text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.administrator.behaviordemo">
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:name=".MyApplications"
        android:theme="@style/MDTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".activity.JanshuActivity"/>
        <activity android:name=".activity.EasyBehaviorActivity"/>
        <activity android:name=".activity.ToolBarActivity"/>
        <activity android:name=".activity.WindowActivity"/>
        <activity android:name=".activity.StausBarBiewActivity"/>
        <activity android:name=".activity.StausBarBiewActivity2"/>
        <activity android:name=".activity.AppbarLayoutActivity"/>
    </application>

</manifest>


text:
NS_ASSUME_NONNULL_BEGIN

@interface DWSecurityStatusView : UIView

@property (nonatomic, assign) DWSecurityLevel securityLevel;

@end

NS_ASSUME_NONNULL_END

redpajama_set_name: RedPajamaGithub


text:
export type FilterByKey<T, K extends string> = T extends Record<K, unknown>
  ? T
  : T extends Partial<Record<K, unknown>>
  ? T & { [key in K]: T[K] }
  : never;

export type RequiredKeys<T, K extends keyof T, V extends keyof T = never> = T &
  Required<Pick<T, K | V>> & { [key in V]: Required<T[V]> };


text:
namespace mlir {
namespace spirv {

enum class Decoration : uint32_t;

class SPIRVDialect : public Dialect {
public:
  explicit SPIRVDialect(MLIRContext *context);

  static StringRef getDialectNamespace() { return "spv"; }

  /// Checks if the given `type` is valid in SPIR-V dialect.
  static bool isValidType(Type type);

  /// Checks if the given `scalar type` is valid in SPIR-V dialect.
  static bool isValidScalarType(Type type);

  /// Returns the attribute name to use when specifying decorations on results
  /// of operations.
  static std::string getAttributeName(Decoration decoration);

  /// Parses a type registered to this dialect.
  Type parseType(DialectAsmParser &parser) const override;

  /// Prints a type registered to this dialect.
  void printType(Type type, DialectAsmPrinter &os) const override;

  /// Provides a hook for materializing a constant to this dialect.
  Operation *materializeConstant(OpBuilder &builder, Attribute value, Type type,
                                 Location loc) override;
};

} // end namespace spirv
} // end namespace mlir

#endif // MLIR_DIALECT_SPIRV_SPIRVDIALECT_H_


text:
import { Injectable }     from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs';
import { Project } from '../common/project';

@Injectable()
export class ProjectSearchService {
    constructor(private http: Http) {}
    search(term: string): Observable<Project[]> {
        return this.http
            .get(`app/project/?name=${term}`)
            .map((r: Response) => r.json().data as Project[]);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>ReffLaw -</title>

    <link rel="stylesheet" href="css/framework7.min.css">

    <link rel="stylesheet" href="css/my-app.css">

Article V

IL 501

General Rule

Except as otherwise required by the Constitution of the United States, the Constitution of Illinois, or provided by applicable statute or rule prescribed by the Supreme Court, the privilege of a witness, person, government, state, or political subdivision thereof shall be governed by the principles of the common law as they may be interpreted by Illinois courts in the light of reason and experience.


text:
"""
Fine-tuning the library models for multiple choice.
"""
# You can also adapt this script on your own multiple choice task. Pointers for this are left as comments.

import logging
import os
import sys
from dataclasses import dataclass, field
from itertools import chain
from typing import Optional, Union

import datasets
import numpy as np
import torch
from datasets import load_dataset

import transformers
from transformers import (
    AutoConfig,
    AutoModelForMultipleChoice,
    AutoTokenizer,
    HfArgumentParser,
    Trainer,
    TrainingArguments,
    default_data_collator,
    set_seed,
)
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
from transformers.trainer_utils import get_last_checkpoint
from transformers.utils import PaddingStrategy, check_min_version, send_example_telemetry

# Will error if the minimal version of Transformers is not installed. Remove at your own risks.
check_min_version("4.25.0.dev0")

logger = logging.getLogger(__name__)

@dataclass
class ModelArguments:
    """
    Arguments pertaining to which model/config/tokenizer we are going to fine-tune from.
    """

    model_name_or_path: str = field(
        metadata={"help": "Path to pretrained model or model identifier from huggingface.co/models"}
    )
    config_name: Optional[str] = field(
        default=None, metadata={"help": "Pretrained config name or path if not the same as model_name"}
    )
    tokenizer_name: Optional[str] = field(
        default=None, metadata={"help": "Pretrained tokenizer name or path if not the same as model_name"}
    )
    cache_dir: Optional[str] = field(
        default=None,
        metadata={"help": "Where do you want to store the pretrained models downloaded from huggingface.co"},
    )
    use_fast_tokenizer: bool = field(
        default=True,
        metadata={"help": "Whether to use one of the fast tokenizer (backed by the tokenizers library) or not."},
    )
    model_revision: str = field(
        default="main",
        metadata={"help": "The specific model version to use (can be a branch name, tag name or commit id)."},
    )
    use_auth_token: bool = field(
        default=False,
        metadata={
            "help": (
                "Will use the token generated when running `huggingface-cli login` (necessary to use this script "
                "with private models)."
            )
        },
    )

@dataclass
class DataTrainingArguments:
    """
    Arguments pertaining to what data we are going to input our model for training and eval.
    """

    train_file: Optional[str] = field(default=None, metadata={"help": "The input training data file (a text file)."})
    validation_file: Optional[str] = field(
        default=None,
        metadata={"help": "An optional input evaluation data file to evaluate the perplexity on (a text file)."},
    )
    overwrite_cache: bool = field(
        default=False, metadata={"help": "Overwrite the cached training and evaluation sets"}
    )
    preprocessing_num_workers: Optional[int] = field(
        default=None,
        metadata={"help": "The number of processes to use for the preprocessing."},
    )
    max_seq_length: Optional[int] = field(
        default=None,
        metadata={
            "help": (
                "The maximum total input sequence length after tokenization. If passed, sequences longer "
                "than this will be truncated, sequences shorter will be padded."
            )
        },
    )
    pad_to_max_length: bool = field(
        default=False,
        metadata={
            "help": (
                "Whether to pad all samples to the maximum sentence length. "
                "If False, will pad the samples dynamically when batching to the maximum length in the batch. More "
                "efficient on GPU but very bad for TPU."
            )
        },
    )
    max_train_samples: Optional[int] = field(
        default=None,
        metadata={
            "help": (
                "For debugging purposes or quicker training, truncate the number of training examples to this "
                "value if set."
            )
        },
    )
    max_eval_samples: Optional[int] = field(
        default=None,
        metadata={
            "help": (
                "For debugging purposes or quicker training, truncate the number of evaluation examples to this "
                "value if set."
            )
        },
    )

    def __post_init__(self):
        if self.train_file is not None:
            extension = self.train_file.split(".")[-1]
            assert extension in ["csv", "json"], "`train_file` should be a csv or a json file."
        if self.validation_file is not None:
            extension = self.validation_file.split(".")[-1]
            assert extension in ["csv", "json"], "`validation_file` should be a csv or a json file."

@dataclass
class DataCollatorForMultipleChoice:
    """
    Data collator that will dynamically pad the inputs for multiple choice received.

    Args:
        tokenizer ([`PreTrainedTokenizer`] or [`PreTrainedTokenizerFast`]):
            The tokenizer used for encoding the data.
        padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `True`):
            Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
            among:

            - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence
              if provided).
            - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
              acceptable input length for the model if that argument is not provided.
            - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
              lengths).
        max_length (`int`, *optional*):
            Maximum length of the returned list and optionally padding length (see above).
        pad_to_multiple_of (`int`, *optional*):
            If set will pad the sequence to a multiple of the provided value.

            This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >=
            7.5 (Volta).
    """

    tokenizer: PreTrainedTokenizerBase
    padding: Union[bool, str, PaddingStrategy] = True
    max_length: Optional[int] = None
    pad_to_multiple_of: Optional[int] = None

    def __call__(self, features):
        label_name = "label" if "label" in features[0].keys() else "labels"
        labels = [feature.pop(label_name) for feature in features]
        batch_size = len(features)
        num_choices = len(features[0]["input_ids"])
        flattened_features = [
            [{k: v[i] for k, v in feature.items()} for i in range(num_choices)] for feature in features
        ]
        flattened_features = list(chain(*flattened_features))

        batch = self.tokenizer.pad(
            flattened_features,
            padding=self.padding,
            max_length=self.max_length,
            pad_to_multiple_of=self.pad_to_multiple_of,
            return_tensors="pt",
        )

        # Un-flatten
        batch = {k: v.view(batch_size, num_choices, -1) for k, v in batch.items()}
        # Add back labels
        batch["labels"] = torch.tensor(labels, dtype=torch.int64)
        return batch

def main():
    # See all possible arguments in src/transformers/training_args.py
    # or by passing the --help flag to this script.
    # We now keep distinct sets of args, for a cleaner separation of concerns.

    parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
    if len(sys.argv) == 2 and sys.argv[1].endswith(".json"):
        # If we pass only one argument to the script and it's the path to a json file,
        # let's parse it to get our arguments.
        model_args, data_args, training_args = parser.parse_json_file(json_file=os.path.abspath(sys.argv[1]))
    else:
        model_args, data_args, training_args = parser.parse_args_into_dataclasses()

    # Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
    # information sent is the one passed as arguments along with your Python/PyTorch versions.
    send_example_telemetry("run_swag", model_args, data_args)

    # Setup logging
    logging.basicConfig(
        format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
        datefmt="%m/%d/%Y %H:%M:%S",
        handlers=[logging.StreamHandler(sys.stdout)],
    )
    log_level = training_args.get_process_log_level()
    logger.setLevel(log_level)
    datasets.utils.logging.set_verbosity(log_level)
    transformers.utils.logging.set_verbosity(log_level)
    transformers.utils.logging.enable_default_handler()
    transformers.utils.logging.enable_explicit_format()

    # Log on each process the small summary:
    logger.warning(
        f"Process rank: {training_args.local_rank}, device: {training_args.device}, n_gpu: {training_args.n_gpu}"
        + f"distributed training: {bool(training_args.local_rank != -1)}, 16-bits training: {training_args.fp16}"
    )
    logger.info(f"Training/evaluation parameters {training_args}")

    # Detecting last checkpoint.
    last_checkpoint = None
    if os.path.isdir(training_args.output_dir) and training_args.do_train and not training_args.overwrite_output_dir:
        last_checkpoint = get_last_checkpoint(training_args.output_dir)
        if last_checkpoint is None and len(os.listdir(training_args.output_dir)) > 0:
            raise ValueError(
                f"Output directory ({training_args.output_dir}) already exists and is not empty. "
                "Use --overwrite_output_dir to overcome."
            )
        elif last_checkpoint is not None and training_args.resume_from_checkpoint is None:
            logger.info(
                f"Checkpoint detected, resuming training at {last_checkpoint}. To avoid this behavior, change "
                "the `--output_dir` or add `--overwrite_output_dir` to train from scratch."
            )

    # Set seed before initializing model.
    set_seed(training_args.seed)

    # Get the datasets: you can either provide your own CSV/JSON/TXT training and evaluation files (see below)
    # or just provide the name of one of the public datasets available on the hub at https://huggingface.co/datasets/
    # (the dataset will be downloaded automatically from the datasets Hub).

    # For CSV/JSON files, this script will use the column called 'text' or the first column if no column called
    # 'text' is found. You can easily tweak this behavior (see below).

    # In distributed training, the load_dataset function guarantee that only one local process can concurrently
    # download the dataset.
    if data_args.train_file is not None or data_args.validation_file is not None:
        data_files = {}
        if data_args.train_file is not None:
            data_files["train"] = data_args.train_file
        if data_args.validation_file is not None:
            data_files["validation"] = data_args.validation_file
        extension = data_args.train_file.split(".")[-1]
        raw_datasets = load_dataset(
            extension,
            data_files=data_files,
            cache_dir=model_args.cache_dir,
            use_auth_token=True if model_args.use_auth_token else None,
        )
    else:
        # Downloading and loading the swag dataset from the hub.
        raw_datasets = load_dataset(
            "swag",
            "regular",
            cache_dir=model_args.cache_dir,
            use_auth_token=True if model_args.use_auth_token else None,
        )
    # See more about loading any type of standard or custom dataset (from files, python dict, pandas DataFrame, etc) at
    # https://huggingface.co/docs/datasets/loading_datasets.html.

    # Load pretrained model and tokenizer

    # Distributed training:
    # The .from_pretrained methods guarantee that only one local process can concurrently
    # download model & vocab.
    config = AutoConfig.from_pretrained(
        model_args.config_name if model_args.config_name else model_args.model_name_or_path,
        cache_dir=model_args.cache_dir,
        revision=model_args.model_revision,
        use_auth_token=True if model_args.use_auth_token else None,
    )
    tokenizer = AutoTokenizer.from_pretrained(
        model_args.tokenizer_name if model_args.tokenizer_name else model_args.model_name_or_path,
        cache_dir=model_args.cache_dir,
        use_fast=model_args.use_fast_tokenizer,
        revision=model_args.model_revision,
        use_auth_token=True if model_args.use_auth_token else None,
    )
    model = AutoModelForMultipleChoice.from_pretrained(
        model_args.model_name_or_path,
        from_tf=bool(".ckpt" in model_args.model_name_or_path),
        config=config,
        cache_dir=model_args.cache_dir,
        revision=model_args.model_revision,
        use_auth_token=True if model_args.use_auth_token else None,
    )

    # When using your own dataset or a different dataset from swag, you will probably need to change this.
    ending_names = [f"ending{i}" for i in range(4)]
    context_name = "sent1"
    question_header_name = "sent2"

    if data_args.max_seq_length is None:
        max_seq_length = tokenizer.model_max_length
        if max_seq_length > 1024:
            logger.warning(
                f"The tokenizer picked seems to have a very large `model_max_length` ({tokenizer.model_max_length}). "
                "Picking 1024 instead. You can change that default value by passing --max_seq_length xxx."
            )
            max_seq_length = 1024
    else:
        if data_args.max_seq_length > tokenizer.model_max_length:
            logger.warning(
                f"The max_seq_length passed ({data_args.max_seq_length}) is larger than the maximum length for the"
                f"model ({tokenizer.model_max_length}). Using max_seq_length={tokenizer.model_max_length}."
            )
        max_seq_length = min(data_args.max_seq_length, tokenizer.model_max_length)

    # Preprocessing the datasets.
    def preprocess_function(examples):
        first_sentences = [[context] * 4 for context in examples[context_name]]
        question_headers = examples[question_header_name]
        second_sentences = [
            [f"{header} {examples[end][i]}" for end in ending_names] for i, header in enumerate(question_headers)
        ]

        # Flatten out
        first_sentences = list(chain(*first_sentences))
        second_sentences = list(chain(*second_sentences))

        # Tokenize
        tokenized_examples = tokenizer(
            first_sentences,
            second_sentences,
            truncation=True,
            max_length=max_seq_length,
            padding="max_length" if data_args.pad_to_max_length else False,
        )
        # Un-flatten
        return {k: [v[i : i + 4] for i in range(0, len(v), 4)] for k, v in tokenized_examples.items()}

    if training_args.do_train:
        if "train" not in raw_datasets:
            raise ValueError("--do_train requires a train dataset")
        train_dataset = raw_datasets["train"]
        if data_args.max_train_samples is not None:
            max_train_samples = min(len(train_dataset), data_args.max_train_samples)
            train_dataset = train_dataset.select(range(max_train_samples))
        with training_args.main_process_first(desc="train dataset map pre-processing"):
            train_dataset = train_dataset.map(
                preprocess_function,
                batched=True,
                num_proc=data_args.preprocessing_num_workers,
                load_from_cache_file=not data_args.overwrite_cache,
            )

    if training_args.do_eval:
        if "validation" not in raw_datasets:
            raise ValueError("--do_eval requires a validation dataset")
        eval_dataset = raw_datasets["validation"]
        if data_args.max_eval_samples is not None:
            max_eval_samples = min(len(eval_dataset), data_args.max_eval_samples)
            eval_dataset = eval_dataset.select(range(max_eval_samples))
        with training_args.main_process_first(desc="validation dataset map pre-processing"):
            eval_dataset = eval_dataset.map(
                preprocess_function,
                batched=True,
                num_proc=data_args.preprocessing_num_workers,
                load_from_cache_file=not data_args.overwrite_cache,
            )

    # Data collator
    data_collator = (
        default_data_collator
        if data_args.pad_to_max_length
        else DataCollatorForMultipleChoice(tokenizer=tokenizer, pad_to_multiple_of=8 if training_args.fp16 else None)
    )

    # Metric
    def compute_metrics(eval_predictions):
        predictions, label_ids = eval_predictions
        preds = np.argmax(predictions, axis=1)
        return {"accuracy": (preds == label_ids).astype(np.float32).mean().item()}

    # Initialize our Trainer
    trainer = Trainer(
        model=model,
        args=training_args,
        train_dataset=train_dataset if training_args.do_train else None,
        eval_dataset=eval_dataset if training_args.do_eval else None,
        tokenizer=tokenizer,
        data_collator=data_collator,
        compute_metrics=compute_metrics,
    )

    # Training
    if training_args.do_train:
        checkpoint = None
        if training_args.resume_from_checkpoint is not None:
            checkpoint = training_args.resume_from_checkpoint
        elif last_checkpoint is not None:
            checkpoint = last_checkpoint
        train_result = trainer.train(resume_from_checkpoint=checkpoint)
        trainer.save_model()  # Saves the tokenizer too for easy upload
        metrics = train_result.metrics

        max_train_samples = (
            data_args.max_train_samples if data_args.max_train_samples is not None else len(train_dataset)
        )
        metrics["train_samples"] = min(max_train_samples, len(train_dataset))

        trainer.log_metrics("train", metrics)
        trainer.save_metrics("train", metrics)
        trainer.save_state()

    # Evaluation
    if training_args.do_eval:
        logger.info("*** Evaluate ***")

        metrics = trainer.evaluate()
        max_eval_samples = data_args.max_eval_samples if data_args.max_eval_samples is not None else len(eval_dataset)
        metrics["eval_samples"] = min(max_eval_samples, len(eval_dataset))

        trainer.log_metrics("eval", metrics)
        trainer.save_metrics("eval", metrics)

    kwargs = dict(
        finetuned_from=model_args.model_name_or_path,
        tasks="multiple-choice",
        dataset_tags="swag",
        dataset_args="regular",
        dataset="SWAG",
        language="en",
    )

    if training_args.push_to_hub:
        trainer.push_to_hub(**kwargs)
    else:
        trainer.create_model_card(**kwargs)

def _mp_fn(index):
    # For xla_spawn (TPUs)
    main()

if __name__ == "__main__":
    main()


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<color name="colorPrimary">#1f487d</color>   <!-- newOldColor: #1f487d -->  <!-- oldColor: #2979ff -->
	<color name="colorPrimaryDark">#132c4c</color> <!-- newOldColor: #ff0d47a1 --> <!-- oldColor: #311b92-->
	<color name="colorSecondary">#d9d9d9</color>  <!-- oldColor: #d9d9d9 -->
	<color name="colorAccent">#ff33b5e5</color>  <!--@android:color/holo_blue_light-->
	<color name="colorPrimaryLight">#C5CAE9</color>
	<color name="colorRipple">#bfbfbf</color>
	<color name="white">#ffffffff</color>
	<color name="black">#000000</color>
	<color name="blackSecondary">#8a000000</color>
	<color name="appBackground">@color/white</color>
	<color name="headerBackground">#ececec</color>
	<color name="red">#AA0000</color>
	<color name="green">#00AA00</color>
	<color name="transparentBlack">#70000000</color>
	<color name="transparentBlackDark">#90000000</color>
	<color name="colorRippleTransparent">#000000</color>

	<color name="textDark">#ff212121</color>
	<color name="textLight">#70000000</color>
	<color name="textLighter">#37000000</color>
	<color name="transparent">#00000000</color>
</resources>


text:
function addRemoveTextInput() {
	// Create the element just like you would in a normal screen declaration
	var input = document.getElementById('MyInput');

	if (input) {
		input.remove();
		// Change our button text
		document.getElementById('addRemoveBtn').setCaption('Add Text Input');
	} else {
		input = document.createElement('input');
		input.setAttribute('type','text');
		input.setAttribute('id','MyInput');
		input.setAttribute('value', 'Hello World');
		// Apply our styling
		input = bb.textInput.style(input);
		// Insert it into the screen and update the scroller
		document.getElementById('inputContainer').appendChild(input);
		// Change our button text
		document.getElementById('addRemoveBtn').setCaption('Remove Text Input');
	}
	// Refresh for PlayBook scroller
	bb.refresh();
}


text:
from base import Resource

class StatusResource(Resource):
    pass


text:
![Akka.NET logo](docs/shfb/icons/AkkaNetLogo.Normal.png)

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akkadotnet/akka.net?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <br/>

**Akka.NET** is a professional-grade port of the popular Java/Scala framework [Akka](http://akka.io) distributed actor framework to .NET.

Akka.NET is a [.NET Foundation](https://dotnetfoundation.org/) project.

![.NET Foundation Logo](docs/images/dotnetfoundationhorizontal.svg)

## Build Status

| Stage                               	| Status                                                                                |
|-------------------------------------	|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------	|
| Build                               	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=Windows%20Build)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)                                   	|
| NuGet Pack                          	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=NuGet%20Pack)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)                                      	|
| .NET Framework Unit Tests           	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Framework%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)       	|
| .NET Framework MultiNode Tests      	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Framework%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) 	|
| .NET Core (Windows) Unit Tests      	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)            	|
| .NET Core (Linux) Unit Tests        	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Unit%20Tests%20(Linux))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)              	|
| .NET Core (Windows) MultiNode Tests 	| [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev)      	|
| .NET Core (Linux) MultiNode Tests   	|                                                                                |
| Docs                                	| [![Build Status](https://dev.azure.com/petabridge/akkadotnet-tools/_apis/build/status/Akka.NET%20Docs?branchName=dev)](https://dev.azure.com/petabridge/akkadotnet-tools/_build/latest?definitionId=82&branchName=dev)                                            	|

### Documentation and resources

#### [Akka.NET Project Site](http://getakka.net)

### Install Akka.NET via NuGet

If you want to include Akka.NET in your project, you can [install it directly from NuGet](https://www.nuget.org/packages/Akka)

To install Akka.NET Distributed Actor Framework, run the following command in the Package Manager Console

```
PM> Install-Package Akka
PM> Install-Package Akka.Remote
```

And if you need F# support:

```
PM> Install-Package Akka.FSharp
```

## Builds
Please see [Building Akka.NET](http://getakka.net/community/building-akka-net.html).

To access nightly Akka.NET builds, please [see the instructions here](http://getakka.net/community/getting-access-to-nightly-builds.html).

## Support
If you need help getting started with Akka.NET, there's a number of great community resources online:

* Subscribe to the Akka.NET project feed on Twitter: https://twitter.com/AkkaDotNet  (@AkkaDotNet)
* Join the Akka.NET project Gitter chat: https://gitter.im/akkadotnet/akka.net
* Ask Akka.NET questions on Stack Overflow: http://stackoverflow.com/questions/tagged/akka.net

If you and your company are interested in getting professional Akka.NET support, you can [contact Petabridge for dedicated Akka.NET support](https://petabridge.com/).


text:
import datetime
import unittest
from cm_api.endpoints.timeseries import *
from cm_api.endpoints.types import ApiList
from cm_api_tests import utils

try:
  import json
except ImportError:
  import simplejson as json

class TestTimeSeries(unittest.TestCase):

  def test_query_timeseries(self):
    TIME_SERIES = '''{
      "items" : [ {
        "timeSeries" : [ {
          "metadata" : {
            "metricName" : "cpu_percent",
            "entityName" : "localhost",
            "startTime" : "2013-05-08T22:58:28.868Z",
            "endTime" : "2013-05-08T23:03:28.868Z",
            "attributes" : {
              "hostname" : "localhost",
              "hostId" : "localhost",
              "rackId" : "/default",
              "category" : "HOST",
              "entityName" : "localhost"
            },
            "unitNumerators" : [ "percent" ],
            "unitDenominators" : [ ]
          },
          "data" : [ {
            "timestamp" : "2013-05-08T22:59:06.000Z",
            "value" : 1.7,
            "type" : "SAMPLE",
            "aggregateStatistics" : {
              "sampleTime": "2013-05-08T22:58:06.000Z",
              "sampleValue": 317,
              "count": 3,
              "min": 305,
              "minTime": "2013-05-08T22:58:06.000Z",
              "max": 317,
              "maxTime": "2013-05-08T22:58:06.000Z",
              "mean": 311.6666666666667,
              "stdDev": 6.110100926606199,
              "crossEntityMetadata": {
                "maxEntityDisplayName": "DATANODE (host1.com)",
                "minEntityDisplayName": "DATANODE (host2.com)",
                "numEntities": 3
              }
            }
          }, {
            "timestamp" : "2013-05-08T23:00:06.000Z",
            "value" : 3.5,
            "type" : "SAMPLE",
            "aggregateStatistics" : {
              "sampleTime": "2013-05-08T22:58:07.000Z",
              "sampleValue": 319,
              "count": 3,
              "min": 304,
              "minTime": "2013-05-08T22:58:07.000Z",
              "max": 319,
              "maxTime": "2013-05-08T22:58:07.000Z",
              "mean": 311.6666666666667,
              "stdDev": 6.110100926606199
            }
          }, {
            "timestamp" : "2013-05-08T23:01:06.000Z",
            "value" : 2.1,
            "type" : "SAMPLE"
          }, {
            "timestamp" : "2013-05-08T23:02:06.000Z",
            "value" : 1.5,
            "type" : "SAMPLE"
          }, {
            "timestamp" : "2013-05-08T23:03:06.000Z",
            "value" : 1.7,
            "type" : "SAMPLE"
          } ]
        } ],
        "warnings" : [ ],
        "timeSeriesQuery" : "select cpu_percent"
      } ]
    }'''

    api_resource = utils.MockResource(self)
    time = datetime.datetime.now()
    api_resource.expect("GET", "/timeseries",
                        retdata=json.loads(TIME_SERIES),
                        params={ 'from':time.isoformat(), 'to':time.isoformat(),
                                 'query':'select cpu_percent'})
    responses = query_timeseries(api_resource,
                                 "select cpu_percent",
                                 time,
                                 time)

    self.assertIsInstance(responses, ApiList)
    self.assertEqual(1, len(responses))
    response = responses[0]
    self.assertIsInstance(response, ApiTimeSeriesResponse)
    self.assertEqual("select cpu_percent", response.timeSeriesQuery)
    self.assertFalse(response.warnings)
    self.assertFalse(response.errors)
    self.assertEqual(1, len(response.timeSeries))
    timeseries = response.timeSeries[0]
    self.assertIsInstance(timeseries, ApiTimeSeries)
    metadata = timeseries.metadata
    self.assertIsInstance(metadata, ApiTimeSeriesMetadata)
    self.assertEqual("cpu_percent", metadata.metricName)
    self.assertEqual("localhost", metadata.entityName)
    self.assertIsInstance(metadata.attributes, dict)
    self.assertEqual("cpu_percent", metadata.metricName)
    self.assertEqual(5, len(timeseries.data))
    for data in timeseries.data:
      self.assertIsInstance(data, ApiTimeSeriesData)
      self.assertEqual("SAMPLE", data.type)
      self.assertIsInstance(data.timestamp, datetime.datetime)
      self.assertTrue(data.value)
    # first and second points have aggregate data.
    data  = timeseries.data[0]
    self.assertIsNotNone(data.aggregateStatistics)
    self.assertIsInstance(data.aggregateStatistics, ApiTimeSeriesAggregateStatistics)
    self.assertEqual(317, data.aggregateStatistics.sampleValue)
    xEntityMetadata = data.aggregateStatistics.crossEntityMetadata
    self.assertIsNotNone(xEntityMetadata)
    self.assertIsInstance(xEntityMetadata, ApiTimeSeriesCrossEntityMetadata)
    self.assertEqual("DATANODE (host1.com)", xEntityMetadata.maxEntityDisplayName)
    data  = timeseries.data[1]
    self.assertIsNotNone(data.aggregateStatistics)
    self.assertIsInstance(data.aggregateStatistics, ApiTimeSeriesAggregateStatistics)
    self.assertEqual(319, data.aggregateStatistics.sampleValue)
    xEntityMetadata = data.aggregateStatistics.crossEntityMetadata
    self.assertIsNone(xEntityMetadata)

    # Test the with-rollups call
    api_resource.expect("GET", "/timeseries",
                        retdata=json.loads(TIME_SERIES),
                        params={ 'from':time.isoformat(), 'to':time.isoformat(),
                                 'query':'select cpu_percent',
                                 'desiredRollup':'RAW',
                                 'mustUseDesiredRollup': True})
    responses = query_timeseries(api_resource,
                                 "select cpu_percent",
                                 time,
                                 time,
                                 "RAW",
                                 True)

  def test_get_metric_schema(self):
    METRICS = '''{
      "items" : [ {
        "name" : "event_drain_success_count_flume_sink_min_rate",
        "displayName" : "Event Drain Successes Across Flume Sinks",
        "description" : "Event Drain Successes aggregate computed across all Flume Sinks.",
        "isCounter" : false,
        "unitNumerator" : "events",
        "unitDenominator" : "seconds",
        "aliases" : [ ],
        "sources" : {
          "CLUSTER" : [ "cdh3", "cdh4" ],
          "FLUME" : [ "cdh3", "cdh4" ]
        }
      }, {
        "name" : "drop_receive",
        "displayName" : "Dropped Packets (Receive)",
        "description" : "The number of packets dropped by the network interface (receive)",
        "isCounter" : true,
        "unitNumerator" : "packets",
        "aliases" : [ "network_interface_drop_receive" ],
        "sources" : {
          "NETWORK_INTERFACE" : [ "enterprise" ]
        }
      } ]
    }'''

    api_resource = utils.MockResource(self)
    api_resource.expect("GET", "/timeseries/schema",
                        retdata=json.loads(METRICS))
    metrics = get_metric_schema(api_resource)

    self.assertIsInstance(metrics, ApiList)
    self.assertEqual(2, len(metrics))
    metric = metrics[0]
    self.assertIsInstance(metric, ApiMetricSchema)
    self.assertEqual("event_drain_success_count_flume_sink_min_rate",
                     metric.name)
    self.assertEqual("Event Drain Successes Across Flume Sinks",
                     metric.displayName)
    self.assertEqual("Event Drain Successes aggregate computed across all Flume Sinks.",
                     metric.description)
    self.assertFalse(metric.isCounter)
    self.assertEqual("events", metric.unitNumerator)
    self.assertEqual("seconds", metric.unitDenominator)
    self.assertFalse(metric.aliases)
    self.assertIsInstance(metric.sources, dict)
    metric = metrics[1]
    self.assertIsInstance(metric, ApiMetricSchema)
    self.assertEqual("drop_receive", metric.name)
    self.assertEqual("Dropped Packets (Receive)",
                     metric.displayName)
    self.assertEqual("The number of packets dropped by the network interface (receive)",
                     metric.description)
    self.assertTrue(metric.isCounter)
    self.assertEqual("packets", metric.unitNumerator)
    self.assertFalse( metric.unitDenominator)
    self.assertIsInstance(metric.aliases, list)
    self.assertEquals("network_interface_drop_receive", metric.aliases[0])
    self.assertIsInstance(metric.sources, dict)
    self.assertEquals("enterprise", metric.sources["NETWORK_INTERFACE"][0])


text:
package dnsrecord

import (
	"context"

	providerv1alpha1 "github.com/giantswarm/apiextensions/v6/pkg/apis/provider/v1alpha1"
	"github.com/giantswarm/microerror"

	"github.com/giantswarm/azure-operator/v6/service/controller/key"

	"github.com/giantswarm/azure-operator/v6/client"
)

// GetDesiredState returns the desired resource group for this cluster.
func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) (interface{}, error) {
	cr, err := key.ToCustomResource(obj)
	if err != nil {
		return nil, microerror.Mask(err)
	}

	return r.getDesiredState(ctx, cr)
}

func (r *Resource) getDesiredState(ctx context.Context, obj providerv1alpha1.AzureConfig) (dnsRecords, error) {
	zonesClient, err := r.getDNSZonesGuestClient(ctx)
	if err != nil {
		return nil, microerror.Mask(err)
	}

	desired := newPartialDNSRecords(obj)

	for i, record := range desired {
		zone := record.RelativeName + "." + record.Zone
		resp, err := zonesClient.Get(ctx, key.ResourceGroupName(obj), zone)
		if client.ResponseWasNotFound(resp.Response) {
			return dnsRecords{}, nil
		} else if err != nil {
			return nil, microerror.Mask(err)
		}

		var nameServers []string
		nameServers = append(nameServers, *resp.NameServers...)

		desired[i].NameServers = nameServers
	}

	return desired, nil
}


text:
namespace {

// We keep the file descriptor for /dev/urandom around so we don't need to
// reopen it (which is expensive), and since we may not even be able to reopen
// it if we are later put in a sandbox. This class wraps the file descriptor so
// we can use LazyInstance to handle opening it on the first access.
class URandomFd {
 public:
  URandomFd() : fd_(open("/dev/urandom", O_RDONLY)) {
    DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno;
  }

  ~URandomFd() { close(fd_); }

  int fd() const { return fd_; }

 private:
  const int fd_;
};

base::LazyInstance<URandomFd>::Leaky g_urandom_fd = LAZY_INSTANCE_INITIALIZER;

}  // namespace

namespace base {

// NOTE: This function must be cryptographically secure. http://crbug.com/140076
uint64 RandUint64() {
  uint64 number;
  RandBytes(&number, sizeof(number));
  return number;
}

void RandBytes(void* output, size_t output_length) {
  const int urandom_fd = g_urandom_fd.Pointer()->fd();
  const bool success =
      ReadFromFD(urandom_fd, static_cast<char*>(output), output_length);
  CHECK(success);
}

int GetUrandomFD(void) {
  return g_urandom_fd.Pointer()->fd();
}

}  // namespace base


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--error messages-->
    <string name="read_permission_denied">Camera Roll需要访问存储空间的权限以显示图片。</string>
    <string name="grant_removable_storage_permission">授予访问可移动存储的权限</string>
    <string name="grant_removable_storage_permission_message">请在下一屏幕上选择您的可移动存储设备的根目录(如SD卡)。</string>
    <!--general-->
    <string name="photo">照片</string>
    <string name="raw_image">原始图像</string>
    <string name="gif">动图</string>
    <string name="video">视频</string>
    <string name="pick_photo">选择一张照片</string>
    <string name="pick_photos">选择照片</string>
    <string name="loading">加载中</string>
    <string name="loading_failed">加载失败</string>
    <string name="ok">确定</string>
    <string name="remove">移除</string>
    <string name="cancel">取消</string>
    <string name="no">取消</string>
    <string name="undo">撤销</string>
    <string name="done">完成</string>
    <string name="retry">重试</string>
    <string name="excluded">已排除</string>
    <string name="error">错误</string>
    <string name="selected_count">已选择%1$d个</string>
    <string name="file_op_channel_name">文件操作</string>
    <string name="file_op_channel_description">显示文件操作当前的状态。</string>
    <!--MainActivity-->
    <string name="refresh">刷新</string>
    <string name="sort_by">排序方式</string>
    <string name="by_name">按名称</string>
    <string name="by_size">按大小</string>
    <string name="by_date">按日期</string>
    <string name="hidden_folders">隐藏的文件夹</string>
    <string name="file_explorer">文件浏览器</string>
    <string name="about">关于</string>
    <string name="settings">设置</string>
    <string name="camera_shortcut">相机快捷方式</string>
    <string name="item_count">%1$d项</string>
    <string name="items_count">%1$d项</string>
    <!--AlbumActivity-->
    <string name="exclude">排除</string>
    <string name="pin_album">固定相册</string>
    <string name="file_deleted">已删除%1$d个文件</string>
    <string name="files_deleted">已删除%1$d个文件</string>
    <string name="select_all">全选</string>
    <!--ItemActivity-->
    <string name="set_as">将照片设置为</string>
    <string name="open_with">打开方式</string>
    <string name="open_with_error">未找到可打开您的%1$s的应用程序</string>
    <string name="print">打印</string>
    <string name="info">详细信息</string>
    <string name="share">分享</string>
    <string name="share_item">分享%1$s</string>
    <string name="share_error">未找到可分享您的%1$s的应用程序</string>
    <string name="edit">编辑</string>
    <string name="edit_item">编辑%1$s</string>
    <string name="edit_error">未找到可编辑您的%1$s的应用程序</string>
    <string name="delete">删除</string>
    <string name="delete_item">删除%1$s</string>
    <string name="delete_files">删除%1$d个文件</string>
    <string name="move">移动</string>
    <string name="move_item_to">移动%1$d个文件至:</string>
    <string name="move_items_to">移动%1$d个文件至:</string>
    <string name="move_error">移动操作不能涉及可移动存储。请使用复制和删除操作代替。</string>
    <string name="copy">复制</string>
    <string name="copy_item_to">复制%1$d项至:</string>
    <string name="copy_items_to">复制%1$d项至:</string>
    <string name="create">创建</string>
    <string name="new_folder">新建文件夹</string>
    <string name="rename">重命名</string>
    <string name="paste">粘贴</string>
    <string name="successfully_created_new_folder">新文件夹创建成功</string>
    <string name="successfully_renamed_file">文件重命名成功</string>
    <!--FileExplorerActivity-->
    <string name="no_files">没有文件</string>
    <string name="storage">存储空间</string>
    <string name="scan">扫描</string>
    <string name="scanning">正在扫描……</string>
    <string name="copy_file">复制%1$d个文件</string>
    <string name="copy_files">复制%1$d个文件</string>
    <string name="move_file">移动%1$d个文件</string>
    <string name="move_files">移动%1$d个文件</string>
    <string name="delete_file">删除%1$d个文件</string>
    <string name="paste_error">您不能在这里粘贴文件!</string>
    <!--SettingsActivity-->
    <string name="appearance">外观</string>
    <string name="theme">主题</string>
    <string name="style">样式</string>
    <string name="column_count">列数</string>
    <string name="other">其他</string>
    <string name="media_retriever">媒体获取器</string>
    <string name="media_retriever_summary">不使用MediaStore API而手动搜索存储空间内的媒体,或许可以解决某些照片不能显示的问题</string>
    <string name="use_8_bit_color">8位颜色</string>
    <string name="use_8_bit_color_summary">在显示照片时使用8位颜色。可能减缓加载、占用更多内存</string>
    <string name="show_animations">过渡动画</string>
    <string name="show_animations_summary">停用元素过渡动画和翻页动画</string>
    <string name="show_videos">显示视频</string>
    <string name="show_videos_summary">在相册中显示视频</string>
    <string name="maximum_brightness">最大亮度</string>
    <string name="maximum_brightness_summary">在显示照片时使用最大亮度</string>
    <!--EditImageActivity-->
    <string name="rotate">旋转</string>
    <string name="restore">重置</string>
    <string name="save_edit">保存</string>
    <string name="export">导出</string>
    <string name="editing_file_format_not_supported">不支持编辑该格式的文件</string>
    <string name="success">成功!</string>
    <!--SetWallpaperActivity-->
    <string name="wallpaper">壁纸</string>
    <string name="set_wallpaper">设置为壁纸</string>
    <string name="wallpaper_file_format_not_supported">不支持将该格式的文件设为壁纸</string>
    <string name="home_screen">主屏幕</string>
    <string name="lock_screen">锁定屏幕</string>
    <string name="both">主屏幕和锁定屏幕</string>
    <!--ExifEditorActivity-->
    <string name="exif_editor">照片信息编辑器</string>
    <string name="edit_exif">编辑照片信息</string>
    <string name="save">保存</string>
    <string name="changes_saved">更改已保存</string>
    <string name="clear_exif_data">清除照片信息</string>
    <!--ExcludedPathsActivity-->
    <string name="excluded_paths">已排除的文件路径</string>
    <!--VirtualAlbumsActivity-->
    <string name="virtual_albums">虚拟相册</string>
    <string name="create_virtual_album">创建虚拟相册</string>
    <string name="virtual_album_created">虚拟相册"%1$s"已创建</string>
    <string name="virtual_album_different_name">请选择其他的相册名称</string>
    <string name="add_path_to_virtual_album">添加路径到虚拟相册</string>
    <string name="added_path_to_virtual_album">已将路径添加到虚拟相册"%1$s"</string>
    <string name="virtual_album_deleted">虚拟相册"%1$s"已删除</string>
    <string name="path_removed">路径已删除</string>
    <string name="no_paths">没有已添加的路径</string>
    <string name="no_virtual_albums">没有虚拟相册</string>
    <!--info Dialog Strings-->
    <string name="tags">标签:</string>
    <string name="new_tag">新标签</string>
    <string name="add_tag">添加标签</string>
    <string name="tag_already_added">已添加标签</string>
    <string name="info_filename">文件名:</string>
    <string name="info_filepath">文件位置:</string>
    <string name="info_size">文件大小:</string>
    <string name="info_dimensions">尺寸:</string>
    <string name="info_date">拍摄日期:</string>
    <string name="info_location">位置:</string>
    <string name="info_focal_length">焦距:</string>
    <string name="info_exposure">曝光时间:</string>
    <string name="info_camera_model">相机型号:</string>
    <string name="info_aperture">光圈值:</string>
    <string name="info_iso">ISO速度:</string>
    <string name="info_frame_rate">帧速率:</string>
    <string name="copied_to_clipboard">已复制到剪贴板</string>
</resources>


text:
import {FirebaseListObservable, AngularFireDatabase, FirebaseObjectObservable} from 'angularfire2';
import {Observable} from 'rxjs/Observable';
import {Observer} from 'rxjs/Observer';
import {DatabaseRef} from './DatabaseRef';
import {BackendService} from './backend.service';

/*
 * Wrapper class for FirebaseObjectObservable, which responds Observables instead of Promises for most operations.
 *
 */
export class ObjectRef<T> extends DatabaseRef {

  object: FirebaseObjectObservable<T> = null;
  objectResource: string = null;

  constructor(backend: BackendService, resource: string) {
    super(backend, resource);
    this.objectResource = resource;
  }

  public get(options?: any): Observable<T> {
    this.object = this.backend.object(this.objectResource, options) as FirebaseObjectObservable<T>;
    return this.object;
  }

  public getId(id: string, options?: any): Observable<T> {
    this.objectResource = this.resource + '/' + id;
    return this.get(options);
  }

  public add(id: string, obj: T): Observable<T> {
    this.object = this.backend.object(`${this.objectResource}/${id}`)  as FirebaseObjectObservable<T>;
    return Observable.create((observer: Observer<T>) => {
      return this.object.set(obj)
        .catch(error => observer.error(error))
        .then(result => {
          observer.next(result);
          observer.complete();
        }, error => {
          observer.error(error);
        });
    });
  }

  public delete(): Observable<T> {
    return Observable.create((observer: Observer<T>) => {
      return this.object.remove()
        .catch(error => observer.error(error))
        .then(result => {
          observer.next(result);
          observer.complete();
        }, error => {
          observer.error(error);
        });
    });
  }

  public update(changes: any): Observable<T> {
    let newObj = changes;
    if (newObj['$key']) {
      newObj = Object.assign({}, changes);
      delete newObj['$key'];
    }
    return Observable.create((observer: Observer<T>) => {
      return this.object.update(newObj)
        .catch(error => observer.error(error))
        .then(result => {
          observer.next(result);
          observer.complete();
        }, error => {
          observer.error(error);
        });
    });
  }

  public set(obj: any): Observable<T> {
    let newObj = obj;
    if (newObj['$key']) {
      newObj = Object.assign({}, obj);
      delete newObj['$key'];
    }
    return Observable.create((observer: Observer<T>) => {
      return this.object.set(newObj)
        .catch(error => observer.error(error))
        .then(result => {
          observer.next(result);
          observer.complete();
        }, error => {
          observer.error(error);
        });
    });
  }

}


text:
package ch.icclab.cyclops.application;

import ch.icclab.cyclops.services.iaas.cloudstack.client.CloudStackScheduler;
import ch.icclab.cyclops.services.iaas.cloudstack.model.CloudStackUsageTypes;
import ch.icclab.cyclops.services.iaas.cloudstack.resource.dto.MeterList;
import ch.icclab.cyclops.services.iaas.cloudstack.resource.impl.*;
import ch.icclab.cyclops.services.iaas.openstack.resource.impl.*;

/**
 * @author Manu
 *         Created by root on 16.11.15.
 */
public class CloudstackUDRApplication extends AbstractApplication {
    @Override
    public void createRoutes() {
        router.attach("/ext/app", ExternalAppResource.class); // API used for data insertion from external PaaS/IaaS
        counter.registerEndpoint("/ext/app");

        //API used for fetching the usage info for a user
        router.attach("/usage/users/{userId}", CloudStackUsage.class);
        counter.registerEndpoint("/usage/users");

        // API endpoint used for requesting resource usage
        router.attach("/usage/resources/{metername}", CloudStackResources.class);
        counter.registerEndpoint("/usage/resources");

        //API used for saving and returning the information on selected meters for usage metrics collection
        router.attach("/meters", CloudStackMeter.class);
        counter.registerEndpoint("/meters");

        router.attach("/meters/v2/", CloudStackMeterV2.class);
        counter.registerEndpoint("/meters/v2/");

        // API used to get usage data from CloudStack
        router.attach("/scheduler/{command}", CloudStackEndpoint.class);
        counter.registerEndpoint("/scheduler");

        // also start collection immediately
        CloudStackScheduler.getInstance().start();

    }

    @Override
    public void initialiseDatabases() {
        dbClient.createDatabases(settings.getInfluxDBSettings().getInfluxDBDatabaseName(), settings.getCloudStackSettings().getCloudStackDBLogsName());

        // make sure we have proper meterList in database
        new CloudStackMeter().initializeWithList(CloudStackUsageTypes.getList());
    }

}