// Copyright (c) 2005 - 2017 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// Return To The Roots is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include "Window.h"
#include "gameTypes/MapCoordinates.h"

class Minimap;

/// Übersichtskarte (MapPreview)
class ctrlMinimap : public Window
{
public:
    ctrlMinimap(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size, const Extent& padding,
                const Extent& mapSize);

    Extent GetCurMapSize() const { return drawnMapSize; }

    /// Get area the map covers (relative to control origin)
    Rect GetMapArea() const;
    Rect GetBoundaryRect() const override;
    Rect GetMapDrawArea() const;

    void SetPadding(const Extent& padding);
    /// Größe ändern
    void Resize(const Extent& newSize) override;
    void SetMapSize(const Extent& newMapSize);

    /// Liefert für einen gegebenen Map-Punkt die Pixel-Koordinaten relativ zur Bounding-Box
    DrawPoint CalcMapCoord(MapPoint pt) const;

    /// Verkleinert Minimap soweit es geht (entfernt Bounding-Box)
    void RemoveBoundingBox(const Extent& minSize);

protected:
    /// Zeichnet die Minimap an sich
    void DrawMap(Minimap& map) const;

    /// Real size of the minimap (gets scaled with retained aspect ratio)
    Extent drawnMapSize;
    /// Abstand der Minimap vom Rand des Controls
    Extent padding;
    /// Requested size of the drawn map
    Extent mapSize;
};

{'repo_name': 'Return-To-The-Roots/s25client', 'stars': '259', 'repo_language': 'C++', 'file_name': 'default.lua', 'mime_type': 'text/plain', 'hash': -2921922893612576488, 'source_dataset': 'data'}


#               FG              BTN_BG bright less brdark        less da     txt fg               br text              btn fg           txt bg     bg     shadow   sel bg     sel fg     link       visited           alt bg default          tooltip bg  tooltip_fg
[ColorScheme]
  active_colors=#e6f2da,          #6f7f5f, #6f7f5f, #6f7f5f, #444c3d, #444c3d, #e6f2da,           #e6f2da,           #e6f2da,           #4f5947, #6f7f5f, #444c3d, #6ccc3d, #000000, #6ccc3d, #e6f2da,            #6f7f5f, #e6f2da,           444c3d,  #e6f2da
disabled_colors=#c8d5bb, #6f7f5f, #6f7f5f, #6f7f5f, #444c3d, #444c3d, #c0cbb5,  #c0cbb5,  #c8d5bb,  #4f5947, #6f7f5f, #444c3d, #6ccc3d, #000000, #6ccc3d, #c8d5bb,   #6f7f5f, #c8d5bb,  #444c3d, #bdc8b2
inactive_colors=#e6f2da,          #6f7f5f, #6f7f5f, #6f7f5f, #444c3d, #444c3d, #e6f2da,           #e6f2da,           #e6f2da,           #4f5947, #6f7f5f, #444c3d, #6ccc3d, #000000, #6ccc3d, #e6f2da,            #6f7f5f, #e6f2da,           #444c3d, #e6f2da

#               FG              BTN_BG     bright   less br  dark     less da  txt fg               br text  btn fg     txt bg     bg     shadow   sel bg     sel fg     link       visite alt bg default  tooltip bg  tooltip_fg
#  active_colors=#e6f2da,          #4f5947, #6f7f5f, #cbc7c4, #9f9d9a, #b8b5b2, #e6f2da,           #ff0000, #e6f2da, #4f5947, #6f7f5f, #767472, #6ccc3d, #000000, #6ccc3d, #e6f2da,            #6f7f5f, #e6f2da,           444c3d, #e6f2da
#disabled_colors=#c8d5bb, #4f5947, #6f7f5f, #cbc7c4, #9f9d9a, #b8b5b2, #c0cbb5,  #ffec17, #e6f2da, #4f5947, #6f7f5f, #767472, #6ccc3d, #000000, #6ccc3d, #c8d5bb,   #6f7f5f, #c8d5bb,  #444c3d, #bdc8b2
#inactive_colors=#e6f2da,          #4f5947, #6f7f5f, #cbc7c4, #9f9d9a, #b8b5b2, #e6f2da,           #ff9040, #e6f2da, #4f5947, #6f7f5f, #767472, #6ccc3d, #000000, #6ccc3d, #e6f2da,            #6f7f5f, #e6f2da,           #444c3d, #e6f2da

{'repo_name': 'linuxmint/cinnamon-spices-themes', 'stars': '105', 'repo_language': 'CSS', 'file_name': 'metadata.json', 'mime_type': 'text/plain', 'hash': -2103268900046870506, 'source_dataset': 'data'}


To Do for the Numerical Schubert Calculus project

November 2017

Need to:
 - Check Examples of the functions that are documented in
http://www2.macaulay2.com/Macaulay2/doc/Macaulay2-1.10/share/doc/Macaulay2/NumericalSchubertCalculus/html/
work properly with their examples

 - fix example of changeFlags, and expand it for the different ways to use it

 - verify and compare solveSchubertProblem vs solveSimpleSchubert

 - make solveSimpleSchubert a Strategy for solveSchubert under the flag PieriHomotopy

 - checkIncidenceSolution: either finish the documentation (add example) or delete it from there

 - finish the explanation about how to use the function printStatistics in NumericalSchubertCalculus.m2 (and explain is for debugging reasons)

 - error in example/documentation of setVerboseLevel

 - to finish testing all functions, need to install PHC and GAP and see if the Galois functions work

 - once we write a unified input, we need to update the nomenclature of the examples (specially those of the documentation)

## Old Comments:

 - Find examples where the software breaks and examine them.

 - Make a table comparing all four implementations on the same problem
    for the software paper.

 - Standard input that should work for everything:

   solveMe(SchubertProblem, k, n)

 where SchubertProblem is a list of pairs
   { ( bracket, flag ), (anotherBracket, anotherFlag),...}

 Frank will write a PHC wrapper for this with standard checks
   (general flag, Schubert problem, etc.)

 the service function verifyInput verifies all inputs, using breaks to return a
   useful error message to the user.

 First step:  Read the TST and EXA dirctory, as well as the bugs,

{'repo_name': 'Macaulay2/M2', 'stars': '175', 'repo_language': 'Macaulay2', 'file_name': 'profiling.cmake', 'mime_type': 'text/plain', 'hash': 8639397068209452996, 'source_dataset': 'data'}


id: dsq-957379147
date: 2013-07-10T06:25:52.0000000-07:00
name: Vince
avatar: https://disqus.com/api/users/avatars/Vince.jpg
message:
I must admit, my bulls hit detector was broken until I read this article. Thanks k's Phil!

{'repo_name': 'haacked/haacked.com', 'stars': '130', 'repo_language': 'Ruby', 'file_name': 'dsq-747526594.yml', 'mime_type': 'text/html', 'hash': -3109826814399051262, 'source_dataset': 'data'}


Git中文本地版本库已经迁移到新地址：

{'repo_name': 'porter-io/tag-github', 'stars': '159', 'repo_language': 'None', 'file_name': '__meta__.json', 'mime_type': 'text/plain', 'hash': -6084152889375315832, 'source_dataset': 'data'}


import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import math
import argparse
from dgl.data import RedditDataset
from torch.nn.parallel import DistributedDataParallel
import tqdm
import traceback

from utils import thread_wrapped_func
from load_graph import load_reddit, inductive_split

class SAGE(nn.Module):
    def __init__(self,
                 in_feats,
                 n_hidden,
                 n_classes,
                 n_layers,
                 activation,
                 dropout):
        super().__init__()
        self.n_layers = n_layers
        self.n_hidden = n_hidden
        self.n_classes = n_classes
        self.layers = nn.ModuleList()
        self.layers.append(dglnn.SAGEConv(in_feats, n_hidden, 'mean'))
        for i in range(1, n_layers - 1):
            self.layers.append(dglnn.SAGEConv(n_hidden, n_hidden, 'mean'))
        self.layers.append(dglnn.SAGEConv(n_hidden, n_classes, 'mean'))
        self.dropout = nn.Dropout(dropout)
        self.activation = activation

    def forward(self, blocks, x):
        h = x
        for l, (layer, block) in enumerate(zip(self.layers, blocks)):
            h = layer(block, h)
            if l != len(self.layers) - 1:
                h = self.activation(h)
                h = self.dropout(h)
        return h

    def inference(self, g, x, batch_size, device):
        """
        Inference with the GraphSAGE model on full neighbors (i.e. without neighbor sampling).
        g : the entire graph.
        x : the input of entire node set.

        The inference code is written in a fashion that it could handle any number of nodes and
        layers.
        """
        # During inference with sampling, multi-layer blocks are very inefficient because
        # lots of computations in the first few layers are repeated.
        # Therefore, we compute the representation of all nodes layer by layer.  The nodes
        # on each layer are of course splitted in batches.
        # TODO: can we standardize this?
        nodes = th.arange(g.number_of_nodes())
        for l, layer in enumerate(self.layers):
            y = th.zeros(g.number_of_nodes(), self.n_hidden if l != len(self.layers) - 1 else self.n_classes)

            sampler = dgl.dataloading.MultiLayerFullNeighborSampler(1)
            dataloader = dgl.dataloading.NodeDataLoader(
                g,
                th.arange(g.number_of_nodes()),
                sampler,
                batch_size=args.batch_size,
                shuffle=True,
                drop_last=False,
                num_workers=args.num_workers)

            for input_nodes, output_nodes, blocks in tqdm.tqdm(dataloader):
                block = blocks[0]

                block = block.int().to(device)
                h = x[input_nodes].to(device)
                h = layer(block, h)
                if l != len(self.layers) - 1:
                    h = self.activation(h)
                    h = self.dropout(h)

                y[output_nodes] = h.cpu()

            x = y
        return y

def compute_acc(pred, labels):
    """
    Compute the accuracy of prediction given the labels.
    """
    return (th.argmax(pred, dim=1) == labels).float().sum() / len(pred)

def evaluate(model, g, inputs, labels, val_nid, batch_size, device):
    """
    Evaluate the model on the validation set specified by ``val_nid``.
    g : The entire graph.
    inputs : The features of all the nodes.
    labels : The labels of all the nodes.
    val_nid : A node ID tensor indicating which nodes do we actually compute the accuracy for.
    batch_size : Number of nodes to compute at the same time.
    device : The GPU device to evaluate on.
    """
    model.eval()
    with th.no_grad():
        pred = model.inference(g, inputs, batch_size, device)
    model.train()
    return compute_acc(pred[val_nid], labels[val_nid])

def load_subtensor(g, labels, seeds, input_nodes, dev_id):
    """
    Copys features and labels of a set of nodes onto GPU.
    """
    batch_inputs = g.ndata['features'][input_nodes].to(dev_id)
    batch_labels = labels[seeds].to(dev_id)
    return batch_inputs, batch_labels

#### Entry point

def run(proc_id, n_gpus, args, devices, data):
    # Start up distributed training, if enabled.
    dev_id = devices[proc_id]
    if n_gpus > 1:
        dist_init_method = 'tcp://{master_ip}:{master_port}'.format(
            master_ip='127.0.0.1', master_port='12345')
        world_size = n_gpus
        th.distributed.init_process_group(backend="nccl",
                                          init_method=dist_init_method,
                                          world_size=world_size,
                                          rank=proc_id)
    th.cuda.set_device(dev_id)

    # Unpack data
    in_feats, n_classes, train_g, val_g, test_g = data
    train_mask = train_g.ndata['train_mask']
    val_mask = val_g.ndata['val_mask']
    test_mask = ~(test_g.ndata['train_mask'] | test_g.ndata['val_mask'])
    train_nid = train_mask.nonzero().squeeze()
    val_nid = val_mask.nonzero().squeeze()
    test_nid = test_mask.nonzero().squeeze()

    # Split train_nid
    train_nid = th.split(train_nid, math.ceil(len(train_nid) / n_gpus))[proc_id]

    # Create PyTorch DataLoader for constructing blocks
    sampler = dgl.dataloading.MultiLayerNeighborSampler(
        [int(fanout) for fanout in args.fan_out.split(',')])
    dataloader = dgl.dataloading.NodeDataLoader(
        train_g,
        train_nid,
        sampler,
        batch_size=args.batch_size,
        shuffle=True,
        drop_last=False,
        num_workers=args.num_workers)

    # Define model and optimizer
    model = SAGE(in_feats, args.num_hidden, n_classes, args.num_layers, F.relu, args.dropout)
    model = model.to(dev_id)
    if n_gpus > 1:
        model = DistributedDataParallel(model, device_ids=[dev_id], output_device=dev_id)
    loss_fcn = nn.CrossEntropyLoss()
    loss_fcn = loss_fcn.to(dev_id)
    optimizer = optim.Adam(model.parameters(), lr=args.lr)

    # Training loop
    avg = 0
    iter_tput = []
    for epoch in range(args.num_epochs):
        tic = time.time()

        # Loop over the dataloader to sample the computation dependency graph as a list of
        # blocks.
        for step, (input_nodes, seeds, blocks) in enumerate(dataloader):
            if proc_id == 0:
                tic_step = time.time()

            # Load the input features as well as output labels
            batch_inputs, batch_labels = load_subtensor(train_g, train_g.ndata['labels'], seeds, input_nodes, dev_id)
            blocks = [block.int().to(dev_id) for block in blocks]
            # Compute loss and prediction
            batch_pred = model(blocks, batch_inputs)
            loss = loss_fcn(batch_pred, batch_labels)
            optimizer.zero_grad()
            loss.backward()
            optimizer.step()

            if proc_id == 0:
                iter_tput.append(len(seeds) * n_gpus / (time.time() - tic_step))
            if step % args.log_every == 0 and proc_id == 0:
                acc = compute_acc(batch_pred, batch_labels)
                print('Epoch {:05d} | Step {:05d} | Loss {:.4f} | Train Acc {:.4f} | Speed (samples/sec) {:.4f} | GPU {:.1f} MiB'.format(
                    epoch, step, loss.item(), acc.item(), np.mean(iter_tput[3:]), th.cuda.max_memory_allocated() / 1000000))

        if n_gpus > 1:
            th.distributed.barrier()

        toc = time.time()
        if proc_id == 0:
            print('Epoch Time(s): {:.4f}'.format(toc - tic))
            if epoch >= 5:
                avg += toc - tic
            if epoch % args.eval_every == 0 and epoch != 0:
                if n_gpus == 1:
                    eval_acc = evaluate(
                        model, val_g, val_g.ndata['features'], val_g.ndata['labels'], val_nid, args.batch_size, devices[0])
                    test_acc = evaluate(
                        model, test_g, test_g.ndata['features'], test_g.ndata['labels'], test_nid, args.batch_size, devices[0])
                else:
                    eval_acc = evaluate(
                        model.module, val_g, val_g.ndata['features'], val_g.ndata['labels'], val_nid, args.batch_size, devices[0])
                    test_acc = evaluate(
                        model.module, test_g, test_g.ndata['features'], test_g.ndata['labels'], test_nid, args.batch_size, devices[0])
                print('Eval Acc {:.4f}'.format(eval_acc))
                print('Test Acc: {:.4f}'.format(test_acc))

    if n_gpus > 1:
        th.distributed.barrier()
    if proc_id == 0:
        print('Avg epoch time: {}'.format(avg / (epoch - 4)))

if __name__ == '__main__':
    argparser = argparse.ArgumentParser("multi-gpu training")
    argparser.add_argument('--gpu', type=str, default='0',
        help="Comma separated list of GPU device IDs.")
    argparser.add_argument('--num-epochs', type=int, default=20)
    argparser.add_argument('--num-hidden', type=int, default=16)
    argparser.add_argument('--num-layers', type=int, default=2)
    argparser.add_argument('--fan-out', type=str, default='10,25')
    argparser.add_argument('--batch-size', type=int, default=1000)
    argparser.add_argument('--log-every', type=int, default=20)
    argparser.add_argument('--eval-every', type=int, default=5)
    argparser.add_argument('--lr', type=float, default=0.003)
    argparser.add_argument('--dropout', type=float, default=0.5)
    argparser.add_argument('--num-workers', type=int, default=0,
        help="Number of sampling processes. Use 0 for no extra process.")
    argparser.add_argument('--inductive', action='store_true',
        help="Inductive learning setting")
    args = argparser.parse_args()

    devices = list(map(int, args.gpu.split(',')))
    n_gpus = len(devices)

    g, n_classes = load_reddit()
    # Construct graph
    g = dgl.as_heterograph(g)
    in_feats = g.ndata['features'].shape[1]

    if args.inductive:
        train_g, val_g, test_g = inductive_split(g)
    else:
        train_g = val_g = test_g = g

    # Create csr/coo/csc formats before launching training processes with multi-gpu.
    # This avoids creating certain formats in each sub-process, which saves momory and CPU.
    train_g.create_formats_()
    val_g.create_formats_()
    test_g.create_formats_()
    # Pack data
    data = in_feats, n_classes, train_g, val_g, test_g

    if n_gpus == 1:
        run(0, n_gpus, args, devices, data)
    else:
        procs = []
        for proc_id in range(n_gpus):
            p = mp.Process(target=thread_wrapped_func(run),
                           args=(proc_id, n_gpus, args, devices, data))
            p.start()
            procs.append(p)
        for p in procs:
            p.join()

{'repo_name': 'dmlc/dgl', 'stars': '5241', 'repo_language': 'Python', 'file_name': 'Util.cmake', 'mime_type': 'text/plain', 'hash': 5334560080644190199, 'source_dataset': 'data'}


function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./ProjectData"));
__export(require("./ProjectManager"));

{'repo_name': 'egret-labs/egret-core', 'stars': '3318', 'repo_language': 'JavaScript', 'file_name': 'promise.js', 'mime_type': 'text/plain', 'hash': -2674485662625042046, 'source_dataset': 'data'}


import datetime
from typing import Any, Dict, Optional, Sequence, Tuple

from django.views.generic.base import View
from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin
from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin

from django.db import models
from django.http import HttpRequest, HttpResponse

class YearMixin:
    year_format: str = ...
    year: Optional[str] = ...
    def get_year_format(self) -> str: ...
    def get_year(self) -> str: ...
    def get_next_year(self, date: datetime.date) -> Optional[datetime.date]: ...
    def get_previous_year(self, date: datetime.date) -> Optional[datetime.date]: ...

class MonthMixin:
    month_format: str = ...
    month: Optional[str] = ...
    def get_month_format(self) -> str: ...
    def get_month(self) -> str: ...
    def get_next_month(self, date: datetime.date) -> Optional[datetime.date]: ...
    def get_previous_month(self, date: datetime.date) -> Optional[datetime.date]: ...

class DayMixin:
    day_format: str = ...
    day: Optional[str] = ...
    def get_day_format(self) -> str: ...
    def get_day(self) -> str: ...
    def get_next_day(self, date: datetime.date) -> Optional[datetime.date]: ...
    def get_previous_day(self, date: datetime.date) -> Optional[datetime.date]: ...

class WeekMixin:
    week_format: str = ...
    week: Optional[str] = ...
    def get_week_format(self) -> str: ...
    def get_week(self) -> str: ...
    def get_next_week(self, date: datetime.date) -> Optional[datetime.date]: ...
    def get_previous_week(self, date: datetime.date) -> Optional[datetime.date]: ...

class DateMixin:
    date_field: Optional[str] = ...
    allow_future: bool = ...
    def get_date_field(self) -> str: ...
    def get_allow_future(self) -> bool: ...
    def uses_datetime_field(self) -> bool: ...

DatedItems = Tuple[Optional[Sequence[datetime.date]], Sequence[object], Dict[str, Any]]

class BaseDateListView(MultipleObjectMixin, DateMixin, View):
    date_list_period: str = ...
    def render_to_response(self, context: Dict[str, Any], **response_kwargs: Any) -> HttpResponse: ...
    def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
    def get_dated_items(self) -> DatedItems: ...
    def get_dated_queryset(self, **lookup: Any) -> models.query.QuerySet: ...
    def get_date_list_period(self) -> str: ...
    def get_date_list(
        self, queryset: models.query.QuerySet, date_type: Optional[str] = ..., ordering: str = ...
    ) -> models.query.QuerySet: ...

class BaseArchiveIndexView(BaseDateListView): ...
class ArchiveIndexView(MultipleObjectTemplateResponseMixin, BaseArchiveIndexView): ...

class BaseYearArchiveView(YearMixin, BaseDateListView):
    make_object_list: bool = ...
    def get_make_object_list(self) -> bool: ...

class YearArchiveView(MultipleObjectTemplateResponseMixin, BaseYearArchiveView): ...
class BaseMonthArchiveView(YearMixin, MonthMixin, BaseDateListView): ...
class MonthArchiveView(MultipleObjectTemplateResponseMixin, BaseMonthArchiveView): ...
class BaseWeekArchiveView(YearMixin, WeekMixin, BaseDateListView): ...
class WeekArchiveView(MultipleObjectTemplateResponseMixin, BaseWeekArchiveView): ...
class BaseDayArchiveView(YearMixin, MonthMixin, DayMixin, BaseDateListView): ...
class DayArchiveView(MultipleObjectTemplateResponseMixin, BaseDayArchiveView): ...
class BaseTodayArchiveView(BaseDayArchiveView): ...
class TodayArchiveView(MultipleObjectTemplateResponseMixin, BaseTodayArchiveView): ...
class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailView): ...
class DateDetailView(SingleObjectTemplateResponseMixin, BaseDateDetailView): ...

def timezone_today() -> datetime.date: ...

{'repo_name': 'srusskih/SublimeJEDI', 'stars': '894', 'repo_language': 'Python', 'file_name': 'test_utils.py', 'mime_type': 'text/x-python', 'hash': -5572180965479506952, 'source_dataset': 'data'}


/* eslint-disable
    camelcase,
    max-len,
    no-return-assign,
    no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
 * decaffeinate suggestions:
 * DS102: Remove unnecessary code created because of implicit returns
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
const SandboxedModule = require('sandboxed-module')
const assert = require('assert')
require('chai').should()
const sinon = require('sinon')
const modulePath = require('path').join(
  __dirname,
  '../../../../app/src/Features/Tags/TagsController.js'
)

describe('TagsController', function() {
  const userId = '123nd3ijdks'
  const projectId = '123njdskj9jlk'
  const tag = 'some_class101'

  beforeEach(function() {
    this.handler = {
      addProjectToTag: sinon.stub().callsArgWith(3),
      removeProjectFromTag: sinon.stub().callsArgWith(3),
      deleteTag: sinon.stub().callsArg(2),
      renameTag: sinon.stub().callsArg(3),
      createTag: sinon.stub()
    }
    this.AuthenticationController = {
      getLoggedInUserId: req => {
        return req.session.user._id
      }
    }
    this.controller = SandboxedModule.require(modulePath, {
      globals: {
        console: console
      },
      requires: {
        './TagsHandler': this.handler,
        'logger-sharelatex': {
          log() {},
          err() {}
        },
        '../Authentication/AuthenticationController': this
          .AuthenticationController
      }
    })
    this.req = {
      params: {
        projectId
      },
      session: {
        user: {
          _id: userId
        }
      }
    }

    this.res = {}
    this.res.status = sinon.stub().returns(this.res)
    this.res.end = sinon.stub()
    return (this.res.json = sinon.stub())
  })

  describe('getAllTags', function() {
    it('should ask the handler for all tags', function(done) {
      const allTags = [{ name: 'tag', projects: ['123423', '423423'] }]
      this.handler.getAllTags = sinon.stub().callsArgWith(1, null, allTags)
      return this.controller.getAllTags(this.req, {
        json: body => {
          body.should.equal(allTags)
          this.handler.getAllTags.calledWith(userId).should.equal(true)
          return done()
        }
      })
    })
  })

  describe('createTag', function() {
    beforeEach(function() {
      this.handler.createTag.callsArgWith(2, null, (this.tag = { mock: 'tag' }))
      this.req.session.user._id = this.userId = 'user-id-123'
      this.req.body = { name: (this.name = 'tag-name') }
      return this.controller.createTag(this.req, this.res)
    })

    it('should create the tag in the backend', function() {
      return this.handler.createTag
        .calledWith(this.userId, this.name)
        .should.equal(true)
    })

    it('should return the tag', function() {
      return this.res.json.calledWith(this.tag).should.equal(true)
    })
  })

  describe('deleteTag', function() {
    beforeEach(function() {
      this.req.params.tagId = this.tagId = 'tag-id-123'
      this.req.session.user._id = this.userId = 'user-id-123'
      return this.controller.deleteTag(this.req, this.res)
    })

    it('should delete the tag in the backend', function() {
      return this.handler.deleteTag
        .calledWith(this.userId, this.tagId)
        .should.equal(true)
    })

    it('should return 204 status code', function() {
      this.res.status.calledWith(204).should.equal(true)
      return this.res.end.called.should.equal(true)
    })
  })

  describe('renameTag', function() {
    beforeEach(function() {
      this.req.params.tagId = this.tagId = 'tag-id-123'
      return (this.req.session.user._id = this.userId = 'user-id-123')
    })

    describe('with a name', function() {
      beforeEach(function() {
        this.req.body = { name: (this.name = 'new-name') }
        return this.controller.renameTag(this.req, this.res)
      })

      it('should delete the tag in the backend', function() {
        return this.handler.renameTag
          .calledWith(this.userId, this.tagId, this.name)
          .should.equal(true)
      })

      it('should return 204 status code', function() {
        this.res.status.calledWith(204).should.equal(true)
        return this.res.end.called.should.equal(true)
      })
    })

    describe('without a name', function() {
      beforeEach(function() {
        return this.controller.renameTag(this.req, this.res)
      })

      it('should not call the backend', function() {
        return this.handler.renameTag.called.should.equal(false)
      })

      it('should return 400 (bad request) status code', function() {
        this.res.status.calledWith(400).should.equal(true)
        return this.res.end.called.should.equal(true)
      })
    })
  })

  describe('addProjectToTag', function() {
    beforeEach(function() {
      this.req.params.tagId = this.tagId = 'tag-id-123'
      this.req.params.projectId = this.projectId = 'project-id-123'
      this.req.session.user._id = this.userId = 'user-id-123'
      return this.controller.addProjectToTag(this.req, this.res)
    })

    it('should add the tag to the project in the backend', function() {
      return this.handler.addProjectToTag
        .calledWith(this.userId, this.tagId, this.projectId)
        .should.equal(true)
    })

    it('should return 204 status code', function() {
      this.res.status.calledWith(204).should.equal(true)
      return this.res.end.called.should.equal(true)
    })
  })

  describe('removeProjectFromTag', function() {
    beforeEach(function() {
      this.req.params.tagId = this.tagId = 'tag-id-123'
      this.req.params.projectId = this.projectId = 'project-id-123'
      this.req.session.user._id = this.userId = 'user-id-123'
      return this.controller.removeProjectFromTag(this.req, this.res)
    })

    it('should remove the tag from the project in the backend', function() {
      return this.handler.removeProjectFromTag
        .calledWith(this.userId, this.tagId, this.projectId)
        .should.equal(true)
    })

    it('should return 204 status code', function() {
      this.res.status.calledWith(204).should.equal(true)
      return this.res.end.called.should.equal(true)
    })
  })
})

{'repo_name': 'overleaf/web', 'stars': '278', 'repo_language': 'JavaScript', 'file_name': 'TagsHandler.js', 'mime_type': 'text/plain', 'hash': 6790888411895380362, 'source_dataset': 'data'}


/* Generated by RuntimeBrowser
   Image: /System/Library/PrivateFrameworks/Celestial.framework/Celestial
 */

@interface FigCheckpointSupport : NSObject {
    struct FigCheckpointSupportPrivate { } * _priv;
}

+ (id)makeDictionary;

@end

{'repo_name': 'nst/iOS-Runtime-Headers', 'stars': '7551', 'repo_language': 'Objective-C', 'file_name': 'NPNameParser.h', 'mime_type': 'text/plain', 'hash': -4073142011648416656, 'source_dataset': 'data'}


package com.manning.gia.todo;

import com.manning.gia.todo.utils.CommandLineInput;
import com.manning.gia.todo.utils.CommandLineInputHandler;

public class ToDoApp {
    public static final char DEFAULT_INPUT = '\u0000';

    public static void main(String args[]) {
        CommandLineInputHandler commandLineInputHandler = new CommandLineInputHandler();
        char command = DEFAULT_INPUT;

        while (CommandLineInput.EXIT.getShortCmd() != command) {
            commandLineInputHandler.printOptions();
            String input = commandLineInputHandler.readInput();
            char[] inputChars = input.length() == 1 ? input.toCharArray() : new char[]{DEFAULT_INPUT};
            command = inputChars[0];
            CommandLineInput commandLineInput = CommandLineInput.getCommandLineInputForInput(command);
            commandLineInputHandler.processInput(commandLineInput);
        }
    }
}

{'repo_name': 'bmuschko/gradle-in-action-source', 'stars': '462', 'repo_language': 'Java', 'file_name': 'Main.java', 'mime_type': 'text/x-c', 'hash': 182629513438595196, 'source_dataset': 'data'}


/*------------------------------------------------------------------------*/
/* Sample code of OS dependent controls for FatFs                         */
/* (C)ChaN, 2012                                                          */
/*------------------------------------------------------------------------*/

#include <rtthread.h>
#include <stdlib.h>		/* ANSI memory controls */
#include <stdio.h>
#include "ff.h"
#include "global.h"

//static rt_mutex_t fatfs_mutex;

#if _FS_REENTRANT
/*------------------------------------------------------------------------*/
/* Create a Synchronization Object
--------------------------------------------------------------------------*/
/* This function is called by f_mount() function to create a new
/  synchronization object, such as semaphore and mutex. When a 0 is
/  returned, the f_mount() function fails with FR_INT_ERR.
*/

int ff_cre_syncobj (	/* 1:Function succeeded, 0:Could not create due to any error */
	BYTE vol,			/* Corresponding logical drive being processed */
	_SYNC_t* sobj		/* Pointer to return the created sync object */
)
{
	static int mutex_id = 0;
	int ret;
	char name[10];
	sprintf(name, "fatfs%d", mutex_id);

	*sobj = rt_mutex_create (name, RT_IPC_FLAG_PRIO);
	mutex_id++;
	ret = (*sobj!=RT_NULL);

	return ret;
}

/*------------------------------------------------------------------------*/
/* Delete a Synchronization Object                                        */
/*------------------------------------------------------------------------*/
/* This function is called in f_mount() function to delete a synchronization
/  object that created with ff_cre_syncobj() function. When a 0 is
/  returned, the f_mount() function fails with FR_INT_ERR.
*/

int ff_del_syncobj (	/* 1:Function succeeded, 0:Could not delete due to any error */
	_SYNC_t sobj		/* Sync object tied to the logical drive to be deleted */
)
{
	int ret;

	rt_err_t err = rt_mutex_delete(sobj);
	ret = (err == RT_EOK);

	return ret;
}

/*------------------------------------------------------------------------*/
/* Request Grant to Access the Volume                                     */
/*------------------------------------------------------------------------*/
/* This function is called on entering file functions to lock the volume.
/  When a FALSE is returned, the file function fails with FR_TIMEOUT.
*/

int ff_req_grant (	/* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
	_SYNC_t sobj	/* Sync object to wait */
)
{
	int ret;

	rt_err_t err = rt_mutex_take(sobj, _FS_TIMEOUT);

	ret = (err == RT_EOK);

	return ret;
}

/*------------------------------------------------------------------------*/
/* Release Grant to Access the Volume                                     */
/*------------------------------------------------------------------------*/
/* This function is called on leaving file functions to unlock the volume.
*/

void ff_rel_grant (
	_SYNC_t sobj	/* Sync object to be signaled */
)
{
	rt_mutex_release(sobj);
}

#endif

#if _USE_LFN == 3	/* LFN with a working buffer on the heap */
/*------------------------------------------------------------------------*/
/* Allocate a memory block                                                */
/*------------------------------------------------------------------------*/
/* If a NULL is returned, the file function fails with FR_NOT_ENOUGH_CORE.
*/

void* ff_memalloc (	/* Returns pointer to the allocated memory block */
	UINT msize		/* Number of bytes to allocate */
)
{
	return rt_malloc(msize);
}

/*------------------------------------------------------------------------*/
/* Free a memory block                                                    */
/*------------------------------------------------------------------------*/

void ff_memfree (
	void* mblock	/* Pointer to the memory block to free */
)
{
	rt_free(mblock);
}

#endif

{'repo_name': 'JcZou/StarryPilot', 'stars': '215', 'repo_language': 'C', 'file_name': 'log_parse.prj', 'mime_type': 'text/plain', 'hash': 444998115007184142, 'source_dataset': 'data'}


// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

assertTrue(/(\u039C)/i.test("\xB5"));
assertTrue(/(\u039C)+/i.test("\xB5"));
assertTrue(/(\u039C)/ui.test("\xB5"));
assertTrue(/(\u039C)+/ui.test("\xB5"));

assertTrue(/(\u03BC)/i.test("\xB5"));
assertTrue(/(\u03BC)+/i.test("\xB5"));
assertTrue(/(\u03BC)/ui.test("\xB5"));
assertTrue(/(\u03BC)+/ui.test("\xB5"));

assertTrue(/(\u03BC)/i.test("\u039C"));
assertTrue(/(\u03BC)+/i.test("\u039C"));
assertTrue(/(\u03BC)/ui.test("\u039C"));
assertTrue(/(\u03BC)+/ui.test("\u039C"));

assertTrue(/(\u0178)/i.test("\xFF"));
assertTrue(/(\u0178)+/i.test("\xFF"));
assertTrue(/(\u0178)/ui.test("\xFF"));
assertTrue(/(\u0178)+/ui.test("\xFF"));

{'repo_name': 'arangodb/arangodb', 'stars': '9984', 'repo_language': 'C++', 'file_name': 'test.jam', 'mime_type': 'text/x-java', 'hash': -2092152165231554776, 'source_dataset': 'data'}


# WasmWinforms
[![Build status](https://ci.appveyor.com/api/projects/status/2s546s2fs3oqjfke?svg=true)](https://ci.appveyor.com/project/roozbehid/wasmwinforms)
[![Nuget](https://img.shields.io/nuget/v/Winforms.Wasm.svg)](https://www.nuget.org/packages/Winforms.Wasm/)

C# Winforms can now work in your browser!
Wasm.Winforms is a nuget package that you can install and use your codes unchanged and run it on your browser!

# Try it online
- https://webassembly.z19.web.core.windows.net/ some random controls doing nothing!
- https://webassembly.z19.web.core.windows.net/Calculator/ demo compiled unchanged from [here](https://code.msdn.microsoft.com/windowsdesktop/Simple-Calculator-54ec8e4a)

# How to use
- Create a Winforms application from Visual Studio. (Note: Winforms are full .Net applications)
- Create an empty .Net Core App from Visual Studio. Add all files from full .net application directory into it. (For example, add Form1.cs,Form1.Designer.cs, Form1.resx, Program.cs .You can add those files as links too.)
- Install latest version of Winforms.Wasm nuget from nuget.org.
- Build your project.
- You can debug Win32 (32bit version) of your code in Visual Studio. (Make sure you have 32bit version of dotnet installed! (it should be in Program Files (x86)\dotnet\dotnet.exe)
- Looking at your OUTPUT DIRECTORY\dist\ you will find your index.html to run!

# How it works
This project uses mono to run your C# IL code.
Also coming with this distribution are System.Drawing and System.Windows.Forms dlls.
Winforms implementation requires many C libraries that I was also ported into WebAssembly. You can find out about them looking into their submodules!

# How to compile/build
This project uses another amazing ( :D ) project of mine: [GCCBuild](https://github.com/roozbehid/dotnet-vcxproj) which enables you to use any compiler to compile Visual Studio C/C++ projects in any OS.
Meaning you can have Visual Studio C/C++ project files and use them to compile both for Windows/Linux and also WebAssembly. You need to have Emscripten installed, activated and already accessible from your path.
First from Visual Studio build switch to Release-x86 then build solution, then do the same for WasmRel-x86.
This way you have all libraries compiled for Win32 and also WebAssembly.
Then in your `\Output\bin\x86\Release` folder you can issue a nuget pack and use that nuget.

When you build an application using this nuget, look for `dist` folder which contains your index.html.
Using Win32 compiled libraries are way easier to debug and run your application.

Please note that compiling mono-wasm project should only be done in WasmRel or WasmDbg targets and it would take a minute or two to complete!

# Why is it so slow/buggy?
You need to download good amount of files to run it. All dlls and big .wasm and .js files have to be downloaded.
File issues and submit pull request so it will be faster/less buggy!
There are many many bugs and this project/product is not at all recommended for production. It is pre-alpha phase!

# We have many better UI frameworks for browsers and web, why use Winforms?!
Well that is a really good question that you have to answer!
For me it was a fun project. But many companies are still using old programs and they would like to use them as-is in a browser, so it would open tons of new oppurtunities for those programs!

# Things to do - You can pick one and contribute!
- Update mono Winforms to latest version
- Update mono version being used. Mono is rapidly changing/improving their WebAssembly technology....
- Use AOT mono
- Find bugs in libgdiplus that causes memory leaks
- Improvements to amazing Microwindows project and make it in-sync

{'repo_name': 'roozbehid/WasmWinforms', 'stars': '421', 'repo_language': 'C#', 'file_name': 'ChangeLog', 'mime_type': 'text/plain', 'hash': 8212636991784753838, 'source_dataset': 'data'}


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

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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="author" content="Mikio Hirabayashi" />
<link rel="contents" href="./" />
<link rel="icon" href="icon16.png" />
<link rev="made" href="mailto:mikio@users.sourceforge.net" />
<title>データベースライブラリ QDBM</title>

QDBM: Quick Database Manager

Copyright (C) 2000-2007 Mikio Hirabayashi

Last Update: Thu, 26 Oct 2006 15:00:20 +0900

[English/Japanese]

概要

QDBMはデータベースを扱うルーチン群のライブラリです。データベースといっても単純なもので、キーと値のペアからなるレコード群を格納したデータファイルです。キーと値は任意の長さを持つ一連のバイト列であり、文字列でもバイナリでも扱うことができます。テーブルやデータ型の概念はありません。レコードはハッシュ表またはB+木で編成されます。

ハッシュ表のデータベースでは、キーはデータベース内で一意であり、キーが重複する複数のレコードを格納することはできません。このデータベースに対しては、キーと値を指定してレコードを格納したり、キーを指定して対応するレコードを削除したり、キーを指定して対応するレコードを検索したりすることができます。また、データベースに格納してある全てのキーを順不同に一つずつ取り出すこともできます。このような操作は、UNIX標準で定義されているDBMライブラリおよびその追従であるNDBMやGDBMに類するものです。QDBMはDBMのより良い代替として利用することができます。

B+木のデータベースでは、キーが重複する複数のレコードを格納することができます。このデータベースに対しては、ハッシュ表のデータベースと同様に、キーを指定してレコードを格納したり取り出したり削除したりすることができます。レコードはユーザが指示した比較関数に基づいて整列されて格納されます。カーソルを用いて各レコードを昇順または降順で参照することができます。この機構によって、文字列の前方一致検索や数値の範囲検索が可能になります。また、B+木のデータベースではトランザクションが利用できます。

QDBMはCで記述され、C、C++、Java、PerlおよびRubyのAPIとして提供されます。QDBMはPOSIX準拠のAPIを備えるプラットフォームで利用できます。QDBMはGNU Lesser General Public Licenseに基づくフリーソフトウェアです。

文書

以下の文書をお読みください。ソースパッケージにも同じものが含まれています。

基本仕様書

C++用API仕様書

Java用API仕様書

Perl用API仕様書

Ruby用API仕様書

CGIスクリプト仕様書

チュートリアル

ダウンロード

以下のパッケージをダウンロードしてください。Linux用バイナリパッケージは、CとC++とJavaのAPIと、CGIスクリプトを納めています。Windows用バイナリパッケージは、CとJavaのAPIと、CGIスクリプトを納めています。

最新のソースパッケージ（バージョン1.8.77）

過去のバージョン

Linux用バイナリパッケージ（RPM）

Windows用バイナリパッケージ

関連するパッケージ

FreeBSD用パッケージ

Solaris用パッケージ

HP-UX用パッケージ

RISC OS用パッケージ

アプリケーション

QDBMのアプリケーションには以下のものがあります。もしあなたのプロジェクトがQDBMを使っているなら、連絡をいただければこのリストに追加いたします。

Hyper Estraier : 平林幹雄による共同体的全文検索システム

Estraier : 平林幹雄による個人用全文検索システム

Diqt : 平林幹雄による多言語辞書検索システム

RBBS : 平林幹雄によるWeb掲示板システム

Harvest : Kang-Jin Leeらによる分散情報検索システム

Bogofilter : Eric S. Raymondらによるベイズ式スパムメールフィルタ

MQS : Alexandre Dulaunoyによるキュー管理サービス

Ruby/Odeum : Zed A. Shawによる転置APIのRuby用インターフェイス

Surfulater : Soft As it Gets Pty社によるWebページスクラップブック

Mutt-NG : Andreas Krennmairらによるテキスト型メールクライアント

SMFS : Eugene KurmaninによるSendmail用フィルタシステム

Dixit : Octavian Procopiucによるルーマニア語辞書検索システム

兄弟

UNIX標準のDBMに追従したライブラリはたくさんあります。それぞれ特徴がありますので、あなたの製品にとって都合がいいものを選んでください。NDBMは古いので、もはや使う理由はないでしょう。SDBMはApache Projectで管理され、GDBMはGNU Projectで管理されています。それらは最も人気があり、また数多くテストされているものでしょう。TDBはSamba Teamで管理されており、複数同時の書き込みが可能です。TinyCDBは随時の更新はできませんが、最も高速に動作します。Berkeley DBは非常に多機能で、ACID準拠で、多くの商用製品で使われています。最後に、QDBMは性能と機能と移植性と利便性のバランスがとれた製品です。

NDBM : BSDによるNew DBM

SDBM : Ozan S. YigitによるSubstitute DBM

GDBM : Philip A. NelsonらによるGNU Database Manager

TDB : Andrew TridgellらによるTrivial Database

TinyCDB :  Michael TokarevによるConstant Database

Berkeley DB : Sleepycat Software社によるBerkeley DB

ベンチマークテストのレポート

Tokyo Cabinet : QDBMの後継製品

その他の情報

QDBMは平林幹雄が作成しました。作者と連絡をとるには、`mikio@users.sourceforge.net' 宛に電子メールを送ってください。ただし、質問やバグレポートなど、他のユーザと共有できる話題はメーリングリストに送ってください。メーリングリストの参加方法については、`http://lists.sourceforge.net/lists/listinfo/qdbm-users' を参照してください。

SourceForge.netにおけるプロジェクトページは `<a href="http://sourceforge.net/projects/qdbm/">http://sourceforge.net/projects/qdbm/</a>' にあります。Freshmeatにおける更新情報は `http://freshmeat.net/projects/qdbm/' から参照できます。

{'repo_name': 'boxbackup/boxbackup', 'stars': '102', 'repo_language': 'C++', 'file_name': 'VCmakefile-old', 'mime_type': 'text/plain', 'hash': -2707155984868257676, 'source_dataset': 'data'}


# SuperPlayer

SuperPlayer(超级播放器)是基于[腾讯云移动直播](https://cloud.tencent.com/document/product/454/7873)的播放器，能快速的集成视频信息拉取、横竖屏切换、清晰度选择、弹幕、直播时移等功能。灵活易用，可高度定制和二次开发。

## 概述

开发一个全功能播放器不止简单的能播放视频，还有要处理旋转、前后台切换、界面显示等一系列问题。SuperPlayer作为一个集成方案，几乎囊括了所有播放器应该具备的特性，大大减少界面开发工作量。SuperPlayer内部使用腾讯云自研的 TXLivePlayer 和 TXVodPlayer，比系统自带的AVPlayer支持更多格式和功能，打开速度更快，兼容性更好。

本播放器所有功能免费，无任何限制，可放心使用。

## 功能特性

- [x] 高可定制
- [x] 直播、点播首屏秒开
- [x] 码率自适应
- [x] 清晰度无缝切换
- [x] 支持小窗播放
- [x] 支持变速播
- [x] 直接加密视频
- [x] 支持设置封面图
- [x] 弹幕
- [x] 直播时移
- [x] 手势操作（调整亮度、声音、进度）
- [x] 截图
- [x] 支持视频旋转、镜像
- [x] 支持视频适应、填充模式
- [x] 支持265硬解
- [x] 支持RTMP、FLV、HLS、MP4
- [x] 支持HTTPS
- [x] 支持视频根据旋转角度自动旋转
- [x] 支持播放预加载
- [x] 支持多码率HLS
- [x] 支持软硬解自动切换
- [x] 支持 HLS 和 MP4 边播边下
- [x] 支持 HLS 离线下载
- [x] 支持断点下载
- [x] 支持 SEI 数据回调
- [x] 支持纯音频播放
- [x] 支持后台播放
- [x] 支持播放器静音
- [x] 支持循环播放
- [x] 支持自定义渲染
- [x] 支持自定义声音处理
- [x] 支持自定义HTTP Headers
- [x] 支持快速seek
- [x] 支持设置进度回调间隔
- [x] 支持视频缩略图
- [x] 支持进度打点

## 快速开始

本项目支持cocoapods安装，只需要将如下代码添加到Podfile中：
```
pod 'SuperPlayer'
```
执行pod install或pod update.

## 集成使用

在[快速集成](https://github.com/tencentyun/SuperPlayer/wiki/Home)中介绍了主要功能使用。

本项目详细文档位于
https://github.com/tencentyun/SuperPlayer/wiki

## 联系方式
+ Issues: https://github.com/tencentyun/SuperPlayer/issues
+ QQ群: 781719018

{'repo_name': 'tencentyun/SuperPlayer_iOS', 'stars': '889', 'repo_language': 'None', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 7374073618226432181, 'source_dataset': 'data'}


# _murex_ Shell Docs

## Data-Type Reference: `hcl`

> HashiCorp Configuration Language (HCL)

## Description

The description below is taken from the HCL git repository's [README](https://github.com/hashicorp/hcl):

> HCL (HashiCorp Configuration Language) is a configuration language built by
> HashiCorp. The goal of HCL is to build a structured configuration language
> that is both human and machine friendly for use with command-line tools, but
> specifically targeted towards DevOps tools, servers, etc.
>
> HCL is also fully JSON compatible. That is, JSON can be used as completely
> valid input to a system expecting HCL. This helps makes systems interoperable
> with other systems.

HCL support within _murex_ is pretty mature however it is not considered a
primitive. Which means, while it is a recommended builtin which you should
expect in most deployments of _murex_, it's still an optional package and
thus may not be present in some edge cases. This is because it relies on
external source packages for the shell to compile.

## Examples

    terraform {
      required_version = "~> 0.11.5"
    }

    data "aws_availability_zones" "available" {}

    data "aws_vpc" "vpc" {
      id = "${var.vpc_id}"
    }

    data "aws_route53_zone" "external" {
      zone_id = "${var.external_hosted_zone_id}"
    }

    data "aws_iam_policy_document" "assume_role_policy" {
      statement {
        actions = ["sts:AssumeRole"]
        effect  = "Allow"

        principals {
          identifiers = ["ec2.amazonaws.com"]
          type        = "Service"
        }
      }
    }

See the HashiCorp's [documentation](https://github.com/hashicorp/hcl) for HCL syntax.

## Default Associations

* **Extension**: `hcl`
* **Extension**: `tf`
* **Extension**: `tfvars`
* **MIME**: `application/hcl`
* **MIME**: `application/x-hcl`
* **MIME**: `text/hcl`
* **MIME**: `text/x-hcl`

## Supported Hooks

* `Marshal()`
    Supported via a JSON marshaller because HCL is designed to be written by humans but "compiled" into JSON
* `ReadArray()`
    Works with HCL arrays. Maps are converted into arrays
* `ReadIndex()`
    Works against all properties in HCL
* `ReadMap()`
    Works with HCL maps
* `ReadNotIndex()`
    Works against all properties in HCL
* `Unmarshal()`
    Supported
* `WriteArray()`
    Works with HCL arrays

## See Also

* [apis/`Marshal()` ](../apis/marshal.md):
  Converts structured memory into a structured file format (eg for stdio)
* [apis/`Unmarshal()` ](../apis/unmarshal.md):
  Converts a structured file format into structured memory
* [commands/`[[` (element)](../commands/element.md):
  Outputs an element from a nested structure
* [commands/`[` (index)](../commands/index.md):
  Outputs an element from an array, map or table
* [commands/`cast`](../commands/cast.md):
  Alters the data type of the previous function without altering it's output
* [commands/`format`](../commands/format.md):
  Reformat one data-type into another data-type
* [types/`json` ](../types/json.md):
  JavaScript Object Notation (JSON) (primitive)
* [types/`jsonl` ](../types/jsonl.md):
  JSON Lines (primitive)
* [commands/`pretty`](../commands/pretty.md):
  Prettifies JSON to make it human readable
* [commands/`runtime`](../commands/runtime.md):
  Returns runtime information on the internal state of _murex_
* [types/`yaml` ](../types/yaml.md):
  YAML Ain't Markup Language (YAML)
* [types/mxjson](../types/mxjson.md):
  Murex-flavoured JSON (primitive)
* [commands/open](../commands/open.md):

* [apis/readarray](../apis/readarray.md):

* [apis/readindex](../apis/readindex.md):

* [apis/readmap](../apis/readmap.md):

* [apis/readnotindex](../apis/readnotindex.md):

* [apis/writearray](../apis/writearray.md):

{'repo_name': 'lmorg/murex', 'stars': '152', 'repo_language': 'Go', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -8127421996112736662, 'source_dataset': 'data'}