/* Hyperscript compatible DSL for creating virtual HAST trees.
964399
function h(selector, properties) {
    var node = parseSelector(selector, defaultTagName)
    var children = Array.prototype.slice.call(arguments, 2)
    var property

    if (properties && isChildren(properties, node)) {
      children.unshift(properties)
      properties = null
    }

    if (properties) {
      for (property in properties) {
        addProperty(node.properties, property, properties[property])
      }
    }

    addChild(node.children, children)

    if (node.tagName === 'template') {
      node.content = {type: 'root', children: node.children}
      node.children = []
    }

    return node
  }
157486
function parseChildrenProperties( root, libs, com, indent ) {
  if (!Array.isArray( root.children )) {
    root.children = [ ];
  }
  root.children.forEach( function( child ) {
    debugger;
    if ( child.type != libs.Tree.TAG ) {
      return;
    }
    libs.compileChildren( child );

    if ( typeof child.attribs === 'undefined' ) {
      child.attribs = {};
    }
    if ( child.attribs.json === null ) {
      parsePropertyJSON( child, libs, com );
    }
    else {
      // By default, this is a list.
      parsePropertyList( child, libs, com, indent + "  " );
    }
  });
}
361031
function makeReflectTypes(uniforms, useIndex) {
  var obj = {}
  for(var i=0; i<uniforms.length; ++i) {
    var n = uniforms[i].name
    var parts = n.split(".")
    var o = obj
    for(var j=0; j<parts.length; ++j) {
      var x = parts[j].split("[")
      if(x.length > 1) {
        if(!(x[0] in o)) {
          o[x[0]] = []
        }
        o = o[x[0]]
        for(var k=1; k<x.length; ++k) {
          var y = parseInt(x[k])
          if(k<x.length-1 || j<parts.length-1) {
            if(!(y in o)) {
              if(k < x.length-1) {
                o[y] = []
              } else {
                o[y] = {}
              }
            }
            o = o[y]
          } else {
            if(useIndex) {
              o[y] = i
            } else {
              o[y] = uniforms[i].type
            }
          }
        }
      } else if(j < parts.length-1) {
        if(!(x[0] in o)) {
          o[x[0]] = {}
        }
        o = o[x[0]]
      } else {
        if(useIndex) {
          o[x[0]] = i
        } else {
          o[x[0]] = uniforms[i].type
        }
      }
    }
  }
  return obj
}
222975
def _variant_to_dsl_helper(tokens) -> Variant:
    
    kind = tokens[KIND]

    if kind == HGVS:
        return hgvs(tokens[IDENTIFIER])

    if kind == GMOD:
        return gmod(
            name=tokens[IDENTIFIER][NAME],
            namespace=tokens[IDENTIFIER][NAMESPACE],
        )

    if kind == PMOD:
        return pmod(
            name=tokens[IDENTIFIER][NAME],
            namespace=tokens[IDENTIFIER][NAMESPACE],
            code=tokens.get(PMOD_CODE),
            position=tokens.get(PMOD_POSITION),
        )

    if kind == FRAGMENT:
        start, stop = tokens.get(FRAGMENT_START), tokens.get(FRAGMENT_STOP)
        return fragment(
            start=start,
            stop=stop,
            description=tokens.get(FRAGMENT_DESCRIPTION)
        )

    raise ValueError('invalid fragment kind: {}'.format(kind))
1159305
private ObjectJS jsonTreeNode(CallTreeNode node, StringifierFactory jsonStringifierFactory) {
		final ObjectJS nodeJS = ObjectJS.create(node, jsonStringifierFactory);
		if (!node.getChildren().isEmpty()) {
			final ArrayJS childNodesJS=new ArrayJS(node.getChildren().size());
			for(CallTreeNode childNode:node.getChildren()) {
				childNodesJS.addElement(jsonTreeNode(childNode, jsonStringifierFactory));
			}
			nodeJS.setAttribute("children", childNodesJS);
		}
		return nodeJS;
	}
580037
function createBasicTranslation(memberName, type, i, options) {
  var node = {};

  node["id"] = memberName;
  node["type"] = type;

  if (i["inheritdoc"] !== undefined) {
    node["inheritdoc"] = i["inheritdoc"].src;
  }
  else if (i["doc"] !== undefined) {
    node["description"] = i["doc"];
    // short description lasts until the first empty line
    node["short_description"] = node["description"].replace(/\n\n[\s\S]*$/, '\n');
  }
  else {
    node["undocumented"] = true;
  }

  node["line"] = i["linenr"];

  if (i["private"] !== undefined)
    node["private"] = i["private"];

  if (i["experimental"] !== undefined)
    node["experimental"] = i["experimental"];

  if (i["ignore"] !== undefined)
    node["ignore"] = i["ignore"];
    
  if (i["chainable"] !== undefined)
    node["chainable"] = i["chainable"];

  if (i["see"] !== undefined)
    node["related_to"] = i["see"].name;

  if (i["author"] !== undefined && i["author"].length > 0)
    node["author"] = i["author"].doc;
  
  if (i["version"] !== undefined)
    node["version"] = i["version"].doc;
  
  if (i["since"] !== undefined)
    node["since"] = i["since"].doc;

  if (i["author"] !== undefined)
    node["author"] = i["author"];

  if (i["related"] !== undefined)
    node["related"] = i["related"].name;

  if (options.customTags) {
    _.each(options.customTags, function(tag) {
      if (i[tag] !== undefined)
        node[tag] = i[tag];
    });
  }

  return node;
}
639369
function buildNamespaceReexport(meta, namespace, checkExport) {
    checkExport();
    return babelTemplate.statement(`
        (function() {
          for (var key in NAMESPACE) {
            if (NAMESPACE == null || !NAMESPACE.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;
            VERIFY_NAME_LIST;
            exports[key] = NAMESPACE[key];
          }
        })();
    `)({
        NAMESPACE: namespace,
        VERIFY_NAME_LIST: meta.exportNameListName
            ? babelTemplate.statement(`
                if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
            `)({EXPORTS_LIST: meta.exportNameListName})
            : null
    });
}
1156684
def virtual(cls, **options):
    
    def wrapped(func):
        param_name = inflection.underscore(func.__name__)
        options.setdefault('name', param_name)

        if 'flags' in options:
            if isinstance(options['flags'], set):
                options['flags'].add('Virtual')
                options['flags'].add('ReadOnly')
            else:
                options['flags'] |= (cls.Flags.Virtual | cls.Flags.ReadOnly)
        else:
            options['flags'] = {'Virtual', 'ReadOnly'}

        def define_setter():
            def setter_wrapped(setter_func):
                func.__orb__.setFlags(func.__orb__.flags() & ~cls.Flags.ReadOnly)
                func.__orb__.setter()(setter_func)
                return setter_func
            return setter_wrapped

        def define_query_filter():
            def shortcut_wrapped(shortcut_func):
                func.__orb__.queryFilter(shortcut_func)
                return shortcut_func
            return shortcut_wrapped

        func.__orb__ = cls(**options)
        func.__orb__.getter()(func)
        func.setter = define_setter
        func.queryFilter = define_query_filter
        return func
    return wrapped
561239
function js2dtCLI (jsonFile, ramlTypeName) {
  const jsonData = fs.readFileSync(jsonFile).toString()

  if (ramlTypeName != null) {
    const raml = js2dt.js2dt(jsonData, ramlTypeName)
    return `#%RAML 1.0 Library\n${yaml.safeDump({ types: raml }, { 'noRefs': true })}`
  } else {
    const typeName = 'this__should__be__the__only__type'
    const raml = js2dt.js2dt(jsonData, typeName)

    const keys = Object.keys(raml)
    if (keys.length !== 1 || !keys.includes(typeName)) {
      throw new Error(`There is more than one type (${JSON.stringify(keys)}), please specify a name for the raml library`)
    }

    return `#%RAML 1.0 DataType\n${yaml.safeDump(raml[typeName], { 'noRefs': true })}`
  }
}
605715
function jsTreeCtrl() {
        /*jshint validthis:true */
        var nodeSerialId = 1;
        var vm = this;

        vm.nodesFingerprint = function (e) {
            if (!e.__uiNodeId) {
                e.__uiNodeId = nodeSerialId++;
            }
            return '' + e.__uiNodeId + (e.id || '') + (e.text || '') + (e.type || '');
        };

        vm.changeWatcher = function (arraySource, tokenFn) {
            var self;
            var getTokens = function () {
                var result = [], token, el;
                if (arraySource) {
                    var array = angular.isFunction(arraySource) ? arraySource() : arraySource;
                    for (var i = 0, n = array.length; i < n; i++) {
                        el = array[i];
                        token = tokenFn(el);
                        map[token] = el;
                        result.push(token);
                    }
                }
                return result;
            };
            // returns elements in that are in a but not in b
            // subtractAsSets([4, 5, 6], [4, 5, 7]) => [6]
            var subtractAsSets = function (a, b) {
                var result = [], inB = {}, i, n;
                for (i = 0, n = b.length; i < n; i++) {
                    inB[b[i]] = true;
                }
                for (i = 0, n = a.length; i < n; i++) {
                    if (!inB[a[i]]) {
                        result.push(a[i]);
                    }
                }
                return result;
            };

            // Map objects to tokens and vice-versa
            var map = {};

            var applyChanges = function (newTokens, oldTokens) {
                var i, n, el, token;
                var replacedTokens = {};
                var removedTokens = subtractAsSets(oldTokens, newTokens);
                for (i = 0, n = removedTokens.length; i < n; i++) {
                    var removedToken = removedTokens[i];
                    el = map[removedToken];
                    delete map[removedToken];
                    var newToken = tokenFn(el);
                    // if the element wasn't removed but simply got a new token, its old token will be different from the current one
                    if (newToken === removedToken) {
                        self.onRemoved(el);
                    } else {
                        replacedTokens[newToken] = removedToken;
                        self.onChanged(el);
                    }
                }

                var addedTokens = subtractAsSets(newTokens, oldTokens);
                for (i = 0, n = addedTokens.length; i < n; i++) {
                    token = addedTokens[i];
                    el = map[token];
                    if (!replacedTokens[token]) {
                        self.onAdded(el);
                    }
                }

            };
            self = {
                subscribe: function (scope, onChanged) {
                    scope.$watch(getTokens, function (newTokens, oldTokens) {
                        if (!onChanged || onChanged(newTokens, oldTokens) !== false) {
                            applyChanges(newTokens, oldTokens);
                        }
                    }, true);
                },
                onAdded: angular.noop,
                onChanged: angular.noop,
                onRemoved: angular.noop
            };
            return self;
        };
    }
625213
function virtualRaf (state, view, vdom) {
  state = state || {}

  assert.equal(typeof state, 'object')
  assert.equal(typeof view, 'function')
  assert.equal(typeof vdom, 'object')

  var inRenderingTransaction = false
  var redrawScheduled = false
  var currentState = null
  var target = null
  var tree = null

  return { render: render, update: update }

  // return the vdom tree
  // null -> obj
  function render () {
    tree = view(state)
    target = vdom.create(tree)
    return target
  }

  // update the state and render function
  // obj -> null
  function update (state) {
    assert.ifError(inRenderingTransaction, 'infinite loop detected')

    // request a redraw for next frame
    if (currentState === null && !redrawScheduled) {
      redrawScheduled = true

      raf(function redraw () {
        redrawScheduled = false
        if (!currentState) return

        inRenderingTransaction = true
        var newTree = view(currentState)
        const patches = vdom.diff(tree, newTree)
        inRenderingTransaction = false

        target = vdom.patch(target, patches)
        tree = newTree
        currentState = null
      })
    }

    // update data for redraw
    currentState = state
  }
}
641886
function (tree, prefix) {
  prefix = prefix || '';
  var result = {};

  _.each(tree, function (val, key) {
    if (_.isObject(val))
      _.extend(result, treeToPaths(val, prefix + key + '.'));
    else
      result[prefix + key] = val;
  });

  return result;
}
688184
function tree (list) {
  var mapped = {}
  for (var i = 0, item; i < list.length; i++) {
    item = list[i]
    if (!item || !item.id) continue
    mapped[item.id] = item
  }

  var result = []
  for (var ii = 0; ii < list.length; ii++) {
    item = list[ii]

    if (!item) continue
    /* jshint -W041 */
    if (item.pid == undefined && item.parentId == undefined) {
      result.push(item)
      continue
    }
    var parent = mapped[item.pid] || mapped[item.parentId]
    if (!parent) continue
    if (!parent.children) parent.children = []
    parent.children.push(item)
  }
  return result
}
740608
function makeTree(left, ops, rights, minPrecedence = 0) {
  while (ops.length > 0 && precedence[ops[0]] >= minPrecedence) {
    let op = ops.shift();
    let right = rights.shift();
    while (ops.length > 0 && (precedence[ops[0]] > precedence[op] ||
        associativity[ops[0]] === 'R' && precedence[ops[0]] === precedence[op])) {
      right = makeTree(right, ops, rights, precedence[ops[0]]);
    }
    left = new BinaryExpression(left, op, right);
  }
  return left;
}
829929
function VNode(tagName, attributes, children) {
	this.simple = true;
	this.tagName = tagName; // non-virtual VText
	this.attributes = attributes; // javascript
	this.children = new VTree(children);
}
437958
function _Type(
    type,       // :: String
    name,       // :: String
    url,        // :: String
    arity,      // :: NonNegativeInteger
    format,
    // :: Nullable ((String -> String, String -> String -> String) -> String)
    supertypes, // :: Array Type
    test,       // :: Any -> Boolean
    tuples      // :: Array (Array3 String (a -> Array b) Type)
  ) {
    var t = Object.create (Type$prototype);
    t._test = test;
    t._extractors = tuples.reduce (function(_extractors, tuple) {
      _extractors[tuple[0]] = tuple[1];
      return _extractors;
    }, {});
    t.arity = arity;  // number of type parameters
    t.extractors = Z.map (B (toArray), t._extractors);
    t.format = format || function(outer, inner) {
      return Z.reduce (function(s, tuple) {
        return s +
               outer (' ') +
               when (tuple[2].arity > 0)
                    (parenthesize (outer))
                    (inner (tuple[0]) (show (tuple[2])));
      }, outer (name), tuples);
    };
    t.keys = tuples.map (function(tuple) { return tuple[0]; });
    t.name = name;
    t.supertypes = supertypes;
    t.type = type;
    t.types = tuples.reduce (function(types, tuple) {
      types[tuple[0]] = tuple[2];
      return types;
    }, {});
    t.url = url;
    return t;
  }
1058203
function PageBase(props, $container, vdir, dependencies) {
        "use strict";
    
        var search, querystring;
        Object.defineProperty(props, 'search', {
            'get': function () {
                return search;
            },
            'set': function (value) {
                search = value;
                querystring = new QueryString(value);
            }
        });
    
        var state;
        Object.defineProperty(props, 'state', {
            'get': function () {
                return state;
            },
            'set': function (value) {
                state = value;
            }
        });
    
        Object.defineProperty(this, '$container', {
            'get': function () {
                return $container;
            }
        });
        Object.defineProperty(this, 'vdir', {
            'get': function () {
                return vdir;
            }
        });
        Object.defineProperty(this, 'dependencies', {
            'get': function () {
                return dependencies.modules;
            }
        });
        Object.defineProperty(this, 'querystring', {
            'get': function () {
                return querystring;
            }
        });
        Object.defineProperty(this, 'state', {
            'get': function () {
                return state;
            }
        });
    
    }