text: This repository is unused. Content is stored in the [wiki](https://github.com/ss-irc/notes/wiki)

redpajama_set_name: RedPajamaGithub


text:
package steam

import "time"

const (
	maxRequestsInFlight  = 100
	maxRequestsPerSecond = 100
)

type APIService struct {
	// Limiters for requests in flight and requests per second.
	inFlight  chan struct{}
	perSecond chan struct{}

	request         chan func()
	pendingRequests []func()

	quit chan struct{}
}

func (s *APIService) Start() {
	fillBucket(s.inFlight, maxRequestsInFlight)
	fillBucket(s.perSecond, maxRequestsPerSecond)
	t := time.NewTicker(time.Second)
	for {
		select {
		case <-t.C:
			fillBucket(s.perSecond, maxRequestsPerSecond)
			s.dispatchPendingRequests()

		case req := <-s.request:
			s.pendingRequests = append(s.pendingRequests, req)
			s.dispatchPendingRequests()
		case <-s.quit:
			return
		}
	}
}

func fillBucket(c chan<- struct{}, n int) {
	for i := 0; i < n; i++ {
		select {
		case c <- struct{}{}:
		default:
			return
		}
	}
}

func (s *APIService) dispatchPendingRequests() {
	for len(s.pendingRequests) > 0 {
		select {
		case <-s.inFlight:
		default:
			return
		}
		select {
		case <-s.perSecond:
		default:
			s.inFlight <- struct{}{}
			return
		}
		req := s.pendingRequests[0]
		go func() {
			req()
			s.inFlight <- struct{}{}
		}()
		s.pendingRequests = s.pendingRequests[1:]
	}
}

func (s *APIService) Stop() {
	close(s.quit)
}

func NewAPIService() *APIService {
	service := &APIService{
		inFlight:  make(chan struct{}, maxRequestsInFlight),
		perSecond: make(chan struct{}, maxRequestsPerSecond),
		request:   make(chan func()),
		quit:      make(chan struct{}),
	}
	go service.Start()
	return service
}


text:
"""This module stores the Problem class which is used to solve different types
of analysis.
"""

import os # used to see if there is a results file
import subprocess # used to launch ccx solver

from . import environment
from . import base_classes
from . import results_file

class Problem(base_classes.Idobj):
    """Makes a problem which can be analyzed with Calculix ccx.

    Args:
        - feamodel (FeaModel): the parent FeaModel
        - problem_type (str): model type, options:
            -- 'struct': structural
        - fname (str): file prefix for the problem .inp and results files
            If value is '' it will default to the project name of the FeaModel

    Attributes:
        fea (FeaModel): parent FeaModel
        __ptype (str): problem type, options:

            - 'struct': structural
        solved (bool): boolean storing whether or not the analysis was solved
        fname (str): the problem database and results file prefix
        rfile (Results_File):
            Results_File is loaded in after the model has been solved
    """
    def __init__(self, feamodel, problem_type, fname=''):
        self.fea = feamodel
        self.__ptype = problem_type
        self.solved = False
        if fname == '':
            fname = self.fea.fname
        self.fname = fname
        self.rfile = results_file.ResultsFile(self)
        base_classes.Idobj.__init__(self)
        self.fea.problems.append(self)

    @staticmethod
    def __get_ntxt(nodes):
        """Returns list of strings defining all nodes.

        Args:
            nodes (list): list of all nodes
        """
        res = []
        res.append('*NODE, NSET=nodes')
        for node in nodes:
            res.append(node.ccx())
        print('INFO: %i nodes' % len(nodes))
        return res

    def __get_etxt(self, elements):
        """Returns list of strings defining all elements.

        Args:
            elements (list): list of all elements
        """
        res = []
        ccxtypes = set([e.ccxtype for e in elements])
        eall_written = False
        eall = []
        for ccxtype in ccxtypes:
            setname = ccxtype
            if len(ccxtypes) == 1:
                setname = 'EAll'
                eall_written = True
            res.append('*ELEMENT, TYPE=%s, ELSET=%s' % (ccxtype, setname))
            elist = [e for e in elements if e.ccxtype == ccxtype]
            print('INFO: %i %s elements' % (len(elist), ccxtype))
            for element in elist:
                res.append(element.ccx())
            eall += elist
            print('INFO: %i total elements' % len(eall))
        if eall_written == False:
            tmp = self.__get_eset('EALL', eall)
            res += tmp
        return res

    @staticmethod
    def __get_ctxt(components):
        """Returns list of strings defining all components.

        Args:
            components (list): list of all components
        """
        res = []
        for comp in components:
            res += comp.ccx()
        return res

    @staticmethod
    def __get_eset(name, elements):
        """Returns list of strings defining components of elements.

        Args:
            name (str): component name
            elements (list): list of component elements
        """
        res = []
        items_per_line = 6
        res.append('*ELSET,ELSET='+name)
        grouped_els = base_classes.chunk_list(elements, items_per_line)
        for group in grouped_els:
            item_ids = [str(e.id) for e in group]
            line = ', '.join(item_ids)
            if group != grouped_els[-1]:
                line += ','
            res.append(line)
        return res

    @staticmethod
    def __fix_line(line, fstr):
        """Fixes the line and returns a fixed line.

        Args:
            line (str): line to fix
            fstr (str): format string to use
        """
        items = fstr.split(',')
        node_num_size = int(items[2][1:])
        pre_len = 3 + node_num_size
        # we are missing + prefix on some numbers, some are too long
        start_str = line[:pre_len]
        end_str = line[pre_len:]
        fields = end_str.count('E')
        low_ind = 0
        values = []
        while len(values) < fields:
            high_ind = end_str.find('E', low_ind)+5
            value = float(end_str[low_ind:high_ind])
            values.append(value)
            low_ind = high_ind
        values = ['%12.5e' % val for val in values]
        end_str = ''.join(values)
        new_str = start_str + end_str + '\n'
        return new_str

    def __fix_frd(self):
        """Fixes the frd file on win32 systems. Text formatting fixed

        On win32 Calculix, results file formatting is  not written correctly.
        Nodal results and stresses are not written as fixed length fields.
        """
        if 'win32' in environment.CCX:
            frd_file = self.fname+'.frd'
            lines = []
            try:
                with open(frd_file, "r") as infile:
                    lines = infile.readlines()
                numlines = len(lines)
                ind = 0
                fix = False
                fstr = ''
                while ind < numlines:
                    line = lines[ind]
                    if '1PSTEP' in line:
                        # we are in a results block
                        ind += 1
                        line = lines[ind]
                        format_ = int(line.split()[-1])
                        if format_ == 0:
                            fstr = "1X,I2,I5,6E12.5"
                        elif format_ == 1:
                            fstr = "1X,I2,I10,6E12.5"
                        ind += 1
                        line = lines[ind]
                        if 'DISPR' in line or 'FORCR' in line:
                            ind += 5
                        else:
                            ind += 7
                        fix = True
                        line = lines[ind]
                    if line[:3] == ' -3':
                        fix = False
                    if fix:
                        lines[ind] = self.__fix_line(line, fstr)
                    ind += 1
                with open(frd_file, "w") as outfile:
                    outfile.writelines(lines)
                print('File %s had its formatting fixed!' % frd_file)
            except IOError:
                print('Error reading .frd file!')

    def solve(self):
        """Solves the model in Calculix ccx."""
        inp = []

        # store what results we'll be outputting for each type of analysis
        out_el = {}
        out_el['struct'] = 'E,S' # strain, stress
        out_node = {}
        out_node['struct'] = 'RF,U' # reaction forces, displacement

        if self.__ptype == 'struct':
            # store nodes, elements, components
            box = {}
            box['nodes'] = []
            box['elements'] = []
            box['components'] = set()

            # store all loads in the parts in this model
            load_dict = self.fea.loads

            # store all nodes, elements, and part element sets
            box['nodes'] = self.fea.view.nodes
            box['elements'] = self.fea.view.elements

            # store all node and element components
            for time in load_dict:
                for load in load_dict[time]:
                    if load.ltype not in ['press', 'press_fluid']:
                        box['components'].add(load.comp)
            for contact in self.fea.contacts:
                box['components'].add(contact.master_comp)
                box['components'].add(contact.slave_comp)

            box['nodes'] = self.__get_ntxt(box['nodes'])
            box['elements'] = self.__get_etxt(box['elements'])
            box['components'] = self.__get_ctxt(box['components'])

            # add text definition for nodes, elelents, components
            inp += box['nodes']+['']
            inp += box['elements']+['']
            inp += box['components']+['']

            # read in all materials
            for matl in self.fea.matls:
                inp += matl.ccx()

            # write all steps and loads
            for time in sorted(load_dict.keys()):
                if time == 0.0:
                    # this is for thicknesses and materials
                    for load in load_dict[time]:
                        inp += load.ccx()
                    for surf_interaction in self.fea.surfints:
                        inp += surf_interaction.ccx()
                    for contact in self.fea.contacts:
                        inp += contact.ccx()
                else:
                    # only write times >= 1
                    inp.append('*STEP')
                    inp.append('*STATIC')

                    for load in load_dict[time]:
                        inp += load.ccx()

                    # make output frd file for cgx
                    inp.append('*EL FILE')
                    inp.append(out_el[self.__ptype])
                    inp.append('*NODE FILE')
                    inp.append(out_node[self.__ptype])

                    # make output dat file for integration point results
                    inp.append('*EL PRINT,ELSET=EALL')
                    inp.append('S')

                    # end step
                    inp.append('*END STEP')

            # write CCX inp file to the local directory
            fname = self.fname+'.inp'
            with open(fname, 'w') as outfile:
                for line in inp:
                    #print (line)
                    outfile.write(line+'\n')
            print('File: %s was written' % (fname))

            # run file
            runstr = "%s %s" % (environment.CCX, self.fname)
            print(runstr)
            subprocess.check_call(runstr, shell=True)
            print('Solving done!')

            # select the probem's parts and load the results file
            frd_file = self.fname+'.frd'
            if os.path.isfile(frd_file):
                self.solved = True
                self.__fix_frd()
                self.rfile.load()
            else:
                print('ERROR: results .frd file was not written!')


text:
namespace mojo {

namespace {

// Helper for temporary storage related to |MojoInitialize()| calls.
struct InitializationState {
  InitializationState(const absl::optional<base::FilePath>& path,
                      MojoInitializeFlags flags) {
    options.flags = flags;

    if (path) {
      utf8_path = path->AsUTF8Unsafe();
      options.mojo_core_path = utf8_path.c_str();
      options.mojo_core_path_length = static_cast<uint32_t>(utf8_path.size());
    }

#if defined(OS_POSIX) || defined(OS_FUCHSIA)
    // Build a temporary reconstructed argv to pass into the library so it can
    // inspect the application command line if needed.
    for (const std::string& s : base::CommandLine::ForCurrentProcess()->argv())
      argv.push_back(s.c_str());
    options.argc = static_cast<uint32_t>(argv.size());
    options.argv = argv.data();
#endif
  }

  MojoInitializeOptions options = {sizeof(MojoInitializeOptions)};
  std::string utf8_path;
  std::vector<const char*> argv;
};

}  // namespace

MojoResult LoadCoreLibrary(absl::optional<base::FilePath> path) {
  InitializationState state(path, MOJO_INITIALIZE_FLAG_LOAD_ONLY);
  return MojoInitialize(&state.options);
}

MojoResult InitializeCoreLibrary(MojoInitializeFlags flags) {
  DCHECK_EQ(flags & MOJO_INITIALIZE_FLAG_LOAD_ONLY, 0u);
  InitializationState state(absl::nullopt, flags);
  return MojoInitialize(&state.options);
}

MojoResult LoadAndInitializeCoreLibrary(absl::optional<base::FilePath> path,
                                        MojoInitializeFlags flags) {
  DCHECK_EQ(flags & MOJO_INITIALIZE_FLAG_LOAD_ONLY, 0u);
  InitializationState state(path, flags);
  return MojoInitialize(&state.options);
}

}  // namespace mojo


text:
require 'sharepoint/errors'
require 'sharepoint/client'
require 'sharepoint/spec_helpers'


text:
classdef DF_EbertPrelec < DF1
	%DF_EbertPrelec

	properties (Dependent)

	end

	methods (Access = public)

		function obj = DF_EbertPrelec(varargin)
			obj = obj@DF1(varargin{:});
		end

	end

	methods (Static, Access = protected)

		function y = function_evaluation(x, theta)
			if verLessThan('matlab','9.1')
				y = exp( - bsxfun(@power, bsxfun(@times, theta.k , x ), theta.tau) );
			else
				% use new array broadcasting in 2016b
				y = exp( - (theta.k .* x).^theta.tau );
			end
		end

	end

end


text:
package net.entropysoft.transmorph.signature.formatter;

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

import net.entropysoft.transmorph.signature.ArrayTypeSignature;
import net.entropysoft.transmorph.signature.ClassTypeSignature;
import net.entropysoft.transmorph.signature.PrimitiveTypeSignature;
import net.entropysoft.transmorph.signature.TypeArgSignature;
import net.entropysoft.transmorph.signature.TypeSignature;
import net.entropysoft.transmorph.signature.FullTypeSignature;

/**
 * Format a TypeSignature using the same format than Class.getName()
 *
 * @author Cedric Chabanois (cchabanois at gmail.com)
 *
 */
public class ClassGetNameSignatureFormatter implements ITypeSignatureFormatter {

	private static Map<Character, String> primitiveTypesMap = new HashMap<Character, String>();
	private ClassFileTypeSignatureFormatter typeSignatureFormatter = new ClassFileTypeSignatureFormatter(
			false);

	static {
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_BOOLEAN,
				Boolean.TYPE.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_BYTE, Byte.TYPE
				.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_CHAR,
				Character.TYPE.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_DOUBLE,
				Double.TYPE.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_FLOAT,
				Float.TYPE.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_INT,
				Integer.TYPE.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_LONG, Long.TYPE
				.getName());
		primitiveTypesMap.put(PrimitiveTypeSignature.PRIMITIVE_SHORT,
				Short.TYPE.getName());
	}

	public String format(TypeSignature typeSignature) {
		if (typeSignature.isPrimitiveType()) {
			return format((PrimitiveTypeSignature) typeSignature);
		}
		if (typeSignature.isArrayType()) {
			return format((ArrayTypeSignature) typeSignature);
		}
		if (typeSignature.isClassType()) {
			return format((ClassTypeSignature) typeSignature);
		}
		if (typeSignature.isTypeVar()) {
			// TODO
			// return format((TypeVarSignature) typeSignature);
		}
		if (typeSignature.isTypeArgument()) {
			return format((TypeArgSignature) typeSignature);
		}
		return null;
	}

	private String format(PrimitiveTypeSignature typeSignature) {
		return primitiveTypesMap.get(typeSignature.getPrimitiveTypeChar());
	}

	private String format(ArrayTypeSignature typeSignature) {
		FullTypeSignature typeErasureSignature = typeSignature
				.getTypeErasureSignature();
		return typeSignatureFormatter.format(typeErasureSignature);
	}

	private String format(ClassTypeSignature typeSignature) {
		return typeSignature.getClassName();
	}

	private String format(TypeArgSignature typeSignature) {
		return format(typeSignature.getTypeErasureSignature());
	}

}


text:
"""Script to parse utmp files."""

import argparse
import logging
import os
import sys

from dtformats import output_writers
from dtformats import utmp

def Main():
  """The main program function.

  Returns:
    bool: True if successful or False if not.
  """
  argument_parser = argparse.ArgumentParser(description=(
      'Extracts information from utmp files.'))

  argument_parser.add_argument(
      '-d', '--debug', dest='debug', action='store_true', default=False,
      help='enable debug output.')

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='PATH',
      default=None, help='path of the utmp file.')

  options = argument_parser.parse_args()

  if not options.source:
    print('Source file missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = output_writers.StdoutWriter()

  try:
    output_writer.Open()
  except IOError as exception:
    print(f'Unable to open output writer with error: {exception!s}')
    print('')
    return False

  with open(options.source, 'rb') as file_object:
    file_object.seek(0, os.SEEK_SET)
    utmp_signature = file_object.read(11)

  if utmp_signature == b'utmpx-1.00\x00':
    utmp_file = utmp.MacOSXUtmpxFile(
        debug=options.debug, output_writer=output_writer)
  else:
    utmp_file = utmp.LinuxLibc6UtmpFile(
        debug=options.debug, output_writer=output_writer)

  utmp_file.Open(options.source)

  output_writer.WriteText('utmp information:')

  utmp_file.Close()

  output_writer.WriteText('')
  output_writer.Close()

  return True

if __name__ == '__main__':
  if not Main():
    sys.exit(1)
  else:
    sys.exit(0)


text:
@implementation CALayer(A_Animation)

#pragma mark - Animation Provider
- (void) A_AnimationSet:(NSString*)keypath AnimtionType:(A_AnimationType)type Start:(id)start End:(id)end Duration:(double)duration FPS:(A_AnimationFPS)kps AutoSet:(BOOL)isset{

    NSParameterAssert(keypath);
    NSParameterAssert(type);
    NSParameterAssert(end);

    if (kps<=0) {
        kps = A_AnimationFPS_middle;
    }
    if (!start) {
        start = [self valueForKeyPath:keypath];
    }
    if (duration<=0) {
        duration = defaultDurationTime;
    }

    CAKeyframeAnimation *keyFrames = [A_Animation A_GenerateKeyframe:keypath Type:type Duration:duration FPS:kps Start:start End:end];
    [self addAnimation:keyFrames forKey:nil];

    if (type >= 0 && isset) {
        [self setValue:end forKeyPath:keypath];
    }
}
- (void) A_AnimationSet:(NSString*)keypath AnimtionType:(A_AnimationType)type Start:(id)start End:(id)end Duration:(double)duration FPS:(A_AnimationFPS)kps {
    [self A_AnimationSet:keypath AnimtionType:type Start:start End:end Duration:duration FPS:kps AutoSet:YES];
}
- (void) A_AnimationSet:(NSString*)keypath AnimtionType:(A_AnimationType)type Start:(id)start End:(id)end Duration:(double)duration {
    [self A_AnimationSet:keypath AnimtionType:type Start:start End:end Duration:duration FPS:A_AnimationFPS_high AutoSet:YES];
}
- (void) A_AnimationSet:(NSString*)keypath AnimtionType:(A_AnimationType)type End:(id)end Duration:(double)duration {
    [self A_AnimationSet:keypath AnimtionType:type Start:nil End:end Duration:duration FPS:A_AnimationFPS_high AutoSet:YES];
}
- (void) A_AnimationSet:(NSString*)keypath AnimtionType:(A_AnimationType)type End:(id)end {
    [self A_AnimationSet:keypath AnimtionType:type Start:nil End:end Duration:0 FPS:A_AnimationFPS_high AutoSet:YES];
}

#pragma mark - Setting layer properties
//https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/AnimatableProperties/AnimatableProperties.html
- (void) A_AnimationSetAnchorPoint:(CGPoint)value AnimtionType:(A_AnimationType)type{
    [self A_AnimationSet:@"anchorPoint" AnimtionType:type Start:nil End:[NSValue valueWithCGPoint:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetBackgroundColor:(UIColor*)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"backgroundColor" AnimtionType:type Start:nil End:value Duration:0 FPS:A_AnimationFPS_high AutoSet:NO];
    self.backgroundColor = value.CGColor;
}
- (void) A_AnimationSetOpacity:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"opacity" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetPosition:(CGPoint)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"position" AnimtionType:type Start:nil End:[NSValue valueWithCGPoint:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetPositionX:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"position.x" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetPositionY:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"position.y" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}

- (void) A_AnimationSetBounds:(CGRect)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"bounds" AnimtionType:type Start:nil End:[NSValue valueWithCGRect:value] Duration:0 FPS:A_AnimationFPS_high];
}

- (void) A_AnimationSetBorderWidth:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"borderWidth" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetBorderColor:(UIColor*)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"borderColor" AnimtionType:type Start:nil End:value Duration:0 FPS:A_AnimationFPS_high AutoSet:NO];
    self.borderColor = value.CGColor;
}
- (void) A_AnimationSetContentsRect:(CGRect)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"contentsRect" AnimtionType:type Start:nil End:[NSValue valueWithCGRect:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetCornerRadius:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"cornerRadius" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}

- (void) A_AnimationSetShadowOffset:(CGSize)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"shadowOffset" AnimtionType:type Start:nil End:[NSValue valueWithCGSize:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetShadowOpacity:(CGSize)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"shadowOpacity" AnimtionType:type Start:nil End:[NSValue valueWithCGSize:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetShadowRadius:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"shadowRadius" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetSublayerTransform:(CATransform3D)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"sublayerTransform" AnimtionType:type Start:nil End:[NSValue valueWithCATransform3D:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetTransform:(CATransform3D)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform" AnimtionType:type Start:nil End:[NSValue valueWithCATransform3D:value] Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetZPosition:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"zPosition" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}

#pragma mark - Setting transform elements
//https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/Key-ValueCodingExtensions/Key-ValueCodingExtensions.html

- (void) A_AnimationSetRotationX:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.rotation.x" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetRotationY:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.rotation.y" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetRotationZ:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.rotation.z" AnimtionType:type Start:nil End:@(value*M_PI/180.0) Duration:0 FPS:A_AnimationFPS_high];
}

- (void) A_AnimationSetScaleX:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.scale.x" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetScaleY:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.scale.y" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetScaleZ:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.scale.z" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetScale:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.scale" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}

- (void) A_AnimationSetTranslationX:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.translation.x" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetTranslationY:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.translation.y" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetTranslationZ:(CGFloat)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.translation.z" AnimtionType:type Start:nil End:@(value) Duration:0 FPS:A_AnimationFPS_high];
}
- (void) A_AnimationSetTranslation:(CGSize)value AnimtionType:(A_AnimationType)type {
    [self A_AnimationSet:@"transform.translation" AnimtionType:type Start:nil End:[NSValue valueWithCGSize:value] Duration:0 FPS:A_AnimationFPS_high];
}

#pragma mark - Custom setting
- (void) A_AnimationSetSize:(CGSize)value AnimtionType:(A_AnimationType)type {
    float widthDiff = (value.width - self.bounds.size.width) / 2.0f;
    float hightDiff = (value.height - self.bounds.size.height) / 2.0f;

    CGRect rect = CGRectMake(self.bounds.origin.x - widthDiff , self.bounds.origin.y - hightDiff, self.bounds.size.width + widthDiff, self.bounds.size.height + hightDiff);

    [self A_AnimationSet:@"bounds" AnimtionType:type Start:nil End:[NSValue valueWithCGRect:rect] Duration:0 FPS:A_AnimationFPS_high];
}

@end


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "client_discount".
 *
 * @property integer $id
 * @property integer $id_service
 * @property integer $id_category
 * @property integer $id_type
 * @property string $value
 */
class ClientDiscount extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'client_discount';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id_service', 'id_category', 'id_type'], 'integer'],
            [['value'], 'string', 'max' => 11],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'id_service' => 'Id Service',
            'id_category' => 'Id Category',
            'id_type' => 'Id Type',
            'value' => 'Value',
        ];
    }
}


text:
class RatingImporter
  ################
  # Entry points #
  ################
  def self.update_all_ratings
    # Since the rating scraper is only based on the English Wikipedia 1.0 rating
    # system, we only include articles from en.wiki.
    # If we develop scrapers for other languages that also keep track of ratings
    # via talk page templates, this will need to be overhauled.
    wiki_id = en_wiki.id
    articles = Article.current.live
                      .namespace(0)
                      .where(wiki_id: wiki_id)
                      .find_in_batches(batch_size: 30)
    update_ratings(articles)
  end

  def self.update_new_ratings
    wiki_id = en_wiki.id # English Wikipedia only, see above.
    edited_articles = Article.current
                             .where(rating_updated_at: nil).namespace(0)
                             .where(wiki_id: wiki_id)
                             .find_in_batches(batch_size: 30)
    update_ratings(edited_articles)
    assigned_articles = Article.assigned
                               .where(rating_updated_at: nil).namespace(0)
                               .where(wiki_id: wiki_id)
                               .find_in_batches(batch_size: 30)
    update_ratings(assigned_articles)
  end

  def self.update_rating_for_article(article)
    return unless article.wiki_id == en_wiki.id # English Wikipedia only, see above.
    update_ratings([[article]])
  end

  ##############
  # API Access #
  ##############
  def self.update_ratings(article_groups)
    require './lib/wiki_api'
    article_groups.each do |articles|
      titles = articles.map(&:title)
      # NOTE: English Wikipedia only, per above.
      ratings = WikiApi.new(en_wiki).get_article_rating(titles)
      next if ratings.blank?
      update_article_ratings(articles, ratings)
    end
  end

  ####################
  # Database methods #
  ####################
  def self.update_article_ratings(articles, ratings)
    articles.each do |article|
      article.rating = ratings[article.title]
      article.rating_updated_at = Time.zone.now
    end
    Article.transaction do
      articles.each(&:save)
    end
  end

  ##################
  # Helper methods #
  ##################

  def self.en_wiki
    Wiki.find_by(language: 'en', project: 'wikipedia')
  end
end


text:
@interface BTCQRCodeScannerView : UIView <AVCaptureMetadataOutputObjectsDelegate>
@property (nonatomic, strong) void(^detectionBlock)(NSString* message);
@property (nonatomic, strong) AVCaptureSession *session;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong) dispatch_queue_t sessionQueue;
@property (nonatomic, assign) AVCaptureDevicePosition cameraPosition;
@property (nonatomic, assign) AVCaptureVideoOrientation cameraOrientation;
- (id) initWithDetectionBlock:(void(^)(NSString* message))detectionBlock;
@end
#endif

@implementation BTCQRCode

#if TARGET_OS_IPHONE
+ (UIImage*) imageForURL:(NSURL*)url size:(CGSize)size scale:(CGFloat)scale {
    return [self imageForString:url.absoluteString size:size scale:scale];
}

+ (UIImage*) imageForString:(NSString*)string size:(CGSize)size scale:(CGFloat)scale {
    CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];

    [filter setValue:[string dataUsingEncoding:NSISOLatin1StringEncoding] forKey:@"inputMessage"];
    [filter setValue:@"L" forKey:@"inputCorrectionLevel"];

    UIGraphicsBeginImageContextWithOptions(size, NO, scale);

    CGContextRef context = UIGraphicsGetCurrentContext();
    CGImageRef cgimage = [[CIContext contextWithOptions:nil] createCGImage:filter.outputImage
                                                              fromRect:filter.outputImage.extent];

    UIImage* image = nil;
    if (context) {
        CGContextSetInterpolationQuality(context, kCGInterpolationNone);
        CGContextDrawImage(context, CGContextGetClipBoundingBox(context), cgimage);
        image = [UIImage imageWithCGImage:UIGraphicsGetImageFromCurrentImageContext().CGImage
                                                scale:scale
                                          orientation:UIImageOrientationDownMirrored];
    }

    UIGraphicsEndImageContext();
    CGImageRelease(cgimage);

    return image;
}

+ (UIView*) scannerViewUsingDevice:(AVCaptureDevicePosition) devicePosition
                       orientation:(AVCaptureVideoOrientation) orientation
                             block:(void(^)(NSString* message))detectionBlock {
    BTCQRCodeScannerView *view = [[BTCQRCodeScannerView alloc] initWithDetectionBlock:detectionBlock];
    view.cameraPosition = devicePosition;
    view.cameraOrientation = orientation;
    return view;
}

+ (UIView*) scannerViewWithBlock:(void(^)(NSString* message))detectionBlock {
    return [self scannerViewUsingDevice:AVCaptureDevicePositionUnspecified
                            orientation:0
                                  block:detectionBlock];
}

#endif

@end

#if TARGET_OS_IPHONE
@implementation BTCQRCodeScannerView
@synthesize cameraPosition, cameraOrientation;

- (id) initWithDetectionBlock:(void(^)(NSString* message))detection {
    if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
        self.sessionQueue = dispatch_queue_create("BTCQRCodeScannerView", NULL);
        self.detectionBlock = detection;
        self.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.8];
    }
    return self;
}

- (void) cleanup {
    [self.session removeOutput:self.session.outputs.firstObject];
    self.sessionQueue = nil;
    self.detectionBlock = nil;
    self.session = nil;
}

- (void) didMoveToWindow {
    [super didMoveToWindow];

    if (!self.sessionQueue) return;

    if (self.window) {
        [self prepareScanner];
    } else {
        [self cleanup];
    }
}

- (AVCaptureDevice *)deviceFromPosition:(AVCaptureDevicePosition) position {
    if (position != AVCaptureDevicePositionUnspecified) {
        NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
        for (AVCaptureDevice *device in devices) {
            if ([device position] == position) {
                return device;
            }
        }
    }
    return [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
}

- (void) prepareScanner {
    [self prepareScannerWithDevice:[self deviceFromPosition:self.cameraPosition]];
}

- (void) prepareScannerWithDevice:(AVCaptureDevice *)device {
    NSError *error = nil;
    AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
    AVCaptureMetadataOutput *output = [AVCaptureMetadataOutput new];

    if (!input) {
        NSLog(@"BTCQRCodeScannerView: Failed to instantiate a video device: %@", [error localizedDescription]);
        return;
    }

    if ([device lockForConfiguration:&error]) {
        if (device.isAutoFocusRangeRestrictionSupported) {
            device.autoFocusRangeRestriction = AVCaptureAutoFocusRangeRestrictionNear;
        }

        if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {
            device.focusMode = AVCaptureFocusModeContinuousAutoFocus;
        }

        [device unlockForConfiguration];
    } else {
        NSLog(@"BTCQRCodeScannerView: Failed to lock device for configuration: %@", [error localizedDescription]);
    }

    self.session = [AVCaptureSession new];

    if (input) [self.session addInput:input];

    [self.session addOutput:output];
    [output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];

    if ([output.availableMetadataObjectTypes containsObject:AVMetadataObjectTypeQRCode]) {
        output.metadataObjectTypes = @[ AVMetadataObjectTypeQRCode ];
    } else {
        NSLog(@"BTCQRCodeScannerView: QRCode not found in availableMetadataObjectTypes: %@", output.availableMetadataObjectTypes);
        [self cleanup];
        return;
    }

    self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
    self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
    self.previewLayer.frame = self.layer.bounds;
    [self.layer addSublayer:self.previewLayer];

    dispatch_async(self.sessionQueue, ^{
        [self.session startRunning];

        if (self.cameraOrientation != 0) {
            //Get Preview Layer connection
            AVCaptureConnection *previewLayerConnection=self.previewLayer.connection;
            if ([previewLayerConnection isVideoOrientationSupported])
                [previewLayerConnection setVideoOrientation:self.cameraOrientation];
        }
    });
}

- (void) layoutSubviews
{
    [super layoutSubviews];
    self.previewLayer.frame = self.layer.bounds;
}

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection
{
    for (AVMetadataMachineReadableCodeObject *object in metadataObjects) {
        // Take the first detected QR code.
        if ([object.type isEqual:AVMetadataObjectTypeQRCode]) {
            if (self.detectionBlock) self.detectionBlock(object.stringValue);

            // Do not cleanup - the owner of this view will remove it from window if detection succeeded.

            return;
        }
    }
}

@end
#endif


text:
<!DOCTYPE html>

<title th:text="#{feeMember.title}"></title>
<object th:include="fragments/head :: head" th:remove="tag"></object>

			Create New Pay
				Inscription

List of feeMembers Empty

List of Pay Inscriptions

						Name
						Year
						Price
						Description

						name
						2015
						price
						description

							<form th:action="@{'feeMemberList/feeMemberEdit/'+${feeMember.id}}" method="post">
								<button class="btn-link glyphicon glyphicon-edit pull-right" th:title="#{edit}" id="feeMemberEdit" style="color: orange"></button>
							</form>

							<form th:action="@{'feeMemberList/notification/'+${feeMember.id}}" method="post">
								<button class="btn-link glyphicon glyphicon-envelope pull-right" th:title="#{notification.info}" style="color: brown"></button>
							</form>

							<form th:action="@{'feeMemberList/payMemberList/'+${feeMember.id}}" method="post">
								<button class="btn-link glyphicon glyphicon-user pull-right" th:title="#{feeMember.infoPayMemberList}" id="payMemberList" style="color: green"></button>
							</form>

							<form th:action="@{'feeMemberList/payMemberList/createPdf/'+${feeMember.id}}" method="post">
								<button class="btn-link glyphicon glyphicon-download-alt pull-right" th:name="createPdf" th:value="ALL" th:title="#{feeMember.infoAllList}"></button>
							</form>


text:
// Copyright(c) 2007 Andreas Gullberg Larsen
// https://github.com/angularsen/UnitsNet
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

namespace UnitsNet.Tests.CustomCode
{
    public class ForceChangeRateTests : ForceChangeRateTestsBase
    {
        protected override double NewtonsPerMinuteInOneNewtonPerSecond => 60;
        protected override double DecanewtonsPerMinuteInOneNewtonPerSecond => 6;
        protected override double KilonewtonsPerMinuteInOneNewtonPerSecond => 0.06;
        protected override double KilonewtonsPerSecondInOneNewtonPerSecond => 1E-3;
        protected override double DecanewtonsPerSecondInOneNewtonPerSecond => 1E-1;
        protected override double NewtonsPerSecondInOneNewtonPerSecond => 1;
        protected override double DecinewtonsPerSecondInOneNewtonPerSecond => 1E1;
        protected override double CentinewtonsPerSecondInOneNewtonPerSecond => 1E2;
        protected override double MillinewtonsPerSecondInOneNewtonPerSecond => 1E3;
        protected override double MicronewtonsPerSecondInOneNewtonPerSecond => 1E6;
        protected override double NanonewtonsPerSecondInOneNewtonPerSecond => 1E9;
    }
}


text:
<template>

This is a test element

This is its value: ${ value }

			ix: ${ $index } = ${ number }

</template>


text:
typedef NS_ENUM(NSUInteger, IAElegantButtonType) {
    IAElegantButtonTypeDefault,
    IAElegantButtonTypeDestructive,
    IAElegantButtonTypeCancel,
};

@interface IAElegantButton : UIButton

@property (strong, nonatomic) NSString *buttonTitle;
@property (strong, nonatomic) void (^buttonAction)(void);
@property (nonatomic, readonly) IAElegantButtonType elegantButtonType;

+ (instancetype)buttonWithTitle:(NSString *)title type:(IAElegantButtonType)type baseColor:(UIColor *)baseColor block:(void (^)(void))block;

@end


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

/// <summary>
/// This class handles all the full-screen videos in the launcher.
/// </summary>
public class VideoManager : MonoBehaviour {

    public enum VideoState { Loading, Playing, Stopped }
    public VideoState state = VideoState.Stopped;

    public VideoPlayer player;
    public AudioSource audioSource;
    public string currentVideo;

    /// <summary>
    /// Plays a new video in the background.
    /// </summary>
    /// <param name="newVideo">A VideoClip to play in the background.</param>
    /// <param name="loop">Whether the video should loop.</param>
    /// <param name="audioClip">If there is a audio component to the video.</param>
    /// <returns>Whether it was successful.</returns>
    public void PlayVideo(string url, bool loop, bool playAudio)
    {
        StopVideo();

        if (url != "" && url != null)
        {
            state = VideoState.Loading;

            currentVideo = url;
            player.isLooping = loop;
            audioSource.enabled = playAudio;

            StartCoroutine(playVideo(url));
        }
    }

    /// <summary>
    /// Overloaded method where it assumes that there is no audio with the video.
    /// </summary>
    /// <param name="newVideo"></param>
    /// <param name="loop"></param>
    public void PlayVideo(VideoClip newVideo, bool loop, bool playAudio)
    {
        PlayVideo(newVideo.originalPath, loop, playAudio);
    }

    IEnumerator playVideo(string url)
    {
        //Disable Play on Awake for both Video and Audio
        player.playOnAwake = true;
        audioSource.playOnAwake = true;

        //We want to play from video clip not from url
        player.source = VideoSource.Url;
        player.url = currentVideo;

        //Set video To Play then prepare Audio to prevent Buffering
        player.Prepare();

        GM.Instance.logger.Debug("Preparing Video " + url);

        //Wait until video is prepared
        while (!player.isPrepared)
        {

            yield return null;
        }

        GM.Instance.logger.Debug("Done Preparing Video " + url);

        //Play Video
        state = VideoState.Playing;
        player.Play();

        GM.Instance.logger.Debug("Playing Video " + url);
        while (player.isPlaying)
        {
            // Debug.LogWarning("Video Time: " + Mathf.FloorToInt((float)player.time));
            yield return null;
        }

        GM.Instance.logger.Debug("Done Playing Video " + url);

        state = VideoState.Stopped;
    }

    /// <summary>
    /// Just stops any video that's currently playing.
    /// </summary>
    public void StopVideo()
    {
        player.Stop();
        state = VideoState.Stopped;
    }

    public VideoState GetState()
    {
        return state;
    }

    /// <summary>
    /// Quickly checks to see if the background is playing, and restarts it if it's not.
    /// </summary>
    public void PlayBackground()
    {
        if (player.url != GM.Instance.data.backgroundVideo || !player.isPlaying)
            PlayVideo(GM.Instance.data.backgroundVideo, true, false);
    }
}


text:
define([
    "chaplin",
    "views/base/view",
    "text!templates/index/vehicleDescription.hbs"
], function(Chaplin, View, template){
    var VehicleDescriptionView = View.extend({
        container: "section.index",
        containerMethod: "append",
        autoRender: true,
        autoAttach: true,
        template: template,
        tagName: "div class='car-info'",

        initialize: function(){
            Chaplin.mediator.subscribe("movement", this.updateView, this);
            Chaplin.mediator.subscribe("getStarted", this.clicked, this);
            this.model = this.collection.models[0];
            this.delegate("click", "button", this.clicked);
        },

        clicked: function(){
            $(".car-info").addClass("hidden");
            $(".model-year-form").removeClass("hidden");
        },

        updateView: function(index){
            this.model = this.collection.models[index];
            $(".car-info").removeClass("hidden");
            $(".model-year-form").addClass("hidden");
            this.render();
        },

        getTemplateData: function(){
            return this.model.attributes
        }

    })

    return VehicleDescriptionView;
})


text:
/*******************************************************************************
* File Name     : rza_io_regrw.c
* Device(s)     : RZ/A1H (R7S721001)
* Tool-Chain    : GNUARM-NONEv14.02-EABI
* H/W Platform  : RSK+RZA1H CPU Board
* Description   : Low level register read/write
*******************************************************************************/
/*******************************************************************************
* History       : DD.MM.YYYY Version Description
*               : 21.10.2014 1.00
*******************************************************************************/

/*******************************************************************************
Includes   <System Includes> , "Project Includes"
*******************************************************************************/
/* Default  type definition header */
#include "r_typedefs.h"

/*******************************************************************************
* Function Name: rza_io_reg_write_8
* Description  : IO register 8-bit write
* Arguments    : volatile uint8_t * ioreg : IO register for writing
*              :                          : Use register definition name of the
*              :                          : iodefine.h
*              : uint8_t write_value      : Write value for the IO register
*              : uint8_t shift            : The number of left shifts to the
*              :                          : target bit
*              : uint8_t mask             : Mask value for the IO register
*              :                          : (Target bit : "1")
* Return Value : None
*******************************************************************************/
void rza_io_reg_write_8 (volatile uint8_t * ioreg,
		                         uint8_t write_value,
		                         uint8_t shift,
		                         uint8_t mask)
{
    uint8_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Modify value       */
    reg_value = (uint8_t)((reg_value & (~mask)) | (write_value << shift));

    /* Write to register  */
    (*ioreg)    = reg_value;
}

/*******************************************************************************
* Function Name: rza_io_reg_write_16
* Description  : IO register 16-bit write
* Arguments    : volatile uint16_t * ioreg : IO register for writing
*              :                           : Use register definition name of the
*              :                           : iodefine.h
*              : uint16_t write_value      : Write value for the IO register
*              : uint16_t shift            : The number of left shifts to the
*              :                           : target bit
*              : uint16_t mask             : Mask value for the IO register
*              :                           : (Target bit : "1")
* Return Value : None
*******************************************************************************/
void rza_io_reg_write_16 (volatile uint16_t * ioreg,
		                          uint16_t write_value,
		                          uint16_t shift,
		                          uint16_t mask)
{
    uint16_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Modify value       */
    reg_value = (uint16_t)((reg_value & (~mask)) | (write_value << shift));

    /* Write to register  */
    (*ioreg)    = reg_value;
}

/*******************************************************************************
* Function Name: RZA_IO_RegWrite_32
* Description  : IO register 32-bit write
* Arguments    : volatile uint32_t * ioreg : IO register for writing
*              :                           : Use register definition name of the
*              :                           : iodefine.h
*              : uint32_t write_value      : Write value for the IO register
*              : uint32_t shift            : The number of left shifts to the
*              :                           : target bit
*              : uint32_t mask             : Mask value for the IO register
*              :                           : (Target bit : "1")
* Return Value : None
*******************************************************************************/
void rza_io_reg_write_32 (volatile uint32_t * ioreg, uint32_t write_value,
                                  uint32_t shift,   uint32_t mask)
{
    uint32_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Modify value       */
    reg_value = ((reg_value & (~mask)) | (write_value << shift));

    /* Write to register  */
    (*ioreg)    = reg_value;
}

/*******************************************************************************
* Function Name: rza_io_reg_read_8
* Description  : IO register 8-bit read
* Arguments    : volatile uint8_t * ioreg : IO register for reading
*              :                          : Use register definition name of the
*              :                          : iodefine.h
*              : uint8_t shift            : The number of right shifts to the
*              :                          : target bit
*              : uint8_t mask             : Mask bit for the IO register
*              :                          : (Target bit: "1")
* Return Value : uint8_t : Value of the obtained target bit
*******************************************************************************/
uint8_t rza_io_reg_read_8 (volatile uint8_t * ioreg, uint8_t shift, uint8_t mask)
{
    uint8_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Clear other bit and Bit shift */
    reg_value = (uint8_t)((reg_value & mask) >> shift);

    return (reg_value);
}

/*******************************************************************************
* Function Name: rza_io_reg_read_16
* Description  : IO register 16-bit read
* Arguments    : volatile uint16_t * ioreg : IO register for reading
*              :                           : Use register definition name of the
*              :                           : iodefine.h
*              : uint16_t shift            : The number of right shifts to the
*              :                           : target bit
*              : uint16_t mask             : Mask bit for the IO register
*              :                           : (Target bit: "1")
* Return Value : uint16_t : Value of the obtained target bit
*******************************************************************************/
uint16_t rza_io_reg_read_16 (volatile uint16_t * ioreg,
		                                          uint16_t shift, uint16_t mask)
{
    uint16_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Clear other bit and Bit shift */
    reg_value = (uint16_t)((reg_value & mask) >> shift);

    return (reg_value);
}

/*******************************************************************************
* Function Name: rza_io_reg_read_32
* Description  : IO register 32-bit read
* Arguments    : volatile uint32_t * ioreg : IO register for reading
*              :                           : Use register definition name of the
*              :                           : iodefine.h
*              : uint32_t shift            : The number of right shifts to the
*              :                           : target bit
*              : uint32_t mask             : Mask bit for the IO register
*              :                           : (Target bit: "1")
* Return Value : uint32_t : Value of the obtained target bit
*******************************************************************************/
uint32_t rza_io_reg_read_32 (volatile uint32_t * ioreg, uint32_t shift,
                                                                 uint32_t mask)
{
    uint32_t reg_value;

    /* Read from register */
    reg_value = (*ioreg);

    /* Clear other bit and Bit shift */
    reg_value = ((reg_value & mask) >> shift);

    return (reg_value);
}

/* End of File */


text:
import (
	"net"
	"log"
)

func main() {
	handle, err := net.Listen("tcp", "localhost:3048")
	if err != nil {
		panic("cannot listen")
	}
	for {
		connection, err := handle.Accept()
		if err != nil {
			log.Println("Error handling a connection")
		}
		go handleConnection(connection)
	}
}


text:
namespace Afluistic.MvbaCore
{
    public enum NotificationSeverity
    {
        Error,
        Warning,
        Info
    }
}


text:
package kidstravel.client.modules

import diode.data.Pot
import diode.react.ModelProxy
import diode.react.ReactPot._
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.prefix_<^._
import japgolly.scalajs.react.{BackendScope, Callback, ReactComponentB}
import kidstravel.client.KidsTravelMain.{Loc, NewPoiLoc}
import kidstravel.client.components.Bootstrap.Button
import kidstravel.client.services.GetCity
import kidstravel.shared.geo.City

object CityModule {

  case class Props(cityId: Long, router: RouterCtl[Loc], proxy: ModelProxy[Pot[City]])

  class Backend($: BackendScope[Props, Unit]) {
    def mounted(props: Props) =
      Callback.when(props.proxy().isEmpty)(props.proxy.dispatch(GetCity(props.cityId)))

    def render(props: Props) = {
      val pot = props.proxy()
      <.div(
        pot.renderPending(_ > 10, _ => <.p("Loading …")),
        pot.renderFailed(_ => <.p("Could not load city.")),
        pot.renderReady(city =>
          <.div(
            <.h1(city.name),
            <.div(
              props.router.link(NewPoiLoc)("New point of interest")(
                ^.`class` := "btn"
              )
            )
          )
        )
      )
    }
  }

  val component = ReactComponentB[Props]("City")
    .renderBackend[Backend]
    .componentDidMount(scope => scope.backend.mounted(scope.props))
    .build

  def apply(cityId: Long, router: RouterCtl[Loc], proxy: ModelProxy[Pot[City]]) =
    component(Props(cityId, router, proxy))
}


text:
import numpy as np

from astropy.table import Table
import astropy.units as u

import pytest

from ... import nist

@pytest.mark.remote_data
class TestNist:

    def test_query_async(self):
        response = nist.core.Nist.query_async(4000 * u.nm, 7000 * u.nm)
        assert response is not None

    def test_query(self):
        result = nist.core.Nist.query(4000 * u.nm, 7000 * u.nm)
        assert isinstance(result, Table)

        # check that no javascript was left in the table
        # (regression test for 1355)
        assert np.all(result['TP'] == 'T8637')

    def test_unescape_html(self):
        response = nist.core.Nist.query_async(4333 * u.AA, 4334 * u.AA, "V I")
        assert '†' in response.text
        # check that Unicode characters have been properly unescaped from their
        # raw HTML code equivalents during parsing
        response = nist.core.Nist._parse_result(response)
        assert any('†' in s for s in response['Ei           Ek'])


text:
package alert

import (
	"strconv"
	"sync"
	"testing"
	"time"

	"github.com/libopenstorage/openstorage/api"
	"github.com/libopenstorage/openstorage/pkg/proto/time"
	"github.com/portworx/kvdb"
	"github.com/portworx/kvdb/mem"
	"github.com/sirupsen/logrus"
	"github.com/stretchr/testify/require"
)

var (
	kva             Alert
	nextID          int64
	isWatcherCalled int
	watcherAction   api.AlertActionType
	watcherAlert    api.Alert
	watcherPrefix   string
	watcherKey      string
)

const (
	kvdbDomain     = "openstorage"
	clusterName    = "1"
	newClusterName = "2"
)

func TestAll(t *testing.T) {
	setup(t)
	raiseAndErase(t)
	raiseWithTTL(t)
	subscribe(t)
	retrieve(t)
	clear(t)
	clearWithTTL(t)
	enumerate(t)
	watch(t)
}

func setup(t *testing.T) {
	kv := kvdb.Instance()
	if kv == nil {
		kv, err := kvdb.New(mem.Name, kvdbDomain+"/"+clusterName, []string{}, nil, logrus.Panicf)
		if err != nil {
			t.Fatalf("Failed to set default KV store : (%v): %v", mem.Name, err)
		}
		err = kvdb.SetInstance(kv)
		if err != nil {
			t.Fatalf("Failed to set default KV store: (%v): %v", mem.Name, err)
		}
	}

	var err error
	kva, err = New("alert_kvdb", clusterName, kvdb.Instance())
	if err != nil {
		t.Fatalf("Failed to create new Kvapi.Alert object")
	}
}

func raiseAndErase(t *testing.T) {
	// Raise api.Alert Id : 1
	raiseAlert := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY,
		Message:  "Test Message",
	}
	err := kva.Raise(&raiseAlert)
	require.NoError(t, err, "Failed in raising an alert")

	kv := kva.GetKvdbInstance()
	var alert api.Alert

	_, err = kv.GetVal(
		getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+
			strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.NoError(t, err, "Failed to retrieve alert from kvdb")
	require.NotNil(t, alert, "api.Alert object null in kvdb")
	require.Equal(t, raiseAlert.Id, alert.Id, "api.Alert Id mismatch")
	require.Equal(t, api.ResourceType_RESOURCE_TYPE_VOLUME, alert.Resource, "api.Alert Resource mismatch")
	require.Equal(t, api.SeverityType_SEVERITY_TYPE_NOTIFY, alert.Severity, "api.Alert Severity mismatch")

	// Raise api.Alert with no Resource
	err = kva.Raise(&api.Alert{Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY})
	require.Error(t, err, "An error was expected")
	require.Equal(t, ErrResourceNotFound, err, "Error mismatch")

	// Erase api.Alert Id : 1
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, raiseAlert.Id)
	require.NoError(t, err, "Failed to erase an alert")

	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+"1", &alert)
	require.Error(t, err, "api.Alert not erased from kvdb")
}

func raiseIfNotExistAndErase(t *testing.T) {
	alerts := make([]*api.Alert, 0)
	mtx := &sync.Mutex{}
	alertFn := func() {
		raiseAlert := &api.Alert{
			Resource:   api.ResourceType_RESOURCE_TYPE_VOLUME,
			Severity:   api.SeverityType_SEVERITY_TYPE_NOTIFY,
			Message:    "Test Message",
			ResourceId: "vol1",
			UniqueTag:  "alert_type_1",
		}
		err := kva.RaiseIfNotExist(raiseAlert)
		require.NoError(t, err, "Failed in raising an alert")
		mtx.Lock()
		defer mtx.Unlock()
		alerts = append(alerts, raiseAlert)
	}

	runs := 5
	for i := 0; i < runs; i++ {
		go alertFn()
	}

	require.Equal(t, len(alerts), runs, "alerts")
	for _, a := range alerts {
		require.Equal(t, a.Id, alerts[0].Id, "ids match")
	}

	// Raise an alert for same resource type but different id.
	alerts[1].UniqueTag = "alert_type_2"
	err := kva.RaiseIfNotExist(alerts[1])
	require.NoError(t, err, "Failed in raising an alert")
	require.NotEqual(t, alerts[1].Id, alerts[0].Id, "different resources")

	err = kva.ClearByUniqueTag(api.ResourceType_RESOURCE_TYPE_VOLUME,
		alerts[0].ResourceId, alerts[0].UniqueTag, 2000)
	require.NoError(t, err, "Failed to erase an alert")

	kv := kva.GetKvdbInstance()
	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+
		strconv.FormatInt(alerts[0].Id, 10), alerts[0])
	require.NoError(t, err, "api.Alert erased from kvdb")
	require.True(t, alerts[0].Cleared, "api.Alert erased from kvdb")

	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, alerts[0].Id)
	require.NoError(t, err, "Failed to erase an alert")

	kv = kva.GetKvdbInstance()
	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+
		strconv.FormatInt(alerts[0].Id, 10), alerts[0])
	require.Error(t, err, "api.Alert not erased from kvdb")

	alerts[0].ResourceId = ""
	err = kva.RaiseIfNotExist(alerts[0])
	require.Error(t, err, "resource id missing check")

	alerts[0].UniqueTag = ""
	err = kva.RaiseIfNotExist(alerts[0])
	require.Error(t, err, "resource id missing check")

	// cleanup
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, alerts[1].Id)
	require.NoError(t, err, "Failed to erase an alert")

}

func raiseWithTTL(t *testing.T) {
	raiseAlert := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY,
		Message:  "Test Message",
		Ttl:      2,
	}
	err := kva.Raise(&raiseAlert)
	require.NoError(t, err, "Failed in raising an alert")

	kv := kva.GetKvdbInstance()
	var alert api.Alert

	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.NoError(t, err, "Failed to retrieve alert from kvdb")
	require.NotNil(t, alert, "api.Alert object null in kvdb")

	time.Sleep(3 * time.Second)
	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.Error(t, err, "Alert should have been removed after the ttl value: ", time.Now())
}

func subscribe(t *testing.T) {
	parentAlertType := int64(1)
	child1Alert := api.Alert{
		AlertType: 2,
		Message:   "child 1",
		Resource:  api.ResourceType_RESOURCE_TYPE_DRIVE,
		Severity:  api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	child2Alert := api.Alert{
		AlertType: 3,
		Message:   "child 2",
		Resource:  api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity:  api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	err := kva.Subscribe(parentAlertType, &child1Alert)
	require.NoError(t, err, "Failed to subscribe alert")
	err = kva.Subscribe(2, &child2Alert)
	require.NoError(t, err, "Failed to subscribe alert")

	raiseAlert := api.Alert{
		AlertType: parentAlertType,
		Resource:  api.ResourceType_RESOURCE_TYPE_NODE,
		Severity:  api.SeverityType_SEVERITY_TYPE_NOTIFY,
		Message:   "parent",
	}
	err = kva.Raise(&raiseAlert)
	require.NoError(t, err, "Failed to raise parent alert")

	enAlerts, err := kva.Enumerate(&api.Alert{})
	require.Equal(t, 3, len(enAlerts), "Incorrect number of alerts raised")

	for _, a := range enAlerts {
		err = kva.Erase(a.Resource, a.Id)
	}

	child3Alert := api.Alert{
		AlertType: 4,
		Message:   "child 3",
		Resource:  api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity:  api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	err = kva.Subscribe(parentAlertType, &child3Alert)
	require.NoError(t, err, "Failed to subscribe alert")
	err = kva.Raise(&raiseAlert)
	require.NoError(t, err, "Failed to raise parent alert")

	enAlerts, err = kva.Enumerate(&api.Alert{})
	require.Equal(t, 4, len(enAlerts), "Incorrect number of alerts raised")

	for _, a := range enAlerts {
		err = kva.Erase(a.Resource, a.Id)
	}

}

func retrieve(t *testing.T) {
	var alert *api.Alert

	// Raise a ResourceType_RESOURCE_TYPE_NODE specific api.Alert
	raiseAlert := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_NODE,
		Severity: api.SeverityType_SEVERITY_TYPE_ALARM,
	}
	err := kva.Raise(&raiseAlert)
	//fmt.Printf("Raise err : %s, Raise Id : %d \n", err, raiseAlert.Id)

	alert, err = kva.Retrieve(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert.Id)
	require.NoError(t, err, "Failed to retrieve alert")
	require.NotNil(t, alert, "api.Alert object null")
	require.Equal(t, raiseAlert.Id, alert.Id, "api.Alert Id mismatch")
	require.Equal(t, api.ResourceType_RESOURCE_TYPE_NODE, alert.Resource, "api.Alert resource mismatch")
	require.Equal(t, api.SeverityType_SEVERITY_TYPE_ALARM, alert.Severity, "api.Alert severity mismatch")

	// Retrieve non existing alert
	alert, err = kva.Retrieve(api.ResourceType_RESOURCE_TYPE_VOLUME, 5)
	require.Error(t, err, "Expected an error")

	// Cleanup
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert.Id)
}

func clear(t *testing.T) {
	// Raise an alert
	var alert api.Alert
	kv := kva.GetKvdbInstance()
	raiseAlert := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_NODE,
		Severity: api.SeverityType_SEVERITY_TYPE_ALARM,
	}
	err := kva.Raise(&raiseAlert)

	err = kva.Clear(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert.Id, 0)
	require.NoError(t, err, "Failed to clear alert")

	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_NODE)+strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.Equal(t, true, alert.Cleared, "Failed to clear alert")

	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert.Id)
}

func clearWithTTL(t *testing.T) {
	// Raise an alert
	var alert api.Alert
	kv := kva.GetKvdbInstance()
	raiseAlert := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_NODE,
		Severity: api.SeverityType_SEVERITY_TYPE_ALARM,
	}
	err := kva.Raise(&raiseAlert)

	err = kva.Clear(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert.Id, 2)
	require.NoError(t, err, "Failed to clear alert")

	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_NODE)+strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.Equal(t, true, alert.Cleared, "Failed to clear alert")

	time.Sleep(3 * time.Second)
	_, err = kv.GetVal(getResourceKey(api.ResourceType_RESOURCE_TYPE_NODE)+strconv.FormatInt(raiseAlert.Id, 10), &alert)
	require.Error(t, err, "Cleared Alert should have been removed after the ttl value")
}

func enumerate(t *testing.T) {
	// Raise a few alert
	raiseAlert1 := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	err := kva.Raise(&raiseAlert1)
	raiseAlert2 := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	err = kva.Raise(&raiseAlert2)
	raiseAlert3 := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_VOLUME,
		Severity: api.SeverityType_SEVERITY_TYPE_WARNING,
	}
	err = kva.Raise(&raiseAlert3)
	raiseAlert4 := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_NODE,
		Severity: api.SeverityType_SEVERITY_TYPE_WARNING,
	}
	err = kva.Raise(&raiseAlert4)

	enAlerts, err := kva.Enumerate(&api.Alert{Resource: api.ResourceType_RESOURCE_TYPE_VOLUME})
	require.NoError(t, err, "Failed to enumerate alert")
	require.Equal(t, 3, len(enAlerts), "Enumerated incorrect number of alert")

	enAlerts, err = kva.Enumerate(&api.Alert{Resource: api.ResourceType_RESOURCE_TYPE_VOLUME, Severity: api.SeverityType_SEVERITY_TYPE_WARNING})
	require.NoError(t, err, "Failed to enumerate alert")
	require.Equal(t, 1, len(enAlerts), "Enumerated incorrect number of alert")
	require.Equal(t, api.SeverityType_SEVERITY_TYPE_WARNING, enAlerts[0].Severity, "Severity mismatch")

	enAlerts, err = kva.Enumerate(&api.Alert{})
	require.NoError(t, err, "Failed to enumerate alert")
	require.Equal(t, 4, len(enAlerts), "Enumerated incorrect number of alert")

	enAlerts, err = kva.Enumerate(&api.Alert{Severity: api.SeverityType_SEVERITY_TYPE_WARNING})
	require.NoError(t, err, "Failed to enumerate alert")
	require.Equal(t, 2, len(enAlerts), "Enumerated incorrect number of alert")
	require.Equal(t, api.SeverityType_SEVERITY_TYPE_WARNING, enAlerts[0].Severity, "Severity mismatch")

	// Add a dummy event into kvdb two hours ago
	kv := kva.GetKvdbInstance()
	currentTime := time.Now()
	delayedTime := currentTime.Add(-1 * time.Duration(2) * time.Hour)

	var fakeAlertId int64
	fakeAlertId = 100
	alert := api.Alert{Timestamp: prototime.TimeToTimestamp(delayedTime), Id: fakeAlertId, Resource: api.ResourceType_RESOURCE_TYPE_VOLUME}

	_, err = kv.Put(getResourceKey(api.ResourceType_RESOURCE_TYPE_VOLUME)+strconv.FormatInt(fakeAlertId, 10), &alert, 0)
	enAlerts, err = kva.EnumerateWithinTimeRange(currentTime.Add(-1*time.Duration(10)*time.Second), currentTime, api.ResourceType_RESOURCE_TYPE_VOLUME)
	require.NoError(t, err, "Failed to enumerate results")
	require.Equal(t, 3, len(enAlerts), "Enumerated incorrect number of alert")

	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, raiseAlert1.Id)
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, raiseAlert2.Id)
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, raiseAlert3.Id)
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlert4.Id)
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, fakeAlertId)

	// let's sleep a bit, and validate alerts erasures have been flushed
	time.Sleep(time.Second)
	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_VOLUME, fakeAlertId)
	require.Error(t, err)
	require.Contains(t, err.Error(), "not found", "Expecting cleanup completed successfully")
}

func testAlertWatcher(alert *api.Alert, action api.AlertActionType, prefix string, key string) error {
	// A dummy callback function
	// Setting the global variables so that we can check them in our unit tests
	isWatcherCalled = 1
	if action != api.AlertActionType_ALERT_ACTION_TYPE_DELETE {
		watcherAlert = *alert
	} else {
		watcherAlert = api.Alert{}
	}
	watcherAction = action
	watcherPrefix = prefix
	watcherKey = key
	return nil

}

func watch(t *testing.T) {
	isWatcherCalled = 0

	err := kva.Watch(clusterName, testAlertWatcher)
	require.NoError(t, err, "Failed to subscribe a watch function")

	raiseAlert1 := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_CLUSTER,
		Severity: api.SeverityType_SEVERITY_TYPE_NOTIFY,
	}
	err = kva.Raise(&raiseAlert1)

	// Sleep for sometime so that we pass on some previous watch callbacks
	time.Sleep(time.Second * 1)

	require.Equal(t, 1, isWatcherCalled, "Callback function not called")
	require.Equal(t, api.AlertActionType_ALERT_ACTION_TYPE_CREATE, watcherAction, "action mismatch for create")
	require.Equal(t, raiseAlert1.Id, watcherAlert.Id, "alert id mismatch")
	require.Equal(t, "alert/cluster/"+strconv.FormatInt(raiseAlert1.Id, 10), watcherKey, "key mismatch")

	err = kva.Clear(api.ResourceType_RESOURCE_TYPE_CLUSTER, raiseAlert1.Id, 0)

	// Sleep for sometime so that we pass on some previous watch callbacks
	time.Sleep(time.Millisecond * 100)

	require.Equal(t, api.AlertActionType_ALERT_ACTION_TYPE_UPDATE, watcherAction, "action mismatch for update")
	require.Equal(t, "alert/cluster/"+strconv.FormatInt(raiseAlert1.Id, 10), watcherKey, "key mismatch")

	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_CLUSTER, raiseAlert1.Id)

	// Sleep for sometime so that we pass on some previous watch callbacks
	time.Sleep(time.Millisecond * 100)

	require.Equal(t, api.AlertActionType_ALERT_ACTION_TYPE_DELETE, watcherAction, "action mismatch for delete")
	require.Equal(t, "alert/cluster/"+strconv.FormatInt(raiseAlert1.Id, 10), watcherKey, "key mismatch")

	// Watch on a new clusterID
	isWatcherCalled = 0
	err = kva.Watch(newClusterName, testAlertWatcher)

	// Create a new alert instance for raising an alert in this new cluster id
	kvaNew, err := New("alert_kvdb_test", newClusterName, kvdb.Instance())

	raiseAlertNew := api.Alert{
		Resource: api.ResourceType_RESOURCE_TYPE_NODE,
		Severity: api.SeverityType_SEVERITY_TYPE_ALARM,
	}
	err = kvaNew.Raise(&raiseAlertNew)
	// Sleep for sometime so that we pass on some previous watch callbacks
	time.Sleep(time.Millisecond * 100)

	require.Equal(t, 1, isWatcherCalled, "Callback function not called")
	require.Equal(t, api.AlertActionType_ALERT_ACTION_TYPE_CREATE, watcherAction, "action mismatch for create")
	require.Equal(t, raiseAlertNew.Id, watcherAlert.Id, "alert id mismatch")
	require.Equal(t, "alert/node/"+strconv.FormatInt(raiseAlertNew.Id, 10), watcherKey, "key mismatch")

	err = kva.Erase(api.ResourceType_RESOURCE_TYPE_NODE, raiseAlertNew.Id)
}


text:
using System;
using System.ComponentModel;

namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models
{
    /// <summary> Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. </summary>
    public readonly partial struct ManagedClusterUpgradeCadence : IEquatable<ManagedClusterUpgradeCadence>
    {
        private readonly string _value;

        /// <summary> Initializes a new instance of <see cref="ManagedClusterUpgradeCadence"/>. </summary>
        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
        public ManagedClusterUpgradeCadence(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string Wave0Value = "Wave0";
        private const string Wave1Value = "Wave1";
        private const string Wave2Value = "Wave2";

        /// <summary> Cluster upgrade starts immediately after a new version is rolled out. Recommended for Test/Dev clusters. </summary>
        public static ManagedClusterUpgradeCadence Wave0 { get; } = new ManagedClusterUpgradeCadence(Wave0Value);
        /// <summary> Cluster upgrade starts 7 days after a new version is rolled out. Recommended for Pre-prod clusters. </summary>
        public static ManagedClusterUpgradeCadence Wave1 { get; } = new ManagedClusterUpgradeCadence(Wave1Value);
        /// <summary> Cluster upgrade starts 14 days after a new version is rolled out. Recommended for Production clusters. </summary>
        public static ManagedClusterUpgradeCadence Wave2 { get; } = new ManagedClusterUpgradeCadence(Wave2Value);
        /// <summary> Determines if two <see cref="ManagedClusterUpgradeCadence"/> values are the same. </summary>
        public static bool operator ==(ManagedClusterUpgradeCadence left, ManagedClusterUpgradeCadence right) => left.Equals(right);
        /// <summary> Determines if two <see cref="ManagedClusterUpgradeCadence"/> values are not the same. </summary>
        public static bool operator !=(ManagedClusterUpgradeCadence left, ManagedClusterUpgradeCadence right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="ManagedClusterUpgradeCadence"/>. </summary>
        public static implicit operator ManagedClusterUpgradeCadence(string value) => new ManagedClusterUpgradeCadence(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is ManagedClusterUpgradeCadence other && Equals(other);
        /// <inheritdoc />
        public bool Equals(ManagedClusterUpgradeCadence other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}


text:
/* Included by _internal.c */
#include "_internal.h"

static int
get_string(PyObject *obj, const char **s, const char *type_error_message)
{
    if (!PyString_Check(obj) && obj != Py_None) {
        PyErr_SetString(PyExc_TypeError, type_error_message);
        return -1;
    }
    *s = NULL;
    if (obj != Py_None) {
        *s = PyString_AsString(obj);
        if (*s == NULL)
            return -1;
    }
    return 0;
}

PyObject *
ufunc_fromfunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
    int nin, nout;
    int nfuncs, ntypes, ndata;
    PyObject *func_list;
    PyObject *type_list;
    PyObject *data_list;
    PyObject *func_obj;
    PyObject *type_obj;
    PyObject *data_obj;
    PyObject *object; /* object to hold on to while ufunc is alive */
    PyObject *pyname, *pydoc;
    const char *name = NULL, *doc = NULL;
    char *signature = NULL;
    int identity;

    int i, j;
    int custom_dtype = 0;
    PyUFuncGenericFunction *funcs;
    int *types;
    void **data;
    PyUFuncObject *ufunc;

    if (!PyArg_ParseTuple(args, "OOO!O!iiOOi|s",
                          &pyname, &pydoc,
                          &PyList_Type, &func_list,
                          &PyList_Type, &type_list,
                          &nin, &nout, &data_list,
                          &object, &identity, &signature)) {
        return NULL;
    }
    if (get_string(pyname, &name, "name should be str or None"))
        return NULL;
    if (get_string(pydoc, &doc, "doc should be str or None"))
        return NULL;
    /* Ensure the pointers to C strings stay alive until the ufunc dies. */
    object = PyTuple_Pack(3, object, pyname, pydoc);
    if (!object)
        return NULL;

    nfuncs = PyList_Size(func_list);

    ntypes = PyList_Size(type_list);
    if (ntypes != nfuncs) {
        PyErr_SetString(PyExc_TypeError, "length of types list must be same as length of function pointer list");
        return NULL;
    }

    ndata = PyList_Size(data_list);
    if (ndata != nfuncs) {
        PyErr_SetString(PyExc_TypeError, "length of data pointer list must be same as length of function pointer list");
        return NULL;
    }

    funcs = PyArray_malloc(nfuncs * sizeof(PyUFuncGenericFunction));
    if (funcs == NULL) {
        return NULL;
    }

    /* build function pointer array */
    for (i = 0; i < nfuncs; i++) {
        func_obj = PyList_GetItem(func_list, i);
        /* Function pointers are passed in as long objects.
           Is there a better way to do this? */
        if (PyLong_Check(func_obj)) {
            funcs[i] = (PyUFuncGenericFunction)PyLong_AsVoidPtr(func_obj);
        }
        else {
            PyErr_SetString(PyExc_TypeError, "function pointer must be long object, or None");
            return NULL;
        }
    }

    types = PyArray_malloc(nfuncs * (nin+nout) * sizeof(int));
    if (types == NULL) {
        return NULL;
    }

    /* build function signatures array */
    for (i = 0; i < nfuncs; i++) {
        type_obj = PyList_GetItem(type_list, i);
        if (!type_obj)
            return NULL;

        for (j = 0; j < (nin+nout); j++) {
            int dtype_num;
            PyObject *dtype_num_obj = PyList_GetItem(type_obj, j);
            if (!dtype_num_obj)
                return NULL;

            SENTRY_VALID_LONG(
                types[i*(nin+nout) + j] = PyLong_AsLong(dtype_num_obj)
            );

            dtype_num = PyLong_AsLong(PyList_GetItem(type_obj, j));

            SENTRY_VALID_LONG(dtype_num);

            if (dtype_num >= NPY_USERDEF) {
                custom_dtype = dtype_num;
            }
        }
    }

    data = PyArray_malloc(nfuncs * sizeof(void *));
    if (data == NULL) {
        return NULL;
    }

    /* build function data pointers array */
    for (i = 0; i < nfuncs; i++) {
        if (PyList_Check(data_list)) {
            data_obj = PyList_GetItem(data_list, i);
            if (PyLong_Check(data_obj)) {
                data[i] = PyLong_AsVoidPtr(data_obj);
            }
            else if (data_obj == Py_None) {
                data[i] = NULL;
            }
            else {
                PyErr_SetString(PyExc_TypeError, "data pointer must be long object, or None");
                return NULL;
            }
        }
        else if (data_list == Py_None) {
            data[i] = NULL;
        }
        else {
            PyErr_SetString(PyExc_TypeError, "data pointers argument must be a list of void pointers, or None");
            return NULL;
        }
    }

    if (!custom_dtype) {
        char *char_types = PyArray_malloc(nfuncs * (nin+nout) * sizeof(char));
        for (i = 0; i < nfuncs; i++) {
            for (j = 0; j < (nin+nout); j++) {
                char_types[i*(nin+nout) + j] = (char)types[i*(nin+nout) + j];
            }
        }
        PyArray_free(types);
        ufunc = (PyUFuncObject *) PyUFunc_FromFuncAndDataAndSignature(
            (PyUFuncGenericFunction*) funcs, data, (char*) char_types,
            nfuncs, nin, nout,
            identity,
            name, doc,
            0 /* check_return */, signature);
        if (!ufunc) {
            PyArray_free(funcs);
            PyArray_free(data);
            Py_DECREF(object);
            return NULL;
        }
        /* XXX funcs, char_types and data won't be free'ed when the ufunc dies */
    }
    else {
        ufunc = (PyUFuncObject *) PyUFunc_FromFuncAndDataAndSignature(
            0, 0, 0, 0,
            nin,
            nout,
            identity,
            name, doc,
            0 /* check_return */, signature);
        if (!ufunc) {
            PyArray_free(funcs);
            PyArray_free(data);
            PyArray_free(types);
            Py_DECREF(object);
            return NULL;
        }

        PyUFunc_RegisterLoopForType(ufunc,
                                    custom_dtype,
                                    funcs[0],
                                    types,
                                    0);
        PyArray_free(funcs);
        PyArray_free(types);
        PyArray_free(data);
        funcs = NULL;
        data = NULL;
    }

    /* Create the sentinel object to clean up dynamically-allocated fields
       when the ufunc is destroyed. */
    ufunc->obj = cleaner_new(ufunc, object);
    Py_DECREF(object);
    if (ufunc->obj == NULL) {
        PyArray_free(funcs);
        PyArray_free(data);
        Py_DECREF(ufunc);
        return NULL;
    }

    return (PyObject *) ufunc;
}


text:
module Spree
  ProductProperty.class_eval do
    has_paper_trail
  end
end


text:
namespace Evelyn.Server.Host
{
    using System;
    using EventStore.ClientAPI;
    using Storage.EventStore;

    public class EventStoreConnectionFactory : IEventStoreConnectionFactory
    {
        private readonly ConnectionSettings _connectionSettings;
        private readonly Uri _uri;
        private readonly string _connectionName;

        public EventStoreConnectionFactory(string uri, string connectionName = "Evelyn.Server.Host")
        {
            _connectionSettings = ConnectionSettings.Create()
                ////.EnableVerboseLogging()
                .UseConsoleLogger()
                .KeepReconnecting()
                .Build();
            _uri = new Uri(uri);
            _connectionName = connectionName;
        }

        public IEventStoreConnection Invoke()
        {
            return EventStoreConnection.Create(_connectionSettings, _uri, _connectionName);
        }
    }
}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?>
<current_observation version="1.0"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
	<credit>NOAA's National Weather Service</credit>
	<credit_URL>http://weather.gov/</credit_URL>
	<image>
		<url>http://weather.gov/images/xml_logo.gif</url>
		<title>NOAA's National Weather Service</title>
		<link>http://weather.gov</link>
	</image>
	<suggested_pickup>15 minutes after the hour</suggested_pickup>
	<suggested_pickup_period>60</suggested_pickup_period>
	<location>Unknown Station</location>
	<station_id>CXZC</station_id>
	<observation_time>Last Updated on Jan 5 2016, 2:00 am ST </observation_time>
        <observation_time_rfc822>Tue, 05 Jan 2016 02:00:00 +0000</observation_time_rfc822>
	<temperature_string>3.0 F (-16.1 C)</temperature_string>
	<temp_f>3.0</temp_f>
	<temp_c>-16.1</temp_c>
	<relative_humidity>79</relative_humidity>
	<wind_string>from the Southwest at 6.9 gusting to 17.3 MPH (6 gusting to 15 KT)</wind_string>
	<wind_dir>Southwest</wind_dir>
	<wind_degrees>210</wind_degrees>
	<wind_mph>6.9</wind_mph>
	<wind_gust_mph>17.3</wind_gust_mph>
	<wind_kt>6</wind_kt>
	<wind_gust_kt>15</wind_gust_kt>
	<pressure_string>1026.0 mb</pressure_string>
	<pressure_mb>1026.0</pressure_mb>
	<dewpoint_string>-2.0 F (-18.9 C)</dewpoint_string>
	<dewpoint_f>-2.0</dewpoint_f>
	<dewpoint_c>-18.9</dewpoint_c>
	<windchill_string>-9 F (-23 C)</windchill_string>
      	<windchill_f>-9</windchill_f>
      	<windchill_c>-23</windchill_c>
	<two_day_history_url>http://www.weather.gov/data/obhistory/CXZC.html</two_day_history_url>
	<ob_url>http://www.weather.gov/data/METAR/CXZC.1.txt</ob_url>
	<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
	<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
	<privacy_policy_url>http://weather.gov/notice.html</privacy_policy_url>
</current_observation>


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

#pragma once

#include "pal_types.h"

struct UTimBuf
{
    int64_t AcTime;
    int64_t ModTime;
};

/**
 * Sets the last access and last modified time of a file
 *
 * Returns 0 on success; otherwise, returns -1 and errno is set.
 */
extern "C" int32_t UTime(const char* path, UTimBuf* time);


text:
import Editor from '../../core/editor';
import Emitter from '../../core/emitter';
import Selection from '../../core/selection';
import Scroll from '../../blots/scroll';
import Quill from '../../core/quill';
import equal from 'deep-equal';

let div = document.createElement('div');
div.id = 'test-container';
document.body.appendChild(div);

window.onerror = function(msg) {
  return (msg === 'Script error.');
};

beforeEach(function() {
  jasmine.addMatchers({
    toEqualHTML: function() {
      return { compare: compareHTML }
    },
    toBeApproximately: function() {
      return { compare: compareApproximately }
    }
  });

  div.innerHTML = '

';
  this.container = div.firstChild;
  this.initialize = initialize.bind(this);
});

function compareApproximately(actual, expected, tolerance) {
  let pass = Math.abs(actual - expected) <= tolerance;
  return {
    pass: pass,
    message: `${actual} is ${(pass ? '' : 'not')} approximately ${expected}`
  };
}

function compareHTML(actual, expected, ignoreClassId) {
  let [div1, div2] = [actual, expected].map(function(html) {
    if (html instanceof HTMLElement) {
      html = html.innerHTML;
    }
    let div = document.createElement('div');
    div.innerHTML = html.replace(/\n\s*/g, '');
    return div;
  });
  let ignoredAttributes = ['width', 'height'];
  if (ignoreClassId) {
    ignoredAttributes = ignoredAttributes.concat(['class', 'id']);
  }
  let message = compareNodes(div1, div2, ignoredAttributes)
  if (message != null) {
    console.error(div1.innerHTML);  // eslint-disable-line no-console
    console.error(div2.innerHTML);  // eslint-disable-line no-console
    return { pass: false, message: message };
  } else {
    return { pass: true, message: 'HTMLs equal' };
  }
}

function compareNodes(node1, node2, ignoredAttributes = []) {
  if (node1.nodeType !== node2.nodeType) {
    return `Expected nodeType '${node1.nodeType}' to equal '${node2.nodeType}'`;
  }
  if (node1.nodeType === node1.ELEMENT_NODE) {
    if (node1.tagName !== node2.tagName) {
      return `Expected tagName '${node1.tagName}' to equal '${node2.tagName}'`;
    }
    let [attr1, attr2] = [node1, node2].map(function(node) {
      return [].reduce.call(node.attributes || {}, function(attr, elem) {
        if (ignoredAttributes.indexOf(elem.name) < 0) {
          attr[elem.name] = elem.name === 'style' ? elem.value.trim() : elem.value;
        }
        return attr;
      }, {});
    });
    if (!equal(attr1, attr2)) {
      return `Expected attributes ${jasmine.pp(attr1)} to equal ${jasmine.pp(attr2)}`;
    }
    if (node1.childNodes.length !== node2.childNodes.length) {
      return `Expected node childNodes length '${node1.childNodes.length}' to equal '${node2.childNodes.length}'`;
    }
    if (node1.childNodes.length === 0) return null;
    let message = '';
    if ([].some.call(node1.childNodes, function(child1, i) {
      message = compareNodes(child1, node2.childNodes[i], ignoredAttributes);
      return message;
    })) {
      return message;
    }
  } else if (node1.data !== node2.data) {
    return `Expected node text '${node1.data}' to equal '${node2.data}'`;
  }
  return null;
}

function initialize(klass, html, container = this.container) {
  if (typeof html === 'object') {
    container.innerHTML = html.html;
  } else {
    container.innerHTML = html.replace(/\n\s*/g, '');
  }
  if (klass === HTMLElement) return container;
  if (klass === Quill) return new Quill(container);
  let emitter = new Emitter();
  let scroll = new Scroll(container, { emitter: emitter });
  if (klass === Scroll) return scroll;
  if (klass === Editor) return new Editor(scroll);
  if (klass === Selection) return new Selection(scroll, emitter);
  if (klass[0] === Editor && klass[1] === Selection) {
    return [new Editor(scroll), new Selection(scroll, emitter)];
  }
}


text:
//
//  ALAdService.h
//  sdk
//
//  Created by Basil on 2/27/12.
//  Copyright (c) 2013, AppLovin Corporation. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ALAnnotations.h"

#import "ALAd.h"
#import "ALAdSize.h"
#import "ALAdLoadDelegate.h"
#import "ALAdDisplayDelegate.h"
#import "ALAdUpdateDelegate.h"
#import "ALAdVideoPlaybackDelegate.h"

AL_ASSUME_NONNULL_BEGIN

/**
 * This class is responsible for providing and displaying ads.
 */
@interface ALAdService : NSObject

/**
 * @name Loading and Preloading Ads
 */

/**
 * Fetch a new ad, of a given size, notifying a supplied delegate on completion.
 *
 * @param adSize    Size of an ad to load. Must not be nil.
 * @param delegate  A callback to notify of the fact that the ad is loaded.
 */
- (void)loadNextAd:(ALAdSize *)adSize andNotify:(id<ALAdLoadDelegate>)delegate;

/**
 * Fetch a new ad, for a given zone, notifying a supplied delegate on completion.
 *
 * @param zoneIdentifier  The identifier of the zone to load an ad for. Must not be nil.
 * @param delegate        A callback to notify of the fact that the ad is loaded.
 */
- (void)loadNextAdForZoneIdentifier:(NSString *)zoneIdentifier andNotify:(id<ALAdLoadDelegate>)delegate;

/**
 * @name Observing Ad Rotations
 */

/**
 * Add an observer of updates of advertisements of a given size.
 *
 *  @param adListener  Listener to add
 *  @param adSize      Size of ads that the listener is interested in
 */
- (void)addAdUpdateObserver:(id <ALAdUpdateObserver>)adListener ofSize:(ALAdSize *)adSize;

/**
 * Remove an observer of updates of advertisements of a given size.
 *
 *  @param adListener  Listener to modify
 *  @param adSize      Size of ads that the listener should no longer receive notifications about
 */
- (void)removeAdUpdateObserver:(id <ALAdUpdateObserver>)adListener ofSize:(ALAdSize *)adSize;

- (id)init __attribute__((unavailable("Don't instantiate ALAdService, access one via [sdk adService] instead.")));

@end

@interface ALAdService(ALMultizoneSupport)

/**
 * Generates a token used for advanced header bidding.
 */
@property (nonatomic, copy, readonly) NSString *bidToken;

/**
 * Fetch a new ad for the given ad token. Provided ad token must be received from AppLovin S2S API.
 *
 * Please note: this method is designed to be called by SDK mediation providers. Please use
 * loadNextAdForZoneIdentifier:andNotify: for regular integrations.
 *
 * @param adToken   Ad token returned from AppLovin S2S API. Must not be nil.
 * @param delegate  A callback to notify that the ad has been loaded. Must not be nil.
 */
- (void)loadNextAdForAdToken:(NSString *)adToken andNotify:(id<ALAdLoadDelegate>)delegate;

/**
 * Fetch a new ad for any of the provided zone identifiers.
 *
 * Please note: this method is designed to be called by SDK mediation providers. Please use
 * loadNextAdForZoneIdentifier:andNotify: for regular integrations.
 *
 * @param zoneIdentifiers  An array of zone identifiers for which an ad should be loaded. Must not be nil.
 * @param delegate         A callback to notify that the ad has been loaded. Must not be nil.
 */
- (void)loadNextAdForZoneIdentifiers:(NSArray<NSString *> *)zoneIdentifiers andNotify:(id<ALAdLoadDelegate>)delegate;

@end

@interface ALAdService(ALDeprecated)
- (void)preloadAdOfSize:(ALAdSize *)adSize __deprecated_msg("Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use [ALAdService loadNextAd:andNotify:] to load ads to display.");
- (void)preloadAdForZoneIdentifier:(NSString *)zoneIdentifier __deprecated_msg("Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use [ALAdService loadNextAdForZoneIdentifier:andNotify:] to load ads to display.");
- (BOOL)hasPreloadedAdOfSize:(ALAdSize *)adSize __deprecated_msg("Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use [ALAdService loadNextAd:andNotify:] to load ads to display.");
- (BOOL)hasPreloadedAdForZoneIdentifier:(NSString *)zoneIdentifier __deprecated_msg("Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use [ALAdService loadNextAdForZoneIdentifier:andNotify:] to load ads to display.");
@end

/**
 * This is an endpoint name for custom AppLovin URL for forcing
 * container to load the next ad:
 *

 *        applovin://com.applovin.sdk/adservice/next_ad
 *

 */
extern NSString *const ALSdkUriNextAd;

/**
 * This is an endpoint name for custom AppLovin URL for forcing
 * ad container to close itself:
 *

 *        applovin://com.applovin.sdk/adservice/close_ad
 *

 */
extern NSString *const ALSdkCloseAd;

/**
 * This is an endpoint name for custom AppLovin URL for forcing
 * ad container to expland itself (using MRAID mechanism)
 *

 *        applovin://com.applovin.sdk/adservice/expand_ad
 *

 */
extern NSString *const ALSdkExpandAd;

/**
 * This is an endpoint name for custom AppLovin URL for forcing
 * an ad expanded before using ALSdkUriExpandAd contract back
 *

 *        applovin://com.applovin.sdk/adservice/contract_ad
 *

 */
extern NSString *const ALSdkContractAd;

AL_ASSUME_NONNULL_END


text:
@interface NSColor(NSColorHexadecimalValue)
-(NSString *)hexadecimalValueOfAnNSColor;
+ (NSColor *) colorFromHexRGB:(NSString *) inColorString;
@end