prompt
large_stringlengths 70
991k
| completion
large_stringlengths 0
1.02k
|
---|---|
<|file_name|>test_line.py<|end_file_name|><|fim▁begin|>import copy
import pytest
from peek.line import InvalidIpAddressException, Line, InvalidStatusException
# 127.0.0.1 - - [01/Jan/1970:00:00:01 +0000] "GET / HTTP/1.1" 200 193 "-" "Python"
test_line_contents = {
'ip_address': '127.0.0.1',
'timestamp': '[01/Jan/1970:00:00:01 +0000]',
'verb': 'GET',
'path': '/',
'status': '200',
'size': '193',
'referrer': '-',<|fim▁hole|>
def get_updated_line_contents(updates=None):
test_contents = copy.deepcopy(test_line_contents)
if updates is not None:
test_contents.update(updates)
return test_contents
test_line = Line(line_contents=test_line_contents)
class TestLineInstantiation:
@pytest.mark.parametrize('expected,actual', [
('127.0.0.1', test_line.ip_address),
(1, test_line.timestamp),
('GET', test_line.verb),
('/', test_line.path),
(200, test_line.status),
(193, test_line.byte_count),
('-', test_line.referrer),
('Python', test_line.user_agent)
])
def test_retrieval(self, expected, actual):
assert expected == actual
class TestLineExceptions:
def test_passing_invalid_ip_address_throws_exception(self):
with pytest.raises(InvalidIpAddressException):
line = Line(line_contents=get_updated_line_contents({'ip_address': 'foobar'}))
def test_passing_non_parseable_status_throws_exception(self):
with pytest.raises(InvalidStatusException):
Line(line_contents=get_updated_line_contents({'status': 'foobar'}))<|fim▁end|> | 'user_agent': 'Python'
}
|
<|file_name|>endpoint_delete.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from kuryr.schemata import commons
ENDPOINT_DELETE_SCHEMA = {
u'links': [{
u'method': u'POST',
u'href': u'/NetworkDriver.DeleteEndpoint',
u'description': u'Delete an Endpoint',
u'rel': u'self',
u'title': u'Delete'
}],<|fim▁hole|> u'title': u'Delete endpoint',
u'required': [u'NetworkID', u'EndpointID'],
u'definitions': {u'commons': {}},
u'$schema': u'http://json-schema.org/draft-04/hyper-schema',
u'type': u'object',
u'properties': {
u'NetworkID': {
u'description': u'Network ID',
u'$ref': u'#/definitions/commons/definitions/id'
},
u'EndpointID': {
u'description': u'Endpoint ID',
u'$ref': u'#/definitions/commons/definitions/id'
}
}
}
ENDPOINT_DELETE_SCHEMA[u'definitions'][u'commons'] = commons.COMMONS<|fim▁end|> | |
<|file_name|>pagination.js<|end_file_name|><|fim▁begin|>var Pagination = Pagination || function(container, goto) {
"use strict";
var $pg = $(container);
var span = 5;
$pg.on("click", "a", function() {
event.preventDefault();
var page = $(this).prop("id");
goto(page);
});
this.render = function(pageInfo) {
var pageCount = pageInfo.pageCount;
var page = pageInfo.page;
var html = [];<|fim▁hole|> var start = page - span < 1 ? 1 : page - span;
var end = page + span > pageCount ? pageCount : page + span;
for (var i = start; i <= end; i++) {
if (i === page) {
html.push("<b>{0}</b>".build(i));
} else {
html.push("<a href='#' id='{0}'>{1}</a>".build(i, i));
}
}
if (page < pageCount) {
html.push("<a href='#' id='{0}'><span class='glyphicon glyphicon-chevron-right'></span></a>".build(page+1));
}
$pg.html(html.join(""));
$pg.show();
};
this.hide = function() {
$pg.hide();
};
};<|fim▁end|> | if (page > 1) {
html.push("<a href='#' id='{0}'><span class='glyphicon glyphicon-chevron-left'></span></a>".build(page-1));
} |
<|file_name|>component_manager.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
import logging
import copy
from urlparse import urlparse
from org.o3project.odenos.core.util.request_parser import RequestParser
from org.o3project.odenos.remoteobject.message.request import Request
from org.o3project.odenos.remoteobject.message.response import Response
from org.o3project.odenos.remoteobject.object_property import ObjectProperty
from org.o3project.odenos.remoteobject.remote_object_manager import RemoteObjectManager
from org.o3project.odenos.remoteobject.manager.component.component_type\
import ComponentType<|fim▁hole|>class ComponentManager(RemoteObjectManager):
DESCRIPTION = "python's ComponentManager"
COMPONENT_TYPES = "component_types"
def __init__(self, object_id, dispatcher):
RemoteObjectManager.__init__(self, object_id, dispatcher)
self._object_property.set_property(ComponentManager.COMPONENT_TYPES, "")
def register_components(self, components):
self.register_remote_objects(components)
types = ",".join(self.remote_object_classes.keys())
self._object_property.set_property(ComponentManager.COMPONENT_TYPES,
types)
def _add_rules(self):
rules = []
rules.append({RequestParser.PATTERN: r"^component_types/?$",
RequestParser.METHOD: Request.Method.GET,
RequestParser.FUNC: self._do_get_component_types,
RequestParser.PARAMS: 0})
rules.append({RequestParser.PATTERN: r"^components/?$",
RequestParser.METHOD: Request.Method.GET,
RequestParser.FUNC: self._do_get_remote_objects,
RequestParser.PARAMS: 0})
rules.append({RequestParser.PATTERN: r"^components/"
+ "([a-zA-Z0-9_-]+)/?$",
RequestParser.METHOD: Request.Method.PUT,
RequestParser.FUNC: self._do_put_remote_object,
RequestParser.PARAMS: 2})
rules.append({RequestParser.PATTERN: r"^components/"
+ "([a-zA-Z0-9_-]+)/?$",
RequestParser.METHOD: Request.Method.GET,
RequestParser.FUNC: self._do_get_remote_object,
RequestParser.PARAMS: 1})
rules.append({RequestParser.PATTERN: r"^components/"
+ "([a-zA-Z0-9_-]+)/?$",
RequestParser.METHOD: Request.Method.DELETE,
RequestParser.FUNC: self._do_delete_remote_object,
RequestParser.PARAMS: 1})
self._parser.add_rule(rules)
def _do_get_component_types(self):
comp_types = {}
tmp = None
try:
for type_name, clazz in self.remote_object_classes.items():
comp_id = "%s_%s" % (self.object_id, type_name)
component = clazz(comp_id, None)
obj_prop = component.object_property
component = None
type = obj_prop.get_property(ObjectProperty.OBJECT_TYPE)
super_type = obj_prop.get_property(ObjectProperty.OBJECT_SUPER_TYPE)
connection_types = {}
connection_types_str = obj_prop.get_property(
ObjectProperty.CONNECTION_TYPES)
conn_type_list = connection_types_str.split(",")
for type_elem in conn_type_list:
type_elem_list = type_elem.split(":")
if len(type_elem_list) == 2:
connection_types[type_elem_list[0]] = type_elem_list[1]
description = obj_prop.get_property(ObjectProperty.DESCRIPTION)
target = ComponentType(type, super_type,
connection_types, description)
comp_types[type_name] = target.packed_object()
except Exception, e:
return Response(Response.StatusCode.INTERNAL_SERVER_ERROR,
str(e))
return Response(Response.StatusCode.OK, comp_types)<|fim▁end|> | |
<|file_name|>test_blog_category.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals<|fim▁hole|>
import frappe
test_records = frappe.get_test_records('Blog Category')<|fim▁end|> | |
<|file_name|>objectmanager.py<|end_file_name|><|fim▁begin|>"""
Contains functionality relate to interfacing wiggly and puq
"""
import binascii,os,re
import numpy as np
import matplotlib.pyplot as plt
import shapely.geometry
import CrispObjects,FuzzyObjects,fuzz,utilities
import _distributions as distributions
import puq
class ObjectManager(object):
"""
Manages Wiggly objects.
- *ignore_certain_vertices*: Used in the SA module to limit the number of runs required
when there are partially certain objects.
If True, then certain vertices (or edges) which would otherwise be added to puq as
ConstantParameters are not added at all.
================ =============================================================================
Object Type Behavior
================ =============================================================================
Rigid No effect. x,y,theta are included in the SA even if they are certain.
deformable Non-uncertain vertices are not included in the SA
vertex-defined Non-uncertain vertices are not included in the SA (todo)
edge-defined Non-uncertain edges are not included in the SA (todo)
================ =============================================================================
"""
def __init__(self,ignore_certain_vertices=False):
self._objects={} #keys are object names, values are dictionaries with keys:values
# 'obj':FObject 'group':the group obj belongs to
# 'tag':any additional information about obj
self._groups={} #keys are group names, values are lists of object names
self._classes={} #keys are class names, values are lists of object names
self._shapesFileFirstWrite=True
self._ignore_certain_vertices=ignore_certain_vertices
@staticmethod
def isShapeParam(paramname):
"""
Given a parameter name, checks whether this parameter indicates that it belongs
to a shape.
- *paramname*: a string indicating the parameter name to check
Returns: true if this parameter name indicates that it is part of a shape
"""
if paramname!=None:
if str(paramname).startswith("wXY__"):
return True
else:
return False
else:
return False
@staticmethod
def isShapeParamLegacy(paramname):
"""
Given a legacy parameter name, checks whether this parameter indicates that it belongs
to a shape.
- *paramname*: a string indicating the parameter name to check
Returns: true if this parameter name indicates that it is part of a shape.
After changing the wiggly parameter separator to __ instead of _, this
function is needed to check whether the separators should be __ instead of _
when parsing the parameters into shapes.
"""
if paramname!=None:
if str(paramname).startswith("wXY_"):
return True
else:
return False
else:
return False
@staticmethod
def getBaseShapes(shapesFileName='shapes.json'):
"""
Constructs shapely shapes out of a previously saved shapes file generated by
:func:`ObjectManager.crispObjects2PuqParams` or :func:`ObjectManager.fuzzyObjects2PuqParams`.
Returns a dictionary in the same format as :func:`ObjectManager.puq2Shapes`.
"""
if not os.path.isfile(shapesFileName):
utilities.msg('getBaseShapes:{} not found. No shapes generated'.format(shapesFileName),'w')
return {}
f=open(shapesFileName,'r')
baseShapesDict=puq.unpickle(f.read())
shapes={}
#search for all params corresponding to this shape
for shpName,shpItem in baseShapesDict.iteritems():
shp_rt=None
if len(shpItem['pts_x'])==1:
#point
shp_rt=shapely.geometry.Point(shpItem['pts_x'],shpItem['pts_y'])
elif shpItem['isClosed']:
#polygon
shp_rt=shapely.geometry.Polygon(np.vstack((shpItem['pts_x'],shpItem['pts_y'])).T)
else:
#linestring
shp_rt=shapely.geometry.LineString(np.vstack((shpItem['pts_x'],shpItem['pts_y'])).T)
if shp_rt!=None:
shapes[shpName]={'shp':shp_rt,'desc':'base shape','type':shpItem['type']}
return shapes
@staticmethod
def puq2Shapes(shapesFileName='shapes.json',params=None,paramsFileName=None):
"""
Constructs distorted shapes out of a puq parameters, using a set of base shapes.
- *shapesFileName*: a file name containing the base shapes. See :func:`crispObjects2PuqParams`
for more information.
- *params*: a list of dictionaries. Each dictionary contains the keys 'name',
'desc', 'value'. Key 'name' is the puq param name constructed using the \*2puqParams methods.
'desc' (may be None) is the description and 'value' is a single value
of the parameter.
[ {'name':<string>, 'desc':<string>, 'value':<float>}, ... ]
See :func:`crispObjects2PuqParams` for details on the convention for 'name'.
- *paramsFileName*: If set, *params* is read from file. See the paramsByFile option of
the puq TestProgram documentation.
Returns: a dictionary with keys equal to the parameter name. The parameter name is the
original name, extracted from the name generated by \*2puqParams. Values are dictionaries
with the following key:value pairs -- 'shp':Shapely shape 'desc':description.
{<paramName string>, {'shp':<Shapely object>, 'desc':<string>,
'type':<string>} 'alphacut':<float or None>, ...}
'type' is the type of object: 'D'=deformable, 'R'=rigid, 'V'=vertex-defined, 'E'=edge-defined.
Any parameters which weren't constructed with :func:`crispObjects2PuqParams` or
:func:`fuzzyObjects2PuqParams` are ignored.
"""
shapes={}
if paramsFileName!=None:
if params!=None:
print('paramsFileName set. Ignoring params')
#paramvalues is a list of tuples.
paramValues=np.loadtxt(paramsFileName,
dtype={"names":("p_name","p_val","p_desc"),
"formats":(np.object,np.float,np.object)})
params=[]
for tupleParam in paramValues:
params.append({'name':tupleParam[0], 'value':tupleParam[1],
'desc':tupleParam[2]})
else:
if params==None:
raise Exception("Must specify either params or paramsFileName")
#Parse object metadata from the puq parameter name.
#data contains the parsed information:
#key=name value=dictionary with
# 'index':list of int
# 'varType':list of string
# 'alphacut':list of float. (Empty list for probabilistic parameters)
# 'desc': list of string
# 'value': list of float
data={}
for param in params:
if param['name']!=None:
if ObjectManager.isShapeParam(param['name']) or ObjectManager.isShapeParamLegacy(param['name']):
if ObjectManager.isShapeParam(param['name']):
parse=param['name'].split('__')
else:
#for files which were made before the switch to double underscores
parse=param['name'].split('_')
#the parameter has been verified to come from *2PuqParams.
#do more validation
skipped=False
if len(parse)<4 or len(parse)>5:
print("Error: parameter {} isn't in the proper format.".format(param['name']))
skipped=True
elif parse[2]!='x' and parse[2]!='y' and parse[2]!='t' and parse[2]!='e':
print("Error: 'varType' must be x, y, or t. Got {}".format(parse[2]))
skipped=True
else:
objName=parse[1]
varType=parse[2]
index=int(parse[3])
acut=None
#get the alpha cut for objects that have it
if len(parse)==5:
acut=float(parse[4])/10.
if not skipped:
if not objName in data.keys():
data[objName]={'index':[],'varType':[],'value':[],'desc':[], 'alphacut':[]}
data[objName]['index'].append(index)
data[objName]['varType'].append(varType)
data[objName]['desc'].append(param['desc'])
data[objName]['value'].append(param['value'])
data[objName]['alphacut'].append(acut)
if skipped:
print("Skipped {}".format(param['name']))
#end if ObjectManager.isShapeParam(param['name'])
#end if param['name']!=None
#end for param in params
#open the file containing the base shapes to distort
#baseShapes is a dict with keys equal to objectname
#and values of dictionaries of properties. see shapes.json
if not os.path.isfile(shapesFileName):
utilities.msg('puq2shapes:{} not found. No shapes generated'.format(shapesFileName),'w')
return {}
f=open(shapesFileName,'r')
baseShapesDict=puq.unpickle(f.read())
#search for all params corresponding to this shape
for shpName,shpItem in baseShapesDict.iteritems():
shp_rt=None
if shpItem['type']=='R':
#rigid object. we're lookgin for 3 variables x,y,theta
if shpName in data.keys():
shp_rt=ObjectManager._puq2Shapes_rigidObjectSingle(shpName,data[shpName],shpItem)
elif shpItem['type']=='D':
#deformable object. we're looking for x,y variables for each vertex.
#building the shape is different since we don't need to use the base shape
#all the information for constructing a shape is present in the puq parameter
if shpName in data.keys():
shp_rt=ObjectManager._puq2Shapes_deformableObjectSingle(shpName,data[shpName],shpItem)
elif shpItem['type']=='V':
#vertex defined object. Same as deformable object for the purpose of
#building a single shapely shape.
if shpName in data.keys():
shp_rt=ObjectManager._puq2Shapes_vertexObjectSingle(shpName,data[shpName],shpItem)
elif shpItem['type']=='E':
#edge-defined object
if shpName in data.keys():
shp_rt=ObjectManager._puq2Shapes_edgeObjectSingle(shpName,data[shpName],shpItem)
else:
print('Type {} not supported. Ignoring'.format(shpItem['type']))
if shp_rt!=None:
shapes[shpName]={'shp':shp_rt,'desc':data[shpName]['desc'][0],
'type':shpItem['type'],'alphacut':data[shpName]['alphacut'][0]}
return shapes
@staticmethod
def _indices(lst, element):
result = []
offset = -1
while True:
try:
offset = lst.index(element, offset+1)
except ValueError:
return result
result.append(offset)
@staticmethod
def _puq2Shapes_deformableObjectSingle(objName,objData,baseShapeData):
"""
Builds a single Shapely shape out of deformable object data.
See :func:`ObjectManager._puq2Shapes_rigidObjectSingle`
"""
shp_rt=None
#do some more validation. The length of all lists must be the same
#for each object.
len1=len(objData['index'])
lens=np.r_[len(objData['varType']),len(objData['value'])]
if np.any(lens!=len1):
#the length of the vertex indices must be the same as the length of
#all the other lists
print("Error. Can't create object {}. The data was corrupt".format(objName))
else:
#ensure that we have the same number of x and y entries using generator comprehension
count_x=sum(xy=='x' for xy in objData['varType'])
count_y=sum(xy=='y' for xy in objData['varType'])
if count_x!=count_y:
print("Error for {}. There must be the same number of x and y values".format(objName))
elif count_x!=(len1/2):
print("Errpr for {}. unexpected count for 'varType'.".format(objName))
else:
pts_x,pts_y=ObjectManager._puq2shapes_deformableVertex_buildobject_helper(baseShapeData,
objData,
objName)
#we now can build the shape
do=CrispObjects.DeformableObjectFromValues(baseShapeData['pts_x'],baseShapeData['pts_y'],
baseShapeData['uncert_pts'],baseShapeData['isClosed'],
pts_x,pts_y)
shp_rt= do.realizationsPolygons[0]
return shp_rt
@staticmethod
def _puq2Shapes_rigidObjectSingle(objName,objData,baseShapeData):
"""
Builds a single Shapely shape out of rigid object data.
- *objName*: the name of the object
- *objData*: a dictionary
{'index':[int], 'varType':[string], 'desc':[string], 'value':[float]}
- *baseShapeData*: a dictionary.
Returns a Shapely shape. If there is an error, returns None (unless an exception is raised).
"""
shp_rt=None
lens=np.r_[len(objData['varType']),len(objData['value'])]
if np.any(lens!=3):
#the length of the vertex indices must be the same as the length of
#all the other lists
print("Warning. Can't create object {}. The data was corrupt".format(objName))
else:
new_x=np.nan
new_y=np.nan
theta=np.nan
for i in range(3):
xyt=objData['varType'][i]
if xyt=='x':
new_x=objData['value'][i]
elif xyt=='y':
new_y=objData['value'][i]
elif xyt=='t':
theta=objData['value'][i]
else:
raise Exception('Unexpected value for varType ({}) for rigid object {}'.format(xyt,objName))
if new_x==np.nan or new_y==np.nan or theta==np.nan:
raise Exception('rigid object {} is corrupted'.format(objName))
#now build a skeleton rigid object to hold this realization
ro=CrispObjects.RigidObjectFromValues(baseShapeData['pts_x'],baseShapeData['pts_y'],
baseShapeData['origin'][0],baseShapeData['origin'][1],
baseShapeData['uncert_pts'],baseShapeData['isClosed'],
np.r_[new_x],np.r_[new_y],np.r_[theta])
#Get the shape. there should only be 1 anyways
shp_rt=ro.realizationsPolygons[0]
return shp_rt
@staticmethod
def _puq2Shapes_edgeObjectSingle(objName,objData,baseShapeData):
"""
Builds a single Shapely shape out of edge-defined object data.
- *objName*: the name of the object
- *objData*: a dictionary
{'index':[int], 'varType':[string], 'desc':[string], 'value':[float], 'alphacut':[float]}
- *baseShapeData*: a dictionary.
Returns a Shapely shape. If there is an error, returns None (unless an exception is raised).
"""
shp_rt=None
#do some more validation. The length of all lists must be the same
#for each object.
len1=len(objData['index'])
lens=np.r_[len(objData['varType']),len(objData['value']), len(objData['alphacut'])]
if np.any(lens!=len1):
#the length of the edge indices must be the same as the length of
#all the other lists
print("Warning. Can't create object {}. The data was corrupt".format(objName))
else:
if baseShapeData['isClosed']:
numedges=len(baseShapeData['pts_x'])+1
else:
numedges=len(baseShapeData['pts_x'])
edge_offsets=np.zeros(numedges)*np.nan
for i in range(numedges):
idxs=ObjectManager._indices(objData['index'],i)
if len(idxs)==0:
edge_offsets[i]=0
elif len(idxs)!=1:
raise Exception('You should not see this error. Edge-defined object {} had more than one variables associated with index {}'.format(objName,i,))
else:
xyt=objData['varType'][idxs[0]]
if xyt=='e':
edge_offsets[i]=objData['value'][idxs[0]]
else:
raise Exception('Unexpected value for varType ({}) for edge-defined object {}'.format(xyt,objName))
#end if
#verify that all edges have the same alpha cut
acut=objData['alphacut'][0] #single alpha cut value
if any([a!=acut for a in objData['alphacut']]):
raise Exception('The edges must all have the same alpha cuts')
#now build a skeleton rigid object to hold this realization
#since this is a single realization, it only has 1 shape at a single alpha cut.
samples_dict={acut:edge_offsets}
edo=FuzzyObjects.EdgeDefinedObjectFromValues(baseShapeData['pts_x'],baseShapeData['pts_y'],<|fim▁hole|> samples_dict)
#Get the shape. there should only be 1
shp_rt=edo.realizationsPolygons[acut][0]
return shp_rt
@staticmethod
def _puq2Shapes_vertexObjectSingle(objName,objData,baseShapeData):
"""
Builds a single Shapely shape out of vertex-defined object data.
- *objName*: the name of the object
- *objData*: a dictionary
{'index':[int], 'varType':[string], 'desc':[string], 'value':[float], 'alphacut':[float]}
- *baseShapeData*: a dictionary.
Returns a Shapely shape. If there is an error, returns None (unless an exception is raised).
"""
shp_rt=None
#do some more validation. The length of all lists must be the same
#for each object.
len1=len(objData['index'])
lens=np.r_[len(objData['varType']),len(objData['value']), len(objData['alphacut'])]
if np.any(lens!=len1):
#the length of the vertex indices must be the same as the length of
#all the other lists
print("Warning. Can't create object {}. The data was corrupt".format(objName))
else:
#ensure that we have the same number of x and y entries using generator comprehension
count_x=sum(xy=='x' for xy in objData['varType'])
count_y=sum(xy=='y' for xy in objData['varType'])
if count_x!=count_y:
print("Errpr for {}. There must be the same number of x and y values".format(objName))
elif count_x!=(len1/2):
print("Error for {}. unexpected count for 'varType'.".format(objName))
else:
pts_x,pts_y=ObjectManager._puq2shapes_deformableVertex_buildobject_helper(baseShapeData,
objData,
objName)
#verify that all edges have the same alpha cut
acut=objData['alphacut'][0] #single alpha cut value
if any([a!=acut for a in objData['alphacut']]):
raise Exception('The edges must all have the same alpha cuts')
#now build a skeleton object to hold this realization
#since this is a single realization, it only has 1 shape at a single alpha cut.
samples_dict={acut:np.hstack((pts_x,pts_y))}
vdo=FuzzyObjects.VertexDefinedObjectFromValues(baseShapeData['pts_x'],baseShapeData['pts_y'],
baseShapeData['isClosed'],
samples_dict)
#Get the shape. there should only be 1
shp_rt=vdo.realizationsPolygons[acut][0]
#end if
return shp_rt
@staticmethod
def _puq2shapes_deformableVertex_buildobject_helper(baseShapeData, objData,objName):
#make sure the lists are sorted according to the index so that we build
#the object in the right order. http://stackoverflow.com/questions/6618515
# ##DISABLED## not needed anymore
# objData_sorted=sorted(zip(objData['index'],objData['xORy'],
# objData['isClosed'],objData['value']),key=lambda pair:pair[0])
numvert=len(baseShapeData['pts_x'])
#build arrays which will hold the vertices
pts_x=np.zeros(numvert)*np.nan
pts_y=np.zeros(numvert)*np.nan
for i in range(numvert):
idxs=ObjectManager._indices(objData['index'],i)
if len(idxs)==0:
#if we're here, the ith vertex of baseshape was not found in the list
#of uncertain vertices. Therefore it must be certain. replace it with
#the corresponding vertex of baseshape
pts_x[i]=baseShapeData['pts_x'][i]
pts_y[i]=baseShapeData['pts_y'][i]
elif len(idxs)!=2:
raise Exception('You should not see this error. Deformable object {} had more than two variables associated with index {}'.format(objName,i,))
for idx in idxs:
#insert the x or y value into the correct location in the list.
#due to the above checks, there is guaranteed to be the same
#number of x and y values
xyt=objData['varType'][idx]
if xyt=='x':
pts_x[i]=objData['value'][idx]
elif xyt=='y':
pts_y[i]=objData['value'][idx]
else:
raise Exception('Unexpected value for varType ({}) for deformable object {}'.format(xyt,objName))
#end for
return pts_x,pts_y
def addObject(self,obj,name=None,data=None):
"""
Adds a CrispObject or FuzzyObject to the manager.
- *obj*: The object to add. The object must have been previously initialized
and realizations generated.
- *name*: A string which identifies the object. Must consist of letters and numbers
ONLY. Allowed names follow the restrictions for valid Python variable names.
If not specified, a name will be
generated automatically. If specified, it must be unique else, an error will
be generated.
- *data*: Any optional extra data to be stored with the object.
When adding multiple fuzzy objects (by subsequent calls to this function), all
objects must have the same alpha cuts.
"""
if name!=None and name!="":
#don't allow name with special characters. Also
reg=re.compile(r'^[^a-zA-Z_]')
if bool(reg.search(name)):
raise Exception('{} is not valid. Name must start with a letter'.format(name))
reg=re.compile(r'__+')
if bool(reg.search(name)):
raise Exception('{} is not valid. Double underscores are reserved.'.format(name))
reg=re.compile(r'\W')
if bool(reg.search(name)):
raise Exception('{} is not valid. Name can only contain letters, numbers and _'.format(name))
name=self._getNextKey(self._objects) if name==None or name=="" else name
if obj._lastDistr==None:
raise Exception('Object not initialized. Must generate realizations first')
if utilities.isCrispObject(obj):
cls='probabilistic'
elif utilities.isFuzzyObject(obj):
cls='fuzzy'
#check to make sure they all have the same alpha cuts
if cls in self._classes.keys():
for fuzzyobjname,managedfuzzyobj in self._objects.iteritems():
if managedfuzzyobj['class']==cls:
if not all([cut in managedfuzzyobj['obj'].realizations.keys() for cut in obj.realizations.keys()]):
raise Exception('All fuzzy objects must have the same alpha cuts')
else:
raise Exception ("unrecognized type " + str(type(obj)))
try:
#add to dictionary. object is stored by reference
self._objects[name]={'obj':obj, 'class':cls, 'data':data}
if cls in self._classes.keys():
#if group exists, add obj to it
self._classes[cls].append(name)
else:
self._classes[cls]=[name]
except Exception,e:
raise Exception('Error adding object of type:{} '.format(cls) + str(e))
@property
def objects(self):
"""
Returns the objects currently managed by ObjectManager.
Objects are returned in the form of a dictionary with keys equal to the
object names and values containing dictionaries with keys 'obj' (the Wiggly
object being managed), 'class' (the group assigned to obj), and 'data'.
{$name$:{'obj':<shapely shape>}, 'class':<string>, 'data':<object>}
'class' can be 'probabilistic' or 'fuzzy'.
"""
return self._objects
@property
def probabilisticObjects(self):
"""
Returns a list of all the CrispObjects that have been added via :func:`addObject`.
To get the object's extra data use :attr:`objects`
"""
if not 'probabilistic' in self._classes:
return []
return [self._objects[obj]['obj'] for obj in self._classes['probabilistic']]
@property
def fuzzyObjects(self):
"""
Returns a list of all the FuzzyObjects that have been added via :func:`addObject`.
To get the object's extra data use :attr:`objects`
"""
if not 'fuzzy' in self._classes:
return []
return [self._objects[obj]['obj'] for obj in self._classes['fuzzy']]
def crispObjects2PuqParams(self,shapesFileName='shapes.json',use_samples=True):
"""
Converts crisp (probabilistic) objects into puq Parameter objects.
- *shapesFileName*: a file name which holds the base shapes.
- *use_samples*: If True, uses the FObject's previously generated realizations (default).
If the object element (ie, vertex, edge etc) is not a constant, a puq CustomParameter
object is returned with it's values property set to the realizations.
If False, an appropriate puq Parameter object is returned, with its values property set
to an empty list. E.g., for a normally distributed DeformableObject, NormalParameter
objects are returned. Unlike the CustomParameters generated if this flag is False,
these Parameter objects will be sampled by puq.
Returns: a list of puq CustomParameter or ConstantParameter objects.
The name of each Parameter is based on the name given to the associated
object when it was added in addObject. For example, for an object named
'house', the x-coordinate of
the third vertex of the object is encoded using the following convention:
wXY__house__x__2
All parameters constructed with this function are identified by the first 5 characters:
'wXY\_\_'
The total number of Parameters contributed to the returned list can
be determined from the table:
=================== =====================
Object Type Num. Parameters
contributed
=================== =====================
DeformableObject 2N - one for each of
the x,y coordinate
pairs for the N
vertices.
RigidObject 3 - x, y, and theta
=================== =====================
For example, if the ObjectManager contains a single RigidObject, calling
this function will return a list of 3 custom parameters and the base shape
of the rigid object will be written to *shapesFileName*
"""
if shapesFileName==None:
raise Exception("must specify a file name which will hold the shapes to process")
if len(self._objects)==0:
raise Exception("There are no objects to convert")
shapes={}
puq_params=[]
for objName in self._classes['probabilistic']:
managedObj=self._objects[objName]
obj=managedObj['obj']
isClosed=obj.isClosed
uncert_pts=obj.uncertainVertices
objtype=None
origin=None
if utilities.isRigidObject(obj):
desc='rigid object coord'
objtype='R'
#get the data from the rigid object
x_samples,y_samples,t_samples=obj.realizationsParams
origin=obj.origin
data={'x':x_samples, 'y':y_samples, 't':t_samples}
var=['x','y','t']
for i,v in enumerate(var):
name='wXY__{}__{}__{}'.format(objName,v,0)
if np.all(data[v]==data[v][0]):
#if all the samples for this variable are the same, it is a constant
param=puq.ConstantParameter(name,'[C] ' + desc,attrs=[('uncert_type','prob-const')],
value=np.r_[data[v][0]])
else:
if use_samples:
param=puq.CustomParameter(name,desc,attrs=[('uncert_type','prob')],
pdf=data[v],use_samples_val=True)
else:
param=self._element2SpecificPuqParam(name,desc,obj,i)
if param!=None:
puq_params.append(param)
elif utilities.isDeformableObject(obj):
desc='deformable object coord.'
objtype='D'
#get the data from the object
pts_x_samples,pts_y_samples=obj.realizations
for i in range(np.size(pts_x_samples,1)):
#for the x,y coord of each vertex (column of pts_<>_samples),
#create a parameter. set the parameter values to the
#samples (the rows)
name='wXY__{}__x__{}'.format(objName,i)
if np.all(pts_x_samples[:,i]==pts_x_samples[0,i]):
#if all the samples for this variable are the same, it is a constant
param=puq.ConstantParameter(name,'[C] ' + desc,attrs=[('uncert_type','prob-const')],
value=np.r_[pts_x_samples[0,i]])
if self._ignore_certain_vertices:
param=None
else:
if use_samples:
param=puq.CustomParameter(name,desc,attrs=[('uncert_type','prob')],
pdf=pts_x_samples[:,i],use_samples_val=True)
else:
param=self._element2SpecificPuqParam(name,desc,obj,i)
if param!=None:
puq_params.append(param)
name='wXY__{}__y__{}'.format(objName,i)
if np.all(pts_y_samples[:,i]==pts_y_samples[0,i]):
param=puq.ConstantParameter(name,'[C] ' + desc,attrs=[('uncert_type','prob-const')],
value=np.r_[pts_y_samples[0,i]])
if self._ignore_certain_vertices:
param=None
else:
if use_samples:
param=puq.CustomParameter(name,desc,attrs=[('uncert_type','prob')],
pdf=pts_y_samples[:,i],use_samples_val=True)
else:
param=self._element2SpecificPuqParam(name,desc,obj,np.size(pts_x_samples,1)+i)
if param!=None:
puq_params.append(param)
else:
raise Exception("object of type {} not supported".format(str(type(obj))))
shapes[objName]={'type':objtype,'pts_x':obj.coords[0], 'pts_y':obj.coords[1],
'isClosed':isClosed,'origin':origin, 'uncert_pts':uncert_pts}
#end for: objName in self._classes['probabilistic']
self._writeShapesFile(shapes,shapesFileName)
return puq_params
def fuzzyObjects2PuqParams(self,shapesFileName='shapes.json',use_samples=True):
"""
Converts fuzzy objects into puq Parameter objects.
- *shapesFileName*: a file name to which the base shapes will be written.
- *use_samples*: If True, uses the FObject's previously generated realizations (default).
If the object element (ie, vertex, edge etc) is not a constant, a puq CustomParameter
object is returned with it's values property set to the realizations.
If False, an appropriate puq Parameter object is returned, with its values property set
to an empty list. E.g., for a normally distributed DeformableObject, NormalParameter
objects are returned. Unlike the CustomParameters generated if this flag is False,
these Parameter objects will be sampled by puq.
Returns a dictionary with keys equal to alpha cuts of the objects. The values
are dictionaries with keys 'params', 'num_realizations'
{ $a-cut$:{'params':[object], 'num_realizations':integer}, ...}
'params' is a list of puq CustomParameter or ConstantParameter objects each containing
samples of vertex coordinates or edges at that
particular alpha cut. **All non-constant parameters at a given a-cut are guaranteed to have
the same number of realizations.** This number is the maximum number of realizzations of
all objects at that alpha cut and is given in the
'num_realizations' entry. If a parameter is a constant, it will have 1 realization.
For example at alpha-cut 0.2, O1 has 10 realizations and O2 has 8.
The generated puq parameters for O1 will all have 10 realizations. For O2, the number of
realizations will be increased to 10 by repeating the first two samples. If O2 is a constant
instead, the number of realizations in the puq parameter is 1.
All fuzzy objects are guaranteed to have the same alpha cuts.
The name of each Parameter is based on the name given to the associated
object when it was added in addObject. For example, for an object named
'house', the x-coordinate of
the third vertex of the object at alpha cut 1 is encoded using the following convention:
wXY__house__x__2__10
For an edge defined object, third edge alpha cut 0.8,
wXY__house__e__2__8
All parameters constructed with this function are identified by the first 5 characters
'wXY\_\_'.
The total number of Parameters contributed to the returned dictionary for a single alpha-cut
can be determined from the table:
=================== =====================
Object Type Num. Parameters
contributed
=================== =====================
VertexDefinedObject 2N - one for each of
the x,y coordiate
pairs for the N
vertices.
EdgeDefinedObject N - one for each of
the N edges of the
object.
=================== =====================
"""
if shapesFileName==None:
raise Exception("must specify a file name which will hold the shapes to process")
if len(self._objects)==0:
raise Exception("There are no objects to convert")
shapes={}
puq_params={}
#in addObject we verified that all fuzzy objects have the same alpha cuts.
#Get a list of alpha cuts from the first object
acuts=self.fuzzyObjects[0].realizations.keys()
#loop over the alpha cuts. for each alpha cut, determine which object
#has the most realizations. For objects which have fewer realizations than
#this number, replicate the realizations so that they all have the same number.
for acut in acuts:
maxrealizations=0
for objName in self._classes['fuzzy']:
managedObj=self._objects[objName] #dictionary. see addObject
obj=managedObj['obj'] #FObject
if len(obj.getRealizations4Sim(acut))>maxrealizations:
maxrealizations=len(obj.getRealizations4Sim(acut))
#print(acut,objName,len(obj.getRealizations4Sim(acut)))
#print('maxrealizations',maxrealizations)
#holds the puq params at this alpha level
puq_params_alpha=[]
for objName in self._classes['fuzzy']:
managedObj=self._objects[objName] #dictionary. see addObject
obj=managedObj['obj'] #FObject
isClosed=obj.isClosed
objtype=None
#list of numpy arrays
#Each array is guaranteed to have the same length
realizations=obj.getRealizations4Sim(acut)
#fuzzyVars: columns are variables, rows realizations
#the order is defined in the constructor of VertexDefinedObject.
#The order is first all the x variables, then the y variables.
fuzzyVars=np.vstack(realizations)
nFuzzyVars=np.size(fuzzyVars,1)
numrealizations_this=np.size(fuzzyVars,0)
#print(acut,objName,np.size(fuzzyVars,0))
if numrealizations_this<maxrealizations:
#if this object has fewer realizations than the maximum out of
#all fuzzy objects, expand the fuzzyVars matrix to make up the difference
#by copying the required values from the top
fuzzyVars=np.take(fuzzyVars,range(maxrealizations),axis=0,mode='wrap')
print('Fuzzy var {} had n={} realiz. at a-cut {}. Adjusted to n={}'.format(
objName,numrealizations_this,acut,maxrealizations) )
#this fuzzy variable now has the same number of realizations as the others.
#We can now process it.
if utilities.isVertexDefinedObject(obj):
desc='vertex-defined obj coord @a-cut {}'.format(acut)
objtype='V'
var=['x','y']
if nFuzzyVars%2!=0:
raise Exception('Vertex-defined object must have the same number of x and y variables')
for i in range(nFuzzyVars/2):
for k in range(len(var)):
name='wXY__{}__{}__{}__{}'.format(objName,var[k],i,format(acut*10,'.0f'))
samples=fuzzyVars[:,i+nFuzzyVars/2*k]
if np.all(samples==samples[0]):
#if all the samples for this variable are the same, it is a constant
param=puq.ConstantParameter(name,'[C] ' + desc,attrs=[('uncert_type','fuzzy-const')],
value=np.r_[samples[0]])
if self._ignore_certain_vertices:
param=None
else:
if use_samples:
param=puq.CustomParameter(name,desc,attrs=[('uncert_type','fuzzy')],
pdf=samples,use_samples_val=True)
else:
#print(name)
param=self._element2SpecificPuqParam(name,desc,obj,(nFuzzyVars/2)*k+i,acut)
if param!=None:
puq_params_alpha.append(param)
#end for k in range(len(var))
#end for i in range(nFuzzyVars/2)
elif utilities.isEdgeDefinedObject(obj):
desc='edge-defined obj edge offset @a-cut {}'.format(acut)
objtype='E'
for i in range(nFuzzyVars):
name='wXY__{}__e__{}__{}'.format(objName,i,format(acut*10,'.0f'))
samples=fuzzyVars[:,i]
if np.all(samples==samples[0]):
#if all the samples for this variable are the same, it is a constant
param=puq.ConstantParameter(name,'[C] ' + desc,attrs=[('uncert_type','fuzzy-const')],
value=np.r_[samples[0]])
if self._ignore_certain_vertices:
param=None
else:
if use_samples:
param=puq.CustomParameter(name,desc,attrs=[('uncert_type','fuzzy')],
pdf=samples,use_samples_val=True)
else:
param=self._element2SpecificPuqParam(name,desc,obj,i,acut)
if param!=None:
puq_params_alpha.append(param)
else:
raise Exception("object of type {} not supported".format(str(type(obj))))
shapes[objName]={'type':objtype,'pts_x':obj.coords[0], 'pts_y':obj.coords[1],
'isClosed':isClosed,'origin':None, 'uncert_pts':None}
#end for: objName in self._classes['fuzzy']
puq_params[acut]={'params':puq_params_alpha, 'num_realizations':maxrealizations}
#end for: acut in acuts
self._writeShapesFile(shapes,shapesFileName)
return puq_params
def _element2SpecificPuqParam(self,name,desc,obj,i,alpha=None):
"""
Helper function to convert an FObject variable to a puq parameter of a certain type.
The returned puq parameter can be fed to puq which will sample it.
- *name,desc*: the parameter name and description
- *obj*: the object to which the element to be converted belongs
- *i*: the index of the element to convert. This varies depending on the object type
e.g., for a deformable object, index 0 converts the x coordinate of the first vertex.
- *alpha*: the alpha cut to process (only for fuzzy *obj*)
Note this function does not take into consideration elements that are certain. Such
elements are treated as uncertain. Therefore the conversion of these elements must
take place outside this function.
"""
if utilities.isCrispObject(obj):
if obj._lastDistr==distributions.DIST_NORM:
param=puq.NormalParameter(name,desc,attrs=[('uncert_type','prob')],
mean=obj._means[i],dev=np.sqrt(obj._variances[i]))
param.values=[]
elif obj._lastDistr==distributions.DIST_UNIF:
param=puq.UniformParameter(name,desc,attrs=[('uncert_type','prob')],
min=obj._bound_lower[i],max=obj._bound_upper[i])
param.values=[]
else:
raise Exception('Distribution of type {} not supported'.format(obj._lastDistr))
elif utilities.isFuzzyObject(obj):
bound_lower=obj._fuzzyVariables[i].alpha(alpha)[0]
bound_upper=obj._fuzzyVariables[i].alpha(alpha)[1]
param=puq.UniformParameter(name,desc,attrs=[('uncert_type','fuzzy')],
min=bound_lower,max=bound_upper)
param.values=[]
else:
raise Exception('_element2SpecificPuqParam: obj type not supported')
return param
def _writeShapesFile(self,shapes,shapesFileName):
"""
writes the auxiliary shapes file used to reconstruct the shapes.
- *shapes*: a dictionary.
- *shapesFileName*: the file to write
"""
existingshapes={}
try:
if not self._shapesFileFirstWrite:
#only try to read from an existing file if we've already written to it.
#This avoids reading from a file left over from a previous run
f=open(shapesFileName,'r')
existingshapes=puq.unpickle(f.read())
f.close()
except IOError:
pass
f=open(shapesFileName,'w')
existingshapes.update(shapes)
s=puq.jpickle.pickle(existingshapes)
f.write(s)
f.close()
self._shapesFileFirstWrite=False
def _getNextKey(self,d):
"""
Gets a unique key for the dictionary *d* consisting of a 16 character hex value.
"""
newkey=binascii.hexlify(os.urandom(8))
i=0
while newkey in d.keys():
newkey=binascii.hexlify(os.urandom(8))
i+=1
if i>1000:
raise Exception("Couldn't find unique id")
return newkey
def test_addFuzzyObjects():
plt.close('all')
n=10
np.random.seed(96931694)
method='random'
#method='reducedtransformation' #only for plotting. setting this will fail the assertion below
#n=None
#acuts=np.linspace(0,1,num=11)
acuts=np.r_[0,0.5,1] #fewer for clarity
#define a polygon
pt_x=np.r_[480.,485,520,510,520]
pt_y=np.r_[123.,100,105,110,117]
#######
#edge defined
#define fuzzy numbers for all the edges.
#trapezoidal fuzzy numbers are in the form
# (kernel_lower,kernel_upper), (support_lower,support_upper)
edgeMembFcn=[fuzz.TrapezoidalFuzzyNumber((0, 0), (0, 0)),
fuzz.TrapezoidalFuzzyNumber((0, 0), (-3, 3)),
fuzz.TrapezoidalFuzzyNumber((-1.5, 1.5), (-5, 7)),
fuzz.TrapezoidalFuzzyNumber((-1, 1), (-3, 3)),
fuzz.TrapezoidalFuzzyNumber((-.75, .75), (-1, 1))]
edo=FuzzyObjects.EdgeDefinedObject(pt_x,pt_y,edgeMembFcn,isClosed=True)
edo.generateRealizations(n,acuts,method)
#edo.plot()
#edo.plotFuzzyNumbers()
###########
#vertex defined
membFcn_x=[ fuzz.TrapezoidalFuzzyNumber((0, 0), (0, 0)),
fuzz.TrapezoidalFuzzyNumber((0, 0), (-2, 2)),
fuzz.TrapezoidalFuzzyNumber((-2, 2), (-2, 2)),
fuzz.TrapezoidalFuzzyNumber((-1, 1), (-1.5, 3)),
fuzz.TrapezoidalFuzzyNumber((-0.5, 0.5), (-2, 1))]
#test a point
membFcn_x=[ fuzz.TrapezoidalFuzzyNumber((-0.5, 0.5), (-1.5, 1.5))]
pt_x=np.r_[480.]
pt_y=np.r_[123.]
membFcn_y=membFcn_x
vdo=FuzzyObjects.VertexDefinedObject(pt_x+50,pt_y,membFcn_x,membFcn_y,isClosed=False)
vdo.generateRealizations(n,acuts,method)
vdo.plot()
vdo.plotFuzzyNumbers()
manager=ObjectManager(ignore_certain_vertices=True)
#manager.addObject(edo,name='edo1')
manager.addObject(vdo,name='vdo1')
print('objects: ' + str(manager.objects))
print('convert to puq params:')
baseshapesfile='shapes.json'
print('base shapes in {}'.format(baseshapesfile))
s_all={}
puqparams_all=manager.fuzzyObjects2PuqParams(baseshapesfile)
#puqparams_all=manager.fuzzyObjects2PuqParams(baseshapesfile,use_samples=False)
for acut,puqparams_data in puqparams_all.iteritems():
print("alpha cut {}".format(acut))
puqparams=puqparams_data['params']
s=[]
oldname=''
for puqparam in puqparams:
name=puqparam.name.split('__')[1]
vertex=int(puqparam.name.split('__')[3])
var=puqparam.name.split('__')[2]
if name!=oldname:
print(' {}'.format(name))
oldname=name
print('\tn:{} nm:{} desc:{} \n\t\t{}'.format(np.size(puqparam.values),puqparam.name,puqparam.description,type(puqparam)))
#add the name, desc, and values
s.append({'name':puqparam.name,'desc':puqparam.description,'value':puqparam.values})
#check to make sure the order of the realizations matches after converting to puq params
#see issue #78. The check only works if method=random
if name=='edo1':
assert method=='random','only random realizations supported'
#use the min since puqparams.values can have more or less entries than getrealizations4sim
# see documentation of fuzzyObjects2puqParams
for i in range(min(np.size(puqparam.values),np.size(edo.getRealizations4Sim(acut)[:,vertex]))):
assert(puqparam.values[i]==edo.getRealizations4Sim(acut)[i,vertex])
if name=='vdo1':
assert method=='random','only random realizations supported'
rlz=vdo.getRealizations4Sim(acut)
x=rlz[:,vertex]
y=rlz[:,(np.size(rlz,1)/2)+vertex]
if var=='x':
for i in range(min(np.size(puqparam.values),np.size(x))):
assert(puqparam.values[i]==x[i])
if var=='y':
for i in range(min(np.size(puqparam.values),np.size(y))):
assert(puqparam.values[i]==y[i])
s_all[acut]=s
plt.show()
plt.figure()
return s_all,baseshapesfile,n,[edo,vdo]
def test_fuzzyObjectsFromPuq():
#tests re-building shapely shapes from puq parameters
params_all_acuts,baseshapesfile,n,objects=test_addFuzzyObjects()
print('')
cm=plt.get_cmap('jet')
sorted_acuts=sorted(params_all_acuts.keys())
for acut in sorted_acuts:
params_all=params_all_acuts[acut]
ac=0.05 if acut==0 else acut
clr=cm(ac*0.999999)
maxrealizations=0
for param in params_all:
if np.size(param['value'])>maxrealizations:
maxrealizations= np.size(param['value'])
for i in range(maxrealizations):
params=[]
for j,param in enumerate(params_all):
#the % is needed for 'value' in order to handle constants which only have 1 realization.
params.append({'name':param['name'], 'desc':param['desc'],
'value':param['value'][i%np.size(param['value'])]})
shapes=ObjectManager.puq2Shapes(baseshapesfile,params=params)
print("acut {} realization {}, number of shapes: {}".format(acut,i,len(shapes)))
for shpName,shpData in shapes.iteritems():
shp=shpData['shp']
shpDesc=shpData['desc']
if utilities.isShapelyPoint(shp):
xy=shp.coords
plt.plot(xy[0][0],xy[0][1],'o',color=clr)
elif utilities.isShapelyLineString(shp):
xy=np.asarray(shp)
plt.plot(xy[:,0],xy[:,1],'-',color=clr)
elif utilities.isShapelyPolygon(shp):
xy=np.asarray(shp.exterior)
plt.plot(xy[:,0],xy[:,1],'-',color=clr)
#testing issue #73. i%l is needed because when combining objects, the maxrealizations
#is the largers number of realizations out of all the objects.
if shpName=='edo1':
l=len(objects[0].realizationsPolygons[acut])
assert(np.all(xy==np.asarray(objects[0].realizationsPolygons[acut][i%l].exterior)))
elif shpName=='vdo1':
pass
else:
print("error: unsupported shapely type: {}".format(str(type(shp))))
print("\tshpname {}\n\t\tpuq param desc: {}".format(shpName,shpDesc))
print('----')
print('\n\n')
plt.axis('equal')
plt.show()
def test_addCrispObjects():
n=7
plt.close('all')
########
#build rigid object
#define a polygon
pt_x=np.r_[480.,485,520,510,520]
pt_y=np.r_[123.,100,105,110,117]
uncertain_pts=np.r_[1,1,1,0,1]
centroid_x=np.mean(pt_x)
centroid_y=np.mean(pt_y)
centroid_xv=2.
centroid_yv=2.
theta_mn=0.
theta_v=10
variances=np.r_[centroid_xv,centroid_yv,theta_v]
#x,y correlated but uncorrelated to theta
cor3=np.r_[[
#x y theta
[1, 0.8, 0], #x
[0.8, 1, 0], #y
[0, 0, 1] #theta
]]
cov=utilities.cor2cov(cor3,variances)
ro=CrispObjects.RigidObject(pt_x,pt_y,centroid_x,centroid_y,theta_mn,cov,uncertain_pts)
ro.generateNormal(n,translate=False,rotate=True)
#ro.plot(1)
#########
#########
#build deformable object
#define a point
pt_x=np.r_[495]
pt_y=np.r_[110]
uncertain_pts=[1]
xv=20
yv=10
variances=np.r_[xv,yv]
cor=np.r_[[
#x0 #y0
[1, 0], #x0
[0, 1], #x1
]]
cov=utilities.cor2cov(cor,variances)
do1=CrispObjects.DeformableObject(pt_x,pt_y,cov,uncertain_pts,isClosed=False)
do1.generateUniform(n)
#do1.plot(1,points=True)
#define a line
pt_x=np.r_[488,502]
pt_y=np.r_[107,107]
uncertain_pts=[0,1]
variances=[5,5,5,5]
cor=np.r_[[
#x0 x1 y0 y1
[1, 0, 0, 0], #x0
[0, 1, 0, 0], #x1
[0, 0, 1, 0], #y0
[0, 0, 0, 1], #y1
]]
cov=utilities.cor2cov(cor,variances)
do2=CrispObjects.DeformableObject(pt_x,pt_y,cov,uncertain_pts,isClosed=False)
do2.generateUniform(n)
#do2.plot(1)
#plt.show()
#########
#manager=ObjectManager()
manager=ObjectManager(ignore_certain_vertices=True)
manager.addObject(ro,'ro')
manager.addObject(do1,'do1')
manager.addObject(do2,'do2')
print('objects: ' + str(manager.objects))
print('convert to puq params:')
baseshapesfile='shapes.json'
print('base shapes in {}'.format(baseshapesfile))
s=[]
oldname=''
puqparams=manager.crispObjects2PuqParams(baseshapesfile)
#puqparams=manager.crispObjects2PuqParams(baseshapesfile,use_samples=False)
for puqparam in puqparams:
name=puqparam.name.split('__')[1]
if name!=oldname:
print(' {}'.format(name))
oldname=name
print('\tn:{} nm:{} desc:{} \n\t\t{}'.format(np.size(puqparam.values),puqparam.name,puqparam.description,type(puqparam)))
#print('\t{}'.format(puqparam.values))
#add the name, desc, and values
s.append({'name':puqparam.name,'desc':puqparam.description,'value':puqparam.values})
#check to make sure the order of the generated realuzations is the same after
#converting to puq parameters
#see issue #78
for puqparam in puqparams:
name=puqparam.name.split('__')[1]
var=puqparam.name.split('__')[2]
if name=='ro':
x,y,t=ro.realizationsParams
if var=='x':
for i in range(np.size(puqparam.values)):
assert(x[i]==puqparam.values[i])
if var=='y':
for i in range(np.size(puqparam.values)):
assert(y[i]==puqparam.values[i])
if var=='t':
for i in range(np.size(puqparam.values)):
assert(t[i]==puqparam.values[i])
if name=='do1' or name=='do2':
vertex=int(puqparam.name.split('__')[3])
if name=='do1':
x=do1.realizations[0]
y=do1.realizations[1]
else:
#print(do2.realizations)
x=do2.realizations[0]
y=do2.realizations[1]
if var=='x':
for i in range(np.size(puqparam.values)):
assert(x[i,vertex]==puqparam.values[i])
if var=='y':
for i in range(np.size(puqparam.values)):
assert(y[i,vertex]==puqparam.values[i])
return s,baseshapesfile,n,[ro,do1,do2]
def test_crispObjectsFromPuq():
#tests re-building shapely shapes from puq parameters
#note: this function only works when manager.crispObjects2PuqParams use_samples=True
# in test_addCrispObjects
plt.close('all')
params_all,baseshapesfile,n,objects=test_addCrispObjects()
print('')
for i in range(n): #n is number of realizations.
params=[]
for j,param in enumerate(params_all):
#the % is needed for 'value' in order to handle constants which only have 1 realization.
params.append({'name':param['name'], 'desc':param['desc'],
'value':param['value'][i%np.size(param['value'])]})
print(params)
shapes=ObjectManager.puq2Shapes(baseshapesfile,params=params)
print("realization {}, number of shapes: {}".format(i,len(shapes)))
for shpName,shpData in shapes.iteritems():
shp=shpData['shp']
shpDesc=shpData['desc']
if utilities.isShapelyPoint(shp):
xy=shp.coords
plt.plot(xy[0][0],xy[0][1],'o')
assert(np.all(xy==np.asarray(objects[1].realizationsPolygons[i].coords)))
elif utilities.isShapelyLineString(shp):
xy=np.asarray(shp)
plt.plot(xy[:,0],xy[:,1],'-')
#assert(np.all(xy==np.asarray(objects[2].realizationsPolygons[i]))) #assert will fail when use_samples=True in test_addCrispObjects
elif utilities.isShapelyPolygon(shp):
xy=np.asarray(shp.exterior)
plt.plot(xy[:,0],xy[:,1],'-')
#check that the realizations after using puq2shapes are in the same order
#as the original object. See #78
# object[0] is the rigid object polygon
assert(np.all(xy==np.asarray(objects[0].realizationsPolygons[i].exterior)))
else:
print("error: unsupported shapely type: {}".format(str(type(shp))))
print("\tshpname {}\n\t\tdesc {}".format(shpName,shpDesc))
plt.show()
#check if we're executing this script as the main script
if __name__ == '__main__':
np.random.seed(93113488)
#test_addCrispObjects()
#test_crispObjectsFromPuq()
#test_addFuzzyObjects()
test_fuzzyObjectsFromPuq()<|fim▁end|> | baseShapeData['isClosed'], |
<|file_name|>callable.hpp<|end_file_name|><|fim▁begin|>// Boost.TypeErasure library
//
// Copyright 2011 Steven Watanabe
//
// Distributed under the Boost Software License Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// $Id$
#if !defined(BOOST_PP_IS_ITERATING)
#ifndef BOOST_TYPE_ERASURE_CALLABLE_HPP_INCLUDED
#define BOOST_TYPE_ERASURE_CALLABLE_HPP_INCLUDED
#include <boost/utility/declval.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/type_erasure/config.hpp>
#include <boost/type_erasure/call.hpp>
#include <boost/type_erasure/concept_interface.hpp>
#include <boost/type_erasure/rebind_any.hpp>
#include <boost/type_erasure/param.hpp>
namespace boost {
namespace type_erasure {
template<class Sig, class F = _self>
struct callable;
namespace detail {
template<class Sig>
struct result_of_callable;
}
#if defined(BOOST_TYPE_ERASURE_DOXYGEN)
/**
* The @ref callable concept allows an @ref any to hold function objects.
* @c Sig is interpreted in the same way as for Boost.Function, except
* that the arguments and return type are allowed to be placeholders.
* @c F must be a @ref placeholder.
*
* Multiple instances of @ref callable can be used
* simultaneously. Overload resolution works normally.
* Note that unlike Boost.Function, @ref callable
* does not provide result_type. It does, however,
* support @c boost::result_of.
*/
template<class Sig, class F = _self>
struct callable
{
/**
* @c R is the result type of @c Sig and @c T is the argument
* types of @c Sig.
*/
static R apply(F& f, T... arg);
};
#elif !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template<class R, class... T, class F>
struct callable<R(T...), F>
{
static R apply(F& f, T... arg)
{
return f(std::forward<T>(arg)...);
}
};
template<class... T, class F>
struct callable<void(T...), F>
{
static void apply(F& f, T... arg)
{
f(std::forward<T>(arg)...);
}
};
template<class R, class F, class Base, class Enable, class... T>
struct concept_interface<callable<R(T...), F>, Base, F, Enable>
: Base
{
template<class Sig>
struct result :
::boost::type_erasure::detail::result_of_callable<Sig>
{};
typedef void _boost_type_erasure_is_callable;
typedef ::boost::mpl::vector<R> _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[1];
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
typename ::boost::type_erasure::as_param<Base, T>::type...);
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(typename ::boost::type_erasure::as_param<Base, T>::type... arg)
{
return ::boost::type_erasure::call(callable<R(T...), F>(), *this,
::std::forward<typename ::boost::type_erasure::as_param<Base, T>::type>(arg)...);
}
};
template<class R, class F, class Base, class Enable, class... T>
struct concept_interface<callable<R(T...), const F>, Base, F, Enable>
: Base
{
template<class Sig>
struct result :
::boost::type_erasure::detail::result_of_callable<Sig>
{};
typedef void _boost_type_erasure_is_callable;
typedef ::boost::mpl::vector<R> _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[1];
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
typename ::boost::type_erasure::as_param<Base, T>::type...) const;
typename ::boost::type_erasure::rebind_any<Base, R>::type operator()(
typename ::boost::type_erasure::as_param<Base, T>::type... arg) const
{
return ::boost::type_erasure::call(callable<R(T...), const F>(), *this,
::std::forward<typename ::boost::type_erasure::as_param<Base, T>::type>(arg)...);
}
};
template<class R, class F, class Base, class... T>
struct concept_interface<
callable<R(T...), F>,
Base,
F,
typename Base::_boost_type_erasure_is_callable
>
: Base
{
typedef typename ::boost::mpl::push_back<
typename Base::_boost_type_erasure_callable_results,
R
>::type _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[
::boost::mpl::size<_boost_type_erasure_callable_results>::value];
using Base::_boost_type_erasure_deduce_callable;
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
typename ::boost::type_erasure::as_param<Base, T>::type...);
using Base::operator();
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(typename ::boost::type_erasure::as_param<Base, T>::type... arg)
{
return ::boost::type_erasure::call(callable<R(T...), F>(), *this,
::std::forward<typename ::boost::type_erasure::as_param<Base, T>::type>(arg)...);
}
};
template<class R, class F, class Base, class... T>
struct concept_interface<
callable<R(T...), const F>,
Base,
F,
typename Base::_boost_type_erasure_is_callable
>
: Base
{
typedef typename ::boost::mpl::push_back<
typename Base::_boost_type_erasure_callable_results,
R
>::type _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[
::boost::mpl::size<_boost_type_erasure_callable_results>::value];
using Base::_boost_type_erasure_deduce_callable;
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
typename ::boost::type_erasure::as_param<Base, T>::type...) const;
using Base::operator();
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(typename ::boost::type_erasure::as_param<Base, T>::type... arg) const
{
return ::boost::type_erasure::call(callable<R(T...), const F>(), *this,
::std::forward<typename ::boost::type_erasure::as_param<Base, T>::type>(arg)...);
}
};
namespace detail {
template<class This, class... T>
struct result_of_callable<This(T...)>
{
typedef typename ::boost::mpl::at_c<
typename This::_boost_type_erasure_callable_results,
sizeof(::boost::declval<This>().
_boost_type_erasure_deduce_callable(::boost::declval<T>()...)) - 1
>::type type;
};
}
#else
/** INTERNAL ONLY */
#define BOOST_PP_FILENAME_1 <boost/type_erasure/callable.hpp>
/** INTERNAL ONLY */
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_DEC(BOOST_TYPE_ERASURE_MAX_ARITY))
#include BOOST_PP_ITERATE()
#endif
}
}
#endif
#else
#define N BOOST_PP_ITERATION()
#define BOOST_TYPE_ERASURE_DECLVAL(z, n, data) ::boost::declval<BOOST_PP_CAT(T, n)>()
#define BOOST_TYPE_ERASURE_REBIND(z, n, data)\
typename ::boost::type_erasure::as_param<Base, BOOST_PP_CAT(T, n)>::type BOOST_PP_CAT(arg, n)
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_TYPE_ERASURE_FORWARD(z, n, data) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n)
#define BOOST_TYPE_ERASURE_FORWARD_REBIND(z, n, data) BOOST_PP_CAT(arg, n)
#else
#define BOOST_TYPE_ERASURE_FORWARD(z, n, data) ::std::forward<BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, data), n)>(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n))
#define BOOST_TYPE_ERASURE_FORWARD_REBIND(z, n, data) ::std::forward<typename ::boost::type_erasure::as_param<Base, BOOST_PP_CAT(T, n)>::type>(BOOST_PP_CAT(arg, n))
#endif
template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T), class F>
struct callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>
{
static R apply(F& f BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, T, arg))
{
return f(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_FORWARD, (T, arg)));
}
};
template<BOOST_PP_ENUM_PARAMS(N, class T) BOOST_PP_COMMA_IF(N) class F>
struct callable<void(BOOST_PP_ENUM_PARAMS(N, T)), F>
{
static void apply(F& f BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, T, arg))
{
f(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_FORWARD, (T, arg)));
}
};
template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T), class F, class Base, class Enable>
struct concept_interface<
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>,
Base,
F,
Enable
>
: Base
{
template<class Sig>
struct result :
::boost::type_erasure::detail::result_of_callable<Sig>
{};
typedef void _boost_type_erasure_is_callable;
typedef ::boost::mpl::vector<R> _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[1];
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~));
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~))
{
return ::boost::type_erasure::call(
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>(),
*this BOOST_PP_ENUM_TRAILING(N, BOOST_TYPE_ERASURE_FORWARD_REBIND, ~));
}
};
template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T), class F, class Base, class Enable>
struct concept_interface<
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), const F>,
Base,
F,
Enable
>
: Base
{
template<class Sig>
struct result :
::boost::type_erasure::detail::result_of_callable<Sig>
{};
typedef void _boost_type_erasure_is_callable;
typedef ::boost::mpl::vector<R> _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[1];
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~)) const;
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~)) const
{
return ::boost::type_erasure::call(
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), const F>(),
*this BOOST_PP_ENUM_TRAILING(N, BOOST_TYPE_ERASURE_FORWARD_REBIND, ~));
}
};
template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T), class F, class Base><|fim▁hole|> Base,
F,
typename Base::_boost_type_erasure_is_callable
>
: Base
{
typedef typename ::boost::mpl::push_back<
typename Base::_boost_type_erasure_callable_results,
R
>::type _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[
::boost::mpl::size<_boost_type_erasure_callable_results>::value];
using Base::_boost_type_erasure_deduce_callable;
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~));
using Base::operator();
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~))
{
return ::boost::type_erasure::call(
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>(),
*this BOOST_PP_ENUM_TRAILING(N, BOOST_TYPE_ERASURE_FORWARD_REBIND, ~));
}
};
template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T), class F, class Base>
struct concept_interface<
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), const F>,
Base,
F,
typename Base::_boost_type_erasure_is_callable
>
: Base
{
typedef typename ::boost::mpl::push_back<
typename Base::_boost_type_erasure_callable_results,
R
>::type _boost_type_erasure_callable_results;
typedef char (&_boost_type_erasure_callable_size)[
::boost::mpl::size<_boost_type_erasure_callable_results>::value];
using Base::_boost_type_erasure_deduce_callable;
_boost_type_erasure_callable_size
_boost_type_erasure_deduce_callable(
BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~)) const;
using Base::operator();
typename ::boost::type_erasure::rebind_any<Base, R>::type
operator()(BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_REBIND, ~)) const
{
return ::boost::type_erasure::call(
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), const F>(),
*this BOOST_PP_ENUM_TRAILING(N, BOOST_TYPE_ERASURE_FORWARD_REBIND, ~));
}
};
namespace detail {
template<class This BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
struct result_of_callable<This(BOOST_PP_ENUM_PARAMS(N, T))>
{
typedef typename ::boost::mpl::at_c<
typename This::_boost_type_erasure_callable_results,
sizeof(::boost::declval<This>().
_boost_type_erasure_deduce_callable(
BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_DECLVAL, ~))) - 1
>::type type;
};
}
#undef BOOST_TYPE_ERASURE_DECLVAL
#undef BOOST_TYPE_ERASURE_REBIND
#undef N
#endif<|fim▁end|> | struct concept_interface<
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>, |
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var listCommand = [];
require('./listCommand')(listCommand)
var logDetail = (str) => {
console.log(' > '+str);
}
var printHelp = () => {
var txtHelp = "";
var h = ' ';
var t = ' ';
txtHelp += "\n"+h+"Usage : rider [command] \n";
txtHelp += "\n"+h+"Command List : \n";
var maxText = 0;
if(listCommand == undefined){
logDetail("not found help detail");
return;
}
Object.keys(listCommand).forEach((keyName) => {
var item = listCommand[keyName];
if(maxText < item.name.length+item.params.length)
maxText = item.name.length+item.params.length+4;
});
var maxT = Math.ceil(maxText/4);
Object.keys(listCommand).forEach((keyName) => {
var item = listCommand[keyName];
var x = (item.name.length+item.params.length+4)/4;
x = Math.ceil(x);
var space = '\t';
for (var i = 0; i < maxT-x-1; i++) {
space += '\t';
}
var txt = "";
if(item.params.length > 0){
space += '\t';
txt = '\t'+item.name +" [" +item.params+"] " + space +item.desc+"\n";
}else{
txt = '\t'+item.name + space +item.desc+"\n";
} <|fim▁hole|> process.exit(0);
}
var parseParams = (params, cb) => {
if(params.length < 3){
return cb(true);
}
cb(false);
}
var checkCommand = (cmd) => {
var foundCmd = false;
Object.keys(listCommand).forEach((keyName) => {
if(keyName == cmd){
foundCmd = true;
return;
}
});
return !foundCmd;
}
var runCommand = (params, cb) => {
var opt = params[2];
var objRun = listCommand[opt];
if(objRun != undefined && objRun != null){
objRun.runCommand(params, cb);
}
}
var main = () => {
console.log(">> Rider ... ");
var params = process.argv;
parseParams(params, (err) => {
if(err){
printHelp();
return;
}
var opt = params[2];
if(opt == "-h" || opt == "--help"){
printHelp();
return;
}
if(checkCommand(opt)){
printHelp();
return;
}
runCommand(params, () => {
process.exit(0);
});
});
}
// -- call main function --
main();<|fim▁end|> | txtHelp +=txt;
txtHelp +"\n";
});
console.log(txtHelp); |
<|file_name|>search_term_targeting_status.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v2/enums/search_term_targeting_status.proto
package enums
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Indicates whether the search term is one of your targeted or excluded
// keywords.
type SearchTermTargetingStatusEnum_SearchTermTargetingStatus int32
const (
// Not specified.
SearchTermTargetingStatusEnum_UNSPECIFIED SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 0
// Used for return value only. Represents value unknown in this version.
SearchTermTargetingStatusEnum_UNKNOWN SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 1
// Search term is added to targeted keywords.
SearchTermTargetingStatusEnum_ADDED SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 2
// Search term matches a negative keyword.
SearchTermTargetingStatusEnum_EXCLUDED SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 3
// Search term has been both added and excluded.
SearchTermTargetingStatusEnum_ADDED_EXCLUDED SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 4
// Search term is neither targeted nor excluded.
SearchTermTargetingStatusEnum_NONE SearchTermTargetingStatusEnum_SearchTermTargetingStatus = 5
)
var SearchTermTargetingStatusEnum_SearchTermTargetingStatus_name = map[int32]string{
0: "UNSPECIFIED",
1: "UNKNOWN",
2: "ADDED",
3: "EXCLUDED",
4: "ADDED_EXCLUDED",
5: "NONE",
}
var SearchTermTargetingStatusEnum_SearchTermTargetingStatus_value = map[string]int32{
"UNSPECIFIED": 0,
"UNKNOWN": 1,
"ADDED": 2,
"EXCLUDED": 3,<|fim▁hole|>func (x SearchTermTargetingStatusEnum_SearchTermTargetingStatus) String() string {
return proto.EnumName(SearchTermTargetingStatusEnum_SearchTermTargetingStatus_name, int32(x))
}
func (SearchTermTargetingStatusEnum_SearchTermTargetingStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_ba40e9e8a534681c, []int{0, 0}
}
// Container for enum indicating whether a search term is one of your targeted
// or excluded keywords.
type SearchTermTargetingStatusEnum struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SearchTermTargetingStatusEnum) Reset() { *m = SearchTermTargetingStatusEnum{} }
func (m *SearchTermTargetingStatusEnum) String() string { return proto.CompactTextString(m) }
func (*SearchTermTargetingStatusEnum) ProtoMessage() {}
func (*SearchTermTargetingStatusEnum) Descriptor() ([]byte, []int) {
return fileDescriptor_ba40e9e8a534681c, []int{0}
}
func (m *SearchTermTargetingStatusEnum) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SearchTermTargetingStatusEnum.Unmarshal(m, b)
}
func (m *SearchTermTargetingStatusEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SearchTermTargetingStatusEnum.Marshal(b, m, deterministic)
}
func (m *SearchTermTargetingStatusEnum) XXX_Merge(src proto.Message) {
xxx_messageInfo_SearchTermTargetingStatusEnum.Merge(m, src)
}
func (m *SearchTermTargetingStatusEnum) XXX_Size() int {
return xxx_messageInfo_SearchTermTargetingStatusEnum.Size(m)
}
func (m *SearchTermTargetingStatusEnum) XXX_DiscardUnknown() {
xxx_messageInfo_SearchTermTargetingStatusEnum.DiscardUnknown(m)
}
var xxx_messageInfo_SearchTermTargetingStatusEnum proto.InternalMessageInfo
func init() {
proto.RegisterEnum("google.ads.googleads.v2.enums.SearchTermTargetingStatusEnum_SearchTermTargetingStatus", SearchTermTargetingStatusEnum_SearchTermTargetingStatus_name, SearchTermTargetingStatusEnum_SearchTermTargetingStatus_value)
proto.RegisterType((*SearchTermTargetingStatusEnum)(nil), "google.ads.googleads.v2.enums.SearchTermTargetingStatusEnum")
}
func init() {
proto.RegisterFile("google/ads/googleads/v2/enums/search_term_targeting_status.proto", fileDescriptor_ba40e9e8a534681c)
}
var fileDescriptor_ba40e9e8a534681c = []byte{
// 335 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x50, 0x4b, 0x4e, 0xc3, 0x30,
0x10, 0x25, 0x69, 0x0b, 0xc5, 0x45, 0x10, 0x79, 0x07, 0xa2, 0x48, 0xed, 0x01, 0x1c, 0x29, 0xec,
0xcc, 0x86, 0xb4, 0x09, 0x55, 0x05, 0x4a, 0x2b, 0xf5, 0x03, 0x42, 0x91, 0x22, 0xd3, 0x58, 0x26,
0x52, 0x63, 0x47, 0xb1, 0xdb, 0x7b, 0x70, 0x05, 0x96, 0x1c, 0x85, 0xa3, 0xb0, 0xe5, 0x02, 0x28,
0x4e, 0x93, 0x5d, 0xd8, 0x58, 0xcf, 0xf3, 0x66, 0xde, 0x9b, 0x79, 0xe0, 0x9e, 0x09, 0xc1, 0xb6,
0xd4, 0x26, 0xb1, 0xb4, 0x4b, 0x58, 0xa0, 0xbd, 0x63, 0x53, 0xbe, 0x4b, 0xa5, 0x2d, 0x29, 0xc9,
0x37, 0xef, 0x91, 0xa2, 0x79, 0x1a, 0x29, 0x92, 0x33, 0xaa, 0x12, 0xce, 0x22, 0xa9, 0x88, 0xda,
0x49, 0x94, 0xe5, 0x42, 0x09, 0xd8, 0x2f, 0xc7, 0x10, 0x89, 0x25, 0xaa, 0x15, 0xd0, 0xde, 0x41,
0x5a, 0xe1, 0xea, 0xba, 0x32, 0xc8, 0x12, 0x9b, 0x70, 0x2e, 0x14, 0x51, 0x89, 0xe0, 0x87, 0xe1,
0xe1, 0x87, 0x01, 0xfa, 0x0b, 0xed, 0xb1, 0xa4, 0x79, 0xba, 0xac, 0x1c, 0x16, 0xda, 0xc0, 0xe7,
0xbb, 0x74, 0x98, 0x81, 0xcb, 0xc6, 0x06, 0x78, 0x01, 0x7a, 0xab, 0x60, 0x31, 0xf7, 0xc7, 0xd3,
0x87, 0xa9, 0xef, 0x59, 0x47, 0xb0, 0x07, 0x4e, 0x56, 0xc1, 0x63, 0x30, 0x7b, 0x0e, 0x2c, 0x03,
0x9e, 0x82, 0x8e, 0xeb, 0x79, 0xbe, 0x67, 0x99, 0xf0, 0x0c, 0x74, 0xfd, 0x97, 0xf1, 0xd3, 0xaa,
0xf8, 0xb5, 0x20, 0x04, 0xe7, 0x9a, 0x88, 0xea, 0x5a, 0x1b, 0x76, 0x41, 0x3b, 0x98, 0x05, 0xbe,
0xd5, 0x19, 0xfd, 0x1a, 0x60, 0xb0, 0x11, 0x29, 0xfa, 0xf7, 0xae, 0xd1, 0x4d, 0xe3, 0x56, 0xf3,
0xe2, 0xb2, 0xb9, 0xf1, 0x3a, 0x3a, 0x08, 0x30, 0xb1, 0x25, 0x9c, 0x21, 0x91, 0x33, 0x9b, 0x51,
0xae, 0xef, 0xae, 0xa2, 0xce, 0x12, 0xd9, 0x90, 0xfc, 0x9d, 0x7e, 0x3f, 0xcd, 0xd6, 0xc4, 0x75,
0xbf, 0xcc, 0xfe, 0xa4, 0x94, 0x72, 0x63, 0x89, 0x4a, 0x58, 0xa0, 0xb5, 0x83, 0x8a, 0x88, 0xe4,
0x77, 0xc5, 0x87, 0x6e, 0x2c, 0xc3, 0x9a, 0x0f, 0xd7, 0x4e, 0xa8, 0xf9, 0x1f, 0x73, 0x50, 0x16,
0x31, 0x76, 0x63, 0x89, 0x71, 0xdd, 0x81, 0xf1, 0xda, 0xc1, 0x58, 0xf7, 0xbc, 0x1d, 0xeb, 0xc5,
0x6e, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x26, 0xf4, 0x5c, 0x3d, 0x11, 0x02, 0x00, 0x00,
}<|fim▁end|> | "ADDED_EXCLUDED": 4,
"NONE": 5,
}
|
<|file_name|>IndicesParser.java<|end_file_name|><|fim▁begin|>package com.github.obourgain.elasticsearch.http.response.parser;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.elasticsearch.common.xcontent.XContentParser;
import com.github.obourgain.elasticsearch.http.response.entity.Indices;<|fim▁hole|>import com.github.obourgain.elasticsearch.http.response.entity.Shards;
import lombok.Getter;
@Getter
public class IndicesParser {
private static List<ShardFailure> failures;
public static Indices parse(XContentParser parser) {
Map<String, Shards> result = new HashMap<>();
try {
XContentParser.Token token;
String currentFieldName = null;
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentFieldName = parser.currentName();
} else if (token == XContentParser.Token.START_ARRAY) {
failures = ShardFailure.parse(parser);
} else if (token == XContentParser.Token.START_OBJECT) {
Shards shards = new Shards().parse(parser);
result.put(currentFieldName, shards);
}
}
return Indices.fromMap(result);
} catch (IOException e) {
throw new RuntimeException("Unable to parse source", e);
}
}
}<|fim▁end|> | import com.github.obourgain.elasticsearch.http.response.entity.ShardFailure; |
<|file_name|>helpers_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"syscall"
"testing"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
apitesting "k8s.io/kubernetes/pkg/api/testing"
"k8s.io/utils/exec"
)
func TestMerge(t *testing.T) {
grace := int64(30)
tests := []struct {
obj runtime.Object
fragment string
expected runtime.Object
expectErr bool
}{
{
obj: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
},
fragment: fmt.Sprintf(`{ "apiVersion": "%s" }`, api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()),
expected: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
Spec: apitesting.DeepEqualSafePodSpec(),
},
},
/* TODO: uncomment this test once Merge is updated to use
strategic-merge-patch. See #8449.
{
obj: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
Spec: api.PodSpec{
Containers: []api.Container{
api.Container{
Name: "c1",
Image: "red-image",
},
api.Container{
Name: "c2",
Image: "blue-image",
},
},
},
},
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "containers": [ { "name": "c1", "image": "green-image" } ] } }`, api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()),
expected: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
Spec: api.PodSpec{
Containers: []api.Container{
api.Container{
Name: "c1",
Image: "green-image",
},
api.Container{
Name: "c2",
Image: "blue-image",
},
},
},
},
}, */
{
obj: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
},
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "volumes": [ {"name": "v1"}, {"name": "v2"} ] } }`, api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()),
expected: &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
Spec: api.PodSpec{
Volumes: []api.Volume{
{
Name: "v1",
VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}},
},
{
Name: "v2",
VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}},
},
},
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
TerminationGracePeriodSeconds: &grace,
SecurityContext: &api.PodSecurityContext{},
SchedulerName: api.DefaultSchedulerName,
},
},
},
{
obj: &api.Pod{},
fragment: "invalid json",
expected: &api.Pod{},
expectErr: true,
},
{
obj: &api.Service{},
fragment: `{ "apiVersion": "badVersion" }`,
expectErr: true,
},
{
obj: &api.Service{
Spec: api.ServiceSpec{},
},
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "ports": [ { "port": 0 } ] } }`, api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()),
expected: &api.Service{
Spec: api.ServiceSpec{
SessionAffinity: "None",
Type: api.ServiceTypeClusterIP,
Ports: []api.ServicePort{
{
Protocol: api.ProtocolTCP,
Port: 0,
},
},
},
},
},
{
obj: &api.Service{
Spec: api.ServiceSpec{
Selector: map[string]string{
"version": "v1",
},
},
},
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "selector": { "version": "v2" } } }`, api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()),
expected: &api.Service{
Spec: api.ServiceSpec{
SessionAffinity: "None",
Type: api.ServiceTypeClusterIP,
Selector: map[string]string{
"version": "v2",
},
},
},
},
}
for i, test := range tests {
out, err := Merge(testapi.Default.Codec(), test.obj, test.fragment)
if !test.expectErr {
if err != nil {
t.Errorf("testcase[%d], unexpected error: %v", i, err)
} else if !apiequality.Semantic.DeepEqual(out, test.expected) {
t.Errorf("\n\ntestcase[%d]\nexpected:\n%+v\nsaw:\n%+v", i, test.expected, out)
}
}
if test.expectErr && err == nil {
t.Errorf("testcase[%d], unexpected non-error", i)
}
}
}
type fileHandler struct {
data []byte
}
func (f *fileHandler) ServeHTTP(res http.ResponseWriter, req *http.Request) {
if req.URL.Path == "/error" {
res.WriteHeader(http.StatusNotFound)
return
}
res.WriteHeader(http.StatusOK)
res.Write(f.data)
}
type checkErrTestCase struct {
err error
expectedErr string
expectedCode int
}
func TestCheckInvalidErr(t *testing.T) {
testCheckError(t, []checkErrTestCase{
{
errors.NewInvalid(api.Kind("Invalid1"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field"), "single", "details")}),
"The Invalid1 \"invalidation\" is invalid: field: Invalid value: \"single\": details\n",
DefaultErrorExitCode,
},
{
errors.NewInvalid(api.Kind("Invalid2"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field1"), "multi1", "details"), field.Invalid(field.NewPath("field2"), "multi2", "details")}),
"The Invalid2 \"invalidation\" is invalid: \n* field1: Invalid value: \"multi1\": details\n* field2: Invalid value: \"multi2\": details\n",
DefaultErrorExitCode,
},
{
errors.NewInvalid(api.Kind("Invalid3"), "invalidation", field.ErrorList{}),
"The Invalid3 \"invalidation\" is invalid",
DefaultErrorExitCode,
},
{
errors.NewInvalid(api.Kind("Invalid4"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field4"), "multi4", "details"), field.Invalid(field.NewPath("field4"), "multi4", "details")}),
"The Invalid4 \"invalidation\" is invalid: field4: Invalid value: \"multi4\": details\n",
DefaultErrorExitCode,
},
})
}
func TestCheckNoResourceMatchError(t *testing.T) {
testCheckError(t, []checkErrTestCase{
{
&meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}},
`the server doesn't have a resource type "foo"`,
DefaultErrorExitCode,
},
{
&meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Version: "theversion", Resource: "foo"}},
`the server doesn't have a resource type "foo" in version "theversion"`,
DefaultErrorExitCode,
},
{
&meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: "thegroup", Version: "theversion", Resource: "foo"}},
`the server doesn't have a resource type "foo" in group "thegroup" and version "theversion"`,
DefaultErrorExitCode,
},
{
&meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: "thegroup", Resource: "foo"}},
`the server doesn't have a resource type "foo" in group "thegroup"`,
DefaultErrorExitCode,
},
})
}
func TestCheckExitError(t *testing.T) {
testCheckError(t, []checkErrTestCase{
{
exec.CodeExitError{Err: fmt.Errorf("pod foo/bar terminated"), Code: 42},
"pod foo/bar terminated",
42,
},
})
}
func testCheckError(t *testing.T, tests []checkErrTestCase) {
var errReturned string
var codeReturned int
errHandle := func(err string, code int) {
errReturned = err
codeReturned = code
}
for _, test := range tests {
checkErr(test.err, errHandle)
if errReturned != test.expectedErr {
t.Fatalf("Got: %s, expected: %s", errReturned, test.expectedErr)
}
if codeReturned != test.expectedCode {
t.Fatalf("Got: %d, expected: %d", codeReturned, test.expectedCode)
}
}
}
func TestDumpReaderToFile(t *testing.T) {
testString := "TEST STRING"
tempFile, err := ioutil.TempFile("", "hlpers_test_dump_")
if err != nil {
t.Errorf("unexpected error setting up a temporary file %v", err)
}
defer syscall.Unlink(tempFile.Name())
defer tempFile.Close()
defer func() {
if !t.Failed() {
os.Remove(tempFile.Name())
}
}()
err = DumpReaderToFile(strings.NewReader(testString), tempFile.Name())
if err != nil {
t.Errorf("error in DumpReaderToFile: %v", err)
}
data, err := ioutil.ReadFile(tempFile.Name())
if err != nil {
t.Errorf("error when reading %s: %v", tempFile.Name(), err)
}
stringData := string(data)
if stringData != testString {
t.Fatalf("Wrong file content %s != %s", testString, stringData)
}
}<|fim▁end|> | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
|
<|file_name|>Embed.js<|end_file_name|><|fim▁begin|>Ext.define("Voyant.notebook.util.Embed", {
transferable: ['embed'],
embed: function() { // this is for instances
embed.apply(this, arguments);
},
constructor: function(config) {
var me = this;
},
statics: {
i18n: {},
api: {
embeddedParameters: undefined,
embeddedConfig: undefined
},
embed: function(cmp, config) {
if (this.then) {
this.then(function(embedded) {
embed.call(embedded, cmp, config)
})
} else if (Ext.isArray(cmp)) {
Voyant.notebook.util.Show.SINGLE_LINE_MODE=true;
show("<table><tr>");
cmp.forEach(function(embeddable) {
show("<td>");
if (Ext.isArray(embeddable)) {
if (embeddable[0].embeddable) {
embeddable[0].embed.apply(embeddable[0], embeddable.slice(1))
} else {
embed.apply(this, embeddable)
}
} else {
embed.apply(this, embeddable);
}
show("</td>")
})
// for (var i=0; i<arguments.length; i++) {
// var unit = arguments[i];
// show("<td>")
// unit[0].embed.call(unit[0], unit[1], unit[2]);
// show("</td>")
// }
show("</tr></table>")
Voyant.notebook.util.Show.SINGLE_LINE_MODE=false;
return
} else {
// use the default (first) embeddable panel if no panel is specified
if (this.embeddable && (!cmp || Ext.isObject(cmp))) {
// if the first argument is an object, use it as config instead
if (Ext.isObject(cmp)) {config = cmp;}
cmp = this.embeddable[0];
}
if (Ext.isString(cmp)) {
cmp = Ext.ClassManager.getByAlias('widget.'+cmp.toLowerCase()) || Ext.ClassManager.get(cmp);
}
var isEmbedded = false;
if (Ext.isFunction(cmp)) {
var name = cmp.getName();
if (this.embeddable && Ext.Array.each(this.embeddable, function(item) {
if (item==name) {
config = config || {};
var embeddedParams = {};
for (key in Ext.ClassManager.get(Ext.getClassName(cmp)).api) {
if (key in config) {
embeddedParams[key] = config[key]
}
}
if (!embeddedParams.corpus) {
if (Ext.getClassName(this)=='Voyant.data.model.Corpus') {
embeddedParams.corpus = this.getId();
} else if (this.getCorpus) {
var corpus = this.getCorpus();
if (corpus) {
embeddedParams.corpus = this.getCorpus().getId();
}
}
}
Ext.applyIf(config, {
style: 'width: '+(config.width || '90%') + (Ext.isNumber(config.width) ? 'px' : '')+
'; height: '+(config.height || '400px') + (Ext.isNumber(config.height) ? 'px' : '')
});
delete config.width;
delete config.height;
var corpus = embeddedParams.corpus;
delete embeddedParams.corpus;
Ext.applyIf(embeddedParams, Voyant.application.getModifiedApiParams());
var embeddedConfigParamEncodded = Ext.encode(embeddedParams);
var embeddedConfigParam = encodeURIComponent(embeddedConfigParamEncodded);
var iframeId = Ext.id();
var url = Voyant.application.getBaseUrlFull()+"tool/"+name.substring(name.lastIndexOf(".")+1)+'/?';
if (true || embeddedConfigParam.length>1800) {
show('<iframe style="'+config.style+'" id="'+iframeId+'" name="'+iframeId+'"></iframe>');
var dfd = Voyant.application.getDeferred(this);
Ext.Ajax.request({
url: Voyant.application.getTromboneUrl(),
params: {
tool: 'resource.StoredResource',
storeResource: embeddedConfigParam
}
}).then(function(response) {
var json = Ext.util.JSON.decode(response.responseText);
var params = {
minimal: true,
embeddedApiId: json.storedResource.id
}
if (corpus) {
params.corpus = corpus;
}
Ext.applyIf(params, Voyant.application.getModifiedApiParams());
document.getElementById(iframeId).setAttribute("src",url+Ext.Object.toQueryString(params));
dfd.resolve();
}).otherwise(function(response) {
showError(response);
dfd.reject();
})
} else {
show('<iframe src="'+url+embeddedConfigParam+'" style="'+config.style+'" id="'+iframeId+'" name="'+iframeId+'"></iframe>');
}
isEmbedded = true;
return false;<|fim▁hole|> }, this)===true) {
Voyant.notebook.util.Embed.showWidgetNotRecognized.call(this);
}
if (!isEmbedded) {
var embedded = Ext.create(cmp, config);
embedded.embed(config);
isEmbedded = true;
}
}
if (!isEmbedded) {
Voyant.notebook.util.Embed.showWidgetNotRecognized.call(this);
}
}
},
showWidgetNotRecognized: function() {
var msg = Voyant.notebook.util.Embed.i18n.widgetNotRecognized;
if (this.embeddable) {
msg += Voyant.notebook.util.Embed.i18n.tryWidget+'<ul>'+this.embeddable.map(function(cmp) {
var widget = cmp.substring(cmp.lastIndexOf(".")+1).toLowerCase()
return "\"<a href='../../docs/#!/guide/"+widget+"' target='voyantdocs'>"+widget+"</a>\""
}).join(", ")+"</ul>"
}
showError(msg)
}
}
})
embed = Voyant.notebook.util.Embed.embed<|fim▁end|> | } |
<|file_name|>DbWrite.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013-2018 Emmanuel BRUN ([email protected])
*
<|fim▁hole|> * AmapJ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* AmapJ 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with AmapJ. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
package fr.amapj.model.engine.transaction;
public @interface DbWrite
{
}<|fim▁end|> | * This file is part of AmapJ.
*
|
<|file_name|>toscanfv_parser.py<|end_file_name|><|fim▁begin|>import json
import pyaml
import yaml
from lib.util import Util
from lib.parser import Parser
import logging
import traceback
import glob
import os
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('ToscanfvParser')
class ToscanfvParser(Parser):
"""Parser methods for toscanfv project type
"""
def __init__(self):
super(ToscanfvParser, self).__init__()
@classmethod
def importprojectdir(cls,dir_project, file_type):
"""Imports all descriptor files under a given folder
this method is specific for Toscanfv project type
"""
project = {<|fim▁hole|> }
for desc_type in project:
cur_type_path = os.path.join(dir_project, desc_type.upper())
log.debug(cur_type_path)
if os.path.isdir(cur_type_path):
for file in glob.glob(os.path.join(cur_type_path, '*.'+file_type)):
if file_type == 'json':
project[desc_type][os.path.basename(file).split('.')[0]] = Util.loadjsonfile(file)
elif file_type == 'yaml':
project[desc_type][os.path.basename(file).split('.')[0]] = Util.loadyamlfile(file)
for vertices_file in glob.glob(os.path.join(dir_project, '*.json')):
if os.path.basename(vertices_file) == 'vertices.json':
project['positions']['vertices'] = Util.loadjsonfile(vertices_file)
return project
@classmethod
def importprojectfiles(cls, file_dict):
"""Imports descriptors (extracted from the new project POST)
The keys in the dictionary are the file types
"""
project = {
'toscayaml':{},
}
for desc_type in project:
if desc_type in file_dict:
files_desc_type = file_dict[desc_type]
for file in files_desc_type:
project[desc_type][os.path.splitext(file.name)[0]] = json.loads(file.read())
return project<|fim▁end|> | 'toscayaml':{},
'positions': {} |
<|file_name|>MakeVerboseFormat.cpp<|end_file_name|><|fim▁begin|>/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file Implementation of the post processing step "MakeVerboseFormat"
*/
#include "MakeVerboseFormat.h"
#include <assimp/scene.h>
#include <assimp/DefaultLogger.hpp>
using namespace Assimp;
// ------------------------------------------------------------------------------------------------
MakeVerboseFormatProcess::MakeVerboseFormatProcess()
{
// nothing to do here
}
// ------------------------------------------------------------------------------------------------
MakeVerboseFormatProcess::~MakeVerboseFormatProcess()
{
// nothing to do here
}
// ------------------------------------------------------------------------------------------------
// Executes the post processing step on the given imported data.
void MakeVerboseFormatProcess::Execute( aiScene* pScene)
{
ai_assert(NULL != pScene);
ASSIMP_LOG_DEBUG("MakeVerboseFormatProcess begin");
bool bHas = false;
for( unsigned int a = 0; a < pScene->mNumMeshes; a++)
{
if( MakeVerboseFormat( pScene->mMeshes[a]))
bHas = true;
}
if (bHas) {
ASSIMP_LOG_INFO("MakeVerboseFormatProcess finished. There was much work to do ...");
} else {
ASSIMP_LOG_DEBUG("MakeVerboseFormatProcess. There was nothing to do.");
}
pScene->mFlags &= ~AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;
}
// ------------------------------------------------------------------------------------------------
// Executes the post processing step on the given imported data.
bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
{
ai_assert(NULL != pcMesh);
unsigned int iOldNumVertices = pcMesh->mNumVertices;
const unsigned int iNumVerts = pcMesh->mNumFaces*3;
aiVector3D* pvPositions = new aiVector3D[ iNumVerts ];
aiVector3D* pvNormals = NULL;
if (pcMesh->HasNormals())
{
pvNormals = new aiVector3D[iNumVerts];
}
aiVector3D* pvTangents = NULL, *pvBitangents = NULL;
if (pcMesh->HasTangentsAndBitangents())
{
pvTangents = new aiVector3D[iNumVerts];
pvBitangents = new aiVector3D[iNumVerts];
}
aiVector3D* apvTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS] = {0};
aiColor4D* apvColorSets[AI_MAX_NUMBER_OF_COLOR_SETS] = {0};
unsigned int p = 0;
while (pcMesh->HasTextureCoords(p))
apvTextureCoords[p++] = new aiVector3D[iNumVerts];
p = 0;
while (pcMesh->HasVertexColors(p))
apvColorSets[p++] = new aiColor4D[iNumVerts];
// allocate enough memory to hold output bones and vertex weights ...
std::vector<aiVertexWeight>* newWeights = new std::vector<aiVertexWeight>[pcMesh->mNumBones];
for (unsigned int i = 0;i < pcMesh->mNumBones;++i) {
newWeights[i].reserve(pcMesh->mBones[i]->mNumWeights*3);
}
// iterate through all faces and build a clean list
unsigned int iIndex = 0;
for (unsigned int a = 0; a< pcMesh->mNumFaces;++a)
{
aiFace* pcFace = &pcMesh->mFaces[a];
for (unsigned int q = 0; q < pcFace->mNumIndices;++q,++iIndex)
{
// need to build a clean list of bones, too
for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
{
for (unsigned int a = 0; a < pcMesh->mBones[i]->mNumWeights;a++)
{
const aiVertexWeight& w = pcMesh->mBones[i]->mWeights[a];
if(pcFace->mIndices[q] == w.mVertexId)
{
aiVertexWeight wNew;
wNew.mVertexId = iIndex;
wNew.mWeight = w.mWeight;
newWeights[i].push_back(wNew);
}
}
}
pvPositions[iIndex] = pcMesh->mVertices[pcFace->mIndices[q]];
if (pcMesh->HasNormals())
{
pvNormals[iIndex] = pcMesh->mNormals[pcFace->mIndices[q]];
}
if (pcMesh->HasTangentsAndBitangents())
{
pvTangents[iIndex] = pcMesh->mTangents[pcFace->mIndices[q]];
pvBitangents[iIndex] = pcMesh->mBitangents[pcFace->mIndices[q]];
}
unsigned int p = 0;<|fim▁hole|> apvTextureCoords[p][iIndex] = pcMesh->mTextureCoords[p][pcFace->mIndices[q]];
++p;
}
p = 0;
while (pcMesh->HasVertexColors(p))
{
apvColorSets[p][iIndex] = pcMesh->mColors[p][pcFace->mIndices[q]];
++p;
}
pcFace->mIndices[q] = iIndex;
}
}
// build output vertex weights
for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
{
delete [] pcMesh->mBones[i]->mWeights;
if (!newWeights[i].empty()) {
pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()];
aiVertexWeight *weightToCopy = &( newWeights[i][0] );
memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,
sizeof(aiVertexWeight) * newWeights[i].size());
} else {
pcMesh->mBones[i]->mWeights = NULL;
}
}
delete[] newWeights;
// delete the old members
delete[] pcMesh->mVertices;
pcMesh->mVertices = pvPositions;
p = 0;
while (pcMesh->HasTextureCoords(p))
{
delete[] pcMesh->mTextureCoords[p];
pcMesh->mTextureCoords[p] = apvTextureCoords[p];
++p;
}
p = 0;
while (pcMesh->HasVertexColors(p))
{
delete[] pcMesh->mColors[p];
pcMesh->mColors[p] = apvColorSets[p];
++p;
}
pcMesh->mNumVertices = iNumVerts;
if (pcMesh->HasNormals())
{
delete[] pcMesh->mNormals;
pcMesh->mNormals = pvNormals;
}
if (pcMesh->HasTangentsAndBitangents())
{
delete[] pcMesh->mTangents;
pcMesh->mTangents = pvTangents;
delete[] pcMesh->mBitangents;
pcMesh->mBitangents = pvBitangents;
}
return (pcMesh->mNumVertices != iOldNumVertices);
}
// ------------------------------------------------------------------------------------------------
bool IsMeshInVerboseFormat(const aiMesh* mesh) {
// avoid slow vector<bool> specialization
std::vector<unsigned int> seen(mesh->mNumVertices,0);
for(unsigned int i = 0; i < mesh->mNumFaces; ++i) {
const aiFace& f = mesh->mFaces[i];
for(unsigned int j = 0; j < f.mNumIndices; ++j) {
if(++seen[f.mIndices[j]] == 2) {
// found a duplicate index
return false;
}
}
}
return true;
}
// ------------------------------------------------------------------------------------------------
bool MakeVerboseFormatProcess::IsVerboseFormat(const aiScene* pScene) {
for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
if(!IsMeshInVerboseFormat(pScene->mMeshes[i])) {
return false;
}
}
return true;
}<|fim▁end|> | while (pcMesh->HasTextureCoords(p))
{ |
<|file_name|>movie4kis.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
fantastic Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
'''
import urllib, urlparse, re
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import source_utils
from resources.lib.modules import dom_parser
from resources.lib.modules import directstream
from resources.lib.modules import debrid
class source:
def __init__(self):
self.priority = 1
self.language = ['en']
self.domains = ['movie4k.is']
self.base_link = 'http://movie4k.is'
self.search_link = '/search/%s/feed/rss2/'
def movie(self, imdb, title, localtitle, aliases, year):
try:
url = {'imdb': imdb, 'title': title, 'year': year}
url = urllib.urlencode(url)
return url
except:
return
def sources(self, url, hostDict, hostprDict):
try:
sources = []
if url == None: return sources
data = urlparse.parse_qs(url)
data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])
title = data['tvshowtitle'] if 'tvshowtitle' in data else data['title']
hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year']
query = '%s S%02dE%02d' % (data['tvshowtitle'], int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s' % (data['title'])
query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query)
url = self.search_link % urllib.quote_plus(query)
url = urlparse.urljoin(self.base_link, url)
r = client.request(url)
posts = client.parseDOM(r, 'item')
items = []
for post in posts:
try:
t = client.parseDOM(post, 'title')[0]
t2 = re.sub('(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', t)
if not cleantitle.get_simple(t2.replace('Watch Online','')) == cleantitle.get(title): raise Exception()
l = client.parseDOM(post, 'link')[0]
p = client.parseDOM(post, 'pubDate')[0]
if data['year'] in p: items += [(t, l)]
except:
pass
print items
for item in items:<|fim▁hole|>
u = client.request(item[1])
if 'http://www.imdb.com/title/%s/' % data['imdb'] in u:
l = client.parseDOM(u, 'div', {'class': 'movieplay'})[0]
l = client.parseDOM(u, 'iframe', ret='data-lazy-src')[0]
quality, info = source_utils.get_release_quality(name, l)
info = ' | '.join(info)
url = l
url = client.replaceHTMLCodes(url)
url = url.encode('utf-8')
valid, host = source_utils.is_host_valid(url,hostDict)
sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
'info': info, 'direct': False, 'debridonly': False})
except:
pass
return sources
except:
return sources
def resolve(self, url):
return url<|fim▁end|> | try:
name = item[0]
name = client.replaceHTMLCodes(name) |
<|file_name|>S15.4.4.11_A7.1.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.<|fim▁hole|>/**
* The length property of sort has the attribute DontEnum
*
* @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A7.1.js
* @description Checking use propertyIsEnumerable, for-in
*/
//CHECK#1
if (Array.prototype.sort.propertyIsEnumerable('length') !== false) {
$ERROR('#1: Array.prototype.sort.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.sort.propertyIsEnumerable('length')));
}
//CHECK#2
var result = true;
for (var p in Array.sort){
if (p === "length") {
result = false;
}
}
if (result !== true) {
$ERROR('#2: result = true; for (p in Array.sort) { if (p === "length") result = false; } result === true;');
}<|fim▁end|> | |
<|file_name|>radiowatchframe.py<|end_file_name|><|fim▁begin|>import wx
import sys
import os
import time
import threading
import math
import pynotify
import pygame.mixer
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/ext/pprzlink/lib/v1.0/python")
from pprzlink.ivy import IvyMessagesInterface
WIDTH = 150
HEIGHT = 40
UPDATE_INTERVAL = 250
class RadioWatchFrame(wx.Frame):
def message_recv(self, ac_id, msg):
if msg.name == "ROTORCRAFT_STATUS":
self.rc_status = int(msg['rc_status'])
if self.rc_status != 0 and not self.alertChannel.get_busy():
self.warn_timer = wx.CallLater(5, self.rclink_alert)
# else:<|fim▁hole|> # self.notification.close()
def gui_update(self):
self.rc_statusText.SetLabel(["OK", "LOST", "REALLY LOST"][self.rc_status])
self.update_timer.Restart(UPDATE_INTERVAL)
def rclink_alert(self):
self.alertChannel.queue(self.alertSound)
self.notification.show()
time.sleep(5)
def setFont(self, control):
font = control.GetFont()
size = font.GetPointSize()
font.SetPointSize(size * 1.4)
control.SetFont(font)
def __init__(self):
wx.Frame.__init__(self, id=-1, parent=None, name=u'RCWatchFrame',
size=wx.Size(WIDTH, HEIGHT), title=u'RC Status')
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.rc_statusText = wx.StaticText(self, -1, "UNKWN")
pygame.mixer.init()
self.alertSound = pygame.mixer.Sound("crossing.wav")
self.alertChannel = pygame.mixer.Channel(False)
self.setFont(self.rc_statusText)
self.notification = pynotify.Notification("RC Link Warning!",
"RC Link status not OK!",
"dialog-warning")
self.rc_status = -1
pynotify.init("RC Status")
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.rc_statusText, 1, wx.EXPAND)
self.SetSizer(sizer)
sizer.Layout()
self.interface = IvyMessagesInterface("radiowatchframe")
self.interface.subscribe(self.message_recv)
self.update_timer = wx.CallLater(UPDATE_INTERVAL, self.gui_update)
def OnClose(self, event):
self.interface.shutdown()
self.Destroy()<|fim▁end|> | |
<|file_name|>CodeGenAction.cpp<|end_file_name|><|fim▁begin|>//===--- CodeGenAction.cpp - LLVM Code Generation Frontend Action ---------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "clang/CodeGen/CodeGenAction.h"
#include "CodeGenModule.h"
#include "CoverageMappingGen.h"
#include "MacroPPCallbacks.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclGroup.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/BackendUtil.h"
#include "clang/CodeGen/ModuleBuilder.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Linker/Linker.h"
#include "llvm/Pass.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Transforms/IPO/Internalize.h"
#include <memory>
using namespace clang;
using namespace llvm;
namespace clang {
class BackendConsumer;
class ClangDiagnosticHandler final : public DiagnosticHandler {
public:
ClangDiagnosticHandler(const CodeGenOptions &CGOpts, BackendConsumer *BCon)
: CodeGenOpts(CGOpts), BackendCon(BCon) {}
bool handleDiagnostics(const DiagnosticInfo &DI) override;
bool isAnalysisRemarkEnabled(StringRef PassName) const override {
return (CodeGenOpts.OptimizationRemarkAnalysisPattern &&
CodeGenOpts.OptimizationRemarkAnalysisPattern->match(PassName));
}
bool isMissedOptRemarkEnabled(StringRef PassName) const override {
return (CodeGenOpts.OptimizationRemarkMissedPattern &&
CodeGenOpts.OptimizationRemarkMissedPattern->match(PassName));
}
bool isPassedOptRemarkEnabled(StringRef PassName) const override {
return (CodeGenOpts.OptimizationRemarkPattern &&
CodeGenOpts.OptimizationRemarkPattern->match(PassName));
}
bool isAnyRemarkEnabled() const override {
return (CodeGenOpts.OptimizationRemarkAnalysisPattern ||
CodeGenOpts.OptimizationRemarkMissedPattern ||
CodeGenOpts.OptimizationRemarkPattern);
}
private:
const CodeGenOptions &CodeGenOpts;
BackendConsumer *BackendCon;
};
class BackendConsumer : public ASTConsumer {
using LinkModule = CodeGenAction::LinkModule;
virtual void anchor();
DiagnosticsEngine &Diags;
BackendAction Action;
const HeaderSearchOptions &HeaderSearchOpts;
const CodeGenOptions &CodeGenOpts;
const TargetOptions &TargetOpts;
const LangOptions &LangOpts;
std::unique_ptr<raw_pwrite_stream> AsmOutStream;
ASTContext *Context;
Timer LLVMIRGeneration;
unsigned LLVMIRGenerationRefCount;
/// True if we've finished generating IR. This prevents us from generating
/// additional LLVM IR after emitting output in HandleTranslationUnit. This
/// can happen when Clang plugins trigger additional AST deserialization.
bool IRGenFinished = false;
std::unique_ptr<CodeGenerator> Gen;
SmallVector<LinkModule, 4> LinkModules;
// This is here so that the diagnostic printer knows the module a diagnostic
// refers to.
llvm::Module *CurLinkModule = nullptr;
public:
BackendConsumer(BackendAction Action, DiagnosticsEngine &Diags,
const HeaderSearchOptions &HeaderSearchOpts,
const PreprocessorOptions &PPOpts,
const CodeGenOptions &CodeGenOpts,
const TargetOptions &TargetOpts,
const LangOptions &LangOpts, bool TimePasses,
const std::string &InFile,
SmallVector<LinkModule, 4> LinkModules,
std::unique_ptr<raw_pwrite_stream> OS, LLVMContext &C,
CoverageSourceInfo *CoverageInfo = nullptr)
: Diags(Diags), Action(Action), HeaderSearchOpts(HeaderSearchOpts),
CodeGenOpts(CodeGenOpts), TargetOpts(TargetOpts), LangOpts(LangOpts),
AsmOutStream(std::move(OS)), Context(nullptr),
LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
LLVMIRGenerationRefCount(0),
Gen(CreateLLVMCodeGen(Diags, InFile, HeaderSearchOpts, PPOpts,
CodeGenOpts, C, CoverageInfo)),
LinkModules(std::move(LinkModules)) {
FrontendTimesIsEnabled = TimePasses;
llvm::TimePassesIsEnabled = TimePasses;
}
llvm::Module *getModule() const { return Gen->GetModule(); }
std::unique_ptr<llvm::Module> takeModule() {
return std::unique_ptr<llvm::Module>(Gen->ReleaseModule());
}
CodeGenerator *getCodeGenerator() { return Gen.get(); }
void HandleCXXStaticMemberVarInstantiation(VarDecl *VD) override {
Gen->HandleCXXStaticMemberVarInstantiation(VD);
}
void Initialize(ASTContext &Ctx) override {
assert(!Context && "initialized multiple times");
Context = &Ctx;
if (FrontendTimesIsEnabled)
LLVMIRGeneration.startTimer();
Gen->Initialize(Ctx);
if (FrontendTimesIsEnabled)
LLVMIRGeneration.stopTimer();
}
bool HandleTopLevelDecl(DeclGroupRef D) override {
PrettyStackTraceDecl CrashInfo(*D.begin(), SourceLocation(),
Context->getSourceManager(),
"LLVM IR generation of declaration");
// Recurse.
if (FrontendTimesIsEnabled) {
LLVMIRGenerationRefCount += 1;
if (LLVMIRGenerationRefCount == 1)
LLVMIRGeneration.startTimer();
}
Gen->HandleTopLevelDecl(D);
if (FrontendTimesIsEnabled) {
LLVMIRGenerationRefCount -= 1;
if (LLVMIRGenerationRefCount == 0)
LLVMIRGeneration.stopTimer();
}
return true;
}
void HandleInlineFunctionDefinition(FunctionDecl *D) override {
PrettyStackTraceDecl CrashInfo(D, SourceLocation(),
Context->getSourceManager(),
"LLVM IR generation of inline function");
if (FrontendTimesIsEnabled)
LLVMIRGeneration.startTimer();
Gen->HandleInlineFunctionDefinition(D);
if (FrontendTimesIsEnabled)
LLVMIRGeneration.stopTimer();
}
void HandleInterestingDecl(DeclGroupRef D) override {
// Ignore interesting decls from the AST reader after IRGen is finished.
if (!IRGenFinished)
HandleTopLevelDecl(D);
}
// Links each entry in LinkModules into our module. Returns true on error.
bool LinkInModules() {
for (auto &LM : LinkModules) {
if (LM.PropagateAttrs)
for (Function &F : *LM.Module)
Gen->CGM().AddDefaultFnAttrs(F);
CurLinkModule = LM.Module.get();
bool Err;
if (LM.Internalize) {
Err = Linker::linkModules(
*getModule(), std::move(LM.Module), LM.LinkFlags,
[](llvm::Module &M, const llvm::StringSet<> &GVS) {
internalizeModule(M, [&GVS](const llvm::GlobalValue &GV) {
return !GV.hasName() || (GVS.count(GV.getName()) == 0);
});
});
} else {
Err = Linker::linkModules(*getModule(), std::move(LM.Module),
LM.LinkFlags);
}
if (Err)
return true;
}
return false; // success
}
void HandleTranslationUnit(ASTContext &C) override {
{
PrettyStackTraceString CrashInfo("Per-file LLVM IR generation");
if (FrontendTimesIsEnabled) {
LLVMIRGenerationRefCount += 1;
if (LLVMIRGenerationRefCount == 1)
LLVMIRGeneration.startTimer();
}
Gen->HandleTranslationUnit(C);
if (FrontendTimesIsEnabled) {
LLVMIRGenerationRefCount -= 1;
if (LLVMIRGenerationRefCount == 0)
LLVMIRGeneration.stopTimer();
}
IRGenFinished = true;
}
// Silently ignore if we weren't initialized for some reason.
if (!getModule())
return;
// Install an inline asm handler so that diagnostics get printed through
// our diagnostics hooks.
LLVMContext &Ctx = getModule()->getContext();
LLVMContext::InlineAsmDiagHandlerTy OldHandler =
Ctx.getInlineAsmDiagnosticHandler();
void *OldContext = Ctx.getInlineAsmDiagnosticContext();
Ctx.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, this);
std::unique_ptr<DiagnosticHandler> OldDiagnosticHandler =
Ctx.getDiagnosticHandler();
Ctx.setDiagnosticHandler(llvm::make_unique<ClangDiagnosticHandler>(
CodeGenOpts, this));
Ctx.setDiagnosticsHotnessRequested(CodeGenOpts.DiagnosticsWithHotness);
if (CodeGenOpts.DiagnosticsHotnessThreshold != 0)
Ctx.setDiagnosticsHotnessThreshold(
CodeGenOpts.DiagnosticsHotnessThreshold);
std::unique_ptr<llvm::ToolOutputFile> OptRecordFile;
if (!CodeGenOpts.OptRecordFile.empty()) {
std::error_code EC;
OptRecordFile = llvm::make_unique<llvm::ToolOutputFile>(
CodeGenOpts.OptRecordFile, EC, sys::fs::F_None);
if (EC) {
Diags.Report(diag::err_cannot_open_file) <<
CodeGenOpts.OptRecordFile << EC.message();
return;
}
Ctx.setDiagnosticsOutputFile(
llvm::make_unique<yaml::Output>(OptRecordFile->os()));
if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone)
Ctx.setDiagnosticsHotnessRequested(true);
}
// Link each LinkModule into our module.
if (LinkInModules())
return;
EmbedBitcode(getModule(), CodeGenOpts, llvm::MemoryBufferRef());
EmitBackendOutput(Diags, HeaderSearchOpts, CodeGenOpts, TargetOpts,
LangOpts, C.getTargetInfo().getDataLayout(),
getModule(), Action, std::move(AsmOutStream));
Ctx.setInlineAsmDiagnosticHandler(OldHandler, OldContext);
Ctx.setDiagnosticHandler(std::move(OldDiagnosticHandler));
if (OptRecordFile)
OptRecordFile->keep();
}
void HandleTagDeclDefinition(TagDecl *D) override {
PrettyStackTraceDecl CrashInfo(D, SourceLocation(),
Context->getSourceManager(),
"LLVM IR generation of declaration");
Gen->HandleTagDeclDefinition(D);
}
void HandleTagDeclRequiredDefinition(const TagDecl *D) override {
Gen->HandleTagDeclRequiredDefinition(D);
}
void CompleteTentativeDefinition(VarDecl *D) override {
Gen->CompleteTentativeDefinition(D);
}
void AssignInheritanceModel(CXXRecordDecl *RD) override {
Gen->AssignInheritanceModel(RD);
}
void HandleVTable(CXXRecordDecl *RD) override {
Gen->HandleVTable(RD);
}
static void InlineAsmDiagHandler(const llvm::SMDiagnostic &SM,void *Context,
unsigned LocCookie) {
SourceLocation Loc = SourceLocation::getFromRawEncoding(LocCookie);
((BackendConsumer*)Context)->InlineAsmDiagHandler2(SM, Loc);
}
/// Get the best possible source location to represent a diagnostic that
/// may have associated debug info.
const FullSourceLoc
getBestLocationFromDebugLoc(const llvm::DiagnosticInfoWithLocationBase &D,
bool &BadDebugInfo, StringRef &Filename,
unsigned &Line, unsigned &Column) const;
void InlineAsmDiagHandler2(const llvm::SMDiagnostic &,
SourceLocation LocCookie);
void DiagnosticHandlerImpl(const llvm::DiagnosticInfo &DI);
/// Specialized handler for InlineAsm diagnostic.
/// \return True if the diagnostic has been successfully reported, false
/// otherwise.
bool InlineAsmDiagHandler(const llvm::DiagnosticInfoInlineAsm &D);
/// Specialized handler for StackSize diagnostic.
/// \return True if the diagnostic has been successfully reported, false
/// otherwise.
bool StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D);
/// Specialized handler for unsupported backend feature diagnostic.
void UnsupportedDiagHandler(const llvm::DiagnosticInfoUnsupported &D);
/// Specialized handlers for optimization remarks.
/// Note that these handlers only accept remarks and they always handle
/// them.
void EmitOptimizationMessage(const llvm::DiagnosticInfoOptimizationBase &D,
unsigned DiagID);
void
OptimizationRemarkHandler(const llvm::DiagnosticInfoOptimizationBase &D);
void OptimizationRemarkHandler(
const llvm::OptimizationRemarkAnalysisFPCommute &D);
void OptimizationRemarkHandler(
const llvm::OptimizationRemarkAnalysisAliasing &D);
void OptimizationFailureHandler(
const llvm::DiagnosticInfoOptimizationFailure &D);
};
void BackendConsumer::anchor() {}
}
bool ClangDiagnosticHandler::handleDiagnostics(const DiagnosticInfo &DI) {
BackendCon->DiagnosticHandlerImpl(DI);
return true;
}
/// ConvertBackendLocation - Convert a location in a temporary llvm::SourceMgr
/// buffer to be a valid FullSourceLoc.
static FullSourceLoc ConvertBackendLocation(const llvm::SMDiagnostic &D,
SourceManager &CSM) {
// Get both the clang and llvm source managers. The location is relative to
// a memory buffer that the LLVM Source Manager is handling, we need to add
// a copy to the Clang source manager.
const llvm::SourceMgr &LSM = *D.getSourceMgr();
// We need to copy the underlying LLVM memory buffer because llvm::SourceMgr
// already owns its one and clang::SourceManager wants to own its one.
const MemoryBuffer *LBuf =
LSM.getMemoryBuffer(LSM.FindBufferContainingLoc(D.getLoc()));
<|fim▁hole|> LBuf->getBufferIdentifier());
// FIXME: Keep a file ID map instead of creating new IDs for each location.
FileID FID = CSM.createFileID(std::move(CBuf));
// Translate the offset into the file.
unsigned Offset = D.getLoc().getPointer() - LBuf->getBufferStart();
SourceLocation NewLoc =
CSM.getLocForStartOfFile(FID).getLocWithOffset(Offset);
return FullSourceLoc(NewLoc, CSM);
}
/// InlineAsmDiagHandler2 - This function is invoked when the backend hits an
/// error parsing inline asm. The SMDiagnostic indicates the error relative to
/// the temporary memory buffer that the inline asm parser has set up.
void BackendConsumer::InlineAsmDiagHandler2(const llvm::SMDiagnostic &D,
SourceLocation LocCookie) {
// There are a couple of different kinds of errors we could get here. First,
// we re-format the SMDiagnostic in terms of a clang diagnostic.
// Strip "error: " off the start of the message string.
StringRef Message = D.getMessage();
if (Message.startswith("error: "))
Message = Message.substr(7);
// If the SMDiagnostic has an inline asm source location, translate it.
FullSourceLoc Loc;
if (D.getLoc() != SMLoc())
Loc = ConvertBackendLocation(D, Context->getSourceManager());
unsigned DiagID;
switch (D.getKind()) {
case llvm::SourceMgr::DK_Error:
DiagID = diag::err_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Warning:
DiagID = diag::warn_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Note:
DiagID = diag::note_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Remark:
llvm_unreachable("remarks unexpected");
}
// If this problem has clang-level source location information, report the
// issue in the source with a note showing the instantiated
// code.
if (LocCookie.isValid()) {
Diags.Report(LocCookie, DiagID).AddString(Message);
if (D.getLoc().isValid()) {
DiagnosticBuilder B = Diags.Report(Loc, diag::note_fe_inline_asm_here);
// Convert the SMDiagnostic ranges into SourceRange and attach them
// to the diagnostic.
for (const std::pair<unsigned, unsigned> &Range : D.getRanges()) {
unsigned Column = D.getColumnNo();
B << SourceRange(Loc.getLocWithOffset(Range.first - Column),
Loc.getLocWithOffset(Range.second - Column));
}
}
return;
}
// Otherwise, report the backend issue as occurring in the generated .s file.
// If Loc is invalid, we still need to report the issue, it just gets no
// location info.
Diags.Report(Loc, DiagID).AddString(Message);
}
#define ComputeDiagID(Severity, GroupName, DiagID) \
do { \
switch (Severity) { \
case llvm::DS_Error: \
DiagID = diag::err_fe_##GroupName; \
break; \
case llvm::DS_Warning: \
DiagID = diag::warn_fe_##GroupName; \
break; \
case llvm::DS_Remark: \
llvm_unreachable("'remark' severity not expected"); \
break; \
case llvm::DS_Note: \
DiagID = diag::note_fe_##GroupName; \
break; \
} \
} while (false)
#define ComputeDiagRemarkID(Severity, GroupName, DiagID) \
do { \
switch (Severity) { \
case llvm::DS_Error: \
DiagID = diag::err_fe_##GroupName; \
break; \
case llvm::DS_Warning: \
DiagID = diag::warn_fe_##GroupName; \
break; \
case llvm::DS_Remark: \
DiagID = diag::remark_fe_##GroupName; \
break; \
case llvm::DS_Note: \
DiagID = diag::note_fe_##GroupName; \
break; \
} \
} while (false)
bool
BackendConsumer::InlineAsmDiagHandler(const llvm::DiagnosticInfoInlineAsm &D) {
unsigned DiagID;
ComputeDiagID(D.getSeverity(), inline_asm, DiagID);
std::string Message = D.getMsgStr().str();
// If this problem has clang-level source location information, report the
// issue as being a problem in the source with a note showing the instantiated
// code.
SourceLocation LocCookie =
SourceLocation::getFromRawEncoding(D.getLocCookie());
if (LocCookie.isValid())
Diags.Report(LocCookie, DiagID).AddString(Message);
else {
// Otherwise, report the backend diagnostic as occurring in the generated
// .s file.
// If Loc is invalid, we still need to report the diagnostic, it just gets
// no location info.
FullSourceLoc Loc;
Diags.Report(Loc, DiagID).AddString(Message);
}
// We handled all the possible severities.
return true;
}
bool
BackendConsumer::StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D) {
if (D.getSeverity() != llvm::DS_Warning)
// For now, the only support we have for StackSize diagnostic is warning.
// We do not know how to format other severities.
return false;
if (const Decl *ND = Gen->GetDeclForMangledName(D.getFunction().getName())) {
// FIXME: Shouldn't need to truncate to uint32_t
Diags.Report(ND->getASTContext().getFullLoc(ND->getLocation()),
diag::warn_fe_frame_larger_than)
<< static_cast<uint32_t>(D.getStackSize()) << Decl::castToDeclContext(ND);
return true;
}
return false;
}
const FullSourceLoc BackendConsumer::getBestLocationFromDebugLoc(
const llvm::DiagnosticInfoWithLocationBase &D, bool &BadDebugInfo,
StringRef &Filename, unsigned &Line, unsigned &Column) const {
SourceManager &SourceMgr = Context->getSourceManager();
FileManager &FileMgr = SourceMgr.getFileManager();
SourceLocation DILoc;
if (D.isLocationAvailable()) {
D.getLocation(&Filename, &Line, &Column);
const FileEntry *FE = FileMgr.getFile(Filename);
if (FE && Line > 0) {
// If -gcolumn-info was not used, Column will be 0. This upsets the
// source manager, so pass 1 if Column is not set.
DILoc = SourceMgr.translateFileLineCol(FE, Line, Column ? Column : 1);
}
BadDebugInfo = DILoc.isInvalid();
}
// If a location isn't available, try to approximate it using the associated
// function definition. We use the definition's right brace to differentiate
// from diagnostics that genuinely relate to the function itself.
FullSourceLoc Loc(DILoc, SourceMgr);
if (Loc.isInvalid())
if (const Decl *FD = Gen->GetDeclForMangledName(D.getFunction().getName()))
Loc = FD->getASTContext().getFullLoc(FD->getLocation());
if (DILoc.isInvalid() && D.isLocationAvailable())
// If we were not able to translate the file:line:col information
// back to a SourceLocation, at least emit a note stating that
// we could not translate this location. This can happen in the
// case of #line directives.
Diags.Report(Loc, diag::note_fe_backend_invalid_loc)
<< Filename << Line << Column;
return Loc;
}
void BackendConsumer::UnsupportedDiagHandler(
const llvm::DiagnosticInfoUnsupported &D) {
// We only support errors.
assert(D.getSeverity() == llvm::DS_Error);
StringRef Filename;
unsigned Line, Column;
bool BadDebugInfo = false;
FullSourceLoc Loc =
getBestLocationFromDebugLoc(D, BadDebugInfo, Filename, Line, Column);
Diags.Report(Loc, diag::err_fe_backend_unsupported) << D.getMessage().str();
if (BadDebugInfo)
// If we were not able to translate the file:line:col information
// back to a SourceLocation, at least emit a note stating that
// we could not translate this location. This can happen in the
// case of #line directives.
Diags.Report(Loc, diag::note_fe_backend_invalid_loc)
<< Filename << Line << Column;
}
void BackendConsumer::EmitOptimizationMessage(
const llvm::DiagnosticInfoOptimizationBase &D, unsigned DiagID) {
// We only support warnings and remarks.
assert(D.getSeverity() == llvm::DS_Remark ||
D.getSeverity() == llvm::DS_Warning);
StringRef Filename;
unsigned Line, Column;
bool BadDebugInfo = false;
FullSourceLoc Loc =
getBestLocationFromDebugLoc(D, BadDebugInfo, Filename, Line, Column);
std::string Msg;
raw_string_ostream MsgStream(Msg);
MsgStream << D.getMsg();
if (D.getHotness())
MsgStream << " (hotness: " << *D.getHotness() << ")";
Diags.Report(Loc, DiagID)
<< AddFlagValue(D.getPassName())
<< MsgStream.str();
if (BadDebugInfo)
// If we were not able to translate the file:line:col information
// back to a SourceLocation, at least emit a note stating that
// we could not translate this location. This can happen in the
// case of #line directives.
Diags.Report(Loc, diag::note_fe_backend_invalid_loc)
<< Filename << Line << Column;
}
void BackendConsumer::OptimizationRemarkHandler(
const llvm::DiagnosticInfoOptimizationBase &D) {
// Without hotness information, don't show noisy remarks.
if (D.isVerbose() && !D.getHotness())
return;
if (D.isPassed()) {
// Optimization remarks are active only if the -Rpass flag has a regular
// expression that matches the name of the pass name in \p D.
if (CodeGenOpts.OptimizationRemarkPattern &&
CodeGenOpts.OptimizationRemarkPattern->match(D.getPassName()))
EmitOptimizationMessage(D, diag::remark_fe_backend_optimization_remark);
} else if (D.isMissed()) {
// Missed optimization remarks are active only if the -Rpass-missed
// flag has a regular expression that matches the name of the pass
// name in \p D.
if (CodeGenOpts.OptimizationRemarkMissedPattern &&
CodeGenOpts.OptimizationRemarkMissedPattern->match(D.getPassName()))
EmitOptimizationMessage(
D, diag::remark_fe_backend_optimization_remark_missed);
} else {
assert(D.isAnalysis() && "Unknown remark type");
bool ShouldAlwaysPrint = false;
if (auto *ORA = dyn_cast<llvm::OptimizationRemarkAnalysis>(&D))
ShouldAlwaysPrint = ORA->shouldAlwaysPrint();
if (ShouldAlwaysPrint ||
(CodeGenOpts.OptimizationRemarkAnalysisPattern &&
CodeGenOpts.OptimizationRemarkAnalysisPattern->match(D.getPassName())))
EmitOptimizationMessage(
D, diag::remark_fe_backend_optimization_remark_analysis);
}
}
void BackendConsumer::OptimizationRemarkHandler(
const llvm::OptimizationRemarkAnalysisFPCommute &D) {
// Optimization analysis remarks are active if the pass name is set to
// llvm::DiagnosticInfo::AlwasyPrint or if the -Rpass-analysis flag has a
// regular expression that matches the name of the pass name in \p D.
if (D.shouldAlwaysPrint() ||
(CodeGenOpts.OptimizationRemarkAnalysisPattern &&
CodeGenOpts.OptimizationRemarkAnalysisPattern->match(D.getPassName())))
EmitOptimizationMessage(
D, diag::remark_fe_backend_optimization_remark_analysis_fpcommute);
}
void BackendConsumer::OptimizationRemarkHandler(
const llvm::OptimizationRemarkAnalysisAliasing &D) {
// Optimization analysis remarks are active if the pass name is set to
// llvm::DiagnosticInfo::AlwasyPrint or if the -Rpass-analysis flag has a
// regular expression that matches the name of the pass name in \p D.
if (D.shouldAlwaysPrint() ||
(CodeGenOpts.OptimizationRemarkAnalysisPattern &&
CodeGenOpts.OptimizationRemarkAnalysisPattern->match(D.getPassName())))
EmitOptimizationMessage(
D, diag::remark_fe_backend_optimization_remark_analysis_aliasing);
}
void BackendConsumer::OptimizationFailureHandler(
const llvm::DiagnosticInfoOptimizationFailure &D) {
EmitOptimizationMessage(D, diag::warn_fe_backend_optimization_failure);
}
/// This function is invoked when the backend needs
/// to report something to the user.
void BackendConsumer::DiagnosticHandlerImpl(const DiagnosticInfo &DI) {
unsigned DiagID = diag::err_fe_inline_asm;
llvm::DiagnosticSeverity Severity = DI.getSeverity();
// Get the diagnostic ID based.
switch (DI.getKind()) {
case llvm::DK_InlineAsm:
if (InlineAsmDiagHandler(cast<DiagnosticInfoInlineAsm>(DI)))
return;
ComputeDiagID(Severity, inline_asm, DiagID);
break;
case llvm::DK_StackSize:
if (StackSizeDiagHandler(cast<DiagnosticInfoStackSize>(DI)))
return;
ComputeDiagID(Severity, backend_frame_larger_than, DiagID);
break;
case DK_Linker:
assert(CurLinkModule);
// FIXME: stop eating the warnings and notes.
if (Severity != DS_Error)
return;
DiagID = diag::err_fe_cannot_link_module;
break;
case llvm::DK_OptimizationRemark:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<OptimizationRemark>(DI));
return;
case llvm::DK_OptimizationRemarkMissed:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<OptimizationRemarkMissed>(DI));
return;
case llvm::DK_OptimizationRemarkAnalysis:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<OptimizationRemarkAnalysis>(DI));
return;
case llvm::DK_OptimizationRemarkAnalysisFPCommute:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<OptimizationRemarkAnalysisFPCommute>(DI));
return;
case llvm::DK_OptimizationRemarkAnalysisAliasing:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<OptimizationRemarkAnalysisAliasing>(DI));
return;
case llvm::DK_MachineOptimizationRemark:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<MachineOptimizationRemark>(DI));
return;
case llvm::DK_MachineOptimizationRemarkMissed:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<MachineOptimizationRemarkMissed>(DI));
return;
case llvm::DK_MachineOptimizationRemarkAnalysis:
// Optimization remarks are always handled completely by this
// handler. There is no generic way of emitting them.
OptimizationRemarkHandler(cast<MachineOptimizationRemarkAnalysis>(DI));
return;
case llvm::DK_OptimizationFailure:
// Optimization failures are always handled completely by this
// handler.
OptimizationFailureHandler(cast<DiagnosticInfoOptimizationFailure>(DI));
return;
case llvm::DK_Unsupported:
UnsupportedDiagHandler(cast<DiagnosticInfoUnsupported>(DI));
return;
default:
// Plugin IDs are not bound to any value as they are set dynamically.
ComputeDiagRemarkID(Severity, backend_plugin, DiagID);
break;
}
std::string MsgStorage;
{
raw_string_ostream Stream(MsgStorage);
DiagnosticPrinterRawOStream DP(Stream);
DI.print(DP);
}
if (DiagID == diag::err_fe_cannot_link_module) {
Diags.Report(diag::err_fe_cannot_link_module)
<< CurLinkModule->getModuleIdentifier() << MsgStorage;
return;
}
// Report the backend message using the usual diagnostic mechanism.
FullSourceLoc Loc;
Diags.Report(Loc, DiagID).AddString(MsgStorage);
}
#undef ComputeDiagID
CodeGenAction::CodeGenAction(unsigned _Act, LLVMContext *_VMContext)
: Act(_Act), VMContext(_VMContext ? _VMContext : new LLVMContext),
OwnsVMContext(!_VMContext) {}
CodeGenAction::~CodeGenAction() {
TheModule.reset();
if (OwnsVMContext)
delete VMContext;
}
bool CodeGenAction::hasIRSupport() const { return true; }
void CodeGenAction::EndSourceFileAction() {
// If the consumer creation failed, do nothing.
if (!getCompilerInstance().hasASTConsumer())
return;
// Steal the module from the consumer.
TheModule = BEConsumer->takeModule();
}
std::unique_ptr<llvm::Module> CodeGenAction::takeModule() {
return std::move(TheModule);
}
llvm::LLVMContext *CodeGenAction::takeLLVMContext() {
OwnsVMContext = false;
return VMContext;
}
static std::unique_ptr<raw_pwrite_stream>
GetOutputStream(CompilerInstance &CI, StringRef InFile, BackendAction Action) {
switch (Action) {
case Backend_EmitAssembly:
return CI.createDefaultOutputFile(false, InFile, "s");
case Backend_EmitLL:
return CI.createDefaultOutputFile(false, InFile, "ll");
case Backend_EmitBC:
return CI.createDefaultOutputFile(true, InFile, "bc");
case Backend_EmitNothing:
return nullptr;
case Backend_EmitMCNull:
return CI.createNullOutputFile();
case Backend_EmitObj:
return CI.createDefaultOutputFile(true, InFile, "o");
}
llvm_unreachable("Invalid action!");
}
std::unique_ptr<ASTConsumer>
CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
BackendAction BA = static_cast<BackendAction>(Act);
std::unique_ptr<raw_pwrite_stream> OS = CI.takeOutputStream();
if (!OS)
OS = GetOutputStream(CI, InFile, BA);
if (BA != Backend_EmitNothing && !OS)
return nullptr;
// Load bitcode modules to link with, if we need to.
if (LinkModules.empty())
for (const CodeGenOptions::BitcodeFileToLink &F :
CI.getCodeGenOpts().LinkBitcodeFiles) {
auto BCBuf = CI.getFileManager().getBufferForFile(F.Filename);
if (!BCBuf) {
CI.getDiagnostics().Report(diag::err_cannot_open_file)
<< F.Filename << BCBuf.getError().message();
LinkModules.clear();
return nullptr;
}
Expected<std::unique_ptr<llvm::Module>> ModuleOrErr =
getOwningLazyBitcodeModule(std::move(*BCBuf), *VMContext);
if (!ModuleOrErr) {
handleAllErrors(ModuleOrErr.takeError(), [&](ErrorInfoBase &EIB) {
CI.getDiagnostics().Report(diag::err_cannot_open_file)
<< F.Filename << EIB.message();
});
LinkModules.clear();
return nullptr;
}
LinkModules.push_back({std::move(ModuleOrErr.get()), F.PropagateAttrs,
F.Internalize, F.LinkFlags});
}
CoverageSourceInfo *CoverageInfo = nullptr;
// Add the preprocessor callback only when the coverage mapping is generated.
if (CI.getCodeGenOpts().CoverageMapping) {
CoverageInfo = new CoverageSourceInfo;
CI.getPreprocessor().addPPCallbacks(
std::unique_ptr<PPCallbacks>(CoverageInfo));
}
std::unique_ptr<BackendConsumer> Result(new BackendConsumer(
BA, CI.getDiagnostics(), CI.getHeaderSearchOpts(),
CI.getPreprocessorOpts(), CI.getCodeGenOpts(), CI.getTargetOpts(),
CI.getLangOpts(), CI.getFrontendOpts().ShowTimers, InFile,
std::move(LinkModules), std::move(OS), *VMContext, CoverageInfo));
BEConsumer = Result.get();
// Enable generating macro debug info only when debug info is not disabled and
// also macro debug info is enabled.
if (CI.getCodeGenOpts().getDebugInfo() != codegenoptions::NoDebugInfo &&
CI.getCodeGenOpts().MacroDebugInfo) {
std::unique_ptr<PPCallbacks> Callbacks =
llvm::make_unique<MacroPPCallbacks>(BEConsumer->getCodeGenerator(),
CI.getPreprocessor());
CI.getPreprocessor().addPPCallbacks(std::move(Callbacks));
}
return std::move(Result);
}
static void BitcodeInlineAsmDiagHandler(const llvm::SMDiagnostic &SM,
void *Context,
unsigned LocCookie) {
SM.print(nullptr, llvm::errs());
auto Diags = static_cast<DiagnosticsEngine *>(Context);
unsigned DiagID;
switch (SM.getKind()) {
case llvm::SourceMgr::DK_Error:
DiagID = diag::err_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Warning:
DiagID = diag::warn_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Note:
DiagID = diag::note_fe_inline_asm;
break;
case llvm::SourceMgr::DK_Remark:
llvm_unreachable("remarks unexpected");
}
Diags->Report(DiagID).AddString("cannot compile inline asm");
}
std::unique_ptr<llvm::Module> CodeGenAction::loadModule(MemoryBufferRef MBRef) {
CompilerInstance &CI = getCompilerInstance();
SourceManager &SM = CI.getSourceManager();
// For ThinLTO backend invocations, ensure that the context
// merges types based on ODR identifiers. We also need to read
// the correct module out of a multi-module bitcode file.
if (!CI.getCodeGenOpts().ThinLTOIndexFile.empty()) {
VMContext->enableDebugTypeODRUniquing();
auto DiagErrors = [&](Error E) -> std::unique_ptr<llvm::Module> {
unsigned DiagID =
CI.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Error, "%0");
handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) {
CI.getDiagnostics().Report(DiagID) << EIB.message();
});
return {};
};
Expected<std::vector<BitcodeModule>> BMsOrErr = getBitcodeModuleList(MBRef);
if (!BMsOrErr)
return DiagErrors(BMsOrErr.takeError());
BitcodeModule *Bm = FindThinLTOModule(*BMsOrErr);
// We have nothing to do if the file contains no ThinLTO module. This is
// possible if ThinLTO compilation was not able to split module. Content of
// the file was already processed by indexing and will be passed to the
// linker using merged object file.
if (!Bm) {
auto M = llvm::make_unique<llvm::Module>("empty", *VMContext);
M->setTargetTriple(CI.getTargetOpts().Triple);
return M;
}
Expected<std::unique_ptr<llvm::Module>> MOrErr =
Bm->parseModule(*VMContext);
if (!MOrErr)
return DiagErrors(MOrErr.takeError());
return std::move(*MOrErr);
}
llvm::SMDiagnostic Err;
if (std::unique_ptr<llvm::Module> M = parseIR(MBRef, Err, *VMContext))
return M;
// Translate from the diagnostic info to the SourceManager location if
// available.
// TODO: Unify this with ConvertBackendLocation()
SourceLocation Loc;
if (Err.getLineNo() > 0) {
assert(Err.getColumnNo() >= 0);
Loc = SM.translateFileLineCol(SM.getFileEntryForID(SM.getMainFileID()),
Err.getLineNo(), Err.getColumnNo() + 1);
}
// Strip off a leading diagnostic code if there is one.
StringRef Msg = Err.getMessage();
if (Msg.startswith("error: "))
Msg = Msg.substr(7);
unsigned DiagID =
CI.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Error, "%0");
CI.getDiagnostics().Report(Loc, DiagID) << Msg;
return {};
}
void CodeGenAction::ExecuteAction() {
// If this is an IR file, we have to treat it specially.
if (getCurrentFileKind().getLanguage() == InputKind::LLVM_IR) {
BackendAction BA = static_cast<BackendAction>(Act);
CompilerInstance &CI = getCompilerInstance();
std::unique_ptr<raw_pwrite_stream> OS =
GetOutputStream(CI, getCurrentFile(), BA);
if (BA != Backend_EmitNothing && !OS)
return;
bool Invalid;
SourceManager &SM = CI.getSourceManager();
FileID FID = SM.getMainFileID();
llvm::MemoryBuffer *MainFile = SM.getBuffer(FID, &Invalid);
if (Invalid)
return;
TheModule = loadModule(*MainFile);
if (!TheModule)
return;
const TargetOptions &TargetOpts = CI.getTargetOpts();
if (TheModule->getTargetTriple() != TargetOpts.Triple) {
CI.getDiagnostics().Report(SourceLocation(),
diag::warn_fe_override_module)
<< TargetOpts.Triple;
TheModule->setTargetTriple(TargetOpts.Triple);
}
EmbedBitcode(TheModule.get(), CI.getCodeGenOpts(),
MainFile->getMemBufferRef());
LLVMContext &Ctx = TheModule->getContext();
Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler,
&CI.getDiagnostics());
EmitBackendOutput(CI.getDiagnostics(), CI.getHeaderSearchOpts(),
CI.getCodeGenOpts(), TargetOpts, CI.getLangOpts(),
CI.getTarget().getDataLayout(), TheModule.get(), BA,
std::move(OS));
return;
}
// Otherwise follow the normal AST path.
this->ASTFrontendAction::ExecuteAction();
}
//
void EmitAssemblyAction::anchor() { }
EmitAssemblyAction::EmitAssemblyAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitAssembly, _VMContext) {}
void EmitBCAction::anchor() { }
EmitBCAction::EmitBCAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitBC, _VMContext) {}
void EmitLLVMAction::anchor() { }
EmitLLVMAction::EmitLLVMAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitLL, _VMContext) {}
void EmitLLVMOnlyAction::anchor() { }
EmitLLVMOnlyAction::EmitLLVMOnlyAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitNothing, _VMContext) {}
void EmitCodeGenOnlyAction::anchor() { }
EmitCodeGenOnlyAction::EmitCodeGenOnlyAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitMCNull, _VMContext) {}
void EmitObjAction::anchor() { }
EmitObjAction::EmitObjAction(llvm::LLVMContext *_VMContext)
: CodeGenAction(Backend_EmitObj, _VMContext) {}<|fim▁end|> | // Create the copy and transfer ownership to clang::SourceManager.
// TODO: Avoid copying files into memory.
std::unique_ptr<llvm::MemoryBuffer> CBuf =
llvm::MemoryBuffer::getMemBufferCopy(LBuf->getBuffer(), |
<|file_name|>derives-span-PartialEq-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(PartialEq)]
struct Struct {<|fim▁hole|>//~^ ERROR
}
fn main() {}<|fim▁end|> | x: Error //~ ERROR |
<|file_name|>RdbmsStoreFactory.java<|end_file_name|><|fim▁begin|>package xsmeral.semnet.sink;
import java.util.Properties;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.sail.rdbms.RdbmsStore;
/**
* Factory of {@link RdbmsStore} repositories.
* <br />
* Takes parameters corresponding to RdbmsStore {@linkplain RdbmsStore#RdbmsStore(java.lang.String, java.lang.String, java.lang.String, java.lang.String) constructor}:
* <ul>
* <li><code>driver</code> - FQN of JDBC driver</li>
* <li><code>url</code> - JDBC URL</li>
* <li><code>user</code> - DB user name</li>
* <li><code>password</code> - DB password</li>
* </ul>
* @author Ron Šmeral ([email protected])
*/
public class RdbmsStoreFactory extends RepositoryFactory {
@Override
public void initialize() throws RepositoryException {
Properties props = getProperties();
String jdbcDriver = props.getProperty("driver");
String url = props.getProperty("url");
String user = props.getProperty("user");
String pwd = props.getProperty("password");<|fim▁hole|> throw new RepositoryException("Invalid parameters for repository");
} else {
Repository repo = new SailRepository(new RdbmsStore(jdbcDriver, url, user, pwd));
repo.initialize();
setRepository(repo);
}
}
}<|fim▁end|> | if (jdbcDriver == null || url == null || user == null || pwd == null) { |
<|file_name|>configuration.py<|end_file_name|><|fim▁begin|>"""Configure heppyplotlib or the underlying matplotlib."""
import matplotlib.pyplot as plt
def use_tex(use_serif=True, overwrite=True, preamble=None):
"""Configure pyplot to use LaTeX for text rendering."""
if plt.rcParams['text.usetex'] and not overwrite:
print("Will not override tex settings ...")
return
print("Will use tex for rendering ...")
if preamble is None:
if use_serif:
plt.rc('font', family='serif')
preamble = [r'\usepackage{amsmath}',
r'\usepackage{siunitx}',
r'\usepackage{hepnames}']
else:
# note that we do note even have a capital delta character (\Delta) apparently ...
# TODO: use a more complete sans serif font<|fim▁hole|> r'\renewcommand*\familydefault{\sfdefault}',
r'\usepackage{siunitx}',
r'\usepackage{hepnames}',
r'\sisetup{number-mode=text}', # force siunitx to actually use your fonts
r'\usepackage{sansmath}', # load up the sansmath for sans-serif math
r'\sansmath'] # enable sansmath
plt.rcParams['text.latex.preamble'] = preamble
plt.rc('text', usetex=True)
def set_font_sizes(normal=9, small=8):
r"""Configure pyplot to use these two font sizes.
Match LaTeX paper font sizes using:
.. code-block:: latex
\makeatletter
\newcommand\thefontsize[1]{{#1 The current font size is: \f@size pt\par}}
\makeatother
e.g. extract the font sizes for captions and subcaptions (as in the example)
"""
params = {'font.size': normal, # \thefontsize\small (like captions)
'figure.titlesize': normal,
'axes.titlesize': normal,
'axes.labelsize': normal,
'legend.fontsize': small,
'xtick.labelsize': small, # \thefontsize\footnotesize (like subcaptions)
'ytick.labelsize': small}
plt.rcParams.update(params)
def set_figure_size(latex_width, aspect_ratio=0.6875):
r"""Set figure size given a width in LaTeX points.
Match LaTeX paper text width using:
.. code-block:: latex
\the\textwidth
"""
tex_points_per_inch = 72.27
inches_per_tex_point = 1.0 / tex_points_per_inch
inches_width = latex_width * inches_per_tex_point
plt.rc('figure', figsize=[inches_width, inches_width * aspect_ratio])<|fim▁end|> | preamble = [r'\usepackage{amsmath}', |
<|file_name|>bitmap_glyph.rs<|end_file_name|><|fim▁begin|>use std::ptr::null_mut;
use { ffi, Bitmap };
pub struct BitmapGlyph {
library_raw: ffi::FT_Library,
raw: ffi::FT_BitmapGlyph
}
impl BitmapGlyph {
pub unsafe fn from_raw(library_raw: ffi::FT_Library, raw: ffi::FT_BitmapGlyph) -> Self {
ffi::FT_Reference_Library(library_raw);
BitmapGlyph { library_raw, raw }
}
#[inline(always)]
pub fn left(&self) -> i32 {
unsafe {
(*self.raw).left
}
}
#[inline(always)]
pub fn top(&self) -> i32 {
unsafe {
(*self.raw).top
}
}
#[inline(always)]
pub fn bitmap(&self) -> Bitmap {
unsafe { Bitmap::from_raw(&(*self.raw).bitmap) }<|fim▁hole|> pub fn raw(&self) -> &ffi::FT_BitmapGlyphRec {
unsafe {
&*self.raw
}
}
}
impl Clone for BitmapGlyph {
fn clone(&self) -> Self {
let mut target = null_mut();
let err = unsafe {
ffi::FT_Glyph_Copy(self.raw as ffi::FT_Glyph, &mut target)
};
if err == ffi::FT_Err_Ok {
unsafe { BitmapGlyph::from_raw(self.library_raw, target as ffi::FT_BitmapGlyph) }
} else {
panic!("Failed to copy bitmap glyph")
}
}
}
impl Drop for BitmapGlyph {
fn drop(&mut self) {
let err = unsafe {
ffi::FT_Done_Glyph(self.raw as ffi::FT_Glyph);
ffi::FT_Done_Library(self.library_raw)
};
if err != ffi::FT_Err_Ok {
panic!("Failed to drop library")
}
}
}<|fim▁end|> | }
#[inline(always)] |
<|file_name|>TIFFHeader.java<|end_file_name|><|fim▁begin|>/*
* @(#)TIFFHeader.java
*
* $Date: 2014-03-13 04:15:48 -0400 (Thu, 13 Mar 2014) $
*
* Copyright (c) 2011 by Jeremy Wood.
* All rights reserved.
*
* The copyright of this software is owned by Jeremy Wood.
* You may not use, copy or modify this software, except in
* accordance with the license agreement you entered into with
* Jeremy Wood. For details see accompanying license terms.
*
* This software is probably, but not necessarily, discussed here:
* https://javagraphics.java.net/
*
* That site should also contain the most recent official version
* of this software. (See the SVN repository for more details.)
*
Modified BSD License
Copyright (c) 2015, Jeremy Wood.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The name of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package gr.iti.mklab.reveal.forensics.util.ThumbnailExtractor.image.jpeg;
import java.io.IOException;
import java.io.InputStream;
class TIFFHeader {
boolean bigEndian;
int ifdOffset;
TIFFHeader(InputStream in) throws IOException {
byte[] array = new byte[4];
if(JPEGMarkerInputStream.readFully(in, array, 2, false)!=2) {
throw new IOException("Incomplete TIFF Header");
}
if(array[0]==73 && array[1]==73) { //little endian
bigEndian = false;
} else if(array[0]==77 && array[1]==77) { //big endian
bigEndian = true;
} else {
throw new IOException("Unrecognized endian encoding.");
}
if(JPEGMarkerInputStream.readFully(in, array, 2, !bigEndian)!=2) {
throw new IOException("Incomplete TIFF Header");
}
if(!(array[0]==0 && array[1]==42)) { //required byte in TIFF header
throw new IOException("Missing required identifier 0x002A.");
}<|fim▁hole|>
if(JPEGMarkerInputStream.readFully(in, array, 4, !bigEndian)!=4) {
throw new IOException("Incomplete TIFF Header");
}
ifdOffset = ((array[0] & 0xff) << 24) + ((array[1] & 0xff) << 16) +
((array[2] & 0xff) << 8) + ((array[3] & 0xff) << 0) ;
}
/** The length of this TIFF header. */
int getLength() {
return 8;
}
}<|fim▁end|> | |
<|file_name|>Cache.js<|end_file_name|><|fim▁begin|>/**
* JSONDB - JSON Database Manager
*
* Manage JSON files as databases with JSONDB Query Language (JQL)
*
* This content is released under the GPL License (GPL-3.0)
*
* Copyright (c) 2016, Centers Technologies
*
* @package JSONDB
* @author Nana Axel
* @copyright Copyright (c) 2016, Centers Technologies
* @license http://spdx.org/licenses/GPL-3.0 GPL License
* @filesource
*/
/**
* Class Cache
*
* @package Database
* @subpackage Utilities
* @category Cache
* @author Nana Axel
*/
var Cache = (function () {
function Cache() { }
/**
* Cache array
* @access private
* @static {object}
*/<|fim▁hole|>
/**
* Gets cached data
* @param {object|string} path The path to the table
* @return {object|*}
*/
Cache.prototype.get = function (path) {
if (typeof path === "object") {
var results = [];
for (var id in path) {
results.push(this.get(id));
}
return results;
}
if (!Cache.cache.hasOwnProperty(path)) {
var Util = new (require('./Util'))();
Cache.cache[path] = Util.getTableData(path);
}
return Cache.cache[path];
};
/**
* Updates the cached data for a table
* @param {string} path The path to the table
* @param {object|null} data The data to cache
* @return {object}
*/
Cache.prototype.update = function (path, data) {
data = data || null;
if (null !== data) {
Cache.cache[path] = data;
} else {
var Util = new (require('./Util'))();
Cache.cache[path] = Util.getTableData(path);
}
};
/**
* Resets the cache
* @return Cache
*/
Cache.prototype.reset = function () {
Cache.cache = {};
return this;
};
return Cache;
})();
// Exports the module
module.exports = new Cache();<|fim▁end|> | Cache.cache = {}; |
<|file_name|>fixer_virtualbox_rename_test.go<|end_file_name|><|fim▁begin|>package fix
import (
"reflect"
"testing"
)
func TestFixerVirtualBoxRename_impl(t *testing.T) {
var _ Fixer = new(FixerVirtualBoxRename)
}
func TestFixerVirtualBoxRename_Fix(t *testing.T) {
cases := []struct {
Input map[string]interface{}
Expected map[string]interface{}
}{
{
Input: map[string]interface{}{
"type": "virtualbox",
},
Expected: map[string]interface{}{
"type": "virtualbox-iso",
},
},
}
for _, tc := range cases {
var f FixerVirtualBoxRename
input := map[string]interface{}{
"builders": []map[string]interface{}{tc.Input},
}
expected := map[string]interface{}{
"builders": []map[string]interface{}{tc.Expected},
}
output, err := f.Fix(input)
if err != nil {
t.Fatalf("err: %s", err)
}
if !reflect.DeepEqual(output, expected) {
t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected)
}
}
}
func TestFixerVirtualBoxRenameFix_provisionerOverride(t *testing.T) {
cases := []struct {
Input map[string]interface{}
Expected map[string]interface{}
}{
{
Input: map[string]interface{}{
"provisioners": []interface{}{
map[string]interface{}{
"override": map[string]interface{}{
"virtualbox": map[string]interface{}{},
},
},<|fim▁hole|> Expected: map[string]interface{}{
"provisioners": []interface{}{
map[string]interface{}{
"override": map[string]interface{}{
"virtualbox-iso": map[string]interface{}{},
},
},
},
},
},
}
for _, tc := range cases {
var f FixerVirtualBoxRename
output, err := f.Fix(tc.Input)
if err != nil {
t.Fatalf("err: %s", err)
}
if !reflect.DeepEqual(output, tc.Expected) {
t.Fatalf("unexpected:\n\n%#v\nexpected:\n\n%#v\n", output, tc.Expected)
}
}
}<|fim▁end|> | },
},
|
<|file_name|>handlers.py<|end_file_name|><|fim▁begin|>import logging
from time import strftime
def closed():
logging.info('Headlights process stopped')
def criterr(errortext):
logging.critical('A fatal error occured :: ' + errortext)
exit()
def err(errortext):
logging.error('An error occured :: ' + errortext)
def warn(errortext):
logging.warning(errortext)<|fim▁hole|>def debug(errortext):
logging.debug(errortext)<|fim▁end|> |
def inf(errortext):
logging.info(errortext)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, unicode_literals
from django.views.generic.base import TemplateView<|fim▁hole|><|fim▁end|> |
class CoachToolsView(TemplateView):
template_name = "coach/coach.html" |
<|file_name|>ClientProxy.java<|end_file_name|><|fim▁begin|>package cf.energizingcoalition.energizingcoalition.proxy;<|fim▁hole|>public class ClientProxy extends CommonProxy
{
@Override
public void registerRenderers()
{
}
}<|fim▁end|> | |
<|file_name|>CatalogManagerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.opencb.opencga.catalog;
import com.mongodb.BasicDBObject;
import org.junit.*;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.opencb.opencga.catalog.db.api.CatalogSampleDBAdaptor.SampleFilterOption.*;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.opencb.commons.test.GenericTest;
import org.opencb.datastore.core.ObjectMap;
import org.opencb.datastore.core.QueryOptions;
import org.opencb.datastore.core.QueryResult;
import org.opencb.datastore.core.config.DataStoreServerAddress;
import org.opencb.datastore.mongodb.MongoDataStore;
import org.opencb.datastore.mongodb.MongoDataStoreManager;
import org.opencb.opencga.catalog.authentication.CatalogAuthenticationManager;
import org.opencb.opencga.catalog.db.api.CatalogFileDBAdaptor;
import org.opencb.opencga.catalog.db.api.CatalogSampleDBAdaptor;
import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.io.CatalogIOManager;
import org.opencb.opencga.catalog.utils.CatalogAnnotationsValidatorTest;
import org.opencb.opencga.catalog.utils.CatalogFileUtils;
import org.opencb.opencga.catalog.models.*;
import org.opencb.opencga.catalog.models.File;
import org.opencb.opencga.catalog.exceptions.CatalogDBException;
import org.opencb.opencga.core.common.StringUtils;
import org.opencb.opencga.core.common.TimeUtils;
import java.io.*;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
public class CatalogManagerTest extends GenericTest {
public final static String PASSWORD = "asdf";
protected CatalogManager catalogManager;
protected String sessionIdUser;
protected String sessionIdUser2;
protected String sessionIdUser3;
@Rule
public ExpectedException thrown = ExpectedException.none();
private File testFolder;
@Before
public void setUp() throws IOException, CatalogException {
InputStream is = CatalogManagerTest.class.getClassLoader().getResourceAsStream("catalog.properties");
Properties properties = new Properties();
properties.load(is);
clearCatalog(properties);
catalogManager = new CatalogManager(properties);
catalogManager.createUser("user", "User Name", "[email protected]", PASSWORD, "", null);
catalogManager.createUser("user2", "User2 Name", "[email protected]", PASSWORD, "", null);
catalogManager.createUser("user3", "User3 Name", "[email protected]", PASSWORD, "ACME", null);
sessionIdUser = catalogManager.login("user", PASSWORD, "127.0.0.1").first().getString("sessionId");
sessionIdUser2 = catalogManager.login("user2", PASSWORD, "127.0.0.1").first().getString("sessionId");
sessionIdUser3 = catalogManager.login("user3", PASSWORD, "127.0.0.1").first().getString("sessionId");
Project project1 = catalogManager.createProject("user", "Project about some genomes", "1000G", "", "ACME", null, sessionIdUser).first();
Project project2 = catalogManager.createProject("user2", "Project Management Project", "pmp", "life art intelligent system", "myorg", null, sessionIdUser2).first();
Project project3 = catalogManager.createProject("user3", "project 1", "p1", "", "", null, sessionIdUser3).first();
int studyId = catalogManager.createStudy(project1.getId(), "Phase 1", "phase1", Study.Type.TRIO, "Done", sessionIdUser).first().getId();
int studyId2 = catalogManager.createStudy(project1.getId(), "Phase 3", "phase3", Study.Type.CASE_CONTROL, "d", sessionIdUser).first().getId();
int studyId3 = catalogManager.createStudy(project2.getId(), "Study 1", "s1", Study.Type.CONTROL_SET, "", sessionIdUser2).first().getId();
catalogManager.createFolder(studyId2, Paths.get("data/test/folder/"), true, null, sessionIdUser);
testFolder = catalogManager.createFolder(studyId, Paths.get("data/test/folder/"), true, null, sessionIdUser).first();
ObjectMap attributes = new ObjectMap();
attributes.put("field", "value");
attributes.put("numValue", 5);
catalogManager.modifyFile(testFolder.getId(), new ObjectMap("attributes", attributes), sessionIdUser);
File fileTest1k = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE,
testFolder.getPath() + "test_1K.txt.gz",
StringUtils.randomString(1000).getBytes(), "", false, sessionIdUser).first();
attributes = new ObjectMap();
attributes.put("field", "value");
attributes.put("name", "fileTest1k");
attributes.put("numValue", "10");
attributes.put("boolean", false);
catalogManager.modifyFile(fileTest1k.getId(), new ObjectMap("attributes", attributes), sessionIdUser);
File fileTest05k = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE,
testFolder.getPath() + "test_0.5K.txt",
StringUtils.randomString(500).getBytes(), "", false, sessionIdUser).first();
attributes = new ObjectMap();
attributes.put("field", "valuable");
attributes.put("name", "fileTest05k");
attributes.put("numValue", 5);
attributes.put("boolean", true);
catalogManager.modifyFile(fileTest05k.getId(), new ObjectMap("attributes", attributes), sessionIdUser);
File test01k = catalogManager.createFile(studyId, File.Format.IMAGE, File.Bioformat.NONE,
testFolder.getPath() + "test_0.1K.png",
StringUtils.randomString(100).getBytes(), "", false, sessionIdUser).first();
attributes = new ObjectMap();
attributes.put("field", "other");
attributes.put("name", "test01k");
attributes.put("numValue", 50);
attributes.put("nested", new ObjectMap("num1", 45).append("num2", 33).append("text", "HelloWorld"));
catalogManager.modifyFile(test01k.getId(), new ObjectMap("attributes", attributes), sessionIdUser);
Set<Variable> variables = new HashSet<>();
variables.addAll(Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, true, false, Collections.singletonList("0:130"), 1, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("HEIGHT", "", Variable.VariableType.NUMERIC, "1.5", false, false, Collections.singletonList("0:"), 2, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("ALIVE", "", Variable.VariableType.BOOLEAN, "", true, false, Collections.<String>emptyList(), 3, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("PHEN", "", Variable.VariableType.CATEGORICAL, "", true, false, Arrays.asList("CASE", "CONTROL"), 4, "", "", null, Collections.<String, Object>emptyMap())
));
VariableSet vs = catalogManager.createVariableSet(studyId, "vs", true, "", null, variables, sessionIdUser).first();
int s_1 = catalogManager.createSample(studyId, "s_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_2 = catalogManager.createSample(studyId, "s_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_3 = catalogManager.createSample(studyId, "s_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_4 = catalogManager.createSample(studyId, "s_4", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_5 = catalogManager.createSample(studyId, "s_5", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_6 = catalogManager.createSample(studyId, "s_6", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_7 = catalogManager.createSample(studyId, "s_7", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_8 = catalogManager.createSample(studyId, "s_8", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int s_9 = catalogManager.createSample(studyId, "s_9", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
catalogManager.annotateSample(s_1, "annot1", vs.getId(), new ObjectMap("NAME", "s_1").append("AGE", 6).append("ALIVE", true).append("PHEN", "CONTROL"), null, true, sessionIdUser);
catalogManager.annotateSample(s_2, "annot1", vs.getId(), new ObjectMap("NAME", "s_2").append("AGE", 10).append("ALIVE", false).append("PHEN", "CASE"), null, true, sessionIdUser);
catalogManager.annotateSample(s_3, "annot1", vs.getId(), new ObjectMap("NAME", "s_3").append("AGE", 15).append("ALIVE", true).append("PHEN", "CONTROL"), null, true, sessionIdUser);
catalogManager.annotateSample(s_4, "annot1", vs.getId(), new ObjectMap("NAME", "s_4").append("AGE", 22).append("ALIVE", false).append("PHEN", "CONTROL"), null, true, sessionIdUser);
catalogManager.annotateSample(s_5, "annot1", vs.getId(), new ObjectMap("NAME", "s_5").append("AGE", 29).append("ALIVE", true).append("PHEN", "CASE"), null, true, sessionIdUser);
catalogManager.annotateSample(s_6, "annot2", vs.getId(), new ObjectMap("NAME", "s_6").append("AGE", 38).append("ALIVE", true).append("PHEN", "CONTROL"), null, true, sessionIdUser);
catalogManager.annotateSample(s_7, "annot2", vs.getId(), new ObjectMap("NAME", "s_7").append("AGE", 46).append("ALIVE", false).append("PHEN", "CASE"), null, true, sessionIdUser);
catalogManager.annotateSample(s_8, "annot2", vs.getId(), new ObjectMap("NAME", "s_8").append("AGE", 72).append("ALIVE", true).append("PHEN", "CONTROL"), null, true, sessionIdUser);
catalogManager.modifyFile(test01k.getId(), new ObjectMap("sampleIds", Arrays.asList(s_1, s_2, s_3, s_4, s_5)), sessionIdUser);
}
@After
public void tearDown() throws Exception {
if(sessionIdUser != null) {
catalogManager.logout("user", sessionIdUser);
}
if(sessionIdUser2 != null) {
catalogManager.logout("user2", sessionIdUser2);
}
if(sessionIdUser3 != null) {
catalogManager.logout("user3", sessionIdUser3);
}
// catalogManager.close();
}
public CatalogManager getTestCatalogManager() {
return catalogManager;
}
@Test
public void testAdminUserExists() throws Exception {
thrown.expect(CatalogException.class);
catalogManager.login("admin", "admin", null);
}
@Test
public void testAdminUserExists2() throws Exception {
thrown.expect(CatalogException.class);
QueryResult<ObjectMap> login = catalogManager.login("admin", CatalogAuthenticationManager.cipherPassword("admin"), null);
User admin = catalogManager.getUser("admin", null, login.first().getString("sessionId")).first();
assertEquals(User.Role.ADMIN, admin.getRole());
}
@Test
public void testCreateExistingUser() throws Exception {
thrown.expect(CatalogException.class);
catalogManager.createUser("user", "User Name", "[email protected]", PASSWORD, "", null);
}
@Test
public void testLoginAsAnonymous() throws Exception {
System.out.println(catalogManager.loginAsAnonymous("127.0.0.1"));
}
@Test
public void testLogin() throws Exception {
QueryResult<ObjectMap> queryResult = catalogManager.login("user", PASSWORD, "127.0.0.1");
System.out.println(queryResult.first().toJson());
thrown.expect(CatalogException.class);
catalogManager.login("user", "fakePassword", "127.0.0.1");
// fail("Expected 'wrong password' exception");
}
@Test
public void testLogoutAnonymous() throws Exception {
QueryResult<ObjectMap> queryResult = catalogManager.loginAsAnonymous("127.0.0.1");
catalogManager.logoutAnonymous(queryResult.first().getString("sessionId"));
}
@Test
public void testGetUserInfo() throws CatalogException {
QueryResult<User> user = catalogManager.getUser("user", null, sessionIdUser);
System.out.println("user = " + user);
QueryResult<User> userVoid = catalogManager.getUser("user", user.first().getLastActivity(), sessionIdUser);
System.out.println("userVoid = " + userVoid);
assertTrue(userVoid.getResult().isEmpty());
try {
catalogManager.getUser("user", null, sessionIdUser2);
fail();
} catch (CatalogException e) {
System.out.println(e);
}
}
@Test
public void testModifyUser() throws CatalogException, InterruptedException {
ObjectMap params = new ObjectMap();
String newName = "Changed Name " + StringUtils.randomString(10);
String newPassword = StringUtils.randomString(10);
String newEmail = "[email protected]";
params.put("name", newName);
ObjectMap attributes = new ObjectMap("myBoolean", true);
attributes.put("value", 6);
attributes.put("object", new BasicDBObject("id", 1234));
params.put("attributes", attributes);
User userPre = catalogManager.getUser("user", null, sessionIdUser).first();
System.out.println("userPre = " + userPre);
Thread.sleep(10);
catalogManager.modifyUser("user", params, sessionIdUser);
catalogManager.changeEmail("user", newEmail, sessionIdUser);
catalogManager.changePassword("user", PASSWORD, newPassword, sessionIdUser);
List<User> userList = catalogManager.getUser("user", userPre.getLastActivity(), new QueryOptions("exclude", Arrays.asList("sessions")), sessionIdUser).getResult();
if(userList.isEmpty()){
fail("Error. LastActivity should have changed");
}
User userPost = userList.get(0);
System.out.println("userPost = " + userPost);
assertTrue(!userPre.getLastActivity().equals(userPost.getLastActivity()));
assertEquals(userPost.getName(), newName);
assertEquals(userPost.getEmail(), newEmail);
assertEquals(userPost.getPassword(), CatalogAuthenticationManager.cipherPassword(newPassword));
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
assertEquals(userPost.getAttributes().get(entry.getKey()), entry.getValue());
}
catalogManager.changePassword("user", newPassword, PASSWORD, sessionIdUser);
try {
params = new ObjectMap();
params.put("password", "1234321");
catalogManager.modifyUser("user", params, sessionIdUser);
fail("Expected exception");
} catch (CatalogDBException e){
System.out.println(e);
}
try {
catalogManager.modifyUser("user", params, sessionIdUser2);
fail("Expected exception");
} catch (CatalogException e){
System.out.println(e);
}
}
/**
* Project methods
* ***************************
*/
@Test
public void testCreateAnonymousProject() throws IOException, CatalogException {
String sessionId = catalogManager.loginAsAnonymous("127.0.0.1").first().getString("sessionId");
String userId = catalogManager.getUserIdBySessionId(sessionId);
catalogManager.createProject(userId, "Project", "project", "", "", null, sessionId);
catalogManager.logoutAnonymous(sessionId);
}
@Test
public void testGetAllProjects() throws Exception {
QueryResult<Project> projects = catalogManager.getAllProjects("user", null, sessionIdUser);
assertEquals(1, projects.getNumResults());
projects = catalogManager.getAllProjects("user", null, sessionIdUser2);
assertEquals(0, projects.getNumResults());
}
@Test
public void testCreateProject() throws Exception {
String projectAlias = "projectAlias_ASDFASDF";
catalogManager.createProject("user", "Project", projectAlias, "", "", null, sessionIdUser);
thrown.expect(CatalogDBException.class);
catalogManager.createProject("user", "Project", projectAlias, "", "", null, sessionIdUser);
}
@Test
public void testModifyProject() throws CatalogException {
String newProjectName = "ProjectName " + StringUtils.randomString(10);
int projectId = catalogManager.getUser("user", null, sessionIdUser).first().getProjects().get(0).getId();
ObjectMap options = new ObjectMap();
options.put("name", newProjectName);
ObjectMap attributes = new ObjectMap("myBoolean", true);
attributes.put("value", 6);
attributes.put("object", new BasicDBObject("id", 1234));
options.put("attributes", attributes);
catalogManager.modifyProject(projectId, options, sessionIdUser);
QueryResult<Project> result = catalogManager.getProject(projectId, null, sessionIdUser);
Project project = result.first();
System.out.println(result);
assertEquals(newProjectName, project.getName());
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
assertEquals(project.getAttributes().get(entry.getKey()), entry.getValue());
}
options = new ObjectMap();
options.put("alias", "newProjectAlias");
catalogManager.modifyProject(projectId, options, sessionIdUser);
try {
catalogManager.modifyProject(projectId, options, sessionIdUser2);
fail("Expected 'Permission denied' exception");
} catch (CatalogDBException e){
System.out.println(e);
}
}
/**
* Study methods
* ***************************
*/
@Test
public void testModifyStudy() throws Exception {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
String newName = "Phase 1 "+ StringUtils.randomString(20);
String newDescription = StringUtils.randomString(500);
ObjectMap parameters = new ObjectMap();
parameters.put("name", newName);
parameters.put("description", newDescription);
BasicDBObject attributes = new BasicDBObject("key", "value");
parameters.put("attributes", attributes);
catalogManager.modifyStudy(studyId, parameters, sessionIdUser);
QueryResult<Study> result = catalogManager.getStudy(studyId, sessionIdUser);
System.out.println(result);
Study study = result.first();
assertEquals(study.getName(), newName);
assertEquals(study.getDescription(), newDescription);
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
assertEquals(study.getAttributes().get(entry.getKey()), entry.getValue());
}
}
/**
* File methods
* ***************************
*/
@Test
public void testDeleteDataFromStudy() throws Exception {
}
@Test
public void testCreateFolder() throws Exception {
int projectId = catalogManager.getAllProjects("user2", null, sessionIdUser2).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser2).first().getId();
Set<String> paths = catalogManager.getAllFiles(studyId, new QueryOptions("type", File.Type.FOLDER),
sessionIdUser2).getResult().stream().map(File::getPath).collect(Collectors.toSet());
assertEquals(3, paths.size());
assertTrue(paths.contains("")); //root
assertTrue(paths.contains("data/")); //data
assertTrue(paths.contains("analysis/")); //analysis
Path folderPath = Paths.get("data", "new", "folder");
File folder = catalogManager.createFolder(studyId, folderPath, true, null, sessionIdUser2).first();
paths = catalogManager.getAllFiles(studyId, new QueryOptions("type", File.Type.FOLDER),
sessionIdUser2).getResult().stream().map(File::getPath).collect(Collectors.toSet());
assertEquals(5, paths.size());
assertTrue(paths.contains("data/new/"));
assertTrue(paths.contains("data/new/folder/"));
}
@Test
public void testCreateAndUpload() throws Exception {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int studyId2 = catalogManager.getStudyId("user@1000G:phase3");
CatalogFileUtils catalogFileUtils = new CatalogFileUtils(catalogManager);
java.io.File fileTest;
String fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
QueryResult<File> fileResult = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.VARIANT, "data/" + fileName, "description", true, -1, sessionIdUser);
fileTest = createDebugFile();
catalogFileUtils.upload(fileTest.toURI(), fileResult.first(), null, sessionIdUser, false, false, true, true);
assertTrue("File deleted", !fileTest.exists());
fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
fileResult = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.VARIANT, "data/" + fileName, "description", true, -1, sessionIdUser);
fileTest = createDebugFile();
catalogFileUtils.upload(fileTest.toURI(), fileResult.first(), null, sessionIdUser, false, false, false, true);
assertTrue("File don't deleted", fileTest.exists());
assertTrue(fileTest.delete());
fileName = "item." + TimeUtils.getTimeMillis() + ".txt";
fileResult = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "data/" + fileName,
StringUtils.randomString(200).getBytes(), "description", true, sessionIdUser);
assertTrue("", fileResult.first().getStatus() == File.Status.READY);
assertTrue("", fileResult.first().getDiskUsage() == 200);
fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
fileTest = createDebugFile();
QueryResult<File> fileQueryResult = catalogManager.createFile(
studyId2, File.Format.PLAIN, File.Bioformat.VARIANT, "data/deletable/folder/" + fileName, "description", true, -1, sessionIdUser);
catalogFileUtils.upload(fileTest.toURI(), fileQueryResult.first(), null, sessionIdUser, false, false, true, true);
assertFalse("File deleted by the upload", fileTest.delete());
fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
fileTest = createDebugFile();
fileQueryResult = catalogManager.createFile(
studyId2, File.Format.PLAIN, File.Bioformat.VARIANT, "data/deletable/" + fileName, "description", true, -1, sessionIdUser);
catalogFileUtils.upload(fileTest.toURI(), fileQueryResult.first(), null, sessionIdUser, false, false, false, true);
assertTrue(fileTest.delete());
fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
fileTest = createDebugFile();
fileQueryResult = catalogManager.createFile(
studyId2, File.Format.PLAIN, File.Bioformat.VARIANT, "" + fileName, "file at root", true, -1, sessionIdUser);
catalogFileUtils.upload(fileTest.toURI(), fileQueryResult.first(), null, sessionIdUser, false, false, false, true);
assertTrue(fileTest.delete());
fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
fileTest = createDebugFile();
long size = Files.size(fileTest.toPath());
fileQueryResult = catalogManager.createFile(studyId2, File.Format.PLAIN, File.Bioformat.VARIANT, "" + fileName,
fileTest.toURI(), "file at root", true, sessionIdUser);
assertTrue("File should be moved", !fileTest.exists());
assertTrue(fileQueryResult.first().getDiskUsage() == size);
}
@Test
public void testDownloadAndHeadFile() throws CatalogException, IOException, InterruptedException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
CatalogFileUtils catalogFileUtils = new CatalogFileUtils(catalogManager);
String fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
java.io.File fileTest;
InputStream is = new FileInputStream(fileTest = createDebugFile());
File file = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.VARIANT, "data/" + fileName, "description", true, -1, sessionIdUser).first();
catalogFileUtils.upload(is, file, sessionIdUser, false, false, true);
is.close();
byte[] bytes = new byte[100];
byte[] bytesOrig = new byte[100];
DataInputStream fis = new DataInputStream(new FileInputStream(fileTest));
DataInputStream dis = catalogManager.downloadFile(file.getId(), sessionIdUser);
fis.read(bytesOrig, 0, 100);
dis.read(bytes, 0, 100);
fis.close();
dis.close();
assertArrayEquals(bytesOrig, bytes);
int offset = 5;
int limit = 30;
dis = catalogManager.downloadFile(file.getId(), offset, limit, sessionIdUser);
fis = new DataInputStream(new FileInputStream(fileTest));
for (int i = 0; i < offset; i++) {
fis.readLine();
}
String line;
int lines = 0;
while ((line = dis.readLine()) != null) {
lines++;
System.out.println(line);
assertEquals(fis.readLine(), line);
}
assertEquals(limit-offset, lines);
fis.close();
dis.close();
fileTest.delete();
}
@Test
public void testDownloadFile() throws CatalogException, IOException, InterruptedException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
String fileName = "item." + TimeUtils.getTimeMillis() + ".vcf";
int fileSize = 200;
byte[] bytesOrig = StringUtils.randomString(fileSize).getBytes();
File file = catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "data/" + fileName,
bytesOrig, "description", true, sessionIdUser).first();
DataInputStream dis = catalogManager.downloadFile(file.getId(), sessionIdUser);
byte[] bytes = new byte[fileSize];
dis.read(bytes, 0, fileSize);
assertTrue(Arrays.equals(bytesOrig, bytes));
}
@Test
public void renameFileTest() throws CatalogException, IOException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "data/file.txt",
StringUtils.randomString(200).getBytes(), "description", true, sessionIdUser);
catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "data/nested/folder/file2.txt",
StringUtils.randomString(200).getBytes(), "description", true, sessionIdUser);
catalogManager.renameFile(catalogManager.getFileId("user@1000G:phase1:data/nested/"), "nested2", sessionIdUser);
Set<String> paths = catalogManager.getAllFiles(studyId, null, sessionIdUser).getResult()
.stream().map(File::getPath).collect(Collectors.toSet());
assertTrue(paths.contains("data/nested2/"));
assertFalse(paths.contains("data/nested/"));
assertTrue(paths.contains("data/nested2/folder/"));
assertTrue(paths.contains("data/nested2/folder/file2.txt"));
assertTrue(paths.contains("data/file.txt"));
catalogManager.renameFile(catalogManager.getFileId("user@1000G:phase1:data/"), "Data", sessionIdUser);
paths = catalogManager.getAllFiles(studyId, null, sessionIdUser).getResult()
.stream().map(File::getPath).collect(Collectors.toSet());
assertTrue(paths.contains("Data/"));
assertTrue(paths.contains("Data/file.txt"));
assertTrue(paths.contains("Data/nested2/"));
assertTrue(paths.contains("Data/nested2/folder/"));
assertTrue(paths.contains("Data/nested2/folder/file2.txt"));
}
@Test
public void searchFileTest() throws CatalogException, IOException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
QueryOptions options;
QueryResult<File> result;
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.name.toString(), "~^data");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
//Folder "jobs" does not exist
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.directory.toString(), "jobs");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(0, result.getNumResults());
//Get all files in data
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.directory.toString(), "data/");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
//Get all files in data recursively
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.directory.toString(), "data/.*");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(5, result.getNumResults());
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.type.toString(), "FILE");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
result.getResult().forEach(f -> assertEquals(File.Type.FILE, f.getType()));
int numFiles = result.getNumResults();
assertEquals(3, numFiles);
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.type.toString(), "FOLDER");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
result.getResult().forEach(f -> assertEquals(File.Type.FOLDER, f.getType()));
int numFolders = result.getNumResults();
assertEquals(5, numFolders);
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.path.toString(), "");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
assertEquals(".", result.first().getName());
options = new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.type.toString(), "FILE,FOLDER");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(8, result.getNumResults());
assertEquals(numFiles + numFolders, result.getNumResults());
options = new QueryOptions("type", "FILE");
options.put("diskUsage", ">400");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(2, result.getNumResults());
options = new QueryOptions("type", "FILE");
options.put("diskUsage", "<400");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
List<Integer> sampleIds = catalogManager.getAllSamples(studyId, new QueryOptions("name", "s_1,s_3,s_4"), sessionIdUser).getResult().stream().map(Sample::getId).collect(Collectors.toList());
result = catalogManager.searchFile(studyId, new QueryOptions("sampleIds", sampleIds), sessionIdUser);
assertEquals(1, result.getNumResults());
options = new QueryOptions("type", "FILE");
options.put("format", "PLAIN");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(2, result.getNumResults());
CatalogFileDBAdaptor.FileFilterOption attributes = CatalogFileDBAdaptor.FileFilterOption.attributes;
CatalogFileDBAdaptor.FileFilterOption nattributes = CatalogFileDBAdaptor.FileFilterOption.nattributes;
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".nested.text" , "~H"), sessionIdUser);
assertEquals(1, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".nested.num1" , ">0"), sessionIdUser);
assertEquals(1, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".nested.num1" , ">0"), sessionIdUser);
assertEquals(0, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".field" , "~val"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions("attributes.field" , "~val"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".field", "=~val"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".field", "~val"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".field", "value"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".field", "other"), sessionIdUser);
assertEquals(1, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions("nattributes.numValue", ">=5"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions("nattributes.numValue", ">4,<6"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", "==5"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", "==5.0"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", "5.0"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", ">5"), sessionIdUser);
assertEquals(1, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", ">4"), sessionIdUser);
assertEquals(3, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", "<6"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue", "<=5"), sessionIdUser);
assertEquals(2, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue" , "<5"), sessionIdUser);
assertEquals(0, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue" , "<2"), sessionIdUser);
assertEquals(0, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue" , "==23"), sessionIdUser);
assertEquals(0, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(attributes + ".numValue" , "=~10"), sessionIdUser);
assertEquals(1, result.getNumResults());
result = catalogManager.searchFile(studyId, new QueryOptions(nattributes + ".numValue" , "=10"), sessionIdUser);
assertEquals(0, result.getNumResults());
QueryOptions query = new QueryOptions();
query.add(attributes + ".name", "fileTest1k");
query.add(attributes + ".field", "value");
result = catalogManager.searchFile(studyId, query, sessionIdUser);
assertEquals(1, result.getNumResults());
query = new QueryOptions();
query.add(attributes + ".name", "fileTest1k");
query.add(attributes + ".field", "value");
query.add(attributes + ".numValue", Arrays.asList(8, 9, 10)); //Searching as String. numValue = "10"
result = catalogManager.searchFile(studyId, query, sessionIdUser);
assertEquals(1, result.getNumResults());
}
@Test
public void testSearchFileBoolean() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
QueryOptions options;
QueryResult<File> result;
CatalogFileDBAdaptor.FileFilterOption battributes = CatalogFileDBAdaptor.FileFilterOption.battributes;
options = new QueryOptions(battributes + ".boolean", "true"); //boolean in [true]
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
options = new QueryOptions(battributes + ".boolean", "false"); //boolean in [false]
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(1, result.getNumResults());
options = new QueryOptions(battributes + ".boolean", "!=false"); //boolean in [null, true]
options.put("type", "FILE");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(2, result.getNumResults());
options = new QueryOptions(battributes + ".boolean", "!=true"); //boolean in [null, false]
options.put("type", "FILE");
result = catalogManager.searchFile(studyId, options, sessionIdUser);
assertEquals(2, result.getNumResults());
}
@Test
public void testSearchFileFail1() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
thrown.expect(CatalogDBException.class);
catalogManager.searchFile(studyId, new QueryOptions(CatalogFileDBAdaptor.FileFilterOption.nattributes.toString() + ".numValue", "==NotANumber"), sessionIdUser);
}
@Test
public void testSearchFileFail2() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
thrown.expect(CatalogDBException.class);
catalogManager.searchFile(studyId, new QueryOptions("badFilter", "badFilter"), sessionIdUser);
}
@Test
public void testSearchFileFail3() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
thrown.expect(CatalogDBException.class);
catalogManager.searchFile(studyId, new QueryOptions("id", "~5"), sessionIdUser); //Bad operator
}
@Test
public void testGetFileParent() throws CatalogException, IOException {
int fileId;
fileId = catalogManager.getFileId("user@1000G:phase1:data/test/folder/");
System.out.println(catalogManager.getFile(fileId, null, sessionIdUser));
QueryResult<File> fileParent = catalogManager.getFileParent(fileId, null, sessionIdUser);
System.out.println(fileParent);
fileId = catalogManager.getFileId("user@1000G:phase1:data/");
System.out.println(catalogManager.getFile(fileId, null, sessionIdUser));
fileParent = catalogManager.getFileParent(fileId, null, sessionIdUser);
System.out.println(fileParent);
fileId = catalogManager.getFileId("user@1000G:phase1:");
System.out.println(catalogManager.getFile(fileId, null, sessionIdUser));
fileParent = catalogManager.getFileParent(fileId, null, sessionIdUser);
System.out.println(fileParent);
}
@Test
public void testGetFileParents1() throws CatalogException {
int fileId;
QueryResult<File> fileParents;
fileId = catalogManager.getFileId("user@1000G:phase1:data/test/folder/");
fileParents = catalogManager.getFileParents(fileId, null, sessionIdUser);
assertEquals(4, fileParents.getNumResults());
assertEquals("", fileParents.getResult().get(0).getPath());
assertEquals("data/", fileParents.getResult().get(1).getPath());
assertEquals("data/test/", fileParents.getResult().get(2).getPath());
assertEquals("data/test/folder/", fileParents.getResult().get(3).getPath());
}
@Test
public void testGetFileParents2() throws CatalogException {
int fileId;
QueryResult<File> fileParents;
fileId = catalogManager.getFileId("user@1000G:phase1:data/test/folder/test_1K.txt.gz");
fileParents = catalogManager.getFileParents(fileId, null, sessionIdUser);
assertEquals(4, fileParents.getNumResults());
assertEquals("", fileParents.getResult().get(0).getPath());
assertEquals("data/", fileParents.getResult().get(1).getPath());
assertEquals("data/test/", fileParents.getResult().get(2).getPath());
assertEquals("data/test/folder/", fileParents.getResult().get(3).getPath());
}
@Test
public void testGetFileParents3() throws CatalogException {
int fileId;
QueryResult<File> fileParents;
fileId = catalogManager.getFileId("user@1000G:phase1:data/test/");
fileParents = catalogManager.getFileParents(fileId,
new QueryOptions("include", "projects.studies.files.path,projects.studies.files.id"),
sessionIdUser);
assertEquals(3, fileParents.getNumResults());
assertEquals("", fileParents.getResult().get(0).getPath());
assertEquals("data/", fileParents.getResult().get(1).getPath());
assertEquals("data/test/", fileParents.getResult().get(2).getPath());
fileParents.getResult().forEach(f -> {
assertNull(f.getName());
assertNotNull(f.getPath());
assertTrue(f.getId() != 0);
});
}
@Test
public void testDeleteFile () throws CatalogException, IOException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
List<File> result = catalogManager.getAllFiles(studyId, new QueryOptions("type", "FILE"), sessionIdUser).getResult();
for (File file : result) {
catalogManager.deleteFile(file.getId(), sessionIdUser);
}
CatalogFileUtils catalogFileUtils = new CatalogFileUtils(catalogManager);
catalogManager.getAllFiles(studyId, new QueryOptions("type", "FILE"), sessionIdUser).getResult().forEach(f -> {
assertEquals(f.getStatus(), File.Status.TRASHED);
assertTrue(f.getName().startsWith(".deleted"));
});
int studyId2 = catalogManager.getAllStudies(projectId, null, sessionIdUser).getResult().get(1).getId();
result = catalogManager.getAllFiles(studyId2, new QueryOptions("type", "FILE"), sessionIdUser).getResult();
for (File file : result) {
catalogManager.deleteFile(file.getId(), sessionIdUser);
}
catalogManager.getAllFiles(studyId, new QueryOptions("type", "FILE"), sessionIdUser).getResult().forEach(f -> {
assertEquals(f.getStatus(), File.Status.TRASHED);
assertTrue(f.getName().startsWith(".deleted"));
});
}
@Test
public void testDeleteLeafFolder () throws CatalogException, IOException {
int deletable = catalogManager.getFileId("user@1000G/phase3/data/test/folder/");
deleteFolderAndCheck(deletable);
}
@Test
public void testDeleteMiddleFolder () throws CatalogException, IOException {
int deletable = catalogManager.getFileId("user@1000G/phase3/data/");
deleteFolderAndCheck(deletable);
}
@Test
public void testDeleteRootFolder () throws CatalogException, IOException {
int deletable = catalogManager.getFileId("user@1000G/phase3/");
thrown.expect(CatalogException.class);
deleteFolderAndCheck(deletable);
}
@Test
public void deleteFolderTest() throws CatalogException, IOException {
List<File> folderFiles = new LinkedList<>();
int studyId = catalogManager.getStudyId("user@1000G/phase3");
File folder = catalogManager.createFolder(studyId, Paths.get("folder"), false, null, sessionIdUser).first();
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/my.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/my2.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/my3.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/subfolder/my4.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/subfolder/my5.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
folderFiles.add(catalogManager.createFile(studyId, File.Format.PLAIN, File.Bioformat.NONE, "folder/subfolder/subsubfolder/my6.txt", StringUtils.randomString(200).getBytes(), "", true, sessionIdUser).first());
CatalogIOManager ioManager = catalogManager.getCatalogIOManagerFactory().get(catalogManager.getFileUri(folder));
for (File file : folderFiles) {
assertTrue(ioManager.exists(catalogManager.getFileUri(file)));
}
File stagedFile = catalogManager.createFile(studyId, File.Type.FILE, File.Format.PLAIN, File.Bioformat.NONE, "folder/subfolder/subsubfolder/my_staged.txt",
null, null, null, File.Status.STAGE, 0, -1, null, -1, null, null, true, null, sessionIdUser).first();
thrown.expect(CatalogException.class);
try {
catalogManager.deleteFolder(folder.getId(), sessionIdUser);
} finally {
assertEquals("Folder name should not be modified", folder.getPath(), catalogManager.getFile(folder.getId(), sessionIdUser).first().getPath());
assertTrue(ioManager.exists(catalogManager.getFileUri(catalogManager.getFile(folder.getId(), sessionIdUser).first())));
for (File file : folderFiles) {
assertEquals("File name should not be modified", file.getPath(), catalogManager.getFile(file.getId(), sessionIdUser).first().getPath());
URI fileUri = catalogManager.getFileUri(catalogManager.getFile(file.getId(), sessionIdUser).first());
assertTrue("File uri: " + fileUri + " should exist", ioManager.exists(fileUri));
}
}
}
private void deleteFolderAndCheck(int deletable) throws CatalogException, IOException {
List<File> allFilesInFolder;
catalogManager.deleteFolder(deletable, sessionIdUser);
File file = catalogManager.getFile(deletable, sessionIdUser).first();
allFilesInFolder = catalogManager.getAllFilesInFolder(deletable, null, sessionIdUser).getResult();
allFilesInFolder = catalogManager.searchFile(
catalogManager.getStudyIdByFileId(deletable),
new QueryOptions("directory", catalogManager.getFile(deletable, sessionIdUser).first().getPath() + ".*"),
null, sessionIdUser).getResult();
assertTrue(file.getStatus() == File.Status.TRASHED);
for (File subFile : allFilesInFolder) {
assertTrue(subFile.getStatus() == File.Status.TRASHED);
}
}
/* TYPE_FILE UTILS */
public static java.io.File createDebugFile() throws IOException {
String fileTestName = "/tmp/fileTest " + StringUtils.randomString(5);
return createDebugFile(fileTestName);
}
public static java.io.File createDebugFile(String fileTestName) throws IOException {
return createDebugFile(fileTestName, 200);
}
public static java.io.File createDebugFile(String fileTestName, int lines) throws IOException {
DataOutputStream os = new DataOutputStream(new FileOutputStream(fileTestName));
os.writeBytes("Debug file name: " + fileTestName + "\n");
for (int i = 0; i < 100; i++) {
os.writeBytes(i + ", ");
}
for (int i = 0; i < lines; i++) {
os.writeBytes(StringUtils.randomString(500));
os.write('\n');
}
os.close();
return Paths.get(fileTestName).toFile();
}
/**
* Job methods
* ***************************
*/
@Test
public void testCreateJob() throws CatalogException, IOException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
File outDir = catalogManager.createFolder(studyId, Paths.get("jobs", "myJob"), true, null, sessionIdUser).first();
URI tmpJobOutDir = catalogManager.createJobOutDir(studyId, StringUtils.randomString(5), sessionIdUser);
catalogManager.createJob(
studyId, "myJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, outDir.getId(),
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.PREPARED, 0, 0, null, sessionIdUser);
catalogManager.createJob(
studyId, "myReadyJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, outDir.getId(),
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.READY, 0, 0, null, sessionIdUser);
catalogManager.createJob(
studyId, "myQueuedJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, outDir.getId(),
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.QUEUED, 0, 0, null, sessionIdUser);
catalogManager.createJob(
studyId, "myErrorJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, outDir.getId(),
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.ERROR, 0, 0, null, sessionIdUser);
String sessionId = catalogManager.login("admin", "admin", "localhost").first().get("sessionId").toString();
QueryResult<Job> unfinishedJobs = catalogManager.getUnfinishedJobs(sessionId);
assertEquals(2, unfinishedJobs.getNumResults());
QueryResult<Job> allJobs = catalogManager.getAllJobs(studyId, sessionId);
assertEquals(4, allJobs.getNumResults());
}
@Test
public void testCreateFailJob() throws CatalogException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
URI tmpJobOutDir = catalogManager.createJobOutDir(studyId, StringUtils.randomString(5), sessionIdUser);
thrown.expect(CatalogException.class);
catalogManager.createJob(
studyId, "myErrorJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, projectId, //Bad outputId
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.ERROR, 0, 0, null, sessionIdUser);
}
@Test
public void testGetAllJobs() throws CatalogException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
File outDir = catalogManager.createFolder(studyId, Paths.get("jobs", "myJob"), true, null, sessionIdUser).first();
URI tmpJobOutDir = catalogManager.createJobOutDir(studyId, StringUtils.randomString(5), sessionIdUser);
catalogManager.createJob(
studyId, "myErrorJob", "samtool", "description", "echo \"Hello World!\"", tmpJobOutDir, outDir.getId(),
Collections.emptyList(), null, new HashMap<>(), null, Job.Status.ERROR, 0, 0, null, sessionIdUser);
QueryResult<Job> allJobs = catalogManager.getAllJobs(studyId, sessionIdUser);
assertEquals(1, allJobs.getNumTotalResults());
assertEquals(1, allJobs.getNumResults());
}
/**
* VariableSet methods
* ***************************
*/
@Test
public void testCreateVariableSet () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int variableSetNum = study.getVariableSets().size();
Set<Variable> variables = new HashSet<>();
variables.addAll(Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, true, false, Collections.singletonList("0:99"), 1, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("HEIGHT", "", Variable.VariableType.NUMERIC, "1.5", false, false, Collections.singletonList("0:"), 2, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("ALIVE", "", Variable.VariableType.BOOLEAN, "", true, false, Collections.<String>emptyList(), 3, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("PHEN", "", Variable.VariableType.CATEGORICAL, "", true, false, Arrays.asList("CASE", "CONTROL"), 4, "", "", null, Collections.<String, Object>emptyMap())
));
QueryResult<VariableSet> queryResult = catalogManager.createVariableSet(study.getId(), "vs1", true, "", null, variables, sessionIdUser);
assertEquals(1, queryResult.getResult().size());
study = catalogManager.getStudy(study.getId(), sessionIdUser).first();
assertEquals(variableSetNum + 1, study.getVariableSets().size());
}
@Test
public void testCreateRepeatedVariableSet () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
List<Variable> variables = Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("NAME", "", Variable.VariableType.BOOLEAN, "", true, false, Collections.<String>emptyList(), 3, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, true, false, Collections.singletonList("0:99"), 1, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("HEIGHT", "", Variable.VariableType.NUMERIC, "1.5", false, false, Collections.singletonList("0:"), 2, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("PHEN", "", Variable.VariableType.CATEGORICAL, "", true, false, Arrays.asList("CASE", "CONTROL"), 4, "", "", null, Collections.<String, Object>emptyMap())
);
thrown.expect(CatalogException.class);
catalogManager.createVariableSet(study.getId(), "vs1", true, "", null, variables, sessionIdUser);
}
@Test
public void testDeleteVariableSet() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
List<Variable> variables = Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, true, false, Collections.singletonList("0:99"), 1, "", "", null, Collections.<String, Object>emptyMap())
);
VariableSet vs1 = catalogManager.createVariableSet(studyId, "vs1", true, "", null, variables, sessionIdUser).first();
VariableSet vs1_deleted = catalogManager.deleteVariableSet(vs1.getId(), null, sessionIdUser).first();
assertEquals(vs1.getId(), vs1_deleted.getId());
thrown.expect(CatalogDBException.class); //VariableSet does not exist
catalogManager.getVariableSet(vs1.getId(), null, sessionIdUser);
}
@Test
public void testGetAllVariableSet() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
List<Variable> variables = Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, true, false, Collections.singletonList("0:99"), 1, "", "", null, Collections.<String, Object>emptyMap())
);
VariableSet vs1 = catalogManager.createVariableSet(studyId, "vs1", true, "Cancer", null, variables, sessionIdUser).first();
VariableSet vs2 = catalogManager.createVariableSet(studyId, "vs2", true, "Virgo", null, variables, sessionIdUser).first();
VariableSet vs3 = catalogManager.createVariableSet(studyId, "vs3", true, "Piscis", null, variables, sessionIdUser).first();
VariableSet vs4 = catalogManager.createVariableSet(studyId, "vs4", true, "Aries", null, variables, sessionIdUser).first();
int numResults;
numResults = catalogManager.getAllVariableSet(studyId, new QueryOptions(CatalogSampleDBAdaptor.VariableSetFilterOption.name.toString(), "vs1"), sessionIdUser).getNumResults();
assertEquals(1, numResults);
numResults = catalogManager.getAllVariableSet(studyId, new QueryOptions(CatalogSampleDBAdaptor.VariableSetFilterOption.name.toString(), "vs1,vs2"), sessionIdUser).getNumResults();
assertEquals(2, numResults);
numResults = catalogManager.getAllVariableSet(studyId, new QueryOptions(CatalogSampleDBAdaptor.VariableSetFilterOption.name.toString(), "VS1"), sessionIdUser).getNumResults();
assertEquals(0, numResults);
numResults = catalogManager.getAllVariableSet(studyId, new QueryOptions(CatalogSampleDBAdaptor.VariableSetFilterOption.id.toString(), vs1.getId() + "," + vs3.getId()), sessionIdUser).getNumResults();
assertEquals(2, numResults);
}
@Test
public void testDeleteVariableSetInUse() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
List<Variable> variables = Arrays.asList(
new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()),
new Variable("AGE", "", Variable.VariableType.NUMERIC, null, false, false, Collections.singletonList("0:99"), 1, "", "", null, Collections.<String, Object>emptyMap())
);
VariableSet vs1 = catalogManager.createVariableSet(studyId, "vs1", true, "", null, variables, sessionIdUser).first();
catalogManager.annotateSample(sampleId1, "annotationId", vs1.getId(), Collections.singletonMap("NAME", "LINUS"), null, sessionIdUser);
try {
catalogManager.deleteVariableSet(vs1.getId(), null, sessionIdUser).first();
} finally {
VariableSet variableSet = catalogManager.getVariableSet(vs1.getId(), null, sessionIdUser).first();
assertEquals(vs1.getId(), variableSet.getId());
thrown.expect(CatalogDBException.class); //Expect the exception from the try
}
}
/**<|fim▁hole|> @Test
public void testCreateSample () throws CatalogException {
int projectId = catalogManager.getAllProjects("user", null, sessionIdUser).first().getId();
int studyId = catalogManager.getAllStudies(projectId, null, sessionIdUser).first().getId();
QueryResult<Sample> sampleQueryResult = catalogManager.createSample(studyId, "HG007", "IMDb", "", null, null, sessionIdUser);
System.out.println("sampleQueryResult = " + sampleQueryResult);
}
@Test
public void testAnnotateMulti () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Set<Variable> variables = new HashSet<>();
variables.add(new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()));
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", false, "", null, variables, sessionIdUser).first();
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("NAME", "Luke");
QueryResult<AnnotationSet> annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations = new HashMap<>();
annotations.put("NAME", "Lucas");
catalogManager.annotateSample(sampleId, "annotation2", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
assertEquals(2, catalogManager.getSample(sampleId, null, sessionIdUser).first().getAnnotationSets().size());
}
@Test
public void testAnnotateUnique () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Set<Variable> variables = new HashSet<>();
variables.add(new Variable("NAME", "", Variable.VariableType.TEXT, "", true, false, Collections.<String>emptyList(), 0, "", "", null, Collections.<String, Object>emptyMap()));
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", true, "", null, variables, sessionIdUser).first();
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("NAME", "Luke");
QueryResult<AnnotationSet> annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("NAME", "Lucas");
thrown.expect(CatalogException.class);
catalogManager.annotateSample(sampleId, "annotation2", vs1.getId(), annotations, null, sessionIdUser);
}
@Test
public void testAnnotateIncorrectType () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Set<Variable> variables = new HashSet<>();
variables.add(new Variable("NUM", "", Variable.VariableType.NUMERIC, "", true, false, null, 0, "", "", null, Collections.<String, Object>emptyMap()));
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", false, "", null, variables, sessionIdUser).first();
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("NUM", "5");
QueryResult<AnnotationSet> annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("NUM", "6.8");
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation2", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("NUM", "five point five");
thrown.expect(CatalogException.class);
catalogManager.annotateSample(sampleId, "annotation3", vs1.getId(), annotations, null, sessionIdUser);
}
@Test
public void testAnnotateRange () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Set<Variable> variables = new HashSet<>();
variables.add(new Variable("RANGE_NUM", "", Variable.VariableType.NUMERIC, "", true, false, Arrays.asList("1:14", "16:22", "50:"), 0, "", "", null, Collections.<String, Object>emptyMap()));
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", false, "", null, variables, sessionIdUser).first();
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("RANGE_NUM", "1"); // 1:14
QueryResult<AnnotationSet> annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("RANGE_NUM", "14"); // 1:14
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation2", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("RANGE_NUM", "20"); // 16:20
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation3", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("RANGE_NUM", "100000"); // 50:
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation4", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("RANGE_NUM", "14.1");
thrown.expect(CatalogException.class);
catalogManager.annotateSample(sampleId, "annotation5", vs1.getId(), annotations, null, sessionIdUser);
}
@Test
public void testAnnotateCategorical () throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Set<Variable> variables = new HashSet<>();
variables.add(new Variable("COOL_NAME", "", Variable.VariableType.CATEGORICAL, "", true, false, Arrays.asList("LUKE", "LEIA", "VADER", "YODA"), 0, "", "", null, Collections.<String, Object>emptyMap()));
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", false, "", null, variables, sessionIdUser).first();
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("COOL_NAME", "LUKE");
QueryResult<AnnotationSet> annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("COOL_NAME", "LEIA");
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation2", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("COOL_NAME", "VADER");
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation3", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("COOL_NAME", "YODA");
annotationSetQueryResult = catalogManager.annotateSample(sampleId, "annotation4", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("COOL_NAME", "SPOCK");
thrown.expect(CatalogException.class);
catalogManager.annotateSample(sampleId, "annotation5", vs1.getId(), annotations, null, sessionIdUser);
}
@Test
public void testAnnotateNested() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
int sampleId1 = catalogManager.createSample(study.getId(), "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId2 = catalogManager.createSample(study.getId(), "SAMPLE_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId3 = catalogManager.createSample(study.getId(), "SAMPLE_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId4 = catalogManager.createSample(study.getId(), "SAMPLE_4", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId5 = catalogManager.createSample(study.getId(), "SAMPLE_5", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
VariableSet vs1 = catalogManager.createVariableSet(study.getId(), "vs1", false, "", null, Collections.singleton(CatalogAnnotationsValidatorTest.nestedObject), sessionIdUser).first();
QueryResult<AnnotationSet> annotationSetQueryResult;
HashMap<String, Object> annotations = new HashMap<>();
annotations.put("nestedObject", new QueryOptions("stringList", Arrays.asList("li", "lu")).append("object", new ObjectMap("string", "my value").append("numberList", Arrays.asList(2, 3, 4))));
annotationSetQueryResult = catalogManager.annotateSample(sampleId1, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
annotations.put("nestedObject", new QueryOptions("stringList", Arrays.asList("lo", "lu")).append("object", new ObjectMap("string", "stringValue").append("numberList", Arrays.asList(3,4,5))));
annotationSetQueryResult = catalogManager.annotateSample(sampleId2, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
assertEquals(1, annotationSetQueryResult.getNumResults());
// annotations.put("nestedObject", new QueryOptions("stringList", Arrays.asList("li", "lo", "lu")).append("object", new ObjectMap("string", "my value").append("numberList", Arrays.asList(2, 3, 4))));
// annotationSetQueryResult = catalogManager.annotateSample(sampleId3, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
// assertEquals(1, annotationSetQueryResult.getNumResults());
//
// annotations.put("nestedObject", new QueryOptions("stringList", Arrays.asList("li", "lo", "lu")).append("object", new ObjectMap("string", "my value").append("numberList", Arrays.asList(2, 3, 4))));
// annotationSetQueryResult = catalogManager.annotateSample(sampleId4, "annotation1", vs1.getId(), annotations, null, sessionIdUser);
// assertEquals(1, annotationSetQueryResult.getNumResults());
List<Sample> samples;
QueryOptions queryOptions = new QueryOptions(variableSetId.toString(), vs1.getId());
queryOptions.put(annotation.toString(), "nestedObject.stringList:li");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(1, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(1, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:LL");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(0, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,li,LL");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(2, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.object.string:my value");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(1, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.string:my value");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(1, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.numberList:7");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(0, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.numberList:3");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(2, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.numberList:5");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(1, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.numberList:2,5");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(2, samples.size());
queryOptions.put(annotation.toString(), "nestedObject.stringList:lo,lu,LL;nestedObject.object.numberList:0");
samples = catalogManager.getAllSamples(studyId, queryOptions, sessionIdUser).getResult();
assertEquals(0, samples.size());
}
@Test
public void testQuerySamples() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
Study study = catalogManager.getStudy(studyId, sessionIdUser).first();
VariableSet variableSet = study.getVariableSets().get(0);
List<Sample> samples;
QueryOptions annotation = new QueryOptions();
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(9, samples.size());
annotation = new QueryOptions(variableSetId.toString(), variableSet.getId());
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(8, samples.size());
annotation = new QueryOptions(annotationSetId.toString(), "annot2");
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(3, samples.size());
annotation = new QueryOptions(annotationSetId.toString(), "noExist");
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(0, samples.size());
annotation = new QueryOptions("annotation", "NAME:s_1,s_2,s_3");
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(3, samples.size());
annotation = new QueryOptions("annotation", "AGE:>30");
annotation.add(variableSetId.toString(), variableSet.getId());
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(3, samples.size());
annotation = new QueryOptions("annotation", "AGE:>30");
annotation.add(variableSetId.toString(), variableSet.getId());
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(3, samples.size());
annotation = new QueryOptions("annotation", "AGE:>30");
annotation.add(variableSetId.toString(), variableSet.getId());
annotation.addToListOption("annotation", "ALIVE:true");
samples = catalogManager.getAllSamples(studyId, annotation, sessionIdUser).getResult();
assertEquals(2, samples.size());
}
@Test
public void testModifySample() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int individualId = catalogManager.createIndividual(studyId, "Individual1", "", 0, 0, Individual.Gender.MALE, new QueryOptions(), sessionIdUser).first().getId();
Sample sample = catalogManager.modifySample(sampleId1, new QueryOptions("individualId", individualId), sessionIdUser).first();
assertEquals(individualId, sample.getIndividualId());
}
@Test
public void testModifySampleBadIndividual() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
thrown.expect(CatalogDBException.class);
catalogManager.modifySample(sampleId1, new QueryOptions("individualId", 4), sessionIdUser);
}
@Test
public void testDeleteSample() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
QueryResult<Sample> queryResult = catalogManager.deleteSample(sampleId, new QueryOptions(), sessionIdUser);
assertEquals(sampleId, queryResult.first().getId());
thrown.expect(CatalogDBException.class);
catalogManager.getSample(sampleId, new QueryOptions(), sessionIdUser);
}
/**
* Cohort methods
* ***************************
*/
@Test
public void testCreateCohort() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId2 = catalogManager.createSample(studyId, "SAMPLE_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId3 = catalogManager.createSample(studyId, "SAMPLE_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Cohort myCohort = catalogManager.createCohort(studyId, "MyCohort", Cohort.Type.FAMILY, "", Arrays.asList(sampleId1, sampleId2, sampleId3), null, sessionIdUser).first();
assertEquals("MyCohort", myCohort.getName());
assertEquals(3, myCohort.getSamples().size());
assertTrue(myCohort.getSamples().contains(sampleId1));
assertTrue(myCohort.getSamples().contains(sampleId2));
assertTrue(myCohort.getSamples().contains(sampleId3));
}
@Test
public void testGetAllCohorts() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId2 = catalogManager.createSample(studyId, "SAMPLE_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId3 = catalogManager.createSample(studyId, "SAMPLE_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId4 = catalogManager.createSample(studyId, "SAMPLE_4", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId5 = catalogManager.createSample(studyId, "SAMPLE_5", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Cohort myCohort1 = catalogManager.createCohort(studyId, "MyCohort1", Cohort.Type.FAMILY, "", Arrays.asList(sampleId1, sampleId2, sampleId3), null, sessionIdUser).first();
Cohort myCohort2 = catalogManager.createCohort(studyId, "MyCohort2", Cohort.Type.FAMILY, "", Arrays.asList(sampleId1, sampleId2, sampleId3, sampleId4), null, sessionIdUser).first();
Cohort myCohort3 = catalogManager.createCohort(studyId, "MyCohort3", Cohort.Type.CASE_CONTROL, "", Arrays.asList(sampleId3, sampleId4), null, sessionIdUser).first();
Cohort myCohort4 = catalogManager.createCohort(studyId, "MyCohort4", Cohort.Type.TRIO, "", Arrays.asList(sampleId5, sampleId3), null, sessionIdUser).first();
int numResults;
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.samples.toString(), sampleId1), sessionIdUser).getNumResults();
assertEquals(2, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.samples.toString(), sampleId1 + "," + sampleId5), sessionIdUser).getNumResults();
assertEquals(3, numResults);
// numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.samples.toString(), sampleId3 + "," + sampleId4), sessionIdUser).getNumResults();
// assertEquals(2, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.name.toString(), "MyCohort2"), sessionIdUser).getNumResults();
assertEquals(1, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.name.toString(), "~MyCohort."), sessionIdUser).getNumResults();
assertEquals(4, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.type.toString(), Cohort.Type.FAMILY), sessionIdUser).getNumResults();
assertEquals(2, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.type.toString(), "CASE_CONTROL"), sessionIdUser).getNumResults();
assertEquals(1, numResults);
numResults = catalogManager.getAllCohorts(studyId, new QueryOptions(CatalogSampleDBAdaptor.CohortFilterOption.id.toString(), myCohort1.getId() + "," + myCohort2.getId() + "," + myCohort3.getId()), sessionIdUser).getNumResults();
assertEquals(3, numResults);
}
@Test
public void testCreateCohortFail() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
thrown.expect(CatalogException.class);
catalogManager.createCohort(studyId, "MyCohort", Cohort.Type.FAMILY, "", Arrays.asList(23, 4, 5), null, sessionIdUser);
}
@Test
public void testUpdateCohort() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId2 = catalogManager.createSample(studyId, "SAMPLE_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId3 = catalogManager.createSample(studyId, "SAMPLE_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId4 = catalogManager.createSample(studyId, "SAMPLE_4", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId5 = catalogManager.createSample(studyId, "SAMPLE_5", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Cohort myCohort = catalogManager.createCohort(studyId, "MyCohort", Cohort.Type.FAMILY, "", Arrays.asList(sampleId1, sampleId2, sampleId3), null, sessionIdUser).first();
assertEquals("MyCohort", myCohort.getName());
assertEquals(3, myCohort.getSamples().size());
assertTrue(myCohort.getSamples().contains(sampleId1));
assertTrue(myCohort.getSamples().contains(sampleId2));
assertTrue(myCohort.getSamples().contains(sampleId3));
Cohort myModifiedCohort = catalogManager.modifyCohort(myCohort.getId(), new ObjectMap("samples", Arrays.asList(sampleId1, sampleId3, sampleId4, sampleId5)).append("name", "myModifiedCohort"), sessionIdUser).first();
assertEquals("myModifiedCohort", myModifiedCohort.getName());
assertEquals(4, myModifiedCohort.getSamples().size());
assertTrue(myModifiedCohort.getSamples().contains(sampleId1));
assertTrue(myModifiedCohort.getSamples().contains(sampleId3));
assertTrue(myModifiedCohort.getSamples().contains(sampleId4));
assertTrue(myModifiedCohort.getSamples().contains(sampleId5));
}
@Test
public void testDeleteCohort() throws CatalogException {
int studyId = catalogManager.getStudyId("user@1000G:phase1");
int sampleId1 = catalogManager.createSample(studyId, "SAMPLE_1", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId2 = catalogManager.createSample(studyId, "SAMPLE_2", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
int sampleId3 = catalogManager.createSample(studyId, "SAMPLE_3", "", "", null, new QueryOptions(), sessionIdUser).first().getId();
Cohort myCohort = catalogManager.createCohort(studyId, "MyCohort", Cohort.Type.FAMILY, "", Arrays.asList(sampleId1, sampleId2, sampleId3), null, sessionIdUser).first();
assertEquals("MyCohort", myCohort.getName());
assertEquals(3, myCohort.getSamples().size());
assertTrue(myCohort.getSamples().contains(sampleId1));
assertTrue(myCohort.getSamples().contains(sampleId2));
assertTrue(myCohort.getSamples().contains(sampleId3));
Cohort myDeletedCohort = catalogManager.deleteCohort(myCohort.getId(), null, sessionIdUser).first();
assertEquals(myCohort.getId(), myDeletedCohort.getId());
thrown.expect(CatalogException.class);
catalogManager.getCohort(myCohort.getId(), null, sessionIdUser);
}
/* */
/* Test util methods */
/* */
public static void clearCatalog(Properties properties) throws IOException {
List<DataStoreServerAddress> dataStoreServerAddresses = new LinkedList<>();
for (String hostPort : properties.getProperty(CatalogManager.CATALOG_DB_HOSTS, "localhost").split(",")) {
if (hostPort.contains(":")) {
String[] split = hostPort.split(":");
Integer port = Integer.valueOf(split[1]);
dataStoreServerAddresses.add(new DataStoreServerAddress(split[0], port));
} else {
dataStoreServerAddresses.add(new DataStoreServerAddress(hostPort, 27017));
}
}
MongoDataStoreManager mongoManager = new MongoDataStoreManager(dataStoreServerAddresses);
MongoDataStore db = mongoManager.get(properties.getProperty(CatalogManager.CATALOG_DB_DATABASE));
db.getDb().dropDatabase();
mongoManager.close(properties.getProperty(CatalogManager.CATALOG_DB_DATABASE));
Path rootdir = Paths.get(URI.create(properties.getProperty(CatalogManager.CATALOG_MAIN_ROOTDIR)));
deleteFolderTree(rootdir.toFile());
if (properties.containsKey(CatalogManager.CATALOG_JOBS_ROOTDIR)) {
Path jobsDir = Paths.get(URI.create(properties.getProperty(CatalogManager.CATALOG_JOBS_ROOTDIR)));
if (jobsDir.toFile().exists()) {
deleteFolderTree(jobsDir.toFile());
}
}
}
public static void deleteFolderTree(java.io.File folder) {
java.io.File[] files = folder.listFiles();
if(files!=null) {
for(java.io.File f: files) {
if(f.isDirectory()) {
deleteFolderTree(f);
} else {
f.delete();
}
}
}
folder.delete();
}
}<|fim▁end|> | * Sample methods
* ***************************
*/
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>class B(object):<|fim▁hole|> pass
def __new__<warning descr="Signature is not compatible to __init__">(cls, x, y)</warning>: # error
pass
class A1(B):
pass
class A2(A1):
def __new__<warning descr="Signature is not compatible to __init__">(cls, a)</warning>: # error
pass
class A3(A2):
def __new__(cls, *a): # ok
pass
class C(object):
def __new__(cls, *args, **kwargs):
pass
class C1(C):
def __init__(self, a): # OK
pass
# PY-846
from seob import SeoB
class SeoA(SeoB):
pass
import enum
# PY-24749
class Planet(enum.Enum):
EARTH = (5.976e+24, 6.37814e6)
def __init__(self, mass, radius): # OK
pass<|fim▁end|> | def __init__<warning descr="Signature is not compatible to __new__">(self)</warning>: # error |
<|file_name|>help.py<|end_file_name|><|fim▁begin|>from wrappers import *
from inspect import getdoc
@plugin
class Help:
@command("list")
def list(self, message):
"""list the loaded plugins"""
return message.reply(list(self.bot.plugins.keys()), "loaded plugins: " + ", ".join(self.bot.plugins.keys()))
@command("commands")
def listcoms(self, message):
"""list the available commands"""
return message.reply(list(self.bot.commands.keys()), "available commands: " + ", ".join(self.bot.commands.keys()))
@command("aliases")
def listaliases(self, message):
"""list the saved aliases"""
return message.reply(list(self.bot.aliases.keys()), "saved aliases: " + ", ".join(self.bot.aliases.keys()))
@command("expand")
def expand(self, message):
"""show what an alias does"""
if message.text:
command = message.text.split()[0].strip()
if command in self.bot.aliases:
x = self.bot.aliases[command]
x = self.bot.command_char+ "alias %s = " % command + " || ".join(["%s%s" % (cmd, (" " + arg) if arg else "") for cmd, arg in x])
return message.reply(x)
@command("help", simple=True)
def help_(self, message):
"""help <command> => returns the help for the specified command"""
if not isinstance(message.data, str):
doc = getdoc(message.data)
if not doc:
return message.reply("No help found for passed object '%s'" % message.data.__class__.__name__)
else:
firstline = "%s: %s" % (message.data.__class__.__name__, doc.split("\n")[0])
return message.reply(doc, firstline)
<|fim▁hole|> func = self.bot.commands[com][0]
except:
raise Exception("specifed command not found")
doc = func.__doc__
if not doc:
return message.reply("No help found for specified command")
else:
firstline = "%s: %s" % (com, doc.split("\n")[0])
return message.reply(doc, firstline)
else:
return message.reply("Help can be found at https://github.com/ellxc/piperbot/blob/master/README.md or by joining #piperbot on freenode")<|fim▁end|> | elif message.data:
try:
com = message.data.split()[0]
|
<|file_name|>self.rs<|end_file_name|><|fim▁begin|>#![crate_name = "cross_crate_self"]
/// Link to [Self]
/// Link to [crate]
pub struct S;
impl S {
/// Link to [Self::f]<|fim▁hole|>}<|fim▁end|> | pub fn f() {} |
<|file_name|>BasicSpinnerUI.java<|end_file_name|><|fim▁begin|>/*
* This file is modified by Ivan Maidanski <[email protected]>
* Project name: JCGO-SUNAWT (http://www.ivmaisoft.com/jcgo/)
*/
/*
* @(#)BasicSpinnerUI.java 1.18 06/08/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.swing.plaf.basic;
import java.awt.*;
import java.awt.event.*;
import java.text.ParseException;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.plaf.*;
import javax.swing.text.*;
import java.beans.*;
import java.text.*;
import java.util.*;
/**
* The default Spinner UI delegate.
*
* @version 1.15 01/23/03
* @author Hans Muller
* @since 1.4
*/
public class BasicSpinnerUI extends SpinnerUI
{
/**
* The spinner that we're a UI delegate for. Initialized by
* the <code>installUI</code> method, and reset to null
* by <code>uninstallUI</code>.
*
* @see #installUI
* @see #uninstallUI
*/
protected JSpinner spinner;
/**
* The <code>PropertyChangeListener</code> that's added to the
* <code>JSpinner</code> itself. This listener is created by the
* <code>createPropertyChangeListener</code> method, added by the
* <code>installListeners</code> method, and removed by the
* <code>uninstallListeners</code> method.
* <p>
* One instance of this listener is shared by all JSpinners.
*
* @see #createPropertyChangeListener
* @see #installListeners
* @see #uninstallListeners
*/
private static final PropertyChangeListener propertyChangeListener = new PropertyChangeHandler();
/**
* The mouse/action listeners that are added to the spinner's
* arrow buttons. These listeners are shared by all
* spinner arrow buttons.
*
* @see #createNextButton
* @see #createPreviousButton
*/
private static ArrowButtonHandler nextButtonHandler;
private static ArrowButtonHandler previousButtonHandler;
private static synchronized void initButtonHandlers() {
if (nextButtonHandler == null)
nextButtonHandler = new ArrowButtonHandler("increment", true);
if (previousButtonHandler == null)
previousButtonHandler = new ArrowButtonHandler("decrement", false);
}
/**
* Returns a new instance of BasicSpinnerUI. SpinnerListUI
* delegates are allocated one per JSpinner.
*
* @param c the JSpinner (not used)
* @see ComponentUI#createUI
* @return a new BasicSpinnerUI object
*/
public static ComponentUI createUI(JComponent c) {
return new BasicSpinnerUI();
}
public BasicSpinnerUI() {
initButtonHandlers();
}
private void maybeAdd(Component c, String s) {
if (c != null) {
spinner.add(c, s);
}
}
/**
* Calls <code>installDefaults</code>, <code>installListeners</code>,
* and then adds the components returned by <code>createNextButton</code>,
* <code>createPreviousButton</code>, and <code>createEditor</code>.
*
* @param c the JSpinner
* @see #installDefaults
* @see #installListeners
* @see #createNextButton
* @see #createPreviousButton
* @see #createEditor
*/
public void installUI(JComponent c) {
this.spinner = (JSpinner)c;
installDefaults();
installListeners();
maybeAdd(createNextButton(), "Next");
maybeAdd(createPreviousButton(), "Previous");
maybeAdd(createEditor(), "Editor");
updateEnabledState();
installKeyboardActions();
}
/**
* Calls <code>uninstallDefaults</code>, <code>uninstallListeners</code>,
* and then removes all of the spinners children.
*
* @param c the JSpinner (not used)
*/
public void uninstallUI(JComponent c) {
uninstallDefaults();
uninstallListeners();
this.spinner = null;
c.removeAll();
}
/**
* Initializes <code>propertyChangeListener</code> with
* a shared object that delegates interesting PropertyChangeEvents
* to protected methods.
* <p>
* This method is called by <code>installUI</code>.
*
* @see #replaceEditor
* @see #uninstallListeners
*/
protected void installListeners() {
JComponent editor = spinner.getEditor();
if (editor != null && editor instanceof JSpinner.DefaultEditor) {
JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField();
if (tf != null) {
tf.removeFocusListener(nextButtonHandler);
tf.addFocusListener(nextButtonHandler);
tf.removeFocusListener(previousButtonHandler);
tf.addFocusListener(previousButtonHandler);
}
}
spinner.addPropertyChangeListener(propertyChangeListener);
}
/**
* Removes the <code>propertyChangeListener</code> added
* by installListeners.
* <p>
* This method is called by <code>uninstallUI</code>.
*
* @see #installListeners
*/
protected void uninstallListeners() {
spinner.removePropertyChangeListener(propertyChangeListener);
JComponent editor = spinner.getEditor();
removeEditorBorderListener(editor);
if (editor instanceof JSpinner.DefaultEditor) {
JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField();
if (tf != null) {
tf.removeFocusListener(nextButtonHandler);
tf.removeFocusListener(previousButtonHandler);
}
}
}
/**
* Initialize the <code>JSpinner</code> <code>border</code>,
* <code>foreground</code>, and <code>background</code>, properties
* based on the corresponding "Spinner.*" properties from defaults table.
* The <code>JSpinners</code> layout is set to the value returned by
* <code>createLayout</code>. This method is called by <code>installUI</code>.
*
* @see #uninstallDefaults
* @see #installUI
* @see #createLayout
* @see LookAndFeel#installBorder
* @see LookAndFeel#installColors
*/
protected void installDefaults() {
spinner.setLayout(createLayout());
LookAndFeel.installBorder(spinner, "Spinner.border");
LookAndFeel.installColorsAndFont(spinner, "Spinner.background", "Spinner.foreground", "Spinner.font");
}
/**
* Sets the <code>JSpinner's</code> layout manager to null. This
* method is called by <code>uninstallUI</code>.
*
* @see #installDefaults
* @see #uninstallUI
*/
protected void uninstallDefaults() {
spinner.setLayout(null);
}
/**
* Create a <code>LayoutManager</code> that manages the <code>editor</code>,
* <code>nextButton</code>, and <code>previousButton</code>
* children of the JSpinner. These three children must be
* added with a constraint that identifies their role:
* "Editor", "Next", and "Previous". The default layout manager
* can handle the absence of any of these children.
*
* @return a LayoutManager for the editor, next button, and previous button.
* @see #createNextButton
* @see #createPreviousButton
* @see #createEditor
*/
protected LayoutManager createLayout() {
return new SpinnerLayout();
}
/**
* Create a <code>PropertyChangeListener</code> that can be
* added to the JSpinner itself. Typically, this listener
* will call replaceEditor when the "editor" property changes,
* since it's the <code>SpinnerUI's</code> responsibility to
* add the editor to the JSpinner (and remove the old one).
* This method is called by <code>installListeners</code>.
*
* @return A PropertyChangeListener for the JSpinner itself
* @see #installListeners
*/
protected PropertyChangeListener createPropertyChangeListener() {
return new PropertyChangeHandler();
}
/**
* Create a component that will replace the spinner models value
* with the object returned by <code>spinner.getPreviousValue</code>.
* By default the <code>previousButton</code> is a JButton
* who's <code>ActionListener</code> updates it's <code>JSpinner</code>
* ancestors model. If a previousButton isn't needed (in a subclass)
* then override this method to return null.
*
* @return a component that will replace the spinners model with the
* next value in the sequence, or null
* @see #installUI
* @see #createNextButton
*/
protected Component createPreviousButton() {
return createArrowButton(SwingConstants.SOUTH, previousButtonHandler);
}
/**
* Create a component that will replace the spinner models value
* with the object returned by <code>spinner.getNextValue</code>.
* By default the <code>nextButton</code> is a JButton
* who's <code>ActionListener</code> updates it's <code>JSpinner</code>
* ancestors model. If a nextButton isn't needed (in a subclass)
* then override this method to return null.
*
* @return a component that will replace the spinners model with the
* next value in the sequence, or null
* @see #installUI
* @see #createPreviousButton
*/
protected Component createNextButton() {
return createArrowButton(SwingConstants.NORTH, nextButtonHandler);
}
private Component createArrowButton(int direction, ArrowButtonHandler handler) {
JButton b = new BasicArrowButton(direction);
b.addActionListener(handler);
b.addMouseListener(handler);
Border buttonBorder = UIManager.getBorder("Spinner.arrowButtonBorder");
if (buttonBorder instanceof UIResource) {
// Wrap the border to avoid having the UIResource be replaced by
// the ButtonUI. This is the opposite of using BorderUIResource.
b.setBorder(new CompoundBorder(buttonBorder, null));
} else {
b.setBorder(buttonBorder);
}
return b;
}
/**
* This method is called by installUI to get the editor component
* of the <code>JSpinner</code>. By default it just returns
* <code>JSpinner.getEditor()</code>. Subclasses can override
* <code>createEditor</code> to return a component that contains
* the spinner's editor or null, if they're going to handle adding
* the editor to the <code>JSpinner</code> in an
* <code>installUI</code> override.
* <p>
* Typically this method would be overridden to wrap the editor
* with a container with a custom border, since one can't assume
* that the editors border can be set directly.
* <p>
* The <code>replaceEditor</code> method is called when the spinners
* editor is changed with <code>JSpinner.setEditor</code>. If you've
* overriden this method, then you'll probably want to override
* <code>replaceEditor</code> as well.
*
* @return the JSpinners editor JComponent, spinner.getEditor() by default
* @see #installUI
* @see #replaceEditor
* @see JSpinner#getEditor
*/
protected JComponent createEditor() {
JComponent editor = spinner.getEditor();
maybeRemoveEditorBorder(editor);
installEditorBorderListener(editor);
return editor;
}
/**
* Called by the <code>PropertyChangeListener</code> when the
* <code>JSpinner</code> editor property changes. It's the responsibility
* of this method to remove the old editor and add the new one. By
* default this operation is just:
* <pre>
* spinner.remove(oldEditor);
* spinner.add(newEditor, "Editor");
* </pre>
* The implementation of <code>replaceEditor</code> should be coordinated
* with the <code>createEditor</code> method.
*
* @see #createEditor
* @see #createPropertyChangeListener
*/
protected void replaceEditor(JComponent oldEditor, JComponent newEditor) {
spinner.remove(oldEditor);
maybeRemoveEditorBorder(newEditor);
installEditorBorderListener(newEditor);
spinner.add(newEditor, "Editor");
}
/**
* Remove the border around the inner editor component for LaFs
* that install an outside border around the spinner,
*/
private void maybeRemoveEditorBorder(JComponent editor) {
if (!UIManager.getBoolean("Spinner.editorBorderPainted")) {
if (editor instanceof JPanel &&
editor.getBorder() == null &&
editor.getComponentCount() > 0) {
editor = (JComponent)editor.getComponent(0);
}
if (editor != null && editor.getBorder() instanceof UIResource) {
editor.setBorder(null);
}
}
}
/**
* Remove the border around the inner editor component for LaFs
* that install an outside border around the spinner,
*/
private void installEditorBorderListener(JComponent editor) {
if (!UIManager.getBoolean("Spinner.editorBorderPainted")) {
if (editor instanceof JPanel &&
editor.getBorder() == null &&
editor.getComponentCount() > 0) {
editor = (JComponent)editor.getComponent(0);
}
if (editor != null &&
(editor.getBorder() == null ||
editor.getBorder() instanceof UIResource)) {
editor.addPropertyChangeListener(propertyChangeListener);
}
}
}
private void removeEditorBorderListener(JComponent editor) {
if (!UIManager.getBoolean("Spinner.editorBorderPainted")) {
if (editor instanceof JPanel &&
editor.getComponentCount() > 0) {
editor = (JComponent)editor.getComponent(0);
}
if (editor != null) {
editor.removePropertyChangeListener(propertyChangeListener);
}
}
}
/**
* Updates the enabled state of the children Components based on the
* enabled state of the <code>JSpinner</code>.
*/
private void updateEnabledState() {
updateEnabledState(spinner, spinner.isEnabled());
}
/**
* Recursively updates the enabled state of the child
* <code>Component</code>s of <code>c</code>.
*/
private void updateEnabledState(Container c, boolean enabled) {
for (int counter = c.getComponentCount() - 1; counter >= 0;counter--) {
Component child = c.getComponent(counter);
child.setEnabled(enabled);
if (child instanceof Container) {
updateEnabledState((Container)child, enabled);
}
}
}
/**
* Installs the KeyboardActions onto the JSpinner.
*/
private void installKeyboardActions() {
InputMap iMap = getInputMap(JComponent.
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
SwingUtilities.replaceUIInputMap(spinner, JComponent.
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
iMap);
SwingUtilities.replaceUIActionMap(spinner, getActionMap());
}
/**
* Returns the InputMap to install for <code>condition</code>.
*/
private InputMap getInputMap(int condition) {
if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
return (InputMap)UIManager.get("Spinner.ancestorInputMap");
}
return null;
}
private ActionMap getActionMap() {
ActionMap map = (ActionMap)UIManager.get("Spinner.actionMap");
if (map == null) {
map = createActionMap();
if (map != null) {
UIManager.getLookAndFeelDefaults().put("Spinner.actionMap",
map);
}
}
return map;
}
private ActionMap createActionMap() {
ActionMap map = new ActionMapUIResource();
map.put("increment", nextButtonHandler);
map.put("decrement", previousButtonHandler);
return map;
}
/**
* A handler for spinner arrow button mouse and action events. When
* a left mouse pressed event occurs we look up the (enabled) spinner
* that's the source of the event and start the autorepeat timer. The
* timer fires action events until any button is released at which
* point the timer is stopped and the reference to the spinner cleared.
* The timer doesn't start until after a 300ms delay, so often the
* source of the initial (and final) action event is just the button
* logic for mouse released - which means that we're relying on the fact
* that our mouse listener runs after the buttons mouse listener.
* <p>
* Note that one instance of this handler is shared by all slider previous
* arrow buttons and likewise for all of the next buttons,
* so it doesn't have any state that persists beyond the limits
* of a single button pressed/released gesture.
*/
private static class ArrowButtonHandler extends AbstractAction
implements MouseListener, FocusListener, UIResource {
final javax.swing.Timer autoRepeatTimer;
final boolean isNext;
JSpinner spinner = null;
JButton arrowButton = null;
ArrowButtonHandler(String name, boolean isNext) {
super(name);
this.isNext = isNext;
autoRepeatTimer = new javax.swing.Timer(60, this);
autoRepeatTimer.setInitialDelay(300);
}
private JSpinner eventToSpinner(AWTEvent e) {
Object src = e.getSource();
while ((src instanceof Component) && !(src instanceof JSpinner)) {
src = ((Component)src).getParent();
}
return (src instanceof JSpinner) ? (JSpinner)src : null;
}
public void actionPerformed(ActionEvent e) {
JSpinner spinner = this.spinner;
if (!(e.getSource() instanceof javax.swing.Timer)) {
// Most likely resulting from being in ActionMap.
spinner = eventToSpinner(e);
if (e.getSource() instanceof BasicArrowButton) {
arrowButton = (JButton)e.getSource();
}
} else {
if (arrowButton!=null && !arrowButton.getModel().isPressed()
&& autoRepeatTimer.isRunning()) {
autoRepeatTimer.stop();
spinner = null;
}
}
if (spinner != null) {
try {
int calendarField = getCalendarField(spinner);
spinner.commitEdit();
if (calendarField != -1) {
((SpinnerDateModel)spinner.getModel()).
setCalendarField(calendarField);
}
Object value = (isNext) ? spinner.getNextValue() :
spinner.getPreviousValue();
if (value != null) {
spinner.setValue(value);
select(spinner);
}
} catch (IllegalArgumentException iae) {
UIManager.getLookAndFeel().provideErrorFeedback(spinner);
} catch (ParseException pe) {
UIManager.getLookAndFeel().provideErrorFeedback(spinner);
}
}
}
/**
* If the spinner's editor is a DateEditor, this selects the field
* associated with the value that is being incremented.
*/
private void select(JSpinner spinner) {
JComponent editor = spinner.getEditor();
if (editor instanceof JSpinner.DateEditor) {
JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor;
JFormattedTextField ftf = dateEditor.getTextField();
Format format = dateEditor.getFormat();
Object value;
if (format != null && (value = spinner.getValue()) != null) {
SpinnerDateModel model = dateEditor.getModel();
DateFormat.Field field = DateFormat.Field.ofCalendarField(
model.getCalendarField());
if (field != null) {
try {
AttributedCharacterIterator iterator = format.
formatToCharacterIterator(value);
if (!select(ftf, iterator, field) &&
field == DateFormat.Field.HOUR0) {
select(ftf, iterator, DateFormat.Field.HOUR1);
}
}
catch (IllegalArgumentException iae) {}
}
}
}
}
/**
* Selects the passed in field, returning true if it is found,
* false otherwise.
*/
private boolean select(JFormattedTextField ftf,
AttributedCharacterIterator iterator,
DateFormat.Field field) {
int max = ftf.getDocument().getLength();
iterator.first();
do {
Map attrs = iterator.getAttributes();
if (attrs != null && attrs.containsKey(field)){
int start = iterator.getRunStart(field);
int end = iterator.getRunLimit(field);
if (start != -1 && end != -1 && start <= max &&
end <= max) {
ftf.select(start, end);
}
return true;
}
} while (iterator.next() != CharacterIterator.DONE);
return false;
}
/**
* Returns the calendarField under the start of the selection, or
* -1 if there is no valid calendar field under the selection (or
* the spinner isn't editing dates.
*/
private int getCalendarField(JSpinner spinner) {
JComponent editor = spinner.getEditor();
if (editor instanceof JSpinner.DateEditor) {
JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor;
JFormattedTextField ftf = dateEditor.getTextField();
int start = ftf.getSelectionStart();
JFormattedTextField.AbstractFormatter formatter =
ftf.getFormatter();
if (formatter instanceof InternationalFormatter) {
Format.Field[] fields = ((InternationalFormatter)
formatter).getFields(start);
for (int counter = 0; counter < fields.length; counter++) {
if (fields[counter] instanceof DateFormat.Field) {
int calendarField;
if (fields[counter] == DateFormat.Field.HOUR1) {
calendarField = Calendar.HOUR;
}
else {
calendarField = ((DateFormat.Field)
fields[counter]).getCalendarField();
}
if (calendarField != -1) {
return calendarField;
}
}
}
}
}
return -1;
}
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getComponent().isEnabled()) {
spinner = eventToSpinner(e);
autoRepeatTimer.start();
focusSpinnerIfNecessary();
}
}
public void mouseReleased(MouseEvent e) {
autoRepeatTimer.stop();
spinner = null;
}
public void mouseClicked(MouseEvent e) {
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
/**
* Requests focus on a child of the spinner if the spinner doesn't
* have focus.
*/
private void focusSpinnerIfNecessary() {
Component fo = KeyboardFocusManager.
getCurrentKeyboardFocusManager().getFocusOwner();
if (spinner.isRequestFocusEnabled() && (
fo == null ||
!SwingUtilities.isDescendingFrom(fo, spinner))) {
Container root = spinner;
if (!root.isFocusCycleRoot()) {
root = root.getFocusCycleRootAncestor();
}
if (root != null) {
FocusTraversalPolicy ftp = root.getFocusTraversalPolicy();
Component child = ftp.getComponentAfter(root, spinner);
if (child != null && SwingUtilities.isDescendingFrom(<|fim▁hole|> child.requestFocus();
}
}
}
}
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
if (autoRepeatTimer.isRunning()) {
autoRepeatTimer.stop();
}
spinner = null;
if (arrowButton !=null) {
ButtonModel model = arrowButton.getModel();
model.setPressed(false);
model.setArmed(false);
}
}
}
/**
* A simple layout manager for the editor and the next/previous buttons.
* See the BasicSpinnerUI javadoc for more information about exactly
* how the components are arranged.
*/
private static class SpinnerLayout implements LayoutManager
{
private Component nextButton = null;
private Component previousButton = null;
private Component editor = null;
public void addLayoutComponent(String name, Component c) {
if ("Next".equals(name)) {
nextButton = c;
}
else if ("Previous".equals(name)) {
previousButton = c;
}
else if ("Editor".equals(name)) {
editor = c;
}
}
public void removeLayoutComponent(Component c) {
if (c == nextButton) {
c = null;
}
else if (c == previousButton) {
previousButton = null;
}
else if (c == editor) {
editor = null;
}
}
/**
* Used by the default LayoutManager class - SpinnerLayout for
* missing (null) editor/nextButton/previousButton children.
*/
private static final Dimension zeroSize = new Dimension(0, 0);
private Dimension preferredSize(Component c) {
return (c == null) ? zeroSize : c.getPreferredSize();
}
public Dimension preferredLayoutSize(Container parent) {
Dimension nextD = preferredSize(nextButton);
Dimension previousD = preferredSize(previousButton);
Dimension editorD = preferredSize(editor);
/* Force the editors height to be a multiple of 2
*/
editorD.height = ((editorD.height + 1) / 2) * 2;
Dimension size = new Dimension(editorD.width, editorD.height);
size.width += Math.max(nextD.width, previousD.width);
Insets insets = parent.getInsets();
size.width += insets.left + insets.right;
size.height += insets.top + insets.bottom;
return size;
}
public Dimension minimumLayoutSize(Container parent) {
return preferredLayoutSize(parent);
}
private void setBounds(Component c, int x, int y, int width, int height) {
if (c != null) {
c.setBounds(x, y, width, height);
}
}
public void layoutContainer(Container parent) {
int width = parent.getWidth();
int height = parent.getHeight();
Insets insets = parent.getInsets();
Dimension nextD = preferredSize(nextButton);
Dimension previousD = preferredSize(previousButton);
int buttonsWidth = Math.max(nextD.width, previousD.width);
int editorHeight = height - (insets.top + insets.bottom);
// The arrowButtonInsets value is used instead of the JSpinner's
// insets if not null. Defining this to be (0, 0, 0, 0) causes the
// buttons to be aligned with the outer edge of the spinner's
// border, and leaving it as "null" places the buttons completely
// inside the spinner's border.
Insets buttonInsets = UIManager.getInsets("Spinner.arrowButtonInsets");
if (buttonInsets == null) {
buttonInsets = insets;
}
/* Deal with the spinner's componentOrientation property.
*/
int editorX, editorWidth, buttonsX;
if (parent.getComponentOrientation().isLeftToRight()) {
editorX = insets.left;
editorWidth = width - insets.left - buttonsWidth - buttonInsets.right;
buttonsX = width - buttonsWidth - buttonInsets.right;
} else {
buttonsX = buttonInsets.left;
editorX = buttonsX + buttonsWidth;
editorWidth = width - buttonInsets.left - buttonsWidth - insets.right;
}
int nextY = buttonInsets.top;
int nextHeight = (height / 2) + (height % 2) - nextY;
int previousY = buttonInsets.top + nextHeight;
int previousHeight = height - previousY - buttonInsets.bottom;
setBounds(editor, editorX, insets.top, editorWidth, editorHeight);
setBounds(nextButton, buttonsX, nextY, buttonsWidth, nextHeight);
setBounds(previousButton, buttonsX, previousY, buttonsWidth, previousHeight);
}
}
/**
* Detect JSpinner property changes we're interested in and delegate. Subclasses
* shouldn't need to replace the default propertyChangeListener (although they
* can by overriding createPropertyChangeListener) since all of the interesting
* property changes are delegated to protected methods.
*/
private static class PropertyChangeHandler implements PropertyChangeListener
{
public void propertyChange(PropertyChangeEvent e)
{
String propertyName = e.getPropertyName();
if (e.getSource() instanceof JSpinner) {
JSpinner spinner = (JSpinner)(e.getSource());
SpinnerUI spinnerUI = spinner.getUI();
if (spinnerUI instanceof BasicSpinnerUI) {
BasicSpinnerUI ui = (BasicSpinnerUI)spinnerUI;
if ("editor".equals(propertyName)) {
JComponent oldEditor = (JComponent)e.getOldValue();
JComponent newEditor = (JComponent)e.getNewValue();
ui.replaceEditor(oldEditor, newEditor);
ui.updateEnabledState();
if (oldEditor instanceof JSpinner.DefaultEditor) {
JTextField tf =
((JSpinner.DefaultEditor)oldEditor).getTextField();
if (tf != null) {
tf.removeFocusListener(nextButtonHandler);
tf.removeFocusListener(previousButtonHandler);
}
}
if (newEditor instanceof JSpinner.DefaultEditor) {
JTextField tf =
((JSpinner.DefaultEditor)newEditor).getTextField();
if (tf != null) {
if (tf.getFont() instanceof UIResource) {
tf.setFont(spinner.getFont());
}
tf.addFocusListener(nextButtonHandler);
tf.addFocusListener(previousButtonHandler);
}
}
}
else if ("enabled".equals(propertyName)) {
ui.updateEnabledState();
}
}
} else if (e.getSource() instanceof JComponent) {
JComponent c = (JComponent)e.getSource();
if ((c.getParent() instanceof JPanel) &&
(c.getParent().getParent() instanceof JSpinner) &&
"border".equals(propertyName)) {
JSpinner spinner = (JSpinner)c.getParent().getParent();
SpinnerUI spinnerUI = spinner.getUI();
if (spinnerUI instanceof BasicSpinnerUI) {
BasicSpinnerUI ui = (BasicSpinnerUI)spinnerUI;
ui.maybeRemoveEditorBorder(c);
}
}
}
}
}
}<|fim▁end|> | child, spinner)) { |
<|file_name|>broker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import six
from .comminfo import CommissionInfo
from .position import Position
from .metabase import MetaParams
from .order import Order, BuyOrder, SellOrder
class BrokerBack(six.with_metaclass(MetaParams, object)):
params = (('cash', 10000.0), ('commission', CommissionInfo()),)
def __init__(self):
self.comminfo = dict()
self.init()
def init(self):
if None not in self.comminfo.keys():
self.comminfo = dict({None: self.p.commission})
self.startingcash = self.cash = self.p.cash
self.orders = list() # will only be appending
self.pending = collections.deque() # popleft and append(right)
self.positions = collections.defaultdict(Position)
self.notifs = collections.deque()
def getcash(self):
return self.cash
def setcash(self, cash):
self.startingcash = self.cash = self.p.cash = cash
def getcommissioninfo(self, data):
if data._name in self.comminfo:
return self.comminfo[data._name]
return self.comminfo[None]
def setcommission(self, commission=0.0, margin=None, mult=1.0, name=None):
comm = CommissionInfo(commission=commission, margin=margin, mult=mult)
self.comminfo[name] = comm
def addcommissioninfo(self, comminfo, name=None):
self.comminfo[name] = comminfo
def start(self):
self.init()
def stop(self):
pass
def cancel(self, order):
try:
self.pending.remove(order)
except ValueError:
# If the list didn't have the element we didn't cancel anything
return False
order.cancel()
self.notify(order)
return True
def getvalue(self, datas=None):
pos_value = 0.0
for data in datas or self.positions.keys():
comminfo = self.getcommissioninfo(data)
position = self.positions[data]
pos_value += comminfo.getvalue(position, data.close[0])
return self.cash + pos_value
def getposition(self, data):
return self.positions[data]
def submit(self, order):
# FIXME: When an order is submitted, a margin check
# requirement has to be done before it can be accepted. This implies
# going over the entire list of pending orders for all datas and
# existing positions, simulating order execution and ending up
# with a "cash" figure that can be used to check the margin requirement
# of the order. If not met, the order can be immediately rejected
order.pannotated = None
order.plen = len(order.data)
order.accept()
self.orders.append(order)
self.pending.append(order)
self.notify(order)
return order
def buy(self, owner, data,
size, price=None, plimit=None,
exectype=None, valid=None):
order = BuyOrder(owner=owner, data=data,
size=size, price=price, pricelimit=plimit,
exectype=exectype, valid=valid)
return self.submit(order)
def sell(self, owner, data,
size, price=None, plimit=None,
exectype=None, valid=None):
order = SellOrder(owner=owner, data=data,
size=size, price=price, pricelimit=plimit,
exectype=exectype, valid=valid)
return self.submit(order)
def _execute(self, order, dt, price):
# Orders are fully executed, get operation size
size = order.executed.remsize
# Get comminfo object for the data
comminfo = self.getcommissioninfo(order.data)
# Adjust position with operation size
position = self.positions[order.data]
oldpprice = position.price
psize, pprice, opened, closed = position.update(size, price)
abopened, abclosed = abs(opened), abs(closed)
# if part/all of a position has been closed, then there has been
# a profitandloss ... record it
pnl = comminfo.profitandloss(abclosed, oldpprice, price)
if closed:
# Adjust to returned value for closed items & acquired opened items
closedvalue = comminfo.getoperationcost(abclosed, price)
self.cash += closedvalue
# Calculate and substract commission
closedcomm = comminfo.getcomm_pricesize(abclosed, price)
self.cash -= closedcomm
# Re-adjust cash according to future-like movements
# Restore cash which was already taken at the start of the day
self.cash -= comminfo.cashadjust(abclosed,
price,
order.data.close[0])
# pnl = comminfo.profitandloss(oldpsize, oldpprice, price)
else:
closedvalue = closedcomm = 0.0
if opened:
openedvalue = comminfo.getoperationcost(abopened, price)
self.cash -= openedvalue
openedcomm = comminfo.getcomm_pricesize(abopened, price)
self.cash -= openedcomm
# Remove cash for the new opened contracts
self.cash += comminfo.cashadjust(abopened,
price,
order.data.close[0])
else:
openedvalue = openedcomm = 0.0
# Execute and notify the order
order.execute(dt, size, price,
closed, closedvalue, closedcomm,
opened, openedvalue, openedcomm,
comminfo.margin, pnl,
psize, pprice)
self.notify(order)
def notify(self, order):
self.notifs.append(order.clone())
def next(self):
for data, pos in self.positions.items():
# futures change cash in the broker in every bar
# to ensure margin requirements are met
comminfo = self.getcommissioninfo(data)
self.cash += comminfo.cashadjust(pos.size,
data.close[-1],
data.close[0])
# Iterate once over all elements of the pending queue
for i in range(len(self.pending)):
order = self.pending.popleft()
if order.expire():
self.notify(order)
continue
popen = order.data.tick_open or order.data.open[0]
phigh = order.data.tick_high or order.data.high[0]
plow = order.data.tick_low or order.data.low[0]
pclose = order.data.tick_close or order.data.close[0]
pcreated = order.created.price
plimit = order.created.pricelimit
if order.exectype == Order.Market:
self._execute(order, order.data.datetime[0], price=popen)
elif order.exectype == Order.Close:
self._try_exec_close(order, pclose)
elif order.exectype == Order.Limit:
self._try_exec_limit(order, popen, phigh, plow, pcreated)
elif order.exectype == Order.StopLimit and order.triggered:
self._try_exec_limit(order, popen, phigh, plow, plimit)
elif order.exectype == Order.Stop:
self._try_exec_stop(order, popen, phigh, plow, pcreated)
elif order.exectype == Order.StopLimit:
self._try_exec_stoplimit(order,
popen, phigh, plow, pclose,
pcreated, plimit)
if order.alive():
self.pending.append(order)
def _try_exec_close(self, order, pclose):
if len(order.data) > order.plen:
dt0 = order.data.datetime[0]
if dt0 > order.dteos:
if order.pannotated:
execdt = order.data.datetime[-1]
execprice = pannotated
else:
execdt = dt0
execprice = pclose
self._execute(order, execdt, price=execprice)
return
# If no exexcution has taken place ... annotate the closing price
order.pannotated = pclose
def _try_exec_limit(self, order, popen, phigh, plow, plimit):
if order.isbuy():
if plimit >= popen:
# open smaller/equal than requested - buy cheaper
self._execute(order, order.data.datetime[0], price=popen)
elif plimit >= plow:
# day low below req price ... match limit price
self._execute(order, order.data.datetime[0], price=plimit)
else: # Sell
if plimit <= popen:
# open greater/equal than requested - sell more expensive
self._execute(order, order.data.datetime[0], price=popen)
elif plimit <= phigh:
# day high above req price ... match limit price
self._execute(order, order.data.datetime[0], price=plimit)
def _try_exec_stop(self, order, popen, phigh, plow, pcreated):
if order.isbuy():
if popen >= pcreated:
# price penetrated with an open gap - use open
self._execute(order, order.data.datetime[0], price=popen)
elif phigh >= pcreated:
# price penetrated during the session - use trigger price
self._execute(order, order.data.datetime[0], price=pcreated)
else: # Sell
if popen <= pcreated:
# price penetrated with an open gap - use open
self._execute(order, order.data.datetime[0], price=popen)
elif plow <= pcreated:
# price penetrated during the session - use trigger price
self._execute(order, order.data.datetime[0], price=pcreated)
def _try_exec_stoplimit(self, order,
popen, phigh, plow, pclose,
pcreated, plimit):
if order.isbuy():
if popen >= pcreated:
order.triggered = True
# price penetrated with an open gap
if plimit >= popen:
self._execute(order, order.data.datetime[0], price=popen)
elif plimit >= plow:
# execute in same bar
self._execute(order, order.data.datetime[0], price=plimit)
elif phigh >= pcreated:
# price penetrated upwards during the session
order.triggered = True
# can calculate execution for a few cases - datetime is fixed
dt = order.data.datetime[0]
if popen > pclose:
if plimit >= pcreated:
self._execute(order, dt, price=pcreated)
elif plimit >= pclose:
self._execute(order, dt, price=plimit)
else: # popen < pclose
if plimit >= pcreated:
self._execute(order, dt, price=pcreated)
else: # Sell
if popen <= pcreated:
# price penetrated downwards with an open gap
order.triggered = True
if plimit <= open:
self._execute(order, order.data.datetime[0], price=popen)
elif plimit <= phigh:
# execute in same bar
self._execute(order, order.data.datetime[0], price=plimit)
elif plow <= pcreated:
# price penetrated downwards during the session
order.triggered = True
# can calculate execution for a few cases - datetime is fixed
dt = order.data.datetime[0]
if popen <= pclose:
if plimit <= pcreated:
self._execute(order, dt, price=pcreated)
elif plimit <= pclose:
self._execute(order, dt, price=plimit)<|fim▁hole|> # popen > pclose
if plimit <= pcreated:
self._execute(order, dt, price=pcreated)<|fim▁end|> | else: |
<|file_name|>get_nn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import scipy
from sklearn.neighbors import KNeighborsClassifier
from scipy.cluster import hierarchy as hier
from scipy.spatial import distance
import json
import codecs
import sys
if len(sys.argv) < 2:
print "Provide file name"
sys.exit(1)
elif len(sys.argv) < 3:
out_file = "nn9m.dat"
else:
out_file = sys.argv[2]
print "Start"
fi = codecs.open(sys.argv[1],"r","utf-8")
words = []
data = []
for line in fi:
if not len(line.strip()): continue
k = line.strip().split()
words.append(k[0])
data.append([float(i) for i in k[-200:]])
fi.close()
vectors = np.array(data)
print "Pre-processing done"
# Calculate the distance matrix
def dist(x,y):
return np.dot(x,y)
<|fim▁hole|>knn.fit(vectors,[0]*len(vectors))
fo = codecs.open(out_file,"w","utf-8")
for i,word in enumerate(words):
d,n = knn.kneighbors(vectors[i], n_neighbors = 25, return_distance = True)
if i%1000==0: print d,n
fo.write(word+"\t")
for j in range(1,len(n[0])):
fo.write(words[n[0][j]]+" ({:.6f}), ".format(d[0][j]))
fo.write("\n")
fo.close()<|fim▁end|> | knn = KNeighborsClassifier() |
<|file_name|>queue.rs<|end_file_name|><|fim▁begin|>// Generated by build.rs script in the amqp0-primitives crate.
// Pre-generated files are used by default. Generation is done with the amqp0-codegen crate.
//
// To regenerate, ignoring the pre-generated files, use: cargo --features="amqp0-build-primitives"
// To format and replace the pre-generated files, use: cargo --features="amqp0-pregen-primitives"
//
// EDITORS BEWARE: Your modifications may be overridden or removed.
// generated by primalgen::codegen::spec_module::class_mod::ClassModuleWriter
#![allow(too_many_arguments)]
impl<'a> ::method::queue::BindMethod<'a> for ::Qpid9_0 {
type Payload = Bind<'a>;
} // impl<'a> ::method::queue::BindMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct Bind<'a> {
ticket: u16,
queue: ::std::borrow::Cow<'a, str>,
exchange: ::std::borrow::Cow<'a, str>,
routing_key: ::std::borrow::Cow<'a, str>,
no_wait: bool,<|fim▁hole|> arguments: ::field::TableEntries<'a>,
} // struct Bind<'a>
impl<'a> Bind<'a> {
pub fn new<Q, E, R, A>(ticket: u16,
queue: Q,
exchange: E,
routing_key: R,
no_wait: bool,
arguments: A)
-> Self
where Q: Into<::std::borrow::Cow<'a, str>>,
E: Into<::std::borrow::Cow<'a, str>>,
R: Into<::std::borrow::Cow<'a, str>>,
A: Into<::field::TableEntries<'a>>
{
Bind {
ticket: ticket,
queue: queue.into(),
exchange: exchange.into(),
routing_key: routing_key.into(),
no_wait: no_wait,
arguments: arguments.into(),
} // Bind
} // fn new()
impl_properties! {
(ticket, set_ticket) -> u16,
(queue, queue_mut, set_queue) -> Cow<str>,
(exchange, exchange_mut, set_exchange) -> Cow<str>,
(routing_key, routing_key_mut, set_routing_key) -> Cow<str>,
(no_wait, set_no_wait) -> bool,
(arguments, arguments_mut, set_arguments) -> &::field::TableEntries<'a>,
} // impl_properties
} // impl<'a> Bind<'a>
impl<'a> Default for Bind<'a> {
fn default() -> Self {
Bind::new(0, "", "", "", false, ::field::TableEntries::new())
} // fn default()
} // impl Default for Bind
impl<'a> ::Encodable for Bind<'a> {
fn encoded_size(&self) -> usize {
3 + ::Encodable::encoded_size(&self.queue) + ::Encodable::encoded_size(&self.exchange) +
::Encodable::encoded_size(&self.routing_key) +
::Encodable::encoded_size(&self.arguments)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.ticket, writer)); // ticket
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&self.exchange, writer)); // exchange
try!(::Encodable::write_encoded_to(&self.routing_key, writer)); // routing_key
try!(::Encodable::write_encoded_to(&{
let mut bits = ::bit_vec::BitVec::from_elem(8,
false);
bits.set(7, self.no_wait);
bits
},
writer));
try!(::Encodable::write_encoded_to(&self.arguments, writer)); // arguments
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_bind_encodable_bytes_written_matches_len() {
let payload: Bind = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for Bind<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
20
}
fn method_name(&self) -> &'static str {
"bind"
}
} // impl ::ProtocolMethodPayload for Bind<'a>
impl<'a> ::method::queue::SetBindMethodFields<'a> for Bind<'a> {
fn set_ticket(&mut self, ticket: u16) {
self.set_ticket(ticket)
} // set_ticket()
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_exchange<V>(&mut self, exchange: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_exchange(exchange.into())
} // set_exchange()
fn set_routing_key<V>(&mut self, routing_key: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_routing_key(routing_key.into())
} // set_routing_key()
fn set_no_wait(&mut self, no_wait: bool) {
self.set_no_wait(no_wait)
} // set_no_wait()
fn set_arguments<V>(&mut self, arguments: V)
where V: Into<::field::TableEntries<'a>>
{
self.set_arguments(arguments.into())
} // set_arguments()
} // impl<'a> ::method::queue::SetBindMethodFields<'a> for Bind<'a>
impl<'a> From<Bind<'a>> for ClassMethod<'a> {
fn from(from: Bind<'a>) -> Self {
ClassMethod::Bind(from)
} // fn from()
} // impl From<Bind<'a>> for ClassMethod
impl<'a> From<Bind<'a>> for super::SpecMethod<'a> {
fn from(from: Bind<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<Bind<'a>> for ::super::SpecMethod
impl ::method::queue::BindOkMethod for ::Qpid9_0 {
type Payload = BindOk;
} // impl ::method::queue::BindOkMethod for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct BindOk;
impl BindOk {
pub fn new() -> Self {
BindOk
} // fn new()
} // impl BindOk
impl Default for BindOk {
fn default() -> Self {
BindOk::new()
} // fn default()
} // impl Default for BindOk
impl ::Encodable for BindOk {
fn encoded_size(&self) -> usize {
0
} // encoded_size
fn write_encoded_to<W>(&self, _: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
::std::result::Result::Ok(())
}
} // impl Encodable
#[test]
fn test_bind_ok_encodable_bytes_written_matches_len() {
let payload: BindOk = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl ::ProtocolMethodPayload for BindOk {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
21
}
fn method_name(&self) -> &'static str {
"bind-ok"
}
} // impl ::ProtocolMethodPayload for BindOk
impl<'a> From<BindOk> for ClassMethod<'a> {
fn from(from: BindOk) -> Self {
ClassMethod::BindOk(from)
} // fn from()
} // impl From<BindOk> for ClassMethod
impl From<BindOk> for super::SpecMethod<'static> {
fn from(from: BindOk) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<BindOk> for ::super::SpecMethod
impl<'a> ::method::queue::DeclareMethod<'a> for ::Qpid9_0 {
type Payload = Declare<'a>;
} // impl<'a> ::method::queue::DeclareMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct Declare<'a> {
ticket: u16,
queue: ::std::borrow::Cow<'a, str>,
passive: bool,
durable: bool,
exclusive: bool,
auto_delete: bool,
no_wait: bool,
arguments: ::field::TableEntries<'a>,
} // struct Declare<'a>
impl<'a> Declare<'a> {
pub fn new<Q, A>(ticket: u16,
queue: Q,
passive: bool,
durable: bool,
exclusive: bool,
auto_delete: bool,
no_wait: bool,
arguments: A)
-> Self
where Q: Into<::std::borrow::Cow<'a, str>>,
A: Into<::field::TableEntries<'a>>
{
Declare {
ticket: ticket,
queue: queue.into(),
passive: passive,
durable: durable,
exclusive: exclusive,
auto_delete: auto_delete,
no_wait: no_wait,
arguments: arguments.into(),
} // Declare
} // fn new()
impl_properties! {
(ticket, set_ticket) -> u16,
(queue, queue_mut, set_queue) -> Cow<str>,
(passive, set_passive) -> bool,
(durable, set_durable) -> bool,
(exclusive, set_exclusive) -> bool,
(auto_delete, set_auto_delete) -> bool,
(no_wait, set_no_wait) -> bool,
(arguments, arguments_mut, set_arguments) -> &::field::TableEntries<'a>,
} // impl_properties
} // impl<'a> Declare<'a>
impl<'a> Default for Declare<'a> {
fn default() -> Self {
Declare::new(0,
"",
false,
false,
false,
false,
false,
::field::TableEntries::new())
} // fn default()
} // impl Default for Declare
impl<'a> ::Encodable for Declare<'a> {
fn encoded_size(&self) -> usize {
3 + ::Encodable::encoded_size(&self.queue) + ::Encodable::encoded_size(&self.arguments)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.ticket, writer)); // ticket
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&{
let mut bits = ::bit_vec::BitVec::from_elem(8,
false);
bits.set(7, self.passive);
bits.set(6, self.durable);
bits.set(5, self.exclusive);
bits.set(4, self.auto_delete);
bits.set(3, self.no_wait);
bits
},
writer));
try!(::Encodable::write_encoded_to(&self.arguments, writer)); // arguments
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_declare_encodable_bytes_written_matches_len() {
let payload: Declare = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for Declare<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
10
}
fn method_name(&self) -> &'static str {
"declare"
}
} // impl ::ProtocolMethodPayload for Declare<'a>
impl<'a> ::method::queue::SetDeclareMethodFields<'a> for Declare<'a> {
fn set_ticket(&mut self, ticket: u16) {
self.set_ticket(ticket)
} // set_ticket()
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_passive(&mut self, passive: bool) {
self.set_passive(passive)
} // set_passive()
fn set_durable(&mut self, durable: bool) {
self.set_durable(durable)
} // set_durable()
fn set_exclusive(&mut self, exclusive: bool) {
self.set_exclusive(exclusive)
} // set_exclusive()
fn set_auto_delete(&mut self, auto_delete: bool) {
self.set_auto_delete(auto_delete)
} // set_auto_delete()
fn set_no_wait(&mut self, no_wait: bool) {
self.set_no_wait(no_wait)
} // set_no_wait()
fn set_arguments<V>(&mut self, arguments: V)
where V: Into<::field::TableEntries<'a>>
{
self.set_arguments(arguments.into())
} // set_arguments()
} // impl<'a> ::method::queue::SetDeclareMethodFields<'a> for Declare<'a>
impl<'a> From<Declare<'a>> for ClassMethod<'a> {
fn from(from: Declare<'a>) -> Self {
ClassMethod::Declare(from)
} // fn from()
} // impl From<Declare<'a>> for ClassMethod
impl<'a> From<Declare<'a>> for super::SpecMethod<'a> {
fn from(from: Declare<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<Declare<'a>> for ::super::SpecMethod
impl<'a> ::method::queue::DeclareOkMethod<'a> for ::Qpid9_0 {
type Payload = DeclareOk<'a>;
} // impl<'a> ::method::queue::DeclareOkMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct DeclareOk<'a> {
queue: ::std::borrow::Cow<'a, str>,
message_count: u32,
consumer_count: u32,
} // struct DeclareOk<'a>
impl<'a> DeclareOk<'a> {
pub fn new<Q>(queue: Q, message_count: u32, consumer_count: u32) -> Self
where Q: Into<::std::borrow::Cow<'a, str>>
{
DeclareOk {
queue: queue.into(),
message_count: message_count,
consumer_count: consumer_count,
} // DeclareOk
} // fn new()
impl_properties! {
(queue, queue_mut, set_queue) -> Cow<str>,
(message_count, set_message_count) -> u32,
(consumer_count, set_consumer_count) -> u32,
} // impl_properties
} // impl<'a> DeclareOk<'a>
impl<'a> Default for DeclareOk<'a> {
fn default() -> Self {
DeclareOk::new("", 0, 0)
} // fn default()
} // impl Default for DeclareOk
impl<'a> ::Encodable for DeclareOk<'a> {
fn encoded_size(&self) -> usize {
8 + ::Encodable::encoded_size(&self.queue)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&self.message_count, writer)); // message_count
try!(::Encodable::write_encoded_to(&self.consumer_count, writer)); // consumer_count
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_declare_ok_encodable_bytes_written_matches_len() {
let payload: DeclareOk = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for DeclareOk<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
11
}
fn method_name(&self) -> &'static str {
"declare-ok"
}
} // impl ::ProtocolMethodPayload for DeclareOk<'a>
impl<'a> ::method::queue::SetDeclareOkMethodFields<'a> for DeclareOk<'a> {
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_message_count(&mut self, message_count: u32) {
self.set_message_count(message_count)
} // set_message_count()
fn set_consumer_count(&mut self, consumer_count: u32) {
self.set_consumer_count(consumer_count)
} // set_consumer_count()
} // impl<'a> ::method::queue::SetDeclareOkMethodFields<'a> for DeclareOk<'a>
impl<'a> From<DeclareOk<'a>> for ClassMethod<'a> {
fn from(from: DeclareOk<'a>) -> Self {
ClassMethod::DeclareOk(from)
} // fn from()
} // impl From<DeclareOk<'a>> for ClassMethod
impl<'a> From<DeclareOk<'a>> for super::SpecMethod<'a> {
fn from(from: DeclareOk<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<DeclareOk<'a>> for ::super::SpecMethod
impl<'a> ::method::queue::DeleteMethod<'a> for ::Qpid9_0 {
type Payload = Delete<'a>;
} // impl<'a> ::method::queue::DeleteMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct Delete<'a> {
ticket: u16,
queue: ::std::borrow::Cow<'a, str>,
if_unused: bool,
if_empty: bool,
no_wait: bool,
} // struct Delete<'a>
impl<'a> Delete<'a> {
pub fn new<Q>(ticket: u16, queue: Q, if_unused: bool, if_empty: bool, no_wait: bool) -> Self
where Q: Into<::std::borrow::Cow<'a, str>>
{
Delete {
ticket: ticket,
queue: queue.into(),
if_unused: if_unused,
if_empty: if_empty,
no_wait: no_wait,
} // Delete
} // fn new()
impl_properties! {
(ticket, set_ticket) -> u16,
(queue, queue_mut, set_queue) -> Cow<str>,
(if_unused, set_if_unused) -> bool,
(if_empty, set_if_empty) -> bool,
(no_wait, set_no_wait) -> bool,
} // impl_properties
} // impl<'a> Delete<'a>
impl<'a> Default for Delete<'a> {
fn default() -> Self {
Delete::new(0, "", false, false, false)
} // fn default()
} // impl Default for Delete
impl<'a> ::Encodable for Delete<'a> {
fn encoded_size(&self) -> usize {
3 + ::Encodable::encoded_size(&self.queue)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.ticket, writer)); // ticket
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&{
let mut bits = ::bit_vec::BitVec::from_elem(8,
false);
bits.set(7, self.if_unused);
bits.set(6, self.if_empty);
bits.set(5, self.no_wait);
bits
},
writer));
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_delete_encodable_bytes_written_matches_len() {
let payload: Delete = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for Delete<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
40
}
fn method_name(&self) -> &'static str {
"delete"
}
} // impl ::ProtocolMethodPayload for Delete<'a>
impl<'a> ::method::queue::SetDeleteMethodFields<'a> for Delete<'a> {
fn set_ticket(&mut self, ticket: u16) {
self.set_ticket(ticket)
} // set_ticket()
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_if_unused(&mut self, if_unused: bool) {
self.set_if_unused(if_unused)
} // set_if_unused()
fn set_if_empty(&mut self, if_empty: bool) {
self.set_if_empty(if_empty)
} // set_if_empty()
fn set_no_wait(&mut self, no_wait: bool) {
self.set_no_wait(no_wait)
} // set_no_wait()
} // impl<'a> ::method::queue::SetDeleteMethodFields<'a> for Delete<'a>
impl<'a> From<Delete<'a>> for ClassMethod<'a> {
fn from(from: Delete<'a>) -> Self {
ClassMethod::Delete(from)
} // fn from()
} // impl From<Delete<'a>> for ClassMethod
impl<'a> From<Delete<'a>> for super::SpecMethod<'a> {
fn from(from: Delete<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<Delete<'a>> for ::super::SpecMethod
impl ::method::queue::DeleteOkMethod for ::Qpid9_0 {
type Payload = DeleteOk;
} // impl ::method::queue::DeleteOkMethod for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct DeleteOk {
message_count: u32,
} // struct DeleteOk
impl DeleteOk {
pub fn new(message_count: u32) -> Self {
DeleteOk { message_count: message_count } // DeleteOk
} // fn new()
impl_properties! {
(message_count, set_message_count) -> u32,
} // impl_properties
} // impl DeleteOk
impl Default for DeleteOk {
fn default() -> Self {
DeleteOk::new(0)
} // fn default()
} // impl Default for DeleteOk
impl ::Encodable for DeleteOk {
fn encoded_size(&self) -> usize {
4
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.message_count, writer)); // message_count
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_delete_ok_encodable_bytes_written_matches_len() {
let payload: DeleteOk = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl ::ProtocolMethodPayload for DeleteOk {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
41
}
fn method_name(&self) -> &'static str {
"delete-ok"
}
} // impl ::ProtocolMethodPayload for DeleteOk
impl ::method::queue::SetDeleteOkMethodFields for DeleteOk {
fn set_message_count(&mut self, message_count: u32) {
self.set_message_count(message_count)
} // set_message_count()
} // impl ::method::queue::SetDeleteOkMethodFields for DeleteOk
impl<'a> From<DeleteOk> for ClassMethod<'a> {
fn from(from: DeleteOk) -> Self {
ClassMethod::DeleteOk(from)
} // fn from()
} // impl From<DeleteOk> for ClassMethod
impl From<DeleteOk> for super::SpecMethod<'static> {
fn from(from: DeleteOk) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<DeleteOk> for ::super::SpecMethod
impl<'a> ::method::queue::PurgeMethod<'a> for ::Qpid9_0 {
type Payload = Purge<'a>;
} // impl<'a> ::method::queue::PurgeMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct Purge<'a> {
ticket: u16,
queue: ::std::borrow::Cow<'a, str>,
no_wait: bool,
} // struct Purge<'a>
impl<'a> Purge<'a> {
pub fn new<Q>(ticket: u16, queue: Q, no_wait: bool) -> Self
where Q: Into<::std::borrow::Cow<'a, str>>
{
Purge {
ticket: ticket,
queue: queue.into(),
no_wait: no_wait,
} // Purge
} // fn new()
impl_properties! {
(ticket, set_ticket) -> u16,
(queue, queue_mut, set_queue) -> Cow<str>,
(no_wait, set_no_wait) -> bool,
} // impl_properties
} // impl<'a> Purge<'a>
impl<'a> Default for Purge<'a> {
fn default() -> Self {
Purge::new(0, "", false)
} // fn default()
} // impl Default for Purge
impl<'a> ::Encodable for Purge<'a> {
fn encoded_size(&self) -> usize {
3 + ::Encodable::encoded_size(&self.queue)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.ticket, writer)); // ticket
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&{
let mut bits = ::bit_vec::BitVec::from_elem(8,
false);
bits.set(7, self.no_wait);
bits
},
writer));
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_purge_encodable_bytes_written_matches_len() {
let payload: Purge = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for Purge<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
30
}
fn method_name(&self) -> &'static str {
"purge"
}
} // impl ::ProtocolMethodPayload for Purge<'a>
impl<'a> ::method::queue::SetPurgeMethodFields<'a> for Purge<'a> {
fn set_ticket(&mut self, ticket: u16) {
self.set_ticket(ticket)
} // set_ticket()
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_no_wait(&mut self, no_wait: bool) {
self.set_no_wait(no_wait)
} // set_no_wait()
} // impl<'a> ::method::queue::SetPurgeMethodFields<'a> for Purge<'a>
impl<'a> From<Purge<'a>> for ClassMethod<'a> {
fn from(from: Purge<'a>) -> Self {
ClassMethod::Purge(from)
} // fn from()
} // impl From<Purge<'a>> for ClassMethod
impl<'a> From<Purge<'a>> for super::SpecMethod<'a> {
fn from(from: Purge<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<Purge<'a>> for ::super::SpecMethod
impl ::method::queue::PurgeOkMethod for ::Qpid9_0 {
type Payload = PurgeOk;
} // impl ::method::queue::PurgeOkMethod for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct PurgeOk {
message_count: u32,
} // struct PurgeOk
impl PurgeOk {
pub fn new(message_count: u32) -> Self {
PurgeOk { message_count: message_count } // PurgeOk
} // fn new()
impl_properties! {
(message_count, set_message_count) -> u32,
} // impl_properties
} // impl PurgeOk
impl Default for PurgeOk {
fn default() -> Self {
PurgeOk::new(0)
} // fn default()
} // impl Default for PurgeOk
impl ::Encodable for PurgeOk {
fn encoded_size(&self) -> usize {
4
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.message_count, writer)); // message_count
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_purge_ok_encodable_bytes_written_matches_len() {
let payload: PurgeOk = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl ::ProtocolMethodPayload for PurgeOk {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
31
}
fn method_name(&self) -> &'static str {
"purge-ok"
}
} // impl ::ProtocolMethodPayload for PurgeOk
impl ::method::queue::SetPurgeOkMethodFields for PurgeOk {
fn set_message_count(&mut self, message_count: u32) {
self.set_message_count(message_count)
} // set_message_count()
} // impl ::method::queue::SetPurgeOkMethodFields for PurgeOk
impl<'a> From<PurgeOk> for ClassMethod<'a> {
fn from(from: PurgeOk) -> Self {
ClassMethod::PurgeOk(from)
} // fn from()
} // impl From<PurgeOk> for ClassMethod
impl From<PurgeOk> for super::SpecMethod<'static> {
fn from(from: PurgeOk) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<PurgeOk> for ::super::SpecMethod
impl<'a> ::method::queue::UnbindMethod<'a> for ::Qpid9_0 {
type Payload = Unbind<'a>;
} // impl<'a> ::method::queue::UnbindMethod<'a> for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct Unbind<'a> {
ticket: u16,
queue: ::std::borrow::Cow<'a, str>,
exchange: ::std::borrow::Cow<'a, str>,
routing_key: ::std::borrow::Cow<'a, str>,
arguments: ::field::TableEntries<'a>,
} // struct Unbind<'a>
impl<'a> Unbind<'a> {
pub fn new<Q, E, R, A>(ticket: u16, queue: Q, exchange: E, routing_key: R, arguments: A) -> Self
where Q: Into<::std::borrow::Cow<'a, str>>,
E: Into<::std::borrow::Cow<'a, str>>,
R: Into<::std::borrow::Cow<'a, str>>,
A: Into<::field::TableEntries<'a>>
{
Unbind {
ticket: ticket,
queue: queue.into(),
exchange: exchange.into(),
routing_key: routing_key.into(),
arguments: arguments.into(),
} // Unbind
} // fn new()
impl_properties! {
(ticket, set_ticket) -> u16,
(queue, queue_mut, set_queue) -> Cow<str>,
(exchange, exchange_mut, set_exchange) -> Cow<str>,
(routing_key, routing_key_mut, set_routing_key) -> Cow<str>,
(arguments, arguments_mut, set_arguments) -> &::field::TableEntries<'a>,
} // impl_properties
} // impl<'a> Unbind<'a>
impl<'a> Default for Unbind<'a> {
fn default() -> Self {
Unbind::new(0, "", "", "", ::field::TableEntries::new())
} // fn default()
} // impl Default for Unbind
impl<'a> ::Encodable for Unbind<'a> {
fn encoded_size(&self) -> usize {
2 + ::Encodable::encoded_size(&self.queue) + ::Encodable::encoded_size(&self.exchange) +
::Encodable::encoded_size(&self.routing_key) +
::Encodable::encoded_size(&self.arguments)
} // encoded_size
fn write_encoded_to<W>(&self, writer: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
try!(::Encodable::write_encoded_to(&self.ticket, writer)); // ticket
try!(::Encodable::write_encoded_to(&self.queue, writer)); // queue
try!(::Encodable::write_encoded_to(&self.exchange, writer)); // exchange
try!(::Encodable::write_encoded_to(&self.routing_key, writer)); // routing_key
try!(::Encodable::write_encoded_to(&self.arguments, writer)); // arguments
::std::result::Result::Ok(())
} // fn write_encoded_to()
} // impl Encodable
#[test]
fn test_unbind_encodable_bytes_written_matches_len() {
let payload: Unbind = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl<'a> ::ProtocolMethodPayload for Unbind<'a> {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
50
}
fn method_name(&self) -> &'static str {
"unbind"
}
} // impl ::ProtocolMethodPayload for Unbind<'a>
impl<'a> ::method::queue::SetUnbindMethodFields<'a> for Unbind<'a> {
fn set_ticket(&mut self, ticket: u16) {
self.set_ticket(ticket)
} // set_ticket()
fn set_queue<V>(&mut self, queue: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_queue(queue.into())
} // set_queue()
fn set_exchange<V>(&mut self, exchange: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_exchange(exchange.into())
} // set_exchange()
fn set_routing_key<V>(&mut self, routing_key: V)
where V: Into<::std::borrow::Cow<'a, str>>
{
self.set_routing_key(routing_key.into())
} // set_routing_key()
fn set_arguments<V>(&mut self, arguments: V)
where V: Into<::field::TableEntries<'a>>
{
self.set_arguments(arguments.into())
} // set_arguments()
} // impl<'a> ::method::queue::SetUnbindMethodFields<'a> for Unbind<'a>
impl<'a> From<Unbind<'a>> for ClassMethod<'a> {
fn from(from: Unbind<'a>) -> Self {
ClassMethod::Unbind(from)
} // fn from()
} // impl From<Unbind<'a>> for ClassMethod
impl<'a> From<Unbind<'a>> for super::SpecMethod<'a> {
fn from(from: Unbind<'a>) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<Unbind<'a>> for ::super::SpecMethod
impl ::method::queue::UnbindOkMethod for ::Qpid9_0 {
type Payload = UnbindOk;
} // impl ::method::queue::UnbindOkMethod for ::Qpid9_0
// generated by primalgen::codegen::spec-module::class_mod::method_struct
#[derive(Debug)]
pub struct UnbindOk;
impl UnbindOk {
pub fn new() -> Self {
UnbindOk
} // fn new()
} // impl UnbindOk
impl Default for UnbindOk {
fn default() -> Self {
UnbindOk::new()
} // fn default()
} // impl Default for UnbindOk
impl ::Encodable for UnbindOk {
fn encoded_size(&self) -> usize {
0
} // encoded_size
fn write_encoded_to<W>(&self, _: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
::std::result::Result::Ok(())
}
} // impl Encodable
#[test]
fn test_unbind_ok_encodable_bytes_written_matches_len() {
let payload: UnbindOk = Default::default();
let expected_len = ::Encodable::encoded_size(&payload);
let mut writer = ::std::io::Cursor::new(Vec::with_capacity(expected_len));
::Encodable::write_encoded_to(&payload, &mut writer).unwrap();
let payload = writer.into_inner();
if payload.len() != expected_len {
panic!("Expected payload len {}, got {}, {:?}",
expected_len,
payload.len(),
&payload[..]);
}
}
impl ::ProtocolMethodPayload for UnbindOk {
fn class(&self) -> ::Class {
::Class::Queue
}
fn class_id(&self) -> u16 {
50
}
fn class_name(&self) -> &'static str {
"queue"
}
fn method_id(&self) -> u16 {
51
}
fn method_name(&self) -> &'static str {
"unbind-ok"
}
} // impl ::ProtocolMethodPayload for UnbindOk
impl<'a> From<UnbindOk> for ClassMethod<'a> {
fn from(from: UnbindOk) -> Self {
ClassMethod::UnbindOk(from)
} // fn from()
} // impl From<UnbindOk> for ClassMethod
impl From<UnbindOk> for super::SpecMethod<'static> {
fn from(from: UnbindOk) -> Self {
super::SpecMethod::Queue(from.into())
} // fn default()
} // impl From<UnbindOk> for ::super::SpecMethod
#[derive(Debug)]
pub enum ClassMethod<'a> {
Bind(Bind<'a>),
BindOk(BindOk),
Declare(Declare<'a>),
DeclareOk(DeclareOk<'a>),
Delete(Delete<'a>),
DeleteOk(DeleteOk),
Purge(Purge<'a>),
PurgeOk(PurgeOk),
Unbind(Unbind<'a>),
UnbindOk(UnbindOk),
} // enum ClassMethod
impl<'a> ::Encodable for ClassMethod<'a> {
fn encoded_size(&self) -> usize {
match *self {
ClassMethod::Bind(ref method) => ::Encodable::encoded_size(method),
ClassMethod::BindOk(ref method) => ::Encodable::encoded_size(method),
ClassMethod::Declare(ref method) => ::Encodable::encoded_size(method),
ClassMethod::DeclareOk(ref method) => ::Encodable::encoded_size(method),
ClassMethod::Delete(ref method) => ::Encodable::encoded_size(method),
ClassMethod::DeleteOk(ref method) => ::Encodable::encoded_size(method),
ClassMethod::Purge(ref method) => ::Encodable::encoded_size(method),
ClassMethod::PurgeOk(ref method) => ::Encodable::encoded_size(method),
ClassMethod::Unbind(ref method) => ::Encodable::encoded_size(method),
ClassMethod::UnbindOk(ref method) => ::Encodable::encoded_size(method),
} // match *self
} // fn encoded_size
fn write_encoded_to<W>(&self, _: &mut W) -> ::std::io::Result<()>
where W: ::std::io::Write
{
unimplemented!()
} // fn write_encoded_to()
} // impl ::Encodable for ClassMethod<'a>
impl<'a> ::ProtocolMethodPayload for ClassMethod<'a> {
fn class(&self) -> ::Class {
match *self {
ClassMethod::Bind(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::BindOk(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::Declare(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::DeclareOk(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::Delete(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::DeleteOk(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::Purge(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::PurgeOk(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::Unbind(ref method) => ::ProtocolMethodPayload::class(method),
ClassMethod::UnbindOk(ref method) => ::ProtocolMethodPayload::class(method),
} // match *self
} // fn class
fn class_id(&self) -> u16 {
match *self {
ClassMethod::Bind(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::BindOk(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::Declare(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::DeclareOk(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::Delete(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::DeleteOk(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::Purge(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::PurgeOk(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::Unbind(ref method) => ::ProtocolMethodPayload::class_id(method),
ClassMethod::UnbindOk(ref method) => ::ProtocolMethodPayload::class_id(method),
} // match *self
} // fn class_id
fn class_name(&self) -> &'static str {
match *self {
ClassMethod::Bind(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::BindOk(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::Declare(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::DeclareOk(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::Delete(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::DeleteOk(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::Purge(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::PurgeOk(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::Unbind(ref method) => ::ProtocolMethodPayload::class_name(method),
ClassMethod::UnbindOk(ref method) => ::ProtocolMethodPayload::class_name(method),
} // match *self
} // fn class_name
fn method_id(&self) -> u16 {
match *self {
ClassMethod::Bind(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::BindOk(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::Declare(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::DeclareOk(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::Delete(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::DeleteOk(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::Purge(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::PurgeOk(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::Unbind(ref method) => ::ProtocolMethodPayload::method_id(method),
ClassMethod::UnbindOk(ref method) => ::ProtocolMethodPayload::method_id(method),
} // match *self
} // fn method_id
fn method_name(&self) -> &'static str {
match *self {
ClassMethod::Bind(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::BindOk(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::Declare(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::DeclareOk(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::Delete(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::DeleteOk(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::Purge(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::PurgeOk(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::Unbind(ref method) => ::ProtocolMethodPayload::method_name(method),
ClassMethod::UnbindOk(ref method) => ::ProtocolMethodPayload::method_name(method),
} // match *self
} // fn method_name
} // impl ProtocolMethodPayload for ClassMethod<|fim▁end|> | |
<|file_name|>issue-61475.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
enum E {
A, B
}
<|fim▁hole|> match &&E::A {
&&E::A => {
}
&&E::B => {
}
};
}<|fim▁end|> | fn main() { |
<|file_name|>BayesUpdating.py<|end_file_name|><|fim▁begin|># Add any code that updates the current probability
# values of any of the nodes here.
# For example, here is a method that updates the probability of
# a single node, where this node is assumed to have a single parent.
def update_node_with_one_parent(n):
'''
For all possible values pv of the current node,
For all possible values ppv of the parent,
Look up the conditional probability of pv given ppv.
and multiply it by the current prob. of that parent state (ppv)<|fim▁hole|> print "It does not have exactly one parent."
return
parent = n.parents[0]
for pv in n.possible_values:
n.current_prob[pv] = 0.0
for ppv in n.parents[0].possible_values:
conditional = n.name+'='+str(pv)+'|'+parent.name+'='+str(ppv)
n.current_prob[pv] += n.p[conditional] * parent.current_prob[ppv]
def gen_cartesian_product(sets):
'''Return the cartesian product of a list of sets.
For example: [['a','b'],[0,1],[7,8,9]] should give a 12 element set of triples.'''
if len(sets)==1:
return map(lambda set: [set], sets[0])
subproduct = gen_cartesian_product(sets[1:])
prod = []
for elt in sets[0]:
new_tuples = map(lambda tup: [elt]+tup, subproduct)
prod = prod + new_tuples
return prod
def update_node_with_k_parents(n):
'''
For all possible values pv of the current node,
For all possible values ppv of each of the parents,
Look up the conditional probability of pv given ppv.
and multiply it by the current prob. of that parent state (ppv)
and accumulate these to get the current probability of pv.
'''
print "Updating node: "+n.name
if len(n.parents) < 1:
print "The function update_node_with_k_parents cannot handle node "+n.name
print "It does not have any parents."
return
cartesian_prod = gen_cartesian_product(map(lambda p: p.possible_values, n.parents))
parent_names = map(lambda p: p.name, n.parents)
for pv in n.possible_values:
n.current_prob[pv] = 0.0
print " Updating current prob. of "+pv
for ppv_tuple in cartesian_prod:
print " Adding the contribution for "+str(ppv_tuple)
conditional = n.name+'='+pv+'|'+str(parent_names) +'='+str(ppv_tuple)
parent_vector_prob = reduce(lambda a,b:a*b, map(lambda p, pv:p.current_prob[pv], n.parents, ppv_tuple))
n.current_prob[pv] += n.p[conditional] * parent_vector_prob
#update_node_with_one_parent(nodeB)<|fim▁end|> | and accumulate these to get the current probability of pv.
'''
if len(n.parents)!= 1:
print "The function update_node_with_one_parent cannot handle node "+n.name |
<|file_name|>decode.go<|end_file_name|><|fim▁begin|>package imap
import (
"bytes"
"crypto/md5"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"mime"
"mime/multipart"
"mime/quotedprintable"
"net/mail"
"github.com/yesnault/go-imap/imap"
"github.com/ovh/venom"
)
func decodeHeader(msg *mail.Message, headerName string) (string, error) {
dec := new(mime.WordDecoder)
s, err := dec.DecodeHeader(msg.Header.Get(headerName))
if err != nil {
return msg.Header.Get(headerName), err
}
return s, nil
}
func hash(in string) string {
h2 := md5.New()
io.WriteString(h2, in)
return fmt.Sprintf("%x", h2.Sum(nil))
}
func extract(rsp imap.Response, l venom.Logger) (*Mail, error) {
tm := &Mail{}
header := imap.AsBytes(rsp.MessageInfo().Attrs["RFC822.HEADER"])
tm.UID = imap.AsNumber((rsp.MessageInfo().Attrs["UID"]))
body := imap.AsBytes(rsp.MessageInfo().Attrs["RFC822.TEXT"])
mmsg, err := mail.ReadMessage(bytes.NewReader(header))
if err != nil {
return nil, err
}
tm.Subject, err = decodeHeader(mmsg, "Subject")
if err != nil {
return nil, fmt.Errorf("Cannot decode Subject header: %s", err)
}
tm.From, err = decodeHeader(mmsg, "From")
if err != nil {
return nil, fmt.Errorf("Cannot decode From header: %s", err)
}
tm.To, err = decodeHeader(mmsg, "To")
if err != nil {
return nil, fmt.Errorf("Cannot decode To header: %s", err)
}
encoding := mmsg.Header.Get("Content-Transfer-Encoding")
var r io.Reader = bytes.NewReader(body)
switch encoding {
case "7bit", "8bit", "binary":
// noop, reader already initialized.
case "quoted-printable":
r = quotedprintable.NewReader(r)
case "base64":
r = base64.NewDecoder(base64.StdEncoding, r)
}
l.Debugf("Mail Content-Transfer-Encoding is %s ", encoding)
contentType, params, err := mime.ParseMediaType(mmsg.Header.Get("Content-Type"))
if err != nil {
return nil, fmt.Errorf("Error while reading Content-Type:%s", err)
}
if contentType == "multipart/mixed" || contentType == "multipart/alternative" {
if boundary, ok := params["boundary"]; ok {
mr := multipart.NewReader(r, boundary)
for {
p, errm := mr.NextPart()
if errm == io.EOF {
continue
}
if errm != nil {
l.Debugf("Error while read Part:%s", err)
break
}
slurp, errm := ioutil.ReadAll(p)
if errm != nil {
l.Debugf("Error while ReadAll Part:%s", err)
continue
}
tm.Body = string(slurp)
break
}
}
} else {
body, err = ioutil.ReadAll(r)
if err != nil {<|fim▁hole|> if tm.Body == "" {
tm.Body = string(body)
}
return tm, nil
}<|fim▁end|> | return nil, err
}
} |
<|file_name|>x86_reset16.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <[email protected]>
#
# Entry-type module for the 16-bit x86 reset code for U-Boot
#
from binman.entry import Entry
from binman.etype.blob import Entry_blob
class Entry_x86_reset16(Entry_blob):
"""x86 16-bit reset code for U-Boot
Properties / Entry arguments:
- filename: Filename of u-boot-x86-reset16.bin (default
'u-boot-x86-reset16.bin')
x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
must be placed at a particular address. This entry holds that code. It is
typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible
for jumping to the x86-start16 code, which continues execution.
For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.<|fim▁hole|> """
def __init__(self, section, etype, node):
super().__init__(section, etype, node)
def GetDefaultFilename(self):
return 'u-boot-x86-reset16.bin'<|fim▁end|> | |
<|file_name|>prompt.py<|end_file_name|><|fim▁begin|>class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Prompt',
# list of one or more authors for the module
'Author': ['@FuzzyNop', '@harmj0y'],
# more verbose multi-line description of the module
'Description': ('Launches a specified application with an prompt for credentials with osascript.'),
# True if the module needs to run in the background
'Background' : False,
# File extension to save the file as<|fim▁hole|> 'NeedsAdmin' : False,
# True if the method doesn't touch disk/is reasonably opsec safe
'OpsecSafe' : False,
# the module language
'Language' : 'python',
# the minimum language version needed
'MinLanguageVersion' : '2.6',
# list of any references/other comments
'Comments': [
"https://github.com/fuzzynop/FiveOnceInYourLife"
]
}
# any options needed by the module, settable during runtime
self.options = {
# format:
# value_name : {description, required, default_value}
'Agent' : {
# The 'Agent' option is the only one that MUST be in a module
'Description' : 'Agent to execute module on.',
'Required' : True,
'Value' : ''
},
'AppName' : {
# The 'Agent' option is the only one that MUST be in a module
'Description' : 'The name of the application to launch.',
'Required' : True,
'Value' : 'App Store'
},
'ListApps' : {
# The 'Agent' option is the only one that MUST be in a module
'Description' : 'Switch. List applications suitable for launching.',
'Required' : False,
'Value' : ''
}
}
# save off a copy of the mainMenu object to access external functionality
# like listeners/agent handlers/etc.
self.mainMenu = mainMenu
# During instantiation, any settable option parameters
# are passed as an object set to the module and the
# options dictionary is automatically set. This is mostly
# in case options are passed on the command line
if params:
for param in params:
# parameter format is [Name, Value]
option, value = param
if option in self.options:
self.options[option]['Value'] = value
def generate(self):
listApps = self.options['ListApps']['Value']
appName = self.options['AppName']['Value']
if listApps != "":
script = """
import os
apps = [ app.split('.app')[0] for app in os.listdir('/Applications/') if not app.split('.app')[0].startswith('.')]
choices = []
for x in xrange(len(apps)):
choices.append("[%s] %s " %(x+1, apps[x]) )
print "\\nAvailable applications:\\n"
print '\\n'.join(choices)
"""
else:
# osascript prompt for the specific application
script = """
import os
print os.popen('osascript -e \\\'tell app "%s" to activate\\\' -e \\\'tell app "%s" to display dialog "%s requires your password to continue." & return default answer "" with icon 1 with hidden answer with title "%s Alert"\\\'').read()
""" % (appName, appName, appName, appName)
return script<|fim▁end|> | 'OutputExtension' : "",
# if the module needs administrative privileges |
<|file_name|>_validate_displaylayer.py<|end_file_name|><|fim▁begin|>import pyblish.api
import maya.cmds as cmds
import pymel
<|fim▁hole|>
families = ['scene']
optional = True
label = 'Modeling - Display Layers'
def process(self, instance):
"""Process all the nodes in the instance """
layers = []
for layer in cmds.ls(type='displayLayer'):
# skipping references
if pymel.core.PyNode(layer).isReferenced():
return
if layer != 'defaultLayer':
layers.append(layer)
assert not layers, 'Scene has displayLayers: %s' % layers<|fim▁end|> | class ValidateDisplaylayer(pyblish.api.Validator):
""" Ensure no construction history exists on the nodes in the instance """ |
<|file_name|>test_user.py<|end_file_name|><|fim▁begin|>#import pytest
#import sys
import test.api as api
#import bauble.db as db
from bauble.model.user import User
def xtest_user_json(session):
username = 'test_user_json'
password = username
users = session.query(User).filter_by(username=username)
for user in users:
session.delete(user)
session.commit()
user = User(username=username, password=password)
session.add(user)
session.commit()
def xtest_get_schema():
schema = api.get_resource("/user/schema")
<|fim▁hole|>
def xtest_resource(session):
"""
Test the server properly /family resources
"""
return
db.set_session_schema(session, session.merge(organization).pg_schema)
families = session.query(Family)
# create a family family
first_family = api.create_resource('/family', {'family': api.get_random_name()})
# get the family
first_family = api.get_resource(first_family['ref'])
# query for families
response_json = api.query_resource('/family', q=second_family['family'])
second_family = response_json[0] # we're assuming there's only one
assert second_family['ref'] == second_ref
# delete the created resources
api.delete_resource(first_family['ref'])
api.delete_resource(second_family['ref'])
def test_password(session):
username = api.get_random_name()
email = username + '@bauble.io'
password = api.get_random_name()
user = User(email=email, username=username, password=password)
session.add(user)
session.commit()
# test the password isn't stored in plain text
assert user._password != password
# test that we can compare the password against a plain test password
assert user.password == password
session.delete(user)
session.commit()<|fim▁end|> | |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>//! Provides common utility functions<|fim▁hole|>use num::traits::{NumCast, cast};
/// Shared Lock used for our tensors
pub type ArcLock<T> = Arc<RwLock<T>>;
/// Create a simple native backend.
///
/// This is handy when you need to sync data to host memory to read/write it.
pub fn native_backend() -> Backend<Native> {
let framework = Native::new();
let hardwares = &framework.hardwares().to_vec();
let backend_config = BackendConfig::new(framework, hardwares);
Backend::new(backend_config).unwrap()
}
/// Write into a native Collenchyma Memory.
pub fn write_to_memory<T: NumCast + ::std::marker::Copy>(mem: &mut MemoryType, data: &[T]) {
write_to_memory_offset(mem, data, 0);
}
/// Write into a native Collenchyma Memory with a offset.
pub fn write_to_memory_offset<T: NumCast + ::std::marker::Copy>(mem: &mut MemoryType, data: &[T], offset: usize) {
match mem {
&mut MemoryType::Native(ref mut mem) => {
let mut mem_buffer = mem.as_mut_slice::<f32>();
for (index, datum) in data.iter().enumerate() {
// mem_buffer[index + offset] = *datum;
mem_buffer[index + offset] = cast(*datum).unwrap();
}
},
#[cfg(any(feature = "opencl", feature = "cuda"))]
_ => {}
}
}
/// Write the `i`th sample of a batch into a SharedTensor.
///
/// The size of a single sample is infered through
/// the first dimension of the SharedTensor, which
/// is asumed to be the batchsize.
///
/// Allocates memory on a Native Backend if neccessary.
pub fn write_batch_sample<T: NumCast + ::std::marker::Copy>(tensor: &mut SharedTensor<f32>, data: &[T], i: usize) {
let native_backend = native_backend();
let batch_size = tensor.desc().size();
let sample_size = batch_size / tensor.desc()[0];
let _ = tensor.add_device(native_backend.device());
tensor.sync(native_backend.device()).unwrap();
write_to_memory_offset(tensor.get_mut(native_backend.device()).unwrap(), &data, i * sample_size);
}
/// Create a Collenchyma SharedTensor for a scalar value.
pub fn native_scalar<T: NumCast + ::std::marker::Copy>(scalar: T) -> SharedTensor<T> {
let native = native_backend();
let mut shared_scalar = SharedTensor::<T>::new(native.device(), &vec![1]).unwrap();
write_to_memory(shared_scalar.get_mut(native.device()).unwrap(), &[scalar]);
shared_scalar
}
/// Casts a Vec<usize> to as Vec<i32>
pub fn cast_vec_usize_to_i32(input: Vec<usize>) -> Vec<i32> {
let mut out = Vec::new();
for i in input.iter() {
out.push(*i as i32);
}
out
}
/// Extends IBlas with Axpby
pub trait Axpby<F> : Axpy<F> + Scal<F> {
/// Performs the operation y := a*x + b*y .
///
/// Consists of a scal(b, y) followed by a axpby(a,x,y).
fn axpby(&self, a: &mut SharedTensor<F>, x: &mut SharedTensor<F>, b: &mut SharedTensor<F>, y: &mut SharedTensor<F>) -> Result<(), ::co::error::Error> {
try!(self.scal(b, y));
try!(self.axpy(a, x, y));
Ok(())
}
/// Performs the operation y := a*x + b*y .
///
/// Consists of a scal(b, y) followed by a axpby(a,x,y).
fn axpby_plain(&self, a: &SharedTensor<F>, x: &SharedTensor<F>, b: &SharedTensor<F>, y: &mut SharedTensor<F>) -> Result<(), ::co::error::Error> {
try!(self.scal_plain(b, y));
try!(self.axpy_plain(a, x, y));
Ok(())
}
}
impl<T: Axpy<f32> + Scal<f32>> Axpby<f32> for T {}
/// Encapsulates all traits required by Solvers.
// pub trait SolverOps<F> : Axpby<F> + Dot<F> + Copy<F> {}
//
// impl<T: Axpby<f32> + Dot<f32> + Copy<f32>> SolverOps<f32> for T {}
pub trait SolverOps<F> : LayerOps<F> + Axpby<F> + Dot<F> + Copy<F> {}
impl<T: LayerOps<f32> + Axpby<f32> + Dot<f32> + Copy<f32>> SolverOps<f32> for T {}
/// Encapsulates all traits used in Layers.
#[cfg(all(feature="cuda", not(feature="native")))]
pub trait LayerOps<F> : conn::Convolution<F>
+ conn::Pooling<F>
+ conn::Relu<F> + conn::ReluPointwise<F>
+ conn::Sigmoid<F> + conn::SigmoidPointwise<F>
+ conn::Tanh<F> + conn::TanhPointwise<F>
+ conn::Softmax<F> + conn::LogSoftmax<F>
+ Gemm<F> {}
#[cfg(feature="native")]
/// Encapsulates all traits used in Layers.
pub trait LayerOps<F> : conn::Relu<F>
+ conn::Sigmoid<F>
+ conn::Tanh<F>
+ conn::Softmax<F> + conn::LogSoftmax<F>
+ Gemm<F> {}
#[cfg(all(feature="cuda", not(feature="native")))]
impl<T: conn::Convolution<f32>
+ conn::Pooling<f32>
+ conn::Relu<f32> + conn::ReluPointwise<f32>
+ conn::Sigmoid<f32> + conn::SigmoidPointwise<f32>
+ conn::Tanh<f32> + conn::TanhPointwise<f32>
+ conn::Softmax<f32> + conn::LogSoftmax<f32>
+ Gemm<f32>> LayerOps<f32> for T {}
#[cfg(feature="native")]
impl<T: conn::Relu<f32>
+ conn::Sigmoid<f32>
+ conn::Tanh<f32>
+ conn::Softmax<f32> + conn::LogSoftmax<f32>
+ Gemm<f32>> LayerOps<f32> for T {}<|fim▁end|> | use std::sync::{Arc, RwLock};
use co::prelude::*;
use coblas::plugin::*;
use conn; |
<|file_name|>0003_alter_task_input_field.py<|end_file_name|><|fim▁begin|># Generated by Django 1.11.21 on 2019-07-01 12:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instructor_task', '0002_gradereportsetting'),
]
operations = [
migrations.AlterField(
model_name='instructortask',
name='task_input',<|fim▁hole|> ),
]<|fim▁end|> | field=models.TextField(), |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for mords_backend project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""<|fim▁hole|>
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mords_backend.settings")
application = get_wsgi_application()<|fim▁end|> | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Copyright 2020 The Knative Authors
<|fim▁hole|>You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"log"
"github.com/kelseyhightower/envconfig"
"golang.org/x/sync/errgroup"
"k8s.io/client-go/rest"
"knative.dev/pkg/injection"
"knative.dev/pkg/logging"
_ "knative.dev/pkg/system/testing"
"knative.dev/eventing/pkg/kncloudevents"
"knative.dev/eventing/test/lib/recordevents"
"knative.dev/eventing/test/lib/recordevents/logger_vent"
"knative.dev/eventing/test/lib/recordevents/receiver"
"knative.dev/eventing/test/lib/recordevents/recorder_vent"
"knative.dev/eventing/test/lib/recordevents/sender"
"knative.dev/eventing/test/test_images"
)
type envConfig struct {
EventGenerators []string `envconfig:"EVENT_GENERATORS" required:"true"`
EventLogs []string `envconfig:"EVENT_LOGS" required:"true"`
}
func main() {
cfg, err := rest.InClusterConfig()
if err != nil {
log.Fatal("Error while reading the cfg", err)
}
//nolint // nil ctx is fine here, look at the code of EnableInjectionOrDie
ctx, _ := injection.EnableInjectionOrDie(nil, cfg)
ctx = test_images.ConfigureLogging(ctx, "recordevents")
if err := test_images.ConfigureTracing(logging.FromContext(ctx), ""); err != nil {
logging.FromContext(ctx).Fatal("Unable to setup trace publishing", err)
}
var env envConfig
if err := envconfig.Process("", &env); err != nil {
logging.FromContext(ctx).Fatal("Failed to process env var", err)
}
eventLogs := createEventLogs(ctx, env.EventLogs)
err = startEventGenerators(ctx, env.EventGenerators, eventLogs)
if err != nil {
logging.FromContext(ctx).Fatal("Error during start: ", err)
}
logging.FromContext(ctx).Info("Closing the recordevents process")
}
func createEventLogs(ctx context.Context, logTypes []string) *recordevents.EventLogs {
var l []recordevents.EventLog
for _, logType := range logTypes {
switch recordevents.EventLogType(logType) {
case recordevents.RecorderEventLog:
l = append(l, recorder_vent.NewFromEnv(ctx))
case recordevents.LoggerEventLog:
l = append(l, logger_vent.Logger(logging.FromContext(ctx).Named("event logger").Infof))
default:
logging.FromContext(ctx).Fatal("Cannot recognize event log type: ", logType)
}
}
return recordevents.NewEventLogs(l...)
}
func startEventGenerators(ctx context.Context, genTypes []string, eventLogs *recordevents.EventLogs) error {
errs, _ := errgroup.WithContext(ctx)
for _, genType := range genTypes {
switch recordevents.EventGeneratorType(genType) {
case recordevents.ReceiverEventGenerator:
errs.Go(func() error {
return receiver.NewFromEnv(ctx, eventLogs).Start(ctx, kncloudevents.CreateHandler)
})
case recordevents.SenderEventGenerator:
errs.Go(func() error {
return sender.Start(ctx, eventLogs)
})
default:
logging.FromContext(ctx).Fatal("Cannot recognize event generator type: ", genType)
}
}
return errs.Wait()
}<|fim▁end|> | Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. |
<|file_name|>S15.10.2.15_A1_T8.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.10.2.15_A1_T8;
* @section: 15.10.2.15;
* @assertion: The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
* following:
* If A does not contain exactly one character or B does not contain exactly one character then throw
* a SyntaxError exception;
* @description: Checking if execution of "/[\Wb-G]/.exec("a")" leads to throwing the correct exception;
*/
//CHECK#1
try {
$ERROR('#1.1: /[\\Wb-G]/.exec("a") throw SyntaxError. Actual: ' + (/[\Wb-G]/.exec("a")));
} catch (e) {
if((e instanceof SyntaxError) !== true){
$ERROR('#1.2: /[\\Wb-G]/.exec("a") throw SyntaxError. Actual: ' + (e));
<|fim▁hole|><|fim▁end|> | }
} |
<|file_name|>chip-list.d.ts<|end_file_name|><|fim▁begin|>import { AfterContentInit, ElementRef, QueryList } from '@angular/core';
import { MdChip } from './chip';
import { FocusKeyManager } from '../core/a11y/focus-key-manager';
/**
* A material design chips component (named ChipList for it's similarity to the List component).
*
* Example:
*
* <md-chip-list>
* <md-chip>Chip 1<md-chip>
* <md-chip>Chip 2<md-chip>
* </md-chip-list>
*/
export declare class MdChipList implements AfterContentInit {
private _elementRef;
/** Track which chips we're listening to for focus/destruction. */
private _subscribed;
/** Whether or not the chip is selectable. */
protected _selectable: boolean;<|fim▁hole|> /** The FocusKeyManager which handles focus. */
_keyManager: FocusKeyManager;
/** The chip components contained within this chip list. */
chips: QueryList<MdChip>;
constructor(_elementRef: ElementRef);
ngAfterContentInit(): void;
/**
* Whether or not this chip is selectable. When a chip is not selectable,
* it's selected state is always ignored.
*/
selectable: boolean;
/**
* Programmatically focus the chip list. This in turn focuses the first
* non-disabled chip in this chip list.
*/
focus(): void;
/** Passes relevant key presses to our key manager. */
_keydown(event: KeyboardEvent): void;
/** Toggles the selected state of the currently focused chip. */
protected _toggleSelectOnFocusedChip(): void;
/**
* Iterate through the list of chips and add them to our list of
* subscribed chips.
*
* @param chips The list of chips to be subscribed.
*/
protected _subscribeChips(chips: QueryList<MdChip>): void;
/**
* Add a specific chip to our subscribed list. If the chip has
* already been subscribed, this ensures it is only subscribed
* once.
*
* @param chip The chip to be subscribed (or checked for existing
* subscription).
*/
protected _addChip(chip: MdChip): void;
/**
* Utility to ensure all indexes are valid.
*
* @param index The index to be checked.
* @returns True if the index is valid for our list of chips.
*/
private _isValidIndex(index);
}<|fim▁end|> | |
<|file_name|>test_events.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
from pida.core.events import EventsConfig
import unittest
class MockCallback(object):
def __init__(self):
self.calls = []
def __call__(self, **kw):
self.calls.append(kw)
class MockService(object):<|fim▁hole|>
class EventTestCase(unittest.TestCase):
def setUp(self):
self.e = EventsConfig(MockService())
self.c = MockCallback()
self.e.publish('initial')
self.e.subscribe('initial', self.c)
def test_emit_event(self):
self.e.emit('initial')
self.assertEqual(len(self.c.calls), 1)
self.assertEqual(self.c.calls[0], {})
def test_emit_event_multiple(self):
self.e.emit('initial')
self.e.emit('initial')
self.e.emit('initial')
self.assertEqual(len(self.c.calls), 3)
def test_emit_event_with_argument(self):
self.e.emit('initial', parameter=1)
self.assertEqual(len(self.c.calls), 1)
self.assertEqual(self.c.calls[0], {'parameter': 1})
def test_emit_event_bad_argument(self):
try:
self.e.emit('initial', 1)
raise AssertionError('TypeError not raised')
except TypeError:
pass<|fim▁end|> | """used instead of None cause weakref proxy cant handle None""" |
<|file_name|>gridcontrol.js<|end_file_name|><|fim▁begin|>//When change in default attribute:
// Make code revision and check all values working with the default HTML attribute name 'gridindex' and or the variable `attribute`
var navigationItem, attribute;
var navigationActive = false;
var gridindex = "1-2";
var backupGridindex = "1-2";
var lastGridindex_col = {};
var attributes = ["nav-gridindex"]
function getElem(col, row) {
if (attribute == undefined) {
return document.querySelector("[gridindex='" + String(col) + "-" + String(row) + "']");
} else {
return document.querySelector("[" + attribute + "='" + String(col) + "-" + String(row) + "']");
}
}
function getAttribute(elem) {
var i;
for (i in attributes) {
if (elem.getAttribute(attributes[i]) != null) {
attribute = attributes[i];
break
} else {
attribute = undefined;
}
i += 1;
}
if (attribute == undefined) {
gridindex = String(elem.getAttribute("gridindex"));
console.log("%cFocus event: Calling element with id: " + gridindex, "color:orange;");
} else {
gridindex = String(elem.getAttribute(attribute));
}
}
function getIndex(elem) {
if (attribute == undefined) {
gridindex = String(elem.getAttribute("gridindex"));
if (gridindex == "null") {
getAttribute(elem);
} else {
console.log("%cFocus event: Calling element with id: " + gridindex, "color:orange;");<|fim▁hole|>}
function down() {
var elem, col, row;
var navelem = false;
var tmp = gridindex.split("-");
col = parseInt(tmp[0]);
row = parseInt(tmp[1]);
row += 1;
while (true) {
elem = getElem(col, row);
console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;");
if (elem != undefined) {
if (elem.parentNode.parentNode.className.indexOf("nav-children") > -1 ) {
elem.parentNode.parentNode.style.display = "block";
navigationItem = elem.parentNode.parentNode;
navelem = true;
} else {
if (navigationItem != undefined) {
navigationItem.style = "";
}
}
if (elem.offsetHeight > 0 || navelem) {
elem.focus();
gridindex = String(col) + "-" + String(row);
navelem = false;
break;
} else {
row += 1;
}
} else {
lastGridindex_col[String(col)] = String(row);
col += 1;
if (getElem(col, 1) != null) {
gridindex = String(col) + "-0";
down();
}
break;
}
}
}
function up() {
var elem, col, row;
var tmp = gridindex.split("-");
col = parseInt(tmp[0]);
row = parseInt(tmp[1]);
row -= 1;
while (true) {
elem = getElem(col, row);
console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;");
if (elem != undefined) {
if (elem.parentNode.parentNode.className.indexOf("nav-children") > -1 ) {
elem.parentNode.parentNode.style.display = "block";
navigationItem = elem.parentNode.parentNode;
navelem = true;
} else {
if (navigationItem != undefined) {
navigationItem.style = "";
}
}
if (elem.offsetHeight > 0) {
elem.focus();
gridindex = String(col) + "-" + String(row);
break;
} else {
row -= 1;
}
} else {
if (getElem(col-1, 1) != null) {
if (lastGridindex_col[String(col-1)] == undefined) {
lastGridindex_col[String(col-1)] = "1";
}
gridindex = String(col-1) + "-" + lastGridindex_col[String(col-1)];
if (lastGridindex_col[String(col-1)] == 1) {
gridindex = String(col-1) + "-" + String(parseInt(lastGridindex_col[String(col-1)])+1);
}
up();
}
break;
}
}
}
function left() {
var elem, col, row;
var tmp = gridindex.split("-");
col = parseInt(tmp[0]);
row = parseInt(tmp[1]);
col -= 1;
while (true) {
elem = getElem(col, row);
console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;");
if (elem != undefined) {
if (elem.offsetHeight > 0) {
elem.focus();
gridindex = String(col) + "-" + String(row);
break;
} else {
col -= 1;
}
} else {
col += 1;
break;
}
}
}
function right() {
var elem, col, row;
var tmp = gridindex.split("-");
col = parseInt(tmp[0]);
row = parseInt(tmp[1]);
col += 1;
while (true) {
elem = getElem(col, row);
console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;");
if (elem != undefined) {
if (elem.offsetHeight > 0) {
elem.focus();
gridindex = String(col) + "-" + String(row);
break;
} else {
col += 1;
}
} else {
col -= 1;
break;
}
}
}
document.body.addEventListener("keydown", function(event) {
var key = event.keyCode || event.which;
if (event.altKey) {
var col, row;
if (key == 78) { // key 'n'
// activate/deactivate navigation (toggling)
if (navigationActive) {
// deactivate navigation
attribute = undefined;
navigationActive = false;
gridindex = backupGridindex;
row = gridindex.split("-");
col = parseInt(row[0]);
row = parseInt(row[1]);
getElem(col, row).focus();
} else {
// activate navigation
attribute = "nav-gridindex";
navigationActive = true;
backupGridindex = gridindex;
gridindex = "1-1";
row = gridindex.split("-");
col = parseInt(row[0]);
row = parseInt(row[1]);
getElem(col, row).focus();
}
} else if (key == 27) { // escape
// escape key
attribute = undefined;
navigationActive = false;
gridindex = backupGridindex;
row = gridindex.split("-");
col = parseInt(row[0]);
row = parseInt(row[1]);
getElem(col, row).focus();
}
} else {
if (key == 38 || key == 121) { // arrow up, F10
up();
event.preventDefault();
} else if (key == 40 || key == 120) { // arrow down, F9
down();
event.preventDefault();
} else if (key == 37 || key == 122) { // arrow left, F11
left();
event.preventDefault();
} else if (key == 39 || key == 123) { // arrow right, F12
right();
event.preventDefault();
}
}
})
getElem(1, 2).focus();<|fim▁end|> | }
} else {
getAttribute(elem);
} |
<|file_name|>dataset.py<|end_file_name|><|fim▁begin|># Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
import ROOT
from . import log; log = log[__name__]
from .. import QROOT, asrootpy
from ..base import NamedObject
from ..extern.six import string_types
__all__ = [
'DataSet',
]
class DataSet(NamedObject, QROOT.RooDataSet):
_ROOT = QROOT.RooDataSet
class Entry(object):
def __init__(self, idx, dataset):
self.idx_ = idx
self.dataset_ = dataset
@property
def fields(self):
return asrootpy(self.dataset_.get(self.idx_))
@property
def weight(self):
self.dataset_.get(self.idx_) #set current event
return self.dataset_.weight()
def __len__(self):
return self.numEntries()
def __getitem__(self, idx):
return DataSet.Entry(idx, self)
<|fim▁hole|> for idx in range(len(self)):
yield DataSet.Entry(idx, self)
def createHistogram(self, *args, **kwargs):
if args and isinstance(args[0], string_types):
return ROOT.RooAbsData.createHistogram(self, *args, **kwargs)
return super(DataSet, self).createHistogram(*args, **kwargs)
def reduce(self, *args, **kwargs):
return asrootpy(super(DataSet, self).reduce(*args, **kwargs))<|fim▁end|> | def __iter__(self): |
<|file_name|>svg2js.js<|end_file_name|><|fim▁begin|>'use strict';
var SAX = require('sax'),
JSAPI = require('./jsAPI');
var config = {
strict: true,
trim: false,
normalize: true,
lowercase: true,
xmlns: true,
position: false
};
/**
* Convert SVG (XML) string to SVG-as-JS object.
*
* @param {String} data input data
* @param {Function} callback
*/
module.exports = function(data, callback) {
var sax = SAX.parser(config.strict, config),
root = new JSAPI({ elem: '#document' }),
current = root,
stack = [root],
textContext = null;
function pushToContent(content) {
content = new JSAPI(content, current);
(current.content = current.content || []).push(content);
return content;
}
sax.ondoctype = function(doctype) {
pushToContent({
doctype: doctype
});
};
sax.onprocessinginstruction = function(data) {
pushToContent({
processinginstruction: data
});
};
sax.oncomment = function(comment) {
pushToContent({
comment: comment.trim()
});
};
sax.oncdata = function(cdata) {
pushToContent({
cdata: cdata
});
};
sax.onopentag = function(data) {
var elem = {
elem: data.name,
prefix: data.prefix,
local: data.local
};
if (Object.keys(data.attributes).length) {
elem.attrs = {};
for (var name in data.attributes) {
elem.attrs[name] = {
name: name,
value: data.attributes[name].value,
prefix: data.attributes[name].prefix,
local: data.attributes[name].local
};
}
}
elem = pushToContent(elem);
current = elem;
// Save info about <text> tag to prevent trimming of meaningful whitespace
if (data.name == 'text' && !data.prefix) {
textContext = current;
}
stack.push(elem);
};
sax.ontext = function(text) {
if (/\S/.test(text) || textContext) {
if (!textContext)
text = text.trim();
pushToContent({
text: text
});
}
};
<|fim▁hole|> var last = stack.pop();
// Trim text inside <text> tag.
if (last == textContext) {
trim(textContext);
textContext = null;
}
current = stack[stack.length - 1];
};
sax.onerror = function(e) {
callback({ error: 'Error in parsing: ' + e.message });
};
sax.onend = function() {
callback(root);
};
sax.write(data).close();
function trim(elem) {
if (!elem.content) return elem;
var start = elem.content[0],
end = elem.content[elem.content.length - 1];
while (start && !start.text) start = start.content[0];
if (start) start.text = start.text.replace(/^\s+/, '');
while (end && !end.text) end = end.content[end.content.length - 1];
if (end) end.text = end.text.replace(/\s+$/, '');
return elem;
}
};<|fim▁end|> | sax.onclosetag = function() {
|
<|file_name|>cache.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package controllers
import (<|fim▁hole|> utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/cache"
)
// WaitForCacheSync is a wrapper around cache.WaitForCacheSync that generates log messages
// indicating that the controller identified by controllerName is waiting for syncs, followed by
// either a successful or failed sync.
func WaitForCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...cache.InformerSynced) bool {
glog.Infof("Waiting for caches to sync for %s controller", controllerName)
if !cache.WaitForCacheSync(stopCh, cacheSyncs...) {
utilruntime.HandleError(fmt.Errorf("Unable to sync caches for %s controller", controllerName))
return false
}
glog.Infof("Caches are synced for %s controller", controllerName)
return true
}<|fim▁end|> | "fmt"
"github.com/golang/glog"
|
<|file_name|>color_button.rs<|end_file_name|><|fim▁begin|>// Copyright 2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use ColorButton;
use Widget;
use ffi;
use gdk;
use glib::object::Downcast;
use glib::translate::*;
use std::mem;
impl ColorButton {
pub fn new_with_color(color: &gdk::Color) -> ColorButton {
assert_initialized_main_thread!();
unsafe {<|fim▁hole|>
pub fn new_with_rgba(rgba: &gdk::RGBA) -> ColorButton {
assert_initialized_main_thread!();
unsafe {
Widget::from_glib_none(ffi::gtk_color_button_new_with_rgba(rgba)).downcast_unchecked()
}
}
pub fn get_color(&self) -> gdk::Color {
unsafe {
let mut color = mem::uninitialized();
ffi::gtk_color_button_get_color(self.to_glib_none().0, &mut color);
color
}
}
pub fn get_rgba(&self) -> gdk::RGBA {
unsafe {
let mut rgba = mem::uninitialized();
ffi::gtk_color_button_get_rgba(self.to_glib_none().0, &mut rgba);
rgba
}
}
pub fn set_color(&self, color: &gdk::Color) {
unsafe { ffi::gtk_color_button_set_color(self.to_glib_none().0, color) }
}
pub fn set_rgba(&self, rgba: &gdk::RGBA) {
unsafe { ffi::gtk_color_button_set_rgba(self.to_glib_none().0, rgba) }
}
}<|fim▁end|> | Widget::from_glib_none(ffi::gtk_color_button_new_with_color(color)).downcast_unchecked()
}
} |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [email protected], All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#<|fim▁hole|># This program 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 terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class RLeaflet(RPackage):
"""Create and customize interactive maps using the 'Leaflet' JavaScript
library and the 'htmlwidgets' package. These maps can be used directly from
the R console, from 'RStudio', in Shiny apps and R Markdown documents."""
homepage = "http://rstudio.github.io/leaflet/"
url = "https://cran.r-project.org/src/contrib/leaflet_1.0.1.tar.gz"
version('1.0.1', '7f3d8b17092604d87d4eeb579f73d5df')
depends_on('r-base64enc', type=('build', 'run'))
depends_on('r-htmlwidgets', type=('build', 'run'))
depends_on('r-htmltools', type=('build', 'run'))
depends_on('r-magrittr', type=('build', 'run'))
depends_on('r-markdown', type=('build', 'run'))
depends_on('r-png', type=('build', 'run'))
depends_on('r-rcolorbrewer', type=('build', 'run'))
depends_on('r-raster', type=('build', 'run'))
depends_on('r-scales', type=('build', 'run'))
depends_on('r-sp', type=('build', 'run'))<|fim▁end|> | |
<|file_name|>pidlimit.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Ceph-CSI Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"strconv"
"strings"
)
const (
procCgroup = "/proc/self/cgroup"
sysPidsMaxFmt = "/sys/fs/cgroup/pids%s/pids.max"
)
// return the cgouprs "pids.max" file of the current process
//
// find the line containing the pids group from the /proc/self/cgroup file
// $ grep 'pids' /proc/self/cgroup
// 7:pids:/kubepods.slice/kubepods-besteffort.slice/....scope
// $ cat /sys/fs/cgroup/pids + *.scope + /pids.max.
func getCgroupPidsFile() (string, error) {
cgroup, err := os.Open(procCgroup)
if err != nil {
return "", err
}
defer cgroup.Close() // #nosec: error on close is not critical here
scanner := bufio.NewScanner(cgroup)
var slice string
for scanner.Scan() {
parts := strings.SplitN(scanner.Text(), ":", 3)
if parts == nil || len(parts) < 3 {
continue
}
if parts[1] == "pids" {
slice = parts[2]
break
}
}
if slice == "" {
return "", fmt.Errorf("could not find a cgroup for 'pids'")
}
pidsMax := fmt.Sprintf(sysPidsMaxFmt, slice)
return pidsMax, nil
}
// GetPIDLimit returns the current PID limit, or an error. A value of -1
// translates to "max".
func GetPIDLimit() (int, error) {
pidsMax, err := getCgroupPidsFile()
if err != nil {
return 0, err
}
f, err := os.Open(pidsMax) // #nosec - intended reading from /sys/...
if err != nil {
return 0, err
}
defer f.Close() // #nosec: error on close is not critical here
maxPidsStr, err := bufio.NewReader(f).ReadString('\n')
if err != nil && !errors.Is(err, io.EOF) {
return 0, err
}
maxPidsStr = strings.TrimRight(maxPidsStr, "\n")
maxPids := -1
if maxPidsStr != "max" {
maxPids, err = strconv.Atoi(maxPidsStr)
if err != nil {
return 0, err
}
}
return maxPids, nil
}
// SetPIDLimit configures the given PID limit for the current process. A value
// of -1 translates to "max".
func SetPIDLimit(limit int) error {
limitStr := "max"
if limit != -1 {
limitStr = fmt.Sprintf("%d", limit)
}
pidsMax, err := getCgroupPidsFile()
if err != nil {
return err
}
f, err := os.Create(pidsMax)
if err != nil {
return err
}
_, err = f.WriteString(limitStr)
if err != nil {
f.Close() // #nosec: a write error will be more useful to return
return err
}<|fim▁hole|><|fim▁end|> |
return f.Close()
} |
<|file_name|>extendedHand.py<|end_file_name|><|fim▁begin|>import math
from math import *
#We have put this in the same order as the types in the LeapSDK.
finger_names = ['thumb', 'index', 'middle', 'ring', 'pinky']
'''
Function that returns the palm orientation
@hand: the hand that we're analysing.
'''
def palmOrientation (hand):
palmNormal = hand.palm_normal
y = palmNormal[1]
x = palmNormal[0]
#We have divided the unit sphere in four quadrants and we check the palm_normal's quadrant
if cos(math.pi/4) <= y and y <= 1:
return 'up'
elif -1 <= y and y <= cos(3*math.pi/4):
return 'down'
elif x > 0:
return 'right'
else:
return 'left'
'''
Function that returns a finger from a hand.
@hand: the hand whose finger we want to get.
@finger_type: the finger that we want to get.
'''
def getFinger(hand, finger_type):
#We try to find the finger in the hand.
for finger in hand.fingers:<|fim▁hole|>Function that returns the tip position of the selected finger
@hand: the hand that we're analysing
@finger_type: the finger whose tip's position we want to get
'''
def getTipPosition(hand, finger_type):
finger = getFinger(hand, finger_type)
return finger.bone(3).next_joint<|fim▁end|> | if finger_type == finger_names[finger.type]:
return finger
''' |
<|file_name|>ng-map.no-dependency.js<|end_file_name|><|fim▁begin|>(function(root, factory) {
if (typeof exports === "object") {
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
define([], factory);
} else{
factory();
}
}(this, function() {
/**
* AngularJS Google Maps Ver. 1.18.4
*
* The MIT License (MIT)
*
* Copyright (c) 2014, 2015, 1016 Allen Kim
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
angular.module('ngMap', []);
/**
* @ngdoc controller
* @name MapController
*/
(function() {
'use strict';
var Attr2MapOptions;
var __MapController = function(
$scope, $element, $attrs, $parse, $interpolate, _Attr2MapOptions_, NgMap, NgMapPool, escapeRegExp
) {
Attr2MapOptions = _Attr2MapOptions_;
var vm = this;
var exprStartSymbol = $interpolate.startSymbol();
var exprEndSymbol = $interpolate.endSymbol();
vm.mapOptions; /** @memberof __MapController */
vm.mapEvents; /** @memberof __MapController */
vm.eventListeners; /** @memberof __MapController */
/**
* Add an object to the collection of group
* @memberof __MapController
* @function addObject
* @param groupName the name of collection that object belongs to
* @param obj an object to add into a collection, i.e. marker, shape
*/
vm.addObject = function(groupName, obj) {
if (vm.map) {
vm.map[groupName] = vm.map[groupName] || {};
var len = Object.keys(vm.map[groupName]).length;
vm.map[groupName][obj.id || len] = obj;
if (vm.map instanceof google.maps.Map) {
//infoWindow.setMap works like infoWindow.open
if (groupName != "infoWindows" && obj.setMap) {
obj.setMap && obj.setMap(vm.map);
}
if (obj.centered && obj.position) {
vm.map.setCenter(obj.position);
}
(groupName == 'markers') && vm.objectChanged('markers');
(groupName == 'customMarkers') && vm.objectChanged('customMarkers');
}
}
};
/**
* Delete an object from the collection and remove from map
* @memberof __MapController
* @function deleteObject
* @param {Array} objs the collection of objects. i.e., map.markers
* @param {Object} obj the object to be removed. i.e., marker
*/
vm.deleteObject = function(groupName, obj) {
/* delete from group */
if (obj.map) {
var objs = obj.map[groupName];
for (var name in objs) {
if (objs[name] === obj) {
void 0;
google.maps.event.clearInstanceListeners(obj);
delete objs[name];
}
}
/* delete from map */
obj.map && obj.setMap && obj.setMap(null);
(groupName == 'markers') && vm.objectChanged('markers');
(groupName == 'customMarkers') && vm.objectChanged('customMarkers');
}
};
/**
* @memberof __MapController
* @function observeAttrSetObj
* @param {Hash} orgAttrs attributes before its initialization
* @param {Hash} attrs attributes after its initialization
* @param {Object} obj map object that an action is to be done
* @description watch changes of attribute values and
* do appropriate action based on attribute name
*/
vm.observeAttrSetObj = function(orgAttrs, attrs, obj) {
if (attrs.noWatcher) {
return false;
}
var attrsToObserve = Attr2MapOptions.getAttrsToObserve(orgAttrs);
for (var i=0; i<attrsToObserve.length; i++) {
var attrName = attrsToObserve[i];
attrs.$observe(attrName, NgMap.observeAndSet(attrName, obj));
}
};
/**
* @memberof __MapController
* @function zoomToIncludeMarkers
*/
vm.zoomToIncludeMarkers = function() {
// Only fit to bounds if we have any markers
// object.keys is supported in all major browsers (IE9+)
if ((vm.map.markers != null && Object.keys(vm.map.markers).length > 0) || (vm.map.customMarkers != null && Object.keys(vm.map.customMarkers).length > 0)) {
var bounds = new google.maps.LatLngBounds();
for (var k1 in vm.map.markers) {
bounds.extend(vm.map.markers[k1].getPosition());
}
for (var k2 in vm.map.customMarkers) {
bounds.extend(vm.map.customMarkers[k2].getPosition());
}
if (vm.mapOptions.maximumZoom) {
vm.enableMaximumZoomCheck = true; //enable zoom check after resizing for markers
}
vm.map.fitBounds(bounds);
}
};
/**
* @memberof __MapController
* @function objectChanged
* @param {String} group name of group e.g., markers
*/
vm.objectChanged = function(group) {
if ( vm.map &&
(group == 'markers' || group == 'customMarkers') &&
vm.map.zoomToIncludeMarkers == 'auto'
) {
vm.zoomToIncludeMarkers();
}
};
/**
* @memberof __MapController
* @function initializeMap
* @description
* . initialize Google map on <div> tag
* . set map options, events, and observers
* . reset zoom to include all (custom)markers
*/
vm.initializeMap = function() {
var mapOptions = vm.mapOptions,
mapEvents = vm.mapEvents;
var lazyInitMap = vm.map; //prepared for lazy init
vm.map = NgMapPool.getMapInstance($element[0]);
NgMap.setStyle($element[0]);
// set objects for lazyInit
if (lazyInitMap) {
/**
* rebuild mapOptions for lazyInit
* because attributes values might have been changed
*/
var filtered = Attr2MapOptions.filter($attrs);
var options = Attr2MapOptions.getOptions(filtered);
var controlOptions = Attr2MapOptions.getControlOptions(filtered);
mapOptions = angular.extend(options, controlOptions);
void 0;
for (var group in lazyInitMap) {
var groupMembers = lazyInitMap[group]; //e.g. markers
if (typeof groupMembers == 'object') {
for (var id in groupMembers) {
vm.addObject(group, groupMembers[id]);
}
}
}
vm.map.showInfoWindow = vm.showInfoWindow;
vm.map.hideInfoWindow = vm.hideInfoWindow;
}
// set options
mapOptions.zoom = mapOptions.zoom || 15;
var center = mapOptions.center;
var exprRegExp = new RegExp(escapeRegExp(exprStartSymbol) + '.*' + escapeRegExp(exprEndSymbol));
if (!mapOptions.center ||
((typeof center === 'string') && center.match(exprRegExp))
) {
mapOptions.center = new google.maps.LatLng(0, 0);
} else if( (typeof center === 'string') && center.match(/^[0-9.-]*,[0-9.-]*$/) ){
var lat = parseFloat(center.split(',')[0]);
var lng = parseFloat(center.split(',')[1]);
mapOptions.center = new google.maps.LatLng(lat, lng);
} else if (!(center instanceof google.maps.LatLng)) {
var geoCenter = mapOptions.center;
delete mapOptions.center;
NgMap.getGeoLocation(geoCenter, mapOptions.geoLocationOptions).
then(function (latlng) {
vm.map.setCenter(latlng);
var geoCallback = mapOptions.geoCallback;
geoCallback && $parse(geoCallback)($scope);
}, function () {
if (mapOptions.geoFallbackCenter) {
vm.map.setCenter(mapOptions.geoFallbackCenter);
}
});
}
vm.map.setOptions(mapOptions);
// set events
for (var eventName in mapEvents) {
var event = mapEvents[eventName];
var listener = google.maps.event.addListener(vm.map, eventName, event);
vm.eventListeners[eventName] = listener;
}
// set observers
vm.observeAttrSetObj(orgAttrs, $attrs, vm.map);
vm.singleInfoWindow = mapOptions.singleInfoWindow;
google.maps.event.trigger(vm.map, 'resize');
google.maps.event.addListenerOnce(vm.map, "idle", function () {
NgMap.addMap(vm);
if (mapOptions.zoomToIncludeMarkers) {
vm.zoomToIncludeMarkers();
}
//TODO: it's for backward compatibiliy. will be removed
$scope.map = vm.map;
$scope.$emit('mapInitialized', vm.map);
//callback
if ($attrs.mapInitialized) {
$parse($attrs.mapInitialized)($scope, {map: vm.map});
}
});
//add maximum zoom listeners if zoom-to-include-markers and and maximum-zoom are valid attributes
if (mapOptions.zoomToIncludeMarkers && mapOptions.maximumZoom) {
google.maps.event.addListener(vm.map, 'zoom_changed', function() {
if (vm.enableMaximumZoomCheck == true) {
vm.enableMaximumZoomCheck = false;
google.maps.event.addListenerOnce(vm.map, 'bounds_changed', function() {
vm.map.setZoom(Math.min(mapOptions.maximumZoom, vm.map.getZoom()));
});
}
});
}
};
$scope.google = google; //used by $scope.eval to avoid eval()
/**
* get map options and events
*/
var orgAttrs = Attr2MapOptions.orgAttributes($element);
var filtered = Attr2MapOptions.filter($attrs);
var options = Attr2MapOptions.getOptions(filtered, {scope: $scope});
var controlOptions = Attr2MapOptions.getControlOptions(filtered);
var mapOptions = angular.extend(options, controlOptions);
var mapEvents = Attr2MapOptions.getEvents($scope, filtered);
void 0;
Object.keys(mapEvents).length && void 0;
vm.mapOptions = mapOptions;
vm.mapEvents = mapEvents;
vm.eventListeners = {};
if (options.lazyInit) { // allows controlled initialization
// parse angular expression for dynamic ids
if (!!$attrs.id &&
// starts with, at position 0
$attrs.id.indexOf(exprStartSymbol, 0) === 0 &&
// ends with
$attrs.id.indexOf(exprEndSymbol, $attrs.id.length - exprEndSymbol.length) !== -1) {
var idExpression = $attrs.id.slice(2,-2);
var mapId = $parse(idExpression)($scope);
} else {
var mapId = $attrs.id;
}
vm.map = {id: mapId}; //set empty, not real, map
NgMap.addMap(vm);
} else {
vm.initializeMap();
}
//Trigger Resize
if(options.triggerResize) {
google.maps.event.trigger(vm.map, 'resize');
}
$element.bind('$destroy', function() {
NgMapPool.returnMapInstance(vm.map);
NgMap.deleteMap(vm);
});
}; // __MapController
__MapController.$inject = [
'$scope', '$element', '$attrs', '$parse', '$interpolate', 'Attr2MapOptions', 'NgMap', 'NgMapPool', 'escapeRegexpFilter'
];
angular.module('ngMap').controller('__MapController', __MapController);
})();
/**
* @ngdoc directive
* @name bicycling-layer
* @param Attr2Options {service}
* convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
*
* <map zoom="13" center="34.04924594193164, -118.24104309082031">
* <bicycling-layer></bicycling-layer>
* </map>
*/
(function() {
'use strict';
var parser;
var linkFunc = function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
void 0;
var layer = getLayer(options, events);
mapController.addObject('bicyclingLayers', layer);
mapController.observeAttrSetObj(orgAttrs, attrs, layer); //observers
element.bind('$destroy', function() {
mapController.deleteObject('bicyclingLayers', layer);
});
};
var getLayer = function(options, events) {
var layer = new google.maps.BicyclingLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
var bicyclingLayer= function(Attr2MapOptions) {
parser = Attr2MapOptions;
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: linkFunc
};
};
bicyclingLayer.$inject = ['Attr2MapOptions'];
angular.module('ngMap').directive('bicyclingLayer', bicyclingLayer);
})();
/**
* @ngdoc directive
* @name custom-control
* @param Attr2Options {service} convert html attribute to Google map api options
* @param $compile {service} AngularJS $compile service
* @description
* Build custom control and set to the map with position
*
* Requires: map directive
*
* Restrict To: Element
*
* @attr {String} position position of this control
* i.e. TOP_RIGHT
* @attr {Number} index index of the control
* @example
*
* Example:
* <map center="41.850033,-87.6500523" zoom="3">
* <custom-control id="home" position="TOP_LEFT" index="1">
* <div style="background-color: white;">
* <b>Home</b>
* </div>
* </custom-control>
* </map>
*
*/
(function() {
'use strict';
var parser, NgMap;
var linkFunc = function(scope, element, attrs, mapController, $transclude) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
/**
* build a custom control element
*/
var customControlEl = element[0].parentElement.removeChild(element[0]);
var content = $transclude();
angular.element(customControlEl).append(content);
/**
* set events
*/
for (var eventName in events) {
google.maps.event.addDomListener(customControlEl, eventName, events[eventName]);
}
mapController.addObject('customControls', customControlEl);
var position = options.position;
mapController.map.controls[google.maps.ControlPosition[position]].push(customControlEl);
element.bind('$destroy', function() {
mapController.deleteObject('customControls', customControlEl);
});
};
var customControl = function(Attr2MapOptions, _NgMap_) {
parser = Attr2MapOptions, NgMap = _NgMap_;
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: linkFunc,
transclude: true
}; // return
};
customControl.$inject = ['Attr2MapOptions', 'NgMap'];
angular.module('ngMap').directive('customControl', customControl);
})();
/**
* @ngdoc directive
* @memberof ngmap
* @name custom-marker
* @param Attr2Options {service} convert html attribute to Google map api options
* @param $timeout {service} AngularJS $timeout
* @description
* Marker with html
* Requires: map directive
* Restrict To: Element
*
* @attr {String} position required, position on map
* @attr {Number} z-index optional
* @attr {Boolean} visible optional
* @example
*
* Example:
* <map center="41.850033,-87.6500523" zoom="3">
* <custom-marker position="41.850033,-87.6500523">
* <div>
* <b>Home</b>
* </div>
* </custom-marker>
* </map>
*
*/
/* global document */
(function() {
'use strict';
var parser, $timeout, $compile, NgMap;
var CustomMarker = function(options) {
options = options || {};
this.el = document.createElement('div');
this.el.style.display = 'inline-block';
this.el.style.visibility = "hidden";
this.visible = true;
for (var key in options) { /* jshint ignore:line */
this[key] = options[key];
}
};
var setCustomMarker = function() {
CustomMarker.prototype = new google.maps.OverlayView();
CustomMarker.prototype.setContent = function(html, scope) {
this.el.innerHTML = html;
this.el.style.position = 'absolute';
if (scope) {
$compile(angular.element(this.el).contents())(scope);
}
};
CustomMarker.prototype.getDraggable = function() {
return this.draggable;
};
CustomMarker.prototype.setDraggable = function(draggable) {
this.draggable = draggable;
};
CustomMarker.prototype.getPosition = function() {
return this.position;
};
CustomMarker.prototype.setPosition = function(position) {
position && (this.position = position); /* jshint ignore:line */
var _this = this;
if (this.getProjection() && typeof this.position.lng == 'function') {
void 0;
var setPosition = function() {
if (!_this.getProjection()) { return; }
var posPixel = _this.getProjection().fromLatLngToDivPixel(_this.position);
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
_this.el.style.left = x + "px";
_this.el.style.top = y + "px";
_this.el.style.visibility = "visible";
};
if (_this.el.offsetWidth && _this.el.offsetHeight) {
setPosition();
} else {
//delayed left/top calculation when width/height are not set instantly
$timeout(setPosition, 300);
}
}
};
CustomMarker.prototype.setZIndex = function(zIndex) {
zIndex && (this.zIndex = zIndex); /* jshint ignore:line */
this.el.style.zIndex = this.zIndex;
};
CustomMarker.prototype.getVisible = function() {
return this.visible;
};
CustomMarker.prototype.setVisible = function(visible) {
this.el.style.display = visible ? 'inline-block' : 'none';
this.visible = visible;
};
CustomMarker.prototype.addClass = function(className) {
var classNames = this.el.className.trim().split(' ');
(classNames.indexOf(className) == -1) && classNames.push(className); /* jshint ignore:line */
this.el.className = classNames.join(' ');
};
CustomMarker.prototype.removeClass = function(className) {
var classNames = this.el.className.split(' ');
var index = classNames.indexOf(className);
(index > -1) && classNames.splice(index, 1); /* jshint ignore:line */
this.el.className = classNames.join(' ');
};
CustomMarker.prototype.onAdd = function() {
this.getPanes().overlayMouseTarget.appendChild(this.el);
};
CustomMarker.prototype.draw = function() {
this.setPosition();
this.setZIndex(this.zIndex);
this.setVisible(this.visible);
};
CustomMarker.prototype.onRemove = function() {
this.el.parentNode.removeChild(this.el);
//this.el = null;
};
};
var linkFunc = function(orgHtml, varsToWatch) {
//console.log('orgHtml', orgHtml, 'varsToWatch', varsToWatch);
return function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
/**
* build a custom marker element
*/
element[0].style.display = 'none';
void 0;
var customMarker = new CustomMarker(options);
$timeout(function() { //apply contents, class, and location after it is compiled
scope.$watch('[' + varsToWatch.join(',') + ']', function() {
customMarker.setContent(orgHtml, scope);
}, true);
customMarker.setContent(element[0].innerHTML, scope);
var classNames = element[0].firstElementChild.className;
customMarker.addClass('custom-marker');
customMarker.addClass(classNames);
void 0;
if (!(options.position instanceof google.maps.LatLng)) {
NgMap.getGeoLocation(options.position).then(
function(latlng) {
customMarker.setPosition(latlng);
}
);
}
});
void 0;
for (var eventName in events) { /* jshint ignore:line */
google.maps.event.addDomListener(
customMarker.el, eventName, events[eventName]);
}
mapController.addObject('customMarkers', customMarker);
//set observers
mapController.observeAttrSetObj(orgAttrs, attrs, customMarker);
element.bind('$destroy', function() {
//Is it required to remove event listeners when DOM is removed?
mapController.deleteObject('customMarkers', customMarker);
});
}; // linkFunc
};
var customMarkerDirective = function(
_$timeout_, _$compile_, $interpolate, Attr2MapOptions, _NgMap_, escapeRegExp
) {
parser = Attr2MapOptions;
$timeout = _$timeout_;
$compile = _$compile_;
NgMap = _NgMap_;
var exprStartSymbol = $interpolate.startSymbol();
var exprEndSymbol = $interpolate.endSymbol();
var exprRegExp = new RegExp(escapeRegExp(exprStartSymbol) + '([^' + exprEndSymbol.substring(0, 1) + ']+)' + escapeRegExp(exprEndSymbol), 'g');
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
compile: function(element) {
setCustomMarker();
element[0].style.display ='none';
var orgHtml = element.html();
var matches = orgHtml.match(exprRegExp);
var varsToWatch = [];
//filter out that contains '::', 'this.'
(matches || []).forEach(function(match) {
var toWatch = match.replace(exprStartSymbol,'').replace(exprEndSymbol,'');
if (match.indexOf('::') == -1 &&
match.indexOf('this.') == -1 &&
varsToWatch.indexOf(toWatch) == -1) {
varsToWatch.push(match.replace(exprStartSymbol,'').replace(exprEndSymbol,''));
}
});
return linkFunc(orgHtml, varsToWatch);
}
}; // return
};// function
customMarkerDirective.$inject =
['$timeout', '$compile', '$interpolate', 'Attr2MapOptions', 'NgMap', 'escapeRegexpFilter'];
angular.module('ngMap').directive('customMarker', customMarkerDirective);
})();
/**
* @ngdoc directive
* @name directions
* @description
* Enable directions on map.
* e.g., origin, destination, draggable, waypoints, etc
*
* Requires: map directive
*
* Restrict To: Element
*
* @attr {String} DirectionsRendererOptions
* [Any DirectionsRendererOptions](https://developers.google.com/maps/documentation/javascript/reference#DirectionsRendererOptions)
* @attr {String} DirectionsRequestOptions
* [Any DirectionsRequest options](https://developers.google.com/maps/documentation/javascript/reference#DirectionsRequest)
* @example
* <map zoom="14" center="37.7699298, -122.4469157">
* <directions
* draggable="true"
* panel="directions-panel"
* travel-mode="{{travelMode}}"
* waypoints="[{location:'kingston', stopover:true}]"
* origin="{{origin}}"
* destination="{{destination}}">
* </directions>
* </map>
*/
/* global document */
(function() {
'use strict';
var NgMap, $timeout, NavigatorGeolocation;
var getDirectionsRenderer = function(options, events) {
if (options.panel) {
options.panel = document.getElementById(options.panel) ||
document.querySelector(options.panel);
}
var renderer = new google.maps.DirectionsRenderer(options);
for (var eventName in events) {
google.maps.event.addListener(renderer, eventName, events[eventName]);
}
return renderer;
};
var updateRoute = function(renderer, options) {
var directionsService = new google.maps.DirectionsService();
/* filter out valid keys only for DirectionsRequest object*/
var request = options;
request.travelMode = request.travelMode || 'DRIVING';
var validKeys = [
'origin', 'destination', 'travelMode', 'transitOptions', 'unitSystem',
'durationInTraffic', 'waypoints', 'optimizeWaypoints',
'provideRouteAlternatives', 'avoidHighways', 'avoidTolls', 'region'
];
for(var key in request){
(validKeys.indexOf(key) === -1) && (delete request[key]);
}
if(request.waypoints) {
// Check fo valid values
if(request.waypoints == "[]" || request.waypoints === "") {
delete request.waypoints;
}
}
var showDirections = function(request) {
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
$timeout(function() {
renderer.setDirections(response);
});
}
});
};
if (request.origin && request.destination) {
if (request.origin == 'current-location') {
NavigatorGeolocation.getCurrentPosition().then(function(ll) {
request.origin = new google.maps.LatLng(ll.coords.latitude, ll.coords.longitude);
showDirections(request);
});
} else if (request.destination == 'current-location') {
NavigatorGeolocation.getCurrentPosition().then(function(ll) {
request.destination = new google.maps.LatLng(ll.coords.latitude, ll.coords.longitude);
showDirections(request);
});
} else {
showDirections(request);
}
}
};
var directions = function(
Attr2MapOptions, _$timeout_, _NavigatorGeolocation_, _NgMap_) {
var parser = Attr2MapOptions;
NgMap = _NgMap_;
$timeout = _$timeout_;
NavigatorGeolocation = _NavigatorGeolocation_;
var linkFunc = function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
var attrsToObserve = parser.getAttrsToObserve(orgAttrs);
var renderer = getDirectionsRenderer(options, events);
mapController.addObject('directionsRenderers', renderer);
attrsToObserve.forEach(function(attrName) {
(function(attrName) {
attrs.$observe(attrName, function(val) {
if (attrName == 'panel') {
$timeout(function(){
var panel =
document.getElementById(val) || document.querySelector(val);
void 0;
panel && renderer.setPanel(panel);
});
} else if (options[attrName] !== val) { //apply only if changed
var optionValue = parser.toOptionValue(val, {key: attrName});
void 0;
options[attrName] = optionValue;
updateRoute(renderer, options);
}
});
})(attrName);
});
NgMap.getMap().then(function() {
updateRoute(renderer, options);
});
element.bind('$destroy', function() {
mapController.deleteObject('directionsRenderers', renderer);
});
};
return {
restrict: 'E',<|fim▁hole|> require: ['?^map','?^ngMap'],
link: linkFunc
};
}; // var directions
directions.$inject =
['Attr2MapOptions', '$timeout', 'NavigatorGeolocation', 'NgMap'];
angular.module('ngMap').directive('directions', directions);
})();
/**
* @ngdoc directive
* @name drawing-manager
* @param Attr2Options {service} convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
*
* <map zoom="13" center="37.774546, -122.433523" map-type-id="SATELLITE">
* <drawing-manager
* on-overlaycomplete="onMapOverlayCompleted()"
* position="ControlPosition.TOP_CENTER"
* drawingModes="POLYGON,CIRCLE"
* drawingControl="true"
* circleOptions="fillColor: '#FFFF00';fillOpacity: 1;strokeWeight: 5;clickable: false;zIndex: 1;editable: true;" >
* </drawing-manager>
* </map>
*
* TODO: Add remove button.
* currently, for our solution, we have the shapes/markers in our own
* controller, and we use some css classes to change the shape button
* to a remove button (<div>X</div>) and have the remove operation in our own controller.
*/
(function() {
'use strict';
angular.module('ngMap').directive('drawingManager', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var controlOptions = parser.getControlOptions(filtered);
var events = parser.getEvents(scope, filtered);
/**
* set options
*/
var drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: options.drawingmode,
drawingControl: options.drawingcontrol,
drawingControlOptions: controlOptions.drawingControlOptions,
circleOptions:options.circleoptions,
markerOptions:options.markeroptions,
polygonOptions:options.polygonoptions,
polylineOptions:options.polylineoptions,
rectangleOptions:options.rectangleoptions
});
//Observers
attrs.$observe('drawingControlOptions', function (newValue) {
drawingManager.drawingControlOptions = parser.getControlOptions({drawingControlOptions: newValue}).drawingControlOptions;
drawingManager.setDrawingMode(null);
drawingManager.setMap(mapController.map);
});
/**
* set events
*/
for (var eventName in events) {
google.maps.event.addListener(drawingManager, eventName, events[eventName]);
}
mapController.addObject('mapDrawingManager', drawingManager);
element.bind('$destroy', function() {
mapController.deleteObject('mapDrawingManager', drawingManager);
});
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name dynamic-maps-engine-layer
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
* <map zoom="14" center="[59.322506, 18.010025]">
* <dynamic-maps-engine-layer
* layer-id="06673056454046135537-08896501997766553811">
* </dynamic-maps-engine-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('dynamicMapsEngineLayer', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getDynamicMapsEngineLayer = function(options, events) {
var layer = new google.maps.visualization.DynamicMapsEngineLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered, events);
var layer = getDynamicMapsEngineLayer(options, events);
mapController.addObject('mapsEngineLayers', layer);
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name fusion-tables-layer
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
* <map zoom="11" center="41.850033, -87.6500523">
* <fusion-tables-layer query="{
* select: 'Geocodable address',
* from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'}">
* </fusion-tables-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('fusionTablesLayer', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getLayer = function(options, events) {
var layer = new google.maps.FusionTablesLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered, events);
void 0;
var layer = getLayer(options, events);
mapController.addObject('fusionTablesLayers', layer);
element.bind('$destroy', function() {
mapController.deleteObject('fusionTablesLayers', layer);
});
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name heatmap-layer
* @param Attr2Options {service} convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
*
* <map zoom="11" center="[41.875696,-87.624207]">
* <heatmap-layer data="taxiData"></heatmap-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('heatmapLayer', [
'Attr2MapOptions', '$window', function(Attr2MapOptions, $window) {
var parser = Attr2MapOptions;
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
/**
* set options
*/
var options = parser.getOptions(filtered, {scope: scope});
options.data = $window[attrs.data] || scope[attrs.data];
if (options.data instanceof Array) {
options.data = new google.maps.MVCArray(options.data);
} else {
throw "invalid heatmap data";
}
var layer = new google.maps.visualization.HeatmapLayer(options);
/**
* set events
*/
var events = parser.getEvents(scope, filtered);
void 0;
mapController.addObject('heatmapLayers', layer);
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name info-window
* @param Attr2MapOptions {service}
* convert html attribute to Google map api options
* @param $compile {service} $compile service
* @description
* Defines infoWindow and provides compile method
*
* Requires: map directive
*
* Restrict To: Element
*
* NOTE: this directive should **NOT** be used with `ng-repeat`
* because InfoWindow itself is a template, and a template must be
* reused by each marker, thus, should not be redefined repeatedly
* by `ng-repeat`.
*
* @attr {Boolean} visible
* Indicates to show it when map is initialized
* @attr {Boolean} visible-on-marker
* Indicates to show it on a marker when map is initialized
* @attr {Expression} geo-callback
* if position is an address, the expression is will be performed
* when geo-lookup is successful. e.g., geo-callback="showDetail()"
* @attr {String} <InfoWindowOption> Any InfoWindow options,
* https://developers.google.com/maps/documentation/javascript/reference?csw=1#InfoWindowOptions
* @attr {String} <InfoWindowEvent> Any InfoWindow events,
* https://developers.google.com/maps/documentation/javascript/reference
* @example
* Usage:
* <map MAP_ATTRIBUTES>
* <info-window id="foo" ANY_OPTIONS ANY_EVENTS"></info-window>
* </map>
*
* Example:
* <map center="41.850033,-87.6500523" zoom="3">
* <info-window id="1" position="41.850033,-87.6500523" >
* <div ng-non-bindable>
* Chicago, IL<br/>
* LatLng: {{chicago.lat()}}, {{chicago.lng()}}, <br/>
* World Coordinate: {{worldCoordinate.x}}, {{worldCoordinate.y}}, <br/>
* Pixel Coordinate: {{pixelCoordinate.x}}, {{pixelCoordinate.y}}, <br/>
* Tile Coordinate: {{tileCoordinate.x}}, {{tileCoordinate.y}} at Zoom Level {{map.getZoom()}}
* </div>
* </info-window>
* </map>
*/
/* global google */
(function() {
'use strict';
var infoWindow = function(Attr2MapOptions, $compile, $q, $templateRequest, $timeout, $parse, NgMap) {
var parser = Attr2MapOptions;
var getInfoWindow = function(options, events, element) {
var infoWindow;
/**
* set options
*/
if (options.position && !(options.position instanceof google.maps.LatLng)) {
delete options.position;
}
infoWindow = new google.maps.InfoWindow(options);
/**
* set events
*/
for (var eventName in events) {
if (eventName) {
google.maps.event.addListener(infoWindow, eventName, events[eventName]);
}
}
/**
* set template and template-related functions
* it must have a container element with ng-non-bindable
*/
var templatePromise = $q(function(resolve) {
if (angular.isString(element)) {
$templateRequest(element).then(function (requestedTemplate) {
resolve(angular.element(requestedTemplate).wrap('<div>').parent());
}, function(message) {
throw "info-window template request failed: " + message;
});
}
else {
resolve(element);
}
}).then(function(resolvedTemplate) {
var template = resolvedTemplate.html().trim();
if (angular.element(template).length != 1) {
throw "info-window working as a template must have a container";
}
infoWindow.__template = template.replace(/\s?ng-non-bindable[='"]+/,"");
});
infoWindow.__open = function(map, scope, anchor) {
templatePromise.then(function() {
$timeout(function() {
anchor && (scope.anchor = anchor);
var el = $compile(infoWindow.__template)(scope);
infoWindow.setContent(el[0]);
scope.$apply();
if (anchor && anchor.getPosition) {
infoWindow.open(map, anchor);
} else if (anchor && anchor instanceof google.maps.LatLng) {
infoWindow.open(map);
infoWindow.setPosition(anchor);
} else {
infoWindow.open(map);
}
var infoWindowContainerEl = infoWindow.content.parentElement.parentElement.parentElement;
infoWindowContainerEl.className = "ng-map-info-window";
});
});
};
return infoWindow;
};
var linkFunc = function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
element.css('display','none');
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
var infoWindow = getInfoWindow(options, events, options.template || element);
var address;
if (options.position && !(options.position instanceof google.maps.LatLng)) {
address = options.position;
}
if (address) {
NgMap.getGeoLocation(address).then(function(latlng) {
infoWindow.setPosition(latlng);
infoWindow.__open(mapController.map, scope, latlng);
var geoCallback = attrs.geoCallback;
geoCallback && $parse(geoCallback)(scope);
});
}
mapController.addObject('infoWindows', infoWindow);
mapController.observeAttrSetObj(orgAttrs, attrs, infoWindow);
mapController.showInfoWindow =
mapController.map.showInfoWindow = mapController.showInfoWindow ||
function(p1, p2, p3) { //event, id, marker
var id = typeof p1 == 'string' ? p1 : p2;
var marker = typeof p1 == 'string' ? p2 : p3;
if (typeof marker == 'string') {
//Check if markers if defined to avoid odd 'undefined' errors
if (
typeof mapController.map.markers != "undefined"
&& typeof mapController.map.markers[marker] != "undefined") {
marker = mapController.map.markers[marker];
} else if (
//additionally check if that marker is a custom marker
typeof mapController.map.customMarkers !== "undefined"
&& typeof mapController.map.customMarkers[marker] !== "undefined") {
marker = mapController.map.customMarkers[marker];
} else {
//Better error output if marker with that id is not defined
throw new Error("Cant open info window for id " + marker + ". Marker or CustomMarker is not defined")
}
}
var infoWindow = mapController.map.infoWindows[id];
var anchor = marker ? marker : (this.getPosition ? this : null);
infoWindow.__open(mapController.map, scope, anchor);
if(mapController.singleInfoWindow) {
if(mapController.lastInfoWindow) {
scope.hideInfoWindow(mapController.lastInfoWindow);
}
mapController.lastInfoWindow = id;
}
};
mapController.hideInfoWindow =
mapController.map.hideInfoWindow = mapController.hideInfoWindow ||
function(p1, p2) {
var id = typeof p1 == 'string' ? p1 : p2;
var infoWindow = mapController.map.infoWindows[id];
infoWindow.close();
};
//TODO DEPRECATED
scope.showInfoWindow = mapController.map.showInfoWindow;
scope.hideInfoWindow = mapController.map.hideInfoWindow;
var map = infoWindow.mapId ? {id:infoWindow.mapId} : 0;
NgMap.getMap(map).then(function(map) {
infoWindow.visible && infoWindow.__open(map, scope);
if (infoWindow.visibleOnMarker) {
var markerId = infoWindow.visibleOnMarker;
infoWindow.__open(map, scope, map.markers[markerId]);
}
});
}; //link
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: linkFunc
};
}; // infoWindow
infoWindow.$inject =
['Attr2MapOptions', '$compile', '$q', '$templateRequest', '$timeout', '$parse', 'NgMap'];
angular.module('ngMap').directive('infoWindow', infoWindow);
})();
/**
* @ngdoc directive
* @name kml-layer
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* renders Kml layer on a map
* Requires: map directive
* Restrict To: Element
*
* @attr {Url} url url of the kml layer
* @attr {KmlLayerOptions} KmlLayerOptions
* (https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions)
* @attr {String} <KmlLayerEvent> Any KmlLayer events,
* https://developers.google.com/maps/documentation/javascript/reference
* @example
* Usage:
* <map MAP_ATTRIBUTES>
* <kml-layer ANY_KML_LAYER ANY_KML_LAYER_EVENTS"></kml-layer>
* </map>
*
* Example:
*
* <map zoom="11" center="[41.875696,-87.624207]">
* <kml-layer url="https://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml" >
* </kml-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('kmlLayer', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getKmlLayer = function(options, events) {
var kmlLayer = new google.maps.KmlLayer(options);
for (var eventName in events) {
google.maps.event.addListener(kmlLayer, eventName, events[eventName]);
}
return kmlLayer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
void 0;
var kmlLayer = getKmlLayer(options, events);
mapController.addObject('kmlLayers', kmlLayer);
mapController.observeAttrSetObj(orgAttrs, attrs, kmlLayer); //observers
element.bind('$destroy', function() {
mapController.deleteObject('kmlLayers', kmlLayer);
});
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name map-data
* @param Attr2MapOptions {service}
* convert html attribute to Google map api options
* @description
* set map data
* Requires: map directive
* Restrict To: Element
*
* @wn {String} method-name, run map.data[method-name] with attribute value
* @example
* Example:
*
* <map zoom="11" center="[41.875696,-87.624207]">
* <map-data load-geo-json="https://storage.googleapis.com/maps-devrel/google.json"></map-data>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('mapData', [
'Attr2MapOptions', 'NgMap', function(Attr2MapOptions, NgMap) {
var parser = Attr2MapOptions;
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0] || mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered, events);
void 0;
NgMap.getMap(mapController.map.id).then(function(map) {
//options
for (var key in options) {
var val = options[key];
if (typeof scope[val] === "function") {
map.data[key](scope[val]);
} else {
map.data[key](val);
}
}
//events
for (var eventName in events) {
map.data.addListener(eventName, events[eventName]);
}
});
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name map-lazy-load
* @param Attr2Options {service} convert html attribute to Google map api options
* @description
* Requires: Delay the initialization of map directive
* until the map is ready to be rendered
* Restrict To: Attribute
*
* @attr {String} map-lazy-load
* Maps api script source file location.
* Example:
* 'https://maps.google.com/maps/api/js'
* @attr {String} map-lazy-load-params
* Maps api script source file location via angular scope variable.
* Also requires the map-lazy-load attribute to be present in the directive.
* Example: In your controller, set
* $scope.googleMapsURL = 'https://maps.google.com/maps/api/js?v=3.20&client=XXXXXenter-api-key-hereXXXX'
*
* @example
* Example:
*
* <div map-lazy-load="http://maps.google.com/maps/api/js">
* <map center="Brampton" zoom="10">
* <marker position="Brampton"></marker>
* </map>
* </div>
*
* <div map-lazy-load="http://maps.google.com/maps/api/js"
* map-lazy-load-params="{{googleMapsUrl}}">
* <map center="Brampton" zoom="10">
* <marker position="Brampton"></marker>
* </map>
* </div>
*/
/* global window, document */
(function() {
'use strict';
var $timeout, $compile, src, savedHtml = [], elements = [];
var preLinkFunc = function(scope, element, attrs) {
var mapsUrl = attrs.mapLazyLoadParams || attrs.mapLazyLoad;
if(window.google === undefined || window.google.maps === undefined) {
elements.push({
scope: scope,
element: element,
savedHtml: savedHtml[elements.length],
});
window.lazyLoadCallback = function() {
void 0;
$timeout(function() { /* give some time to load */
elements.forEach(function(elm) {
elm.element.html(elm.savedHtml);
$compile(elm.element.contents())(elm.scope);
});
}, 100);
};
var scriptEl = document.createElement('script');
void 0;
scriptEl.src = mapsUrl +
(mapsUrl.indexOf('?') > -1 ? '&' : '?') +
'callback=lazyLoadCallback';
if (!document.querySelector('script[src="' + scriptEl.src + '"]')) {
document.body.appendChild(scriptEl);
}
} else {
element.html(savedHtml);
$compile(element.contents())(scope);
}
};
var compileFunc = function(tElement, tAttrs) {
(!tAttrs.mapLazyLoad) && void 0;
savedHtml.push(tElement.html());
src = tAttrs.mapLazyLoad;
/**
* if already loaded, stop processing it
*/
if(window.google !== undefined && window.google.maps !== undefined) {
return false;
}
tElement.html(''); // will compile again after script is loaded
return {
pre: preLinkFunc
};
};
var mapLazyLoad = function(_$compile_, _$timeout_) {
$compile = _$compile_, $timeout = _$timeout_;
return {
compile: compileFunc
};
};
mapLazyLoad.$inject = ['$compile','$timeout'];
angular.module('ngMap').directive('mapLazyLoad', mapLazyLoad);
})();
/**
* @ngdoc directive
* @name map-type
* @param Attr2MapOptions {service}
* convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
*
* <map zoom="13" center="34.04924594193164, -118.24104309082031">
* <map-type name="coordinate" object="coordinateMapType"></map-type>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('mapType', ['$parse', 'NgMap',
function($parse, NgMap) {
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var mapTypeName = attrs.name, mapTypeObject;
if (!mapTypeName) {
throw "invalid map-type name";
}
mapTypeObject = $parse(attrs.object)(scope);
if (!mapTypeObject) {
throw "invalid map-type object";
}
NgMap.getMap().then(function(map) {
map.mapTypes.set(mapTypeName, mapTypeObject);
});
mapController.addObject('mapTypes', mapTypeObject);
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @memberof ngMap
* @name ng-map
* @param Attr2Options {service}
* convert html attribute to Google map api options
* @description
* Implementation of {@link __MapController}
* Initialize a Google map within a `<div>` tag
* with given options and register events
*
* @attr {Expression} map-initialized
* callback function when map is initialized
* e.g., map-initialized="mycallback(map)"
* @attr {Expression} geo-callback if center is an address or current location,
* the expression is will be executed when geo-lookup is successful.
* e.g., geo-callback="showMyStoreInfo()"
* @attr {Array} geo-fallback-center
* The center of map incase geolocation failed. i.e. [0,0]
* @attr {Object} geo-location-options
* The navigator geolocation options.
* e.g., { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }.
* If none specified, { timeout: 5000 }.
* If timeout not specified, timeout: 5000 added
* @attr {Boolean} zoom-to-include-markers
* When true, map boundary will be changed automatially
* to include all markers when initialized
* @attr {Boolean} default-style
* When false, the default styling,
* `display:block;height:300px`, will be ignored.
* @attr {String} <MapOption> Any Google map options,
* https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions
* @attr {String} <MapEvent> Any Google map events,
* https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/map_events.html
* @attr {Boolean} single-info-window
* When true the map will only display one info window at the time,
* if not set or false,
* everytime an info window is open it will be displayed with the othe one.
* @attr {Boolean} trigger-resize
* Default to false. Set to true to trigger resize of the map. Needs to be done anytime you resize the map
* @example
* Usage:
* <map MAP_OPTIONS_OR_MAP_EVENTS ..>
* ... Any children directives
* </map>
*
* Example:
* <map center="[40.74, -74.18]" on-click="doThat()">
* </map>
*
* <map geo-fallback-center="[40.74, -74.18]" zoom-to-inlude-markers="true">
* </map>
*/
(function () {
'use strict';
var mapDirective = function () {
return {
restrict: 'AE',
controller: '__MapController',
controllerAs: 'ngmap'
};
};
angular.module('ngMap').directive('map', [mapDirective]);
angular.module('ngMap').directive('ngMap', [mapDirective]);
})();
/**
* @ngdoc directive
* @name maps-engine-layer
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
* <map zoom="14" center="[59.322506, 18.010025]">
* <maps-engine-layer layer-id="06673056454046135537-08896501997766553811">
* </maps-engine-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('mapsEngineLayer', ['Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getMapsEngineLayer = function(options, events) {
var layer = new google.maps.visualization.MapsEngineLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered, events);
void 0;
var layer = getMapsEngineLayer(options, events);
mapController.addObject('mapsEngineLayers', layer);
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name marker
* @param Attr2Options {service} convert html attribute to Google map api options
* @param NavigatorGeolocation It is used to find the current location
* @description
* Draw a Google map marker on a map with given options and register events
*
* Requires: map directive
*
* Restrict To: Element
*
* @attr {String} position address, 'current', or [latitude, longitude]
* example:
* '1600 Pennsylvania Ave, 20500 Washingtion DC',
* 'current position',
* '[40.74, -74.18]'
* @attr {Boolean} centered if set, map will be centered with this marker
* @attr {Expression} geo-callback if position is an address,
* the expression is will be performed when geo-lookup is successful.
* e.g., geo-callback="showStoreInfo()"
* @attr {Boolean} no-watcher if true, no attribute observer is added.
* Useful for many ng-repeat
* @attr {String} <MarkerOption>
* [Any Marker options](https://developers.google.com/maps/documentation/javascript/reference?csw=1#MarkerOptions)
* @attr {String} <MapEvent>
* [Any Marker events](https://developers.google.com/maps/documentation/javascript/reference)
* @example
* Usage:
* <map MAP_ATTRIBUTES>
* <marker ANY_MARKER_OPTIONS ANY_MARKER_EVENTS"></MARKER>
* </map>
*
* Example:
* <map center="[40.74, -74.18]">
* <marker position="[40.74, -74.18]" on-click="myfunc()"></div>
* </map>
*
* <map center="the cn tower">
* <marker position="the cn tower" on-click="myfunc()"></div>
* </map>
*/
/* global google */
(function() {
'use strict';
var parser, $parse, NgMap;
var getMarker = function(options, events) {
var marker;
if (NgMap.defaultOptions.marker) {
for (var key in NgMap.defaultOptions.marker) {
if (typeof options[key] == 'undefined') {
void 0;
options[key] = NgMap.defaultOptions.marker[key];
}
}
}
if (!(options.position instanceof google.maps.LatLng)) {
options.position = new google.maps.LatLng(0,0);
}
marker = new google.maps.Marker(options);
/**
* set events
*/
if (Object.keys(events).length > 0) {
void 0;
}
for (var eventName in events) {
if (eventName) {
google.maps.event.addListener(marker, eventName, events[eventName]);
}
}
return marker;
};
var linkFunc = function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var markerOptions = parser.getOptions(filtered, scope, {scope: scope});
var markerEvents = parser.getEvents(scope, filtered);
void 0;
var address;
if (!(markerOptions.position instanceof google.maps.LatLng)) {
address = markerOptions.position;
}
var marker = getMarker(markerOptions, markerEvents);
mapController.addObject('markers', marker);
if (address) {
NgMap.getGeoLocation(address).then(function(latlng) {
marker.setPosition(latlng);
markerOptions.centered && marker.map.setCenter(latlng);
var geoCallback = attrs.geoCallback;
geoCallback && $parse(geoCallback)(scope);
});
}
//set observers
mapController.observeAttrSetObj(orgAttrs, attrs, marker); /* observers */
element.bind('$destroy', function() {
mapController.deleteObject('markers', marker);
});
};
var marker = function(Attr2MapOptions, _$parse_, _NgMap_) {
parser = Attr2MapOptions;
$parse = _$parse_;
NgMap = _NgMap_;
return {
restrict: 'E',
require: ['^?map','?^ngMap'],
link: linkFunc
};
};
marker.$inject = ['Attr2MapOptions', '$parse', 'NgMap'];
angular.module('ngMap').directive('marker', marker);
})();
/**
* @ngdoc directive
* @name overlay-map-type
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @param $window {service}
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
*
* <map zoom="13" center="34.04924594193164, -118.24104309082031">
* <overlay-map-type index="0" object="coordinateMapType"></map-type>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('overlayMapType', [
'NgMap', function(NgMap) {
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var initMethod = attrs.initMethod || "insertAt";
var overlayMapTypeObject = scope[attrs.object];
NgMap.getMap().then(function(map) {
if (initMethod == "insertAt") {
var index = parseInt(attrs.index, 10);
map.overlayMapTypes.insertAt(index, overlayMapTypeObject);
} else if (initMethod == "push") {
map.overlayMapTypes.push(overlayMapTypeObject);
}
});
mapController.addObject('overlayMapTypes', overlayMapTypeObject);
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name places-auto-complete
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* Provides address auto complete feature to an input element
* Requires: input tag
* Restrict To: Attribute
*
* @attr {AutoCompleteOptions}
* [Any AutocompleteOptions](https://developers.google.com/maps/documentation/javascript/3.exp/reference#AutocompleteOptions)
*
* @example
* Example:
* <script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
* <input places-auto-complete types="['geocode']" on-place-changed="myCallback(place)" component-restrictions="{country:'au'}"/>
*/
/* global google */
(function() {
'use strict';
var placesAutoComplete = function(Attr2MapOptions, $timeout) {
var parser = Attr2MapOptions;
var linkFunc = function(scope, element, attrs, ngModelCtrl) {
if (attrs.placesAutoComplete ==='false') {
return false;
}
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
var autocomplete = new google.maps.places.Autocomplete(element[0], options);
for (var eventName in events) {
google.maps.event.addListener(autocomplete, eventName, events[eventName]);
}
var updateModel = function() {
$timeout(function(){
ngModelCtrl && ngModelCtrl.$setViewValue(element.val());
},100);
};
google.maps.event.addListener(autocomplete, 'place_changed', updateModel);
element[0].addEventListener('change', updateModel);
attrs.$observe('types', function(val) {
if (val) {
var optionValue = parser.toOptionValue(val, {key: 'types'});
autocomplete.setTypes(optionValue);
}
});
attrs.$observe('componentRestrictions', function (val) {
if (val) {
autocomplete.setComponentRestrictions(scope.$eval(val));
}
});
};
return {
restrict: 'A',
require: '?ngModel',
link: linkFunc
};
};
placesAutoComplete.$inject = ['Attr2MapOptions', '$timeout'];
angular.module('ngMap').directive('placesAutoComplete', placesAutoComplete);
})();
/**
* @ngdoc directive
* @name shape
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* Initialize a Google map shape in map with given options and register events
* The shapes are:
* . circle
* . polygon
* . polyline
* . rectangle
* . groundOverlay(or image)
*
* Requires: map directive
*
* Restrict To: Element
*
* @attr {Boolean} centered if set, map will be centered with this marker
* @attr {Expression} geo-callback if shape is a circle and the center is
* an address, the expression is will be performed when geo-lookup
* is successful. e.g., geo-callback="showDetail()"
* @attr {String} <OPTIONS>
* For circle, [any circle options](https://developers.google.com/maps/documentation/javascript/reference#CircleOptions)
* For polygon, [any polygon options](https://developers.google.com/maps/documentation/javascript/reference#PolygonOptions)
* For polyline, [any polyline options](https://developers.google.com/maps/documentation/javascript/reference#PolylineOptions)
* For rectangle, [any rectangle options](https://developers.google.com/maps/documentation/javascript/reference#RectangleOptions)
* For image, [any groundOverlay options](https://developers.google.com/maps/documentation/javascript/reference#GroundOverlayOptions)
* @attr {String} <MapEvent> [Any Shape events](https://developers.google.com/maps/documentation/javascript/reference)
* @example
* Usage:
* <map MAP_ATTRIBUTES>
* <shape name=SHAPE_NAME ANY_SHAPE_OPTIONS ANY_SHAPE_EVENTS"></MARKER>
* </map>
*
* Example:
*
* <map zoom="11" center="[40.74, -74.18]">
* <shape id="polyline" name="polyline" geodesic="true"
* stroke-color="#FF0000" stroke-opacity="1.0" stroke-weight="2"
* path="[[40.74,-74.18],[40.64,-74.10],[40.54,-74.05],[40.44,-74]]" >
* </shape>
* </map>
*
* <map zoom="11" center="[40.74, -74.18]">
* <shape id="polygon" name="polygon" stroke-color="#FF0000"
* stroke-opacity="1.0" stroke-weight="2"
* paths="[[40.74,-74.18],[40.64,-74.18],[40.84,-74.08],[40.74,-74.18]]" >
* </shape>
* </map>
*
* <map zoom="11" center="[40.74, -74.18]">
* <shape id="rectangle" name="rectangle" stroke-color='#FF0000'
* stroke-opacity="0.8" stroke-weight="2"
* bounds="[[40.74,-74.18], [40.78,-74.14]]" editable="true" >
* </shape>
* </map>
*
* <map zoom="11" center="[40.74, -74.18]">
* <shape id="circle" name="circle" stroke-color='#FF0000'
* stroke-opacity="0.8"stroke-weight="2"
* center="[40.70,-74.14]" radius="4000" editable="true" >
* </shape>
* </map>
*
* <map zoom="11" center="[40.74, -74.18]">
* <shape id="image" name="image"
* url="https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg"
* bounds="[[40.71,-74.22],[40.77,-74.12]]" opacity="0.7"
* clickable="true">
* </shape>
* </map>
*
* For full-working example, please visit
* [shape example](https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/shape.html)
*/
/* global google */
(function() {
'use strict';
var getShape = function(options, events) {
var shape;
var shapeName = options.name;
delete options.name; //remove name bcoz it's not for options
void 0;
/**
* set options
*/
switch(shapeName) {
case "circle":
if (!(options.center instanceof google.maps.LatLng)) {
options.center = new google.maps.LatLng(0,0);
}
shape = new google.maps.Circle(options);
break;
case "polygon":
shape = new google.maps.Polygon(options);
break;
case "polyline":
shape = new google.maps.Polyline(options);
break;
case "rectangle":
shape = new google.maps.Rectangle(options);
break;
case "groundOverlay":
case "image":
var url = options.url;
var opts = {opacity: options.opacity, clickable: options.clickable, id:options.id};
shape = new google.maps.GroundOverlay(url, options.bounds, opts);
break;
}
/**
* set events
*/
for (var eventName in events) {
if (events[eventName]) {
google.maps.event.addListener(shape, eventName, events[eventName]);
}
}
return shape;
};
var shape = function(Attr2MapOptions, $parse, NgMap) {
var parser = Attr2MapOptions;
var linkFunc = function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var shapeOptions = parser.getOptions(filtered, {scope: scope});
var shapeEvents = parser.getEvents(scope, filtered);
var address, shapeType;
shapeType = shapeOptions.name;
if (!(shapeOptions.center instanceof google.maps.LatLng)) {
address = shapeOptions.center;
}
var shape = getShape(shapeOptions, shapeEvents);
mapController.addObject('shapes', shape);
if (address && shapeType == 'circle') {
NgMap.getGeoLocation(address).then(function(latlng) {
shape.setCenter(latlng);
shape.centered && shape.map.setCenter(latlng);
var geoCallback = attrs.geoCallback;
geoCallback && $parse(geoCallback)(scope);
});
}
//set observers
mapController.observeAttrSetObj(orgAttrs, attrs, shape);
element.bind('$destroy', function() {
mapController.deleteObject('shapes', shape);
});
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: linkFunc
}; // return
};
shape.$inject = ['Attr2MapOptions', '$parse', 'NgMap'];
angular.module('ngMap').directive('shape', shape);
})();
/**
* @ngdoc directive
* @name streetview-panorama
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @attr container Optional, id or css selector, if given, streetview will be in the given html element
* @attr {String} <StreetViewPanoramaOption>
* [Any Google StreetViewPanorama options](https://developers.google.com/maps/documentation/javascript/reference?csw=1#StreetViewPanoramaOptions)
* @attr {String} <StreetViewPanoramaEvent>
* [Any Google StreetViewPanorama events](https://developers.google.com/maps/documentation/javascript/reference#StreetViewPanorama)
*
* @example
* <map zoom="11" center="[40.688738,-74.043871]" >
* <street-view-panorama
* click-to-go="true"
* disable-default-ui="true"
* disable-double-click-zoom="true"
* enable-close-button="true"
* pano="my-pano"
* position="40.688738,-74.043871"
* pov="{heading:0, pitch: 90}"
* scrollwheel="false"
* visible="true">
* </street-view-panorama>
* </map>
*/
/* global google, document */
(function() {
'use strict';
var streetViewPanorama = function(Attr2MapOptions, NgMap) {
var parser = Attr2MapOptions;
var getStreetViewPanorama = function(map, options, events) {
var svp, container;
if (options.container) {
container = document.getElementById(options.container);
container = container || document.querySelector(options.container);
}
if (container) {
svp = new google.maps.StreetViewPanorama(container, options);
} else {
svp = map.getStreetView();
svp.setOptions(options);
}
for (var eventName in events) {
eventName &&
google.maps.event.addListener(svp, eventName, events[eventName]);
}
return svp;
};
var linkFunc = function(scope, element, attrs) {
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var controlOptions = parser.getControlOptions(filtered);
var svpOptions = angular.extend(options, controlOptions);
var svpEvents = parser.getEvents(scope, filtered);
void 0;
NgMap.getMap().then(function(map) {
var svp = getStreetViewPanorama(map, svpOptions, svpEvents);
map.setStreetView(svp);
(!svp.getPosition()) && svp.setPosition(map.getCenter());
google.maps.event.addListener(svp, 'position_changed', function() {
if (svp.getPosition() !== map.getCenter()) {
map.setCenter(svp.getPosition());
}
});
//needed for geo-callback
var listener =
google.maps.event.addListener(map, 'center_changed', function() {
svp.setPosition(map.getCenter());
google.maps.event.removeListener(listener);
});
});
}; //link
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: linkFunc
};
};
streetViewPanorama.$inject = ['Attr2MapOptions', 'NgMap'];
angular.module('ngMap').directive('streetViewPanorama', streetViewPanorama);
})();
/**
* @ngdoc directive
* @name traffic-layer
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
*
* <map zoom="13" center="34.04924594193164, -118.24104309082031">
* <traffic-layer></traffic-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('trafficLayer', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getLayer = function(options, events) {
var layer = new google.maps.TrafficLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
void 0;
var layer = getLayer(options, events);
mapController.addObject('trafficLayers', layer);
mapController.observeAttrSetObj(orgAttrs, attrs, layer); //observers
element.bind('$destroy', function() {
mapController.deleteObject('trafficLayers', layer);
});
}
}; // return
}]);
})();
/**
* @ngdoc directive
* @name transit-layer
* @param Attr2MapOptions {service} convert html attribute to Google map api options
* @description
* Requires: map directive
* Restrict To: Element
*
* @example
* Example:
*
* <map zoom="13" center="34.04924594193164, -118.24104309082031">
* <transit-layer></transit-layer>
* </map>
*/
(function() {
'use strict';
angular.module('ngMap').directive('transitLayer', [
'Attr2MapOptions', function(Attr2MapOptions) {
var parser = Attr2MapOptions;
var getLayer = function(options, events) {
var layer = new google.maps.TransitLayer(options);
for (var eventName in events) {
google.maps.event.addListener(layer, eventName, events[eventName]);
}
return layer;
};
return {
restrict: 'E',
require: ['?^map','?^ngMap'],
link: function(scope, element, attrs, mapController) {
mapController = mapController[0]||mapController[1];
var orgAttrs = parser.orgAttributes(element);
var filtered = parser.filter(attrs);
var options = parser.getOptions(filtered, {scope: scope});
var events = parser.getEvents(scope, filtered);
void 0;
var layer = getLayer(options, events);
mapController.addObject('transitLayers', layer);
mapController.observeAttrSetObj(orgAttrs, attrs, layer); //observers
element.bind('$destroy', function() {
mapController.deleteObject('transitLayers', layer);
});
}
}; // return
}]);
})();
/**
* @ngdoc filter
* @name camel-case
* @description
* Converts string to camel cased
*/
(function() {
'use strict';
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
var camelCaseFilter = function() {
return function(name) {
return name.
replace(SPECIAL_CHARS_REGEXP,
function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
}).
replace(MOZ_HACK_REGEXP, 'Moz$1');
};
};
angular.module('ngMap').filter('camelCase', camelCaseFilter);
})();
/**
* @ngdoc filter
* @name escape-regex
* @description
* Escapes all regex special characters in a string
*/
(function() {
'use strict';
var escapeRegexpFilter = function() {
return function(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
};
};
angular.module('ngMap').filter('escapeRegexp', escapeRegexpFilter);
})();
/**
* @ngdoc filter
* @name jsonize
* @description
* Converts json-like string to json string
*/
(function() {
'use strict';
var jsonizeFilter = function() {
return function(str) {
try { // if parsable already, return as it is
JSON.parse(str);
return str;
} catch(e) { // if not parsable, change little
return str
// wrap keys without quote with valid double quote
.replace(/([\$\w]+)\s*:/g,
function(_, $1) {
return '"'+$1+'":';
}
)
// replacing single quote wrapped ones to double quote
.replace(/'([^']+)'/g,
function(_, $1) {
return '"'+$1+'"';
}
)
.replace(/''/g, '""');
}
};
};
angular.module('ngMap').filter('jsonize', jsonizeFilter);
})();
/**
* @ngdoc service
* @name Attr2MapOptions
* @description
* Converts tag attributes to options used by google api v3 objects
*/
/* global google */
(function() {
'use strict';
//i.e. "2015-08-12T06:12:40.858Z"
var isoDateRE =
/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/;
var Attr2MapOptions = function(
$parse, $timeout, $log, $interpolate, NavigatorGeolocation, GeoCoder,
camelCaseFilter, jsonizeFilter, escapeRegExp
) {
var exprStartSymbol = $interpolate.startSymbol();
var exprEndSymbol = $interpolate.endSymbol();
/**
* Returns the attributes of an element as hash
* @memberof Attr2MapOptions
* @param {HTMLElement} el html element
* @returns {Hash} attributes
*/
var orgAttributes = function(el) {
(el.length > 0) && (el = el[0]);
var orgAttributes = {};
for (var i=0; i<el.attributes.length; i++) {
var attr = el.attributes[i];
orgAttributes[attr.name] = attr.value;
}
return orgAttributes;
};
var getJSON = function(input) {
var re =/^[\+\-]?[0-9\.]+,[ ]*\ ?[\+\-]?[0-9\.]+$/; //lat,lng
if (input.match(re)) {
input = "["+input+"]";
}
return JSON.parse(jsonizeFilter(input));
};
var getLatLng = function(input) {
var output = input;
if (input[0].constructor == Array) {
if ((input[0][0].constructor == Array && input[0][0].length == 2) || input[0][0].constructor == Object) {
var preoutput;
var outputArray = [];
for (var i = 0; i < input.length; i++) {
preoutput = input[i].map(function(el){
return new google.maps.LatLng(el[0], el[1]);
});
outputArray.push(preoutput);
}
output = outputArray;
} else {
output = input.map(function(el) {
return new google.maps.LatLng(el[0], el[1]);
});
}
} else if (!isNaN(parseFloat(input[0])) && isFinite(input[0])) {
output = new google.maps.LatLng(output[0], output[1]);
}
return output;
};
var toOptionValue = function(input, options) {
var output;
try { // 1. Number?
output = getNumber(input);
} catch(err) {
try { // 2. JSON?
var output = getJSON(input);
if (output instanceof Array) {
if (output[0].constructor == Object) {
output = output;
} else if (output[0] instanceof Array) {
if (output[0][0].constructor == Object) {
output = output;
} else {
output = getLatLng(output);
}
} else {
output = getLatLng(output);
}
}
// JSON is an object (not array or null)
else if (output === Object(output)) {
// check for nested hashes and convert to Google API options
var newOptions = options;
newOptions.doNotConverStringToNumber = true;
output = getOptions(output, newOptions);
}
} catch(err2) {
// 3. Google Map Object function Expression. i.e. LatLng(80,-49)
if (input.match(/^[A-Z][a-zA-Z0-9]+\(.*\)$/)) {
try {
var exp = "new google.maps."+input;
output = eval(exp); /* jshint ignore:line */
} catch(e) {
output = input;
}
// 4. Google Map Object constant Expression. i.e. MayTypeId.HYBRID
} else if (input.match(/^([A-Z][a-zA-Z0-9]+)\.([A-Z]+)$/)) {
try {
var matches = input.match(/^([A-Z][a-zA-Z0-9]+)\.([A-Z]+)$/);
output = google.maps[matches[1]][matches[2]];
} catch(e) {
output = input;
}
// 5. Google Map Object constant Expression. i.e. HYBRID
} else if (input.match(/^[A-Z]+$/)) {
try {
var capitalizedKey = options.key.charAt(0).toUpperCase() +
options.key.slice(1);
if (options.key.match(/temperatureUnit|windSpeedUnit|labelColor/)) {
capitalizedKey = capitalizedKey.replace(/s$/,"");
output = google.maps.weather[capitalizedKey][input];
} else {
output = google.maps[capitalizedKey][input];
}
} catch(e) {
output = input;
}
// 6. Date Object as ISO String
} else if (input.match(isoDateRE)) {
try {
output = new Date(input);
} catch(e) {
output = input;
}
// 7. evaluate dynamically bound values
} else if (input.match(new RegExp('^' + escapeRegExp(exprStartSymbol))) && options.scope) {
try {
var expr = input.replace(new RegExp(escapeRegExp(exprStartSymbol)),'').replace(new RegExp(escapeRegExp(exprEndSymbol), 'g'),'');
output = options.scope.$eval(expr);
} catch (err) {
output = input;
}
} else {
output = input;
}
} // catch(err2)
} // catch(err)
// convert output more for center and position
if (
(options.key == 'center' || options.key == 'position') &&
output instanceof Array
) {
output = new google.maps.LatLng(output[0], output[1]);
}
// convert output more for shape bounds
if (options.key == 'bounds' && output instanceof Array) {
output = new google.maps.LatLngBounds(output[0], output[1]);
}
// convert output more for shape icons
if (options.key == 'icons' && output instanceof Array) {
for (var i=0; i<output.length; i++) {
var el = output[i];
if (el.icon.path.match(/^[A-Z_]+$/)) {
el.icon.path = google.maps.SymbolPath[el.icon.path];
}
}
}
// convert output more for marker icon
if (options.key == 'icon' && output instanceof Object) {
if ((""+output.path).match(/^[A-Z_]+$/)) {
output.path = google.maps.SymbolPath[output.path];
}
for (var key in output) { //jshint ignore:line
var arr = output[key];
if (key == "anchor" || key == "origin" || key == "labelOrigin") {
output[key] = new google.maps.Point(arr[0], arr[1]);
} else if (key == "size" || key == "scaledSize") {
output[key] = new google.maps.Size(arr[0], arr[1]);
}
}
}
return output;
};
var getAttrsToObserve = function(attrs) {
var attrsToObserve = [];
var exprRegExp = new RegExp(escapeRegExp(exprStartSymbol) + '.*' + escapeRegExp(exprEndSymbol), 'g');
if (!attrs.noWatcher) {
for (var attrName in attrs) { //jshint ignore:line
var attrValue = attrs[attrName];
if (attrValue && attrValue.match(exprRegExp)) { // if attr value is {{..}}
attrsToObserve.push(camelCaseFilter(attrName));
}
}
}
return attrsToObserve;
};
/**
* filters attributes by skipping angularjs methods $.. $$..
* @memberof Attr2MapOptions
* @param {Hash} attrs tag attributes
* @returns {Hash} filterd attributes
*/
var filter = function(attrs) {
var options = {};
for(var key in attrs) {
if (key.match(/^\$/) || key.match(/^ng[A-Z]/)) {
void(0);
} else {
options[key] = attrs[key];
}
}
return options;
};
/**
* converts attributes hash to Google Maps API v3 options
* ```
* . converts numbers to number
* . converts class-like string to google maps instance
* i.e. `LatLng(1,1)` to `new google.maps.LatLng(1,1)`
* . converts constant-like string to google maps constant
* i.e. `MapTypeId.HYBRID` to `google.maps.MapTypeId.HYBRID`
* i.e. `HYBRID"` to `google.maps.MapTypeId.HYBRID`
* ```
* @memberof Attr2MapOptions
* @param {Hash} attrs tag attributes
* @param {Hash} options
* @returns {Hash} options converted attributess
*/
var getOptions = function(attrs, params) {
params = params || {};
var options = {};
for(var key in attrs) {
if (attrs[key] || attrs[key] === 0) {
if (key.match(/^on[A-Z]/)) { //skip events, i.e. on-click
continue;
} else if (key.match(/ControlOptions$/)) { // skip controlOptions
continue;
} else {
// nested conversions need to be typechecked
// (non-strings are fully converted)
if (typeof attrs[key] !== 'string') {
options[key] = attrs[key];
} else {
if (params.doNotConverStringToNumber &&
attrs[key].match(/^[0-9]+$/)
) {
options[key] = attrs[key];
} else {
options[key] = toOptionValue(attrs[key], {key: key, scope: params.scope});
}
}
}
} // if (attrs[key])
} // for(var key in attrs)
return options;
};
/**
* converts attributes hash to scope-specific event function
* @memberof Attr2MapOptions
* @param {scope} scope angularjs scope
* @param {Hash} attrs tag attributes
* @returns {Hash} events converted events
*/
var getEvents = function(scope, attrs) {
var events = {};
var toLowercaseFunc = function($1){
return "_"+$1.toLowerCase();
};
var EventFunc = function(attrValue) {
// funcName(argsStr)
var matches = attrValue.match(/([^\(]+)\(([^\)]*)\)/);
var funcName = matches[1];
var argsStr = matches[2].replace(/event[ ,]*/,''); //remove string 'event'
var argsExpr = $parse("["+argsStr+"]"); //for perf when triggering event
return function(event) {
var args = argsExpr(scope); //get args here to pass updated model values
function index(obj,i) {return obj[i];}
var f = funcName.split('.').reduce(index, scope);
f && f.apply(this, [event].concat(args));
$timeout( function() {
scope.$apply();
});
};
};
for(var key in attrs) {
if (attrs[key]) {
if (!key.match(/^on[A-Z]/)) { //skip if not events
continue;
}
//get event name as underscored. i.e. zoom_changed
var eventName = key.replace(/^on/,'');
eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1);
eventName = eventName.replace(/([A-Z])/g, toLowercaseFunc);
var attrValue = attrs[key];
events[eventName] = new EventFunc(attrValue);
}
}
return events;
};
/**
* control means map controls, i.e streetview, pan, etc, not a general control
* @memberof Attr2MapOptions
* @param {Hash} filtered filtered tag attributes
* @returns {Hash} Google Map options
*/
var getControlOptions = function(filtered) {
var controlOptions = {};
if (typeof filtered != 'object') {
return false;
}
for (var attr in filtered) {
if (filtered[attr]) {
if (!attr.match(/(.*)ControlOptions$/)) {
continue; // if not controlOptions, skip it
}
//change invalid json to valid one, i.e. {foo:1} to {"foo": 1}
var orgValue = filtered[attr];
var newValue = orgValue.replace(/'/g, '"');
newValue = newValue.replace(/([^"]+)|("[^"]+")/g, function($0, $1, $2) {
if ($1) {
return $1.replace(/([a-zA-Z0-9]+?):/g, '"$1":');
} else {
return $2;
}
});
try {
var options = JSON.parse(newValue);
for (var key in options) { //assign the right values
if (options[key]) {
var value = options[key];
if (typeof value === 'string') {
value = value.toUpperCase();
} else if (key === "mapTypeIds") {
value = value.map( function(str) {
if (str.match(/^[A-Z]+$/)) { // if constant
return google.maps.MapTypeId[str.toUpperCase()];
} else { // else, custom map-type
return str;
}
});
}
if (key === "style") {
var str = attr.charAt(0).toUpperCase() + attr.slice(1);
var objName = str.replace(/Options$/,'')+"Style";
options[key] = google.maps[objName][value];
} else if (key === "position") {
options[key] = google.maps.ControlPosition[value];
} else {
options[key] = value;
}
}
}
controlOptions[attr] = options;
} catch (e) {
void 0;
}
}
} // for
return controlOptions;
};
return {
filter: filter,
getOptions: getOptions,
getEvents: getEvents,
getControlOptions: getControlOptions,
toOptionValue: toOptionValue,
getAttrsToObserve: getAttrsToObserve,
orgAttributes: orgAttributes
}; // return
};
Attr2MapOptions.$inject= [
'$parse', '$timeout', '$log', '$interpolate', 'NavigatorGeolocation', 'GeoCoder',
'camelCaseFilter', 'jsonizeFilter', 'escapeRegexpFilter'
];
angular.module('ngMap').service('Attr2MapOptions', Attr2MapOptions);
})();
/**
* @ngdoc service
* @name GeoCoder
* @description
* Provides [defered/promise API](https://docs.angularjs.org/api/ng/service/$q)
* service for Google Geocoder service
*/
(function() {
'use strict';
var $q;
/**
* @memberof GeoCoder
* @param {Hash} options
* https://developers.google.com/maps/documentation/geocoding/#geocoding
* @example
* ```
* GeoCoder.geocode({address: 'the cn tower'}).then(function(result) {
* //... do something with result
* });
* ```
* @returns {HttpPromise} Future object
*/
var geocodeFunc = function(options) {
var deferred = $q.defer();
var geocoder = new google.maps.Geocoder();
geocoder.geocode(options, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
deferred.resolve(results);
} else {
deferred.reject(status);
}
});
return deferred.promise;
};
var GeoCoder = function(_$q_) {
$q = _$q_;
return {
geocode : geocodeFunc
};
};
GeoCoder.$inject = ['$q'];
angular.module('ngMap').service('GeoCoder', GeoCoder);
})();
/**
* @ngdoc service
* @name GoogleMapsApi
* @description
* Load Google Maps API Service
*/
(function() {
'use strict';
var $q;
var $timeout;
var GoogleMapsApi = function(_$q_, _$timeout_) {
$q = _$q_;
$timeout = _$timeout_;
return {
/**
* Load google maps into document by creating a script tag
* @memberof GoogleMapsApi
* @param {string} mapsUrl
* @example
* GoogleMapsApi.load(myUrl).then(function() {
* console.log('google map has been loaded')
* });
*/
load: function (mapsUrl) {
var deferred = $q.defer();
if (window.google === undefined || window.google.maps === undefined) {
window.lazyLoadCallback = function() {
$timeout(function() { /* give some time to load */
deferred.resolve(window.google)
}, 100);
};
var scriptEl = document.createElement('script');
scriptEl.src = mapsUrl +
(mapsUrl.indexOf('?') > -1 ? '&' : '?') +
'callback=lazyLoadCallback';
if (!document.querySelector('script[src="' + scriptEl.src + '"]')) {
document.body.appendChild(scriptEl);
}
} else {
deferred.resolve(window.google)
}
return deferred.promise;
}
}
}
GoogleMapsApi.$inject = ['$q', '$timeout'];
angular.module('ngMap').service('GoogleMapsApi', GoogleMapsApi);
})();
/**
* @ngdoc service
* @name NavigatorGeolocation
* @description
* Provides [defered/promise API](https://docs.angularjs.org/api/ng/service/$q)
* service for navigator.geolocation methods
*/
/* global google */
(function() {
'use strict';
var $q;
/**
* @memberof NavigatorGeolocation
* @param {Object} geoLocationOptions the navigator geolocations options.
* i.e. { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }.
* If none specified, { timeout: 5000 }.
* If timeout not specified, timeout: 5000 added
* @param {function} success success callback function
* @param {function} failure failure callback function
* @example
* ```
* NavigatorGeolocation.getCurrentPosition()
* .then(function(position) {
* var lat = position.coords.latitude, lng = position.coords.longitude;
* .. do something lat and lng
* });
* ```
* @returns {HttpPromise} Future object
*/
var getCurrentPosition = function(geoLocationOptions) {
var deferred = $q.defer();
if (navigator.geolocation) {
if (geoLocationOptions === undefined) {
geoLocationOptions = { timeout: 5000 };
}
else if (geoLocationOptions.timeout === undefined) {
geoLocationOptions.timeout = 5000;
}
navigator.geolocation.getCurrentPosition(
function(position) {
deferred.resolve(position);
}, function(evt) {
void 0;
deferred.reject(evt);
},
geoLocationOptions
);
} else {
deferred.reject("Browser Geolocation service failed.");
}
return deferred.promise;
};
var NavigatorGeolocation = function(_$q_) {
$q = _$q_;
return {
getCurrentPosition: getCurrentPosition
};
};
NavigatorGeolocation.$inject = ['$q'];
angular.module('ngMap').
service('NavigatorGeolocation', NavigatorGeolocation);
})();
/**
* @ngdoc factory
* @name NgMapPool
* @description
* Provide map instance to avoid memory leak
*/
(function() {
'use strict';
/**
* @memberof NgMapPool
* @desc map instance pool
*/
var mapInstances = [];
var $window, $document, $timeout;
var add = function(el) {
var mapDiv = $document.createElement("div");
mapDiv.style.width = "100%";
mapDiv.style.height = "100%";
el.appendChild(mapDiv);
var map = new $window.google.maps.Map(mapDiv, {});
mapInstances.push(map);
return map;
};
var findById = function(el, id) {
var notInUseMap;
for (var i=0; i<mapInstances.length; i++) {
var map = mapInstances[i];
if (map.id == id && !map.inUse) {
var mapDiv = map.getDiv();
el.appendChild(mapDiv);
notInUseMap = map;
break;
}
}
return notInUseMap;
};
var findUnused = function(el) { //jshint ignore:line
var notInUseMap;
for (var i=0; i<mapInstances.length; i++) {
var map = mapInstances[i];
if (map.id) {
continue;
}
if (!map.inUse) {
var mapDiv = map.getDiv();
el.appendChild(mapDiv);
notInUseMap = map;
break;
}
}
return notInUseMap;
};
/**
* @memberof NgMapPool
* @function getMapInstance
* @param {HtmlElement} el map container element
* @return map instance for the given element
*/
var getMapInstance = function(el) {
var map = findById(el, el.id) || findUnused(el);
if (!map) {
map = add(el);
} else {
/* firing map idle event, which is used by map controller */
$timeout(function() {
google.maps.event.trigger(map, 'idle');
}, 100);
}
map.inUse = true;
return map;
};
/**
* @memberof NgMapPool
* @function returnMapInstance
* @param {Map} an instance of google.maps.Map
* @desc sets the flag inUse of the given map instance to false, so that it
* can be reused later
*/
var returnMapInstance = function(map) {
map.inUse = false;
};
/**
* @memberof NgMapPool
* @function resetMapInstances
* @desc resets mapInstance array
*/
var resetMapInstances = function() {
for(var i = 0;i < mapInstances.length;i++) {
mapInstances[i] = null;
}
mapInstances = [];
};
/**
* @memberof NgMapPool
* @function deleteMapInstance
* @desc delete a mapInstance
*/
var deleteMapInstance= function(mapId) {
for( var i=0; i<mapInstances.length; i++ ) {
if( (mapInstances[i] !== null) && (mapInstances[i].id == mapId)) {
mapInstances[i]= null;
mapInstances.splice( i, 1 );
}
}
};
var NgMapPool = function(_$document_, _$window_, _$timeout_) {
$document = _$document_[0], $window = _$window_, $timeout = _$timeout_;
return {
mapInstances: mapInstances,
resetMapInstances: resetMapInstances,
getMapInstance: getMapInstance,
returnMapInstance: returnMapInstance,
deleteMapInstance: deleteMapInstance
};
};
NgMapPool.$inject = [ '$document', '$window', '$timeout'];
angular.module('ngMap').factory('NgMapPool', NgMapPool);
})();
/**
* @ngdoc provider
* @name NgMap
* @description
* common utility service for ng-map
*/
(function() {
'use strict';
var $window, $document, $q;
var NavigatorGeolocation, Attr2MapOptions, GeoCoder, camelCaseFilter, NgMapPool;
var mapControllers = {};
var getStyle = function(el, styleProp) {
var y;
if (el.currentStyle) {
y = el.currentStyle[styleProp];
} else if ($window.getComputedStyle) {
y = $document.defaultView.
getComputedStyle(el, null).
getPropertyValue(styleProp);
}
return y;
};
/**
* @memberof NgMap
* @function initMap
* @param id optional, id of the map. default 0
*/
var initMap = function(id) {
var ctrl = mapControllers[id || 0];
if (!(ctrl.map instanceof google.maps.Map)) {
ctrl.initializeMap();
return ctrl.map;
} else {
void 0;
}
};
/**
* @memberof NgMap
* @function getMap
* @param {String} optional, id e.g., 'foo'
* @returns promise
*/
var getMap = function(id, options) {
options = options || {};
id = typeof id === 'object' ? id.id : id;
var deferred = $q.defer();
var timeout = options.timeout || 10000;
function waitForMap(timeElapsed){
var keys = Object.keys(mapControllers);
var theFirstController = mapControllers[keys[0]];
if(id && mapControllers[id]){
deferred.resolve(mapControllers[id].map);
} else if (!id && theFirstController && theFirstController.map) {
deferred.resolve(theFirstController.map);
} else if (timeElapsed > timeout) {
deferred.reject('could not find map');
} else {
$window.setTimeout( function(){
waitForMap(timeElapsed+100);
}, 100);
}
}
waitForMap(0);
return deferred.promise;
};
/**
* @memberof NgMap
* @function addMap
* @param mapController {__MapContoller} a map controller
* @returns promise
*/
var addMap = function(mapCtrl) {
if (mapCtrl.map) {
var len = Object.keys(mapControllers).length;
mapControllers[mapCtrl.map.id || len] = mapCtrl;
}
};
/**
* @memberof NgMap
* @function deleteMap
* @param mapController {__MapContoller} a map controller
*/
var deleteMap = function(mapCtrl) {
var len = Object.keys(mapControllers).length - 1;
var mapId = mapCtrl.map.id || len;
if (mapCtrl.map) {
for (var eventName in mapCtrl.eventListeners) {
void 0;
var listener = mapCtrl.eventListeners[eventName];
google.maps.event.removeListener(listener);
}
if (mapCtrl.map.controls) {
mapCtrl.map.controls.forEach(function(ctrl) {
ctrl.clear();
});
}
}
//Remove Heatmap Layers
if (mapCtrl.map.heatmapLayers) {
Object.keys(mapCtrl.map.heatmapLayers).forEach(function (layer) {
mapCtrl.deleteObject('heatmapLayers', mapCtrl.map.heatmapLayers[layer]);
});
}
NgMapPool.deleteMapInstance(mapId);
delete mapControllers[mapId];
};
/**
* @memberof NgMap
* @function getGeoLocation
* @param {String} address
* @param {Hash} options geo options
* @returns promise
*/
var getGeoLocation = function(string, options) {
var deferred = $q.defer();
if (!string || string.match(/^current/i)) { // current location
NavigatorGeolocation.getCurrentPosition(options).then(
function(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
var latLng = new google.maps.LatLng(lat,lng);
deferred.resolve(latLng);
},
function(error) {
deferred.reject(error);
}
);
} else {
GeoCoder.geocode({address: string}).then(
function(results) {
deferred.resolve(results[0].geometry.location);
},
function(error) {
deferred.reject(error);
}
);
// var geocoder = new google.maps.Geocoder();
// geocoder.geocode(options, function (results, status) {
// if (status == google.maps.GeocoderStatus.OK) {
// deferred.resolve(results);
// } else {
// deferred.reject(status);
// }
// });
}
return deferred.promise;
};
/**
* @memberof NgMap
* @function observeAndSet
* @param {String} attrName attribute name
* @param {Object} object A Google maps object to be changed
* @returns attribue observe function
*/
var observeAndSet = function(attrName, object) {
void 0;
return function(val) {
if (val) {
var setMethod = camelCaseFilter('set-'+attrName);
var optionValue = Attr2MapOptions.toOptionValue(val, {key: attrName});
if (object[setMethod]) { //if set method does exist
void 0;
/* if an location is being observed */
if (attrName.match(/center|position/) &&
typeof optionValue == 'string') {
getGeoLocation(optionValue).then(function(latlng) {
object[setMethod](latlng);
});
} else {
object[setMethod](optionValue);
}
}
}
};
};
/**
* @memberof NgMap
* @function setStyle
* @param {HtmlElement} map contriner element
* @desc set display, width, height of map container element
*/
var setStyle = function(el) {
//if style is not given to the map element, set display and height
var defaultStyle = el.getAttribute('default-style');
if (defaultStyle == "true") {
el.style.display = 'block';
el.style.height = '300px';
} else {
if (getStyle(el, 'display') != "block") {
el.style.display = 'block';
}
if (getStyle(el, 'height').match(/^(0|auto)/)) {
el.style.height = '300px';
}
}
};
angular.module('ngMap').provider('NgMap', function() {
var defaultOptions = {};
/**
* @memberof NgMap
* @function setDefaultOptions
* @param {Hash} options
* @example
* app.config(function(NgMapProvider) {
* NgMapProvider.setDefaultOptions({
* marker: {
* optimized: false
* }
* });
* });
*/
this.setDefaultOptions = function(options) {
defaultOptions = options;
};
var NgMap = function(
_$window_, _$document_, _$q_,
_NavigatorGeolocation_, _Attr2MapOptions_,
_GeoCoder_, _camelCaseFilter_, _NgMapPool_
) {
$window = _$window_;
$document = _$document_[0];
$q = _$q_;
NavigatorGeolocation = _NavigatorGeolocation_;
Attr2MapOptions = _Attr2MapOptions_;
GeoCoder = _GeoCoder_;
camelCaseFilter = _camelCaseFilter_;
NgMapPool = _NgMapPool_;
return {
defaultOptions: defaultOptions,
addMap: addMap,
deleteMap: deleteMap,
getMap: getMap,
initMap: initMap,
setStyle: setStyle,
getGeoLocation: getGeoLocation,
observeAndSet: observeAndSet
};
};
NgMap.$inject = [
'$window', '$document', '$q',
'NavigatorGeolocation', 'Attr2MapOptions',
'GeoCoder', 'camelCaseFilter', 'NgMapPool'
];
this.$get = NgMap;
});
})();
/**
* @ngdoc service
* @name StreetView
* @description
* Provides [defered/promise API](https://docs.angularjs.org/api/ng/service/$q)
* service for [Google StreetViewService]
* (https://developers.google.com/maps/documentation/javascript/streetview)
*/
(function() {
'use strict';
var $q;
/**
* Retrieves panorama id from the given map (and or position)
* @memberof StreetView
* @param {map} map Google map instance
* @param {LatLng} latlng Google LatLng instance
* default: the center of the map
* @example
* StreetView.getPanorama(map).then(function(panoId) {
* $scope.panoId = panoId;
* });
* @returns {HttpPromise} Future object
*/
var getPanorama = function(map, latlng) {
latlng = latlng || map.getCenter();
var deferred = $q.defer();
var svs = new google.maps.StreetViewService();
svs.getPanoramaByLocation( (latlng||map.getCenter), 100,
function (data, status) {
// if streetView available
if (status === google.maps.StreetViewStatus.OK) {
deferred.resolve(data.location.pano);
} else {
// no street view available in this range, or some error occurred
deferred.resolve(false);
//deferred.reject('Geocoder failed due to: '+ status);
}
}
);
return deferred.promise;
};
/**
* Set panorama view on the given map with the panorama id
* @memberof StreetView
* @param {map} map Google map instance
* @param {String} panoId Panorama id fro getPanorama method
* @example
* StreetView.setPanorama(map, panoId);
*/
var setPanorama = function(map, panoId) {
var svp = new google.maps.StreetViewPanorama(
map.getDiv(), {enableCloseButton: true}
);
svp.setPano(panoId);
};
var StreetView = function(_$q_) {
$q = _$q_;
return {
getPanorama: getPanorama,
setPanorama: setPanorama
};
};
StreetView.$inject = ['$q'];
angular.module('ngMap').service('StreetView', StreetView);
})();
return 'ngMap';
}));<|fim▁end|> | |
<|file_name|>borrowck-mut-addr-of-imm-var.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let x: int = 3;
let y: &mut int = &mut x; //~ ERROR cannot borrow
*y = 5;
info2!("{:?}", *y);
}<|fim▁end|> | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>HotPotatoHost.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This application simulates turn-based games hosted on a server.
* Copyright (C) 2014
* Initiators : Fabien Delecroix and Yoann Dufresne
* Developpers : Raphael Bauduin and Celia Cacciatore
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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.<|fim▁hole|> ******************************************************************************/
package games.hotpotato;
import clients.local.LocalClientFactory;
import model.engine.GameHost;
import games.hotpotato.moves.PassFactory;
/**
* Hosts the HotPotato game.
*
* @author Cacciatore Celia - Bauduin Raphael
*/
public class HotPotatoHost extends GameHost<HotPotato> {
public HotPotatoHost() {
super(4, new LocalClientFactory());
}
@Override
protected void createGame() {
this.game = new HotPotato(this.players);
}
@Override
protected void createFactories() {
this.firstMoveFactory = new PassFactory();
}
}<|fim▁end|> | *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>fitvids.js<|end_file_name|><|fim▁begin|>/**
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*/
!function(t){"use strict"
t.fn.fitVids=function(e){var i={customSelector:null,ignore:null}
if(!document.getElementById("fit-vids-style")){var r=document.head||document.getElementsByTagName("head")[0],a=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",d=document.createElement("div")<|fim▁hole|>i.customSelector&&e.push(i.customSelector)
var r=".fitvidsignore"
i.ignore&&(r=r+", "+i.ignore)
var a=t(this).find(e.join(","))
a=a.not("object object"),a=a.not(r),a.each(function(){var e=t(this)
if(!(e.parents(r).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16))
var i="object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height(),a=isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10),d=i/a
if(!e.attr("id")){var o="fitvid"+Math.floor(999999*Math.random())
e.attr("id",o)}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*d+"%"),e.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto)<|fim▁end|> | d.innerHTML='<p>x</p><style id="fit-vids-style">'+a+"</style>",r.appendChild(d.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"] |
<|file_name|>DiagonalizationMethods.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 11:09:05 2013
@author: jotterbach
"""
from numpy import *
from ED_HalfFilling import EigSys_HalfFilling
from DotProduct import scalar_prod
from multiprocessing import *
from multiprocessing import Pool
import matplotlib.pyplot as plt
from ParallelizationTools import info
from os.path import *
from scipy.special import *
from scipy.linalg import qr
from DotProduct import scalar_prod
from Correlation_Generator import *
from datetime import datetime
''' define the datestamp for the filenames '''
date = str(datetime.now())
now = date[0:10]+'_'+date[11:13]+'h'+date[14:16]+'m'
def AngleSpectrum(number_particles, noEV, gamma, hopping, angle):
"""
AngleSpectrum(number_particles, noEV, gamma, hopping, angle):
computes the energy eigenspectrum as a function of the angle of the dipoles
with the chain axis given an unit interaction V and a hopping J
parameters of the function:
number_particles: number of particles in the problem
noEV: number of eigenvalues being calculated
gamma: opening angle of the zig-zag chain
hopping: hopping parameter in units of interaction V
angle: array containing the angles as a multiple of **PI**
"""
''' default values for other methods that are being called by the current
function '''
spectrum = 1 #ensures that the spectrum is calculated in EigSys_HalfFilling
independet_v1_v2 = 1 #makes v1 and v2 independent of each other
number_sites = 2*number_particles #condition for half-filling
interaction_strength = 1 #unit of energy
# number_particles = 6
# noEV = 5*number_sites #degeneracy of GS requires noEV>number_sites
# hopping = .1
# gamma = 2*pi/3
# angle = linspace(-.8,-.7,41)
''' intialization of variables that will be stored for later use '''
eigval = zeros((angle.shape[0],noEV), dtype = float)
degeneracies = zeros((angle.shape[0],1))
v1 = zeros((angle.shape[0],1))
v2 = zeros((angle.shape[0],1))
v3 = zeros((angle.shape[0],1))
''' actual method call '''
if __name__ == 'DiagonalizationMethods':
info('main line')
pool = Pool()
''' invocation of the eigenvalue procedure '''
it = [pool.apply_async(EigSys_HalfFilling, (number_particles, number_sites, hopping, interaction_strength, angle[angle_idx], noEV, spectrum, gamma, independet_v1_v2)) for angle_idx in range(0,angle.shape[0])]
for ridx in it:
angle_idx = nonzero(angle == ridx.get()[0])
eigval[angle_idx,:]= ridx.get()[1]#floor(10*around(real(ridx.get()[1]),decimals = 2))/10
degeneracies[angle_idx] = sum((eigval[angle_idx,:] == eigval[angle_idx,0]).astype(int))
v1[angle_idx]=ridx.get()[2]
v2[angle_idx]=ridx.get()[3]
v3[angle_idx]=ridx.get()[4]
print 'angle:', angle[angle_idx], '\nground-state degeneracy:', degeneracies[angle_idx]
filename = 'FigureData/'+now+'_AngleSpectrum_N'+str(number_particles)+'_J'+str(hopping).replace('.','-')+'_vdd'+str(interaction_strength).replace('.','-')
save(filename+'_EigVals', eigval)
save(filename+'_angle', angle)
print 'saved: '+filename
def InteractionSpectrum(number_particles, noEV, gamma, angle, interaction_strength):
''' computes the eigenvalue spectrum for a given angle
as a function of the interaction strength in units of J
parameters of the function:
number_particles: number of particles in the problem
noEV: number of eigenvalues being calculated
gamma: opening angle of the zig-zag chain
angle: array containing the angles as a multiple of **PI**
interaction_strength: interaction in units of hopping J
'''
''' default values for other methods that are being called by the current
function '''
spectrum = 1 #ensures that the spectrum is calculated in EigSys_HalfFilling
independent_v1_v2 = 1 #makes v1 and v2 independent of each other
number_sites = 2*number_particles #condition for half-filling
hopping = 1 #unit of energy
''' intialization of variables that will be stored for later use '''
eigval = zeros((len(interaction_strength),noEV), dtype = float)
v1 = zeros((interaction_strength.shape[0],1))
v2 = zeros((interaction_strength.shape[0],1))
v3 = zeros((interaction_strength.shape[0],1))
''' actual method call '''
if __name__ == 'DiagonalizationMethods':
info('main line')
pool = Pool()
''' invocation of eigenvalue procedure '''
it = [pool.apply_async(EigSys_HalfFilling, (number_particles, number_sites, hopping, interaction_strength[idx], angle, noEV, spectrum, gamma, independent_v1_v2)) for idx in range(len(interaction_strength))]
for ridx in it:
idx = nonzero(interaction_strength == ridx.get()[6])
v1=ridx.get()[2]
v2=ridx.get()[3]
v3=ridx.get()[4]
eigval[idx,:]= ridx.get()[1]#floor(10*around(real(ridx.get()[1]),decimals = 2))/10
print 'interaction:', interaction_strength[idx], 'interaction constants: ', v1,v2,v3
filename = 'FigureData/'+now+'_InteractionSpectrum_N'+str(number_particles)+'_J'+str(hopping).replace('.','-')+'_Theta'+str(angle).replace('.','-')
save(filename+'_EigVals', eigval)
save(filename+'_interaction',interaction_strength)
print 'saved: '+filename
def HoppingSpectrum(number_particles, noEV, gamma, angle, hopping):
''' computes the eigenvalue spectrum for given interactions as a function
of the hopping in units of interaction V
parameters of the function:
number_particles: number of particles in the problem
noEV: number of eigenvalues being calculated
gamma: opening angle of the zig-zag chain
angle: array containing the angles as a multiple of **PI**
hopping: hopping in units of interaction V
'''
''' default values for other methods that are being called by the current
function '''
spectrum = 1 #ensures that the spectrum is calculated in EigSys_HalfFilling
independent_v1_v2 = 1 #makes v1 and v2 independent of each other
number_sites = 2*number_particles #condition for half-filling
interaction_strength = 1 #unit of energy
''' intialization of variables that will be stored for later use '''
eigval = zeros((len(hopping),noEV), dtype = float)
v1 = zeros((hopping.shape[0],1))
v2 = zeros((hopping.shape[0],1))
v3 = zeros((hopping.shape[0],1))
''' actual method call '''
if __name__ == 'DiagonalizationMethods':
info('main line')
pool = Pool()
''' invocation of eigenvalue procedure ''' <|fim▁hole|> v1=ridx.get()[2]
v2=ridx.get()[3]
v3=ridx.get()[4]
eigval[idx,:]= ridx.get()[1]
print 'hopping:', hopping[idx], 'interactions: ', v1,v2,v3
filename = 'FigureData/'+now+'_HoppingSpectrum-nnhopping_N'+str(number_particles)+'_vdd'+str(interaction_strength).replace('.','-')+'_Theta'+str(angle).replace('.','-')
save(filename+'_EigVals', eigval)
save(filename+'_hopping', hopping)
print 'saved: '+filename
def DensityCorrelations(number_particles, noEV, gamma, angle, hopping, degeneracy):
''' computes the density correlation function for a given set of angle,
interaction and hopping'''
''' default values for other methods that are being called by the current
function '''
spectrum = 0 #ensures that the spectrum AND the eigenvectors are calculated in EigSys_HalfFilling
independent_v1_v2 = 1 #makes v1 and v2 independent of each other
number_sites = 2*number_particles #condition for half-filling
interaction_strength = 1 #unit of energy
''' function specific parameter initilaization '''
eigval, eigvec, basisstates = EigSys_HalfFilling(number_particles, number_sites, hopping, interaction_strength, angle, noEV, spectrum, gamma, independent_v1_v2)
eigval = around(real(eigval),decimals = 2)
print '\nlow-energy spectrum: \n', eigval
print 'GS degeneracy:', degeneracy
eigvec = eigvec.astype(complex)
if degeneracy > 1:
print '\nOrthogonalizing GS manifold'
eigvec_GS = zeros((eigvec.shape[0],degeneracy), dtype = complex)
for m in range(degeneracy):
eigvec_GS[:,m] = eigvec[:,m]
Q, R = qr(eigvec_GS, mode = 'economic')
for m in range(degeneracy):
eigvec[:,m] = Q[:,m]
del Q, R, eigvec_GS
number_states = basisstates.shape[0]
if __name__ == 'DiagonalizationMethods':
''' local density '''
print '\nCalculating local density'
local_density = zeros((2*number_particles,1), dtype = float)
pool = Pool()
for deg_idx in range(0,degeneracy):
print 'state index: ', deg_idx
it = [pool.apply_async(loc_den, (basisstates, number_particles, number_states, eigvec[:,deg_idx], site_idx)) for site_idx in range(0,2*number_particles)]
for ridx in it:
site_idx = ridx.get()[0]
local_density[site_idx] += real(ridx.get()[1])/degeneracy
''' density-density correlation '''
print '\nCalculating density-density correlations'
g2 = zeros((number_sites,1), dtype = float)
for deg_idx in range(0,degeneracy):
print 'state index: ', deg_idx
it = [pool.apply_async(pair_corr, (basisstates, number_particles, number_sites, number_states, eigvec[:,deg_idx], site_idx)) for site_idx in range(0,number_sites)]
for ridx in it:
site_idx = ridx.get()[0]
g2[site_idx] += real(ridx.get()[1])/degeneracy
filename='FigureData/'+now+'_Correlations_N'+str(number_particles)+'_J'+str(hopping).replace('.','-')+'_vdd'+str(interaction_strength).replace('.','-')+'_Theta'+str(angle).replace('.','-')
save(filename+'_local_density', local_density)
save(filename+'_g2', g2)
print 'saved: '+filename<|fim▁end|> | it = [pool.apply_async(EigSys_HalfFilling, (number_particles, number_sites, hopping[idx], interaction_strength, angle, noEV, spectrum, gamma, independent_v1_v2)) for idx in range(len(hopping))]
for ridx in it:
idx = nonzero(hopping == ridx.get()[5]) |
<|file_name|>titcoin.py<|end_file_name|><|fim▁begin|>import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = '25174c22'.decode('hex')
P2P_PORT = 8698
ADDRESS_VERSION = 0
RPC_PORT = 8697
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
(yield helper.check_genesis_block(bitcoind, '00000000bb82b1cbe86b5fe62967c13ff2e8cdabf68adeea2038289771c3491f')) and
not (yield bitcoind.rpc_getinfo())['testnet']
))
SUBSIDY_FUNC = lambda height: 69*69000000 >> (height + 1)//500000
POW_FUNC = data.hash256
BLOCK_PERIOD = 60 # s
SYMBOL = 'TIT'
CONF_FILE_FUNC = lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'titcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/titcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.titcoin'), 'titcoin.conf')<|fim▁hole|>TX_EXPLORER_URL_PREFIX = 'http://blockexperts.com/tit/tx/'
SANE_TARGET_RANGE = (2**256//2**32//1000000 - 1, 2**256//2**32 - 1)
DUMB_SCRYPT_DIFF = 1
DUST_THRESHOLD = 0.001e8<|fim▁end|> | BLOCK_EXPLORER_URL_PREFIX = 'https://blockexperts.com/tit/hash/'
ADDRESS_EXPLORER_URL_PREFIX = 'http://blockexperts.com/tit/address/' |
<|file_name|>procsrv.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::os;
use std::run;
use std::str;
#[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
let mut env = os::env();
// Make sure we include the aux directory in the path
assert!(prog.ends_with(".exe"));
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
env = do env.map() |pair| {
let (k,v) = copy *pair;
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
else { (k,v) }
};
if prog.ends_with("rustc.exe") {
env.push((~"RUST_THREADS", ~"1"));
}
return env;
}
#[cfg(target_os = "linux")]
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
fn target_env(_lib_path: &str, _prog: &str) -> ~[(~str,~str)] {
os::env()
}
pub struct Result {status: int, out: ~str, err: ~str}
pub fn run(lib_path: &str,
prog: &str,
args: &[~str],<|fim▁hole|> let env = env + target_env(lib_path, prog);
let mut proc = run::Process::new(prog, args, run::ProcessOptions {
env: Some(env.slice(0, env.len())),
dir: None,
in_fd: None,
out_fd: None,
err_fd: None
});
for input.iter().advance |input| {
proc.input().write_str(*input);
}
let output = proc.finish_with_output();
Result {
status: output.status,
out: str::from_bytes(output.output),
err: str::from_bytes(output.error)
}
}<|fim▁end|> | env: ~[(~str, ~str)],
input: Option<~str>) -> Result {
|
<|file_name|>PointFeatureInputFormat.java<|end_file_name|><|fim▁begin|>package com.esri.mapred;
import com.esri.io.PointFeatureWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter;
import java.io.IOException;
/**
*/
public class PointFeatureInputFormat
extends AbstractInputFormat<PointFeatureWritable>
{
private final class PointFeatureReader
extends AbstractFeatureReader<PointFeatureWritable>
{
private final PointFeatureWritable m_pointFeatureWritable = new PointFeatureWritable();
public PointFeatureReader(
final InputSplit inputSplit,
final JobConf jobConf) throws IOException
{
super(inputSplit, jobConf);
}
@Override
public PointFeatureWritable createValue()
{
return m_pointFeatureWritable;
}
@Override
protected void next() throws IOException
{
m_shpReader.queryPoint(m_pointFeatureWritable.point);
putAttributes(m_pointFeatureWritable.attributes);
}
}
@Override
public RecordReader<LongWritable, PointFeatureWritable> getRecordReader(
final InputSplit inputSplit,
final JobConf jobConf,<|fim▁hole|> {
return new PointFeatureReader(inputSplit, jobConf);
}
}<|fim▁end|> | final Reporter reporter) throws IOException |
<|file_name|>punch.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-punch',
templateUrl: './punch.component.html',
styleUrls: ['./punch.component.css']
})
export class PunchComponent implements OnInit {
@Input()
value: string;
step: number = 0.1;<|fim▁hole|> min: number = 0.0;
max: number = 23.99;
autocorrect: boolean = true;
decimals: number = 2;
format: string = "n2";
showbuttons: boolean = false;
constructor() { }
ngOnInit() {
}
}<|fim▁end|> | |
<|file_name|>next_permutation.py<|end_file_name|><|fim▁begin|>"""
6 8 7 4 3 2
1. from right to left, find the first element which violates the increasing order, marked as N.
2. from right to left, find the first element which is larger that N, marked as M.
3. swap N and M.
> 7 8 6 4 3 2
4. reverse all digits on the right of M.
> 7 2 3 4 6 8
"""
class Solution:
# @param num, a list of integer
# @return a list of integer
def nextPermutation(self, num):
<|fim▁hole|> return num
# from right to left, find the first num which violates the increasing trend.
idx = len(num) - 1
while idx > 0:
if num[idx - 1] < num[idx]:
break
idx -= 1
# ..., find the 1st num which is larger than num[idx]
pn = len(num) - 1
if idx > 0:
idx -= 1
while pn >= 0 and num[pn] <= num[idx]:
pn -= 1
# swap idx and pn
num[idx], num[pn] = num[pn], num[idx]
idx += 1
# reverse all digits on the right of idx .
r_num = num[idx:]
r_num.reverse()
return num[:idx] + r_num
sol = Solution()
print sol.nextPermutation([1,3,2])<|fim▁end|> | if len(num) <= 1:
|
<|file_name|>backup.rs<|end_file_name|><|fim▁begin|>// id number A unique number used to identify and reference
// a specific image.
// name string The display name of the image. This is shown in
// the web UI and is generally a descriptive title for the image in question.
// type string The kind of image, describing the duration of
// how long the image is stored. This is one of "snapshot", "temporary" or
// "backup".
// distribution string The base distribution used for this image.
// slug nullable string A uniquely identifying string that is
// associated with each of the DigitalOcean-provided public images. These can
// be used to reference a public image as an alternative to the numeric id.
// public boolean A boolean value that indicates whether the
// image in question is public. An image that is public is available to all
// accounts. A non-public image is only accessible from your account.
// regions array An array of the regions that the image is
// available in. The regions are represented by their identifying slug values.
// min_disk_size number The minimum 'disk' required for a size to use
// this image.
use std::fmt;
use std::borrow::Cow;
use response::NamedResponse;
use response;
#[derive(Deserialize, Debug)]
pub struct Backup {
pub id: f64,
pub name: String,
#[serde(rename = "type")]
pub b_type: String,
pub distribution: String,
pub slug: Option<String>,
pub public: bool,
pub regions: Vec<String>,
pub min_disk_size: f64,
}
<|fim▁hole|>impl response::NotArray for Backup {}
impl fmt::Display for Backup {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"ID: {:.0}\n\
Name: {}\n\
Type:{}\n\
Distribution:{}\n\
Slug:{}\n\
Public:{}\n\
Regions:{}\n\
Minimum Disk Size: {:.0} MB\n",
self.id,
self.name,
self.b_type,
self.distribution,
if let Some(ref s) = self.slug {
s.clone()
} else {
"None".to_owned()
},
self.public,
self.regions.iter().fold(String::new(), |acc, s| acc + &format!(" {},", s)[..]),
self.min_disk_size)
}
}
pub type Backups = Vec<Backup>;
impl NamedResponse for Backup {
fn name<'a>() -> Cow<'a, str> { "backup".into() }
}<|fim▁end|> | |
<|file_name|>tar.gz_test.js<|end_file_name|><|fim▁begin|>"use strict";
<|fim▁hole|>/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
var task = require("../tasks/tar.gz"),
fs = require("fs");
exports["targz"] = {
setUp: function(done) {
// setup here
done();
},
"targz sqlite3": function(test) {
test.expect(1);
var actual;
actual = fs.statSync("tmp/node_sqlite3.node");
test.equal(actual.size, 831488);
test.done();
}
};<|fim▁end|> | |
<|file_name|>LuaUpvalueIdentifierImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Jon S Akhtar (Sylvanaar)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sylvanaar.idea.Lua.lang.psi.impl.symbols;
import com.intellij.lang.ASTNode;
import com.sylvanaar.idea.Lua.lang.psi.symbols.LuaParameter;
import com.sylvanaar.idea.Lua.lang.psi.symbols.LuaSymbol;
import com.sylvanaar.idea.Lua.lang.psi.symbols.LuaUpvalueIdentifier;
/**
* Created by IntelliJ IDEA.
* User: Jon S Akhtar
* Date: 1/26/11
* Time: 9:23 PM
*/
public class LuaUpvalueIdentifierImpl extends LuaLocalIdentifierImpl implements LuaUpvalueIdentifier {
public LuaUpvalueIdentifierImpl(ASTNode node) {
super(node);
}
@Override
public boolean isSameKind(LuaSymbol symbol) {<|fim▁hole|> public String toString() {
return "Upvalue: " + getText();
}
}<|fim▁end|> | return symbol instanceof LuaLocalDeclarationImpl || symbol instanceof LuaParameter;
}
@Override |
<|file_name|>diff.rs<|end_file_name|><|fim▁begin|>use ansi_term::{ANSIStrings, Style};
use ansi_term::Colour::{Green, Red};
use config::use_ansi;
use diff;
use std::borrow::Borrow;
use std::cmp::max;
use std::fmt::{Debug, Write};
use unicode_width::UnicodeWidthStr;
/// Can be diffed
pub trait Diffable<T: ?Sized>: PartialEq<T> {
fn diff(&self, to: &T) -> String;
}
fn diff_str(left: &str, right: &str) -> String {
let mut buf = String::new();
for diff in diff::lines(left, right) {
match diff {
diff::Result::Left(l) => {
writeln!(buf,
"{}",
ANSIStrings(&[DIFF_LEFT.paint("-"), DIFF_LEFT.paint(l)]))
.unwrap()
}
diff::Result::Both(l, _) => writeln!(buf, " {}", l).unwrap(),
diff::Result::Right(r) => {
writeln!(buf,
"{}",
ANSIStrings(&[DIFF_RIGHT.paint("+"), DIFF_RIGHT.paint(r)]))
.unwrap()
}
}
}
buf
}
impl Diffable<str> for str {
<|fim▁hole|>
impl Diffable<str> for String {
fn diff(&self, to: &str) -> String {
diff_str(self, to)
}
}
impl<'a, 'b> Diffable<&'b str> for &'a str {
fn diff(&self, to: &&str) -> String {
diff_str(self, to)
}
}
lazy_static!{
static ref DIFF_LEFT: Style = {
if use_ansi() {
Style::new().fg(Red)
} else {
Style::new()
}
};
static ref DIFF_RIGHT: Style = {
if use_ansi() {
Style::new().fg(Green)
} else {
Style::new()
}
};
}
fn diff_slice<T: Debug + PartialEq>(left: &[T], right: &[T]) -> String {
let mut left_diffs = Vec::new();
let mut right_diffs = Vec::new();
let mut i = 0;
for diff in diff::slice(left, right).into_iter() {
match diff {
diff::Result::Left(l) => {
left_diffs.push((i, l));
}
diff::Result::Both(..) => i += 1,
diff::Result::Right(r) => {
right_diffs.push((i, r));
i += 1;
}
}
}
let mut lmax = 3;
let mut rmax = 8;
let mut buf = String::new();
for (&(_, l), &(_, r)) in left_diffs.as_slice().iter().zip(right_diffs.as_slice().iter()) {
write!(buf, "{:?}", l).unwrap();
let lsize = UnicodeWidthStr::width(buf.as_str());
buf.clear();
write!(buf, "{:?}", r).unwrap();
let rsize = UnicodeWidthStr::width(buf.as_str());
buf.clear();
lmax = max(lmax, lsize);
rmax = max(rmax, rsize);
}
// TODO: handle Long text.
// prints a table
writeln!(buf,
"| {i:^5} | {l:^lmax$} | {r:<^rmax$} |",
i = "Index",
l = "Got",
r = "Expected",
lmax = lmax,
rmax = rmax)
.unwrap();
writeln!(buf,
"|-{c:-^5}-|-{c:-^lmax$}-|-{c:-^rmax$}-|",
c = '-',
lmax = lmax,
rmax = rmax)
.unwrap();
debug!("diff_slice: lmax={lmax}, rmax={rmax}",
lmax = lmax,
rmax = rmax);
for ((idx, left), (r_idx, right)) in left_diffs.into_iter().zip(right_diffs) {
assert_eq!(idx, r_idx, "slice_diff: left index == right index");
writeln!(buf,
"| {i:^5} | {l:^lmax$?} | {r:^rmax$?} |",
i = idx,
l = left,
r = right,
lmax = lmax,
rmax = rmax)
.unwrap();
}
buf
}
impl<T: Debug + PartialEq> Diffable<[T]> for [T] {
fn diff(&self, to: &[T]) -> String {
diff_slice(self, to.borrow())
}
}
macro_rules! impl_for_slice_like {
($T:ident, $STRUCT:ty) => {
impl_for_slice_like!($T, $STRUCT, $STRUCT);
};
($T:ident, $STRUCT:ty, $TO:ty) => {
impl<$T: Debug + PartialEq> Diffable<$TO> for $STRUCT {
fn diff(&self, to: &$TO) -> String {
diff_slice(self.borrow(), to.borrow())
}
}
};
}
impl_for_slice_like!(T, Vec<T>);
impl_for_slice_like!(T, [T; 0]);
impl_for_slice_like!(T, [T; 1]);
impl_for_slice_like!(T, [T; 2]);
impl_for_slice_like!(T, [T; 3]);
impl_for_slice_like!(T, [T; 4]);
impl_for_slice_like!(T, [T; 5]);
impl_for_slice_like!(T, [T; 6]);
impl_for_slice_like!(T, [T; 7]);
impl_for_slice_like!(T, [T; 8]);
impl_for_slice_like!(T, [T; 9]);
impl_for_slice_like!(T, [T; 10]);
impl_for_slice_like!(T, [T; 11]);
impl_for_slice_like!(T, [T; 12]);
impl_for_slice_like!(T, [T; 13]);
impl_for_slice_like!(T, [T; 14]);
impl_for_slice_like!(T, [T; 15]);
impl_for_slice_like!(T, [T; 16]);
impl_for_slice_like!(T, [T; 17]);
impl_for_slice_like!(T, [T; 18]);
impl_for_slice_like!(T, [T; 19]);
impl_for_slice_like!(T, [T; 20]);
impl_for_slice_like!(T, [T; 21]);
impl_for_slice_like!(T, [T; 22]);
impl_for_slice_like!(T, [T; 23]);
impl_for_slice_like!(T, [T; 24]);
impl_for_slice_like!(T, [T; 25]);
impl_for_slice_like!(T, [T; 26]);
impl_for_slice_like!(T, [T; 27]);
impl_for_slice_like!(T, [T; 28]);
impl_for_slice_like!(T, [T; 29]);
impl_for_slice_like!(T, [T; 30]);
impl_for_slice_like!(T, [T; 31]);
impl_for_slice_like!(T, [T; 32]);
fn _assert_impl() {
fn _assert<A: ?Sized + Diffable<To>, To: ?Sized>() {}
_assert::<str, str>();
_assert::<String, str>();
_assert::<Vec<u8>, Vec<u8>>();
_assert::<Vec<u8>, Vec<u8>>();
_assert::<[u8; 4], [u8; 4]>();
_assert::<Vec<&str>, Vec<&str>>();
}<|fim▁end|> | fn diff(&self, to: &str) -> String {
diff_str(self, to)
}
}
|
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>const App = require('./spec/app');
module.exports = config => {
const params = {
basePath: '',
frameworks: [
'express-http-server',
'jasmine'
],
files: [
'lib/**/*.js'
],
colors: true,
singleRun: true,
logLevel: config.LOG_WARN,
browsers: [
'Chrome',
'PhantomJS'
],
concurrency: Infinity,
reporters: [
'spec',
'coverage'
],
preprocessors: {
'lib/**/*.js': ['coverage']
},
coverageReporter: {
dir: 'coverage/',
reporters: [
{
type: 'html',
subdir: 'report'
},
{
type: 'lcovonly',
subdir: './',
file: 'coverage-front.info'
},<|fim▁hole|> ]
},
browserDisconnectTimeout: 15000,
browserNoActivityTimeout: 120000,
expressHttpServer: {
port: 8092,
appVisitor: App
}
};
if (process.env.TRAVIS) {
params.browsers = [
'PhantomJS'
];
}
config.set(params);
};<|fim▁end|> | {
type: 'lcov',
subdir: '.'
} |
<|file_name|>Window.js<|end_file_name|><|fim▁begin|>var _elm_lang$window$Native_Window = function()
{
var size = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
callback(_elm_lang$core$Native_Scheduler.succeed({
width: window.innerWidth,
height: window.innerHeight
}));<|fim▁hole|> size: size
};
}();<|fim▁end|> | });
return { |
<|file_name|>conditional-compile.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Crate use statements
#[cfg(bogus)]
use flippity;
#[cfg(bogus)]
static b: bool = false;
static b: bool = true;
mod rustrt {
#[cfg(bogus)]
extern {
// This symbol doesn't exist and would be a link error if this
// module was translated
pub fn bogus();
}
extern {}
}
#[cfg(bogus)]
type t = isize;
type t = bool;
#[cfg(bogus)]
enum tg { foo, }
enum tg { bar, }
#[cfg(bogus)]
struct r {
i: isize,
}
#[cfg(bogus)]
fn r(i:isize) -> r {
r {
i: i
}
}
struct r {
i: isize,
}
fn r(i:isize) -> r {
r {
i: i
}
}
#[cfg(bogus)]
mod m {
// This needs to parse but would fail in typeck. Since it's not in
// the current config it should not be typechecked.
pub fn bogus() { return 0; }
}
mod m {
// Submodules have slightly different code paths than the top-level
// module, so let's make sure this jazz works here as well
#[cfg(bogus)]
pub fn f() { }
pub fn f() { }
}
// Since the bogus configuration isn't defined main will just be
// parsed, but nothing further will be done with it
#[cfg(bogus)]
pub fn main() { panic!() }
pub fn main() {
// Exercise some of the configured items in ways that wouldn't be possible
// if they had the bogus definition
assert!((b));
let _x: t = true;
let _y: tg = tg::bar;
test_in_fn_ctxt();
}
fn test_in_fn_ctxt() {
#[cfg(bogus)]
fn f() { panic!() }
fn f() { }
f();
#[cfg(bogus)]
static i: isize = 0;
static i: isize = 1;
assert_eq!(i, 1);
}
mod test_foreign_items {
pub mod rustrt {
extern {
#[cfg(bogus)]
pub fn write() -> String;
pub fn write() -> String;
}
}
}
mod test_use_statements {
#[cfg(bogus)]
use flippity_foo;
}
mod test_methods {
struct Foo {
bar: usize
}
impl Fooable for Foo {
#[cfg(bogus)]
fn what(&self) { }
fn what(&self) { }
#[cfg(bogus)]
fn the(&self) { }
fn the(&self) { }
}
trait Fooable {
#[cfg(bogus)]
fn what(&self);
fn what(&self);
#[cfg(bogus)]
fn the(&self);
fn the(&self);
}
}<|fim▁end|> | // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>promote.test.ts<|end_file_name|><|fim▁begin|>import {expect, test} from '@oclif/test'
import * as PromoteCmd from '../../../src/commands/pipelines/promote'
describe('pipelines:promote', () => {
const apiUrl = 'https://api.heroku.com'
const pipeline = {
id: '123-pipeline-456',
name: 'example-pipeline',
}
const sourceApp = {
id: '123-source-app-456',
name: 'example-staging',
pipeline,
}
const targetApp1 = {
id: '123-target-app-456',
name: 'example-production',
pipeline,
}
const targetApp2 = {
id: '456-target-app-789',
name: 'example-production-eu',
pipeline,
}
const targetReleaseWithOutput = {
id: '123-target-release-456',
output_stream_url: 'https://busl.example/release',
}
const sourceCoupling = {
app: sourceApp,
id: '123-source-app-456',
pipeline,
stage: 'staging',
}
const targetCoupling1 = {
app: targetApp1,
id: '123-target-app-456',
pipeline,
stage: 'production',
}
const targetCoupling2 = {
app: targetApp2,
id: '456-target-app-789',
pipeline,
stage: 'production',
}
<|fim▁hole|> source: {app: sourceApp},
status: 'pending',
}
function mockPromotionTargets(testInstance: typeof test) {
let pollCount = 0
return testInstance
.nock(apiUrl, api => {
api
.get(`/pipeline-promotions/${promotion.id}/promotion-targets`)
.thrice()
.reply(function () {
pollCount++
return [
200,
[
{
app: {id: targetApp1.id},
status: 'successful',
error_message: null,
},
{
app: {id: targetApp2.id},
// Return failed on the second poll loop
status: pollCount > 1 ? 'failed' : 'pending',
error_message: pollCount > 1 ? 'Because reasons' : null,
},
],
]
})
})
}
function setup(setupTest: typeof test) {
return setupTest
.nock('https://api.heroku.com', api => {
api
.get(`/apps/${sourceApp.name}/pipeline-couplings`)
.reply(200, sourceCoupling)
.get(`/pipelines/${pipeline.id}/pipeline-couplings`)
.reply(200, [sourceCoupling, targetCoupling1, targetCoupling2])
.post('/filters/apps')
.reply(200, [sourceApp, targetApp1, targetApp2])
})
}
setup(mockPromotionTargets(test))
.stdout()
.stderr()
.nock('https://api.heroku.com', api => {
api.post('/pipeline-promotions', {
pipeline: {id: pipeline.id},
source: {app: {id: sourceApp.id}},
targets: [
{app: {id: targetApp1.id}},
{app: {id: targetApp2.id}},
],
}).reply(201, promotion)
})
.command(['pipelines:promote', `--app=${sourceApp.name}`])
.it('promotes to all apps in the next stage', ctx => {
expect(ctx.stdout).to.contain('failed')
expect(ctx.stdout).to.contain('Because reasons')
})
context('passing a `to` flag', function () {
setup(mockPromotionTargets(test))
.stdout()
.stderr()
.nock('https://api.heroku.com', api => {
api
.post('/pipeline-promotions', {
pipeline: {id: pipeline.id},
source: {app: {id: sourceApp.id}},
targets: [
{app: {id: targetApp1.id}},
],
}).reply(201, promotion)
})
.command(['pipelines:promote', `--app=${sourceApp.name}`, `--to=${targetApp1.name}`])
.it('can promote by app name', ctx => {
expect(ctx.stdout).to.contain('failed')
expect(ctx.stdout).to.contain('Because reasons')
})
setup(mockPromotionTargets(test))
.stdout()
.stderr()
.nock('https://api.heroku.com', api => {
api
.post('/pipeline-promotions', {
pipeline: {id: pipeline.id},
source: {app: {id: sourceApp.id}},
targets: [
{app: {id: targetApp1.id}},
],
}).reply(201, promotion)
})
.command(['pipelines:promote', `--app=${sourceApp.name}`, `--to=${targetApp1.id}`])
.it('can promote by app name', ctx => {
expect(ctx.stdout).to.contain('failed')
expect(ctx.stdout).to.contain('Because reasons')
})
})
context('with release phase', function () {
function mockPromotionTargetsWithRelease(testInstance: typeof test, release: any) {
let pollCount = 0
return testInstance
.nock(apiUrl, api => {
api
.post('/pipeline-promotions', {
pipeline: {id: pipeline.id},
source: {app: {id: sourceApp.id}},
targets: [
{app: {id: targetApp1.id}},
{app: {id: targetApp2.id}},
],
})
.reply(201, promotion)
.get(`/apps/${targetApp1.id}/releases/${release.id}`)
.reply(200, targetReleaseWithOutput)
.get(`/pipeline-promotions/${promotion.id}/promotion-targets`)
.twice()
.reply(200, function () {
pollCount++
return [{
app: {id: targetApp1.id},
release: {id: release.id},
status: pollCount > 1 ? 'successful' : 'pending',
error_message: null,
}]
})
})
.nock('https://busl.example', api => {
api
.get('/release')
.reply(200, 'Release Command Output')
})
}
mockPromotionTargetsWithRelease(setup(test), targetReleaseWithOutput)
.stdout()
.stderr()
.command(['pipelines:promote', `--app=${sourceApp.name}`])
.it('streams the release command output', ctx => {
expect(ctx.stdout).to.contain('Running release command')
expect(ctx.stdout).to.contain('Release Command Output')
expect(ctx.stdout).to.contain('successful')
})
})
context('with release phase that errors', function () {
function mockPromotionTargetsWithRelease(testInstance: typeof test, release: any) {
let pollCount = 0
return testInstance
.nock(apiUrl, api => {
api
.post('/pipeline-promotions', {
pipeline: {id: pipeline.id},
source: {app: {id: sourceApp.id}},
targets: [
{app: {id: targetApp1.id}},
{app: {id: targetApp2.id}},
],
})
.reply(201, promotion)
.get(`/apps/${targetApp1.id}/releases/${release.id}`)
.reply(200, targetReleaseWithOutput)
.get(`/pipeline-promotions/${promotion.id}/promotion-targets`)
.reply(200, function () {
pollCount++
return [{
app: {id: targetApp1.id},
release: {id: release.id},
status: pollCount > 1 ? 'successful' : 'pending',
error_message: null,
}]
})
})
.nock('https://busl.example', api => {
api
.get('/release')
.times(100)
.reply(404, 'Release Command Output')
})
}
mockPromotionTargetsWithRelease(setup(test), targetReleaseWithOutput)
.stderr()
.stdout()
.stub(PromoteCmd, 'sleep', () => {
return Promise.resolve()
})
.command(['pipelines:promote', `--app=${sourceApp.name}`])
.catch((error: any) => {
expect(error.oclif.exit).to.equal(2)
expect(error.message).to.equal('stream release output not available')
})
.it('attempts stream and returns error')
})
})<|fim▁end|> | const promotion = {
id: '123-promotion-456', |
<|file_name|>logout.spec.js<|end_file_name|><|fim▁begin|>'use strict';
var config = browser.params;
var UserModel = require(config.serverConfig.root + '/server/api/user/user.model');
describe('Logout View', function() {
var login = function(user) {
let promise = browser.get(config.baseUrl + '/login');
require('../login/login.po').login(user);
return promise;
};
var testUser = {<|fim▁hole|> password: 'test'
};
beforeEach(function() {
return UserModel
.removeAsync()
.then(function() {
return UserModel.createAsync(testUser);
})
.then(function() {
return login(testUser);
});
});
after(function() {
return UserModel.removeAsync();
})
describe('with local auth', function() {
it('should logout a user and redirecting to "/"', function() {
var navbar = require('../../components/navbar/navbar.po');
browser.getCurrentUrl().should.eventually.equal(config.baseUrl + '/');
navbar.navbarAccountGreeting.getText().should.eventually.equal('Hello ' + testUser.name);
browser.get(config.baseUrl + '/logout');
navbar = require('../../components/navbar/navbar.po');
browser.getCurrentUrl().should.eventually.equal(config.baseUrl + '/');
navbar.navbarAccountGreeting.isDisplayed().should.eventually.equal(false);
});
});
});<|fim▁end|> | name: 'Test User',
email: '[email protected]', |
<|file_name|>writer.rs<|end_file_name|><|fim▁begin|>use std::io::{ Write, Error, ErrorKind };
use super::super::classfile::*;
pub struct ClassWriter<'a> {
target: &'a mut Write
}
impl<'a> ClassWriter<'a> {
pub fn new<T>(target: &'a mut T) -> ClassWriter where T: Write {
ClassWriter { target: target }
}
pub fn write_class(&mut self, classfile: &Classfile) -> Result<usize, Error> {
self.write_magic_bytes()
.and(self.write_classfile_version(&classfile.version))
.and(self.write_constant_pool(&classfile.constant_pool))
.and(self.write_access_flags(&classfile.access_flags))
.and(self.write_constant_pool_index(&classfile.this_class))
.and(self.write_constant_pool_index(&classfile.super_class))
.and(self.write_interfaces(&classfile.interfaces))
.and(self.write_fields(&classfile.fields, &classfile.constant_pool))
.and(self.write_methods(&classfile.methods, &classfile.constant_pool))
.and(self.write_attributes(&classfile.attributes, &classfile.constant_pool))
}
pub fn write_magic_bytes(&mut self) -> Result<usize, Error> {
self.write_u32(0xCAFEBABE)
}
pub fn write_classfile_version(&mut self, version: &ClassfileVersion) -> Result<usize, Error> {<|fim▁hole|> pub fn write_constant_pool(&mut self, cp: &ConstantPool) -> Result<usize, Error> {
cp.constants.iter().fold(self.write_u16(cp.cp_len() as u16), |acc, x| {
match acc {
Ok(ctr) => self.write_constant(x).map(|c| c + ctr),
err@_ => err
}
})
}
fn write_constant(&mut self, constant: &Constant) -> Result<usize, Error> {
match constant {
&Constant::Utf8(ref bytes) => self.write_u8(1).and(self.write_u16(bytes.len() as u16)).and(self.write_n(bytes)),
&Constant::Integer(ref value) => self.write_u8(3).and(self.write_u32(*value)),
&Constant::Float(ref value) => self.write_u8(4).and(self.write_u32(*value)),
&Constant::Long(ref value) => self.write_u8(5).and(self.write_u64(*value)),
&Constant::Double(ref value) => self.write_u8(6).and(self.write_u64(*value)),
&Constant::Class(ref idx) => self.write_u8(7).and(self.write_u16(idx.idx as u16)),
&Constant::String(ref idx) => self.write_u8(8).and(self.write_u16(idx.idx as u16)),
&Constant::MethodType(ref idx) => self.write_u8(16).and(self.write_u16(idx.idx as u16)),
&Constant::FieldRef { class_index: ref c_idx, name_and_type_index: ref n_idx } => self.write_u8(9).and(self.write_u16(c_idx.idx as u16)).and(self.write_u16(n_idx.idx as u16)),
&Constant::MethodRef { class_index: ref c_idx, name_and_type_index: ref n_idx } => self.write_u8(10).and(self.write_u16(c_idx.idx as u16)).and(self.write_u16(n_idx.idx as u16)),
&Constant::InterfaceMethodRef { class_index: ref c_idx, name_and_type_index: ref n_idx } => self.write_u8(11).and(self.write_u16(c_idx.idx as u16)).and(self.write_u16(n_idx.idx as u16)),
&Constant::NameAndType { name_index: ref n_idx, descriptor_index: ref d_idx } => self.write_u8(12).and(self.write_u16(n_idx.idx as u16)).and(self.write_u16(d_idx.idx as u16)),
&Constant::MethodHandle { reference_kind: ref kind, reference_index: ref r_idx } => self.write_u8(15).and(self.write_u8(kind.to_u8())).and(self.write_u16(r_idx.idx as u16)),
&Constant::InvokeDynamic { bootstrap_method_attr_index: ref m_idx, name_and_type_index: ref n_idx } => self.write_u8(18).and(self.write_u16(m_idx.idx as u16)).and(self.write_u16(n_idx.idx as u16)),
&Constant::Placeholder => Ok(0),
_ => Err(Error::new(ErrorKind::InvalidData, "Unknown constant detected"))
}
}
fn write_access_flags(&mut self, flags: &AccessFlags) -> Result<usize, Error> {
self.write_u16(flags.flags)
}
fn write_constant_pool_index(&mut self, class_index: &ConstantPoolIndex) -> Result<usize, Error> {
self.write_u16(class_index.idx as u16)
}
fn write_interfaces(&mut self, ifs: &Vec<ConstantPoolIndex>) -> Result<usize, Error> {
ifs.iter().fold(self.write_u16(ifs.len() as u16), |acc, x| {
match acc {
Ok(ctr) => self.write_u16(x.idx as u16).map(|c| c + ctr),
err@_ => err
}
})
}
fn write_fields(&mut self, fields: &Vec<Field>, cp: &ConstantPool) -> Result<usize, Error> {
fields.iter().fold(self.write_u16(fields.len() as u16), |acc, x| {
match acc {
Ok(ctr) => self.write_field(x, cp).map(|c| c + ctr),
err@_ => err
}
})
}
fn write_field(&mut self, field: &Field, cp: &ConstantPool) -> Result<usize, Error> {
self.write_access_flags(&field.access_flags)
.and(self.write_constant_pool_index(&field.name_index))
.and(self.write_constant_pool_index(&field.descriptor_index))
.and(self.write_attributes(&field.attributes, cp))
}
fn write_methods(&mut self, methods: &Vec<Method>, cp: &ConstantPool) -> Result<usize, Error> {
methods.iter().fold(self.write_u16(methods.len() as u16), |acc, x| {
match acc {
Ok(ctr) => self.write_method(x, cp).map(|c| c + ctr),
err@_ => err
}
})
}
fn write_method(&mut self, method: &Method, cp: &ConstantPool) -> Result<usize, Error> {
self.write_access_flags(&method.access_flags)
.and(self.write_constant_pool_index(&method.name_index))
.and(self.write_constant_pool_index(&method.descriptor_index))
.and(self.write_attributes(&method.attributes, cp))
}
fn write_attributes(&mut self, attributes: &Vec<Attribute>, cp: &ConstantPool) -> Result<usize, Error> {
attributes.iter().fold(self.write_u16(attributes.len() as u16), |acc, x| {
match acc {
Ok(ctr) => self.write_attribute(x, cp).map(|c| c + ctr),
err@_ => err
}
})
}
fn write_attribute(&mut self, attribute: &Attribute, cp: &ConstantPool) -> Result<usize, Error> {
match attribute {
&Attribute::RawAttribute { name_index: ref n_idx, info: ref bytes } => self.write_u16(n_idx.idx as u16).and(self.write_u32(bytes.len() as u32)).and(self.write_n(bytes)),
&Attribute::ConstantValue(ref idx) => self.write_u16(cp.get_utf8_index("ConstantValue") as u16).and(self.write_u32(2)).and(self.write_u16(idx.idx as u16)),
&Attribute::Code { max_stack, max_locals, ref code, ref exception_table, ref attributes } => {
let mut target: Vec<u8> = vec![];
{
let mut code_writer = ClassWriter::new(&mut target);
let _ = code_writer.write_u16(max_stack)
.and(code_writer.write_u16(max_locals))
.and(code_writer.write_instructions(code))
.and(code_writer.write_exception_handlers(exception_table))
.and(code_writer.write_attributes(attributes, cp));
}
self.write_u16(cp.get_utf8_index("Code") as u16)
.and(self.write_u32(target.len() as u32))
.and(self.write_n(&target))
},
&Attribute::StackMapTable(ref table) => self.write_stack_map_table(table, cp),
&Attribute::Exceptions(ref table) => self.write_u16(cp.get_utf8_index("Exceptions") as u16).and(self.write_u32(2 + (table.len() as u32) * 2)).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| self.write_u16(x.idx as u16))),
&Attribute::InnerClasses(ref table) => self.write_u16(cp.get_utf8_index("InnerClasses") as u16).and(self.write_u32(2 + (table.len() as u32) * 8)).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| {
self.write_u16(x.inner_class_info_index.idx as u16)
.and(self.write_u16(x.outer_class_info_index.idx as u16))
.and(self.write_u16(x.inner_name_index.idx as u16))
.and(self.write_u16(x.access_flags.flags))
})),
&Attribute::EnclosingMethod { ref class_index, ref method_index } => self.write_u16(cp.get_utf8_index("EnclosingMethod") as u16).and(self.write_u32(4)).and(self.write_u16(class_index.idx as u16)).and(self.write_u16(method_index.idx as u16)),
&Attribute::Synthetic => self.write_u16(cp.get_utf8_index("Synthetic") as u16).and(self.write_u32(0)),
&Attribute::Signature(ref idx) => self.write_u16(cp.get_utf8_index("Signature") as u16).and(self.write_u32(2)).and(self.write_u16(idx.idx as u16)),
&Attribute::SourceFile(ref idx) => self.write_u16(cp.get_utf8_index("SourceFile") as u16).and(self.write_u32(2)).and(self.write_u16(idx.idx as u16)),
&Attribute::SourceDebugExtension(ref vec) => self.write_u16(cp.get_utf8_index("SourceDebugExtension") as u16).and(self.write_u32(vec.len() as u32)).and(self.write_n(vec)),
&Attribute::LineNumberTable(ref table) => self.write_u16(cp.get_utf8_index("LineNumberTable") as u16).and(self.write_u32(2 + table.len() as u32 * 4)).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| {
self.write_u16(x.start_pc).and(self.write_u16(x.line_number))
})),
&Attribute::LocalVariableTable(ref table) => self.write_u16(cp.get_utf8_index("LocalVariableTable") as u16).and(self.write_u32(2 + table.len() as u32 * 10)).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| {
self.write_u16(x.start_pc)
.and(self.write_u16(x.length))
.and(self.write_u16(x.name_index.idx as u16))
.and(self.write_u16(x.descriptor_index.idx as u16))
.and(self.write_u16(x.index))
})),
&Attribute::LocalVariableTypeTable(ref table) => self.write_u16(cp.get_utf8_index("LocalVariableTypeTable") as u16).and(self.write_u32(2 + table.len() as u32 * 10)).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| {
self.write_u16(x.start_pc)
.and(self.write_u16(x.length))
.and(self.write_u16(x.name_index.idx as u16))
.and(self.write_u16(x.signature_index.idx as u16))
.and(self.write_u16(x.index))
})),
&Attribute::Deprecated => self.write_u16(cp.get_utf8_index("Deprecated") as u16).and(self.write_u32(0)),
&Attribute::RuntimeVisibleAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeVisibleAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(2, |acc, x| acc + x.len() as u32)))
// num_annotations
.and(self.write_u16(table.len() as u16))
// annotations
.and(table.iter().fold(Ok(0), |_, x| self.write_annotation(x, cp)))
},
&Attribute::RuntimeInvisibleAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeInvisibleAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(2, |acc, x| acc + x.len() as u32)))
// num_annotations
.and(self.write_u16(table.len() as u16))
// annotations
.and(table.iter().fold(Ok(0), |_, x| self.write_annotation(x, cp)))
},
&Attribute::RuntimeVisibleParameterAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeVisibleParameterAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(1, |acc, x| acc + x.iter().fold(2, |acc2, x2| acc2 + x2.len()) as u32)))
// num_parameters
.and(self.write_u8(table.len() as u8))
// parameter_annotations
.and(table.iter().fold(Ok(0), |_, ann_table| self.write_u16(ann_table.len() as u16).and(ann_table.iter().fold(Ok(0), |_, ann| self.write_annotation(ann, cp)))))
},
&Attribute::RuntimeInvisibleParameterAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeInvisibleParameterAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(1, |acc, x| acc + x.iter().fold(2, |acc2, x2| acc2 + x2.len()) as u32)))
// num_parameters
.and(self.write_u8(table.len() as u8))
// parameter_annotations
.and(table.iter().fold(Ok(0), |_, ann_table| self.write_u16(ann_table.len() as u16).and(ann_table.iter().fold(Ok(0), |_, ann| self.write_annotation(ann, cp)))))
},
&Attribute::RuntimeVisibleTypeAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeVisibleTypeAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(2, |acc, x| acc + x.len() as u32)))
// num_annotations
.and(self.write_u16(table.len() as u16))
// annotations
.and(table.iter().fold(Ok(0), |_, x| self.write_type_annotation(x, cp)))
},
&Attribute::RuntimeInvisibleTypeAnnotations(ref table) => {
self.write_u16(cp.get_utf8_index("RuntimeInvisibleTypeAnnotations") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(2, |acc, x| acc + x.len() as u32)))
// num_annotations
.and(self.write_u16(table.len() as u16))
// annotations
.and(table.iter().fold(Ok(0), |_, x| self.write_type_annotation(x, cp)))
},
&Attribute::AnnotationDefault(ref value) => {
self.write_u16(cp.get_utf8_index("AnnotationDefault") as u16)
.and(self.write_u32(value.len() as u32))
.and(self.write_element_value(value, cp))
},
&Attribute::BootstrapMethods(ref table) => {
self.write_u16(cp.get_utf8_index("BootstrapMethods") as u16)
// attribute_length
.and(self.write_u32(table.iter().fold(2, |acc, method| acc + 4 + method.bootstrap_arguments.len() as u32 * 2)))
// num_bootstrap_methods
.and(self.write_u16(table.len() as u16))
// bootstrap_methods
.and(table.iter().fold(Ok(0), |_, method| {
// bootstrap_method_ref
self.write_u16(method.bootstrap_method_ref.idx as u16)
// num_bootstrap_arguments
.and(self.write_u16(method.bootstrap_arguments.len() as u16))
// bootstrap_arguments
.and(method.bootstrap_arguments.iter().fold(Ok(0), |_, arg| self.write_u16(arg.idx as u16)))
}))
},
&Attribute::MethodParameters(ref table) => {
self.write_u16(cp.get_utf8_index("MethodParameters") as u16)
.and(self.write_u32(1 + table.len() as u32 * 4))
.and(table.iter().fold(Ok(0), |_, p| self.write_u16(p.name_index.idx as u16).and(self.write_u16(p.access_flags.flags as u16))))
}
}
}
fn write_stack_map_table(&mut self, table: &Vec<StackMapFrame>, cp: &ConstantPool) -> Result<usize, Error> {
// attribute_name_index
self.write_u16(cp.get_utf8_index("StackMapTable") as u16)
// attribute_length = number_of_entries length (2) + sum of entries' length
.and(self.write_u32(2 + table.iter().map(|st| st.len()).fold(0, |acc, x| acc + x) as u32))
// number_of_entries
.and(self.write_u16(table.len() as u16))
// entries
.and(table.iter().fold(Ok(0), |_, x| {
match x {
&StackMapFrame::SameFrame { tag } => self.write_u8(tag),
&StackMapFrame::SameLocals1StackItemFrame{ tag, ref stack } => self.write_u8(tag).and(self.write_verification_type(stack)),
&StackMapFrame::SameLocals1StackItemFrameExtended { offset_delta, ref stack } => self.write_u8(247).and(self.write_u16(offset_delta)).and(self.write_verification_type(stack)),
&StackMapFrame::ChopFrame { tag, offset_delta } => self.write_u8(tag).and(self.write_u16(offset_delta)),
&StackMapFrame::SameFrameExtended { offset_delta } => self.write_u8(251).and(self.write_u16(offset_delta)),
&StackMapFrame::AppendFrame { tag, offset_delta, ref locals } => self.write_u8(tag).and(self.write_u16(offset_delta)).and(locals.iter().fold(Ok(0), |_, x| self.write_verification_type(x))),
&StackMapFrame::FullFrame { offset_delta, ref locals, ref stack } => {
// full frame tag
self.write_u8(255)
// offset_delta
.and(self.write_u16(offset_delta))
// number_of_locals
.and(self.write_u16(locals.len() as u16))
// locals
.and(locals.iter().fold(Ok(0), |_, x| self.write_verification_type(x)))
// number_of_stack_items
.and(self.write_u16(stack.len() as u16))
// stack
.and(stack.iter().fold(Ok(0), |_, x| self.write_verification_type(x)))
},
&StackMapFrame::FutureUse { tag } => self.write_u8(tag)
}
}))
}
fn write_verification_type(&mut self, info: &VerificationType) -> Result<usize, Error> {
match info {
&VerificationType::Top => self.write_u8(0),
&VerificationType::Integer => self.write_u8(1),
&VerificationType::Float => self.write_u8(2),
&VerificationType::Long => self.write_u8(4),
&VerificationType::Double => self.write_u8(3),
&VerificationType::Null => self.write_u8(5),
&VerificationType::UninitializedThis => self.write_u8(6),
&VerificationType::Object { ref cpool_index } => self.write_u8(7).and(self.write_u16(cpool_index.idx as u16)),
&VerificationType::Uninitialized { offset } => self.write_u8(8).and(self.write_u16(offset))
}
}
fn write_element_value(&mut self, element_value: &ElementValue, cp: &ConstantPool) -> Result<usize, Error> {
match element_value {
&ElementValue::ConstantValue(tag, ref idx) => self.write_u8(tag).and(self.write_u16(idx.idx as u16)),
&ElementValue::Enum { ref type_name_index, ref const_name_index } => self.write_u8(101).and(self.write_u16(type_name_index.idx as u16)).and(self.write_u16(const_name_index.idx as u16)),
&ElementValue::ClassInfo(ref idx) => self.write_u8(99).and(self.write_u16(idx.idx as u16)),
&ElementValue::Annotation(ref annotation) => self.write_u8(64).and(self.write_annotation(annotation, cp)),
&ElementValue::Array(ref table) => self.write_u8(91).and(self.write_u16(table.len() as u16)).and(table.iter().fold(Ok(0), |_, x| { self.write_element_value(x, cp) }))
}
}
fn write_element_value_pair(&mut self, pair: &ElementValuePair, cp: &ConstantPool) -> Result<usize, Error> {
self.write_u16(pair.element_name_index.idx as u16).and(self.write_element_value(&pair.value, cp))
}
fn write_annotation(&mut self, annotation: &Annotation, cp: &ConstantPool) -> Result<usize, Error> {
// type_index
self.write_u16(annotation.type_index.idx as u16)
// num_element_value_pairs
.and(self.write_u16(annotation.element_value_pairs.len() as u16))
// element_value_pairs
.and(annotation.element_value_pairs.iter().fold(Ok(0), |_, x| self.write_element_value_pair(x, cp)))
}
fn write_type_annotation(&mut self, annotation: &TypeAnnotation, cp: &ConstantPool) -> Result<usize, Error> {
// target_type
self.write_u8(annotation.target_info.subtype())
// target_info
.and({
match &annotation.target_info {
&TargetInfo::TypeParameter { subtype: _, idx } => self.write_u8(idx),
&TargetInfo::SuperType { idx } => self.write_u16(idx),
&TargetInfo::TypeParameterBound { subtype: _, param_idx, bound_index } => self.write_u8(param_idx).and(self.write_u8(bound_index)),
&TargetInfo::Empty { subtype: _ } => Ok(0),
&TargetInfo::MethodFormalParameter { idx } => self.write_u8(idx),
&TargetInfo::Throws { idx } => self.write_u16(idx),
&TargetInfo::LocalVar { subtype: _, ref target } => self.write_u16(target.len() as u16).and(target.iter().fold(Ok(0), |_, x| self.write_u16(x.0).and(self.write_u16(x.1)).and(self.write_u16(x.2)))),
&TargetInfo::Catch { idx } => self.write_u16(idx),
&TargetInfo::Offset { subtype: _, idx } => self.write_u16(idx),
&TargetInfo::TypeArgument { subtype: _, offset, type_arg_idx } => self.write_u16(offset).and(self.write_u8(type_arg_idx))
}
})
.and({
// path_length
self.write_u8(annotation.target_path.path.len() as u8)
// path
.and(annotation.target_path.path.iter().fold(Ok(0), |_, x| self.write_u8(x.0.value()).and(self.write_u8(x.1))))
})
.and(self.write_u16(annotation.type_index.idx as u16))
.and(self.write_u16(annotation.element_value_pairs.len() as u16))
.and(annotation.element_value_pairs.iter().fold(Ok(0), |_, x| self.write_element_value_pair(x, cp)))
}
fn write_instructions(&mut self, instructions: &Vec<Instruction>) -> Result<usize, Error> {
let mut target: Vec<u8> = vec![];
let _ /*written_bytes*/ = {
let mut instr_writer = ClassWriter::new(&mut target);
instructions.iter().fold(0 as usize, |counter, instr| {
counter + instr_writer.render_instruction(instr, counter)
})
};
self.write_u32(target.len() as u32).and_then(|x| self.write_n(&target).map(|y| x + y))
}
/// Renders a single instruction into the output stream
fn render_instruction(&mut self, instruction: &Instruction, offset: usize) -> usize {
match instruction {
&Instruction::AALOAD => self.write_u8(0x32),
&Instruction::AASTORE => self.write_u8(0x53),
&Instruction::ACONST_NULL => self.write_u8(0x01),
&Instruction::ALOAD(value) => self.write_u8(0x19).and(self.write_u8(value)).and(Ok(2)),
&Instruction::ALOAD_0 => self.write_u8(0x2a),
&Instruction::ALOAD_1 => self.write_u8(0x2b),
&Instruction::ALOAD_2 => self.write_u8(0x2c),
&Instruction::ALOAD_3 => self.write_u8(0x2d),
&Instruction::ANEWARRAY(b) => self.write_u8(0xbd).and(self.write_u16(b)).and(Ok(3)),
&Instruction::ARETURN => self.write_u8(0xb0),
&Instruction::ARRAYLENGTH => self.write_u8(0xbe),
&Instruction::ASTORE(value) => self.write_u8(0x3a).and(self.write_u8(value)).and(Ok(2)),
&Instruction::ASTORE_0 => self.write_u8(0x4b),
&Instruction::ASTORE_1 => self.write_u8(0x4c),
&Instruction::ASTORE_2 => self.write_u8(0x4d),
&Instruction::ASTORE_3 => self.write_u8(0x4e),
&Instruction::ATHROW => self.write_u8(0xbf),
&Instruction::BALOAD => self.write_u8(0x33),
&Instruction::BASTORE => self.write_u8(0x54),
&Instruction::BIPUSH(value) => self.write_u8(0x10).and(self.write_u8(value)).and(Ok(2)),
&Instruction::CALOAD => self.write_u8(0x34),
&Instruction::CASTORE => self.write_u8(0x55),
&Instruction::CHECKCAST(value) => self.write_u8(0xc0).and(self.write_u16(value)).and(Ok(3)),
&Instruction::D2F => self.write_u8(0x90),
&Instruction::D2I => self.write_u8(0x8e),
&Instruction::D2L => self.write_u8(0x8f),
&Instruction::DADD => self.write_u8(0x63),
&Instruction::DALOAD => self.write_u8(0x31),
&Instruction::DASTORE => self.write_u8(0x52),
&Instruction::DCMPL => self.write_u8(0x97),
&Instruction::DCMPG => self.write_u8(0x98),
&Instruction::DCONST_0 => self.write_u8(0x0e),
&Instruction::DCONST_1 => self.write_u8(0x0f),
&Instruction::DDIV => self.write_u8(0x6f),
&Instruction::DLOAD(value) => self.write_u8(0x18).and(self.write_u8(value)).and(Ok(2)),
&Instruction::DLOAD_0 => self.write_u8(0x26),
&Instruction::DLOAD_1 => self.write_u8(0x27),
&Instruction::DLOAD_2 => self.write_u8(0x28),
&Instruction::DLOAD_3 => self.write_u8(0x29),
&Instruction::DMUL => self.write_u8(0x6b),
&Instruction::DNEG => self.write_u8(0x77),
&Instruction::DREM => self.write_u8(0x73),
&Instruction::DRETURN => self.write_u8(0xaf),
&Instruction::DSTORE(value) => self.write_u8(0x39).and(self.write_u8(value)).and(Ok(2)),
&Instruction::DSTORE_0 => self.write_u8(0x47),
&Instruction::DSTORE_1 => self.write_u8(0x48),
&Instruction::DSTORE_2 => self.write_u8(0x49),
&Instruction::DSTORE_3 => self.write_u8(0x4a),
&Instruction::DSUB => self.write_u8(0x67),
&Instruction::DUP => self.write_u8(0x59),
&Instruction::DUP_X1 => self.write_u8(0x5a),
&Instruction::DUP_X2 => self.write_u8(0x5b),
&Instruction::DUP2 => self.write_u8(0x5c),
&Instruction::DUP2_X1 => self.write_u8(0x5d),
&Instruction::DUP2_X2 => self.write_u8(0x5e),
&Instruction::F2D => self.write_u8(0x8d),
&Instruction::F2I => self.write_u8(0x8b),
&Instruction::F2L => self.write_u8(0x8c),
&Instruction::FADD => self.write_u8(0x62),
&Instruction::FALOAD => self.write_u8(0x30),
&Instruction::FASTORE => self.write_u8(0x51),
&Instruction::FCMPL => self.write_u8(0x95),
&Instruction::FCMPG => self.write_u8(0x96),
&Instruction::FCONST_0 => self.write_u8(0x0b),
&Instruction::FCONST_1 => self.write_u8(0x0c),
&Instruction::FCONST_2 => self.write_u8(0x0d),
&Instruction::FDIV => self.write_u8(0x6e),
&Instruction::FLOAD(value) => self.write_u8(0x17).and(self.write_u8(value)).and(Ok(2)),
&Instruction::FLOAD_0 => self.write_u8(0x22),
&Instruction::FLOAD_1 => self.write_u8(0x23),
&Instruction::FLOAD_2 => self.write_u8(0x24),
&Instruction::FLOAD_3 => self.write_u8(0x25),
&Instruction::FMUL => self.write_u8(0x6a),
&Instruction::FNEG => self.write_u8(0x76),
&Instruction::FREM => self.write_u8(0x72),
&Instruction::FRETURN => self.write_u8(0xae),
&Instruction::FSTORE(value) => self.write_u8(0x38).and(self.write_u8(value)).and(Ok(2)),
&Instruction::FSTORE_0 => self.write_u8(0x43),
&Instruction::FSTORE_1 => self.write_u8(0x44),
&Instruction::FSTORE_2 => self.write_u8(0x45),
&Instruction::FSTORE_3 => self.write_u8(0x46),
&Instruction::FSUB => self.write_u8(0x66),
&Instruction::GETFIELD(value) => self.write_u8(0xb4).and(self.write_u16(value)).and(Ok(3)),
&Instruction::GETSTATIC(value) => self.write_u8(0xb2).and(self.write_u16(value)).and(Ok(3)),
&Instruction::GOTO(value) => self.write_u8(0xa7).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::GOTO_W(value) => self.write_u8(0xc8).and(self.write_u32(value as u32)).and(Ok(5)),
&Instruction::I2B => self.write_u8(0x91),
&Instruction::I2C => self.write_u8(0x92),
&Instruction::I2D => self.write_u8(0x87),
&Instruction::I2F => self.write_u8(0x86),
&Instruction::I2L => self.write_u8(0x85),
&Instruction::I2S => self.write_u8(0x93),
&Instruction::IADD => self.write_u8(0x60),
&Instruction::IALOAD => self.write_u8(0x2e),
&Instruction::IAND => self.write_u8(0x7e),
&Instruction::IASTORE => self.write_u8(0x4f),
&Instruction::ICONST_M1 => self.write_u8(0x02),
&Instruction::ICONST_0 => self.write_u8(0x03),
&Instruction::ICONST_1 => self.write_u8(0x04),
&Instruction::ICONST_2 => self.write_u8(0x05),
&Instruction::ICONST_3 => self.write_u8(0x06),
&Instruction::ICONST_4 => self.write_u8(0x07),
&Instruction::ICONST_5 => self.write_u8(0x08),
&Instruction::IDIV => self.write_u8(0x6c),
&Instruction::IF_ACMPEQ(value) => self.write_u8(0xa5).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ACMPNE(value) => self.write_u8(0xa6).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPEQ(value) => self.write_u8(0x9f).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPNE(value) => self.write_u8(0xa0).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPLT(value) => self.write_u8(0xa1).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPGE(value) => self.write_u8(0xa2).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPGT(value) => self.write_u8(0xa3).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IF_ICMPLE(value) => self.write_u8(0xa4).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFEQ(value) => self.write_u8(0x99).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFNE(value) => self.write_u8(0x9a).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFLT(value) => self.write_u8(0x9b).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFGE(value) => self.write_u8(0x9c).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFGT(value) => self.write_u8(0x9d).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFLE(value) => self.write_u8(0x9e).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFNONNULL(value) => self.write_u8(0xc7).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IFNULL(value) => self.write_u8(0xc6).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::IINC(a, b) => self.write_u8(0x84).and(self.write_u8(a)).and(self.write_u8(b as u8)).and(Ok(3)),
&Instruction::ILOAD(value) => self.write_u8(0x15).and(self.write_u8(value)).and(Ok(2)),
&Instruction::ILOAD_0 => self.write_u8(0x1a),
&Instruction::ILOAD_1 => self.write_u8(0x1b),
&Instruction::ILOAD_2 => self.write_u8(0x1c),
&Instruction::ILOAD_3 => self.write_u8(0x1d),
&Instruction::IMUL => self.write_u8(0x68),
&Instruction::INEG => self.write_u8(0x74),
&Instruction::INSTANCEOF(value) => self.write_u8(0xc1).and(self.write_u16(value)).and(Ok(3)),
&Instruction::INVOKEDYNAMIC(value) => self.write_u8(0xba).and(self.write_u16(value)).and(self.write_u16(0)).and(Ok(5)),
&Instruction::INVOKEINTERFACE(a, b) => self.write_u8(0xb9).and(self.write_u16(a)).and(self.write_u8(b)).and(self.write_u8(0)).and(Ok(5)),
&Instruction::INVOKESPECIAL(value) => self.write_u8(0xb7).and(self.write_u16(value)).and(Ok(3)),
&Instruction::INVOKESTATIC(value) => self.write_u8(0xb8).and(self.write_u16(value)).and(Ok(3)),
&Instruction::INVOKEVIRTUAL(value) => self.write_u8(0xb6).and(self.write_u16(value)).and(Ok(3)),
&Instruction::IOR => self.write_u8(0x80),
&Instruction::IREM => self.write_u8(0x70),
&Instruction::IRETURN => self.write_u8(0xac),
&Instruction::ISHL => self.write_u8(0x78),
&Instruction::ISHR => self.write_u8(0x7a),
&Instruction::ISTORE(value) => self.write_u8(0x36).and(self.write_u8(value)).and(Ok(2)),
&Instruction::ISTORE_0 => self.write_u8(0x3b),
&Instruction::ISTORE_1 => self.write_u8(0x3c),
&Instruction::ISTORE_2 => self.write_u8(0x3d),
&Instruction::ISTORE_3 => self.write_u8(0x3e),
&Instruction::ISUB => self.write_u8(0x64),
&Instruction::IUSHR => self.write_u8(0x7c),
&Instruction::IXOR => self.write_u8(0x82),
&Instruction::JSR(value) => self.write_u8(0xa8).and(self.write_u16(value as u16)).and(Ok(3)),
&Instruction::JSR_W(value) => self.write_u8(0xc9).and(self.write_u32(value as u32)).and(Ok(5)),
&Instruction::L2D => self.write_u8(0x8a),
&Instruction::L2F => self.write_u8(0x89),
&Instruction::L2I => self.write_u8(0x88),
&Instruction::LADD => self.write_u8(0x61),
&Instruction::LALOAD => self.write_u8(0x2f),
&Instruction::LAND => self.write_u8(0x7f),
&Instruction::LASTORE => self.write_u8(0x50),
&Instruction::LCMP => self.write_u8(0x94),
&Instruction::LCONST_0 => self.write_u8(0x09),
&Instruction::LCONST_1 => self.write_u8(0x0a),
&Instruction::LDC(value) => self.write_u8(0x12).and(self.write_u8(value)).and(Ok(2)),
&Instruction::LDC_W(value) => self.write_u8(0x13).and(self.write_u16(value)).and(Ok(3)),
&Instruction::LDC2_W(value) => self.write_u8(0x14).and(self.write_u16(value)).and(Ok(3)),
&Instruction::LDIV => self.write_u8(0x6d),
&Instruction::LLOAD(value) => self.write_u8(0x16).and(self.write_u8(value)).and(Ok(2)),
&Instruction::LLOAD_0 => self.write_u8(0x1e),
&Instruction::LLOAD_1 => self.write_u8(0x1f),
&Instruction::LLOAD_2 => self.write_u8(0x20),
&Instruction::LLOAD_3 => self.write_u8(0x21),
&Instruction::LMUL => self.write_u8(0x69),
&Instruction::LNEG => self.write_u8(0x75),
&Instruction::LOOKUPSWITCH(a, ref l) => {
let _ = self.write_u8(0xab);
let padding = (4 - ((offset + 1) % 4)) % 4;
for _ in 0..padding {
let _ = self.write_u8(0);
}
let _ = self.write_u32(a as u32);
let _ = self.write_u32(l.len() as u32);
for &(p1, p2) in l {
let _ = self.write_u32(p1 as u32);
let _ = self.write_u32(p2 as u32);
}
let len = 9 + padding + l.len() * 8;
Ok(len)
},
&Instruction::LOR => self.write_u8(0x81),
&Instruction::LREM => self.write_u8(0x71),
&Instruction::LRETURN => self.write_u8(0xad),
&Instruction::LSHL => self.write_u8(0x79),
&Instruction::LSHR => self.write_u8(0x7b),
&Instruction::LSTORE(value) => self.write_u8(0x37).and(self.write_u8(value)).and(Ok(2)),
&Instruction::LSTORE_0 => self.write_u8(0x3f),
&Instruction::LSTORE_1 => self.write_u8(0x40),
&Instruction::LSTORE_2 => self.write_u8(0x41),
&Instruction::LSTORE_3 => self.write_u8(0x42),
&Instruction::LSUB => self.write_u8(0x65),
&Instruction::LUSHR => self.write_u8(0x7d),
&Instruction::LXOR => self.write_u8(0x83),
&Instruction::MONITORENTER => self.write_u8(0xc2),
&Instruction::MONITOREXIT => self.write_u8(0xc3),
&Instruction::MULTIANEWARRAY(a, b) => self.write_u8(0xc5).and(self.write_u16(a)).and(self.write_u8(b)).and(Ok(4)),
&Instruction::NEW(value) => self.write_u8(0xbb).and(self.write_u16(value)).and(Ok(3)),
&Instruction::NEWARRAY(value) => self.write_u8(0xbc).and(self.write_u8(value)).and(Ok(2)),
&Instruction::NOP => self.write_u8(0x00),
&Instruction::POP => self.write_u8(0x57),
&Instruction::POP2 => self.write_u8(0x58),
&Instruction::PUTFIELD(value) => self.write_u8(0xb5).and(self.write_u16(value)).and(Ok(3)),
&Instruction::PUTSTATIC(value) => self.write_u8(0xb3).and(self.write_u16(value)).and(Ok(3)),
&Instruction::RET(value) => self.write_u8(0xa9).and(self.write_u8(value)).and(Ok(2)),
&Instruction::RETURN => self.write_u8(0xb1),
&Instruction::SALOAD => self.write_u8(0x35),
&Instruction::SASTORE => self.write_u8(0x56),
&Instruction::SIPUSH(value) => self.write_u8(0x11).and(self.write_u16(value)).and(Ok(3)),
&Instruction::SWAP => self.write_u8(0x5f),
//TABLESWITCH(i32, i32, i32, Vec<i32>),
&Instruction::TABLESWITCH(a, b, c, ref d) => {
let _ = self.write_u8(0xaa);
let padding = (4 - ((offset + 1) % 4)) % 4;
for _ in 0..padding {
let _ = self.write_u8(0);
}
let _ = self.write_u32(a as u32);
let _ = self.write_u32(b as u32);
let _ = self.write_u32(c as u32);
for &v in d {
let _ = self.write_u32(v as u32);
}
Ok(13 + padding + d.len() * 4)
},
&Instruction::ILOAD_W(value) => self.write_u16(0xc415).and(self.write_u16(value)).and(Ok(4)),
&Instruction::FLOAD_W(value) => self.write_u16(0xc417).and(self.write_u16(value)).and(Ok(4)),
&Instruction::ALOAD_W(value) => self.write_u16(0xc419).and(self.write_u16(value)).and(Ok(4)),
&Instruction::LLOAD_W(value) => self.write_u16(0xc416).and(self.write_u16(value)).and(Ok(4)),
&Instruction::DLOAD_W(value) => self.write_u16(0xc418).and(self.write_u16(value)).and(Ok(4)),
&Instruction::ISTORE_W(value) => self.write_u16(0xc436).and(self.write_u16(value)).and(Ok(4)),
&Instruction::FSTORE_W(value) => self.write_u16(0xc438).and(self.write_u16(value)).and(Ok(4)),
&Instruction::ASTORE_W(value) => self.write_u16(0xc43a).and(self.write_u16(value)).and(Ok(4)),
&Instruction::LSTORE_W(value) => self.write_u16(0xc437).and(self.write_u16(value)).and(Ok(4)),
&Instruction::DSTORE_W(value) => self.write_u16(0xc439).and(self.write_u16(value)).and(Ok(4)),
&Instruction::RET_W(value) => self.write_u16(0xc4a9).and(self.write_u16(value)).and(Ok(4)),
&Instruction::IINC_W(a, b) => self.write_u16(0xc484).and(self.write_u16(a)).and(self.write_u16(b as u16)).and(Ok(6)),
_ => self.write_u8(0xFF)
}.ok().unwrap_or(0)
}
fn write_exception_handlers(&mut self, exception_table: &Vec<ExceptionHandler>) -> Result<usize, Error> {
self.write_u16(exception_table.len() as u16)
.and(exception_table.iter().fold(Ok(0), |_, x| {
self.write_u16(x.start_pc)
.and(self.write_u16(x.end_pc))
.and(self.write_u16(x.handler_pc))
.and(self.write_u16(x.catch_type.idx as u16))
}))
}
pub fn write_n(&mut self, bytes: &Vec<u8>) -> Result<usize, Error> {
bytes.iter().fold(Ok(0), |acc, x| match acc {
Ok(ctr) => self.write_u8(*x).map(|c| c + ctr),
err@_ => err
})
}
pub fn write_u64(&mut self, value: u64) -> Result<usize, Error> {
let buf: [u8; 8] = [
((value & 0xFF << 56) >> 56) as u8,
((value & 0xFF << 48) >> 48) as u8,
((value & 0xFF << 40) >> 40) as u8,
((value & 0xFF << 32) >> 32) as u8,
((value & 0xFF << 24) >> 24) as u8,
((value & 0xFF << 16) >> 16) as u8,
((value & 0xFF << 8) >> 8) as u8,
(value & 0xFF) as u8
];
self.target.write(&buf)
}
pub fn write_u32(&mut self, value: u32) -> Result<usize, Error> {
let buf: [u8; 4] = [
((value & 0xFF << 24) >> 24) as u8,
((value & 0xFF << 16) >> 16) as u8,
((value & 0xFF << 8) >> 8) as u8,
(value & 0xFF) as u8
];
self.target.write(&buf)
}
pub fn write_u16(&mut self, value: u16) -> Result<usize, Error> {
let buf: [u8; 2] = [((value & 0xFF00) >> 8) as u8, (value & 0xFF) as u8];
self.target.write(&buf)
}
pub fn write_u8(&mut self, value: u8) -> Result<usize, Error> {
self.target.write(&[value])
}
}<|fim▁end|> | self.write_u16(version.minor_version)
.and(self.write_u16(version.major_version))
}
|
<|file_name|>speed.py<|end_file_name|><|fim▁begin|>from colour import *
from cartesian import *
from timeit import *<|fim▁hole|> for i in range(1, 100000):
c = colour_create(.5, .5, .5, 0)
b = colour_add(b, c)
def test_cartesian():
b = cartesian_create(0, 0, 0)
for i in range(1, 50000):
c = cartesian_create(.5, .5, .5)
b = cartesian_normalise(cartesian_add(b, c))
d = cartesian_dot(c, b)
e = cartesian_cross(c, b)
# if __name__ == '__main__':
# print(repeat("test_colour()",
# setup="from __main__ import test_colour", number=50))<|fim▁end|> |
def test_colour():
b = colour_create(0, 0, 0, 0) |
<|file_name|>utility.rs<|end_file_name|><|fim▁begin|>use support::project;
<|fim▁hole|> let project = project("git-clean_removes").build();
let result = project.git_clean_command("-y")
.env("PATH", "")
.run();
assert!(!result.is_success(),
result.failure_message("command to fail"));
assert!(result.stdout().contains("Unable to execute 'git' on your machine"),
result.failure_message("to be missing the git command"));
}<|fim▁end|> | #[test]
fn test_git_clean_checks_for_git_in_path() { |
<|file_name|>PyGdbDb.py<|end_file_name|><|fim▁begin|># coding=utf-8
import pymysql
import PyGdbUtil
class PyGdbDb:
# 初始化: 连接数据库
def __init__(self, host, port, dbname, user, passwd):
self.project = None
self.table_prefix = None
try:
self.connection = pymysql.connect(
host=host, port=int(port), user=user, password=passwd, db=dbname, charset="utf8mb4")
self.cursor = self.connection.cursor()
except Exception as e_con:
print '数据库连接错误, 程序中止'
print e_con
exit(-1)
def test(self):
print '正在测试数据库连接'
print '数据库连接: ' + str(self.connection.get_host_info()) if self.connection else '数据库连接异常'
print '数据库游标: ' + str(self.cursor) if self.cursor else '数据库游标异常'
print '数据库连接测试完毕'
print '检查表 aabb 是否存在'
if self.exist_table('aabb'):
print '存在'
else:
print '不存在'
print '初始化项目 example'
self.init_project('example', 'example_')
self.new_project()
PyGdbUtil.log(0, '初始化完毕')
# 初始化项目
def init_project(self, project_name, table_prefix):
self.project = project_name
self.table_prefix = table_prefix
# 检测是否存在该项目 不存在->创建 返回True; 存在->返回 False
def new_project(self):
if not self.table_prefix:
PyGdbUtil.log(2, '未指定数据库前缀')
exist_project = self.exist_table(self.table_prefix + 'BreakPoint')
# 创建数据库表
if not exist_project:
self.create_table(self.table_prefix + "BreakPoint(bid INT AUTO_INCREMENT primary key, pid INT, lineNumber INT, funcName TEXT, funcList TEXT)")
self.create_table(self.table_prefix + "PStackSize(pid INT, tid INT, stackSize INT, pass TINYINT)")
self.create_table(self.table_prefix + "FStackSize(pid INT, tid INT, fid INT, stackSize INT)")
self.create_table(self.table_prefix + "FrameVariable(bid INT, varName CHAR, varValue TEXT, varSize INT)")
self.create_table(self.table_prefix + "FuncAdjacencyList(pid INT, tid INT, parFid INT, fid INT, cnt INT)")
self.create_table(self.table_prefix + "Function(fid INT, funcName CHAR(30))")
self.create_table(self.table_prefix + "TestCase(tid INT AUTO_INCREMENT primary key, testStr TEXT)")
self.commit()
return True
else:
return False
def clear_project(self):
if not self.table_prefix:
PyGdbUtil.log(2, '未指定数据库前缀')
exist_project = self.exist_table(self.table_prefix + 'BreakPoint')
if exist_project:
self.drop_table(self.table_prefix + "BreakPoint")
self.drop_table(self.table_prefix + "PStackSize")
self.drop_table(self.table_prefix + "FStackSize")
self.drop_table(self.table_prefix + "FrameVariable")
self.drop_table(self.table_prefix + "FuncAdjacencyList")
self.drop_table(self.table_prefix + "Function")
self.drop_table(self.table_prefix + "TestCase")
self.commit()
return True
else:
return False
# 插入测试用例
def insert_test_case(self, test_str):
self.execute("insert into " + self.table_prefix + "TestCase(testStr) VALUES('%s')" % test_str)
# 插入程序断点
def insert_breakpoint(self, pid, line_number, func_name):
# return # 测试
PyGdbUtil.log(0, str(pid) + " " + str(line_number) + " " + str(func_name))
self.execute("insert into " + self.table_prefix +
"BreakPoint(pid, lineNumber, funcName) VALUES (%s, %s, '%s')" % (pid, line_number, func_name))
# 插入函数
def inset_function(self, fid, func_name):
self.execute('insert into ' + self.table_prefix +
'Function(fid, funcName) VALUES (%s, "%s")' % (fid, func_name))
# 插入一个栈帧变量信息
def insert_frame_var(self, bid, var_name, var_value, var_size):
self.execute('insert into ' + self.table_prefix +
'FrameVariable(bid, varName, varValue, varSize) ' +
'VALUES (%s, "%s", "%s", %s)' % (bid, var_name, var_value, var_size))
# 插入栈帧大小
def insert_frame_stack_size(self, pid, tid, fid, size):
self.execute('insert into ' + self.table_prefix +
'FStackSize(pid, tid, fid, stackSize) VALUES (%s, %s, %s, %s)' %
(pid, tid, fid, size))
# 插入最大栈帧大小
def insert_max_stack_size(self, pid, tid, size):
self.execute('insert into ' + self.table_prefix +
'PStackSize(pid, tid, stackSize) VALUES (%s, %s, %s)' %(pid, tid, size))
# 根据函数名称获取 fid
def get_function_fid_by_name(self, func_name):
self.execute('select fid from ' + self.table_prefix + 'Function where funcName=' + func_name)
fetch_one = self.cursor.fetchone()
print "获取函数id: " + fetch_one
return fetch_one[0]
# 根据bid获取fid
def get_fid_by_bid(self, bid):
self.execute('select funcName from ' + self.table_prefix + 'BreakPoint where bid=' + str(bid))
fetch_one = self.cursor.fetchone()
fid = self.get_fid_by_func_name(str(fetch_one[0]))
return fid
# 根据函数名获取 fid
def get_fid_by_func_name(self, func_name):
self.execute('select fid from ' + self.table_prefix + 'Function where funcName="%s"' % (str(func_name)))
return self.cursor.fetchone()[0]
# 数据库中插入断点
def info_breakpoint_handler(self, pid, gdb_info_breakpoint):
ss = gdb_info_breakpoint.split("\n")
for s in ss:
if 0 < s.find("breakpoint keep y"):
s2 = s.split()
s3 = s2[8].split(":")
self.insert_breakpoint(pid, s3[1], s2[6])
# 添加有向边 a-->b
def insert_edge(self, pid, tid, func_name_a, func_name_b):
fid_a = self.get_fid_by_func_name(func_name_a)
fid_b = self.get_fid_by_func_name(func_name_b)
try:
self.execute('select cnt from ' + self.table_prefix +
'FuncAdjacencyList where pid=%s and tid=%s and parFid=%s and fid=%s' %
(pid, tid, fid_a, fid_b))
cnt = int(self.cursor.fetchone()[0]) + 1
self.execute('update ' + self.table_prefix +
'FuncAdjacencyList set cnt=%s where pid=%s and tid=%s and parFid=%s and fid=%s' %
(pid, tid, cnt, fid_a, fid_b))
except Exception:
cnt = 1
self.execute('insert into ' + self.table_prefix +
'FuncAdjacencyList(pid, tid, parFid, fid, cnt) VALUES (%s, %s, %s, %s, %s)' %
(pid, tid, fid_a, fid_b, cnt))
# 根据 gdb(info b) 的信息获取函数列表
def get_function_list(self, break_info):
func_list = []
string_list = break_info.split('\n')[1:]
for line in string_list:
word = line.split()
if len(word) >= 6:
func_list.append(word[6])
return func_list
# 将给出的函数列表插入数据库中
def insert_function_list(self, func_list):
fid = 0
func_list = list(set(func_list)) # 去重
for func in func_list:
fid += 1
self.inset_function(fid, func)
# 检查是否存在一张表
def exist_table(self, table_name):
try:
self.execute('select * from ' + table_name)
return True
except Exception:
return False
# 创建表
def create_table(self, table_name):
try:
PyGdbUtil.log(0, "创建表" + table_name)
self.execute("create table if not exists " + table_name)
except Exception as e:
# print e
PyGdbUtil.log(2, "创建表" + table_name + "失败! 请检查数据表前缀是否有非法字符.")
# 删除表
def drop_table(self, table_name):
try:
PyGdbUtil.log(0, "删除表" + table_name)
self.execute('drop table if exists ' + table_name)
except Exception as e:
print e
PyGdbUtil.log(2, '删除表失败!')
# 获取测试样例
def get_test_case_by_tid(self, tid):
self.execute("SELECT testStr FROM " + self.table_prefix + "TestCase WHERE tid='%s'" % tid)
return self.cursor.fetchone()[0]
# 获取测试样例总数
def get_test_case_cnt(self):
self.execute('SELECT max(tid) FROM ' + self.table_prefix + 'TestCase')
return int(self.cursor.fetchone()[0])
# 获取指定程序的断点列表
def get_breakpoint_list(self, pid):
self.execute('SELECT lineNumber FROM ' + self.table_prefix + 'BreakPoint WHERE pid="%s"' % pid)
all = self.cursor.fetchall()
return [x[0] for x in all]
# 执行 sql 语句
def execute(self, sql_cmd):
return self.cursor.execute(sql_cmd)
# commit 操作
def commit(self):
self.connection.commit()
"""
==================================================================
下方是 RestFul API 直接需要用到的 api
我擦, 这个好像应该放到另一个工程里面 - -#
==================================================================
"""
# getWorstStackSize(String program String t1){} input1+program getWorstStackSize(){}
# tid + pid --> Worst Stack Size<|fim▁hole|> def api_max_stack_size(self, pid, tid, fid):
pass
# 给出正确程序的pid 以及比较程序的 pid, 以及测试用例集合(tid列表), 返回程序执行成功与否的TF表
def api_result(self, correct_pid, test_pid, tid_list):
pass
# 返回程序断点列表
def api_breakpoint_list(self, pid, tid):
pass
# 断点处函数栈列表
def api_breakpoint_func_list(self, pid, breakpoint):
pass
# 断点处栈帧信息
def api_breakpoint_frame_info(self, pid, breakpoint):
pass
# 返回函数调用图的邻接表
def api_function_graph(self, pid, tid):
pass
# 返回函数列表
def api_function_list(self, pid):
pass
if __name__ == '__main__':
print "PyGDB Database 测试模式"
try:
dbc = PyGdbDb('127.0.0.1', '3306', 'pygdb', 'root', 'Sbdljw1992')
print '数据库连接成功'
dbc.test()
dbc.connection.close()
print '数据库连接断开成功'
except Exception as e:
print '严重错误: ' + str(e)
exit(-1)<|fim▁end|> | def api_worst_stack_size(self, pid, tid):
pass
|
<|file_name|>trans_real.py<|end_file_name|><|fim▁begin|>"""Translation helper functions."""
import locale
import os
import re
import sys
import gettext as gettext_module
from cStringIO import StringIO
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe, SafeData
from django.utils.thread_support import currentThread
# Translations are cached in a dictionary for every language+app tuple.
# The active translations are stored by threadid to make them thread local.
_translations = {}
_active = {}
# The default translation is based on the settings file.
_default = None
# This is a cache for normalized accept-header languages to prevent multiple
# file lookups when checking the same locale on repeated requests.
_accepted = {}
# Format of Accept-Language header values. From RFC 2616, section 14.4 and 3.9.
accept_language_re = re.compile(r'''
([A-Za-z]{1,8}(?:-[A-Za-z]{1,8})*|\*) # "en", "en-au", "x-y-z", "*"
(?:;q=(0(?:\.\d{,3})?|1(?:.0{,3})?))? # Optional "q=1.00", "q=0.8"
(?:\s*,\s*|$) # Multiple accepts per header.
''', re.VERBOSE)
def to_locale(language, to_lower=False):
"""
Turns a language name (en-us) into a locale name (en_US). If 'to_lower' is
True, the last component is lower-cased (en_us).
"""
p = language.find('-')
if p >= 0:
if to_lower:
return language[:p].lower()+'_'+language[p+1:].lower()
else:
return language[:p].lower()+'_'+language[p+1:].upper()
else:
return language.lower()
def to_language(locale):
"""Turns a locale name (en_US) into a language name (en-us)."""
p = locale.find('_')
if p >= 0:
return locale[:p].lower()+'-'+locale[p+1:].lower()
else:
return locale.lower()
class DjangoTranslation(gettext_module.GNUTranslations):
"""
This class sets up the GNUTranslations context with regard to output
charset. Django uses a defined DEFAULT_CHARSET as the output charset on
Python 2.4. With Python 2.3, use DjangoTranslation23.
"""
def __init__(self, *args, **kw):
from django.conf import settings
gettext_module.GNUTranslations.__init__(self, *args, **kw)
# Starting with Python 2.4, there's a function to define
# the output charset. Before 2.4, the output charset is
# identical with the translation file charset.
try:
self.set_output_charset('utf-8')
except AttributeError:
pass
self.django_output_charset = 'utf-8'
self.__language = '??'
def merge(self, other):
self._catalog.update(other._catalog)
def set_language(self, language):
self.__language = language
def language(self):
return self.__language
def __repr__(self):
return "<DjangoTranslation lang:%s>" % self.__language
class DjangoTranslation23(DjangoTranslation):
"""
Compatibility class that is only used with Python 2.3.
Python 2.3 doesn't support set_output_charset on translation objects and
needs this wrapper class to make sure input charsets from translation files
are correctly translated to output charsets.
With a full switch to Python 2.4, this can be removed from the source.
"""
def gettext(self, msgid):
res = self.ugettext(msgid)
return res.encode(self.django_output_charset)
def ngettext(self, msgid1, msgid2, n):
res = self.ungettext(msgid1, msgid2, n)
return res.encode(self.django_output_charset)
def translation(language):
"""
Returns a translation object.
This translation object will be constructed out of multiple GNUTranslations
objects by merging their catalogs. It will construct a object for the
requested language and add a fallback to the default language, if it's
different from the requested language.
"""
global _translations
t = _translations.get(language, None)
if t is not None:
return t
from django.conf import settings
# set up the right translation class
klass = DjangoTranslation
if sys.version_info < (2, 4):
klass = DjangoTranslation23
globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
if settings.SETTINGS_MODULE is not None:
parts = settings.SETTINGS_MODULE.split('.')
project = import_module(parts[0])
projectpath = os.path.join(os.path.dirname(project.__file__), 'locale')
else:
projectpath = None
def _fetch(lang, fallback=None):
global _translations
loc = to_locale(lang)
res = _translations.get(lang, None)
if res is not None:
return res
def _translation(path):
try:
t = gettext_module.translation('django', path, [loc], klass)
t.set_language(lang)
return t
except IOError, e:
return None
res = _translation(globalpath)
# We want to ensure that, for example, "en-gb" and "en-us" don't share
# the same translation object (thus, merging en-us with a local update
# doesn't affect en-gb), even though they will both use the core "en"
# translation. So we have to subvert Python's internal gettext caching.
base_lang = lambda x: x.split('-', 1)[0]
if base_lang(lang) in [base_lang(trans) for trans in _translations]:
res._info = res._info.copy()
res._catalog = res._catalog.copy()
def _merge(path):
t = _translation(path)
if t is not None:
if res is None:
return t
else:
res.merge(t)
return res
for localepath in settings.LOCALE_PATHS:
if os.path.isdir(localepath):
res = _merge(localepath)
if projectpath and os.path.isdir(projectpath):
res = _merge(projectpath)
for appname in settings.INSTALLED_APPS:
app = import_module(appname)
apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
if os.path.isdir(apppath):
res = _merge(apppath)
if res is None:
if fallback is not None:
res = fallback
else:
return gettext_module.NullTranslations()
_translations[lang] = res
return res
default_translation = _fetch(settings.LANGUAGE_CODE)
current_translation = _fetch(language, fallback=default_translation)
return current_translation
def activate(language):
"""
Fetches the translation object for a given tuple of application name and
language and installs it as the current translation object for the current
thread.
"""
_active[currentThread()] = translation(language)
def deactivate():
"""
Deinstalls the currently active translation object so that further _ calls
will resolve against the default translation object, again.
"""
global _active
if currentThread() in _active:
del _active[currentThread()]
def deactivate_all():
"""
Makes the active translation object a NullTranslations() instance. This is
useful when we want delayed translations to appear as the original string
for some reason.
"""
_active[currentThread()] = gettext_module.NullTranslations()
def get_language():
"""Returns the currently selected language."""
t = _active.get(currentThread(), None)
if t is not None:
try:
return to_language(t.language())
except AttributeError:
pass
# If we don't have a real translation object, assume it's the default language.
from django.conf import settings
return settings.LANGUAGE_CODE
def get_language_bidi():
"""
Returns selected language's BiDi layout.
False = left-to-right layout
True = right-to-left layout
"""
from django.conf import settings
base_lang = get_language().split('-')[0]
return base_lang in settings.LANGUAGES_BIDI
def catalog():
"""
Returns the current active catalog for further processing.
This can be used if you need to modify the catalog or want to access the
whole message catalog instead of just translating one string.
"""
global _default, _active
t = _active.get(currentThread(), None)
if t is not None:
return t
if _default is None:
from django.conf import settings
_default = translation(settings.LANGUAGE_CODE)
return _default
def do_translate(message, translation_function):
"""
Translates 'message' using the given 'translation_function' name -- which
will be either gettext or ugettext. It uses the current thread to find the
translation object to use. If no current translation is activated, the
message will be run through the default translation object.
"""
global _default, _active
t = _active.get(currentThread(), None)
if t is not None:
result = getattr(t, translation_function)(message)
else:
if _default is None:
from django.conf import settings
_default = translation(settings.LANGUAGE_CODE)
result = getattr(_default, translation_function)(message)
if isinstance(message, SafeData):
return mark_safe(result)
return result
def gettext(message):
return do_translate(message, 'gettext')
def ugettext(message):
return do_translate(message, 'ugettext')
def gettext_noop(message):
"""
Marks strings for translation but doesn't translate them now. This can be
used to store strings in global variables that should stay in the base
language (because they might be used externally) and will be translated
later.
"""
return message
def do_ntranslate(singular, plural, number, translation_function):
global _default, _active
t = _active.get(currentThread(), None)
if t is not None:
return getattr(t, translation_function)(singular, plural, number)
if _default is None:
from django.conf import settings
_default = translation(settings.LANGUAGE_CODE)
return getattr(_default, translation_function)(singular, plural, number)
def ngettext(singular, plural, number):
"""
Returns a UTF-8 bytestring of the translation of either the singular or
plural, based on the number.
"""
return do_ntranslate(singular, plural, number, 'ngettext')
def ungettext(singular, plural, number):
"""
Returns a unicode strings of the translation of either the singular or
plural, based on the number.
"""
return do_ntranslate(singular, plural, number, 'ungettext')
def check_for_language(lang_code):
"""
Checks whether there is a global language file for the given language
code. This is used to decide whether a user-provided language is
available. This is only used for language codes from either the cookies or
session.
"""
from django.conf import settings
globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
if gettext_module.find('django', globalpath, [to_locale(lang_code)]) is not None:
return True
else:
return False
def get_language_from_request(request):
"""
Analyzes the request to find what language the user wants the system to
show. Only languages listed in settings.LANGUAGES are taken into account.
If the user requests a sublanguage where we have a main language, we send
out the main language.
"""
global _accepted
from django.conf import settings
globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
supported = dict(settings.LANGUAGES)
if hasattr(request, 'session'):
lang_code = request.session.get('django_language', None)
if lang_code in supported and lang_code is not None and check_for_language(lang_code):
return lang_code
lang_code = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME)
if lang_code and lang_code in supported and check_for_language(lang_code):
return lang_code
accept = request.META.get('HTTP_ACCEPT_LANGUAGE', '')
for accept_lang, unused in parse_accept_lang_header(accept):
if accept_lang == '*':
break
# We have a very restricted form for our language files (no encoding
# specifier, since they all must be UTF-8 and only one possible
# language each time. So we avoid the overhead of gettext.find() and
# work out the MO file manually.
# 'normalized' is the root name of the locale in POSIX format (which is
# the format used for the directories holding the MO files).
normalized = locale.locale_alias.get(to_locale(accept_lang, True))
if not normalized:
continue
# Remove the default encoding from locale_alias.
normalized = normalized.split('.')[0]
if normalized in _accepted:
# We've seen this locale before and have an MO file for it, so no
# need to check again.
return _accepted[normalized]
for lang, dirname in ((accept_lang, normalized),
(accept_lang.split('-')[0], normalized.split('_')[0])):
if lang.lower() not in supported:
continue
langfile = os.path.join(globalpath, dirname, 'LC_MESSAGES',
'django.mo')
if os.path.exists(langfile):
_accepted[normalized] = lang
return lang
return settings.LANGUAGE_CODE
def get_date_formats():
"""
Checks whether translation files provide a translation for some technical
message ID to store date and time formats. If it doesn't contain one, the
formats provided in the settings will be used.
"""
from django.conf import settings
date_format = ugettext('DATE_FORMAT')
datetime_format = ugettext('DATETIME_FORMAT')
time_format = ugettext('TIME_FORMAT')
if date_format == 'DATE_FORMAT':
date_format = settings.DATE_FORMAT
if datetime_format == 'DATETIME_FORMAT':
datetime_format = settings.DATETIME_FORMAT
if time_format == 'TIME_FORMAT':
time_format = settings.TIME_FORMAT
return date_format, datetime_format, time_format
def get_partial_date_formats():
"""
Checks whether translation files provide a translation for some technical
message ID to store partial date formats. If it doesn't contain one, the
formats provided in the settings will be used.
"""
from django.conf import settings
year_month_format = ugettext('YEAR_MONTH_FORMAT')
month_day_format = ugettext('MONTH_DAY_FORMAT')
if year_month_format == 'YEAR_MONTH_FORMAT':
year_month_format = settings.YEAR_MONTH_FORMAT
if month_day_format == 'MONTH_DAY_FORMAT':
month_day_format = settings.MONTH_DAY_FORMAT
return year_month_format, month_day_format
dot_re = re.compile(r'\S')
def blankout(src, char):
"""
Changes every non-whitespace character to the given char.
Used in the templatize function.
"""
return dot_re.sub(char, src)
inline_re = re.compile(r"""^\s*trans\s+((?:".*?")|(?:'.*?'))\s*""")
block_re = re.compile(r"""^\s*blocktrans(?:\s+|$)""")
endblock_re = re.compile(r"""^\s*endblocktrans$""")
plural_re = re.compile(r"""^\s*plural$""")
constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""")
def templatize(src):
"""
Turns a Django template into something that is understood by xgettext. It
does so by translating the Django translation tags into standard gettext
function invocations.
"""
from django.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
out = StringIO()
intrans = False
inplural = False
singular = []
plural = []
for t in Lexer(src, None).tokenize():
if intrans:
if t.token_type == TOKEN_BLOCK:
endbmatch = endblock_re.match(t.contents)
pluralmatch = plural_re.match(t.contents)
if endbmatch:
if inplural:
out.write(' ngettext(%r,%r,count) ' % (''.join(singular), ''.join(plural)))
for part in singular:
out.write(blankout(part, 'S'))
for part in plural:
out.write(blankout(part, 'P'))
else:
out.write(' gettext(%r) ' % ''.join(singular))
for part in singular:
out.write(blankout(part, 'S'))
intrans = False
inplural = False
singular = []
plural = []
elif pluralmatch:
inplural = True
else:
raise SyntaxError("Translation blocks must not include other block tags: %s" % t.contents)
elif t.token_type == TOKEN_VAR:
if inplural:
plural.append('%%(%s)s' % t.contents)
else:
singular.append('%%(%s)s' % t.contents)
elif t.token_type == TOKEN_TEXT:
if inplural:
plural.append(t.contents)
else:
singular.append(t.contents)
else:
if t.token_type == TOKEN_BLOCK:
imatch = inline_re.match(t.contents)
bmatch = block_re.match(t.contents)
cmatches = constant_re.findall(t.contents)
if imatch:
g = imatch.group(1)
if g[0] == '"': g = g.strip('"')
elif g[0] == "'": g = g.strip("'")
out.write(' gettext(%r) ' % g)
elif bmatch:
for fmatch in constant_re.findall(t.contents):
<|fim▁hole|> intrans = True
inplural = False
singular = []
plural = []
elif cmatches:
for cmatch in cmatches:
out.write(' _(%s) ' % cmatch)
else:
out.write(blankout(t.contents, 'B'))
elif t.token_type == TOKEN_VAR:
parts = t.contents.split('|')
cmatch = constant_re.match(parts[0])
if cmatch:
out.write(' _(%s) ' % cmatch.group(1))
for p in parts[1:]:
if p.find(':_(') >= 0:
out.write(' %s ' % p.split(':',1)[1])
else:
out.write(blankout(p, 'F'))
else:
out.write(blankout(t.contents, 'X'))
return out.getvalue()
def parse_accept_lang_header(lang_string):
"""
Parses the lang_string, which is the body of an HTTP Accept-Language
header, and returns a list of (lang, q-value), ordered by 'q' values.
Any format errors in lang_string results in an empty list being returned.
"""
result = []
pieces = accept_language_re.split(lang_string)
if pieces[-1]:
return []
for i in range(0, len(pieces) - 1, 3):
first, lang, priority = pieces[i : i + 3]
if first:
return []
priority = priority and float(priority) or 1.0
result.append((lang, priority))
result.sort(lambda x, y: -cmp(x[1], y[1]))
return result<|fim▁end|> | out.write(' _(%s) ' % fmatch)
|
<|file_name|>graphviz.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! This module provides linkage between libgraphviz traits and
//! `rustc::middle::typeck::infer::region_inference`, generating a
//! rendering of the graph represented by the list of `Constraint`
//! instances (which make up the edges of the graph), as well as the
//! origin for each constraint (which are attached to the labels on
//! each edge).
/// For clarity, rename the graphviz crate locally to dot.
use graphviz as dot;
use middle::ty;
use super::Constraint;
use middle::infer::SubregionOrigin;
use middle::infer::region_inference::RegionVarBindings;
use util::nodemap::{FnvHashMap, FnvHashSet};
use util::ppaux::Repr;
use std::collections::hash_map::Entry::Vacant;
use std::io::{self, File};
use std::os;
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
use syntax::ast;
fn print_help_message() {
println!("\
-Z print-region-graph by default prints a region constraint graph for every \n\
function body, to the path `/tmp/constraints.nodeXXX.dot`, where the XXX is \n\
replaced with the node id of the function under analysis. \n\
\n\
To select one particular function body, set `RUST_REGION_GRAPH_NODE=XXX`, \n\
where XXX is the node id desired. \n\
\n\
To generate output to some path other than the default \n\
`/tmp/constraints.nodeXXX.dot`, set `RUST_REGION_GRAPH=/path/desired.dot`; \n\
occurrences of the character `%` in the requested path will be replaced with\n\
the node id of the function under analysis. \n\
\n\
(Since you requested help via RUST_REGION_GRAPH=help, no region constraint \n\
graphs will be printed. \n\
");
}
pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a, 'tcx>,
subject_node: ast::NodeId) {
let tcx = region_vars.tcx;
if !region_vars.tcx.sess.opts.debugging_opts.print_region_graph {
return;
}
let requested_node : Option<ast::NodeId> =
os::getenv("RUST_REGION_GRAPH_NODE").and_then(|s| s.parse());
if requested_node.is_some() && requested_node != Some(subject_node) {
return;
}
let requested_output = os::getenv("RUST_REGION_GRAPH");
debug!("requested_output: {:?} requested_node: {:?}",
requested_output, requested_node);
let output_path = {
let output_template = match requested_output {
Some(ref s) if s.as_slice() == "help" => {
static PRINTED_YET: AtomicBool = ATOMIC_BOOL_INIT;
if !PRINTED_YET.load(Ordering::SeqCst) {
print_help_message();
PRINTED_YET.store(true, Ordering::SeqCst);
}
return;
}
Some(other_path) => other_path,
None => "/tmp/constraints.node%.dot".to_string(),
};
if output_template.len() == 0 {
tcx.sess.bug("empty string provided as RUST_REGION_GRAPH");
}
<|fim▁hole|> if output_template.contains_char('%') {
let mut new_str = String::new();
for c in output_template.chars() {
if c == '%' {
new_str.push_str(subject_node.to_string().as_slice());
} else {
new_str.push(c);
}
}
new_str
} else {
output_template
}
};
let constraints = &*region_vars.constraints.borrow();
match dump_region_constraints_to(tcx, constraints, output_path.as_slice()) {
Ok(()) => {}
Err(e) => {
let msg = format!("io error dumping region constraints: {}", e);
region_vars.tcx.sess.err(msg.as_slice())
}
}
}
struct ConstraintGraph<'a, 'tcx: 'a> {
tcx: &'a ty::ctxt<'tcx>,
graph_name: String,
map: &'a FnvHashMap<Constraint, SubregionOrigin<'tcx>>,
node_ids: FnvHashMap<Node, uint>,
}
#[derive(Clone, Hash, PartialEq, Eq, Show)]
enum Node {
RegionVid(ty::RegionVid),
Region(ty::Region),
}
type Edge = Constraint;
impl<'a, 'tcx> ConstraintGraph<'a, 'tcx> {
fn new(tcx: &'a ty::ctxt<'tcx>,
name: String,
map: &'a ConstraintMap<'tcx>) -> ConstraintGraph<'a, 'tcx> {
let mut i = 0;
let mut node_ids = FnvHashMap::new();
{
let mut add_node = |&mut : node| {
if let Vacant(e) = node_ids.entry(node) {
e.insert(i);
i += 1;
}
};
for (n1, n2) in map.keys().map(|c|constraint_to_nodes(c)) {
add_node(n1);
add_node(n2);
}
}
ConstraintGraph { tcx: tcx,
graph_name: name,
map: map,
node_ids: node_ids }
}
}
impl<'a, 'tcx> dot::Labeller<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> {
fn graph_id(&self) -> dot::Id {
dot::Id::new(self.graph_name.as_slice()).unwrap()
}
fn node_id(&self, n: &Node) -> dot::Id {
dot::Id::new(format!("node_{}", self.node_ids.get(n).unwrap())).unwrap()
}
fn node_label(&self, n: &Node) -> dot::LabelText {
match *n {
Node::RegionVid(n_vid) =>
dot::LabelText::label(format!("{:?}", n_vid)),
Node::Region(n_rgn) =>
dot::LabelText::label(format!("{}", n_rgn.repr(self.tcx))),
}
}
fn edge_label(&self, e: &Edge) -> dot::LabelText {
dot::LabelText::label(format!("{}", self.map.get(e).unwrap().repr(self.tcx)))
}
}
fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
match *c {
Constraint::ConstrainVarSubVar(rv_1, rv_2) => (Node::RegionVid(rv_1),
Node::RegionVid(rv_2)),
Constraint::ConstrainRegSubVar(r_1, rv_2) => (Node::Region(r_1),
Node::RegionVid(rv_2)),
Constraint::ConstrainVarSubReg(rv_1, r_2) => (Node::RegionVid(rv_1),
Node::Region(r_2)),
}
}
impl<'a, 'tcx> dot::GraphWalk<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> {
fn nodes(&self) -> dot::Nodes<Node> {
let mut set = FnvHashSet::new();
for constraint in self.map.keys() {
let (n1, n2) = constraint_to_nodes(constraint);
set.insert(n1);
set.insert(n2);
}
debug!("constraint graph has {} nodes", set.len());
set.into_iter().collect()
}
fn edges(&self) -> dot::Edges<Edge> {
debug!("constraint graph has {} edges", self.map.len());
self.map.keys().map(|e|*e).collect()
}
fn source(&self, edge: &Edge) -> Node {
let (n1, _) = constraint_to_nodes(edge);
debug!("edge {:?} has source {:?}", edge, n1);
n1
}
fn target(&self, edge: &Edge) -> Node {
let (_, n2) = constraint_to_nodes(edge);
debug!("edge {:?} has target {:?}", edge, n2);
n2
}
}
pub type ConstraintMap<'tcx> = FnvHashMap<Constraint, SubregionOrigin<'tcx>>;
fn dump_region_constraints_to<'a, 'tcx:'a >(tcx: &'a ty::ctxt<'tcx>,
map: &ConstraintMap<'tcx>,
path: &str) -> io::IoResult<()> {
debug!("dump_region_constraints map (len: {}) path: {}", map.len(), path);
let g = ConstraintGraph::new(tcx, format!("region_constraints"), map);
let mut f = File::create(&Path::new(path));
debug!("dump_region_constraints calling render");
dot::render(&g, &mut f)
}<|fim▁end|> | |
<|file_name|>opf_metrics_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program 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 this program. If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------
import numpy as np
import unittest2 as unittest
from nupic.frameworks.opf.metrics import getModule, MetricSpec
class OPFMetricsTest(unittest.TestCase):
DELTA = 0.01
VERBOSITY = 0
def testRMSE(self):
rmse = getModule(MetricSpec("rmse", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
rmse.addInstance(gt[i], p[i])
target = 6.71
self.assertTrue(abs(rmse.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testWindowedRMSE(self):
wrmse = getModule(MetricSpec("rmse", None, None,
{"verbosity": OPFMetricsTest.VERBOSITY, "window":3}))
gt = [9, 4, 4, 100, 44]
p = [0, 13, 4, 6, 7]
for gv, pv in zip(gt, p):
wrmse.addInstance(gv, pv)
target = 58.324
self.assertTrue (abs(wrmse.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testAAE(self):
aae = getModule(MetricSpec("aae", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
aae.addInstance(gt[i], p[i])
target = 6.0
self.assertTrue(abs(aae.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testTrivialAAE(self):
trivialaae = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY,"errorMetric":"aae"}))
gt = [i/4+1 for i in range(100)]
p = [i for i in range(100)]
for i in xrange(len(gt)):
trivialaae.addInstance(gt[i], p[i])
target = .25
self.assertTrue(abs(trivialaae.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA)
def testTrivialAccuracy(self):
trivialaccuracy = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY,"errorMetric":"acc"}))
gt = [str(i/4+1) for i in range(100)]
p = [str(i) for i in range(100)]
for i in xrange(len(gt)):
trivialaccuracy.addInstance(gt[i], p[i])
target = .75
self.assertTrue(abs(trivialaccuracy.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA)
def testWindowedTrivialAAE (self):
"""Trivial Average Error metric test"""
trivialAveErr = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY,"errorMetric":"avg_err"}))
gt = [str(i/4+1) for i in range(100)]
p = [str(i) for i in range(100)]
for i in xrange(len(gt)):
trivialAveErr.addInstance(gt[i], p[i])
target = .25
self.assertTrue(abs(trivialAveErr.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testWindowedTrivialAccuract(self):
"""Trivial AAE metric test"""
trivialaae = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100,"errorMetric":"aae"}))
gt = [i/4+1 for i in range(1000)]
p = [i for i in range(1000)]
for i in xrange(len(gt)):
trivialaae.addInstance(gt[i], p[i])
target = .25
self.assertTrue(abs(trivialaae.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA)
def testWindowedTrivialAccuracy(self):
"""Trivial Accuracy metric test"""
trivialaccuracy = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100,"errorMetric":"acc"}))
gt = [str(i/4+1) for i in range(1000)]
p = [str(i) for i in range(1000)]
for i in xrange(len(gt)):
trivialaccuracy.addInstance(gt[i], p[i])
target = .75
self.assertTrue(abs(trivialaccuracy.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testWindowedTrivialAverageError (self):
"""Trivial Average Error metric test"""
trivialAveErr = getModule(MetricSpec("trivial", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100,"errorMetric":"avg_err"}))
gt = [str(i/4+1) for i in range(500, 1000)]
p = [str(i) for i in range(1000)]
for i in xrange(len(gt)):
trivialAveErr.addInstance(gt[i], p[i])
target = .25
self.assertTrue(abs(trivialAveErr.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testMultistepAAE(self):
"""Multistep AAE metric test"""
msp = getModule(MetricSpec("multiStep", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "errorMetric":"aae",
"steps": 3}))
# Make each ground truth 1 greater than the prediction
gt = [i+1 for i in range(100)]
p = [{3: {i: .7, 5: 0.3}} for i in range(100)]
for i in xrange(len(gt)):
msp.addInstance(gt[i], p[i])
target = 1
self.assertTrue(abs(msp.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testMultistepAAEMultipleSteps(self):
"""Multistep AAE metric test, predicting 2 different step sizes"""
msp = getModule(MetricSpec("multiStep", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "errorMetric":"aae",
"steps": [3,6]}))
# Make each 3 step prediction +1 over ground truth and each 6 step
# prediction +0.5 over ground truth
gt = [i for i in range(100)]
p = [{3: {i+1: .7, 5: 0.3},
6: {i+0.5: .7, 5: 0.3}} for i in range(100)]
for i in xrange(len(gt)):
msp.addInstance(gt[i], p[i])
target = 0.75 # average of +1 error and 0.5 error
self.assertTrue(abs(msp.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testMultistepProbability(self):
"""Multistep with probabilities metric test"""
msp = getModule(MetricSpec("multiStepProbability", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "errorMetric":"aae",
"steps":3}))
gt = [5 for i in range(1000)]
p = [{3: {i: .3, 5: .7}} for i in range(1000)]
for i in xrange(len(gt)):
msp.addInstance(gt[i], p[i])
#((999-5)(1000-5)/2-(899-5)(900-5)/2)*.3/100
target = 283.35
self.assertTrue(abs(msp.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testMultistepProbabilityMultipleSteps(self):
"""Multistep with probabilities metric test, predicting 2 different step
sizes"""
msp = getModule(MetricSpec("multiStepProbability", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100,
"errorMetric":"aae", "steps": [1,3]}))
gt = [5 for i in range(1000)]
p = [{3: {i: .3, 5: .7},
1: {5: 1.0}} for i in range(1000)]
for i in xrange(len(gt)):
msp.addInstance(gt[i], p[i])
#(((999-5)(1000-5)/2-(899-5)(900-5)/2)*.3/100) / 2
# / 2 because the 1-step prediction is 100% accurate
target = 283.35/2
self.assertTrue(abs(msp.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testMovingMeanAbsoluteError(self):
"""Moving mean Average Absolute Error metric test"""
movingMeanAAE = getModule(MetricSpec("moving_mean", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "mean_window":3,
"errorMetric":"aae"}))
gt = [i for i in range(890)]
gt.extend([2*i for i in range(110)])
p = [i for i in range(1000)]
res = []
for i in xrange(len(gt)):
movingMeanAAE.addInstance(gt[i], p[i])
res.append(movingMeanAAE.getMetric()["value"])
self.assertTrue(max(res[1:890]) == 2.0)
self.assertTrue(min(res[891:])>=4.0)
target = 4.0
self.assertTrue(abs(movingMeanAAE.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testMovingMeanRMSE(self):
"""Moving mean RMSE metric test"""
movingMeanRMSE = getModule(MetricSpec("moving_mean", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "mean_window":3,
"errorMetric":"rmse"}))
gt = [i for i in range(890)]
gt.extend([2*i for i in range(110)])
p = [i for i in range(1000)]
res = []
for i in xrange(len(gt)):
movingMeanRMSE.addInstance(gt[i], p[i])
res.append(movingMeanRMSE.getMetric()["value"])
self.assertTrue(max(res[1:890]) == 2.0)
self.assertTrue(min(res[891:])>=4.0)
target = 4.0
self.assertTrue(abs(movingMeanRMSE.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA)
def testMovingModeAverageError(self):
"""Moving mode Average Error metric test"""
movingModeAvgErr = getModule(MetricSpec("moving_mode", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "mode_window":3,
"errorMetric":"avg_err"}))
#Should initiall assymptote to .5
#Then after 900 should go to 1.0 as the predictions will always be offset
gt = [i/4 for i in range(900)]
gt.extend([2*i/4 for i in range(100)])
p = [i for i in range(1000)]
res = []
for i in xrange(len(gt)):
movingModeAvgErr.addInstance(gt[i], p[i])
res.append(movingModeAvgErr.getMetric()["value"])
#Make sure that there is no point where the average error is >.5
self.assertTrue(max(res[1:890]) == .5)
#Make sure that after the statistics switch the error goes to 1.0
self.assertTrue(min(res[891:])>=.5)
#Make sure that the statistics change is still noticeable while it is
#in the window
self.assertTrue(res[998]<1.0)
target = 1.0
self.assertTrue(abs(movingModeAvgErr.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testMovingModeAccuracy(self):
"""Moving mode Accuracy metric test"""
movingModeACC = getModule(MetricSpec("moving_mode", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "mode_window":3,
"errorMetric":"acc"}))
#Should initially asymptote to .5
#Then after 900 should go to 0.0 as the predictions will always be offset
gt = [i/4 for i in range(900)]
gt.extend([2*i/4 for i in range(100)])
p = [i for i in range(1000)]
res = []
for i in xrange(len(gt)):
movingModeACC.addInstance(gt[i], p[i])
res.append(movingModeACC.getMetric()["value"])
#Make sure that there is no point where the average acc is <.5
self.assertTrue(min(res[1:899]) == .5)
#Make sure that after the statistics switch the acc goes to 0.0
self.assertTrue(max(res[900:])<=.5)
#Make sure that the statistics change is still noticeable while it
#is in the window
self.assertTrue(res[998]>0.0)
target = 0.0
self.assertTrue(abs(movingModeACC.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testTwoGramScalars(self):
"""Two gram scalars test"""
oneGram = getModule(MetricSpec("two_gram", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, \
"window":100, "predictionField":"test",
"errorMetric":"acc"}))
# Sequences of 0,1,2,3,4,0,1,2,3,4,...
encodings = [np.zeros(10) for i in range(5)]
for i in range(len(encodings)):
encoding = encodings[i]
encoding[i] = 1
gt = [i%5 for i in range(1000)]
res = []
for i in xrange(len(gt)):
if i == 20:
# Make sure we don"t barf with missing values
oneGram.addInstance(np.zeros(10), prediction=None,
record={"test":None})
else:
# Feed in next groundTruth
oneGram.addInstance(encodings[i%5], prediction=None,
record={"test":gt[i]})
res.append(oneGram.getMetric()["value"])
target = 1.0
self.assertTrue(abs(oneGram.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testTwoGramScalarsStepsGreaterOne(self):
"""Two gram scalars test with step size other than 1"""
oneGram = getModule(MetricSpec("two_gram", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY,\
"window":100, "predictionField":"test",
"errorMetric":"acc", "steps": 2}))
# Sequences of 0,1,2,3,4,0,1,2,3,4,...
encodings = [np.zeros(10) for i in range(5)]
for i in range(len(encodings)):
encoding = encodings[i]
encoding[i] = 1
gt = [i%5 for i in range(1000)]
res = []
for i in xrange(len(gt)):
if i == 20:
# Make sure we don"t barf with missing values
oneGram.addInstance(np.zeros(10), prediction=None,
record={"test":None})
else:
# Feed in next groundTruth
oneGram.addInstance(encodings[i%5], prediction=None,
record={"test":gt[i]})
res.append(oneGram.getMetric()["value"])
target = 1.0
self.assertTrue(abs(oneGram.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA)
def testTwoGramStrings(self):
"""One gram string test"""
oneGram = getModule(MetricSpec("two_gram", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100, "errorMetric":"acc",
"predictionField":"test"}))
# Sequences of "0", "1", "2", "3", "4", "0", "1", ...
gt = [str(i%5) for i in range(1000)]
encodings = [np.zeros(10) for i in range(5)]
for i in range(len(encodings)):
encoding = encodings[i]
encoding[i] = 1
# Make every 5th element random
newElem = 100
for i in range(5, 1000, 5):
gt[i] = str(newElem)
newElem += 20
res = []
for i in xrange(len(gt)):
if i==20:
# Make sure we don"t barf with missing values
oneGram.addInstance(np.zeros(10), prediction=None,
record={"test":None})
else:
oneGram.addInstance(encodings[i%5], prediction=None,
record={"test":gt[i]})
res.append(oneGram.getMetric()["value"])
target = .8
self.assertTrue(abs(oneGram.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testWindowedAAE(self):
"""Windowed AAE"""
waae = getModule(MetricSpec("aae", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":1}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
waae.addInstance(gt[i], p[i])
target = 3.0
self.assertTrue( abs(waae.getMetric()["value"]-target) \
< OPFMetricsTest.DELTA, "Got %s" %waae.getMetric())
def testAccuracy(self):
"""Accuracy"""
acc = getModule(MetricSpec("acc", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY}))
gt = [0, 1, 2, 3, 4, 5]
p = [0, 1, 2, 4, 5, 6]
for i in xrange(len(gt)):
acc.addInstance(gt[i], p[i])
target = 0.5
self.assertTrue(abs(acc.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testWindowedAccuracy(self):
"""Windowed accuracy"""
acc = getModule(MetricSpec("acc", None, None, \
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":2}))
gt = [0, 1, 2, 3, 4, 5]
p = [0, 1, 2, 4, 5, 6]
for i in xrange(len(gt)):
acc.addInstance(gt[i], p[i])
target = 0.0
self.assertTrue(abs(acc.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testAverageError(self):
"""Ave Error"""
err = getModule(MetricSpec("avg_err", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY}))
gt = [1, 1, 2, 3, 4, 5]
p = [0, 1, 2, 4, 5, 6]
for i in xrange(len(gt)):
err.addInstance(gt[i], p[i])
target = (2.0/3.0)
self.assertTrue(abs(err.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testWindowedAverageError(self):
"""Windowed Ave Error"""
err = getModule(MetricSpec("avg_err", None, None, \
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":2}))
gt = [0, 1, 2, 3, 4, 5]
p = [0, 1, 2, 4, 5, 6]
for i in xrange(len(gt)):
err.addInstance(gt[i], p[i])
target = 1.0
self.assertTrue(abs(err.getMetric()["value"]-target) < OPFMetricsTest.DELTA)
def testLongWindowRMSE(self):
"""RMSE"""
rmse = getModule(MetricSpec("rmse", None, None,
{"verbosity" : OPFMetricsTest.VERBOSITY, "window":100}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
rmse.addInstance(gt[i], p[i])
target = 6.71
self.assertTrue(abs(rmse.getMetric()["value"]-target)\
< OPFMetricsTest.DELTA)
def testCustomErrorMetric(self):
customFunc = """def getError(pred,ground,tools):
return abs(pred-ground)"""
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc, "errorWindow":3}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
aggErr = customEM.addInstance(gt[i], p[i])
target = 5.0
delta = 0.001
# insure that addInstance returns the aggregate error - other
# uber metrics depend on this behavior.
self.assertEqual(aggErr, customEM.getMetric()["value"])
self.assertTrue(abs(customEM.getMetric()["value"]-target) < delta)
customFunc = """def getError(pred,ground,tools):
sum = 0
for i in range(min(3,tools.getBufferLen())):
sum+=abs(tools.getPrediction(i)-tools.getGroundTruth(i))
return sum/3"""
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [9, 4, 5, 6]
p = [0, 13, 8, 3]
for i in xrange(len(gt)):
customEM.addInstance(gt[i], p[i])
target = 5.0
delta = 0.001
self.assertTrue(abs(customEM.getMetric()["value"]-target) < delta)
# Test custom error metric helper functions
# Test getPrediction
# Not-Windowed
storeWindow=4
failed = False
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getPrediction(%d)""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue( not failed,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue( customEM.getMetric()["value"] == p[i-lookBack])
#Windowed
for lookBack in range(5):
customFunc = """def getError(pred,ground,tools):
return tools.getPrediction(%d)""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":storeWindow}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if lookBack>=storeWindow-1:
pass
if i < lookBack or lookBack>=storeWindow:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue (not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == p[i-lookBack])
#Test getGroundTruth
#Not-Windowed
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getGroundTruth(%d)""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue( not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == gt[i-lookBack])
#Windowed
for lookBack in range(5):
customFunc = """def getError(pred,ground,tools):
return tools.getGroundTruth(%d)""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":storeWindow}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack or lookBack>=storeWindow:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue( not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue( customEM.getMetric()["value"] == gt[i-lookBack])
#Test getFieldValue
#Not-Windowed Scalar
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getFieldValue(%d,"test1")""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue( not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == t1[i-lookBack])
#Windowed Scalar
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getFieldValue(%d,"test1")""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":storeWindow}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack or lookBack>=storeWindow:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue (not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue( customEM.getMetric()["value"] == t1[i-lookBack])
#Not-Windowed category
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getFieldValue(%d,"test1")""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue( not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == t1[i-lookBack])
#Windowed category
for lookBack in range(3):
customFunc = """def getError(pred,ground,tools):
return tools.getFieldValue(%d,"test1")""" % lookBack
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":storeWindow}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
if i < lookBack or lookBack>=storeWindow:
try:
customEM.addInstance(gt[i], p[i], curRecord)
failed = True
except:
self.assertTrue (not failed ,
"An exception should have been generated, but wasn't")
else:
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == t1[i-lookBack])
#Test getBufferLen
#Not-Windowed
customFunc = """def getError(pred,ground,tools):
return tools.getBufferLen()"""
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
customEM.addInstance(gt[i], p[i], curRecord)<|fim▁hole|> #Windowed
customFunc = """def getError(pred,ground,tools):
return tools.getBufferLen()"""
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":storeWindow}))
gt = [i for i in range(100)]
p = [2*i for i in range(100)]
t1 = [3*i for i in range(100)]
t2 = [str(4*i) for i in range(100)]
for i in xrange(len(gt)):
curRecord = {"pred":p[i], "ground":gt[i], "test1":t1[i], "test2":t2[i]}
customEM.addInstance(gt[i], p[i], curRecord)
self.assertTrue (customEM.getMetric()["value"] == min(i+1, 4))
#Test initialization edge cases
try:
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"errorWindow":0}))
self.assertTrue (False , "error Window of 0 should fail self.assertTrue")
except:
pass
try:
customEM = getModule(MetricSpec("custom_error_metric", None, None,
{"customFuncSource":customFunc,"storeWindow":0}))
self.assertTrue (False , "error Window of 0 should fail self.assertTrue")
except:
pass
if __name__ == "__main__":
unittest.main()<|fim▁end|> | self.assertTrue (customEM.getMetric()["value"] == i+1) |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from pathlib import Path
import click
from git import Repo
from git.exc import InvalidGitRepositoryError
from logger import logger
from config import config
from utils import PairedObject, PairedProject, get_current_project, PathType
@click.group()
@click.option('-v', '--verbose', is_flag=True, help='Enables verbose messaging')
@click.pass_context
def et(ctx: click.core.Context, verbose: bool):
"""
Primary top-level group command.
Calling directly with no parameters will display help.
"""
ctx.obj = {}
ctx.obj['verbose'] = verbose
@et.command('init', short_help='Initialize a new Env Tracker repository')
@click.argument('directory', default='.',
type=PathType(exists=True, file_okay=False, dir_okay=True, resolve_path=True, allow_dash=False))
@click.option('-n', '--name', type=click.STRING)
def cmd_init(directory: Path, name: str):
"""
Create an empty Git repository that points to an existing repository
"""
try:
existing_project = PairedProject.from_path(directory)
except Exception:
logger.debug('No existing project found - continuing')
else:
raise click.BadParameter(
f'Conflict: specified directory is already linked to {str(existing_project.child_dir)}',
param_hint='DIRECTORY')
## Validate parameters and set defaults
try:
repo = Repo(directory, search_parent_directories=False)
except InvalidGitRepositoryError:
try:
# Check if the directory is a subdir of a git repo and suggest that
repo = Repo(directory, search_parent_directories=True)
except InvalidGitRepositoryError:
raise click.BadParameter('Not a git repository.', param_hint=['directory'])
else:
raise click.BadParameter(f'Not a git repository. Did you mean this?\n\n\t{repo.working_dir}',<|fim▁hole|> parent_path = Path(repo.working_dir)
if name:
# names must not contain OS path delimiters
if Path(name).name != name:
raise click.BadParameter('Must not contain path delimiter, e.g. "/" or "\\"', param_hint=['name'])
else:
name = parent_path.name
child_path: Path = Path(config.ET_HOME) / name
to_parent_symlink: Path = child_path / config.PARENT_SYMLINK_NAME
## Attempt to create the child directory
try:
child_path.mkdir(parents=True)
except FileExistsError:
if to_parent_symlink.exists():
raise click.BadParameter(
f'Path "{child_path}" already exists and links to: "{to_parent_symlink.resolve()}"',
param_hint=['name'])
else:
raise click.BadParameter(f'Path "{child_path}" already exists', param_hint=['name'])
## Initialize the child repo
repo = Repo.init(child_path)
to_parent_symlink.symlink_to(parent_path)
repo.index.add([config.PARENT_SYMLINK_NAME])
repo.index.commit('Link project to parent directory')
click.echo(f'Installed new project "{name}", linking "{child_path}" -> "{parent_path}"')
@et.command('link', short_help='Link a file or directory')
@click.argument('file', type=PathType(exists=True, file_okay=True, dir_okay=True, allow_dash=False, writable=True,
readable=True, resolve_path=False))
def cmd_link(file: Path):
"""
Tracks a file in the parent repo.
Moves the specified file to the child repository and symlinks the file back to
its original location.
Validations:
- path exists
- path exists under the parent dir
- path does not exist under the child dir
- parent path is not a symlink
"""
# We check for symlink here because we resolve the file path to init the project
obj_pair = PairedObject.from_path(file)
if obj_pair.is_linked:
raise click.BadParameter(f'Path "{obj_pair.relative_path}" is already linked')
if obj_pair.parent_path.is_symlink():
raise click.BadParameter(f'Path "{file}" is already a symlink', param_hint=['file'])
if not obj_pair.working_from_parent:
raise click.BadParameter(f'Path "{file}" not found under "{obj_pair.project.parent_dir}"',
param_hint=['file'])
if obj_pair.child_path.exists():
raise click.BadParameter(f'Destination path "{obj_pair.child_path}" already exists', param_hint=['file'])
obj_pair.link()
# commit the new file
child_repo = obj_pair.project.child_repo
child_repo.index.add([str(obj_pair.relative_path)])
child_repo.index.commit(f'Initialize tracking for "{obj_pair.relative_path}"')
@et.command('unlink', short_help='Stop tracking a file or directory')
@click.argument('file', type=PathType(exists=True, file_okay=True, dir_okay=True, allow_dash=False, writable=True,
readable=True, resolve_path=False))
def cmd_unlink(file: Path):
"""
Unlinks a tracked file by reverting the changes made by the `link` command
TODO: add an `--all` option to unlink all objects
"""
## Validate parameters and set defaults
obj_pair = PairedObject.from_path(file)
if not obj_pair.is_linked:
raise click.BadParameter('File is not linked', param_hint=['file'])
## Unlink files
obj_pair.unlink()
## Commit changes
child_repo = obj_pair.project.child_repo
child_repo.index.remove([str(obj_pair.relative_path)])
child_repo.index.commit(f'Stop tracking for "{obj_pair.relative_path}"')
@et.command('status', short_help='`git status` on the linked repository')
def cmd_status():
proj = get_current_project()
g = proj.child_repo.git
click.echo(click.style(f'Showing git status for "{proj.child_dir}"', fg='red'))
click.echo()
click.echo(g.status())
@et.command('other', short_help='Output the linked repository directory')
def cmd_other():
"""
Writes the linked directory of the current location to stdout
Example usage:
cd `et other` - changes directory back and forth between linked repositories
"""
proj = get_current_project()
other_dir = proj.child_dir if proj.working_from_parent else proj.parent_dir
click.echo(other_dir)
@et.command('commit', short_help='Commit all changes to the linked directory')
@click.option('-m', '--message', type=click.STRING, default='Saving changes')
def cmd_commit(message):
"""
Commits all changes to the linked repository using `git add -u`
"""
proj = get_current_project()
proj.child_repo.git.add(update=True) # git add -u
proj.child_repo.index.commit(message)<|fim▁end|> | param_hint=['directory'])
|
<|file_name|>experiment.py<|end_file_name|><|fim▁begin|>"""
Author: Seyed Hamidreza Mohammadi
This file is part of the shamidreza/uniselection software.
Please refer to the LICENSE provided alongside the software (which is GPL v2,
http://www.gnu.org/licenses/gpl-2.0.html).
This file includes the code for putting all the pieces together.
"""
from utils import *
from extract_unit_info import *
from search import *
from generate_speech import *
if __name__ == "__main__":
if 0: # test pit2gci
pit_file='/Users/hamid/Code/hts/HTS-demo_CMU-ARCTIC-SLT2/gen/qst001/ver1/2mix/2/alice01.lf0'
target_gci = pit2gci(pit_file)
if 1: # test read_dur,pit,for methods
dur_file='/Users/hamid/Code/hts/HTS-demo_CMU-ARCTIC-SLT2/gen/qst001/ver1/2mix/2/alice01.dur'
for_file='/Users/hamid/Code/hts/HTS-demo_CMU-ARCTIC-SLT2/gen/qst001/ver1/2mix/2/alice01.for'
pit_file='/Users/hamid/Code/hts/HTS-demo_CMU-ARCTIC-SLT2/gen/qst001/ver1/2mix/2/alice01.lf0'
#a=read_hts_for(for_file)
#b=read_hts_pit(pit_file)
#c=read_hts_dur(dur_file)
fname = 'arctic_a0001'
lab_name=corpus_path+'/lab/'+fname+'.lab'
wav_name=corpus_path+'/wav/'+fname+'.wav'<|fim▁hole|> #times, labs = read_lab(lab_name)
##tmp_units=extract_info(lab_name, wav_name, 0,0)
times, pits, vox_times, vox_vals = read_hts_pit(pit_file)
frm_time, frm_val = read_hts_for(for_file)
gcis=pit2gci(times, pits, vox_times, vox_vals)
tmp_units, times=read_input_lab(dur_file, pit_file)
#tmp_units = tmp_units[128:140]##
target_units = np.zeros(len(tmp_units), 'object')
for j in xrange(len(tmp_units)):
target_units[j] = tmp_units[j]
if 0:
units, fnames=load_units()
units = units[:int(units.shape[0]*(100.0/100.0))]
best_units_indice=search(target_units, units,limit=20)
best_units = units[best_units_indice]
f=open('tmp2.pkl','w+')
import pickle
pickle.dump(best_units,f)
pickle.dump(fnames,f)
f.flush()
f.close()
else:
f=open('tmp2.pkl','r')
import pickle
best_units=pickle.load(f)
fnames=pickle.load(f)
#best_units = best_units[128:140]##
f.close()
for i in xrange(target_units.shape[0]):
print target_units[i].phone, best_units[i].phone, best_units[i].unit_id
#wavs=concatenate_units_overlap(best_units, fnames)
#gcis = gcis[(gcis>times[128]) * (gcis<times[140])]
#gcis -= times[128]
##$frm_time, frm_val = units2for(best_units, fnames, times, frm_time, frm_val)
frm_time *= 16000.0
gcis=units2gci(best_units, fnames)##$
gcis = np.array(gcis)
##$gcis *= 16000
gcis = gcis.astype(np.uint32)
old_times = np.array(times).copy()
old_times *= 16000.0
times=units2dur(best_units, fnames)##$
times = np.array(times)
##$times *= 16000
times = times.astype(np.uint32)
#times = times[128:141]##
#aa=times[0]##
#for i in range(len(times)):##
#times[i] -= aa##
#frm_time *= 16000
wavs=concatenate_units_psola_har_overlap(best_units, fnames, old_times, times, gcis, frm_time, frm_val, overlap=0.5)
#wavs=concatenate_units_nooverlap(best_units, fnames)
ftime, fval = get_formant(wavs, 16000)
from scipy.io.wavfile import write as wwrite
wwrite('out.wav', 16000, wavs)
print 'successfully saved out.wav'<|fim▁end|> | pm_name=corpus_path+'/pm/'+fname+'.pm'
##target_units = load_input(lab_name) |
<|file_name|>mess_manager.py<|end_file_name|><|fim▁begin|>#
# IIT Kharagpur - Hall Management System
# System to manage Halls of residences, Warden grant requests, student complaints
# hall worker attendances and salary payments
#
# MIT License
#
"""
@ authors: Madhav Datt, Avikalp Srivastava
"""
from ..database import db_func as db
from ..database import password_validation as pv
import worker
class MessManager(worker.Worker):
"""Contains details of Worker Instance
Attributes:
worker_ID: Integer to uniquely identify worker
name: String
hall_ID: Integer to uniquely identify hall
monthly_salary: Float
"""
def __init__(self, name, hall_ID, password, monthly_salary,
rebuild=False, worker_ID=None):
"""
Init MessManager with details as recruited by HMC or Warden
"""
# The rebuild flag, if true, denotes that the object is being made from
# data already present in the database
# If False, a new data row is added to the specific table
if not rebuild:
self.worker_ID = db.add("worker")
db.update("worker", self.worker_ID, "worker_type", "M")
self.password = password
else:
self.worker_ID = worker_ID
self._password = password
self.monthly_salary = monthly_salary<|fim▁hole|> worker.Worker.__init__(self, self.worker_ID, name, hall_ID)
# password getter and setter functions
@property
def password(self):
return self._password
@password.setter
def password(self, password):
self._password = pv.hash_password(password)
db.update("worker", self.worker_ID, "password", self.password)
# monthly_salary getter and setter functions
@property
def monthly_salary(self):
return self._monthly_salary
@monthly_salary.setter
def monthly_salary(self, monthly_salary):
self._monthly_salary = monthly_salary
db.update("worker", self.worker_ID, "monthly_salary", self.monthly_salary)
def compute_mess_payment(self, student_table):
"""
Compute total money due to hall in form of mess payments
Sum of each student resident's mess charge
Pass parameter student_table = dbr.rebuild("student")
"""
mess_total = 0.
for key in student_table:
if student_table[key].hall_ID == self.hall_ID:
mess_total = mess_total + student_table[key].mess_charge
return mess_total<|fim▁end|> | |
<|file_name|>smri_freesurfer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
================
sMRI: FreeSurfer
================
This script, smri_freesurfer.py, demonstrates the ability to call reconall on
a set of subjects and then make an average subject.
python smri_freesurfer.py
Import necessary modules from nipype.
"""
import os
import nipype.pipeline.engine as pe
import nipype.interfaces.io as nio
from nipype.interfaces.freesurfer.preprocess import ReconAll
from nipype.interfaces.freesurfer.utils import MakeAverageSubject
subject_list = ['s1', 's3']
data_dir = os.path.abspath('data')
subjects_dir = os.path.abspath('amri_freesurfer_tutorial/subjects_dir')
wf = pe.Workflow(name="l1workflow")
wf.base_dir = os.path.abspath('amri_freesurfer_tutorial/workdir')
"""<|fim▁hole|>"""
datasource = pe.MapNode(interface=nio.DataGrabber(infields=['subject_id'],
outfields=['struct']),
name='datasource',
iterfield=['subject_id'])
datasource.inputs.base_directory = data_dir
datasource.inputs.template = '%s/%s.nii'
datasource.inputs.template_args = dict(struct=[['subject_id', 'struct']])
datasource.inputs.subject_id = subject_list
"""
Run recon-all
"""
recon_all = pe.MapNode(interface=ReconAll(), name='recon_all',
iterfield=['subject_id', 'T1_files'])
recon_all.inputs.subject_id = subject_list
if not os.path.exists(subjects_dir):
os.mkdir(subjects_dir)
recon_all.inputs.subjects_dir = subjects_dir
wf.connect(datasource, 'struct', recon_all, 'T1_files')
"""
Make average subject
"""
average = pe.Node(interface=MakeAverageSubject(), name="average")
average.inputs.subjects_dir = subjects_dir
wf.connect(recon_all, 'subject_id', average, 'subjects_ids')
wf.run("MultiProc", plugin_args={'n_procs': 4})<|fim▁end|> | Grab data |
<|file_name|>EventSourceServlet.java<|end_file_name|><|fim▁begin|>package dev.jee6demo.jspes;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/EventSourceServlet")
public class EventSourceServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/event-stream");
response.setCharacterEncoding("UTF-8");
PrintWriter pw = response.getWriter();
for (int i = 0; i < 5; i++) {
pw.write("event:new_time\n");
pw.write("data: " + now() + "\n\n");<|fim▁hole|> } catch (InterruptedException e) {
e.printStackTrace();
}
}
pw.write("event:new_time\n");
pw.write("data: STOP\n\n");
pw.flush();
pw.close();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
public static String now(){
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS");
return dateFormat.format(new Date());
}
}<|fim▁end|> | pw.flush();
try {
Thread.sleep(1000); |
<|file_name|>disk-tree.json.js<|end_file_name|><|fim▁begin|>define(
[
{
"value": 40,
"name": "Accessibility",
"path": "Accessibility"
},
{
"value": 180,
"name": "Accounts",
"path": "Accounts",
"children": [
{
"value": 76,
"name": "Access",
"path": "Accounts/Access",
"children": [
{
"value": 12,
"name": "DefaultAccessPlugin.bundle",
"path": "Accounts/Access/DefaultAccessPlugin.bundle"
},
{
"value": 28,
"name": "FacebookAccessPlugin.bundle",
"path": "Accounts/Access/FacebookAccessPlugin.bundle"
},
{
"value": 20,
"name": "LinkedInAccessPlugin.bundle",
"path": "Accounts/Access/LinkedInAccessPlugin.bundle"
},
{
"value": 16,
"name": "TencentWeiboAccessPlugin.bundle",
"path": "Accounts/Access/TencentWeiboAccessPlugin.bundle"
}
]
},
{
"value": 92,
"name": "Authentication",
"path": "Accounts/Authentication",
"children": [
{
"value": 24,
"name": "FacebookAuthenticationPlugin.bundle",
"path": "Accounts/Authentication/FacebookAuthenticationPlugin.bundle"
},
{
"value": 16,
"name": "LinkedInAuthenticationPlugin.bundle",
"path": "Accounts/Authentication/LinkedInAuthenticationPlugin.bundle"
},
{
"value": 20,
"name": "TencentWeiboAuthenticationPlugin.bundle",
"path": "Accounts/Authentication/TencentWeiboAuthenticationPlugin.bundle"
},
{
"value": 16,
"name": "TwitterAuthenticationPlugin.bundle",
"path": "Accounts/Authentication/TwitterAuthenticationPlugin.bundle"
},
{
"value": 16,
"name": "WeiboAuthenticationPlugin.bundle",
"path": "Accounts/Authentication/WeiboAuthenticationPlugin.bundle"
}
]
},
{
"value": 12,
"name": "Notification",
"path": "Accounts/Notification",
"children": [
{
"value": 12,
"name": "SPAAccountsNotificationPlugin.bundle",
"path": "Accounts/Notification/SPAAccountsNotificationPlugin.bundle"
}
]
}
]
},
{
"value": 1904,
"name": "AddressBook Plug-Ins",
"path": "AddressBook Plug-Ins",
"children": [
{
"value": 744,
"name": "CardDAVPlugin.sourcebundle",
"path": "AddressBook Plug-Ins/CardDAVPlugin.sourcebundle",
"children": [
{
"value": 744,
"name": "Contents",
"path": "AddressBook Plug-Ins/CardDAVPlugin.sourcebundle/Contents"
}
]
},
{
"value": 28,
"name": "DirectoryServices.sourcebundle",
"path": "AddressBook Plug-Ins/DirectoryServices.sourcebundle",
"children": [
{
"value": 28,
"name": "Contents",
"path": "AddressBook Plug-Ins/DirectoryServices.sourcebundle/Contents"
}
]
},
{
"value": 680,
"name": "Exchange.sourcebundle",
"path": "AddressBook Plug-Ins/Exchange.sourcebundle",
"children": [
{
"value": 680,
"name": "Contents",
"path": "AddressBook Plug-Ins/Exchange.sourcebundle/Contents"
}
]
},
{
"value": 432,
"name": "LDAP.sourcebundle",
"path": "AddressBook Plug-Ins/LDAP.sourcebundle",
"children": [
{
"value": 432,
"name": "Contents",
"path": "AddressBook Plug-Ins/LDAP.sourcebundle/Contents"
}
]
},
{
"value": 20,
"name": "LocalSource.sourcebundle",
"path": "AddressBook Plug-Ins/LocalSource.sourcebundle",
"children": [
{
"value": 20,
"name": "Contents",
"path": "AddressBook Plug-Ins/LocalSource.sourcebundle/Contents"
}
]
}
]
},
{
"value": 36,
"name": "Assistant",
"path": "Assistant",
"children": [
{
"value": 36,
"name": "Plugins",
"path": "Assistant/Plugins",
"children": [
{
"value": 36,
"name": "AddressBook.assistantBundle",
"path": "Assistant/Plugins/AddressBook.assistantBundle"
},
{
"value": 8,
"name": "GenericAddressHandler.addresshandler",
"path": "Recents/Plugins/GenericAddressHandler.addresshandler"
},
{
"value": 12,
"name": "MapsRecents.addresshandler",
"path": "Recents/Plugins/MapsRecents.addresshandler"
}
]
}
]
},
{
"value": 53228,
"name": "Automator",
"path": "Automator",
"children": [
{
"value": 0,
"name": "ActivateFonts.action",
"path": "Automator/ActivateFonts.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/ActivateFonts.action/Contents"
}
]
},
{
"value": 12,
"name": "AddAttachments to Front Message.action",
"path": "Automator/AddAttachments to Front Message.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/AddAttachments to Front Message.action/Contents"
}
]
},
{
"value": 276,
"name": "AddColor Profile.action",
"path": "Automator/AddColor Profile.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/AddColor Profile.action/Contents"
}
]
},
{
"value": 32,
"name": "AddGrid to PDF Documents.action",
"path": "Automator/AddGrid to PDF Documents.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/AddGrid to PDF Documents.action/Contents"
}
]
},
{
"value": 12,
"name": "AddMovie to iDVD Menu.action",
"path": "Automator/AddMovie to iDVD Menu.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/AddMovie to iDVD Menu.action/Contents"
}
]
},
{
"value": 20,
"name": "AddPhotos to Album.action",
"path": "Automator/AddPhotos to Album.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/AddPhotos to Album.action/Contents"
}
]
},
{
"value": 12,
"name": "AddSongs to iPod.action",
"path": "Automator/AddSongs to iPod.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/AddSongs to iPod.action/Contents"
}
]
},
{
"value": 44,
"name": "AddSongs to Playlist.action",
"path": "Automator/AddSongs to Playlist.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/AddSongs to Playlist.action/Contents"
}
]
},
{
"value": 12,
"name": "AddThumbnail Icon to Image Files.action",
"path": "Automator/AddThumbnail Icon to Image Files.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/AddThumbnail Icon to Image Files.action/Contents"
}
]
},
{
"value": 268,
"name": "Addto Font Library.action",
"path": "Automator/Addto Font Library.action",
"children": [
{
"value": 268,
"name": "Contents",
"path": "Automator/Addto Font Library.action/Contents"
}
]
},
{
"value": 0,
"name": "AddressBook.definition",
"path": "Automator/AddressBook.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/AddressBook.definition/Contents"
}
]
},
{
"value": 408,
"name": "AppleVersioning Tool.action",
"path": "Automator/AppleVersioning Tool.action",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Automator/AppleVersioning Tool.action/Contents"
}
]
},
{
"value": 568,
"name": "ApplyColorSync Profile to Images.action",
"path": "Automator/ApplyColorSync Profile to Images.action",
"children": [
{
"value": 568,
"name": "Contents",
"path": "Automator/ApplyColorSync Profile to Images.action/Contents"
}
]
},
{
"value": 348,
"name": "ApplyQuartz Composition Filter to Image Files.action",
"path": "Automator/ApplyQuartz Composition Filter to Image Files.action",
"children": [
{
"value": 348,
"name": "Contents",
"path": "Automator/ApplyQuartz Composition Filter to Image Files.action/Contents"
}
]
},
{
"value": 368,
"name": "ApplyQuartz Filter to PDF Documents.action",
"path": "Automator/ApplyQuartz Filter to PDF Documents.action",
"children": [
{
"value": 368,
"name": "Contents",
"path": "Automator/ApplyQuartz Filter to PDF Documents.action/Contents"
}
]
},
{
"value": 96,
"name": "ApplySQL.action",
"path": "Automator/ApplySQL.action",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Automator/ApplySQL.action/Contents"
}
]
},
{
"value": 372,
"name": "Askfor Confirmation.action",
"path": "Automator/Askfor Confirmation.action",
"children": [
{
"value": 372,
"name": "Contents",
"path": "Automator/Askfor Confirmation.action/Contents"
}
]
},
{
"value": 104,
"name": "Askfor Finder Items.action",
"path": "Automator/Askfor Finder Items.action",
"children": [
{
"value": 104,
"name": "Contents",
"path": "Automator/Askfor Finder Items.action/Contents"
}
]
},
{
"value": 52,
"name": "Askfor Movies.action",
"path": "Automator/Askfor Movies.action",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Automator/Askfor Movies.action/Contents"
}
]
},
{
"value": 44,
"name": "Askfor Photos.action",
"path": "Automator/Askfor Photos.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/Askfor Photos.action/Contents"
}
]
},
{
"value": 16,
"name": "Askfor Servers.action",
"path": "Automator/Askfor Servers.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/Askfor Servers.action/Contents"
}
]
},
{
"value": 52,
"name": "Askfor Songs.action",
"path": "Automator/Askfor Songs.action",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Automator/Askfor Songs.action/Contents"
}
]
},
{
"value": 288,
"name": "Askfor Text.action",
"path": "Automator/Askfor Text.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/Askfor Text.action/Contents"
}
]
},
{
"value": 0,
"name": "Automator.definition",
"path": "Automator/Automator.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/Automator.definition/Contents"
}
]
},
{
"value": 12,
"name": "BrowseMovies.action",
"path": "Automator/BrowseMovies.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/BrowseMovies.action/Contents"
}
]
},
{
"value": 552,
"name": "BuildXcode Project.action",
"path": "Automator/BuildXcode Project.action",
"children": [
{
"value": 552,
"name": "Contents",
"path": "Automator/BuildXcode Project.action/Contents"
}
]
},
{
"value": 296,
"name": "BurnA Disc.action",
"path": "Automator/BurnA Disc.action",
"children": [
{
"value": 296,
"name": "Contents",
"path": "Automator/BurnA Disc.action/Contents"
}
]
},
{
"value": 8,
"name": "ChangeCase of Song Names.action",
"path": "Automator/ChangeCase of Song Names.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ChangeCase of Song Names.action/Contents"
}
]
},
{
"value": 60,
"name": "ChangeType of Images.action",
"path": "Automator/ChangeType of Images.action",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Automator/ChangeType of Images.action/Contents"
}
]
},
{
"value": 24,
"name": "Choosefrom List.action",
"path": "Automator/Choosefrom List.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/Choosefrom List.action/Contents"
}
]
},
{
"value": 12,
"name": "CombineMail Messages.action",
"path": "Automator/CombineMail Messages.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/CombineMail Messages.action/Contents"
}
]
},
{
"value": 24,
"name": "CombinePDF Pages.action",
"path": "Automator/CombinePDF Pages.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/CombinePDF Pages.action/Contents"
}
]
},
{
"value": 12,
"name": "CombineText Files.action",
"path": "Automator/CombineText Files.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/CombineText Files.action/Contents"
}
]
},
{
"value": 24,
"name": "CompressImages in PDF Documents.action",
"path": "Automator/CompressImages in PDF Documents.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/CompressImages in PDF Documents.action/Contents"
}
]
},
{
"value": 8,
"name": "Connectto Servers.action",
"path": "Automator/Connectto Servers.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/Connectto Servers.action/Contents"
}
]
},
{
"value": 8,
"name": "ConvertAccount object to Mailbox object.caction",
"path": "Automator/ConvertAccount object to Mailbox object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertAccount object to Mailbox object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertAlbum object to Photo object.caction",
"path": "Automator/ConvertAlbum object to Photo object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertAlbum object to Photo object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertAlias object to Finder object.caction",
"path": "Automator/ConvertAlias object to Finder object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertAlias object to Finder object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertAlias object to iPhoto photo object.caction",
"path": "Automator/ConvertAlias object to iPhoto photo object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertAlias object to iPhoto photo object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertCalendar object to Event object.caction",
"path": "Automator/ConvertCalendar object to Event object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertCalendar object to Event object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertCalendar object to Reminders object.caction",
"path": "Automator/ConvertCalendar object to Reminders object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertCalendar object to Reminders object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertCocoa Data To Cocoa String.caction",
"path": "Automator/ConvertCocoa Data To Cocoa String.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertCocoa Data To Cocoa String.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertCocoa String To Cocoa Data.caction",
"path": "Automator/ConvertCocoa String To Cocoa Data.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertCocoa String To Cocoa Data.caction/Contents"
}
]
},
{
"value": 12,
"name": "ConvertCocoa URL to iTunes Track Object.caction",
"path": "Automator/ConvertCocoa URL to iTunes Track Object.caction",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/ConvertCocoa URL to iTunes Track Object.caction/Contents"
}
]
},
{
"value": 12,
"name": "ConvertCocoa URL to RSS Feed.caction",
"path": "Automator/ConvertCocoa URL to RSS Feed.caction",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/ConvertCocoa URL to RSS Feed.caction/Contents"
}
]
},
{
"value": 40,
"name": "ConvertCSV to SQL.action",
"path": "Automator/ConvertCSV to SQL.action",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Automator/ConvertCSV to SQL.action/Contents"
}
]
},
{
"value": 8,
"name": "ConvertFeeds to Articles.caction",
"path": "Automator/ConvertFeeds to Articles.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertFeeds to Articles.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertFinder object to Alias object.caction",
"path": "Automator/ConvertFinder object to Alias object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertFinder object to Alias object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertGroup object to Person object.caction",
"path": "Automator/ConvertGroup object to Person object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertGroup object to Person object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertiPhoto Album to Alias object.caction",
"path": "Automator/ConvertiPhoto Album to Alias object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertiPhoto Album to Alias object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertiTunes object to Alias object.caction",
"path": "Automator/ConvertiTunes object to Alias object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertiTunes object to Alias object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertiTunes Playlist object to Alias object.caction",
"path": "Automator/ConvertiTunes Playlist object to Alias object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertiTunes Playlist object to Alias object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertMailbox object to Message object.caction",
"path": "Automator/ConvertMailbox object to Message object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertMailbox object to Message object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertPhoto object to Alias object.caction",
"path": "Automator/ConvertPhoto object to Alias object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertPhoto object to Alias object.caction/Contents"
}
]
},
{
"value": 8,
"name": "ConvertPlaylist object to Song object.caction",
"path": "Automator/ConvertPlaylist object to Song object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertPlaylist object to Song object.caction/Contents"
}
]
},
{
"value": 2760,
"name": "ConvertQuartz Compositions to QuickTime Movies.action",
"path": "Automator/ConvertQuartz Compositions to QuickTime Movies.action",
"children": [
{
"value": 2760,
"name": "Contents",
"path": "Automator/ConvertQuartz Compositions to QuickTime Movies.action/Contents"
}
]
},
{
"value": 8,
"name": "ConvertSource object to Playlist object.caction",
"path": "Automator/ConvertSource object to Playlist object.caction",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ConvertSource object to Playlist object.caction/Contents"
}
]
},
{
"value": 96,
"name": "CopyFinder Items.action",
"path": "Automator/CopyFinder Items.action",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Automator/CopyFinder Items.action/Contents"
}
]
},
{
"value": 8,
"name": "Copyto Clipboard.action",
"path": "Automator/Copyto Clipboard.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/Copyto Clipboard.action/Contents"
}
]
},
{
"value": 72,
"name": "CreateAnnotated Movie File.action",
"path": "Automator/CreateAnnotated Movie File.action",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Automator/CreateAnnotated Movie File.action/Contents"
}
]
},
{
"value": 96,
"name": "CreateArchive.action",
"path": "Automator/CreateArchive.action",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Automator/CreateArchive.action/Contents"
}
]
},
{
"value": 412,
"name": "CreateBanner Image from Text.action",
"path": "Automator/CreateBanner Image from Text.action",
"children": [
{
"value": 412,
"name": "Contents",
"path": "Automator/CreateBanner Image from Text.action/Contents"
}
]
},
{
"value": 392,
"name": "CreatePackage.action",
"path": "Automator/CreatePackage.action",
"children": [
{
"value": 392,
"name": "Contents",
"path": "Automator/CreatePackage.action/Contents"
}
]
},
{
"value": 208,
"name": "CreateThumbnail Images.action",
"path": "Automator/CreateThumbnail Images.action",
"children": [
{
"value": 208,
"name": "Contents",
"path": "Automator/CreateThumbnail Images.action/Contents"
}
]
},
{
"value": 712,
"name": "CropImages.action",
"path": "Automator/CropImages.action",
"children": [
{
"value": 712,
"name": "Contents",
"path": "Automator/CropImages.action/Contents"
}
]
},
{
"value": 8,
"name": "CVSAdd.action",
"path": "Automator/CVSAdd.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/CVSAdd.action/Contents"
}
]
},
{
"value": 24,
"name": "CVSCheckout.action",
"path": "Automator/CVSCheckout.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/CVSCheckout.action/Contents"
}
]
},
{
"value": 24,
"name": "CVSCommit.action",
"path": "Automator/CVSCommit.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/CVSCommit.action/Contents"
}
]
},
{
"value": 276,
"name": "CVSUpdate.action",
"path": "Automator/CVSUpdate.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/CVSUpdate.action/Contents"
}
]
},
{
"value": 0,
"name": "DeactivateFonts.action",
"path": "Automator/DeactivateFonts.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/DeactivateFonts.action/Contents"
}
]
},
{
"value": 12,
"name": "DeleteAll iPod Notes.action",
"path": "Automator/DeleteAll iPod Notes.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/DeleteAll iPod Notes.action/Contents"
}
]
},
{
"value": 32,
"name": "DeleteCalendar Events.action",
"path": "Automator/DeleteCalendar Events.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/DeleteCalendar Events.action/Contents"
}
]
},
{
"value": 8,
"name": "DeleteCalendar Items.action",
"path": "Automator/DeleteCalendar Items.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/DeleteCalendar Items.action/Contents"
}
]
},
{
"value": 8,
"name": "DeleteCalendars.action",
"path": "Automator/DeleteCalendars.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/DeleteCalendars.action/Contents"
}
]
},
{
"value": 8,
"name": "DeleteReminders.action",
"path": "Automator/DeleteReminders.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/DeleteReminders.action/Contents"
}
]
},
{
"value": 12,
"name": "DisplayMail Messages.action",
"path": "Automator/DisplayMail Messages.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/DisplayMail Messages.action/Contents"
}
]
},
{
"value": 16,
"name": "DisplayNotification.action",
"path": "Automator/DisplayNotification.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/DisplayNotification.action/Contents"
}
]
},
{
"value": 8,
"name": "DisplayWebpages 2.action",
"path": "Automator/DisplayWebpages 2.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/DisplayWebpages 2.action/Contents"
}
]
},
{
"value": 12,
"name": "DisplayWebpages.action",
"path": "Automator/DisplayWebpages.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/DisplayWebpages.action/Contents"
}
]
},
{
"value": 276,
"name": "DownloadPictures.action",
"path": "Automator/DownloadPictures.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/DownloadPictures.action/Contents"
}
]
},
{
"value": 24,
"name": "DownloadURLs.action",
"path": "Automator/DownloadURLs.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/DownloadURLs.action/Contents"
}
]
},
{
"value": 8,
"name": "DuplicateFinder Items.action",
"path": "Automator/DuplicateFinder Items.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/DuplicateFinder Items.action/Contents"
}
]
},
{
"value": 8,
"name": "EjectDisk.action",
"path": "Automator/EjectDisk.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/EjectDisk.action/Contents"
}
]
},
{
"value": 12,
"name": "EjectiPod.action",
"path": "Automator/EjectiPod.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/EjectiPod.action/Contents"
}
]
},
{
"value": 276,
"name": "Enableor Disable Tracks.action",
"path": "Automator/Enableor Disable Tracks.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/Enableor Disable Tracks.action/Contents"
}
]
},
{
"value": 464,
"name": "EncodeMedia.action",
"path": "Automator/EncodeMedia.action",
"children": [
{
"value": 464,
"name": "Contents",
"path": "Automator/EncodeMedia.action/Contents"
}
]
},
{
"value": 80,
"name": "Encodeto MPEG Audio.action",
"path": "Automator/Encodeto MPEG Audio.action",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Automator/Encodeto MPEG Audio.action/Contents"
}
]
},
{
"value": 24,
"name": "EncryptPDF Documents.action",
"path": "Automator/EncryptPDF Documents.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/EncryptPDF Documents.action/Contents"
}
]
},
{
"value": 12,
"name": "EventSummary.action",
"path": "Automator/EventSummary.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/EventSummary.action/Contents"
}
]
},
{
"value": 24,
"name": "ExecuteSQL.action",
"path": "Automator/ExecuteSQL.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/ExecuteSQL.action/Contents"
}
]
},
{
"value": 264,
"name": "ExportFont Files.action",
"path": "Automator/ExportFont Files.action",
"children": [
{
"value": 264,
"name": "Contents",
"path": "Automator/ExportFont Files.action/Contents"
}
]
},
{
"value": 24,
"name": "ExportMovies for iPod.action",
"path": "Automator/ExportMovies for iPod.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/ExportMovies for iPod.action/Contents"
}
]
},
{
"value": 44,
"name": "ExportvCards.action",
"path": "Automator/ExportvCards.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/ExportvCards.action/Contents"
}
]
},
{
"value": 12,
"name": "ExtractData from Text.action",
"path": "Automator/ExtractData from Text.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/ExtractData from Text.action/Contents"
}
]
},
{
"value": 24,
"name": "ExtractOdd & Even Pages.action",
"path": "Automator/ExtractOdd & Even Pages.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/ExtractOdd & Even Pages.action/Contents"
}
]
},
{
"value": 276,
"name": "ExtractPDF Annotations.action",
"path": "Automator/ExtractPDF Annotations.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/ExtractPDF Annotations.action/Contents"
}
]
},
{
"value": 2620,
"name": "ExtractPDF Text.action",
"path": "Automator/ExtractPDF Text.action",
"children": [
{
"value": 2620,
"name": "Contents",
"path": "Automator/ExtractPDF Text.action/Contents"
}
]
},
{
"value": 44,
"name": "FilterArticles.action",
"path": "Automator/FilterArticles.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/FilterArticles.action/Contents"
}
]
},
{
"value": 272,
"name": "FilterCalendar Items 2.action",
"path": "Automator/FilterCalendar Items 2.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/FilterCalendar Items 2.action/Contents"
}
]
},
{
"value": 280,
"name": "FilterContacts Items 2.action",
"path": "Automator/FilterContacts Items 2.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/FilterContacts Items 2.action/Contents"
}
]
},
{
"value": 280,
"name": "FilterFinder Items 2.action",
"path": "Automator/FilterFinder Items 2.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/FilterFinder Items 2.action/Contents"
}
]
},
{
"value": 12,
"name": "FilterFinder Items.action",
"path": "Automator/FilterFinder Items.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/FilterFinder Items.action/Contents"
}
]
},
{
"value": 264,
"name": "FilterFonts by Font Type.action",
"path": "Automator/FilterFonts by Font Type.action",
"children": [
{
"value": 264,
"name": "Contents",
"path": "Automator/FilterFonts by Font Type.action/Contents"
}
]
},
{
"value": 280,
"name": "FilteriPhoto Items 2.action",
"path": "Automator/FilteriPhoto Items 2.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/FilteriPhoto Items 2.action/Contents"
}
]
},
{
"value": 272,
"name": "FilterItems.action",
"path": "Automator/FilterItems.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/FilterItems.action/Contents"
}
]
},
{
"value": 276,
"name": "FilteriTunes Items 2.action",
"path": "Automator/FilteriTunes Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FilteriTunes Items 2.action/Contents"
}
]
},
{
"value": 276,
"name": "FilterMail Items 2.action",
"path": "Automator/FilterMail Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FilterMail Items 2.action/Contents"
}
]
},
{
"value": 60,
"name": "FilterParagraphs.action",
"path": "Automator/FilterParagraphs.action",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Automator/FilterParagraphs.action/Contents"
}
]
},
{
"value": 276,
"name": "FilterURLs 2.action",
"path": "Automator/FilterURLs 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FilterURLs 2.action/Contents"
}
]
},
{
"value": 12,
"name": "FilterURLs.action",
"path": "Automator/FilterURLs.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/FilterURLs.action/Contents"
}
]
},
{
"value": 272,
"name": "FindCalendar Items 2.action",
"path": "Automator/FindCalendar Items 2.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/FindCalendar Items 2.action/Contents"
}
]
},
{
"value": 276,
"name": "FindContacts Items 2.action",
"path": "Automator/FindContacts Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FindContacts Items 2.action/Contents"
}
]
},
{
"value": 276,
"name": "FindFinder Items 2.action",
"path": "Automator/FindFinder Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FindFinder Items 2.action/Contents"
}
]
},
{
"value": 280,
"name": "FindFinder Items.action",
"path": "Automator/FindFinder Items.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/FindFinder Items.action/Contents"
}
]
},
{
"value": 276,
"name": "FindiPhoto Items 2.action",
"path": "Automator/FindiPhoto Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FindiPhoto Items 2.action/Contents"
}
]
},
{
"value": 272,
"name": "FindItems.action",
"path": "Automator/FindItems.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/FindItems.action/Contents"
}
]
},
{
"value": 276,
"name": "FindiTunes Items 2.action",
"path": "Automator/FindiTunes Items 2.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/FindiTunes Items 2.action/Contents"
}
]
},
{
"value": 280,
"name": "FindMail Items 2.action",
"path": "Automator/FindMail Items 2.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/FindMail Items 2.action/Contents"
}
]
},
{
"value": 84,
"name": "FindPeople with Birthdays.action",
"path": "Automator/FindPeople with Birthdays.action",
"children": [
{
"value": 84,
"name": "Contents",
"path": "Automator/FindPeople with Birthdays.action/Contents"
}
]
},
{
"value": 0,
"name": "Finder.definition",
"path": "Automator/Finder.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/Finder.definition/Contents"
}
]
},
{
"value": 104,
"name": "FlipImages.action",
"path": "Automator/FlipImages.action",
"children": [
{
"value": 104,
"name": "Contents",
"path": "Automator/FlipImages.action/Contents"
}
]
},
{
"value": 0,
"name": "FontBook.definition",
"path": "Automator/FontBook.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/FontBook.definition/Contents"
}
]
},
{
"value": 36,
"name": "GetAttachments from Mail Messages.action",
"path": "Automator/GetAttachments from Mail Messages.action",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Automator/GetAttachments from Mail Messages.action/Contents"
}
]
},
{
"value": 180,
"name": "GetContact Information.action",
"path": "Automator/GetContact Information.action",
"children": [
{
"value": 180,
"name": "Contents",
"path": "Automator/GetContact Information.action/Contents"
}
]
},
{
"value": 8,
"name": "GetContents of Clipboard.action",
"path": "Automator/GetContents of Clipboard.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetContents of Clipboard.action/Contents"
}
]
},
{
"value": 8,
"name": "GetContents of TextEdit Document.action",
"path": "Automator/GetContents of TextEdit Document.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetContents of TextEdit Document.action/Contents"
}
]
},
{
"value": 12,
"name": "GetContents of Webpages.action",
"path": "Automator/GetContents of Webpages.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/GetContents of Webpages.action/Contents"
}
]
},
{
"value": 8,
"name": "GetCurrent Webpage from Safari.action",
"path": "Automator/GetCurrent Webpage from Safari.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetCurrent Webpage from Safari.action/Contents"
}
]
},
{
"value": 84,
"name": "GetDefinition of Word.action",
"path": "Automator/GetDefinition of Word.action",
"children": [
{
"value": 84,
"name": "Contents",
"path": "Automator/GetDefinition of Word.action/Contents"
}
]
},
{
"value": 8,
"name": "GetEnclosure URLs from Articles.action",
"path": "Automator/GetEnclosure URLs from Articles.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetEnclosure URLs from Articles.action/Contents"
}
]
},
{
"value": 12,
"name": "GetFeeds from URLs.action",
"path": "Automator/GetFeeds from URLs.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/GetFeeds from URLs.action/Contents"
}
]
},
{
"value": 0,
"name": "GetFiles for Fonts.action",
"path": "Automator/GetFiles for Fonts.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/GetFiles for Fonts.action/Contents"
}
]
},
{
"value": 12,
"name": "GetFolder Contents.action",
"path": "Automator/GetFolder Contents.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/GetFolder Contents.action/Contents"
}
]
},
{
"value": 412,
"name": "GetFont Info.action",
"path": "Automator/GetFont Info.action",
"children": [
{
"value": 412,
"name": "Contents",
"path": "Automator/GetFont Info.action/Contents"
}
]
},
{
"value": 0,
"name": "GetFonts from Font Files.action",
"path": "Automator/GetFonts from Font Files.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/GetFonts from Font Files.action/Contents"
}
]
},
{
"value": 0,
"name": "GetFonts of TextEdit Document.action",
"path": "Automator/GetFonts of TextEdit Document.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/GetFonts of TextEdit Document.action/Contents"
}
]
},
{
"value": 20,
"name": "GetiDVD Slideshow Images.action",
"path": "Automator/GetiDVD Slideshow Images.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/GetiDVD Slideshow Images.action/Contents"
}
]
},
{
"value": 28,
"name": "GetImage URLs from Articles.action",
"path": "Automator/GetImage URLs from Articles.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/GetImage URLs from Articles.action/Contents"
}
]
},
{
"value": 52,
"name": "GetImage URLs from Webpage.action",
"path": "Automator/GetImage URLs from Webpage.action",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Automator/GetImage URLs from Webpage.action/Contents"
}
]
},
{
"value": 12,
"name": "GetLink URLs from Articles.action",
"path": "Automator/GetLink URLs from Articles.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/GetLink URLs from Articles.action/Contents"
}
]
},
{
"value": 24,
"name": "GetLink URLs from Webpages.action",
"path": "Automator/GetLink URLs from Webpages.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/GetLink URLs from Webpages.action/Contents"
}
]
},
{
"value": 20,
"name": "GetNew Mail.action",
"path": "Automator/GetNew Mail.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/GetNew Mail.action/Contents"
}
]
},
{
"value": 276,
"name": "GetPDF Metadata.action",
"path": "Automator/GetPDF Metadata.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/GetPDF Metadata.action/Contents"
}
]
},
{
"value": 8,
"name": "GetPermalinks of Articles.action",
"path": "Automator/GetPermalinks of Articles.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetPermalinks of Articles.action/Contents"
}
]
},
{
"value": 0,
"name": "GetPostScript name of Font.action",
"path": "Automator/GetPostScript name of Font.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/GetPostScript name of Font.action/Contents"
}
]
},
{
"value": 44,
"name": "GetSelected Contacts Items 2.action",
"path": "Automator/GetSelected Contacts Items 2.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/GetSelected Contacts Items 2.action/Contents"
}
]
},
{
"value": 8,
"name": "GetSelected Finder Items 2.action",
"path": "Automator/GetSelected Finder Items 2.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetSelected Finder Items 2.action/Contents"
}
]
},
{
"value": 28,
"name": "GetSelected iPhoto Items 2.action",
"path": "Automator/GetSelected iPhoto Items 2.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/GetSelected iPhoto Items 2.action/Contents"
}
]
},
{
"value": 8,
"name": "GetSelected Items.action",
"path": "Automator/GetSelected Items.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetSelected Items.action/Contents"
}
]
},
{
"value": 28,
"name": "GetSelected iTunes Items 2.action",
"path": "Automator/GetSelected iTunes Items 2.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/GetSelected iTunes Items 2.action/Contents"
}
]
},
{
"value": 28,
"name": "GetSelected Mail Items 2.action",
"path": "Automator/GetSelected Mail Items 2.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/GetSelected Mail Items 2.action/Contents"
}
]
},
{
"value": 540,
"name": "GetSpecified Calendar Items.action",
"path": "Automator/GetSpecified Calendar Items.action",
"children": [
{
"value": 540,
"name": "Contents",
"path": "Automator/GetSpecified Calendar Items.action/Contents"
}
]
},
{
"value": 292,
"name": "GetSpecified Contacts Items.action",
"path": "Automator/GetSpecified Contacts Items.action",
"children": [
{
"value": 292,
"name": "Contents",
"path": "Automator/GetSpecified Contacts Items.action/Contents"
}
]
},
{
"value": 308,
"name": "GetSpecified Finder Items.action",
"path": "Automator/GetSpecified Finder Items.action",
"children": [
{
"value": 308,
"name": "Contents",
"path": "Automator/GetSpecified Finder Items.action/Contents"
}
]
},
{
"value": 288,
"name": "GetSpecified iPhoto Items.action",
"path": "Automator/GetSpecified iPhoto Items.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/GetSpecified iPhoto Items.action/Contents"
}
]
},
{
"value": 288,
"name": "GetSpecified iTunes Items.action",
"path": "Automator/GetSpecified iTunes Items.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/GetSpecified iTunes Items.action/Contents"
}
]
},
{
"value": 380,
"name": "GetSpecified Mail Items.action",
"path": "Automator/GetSpecified Mail Items.action",
"children": [
{
"value": 380,
"name": "Contents",
"path": "Automator/GetSpecified Mail Items.action/Contents"
}
]
},
{
"value": 288,
"name": "GetSpecified Movies.action",
"path": "Automator/GetSpecified Movies.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/GetSpecified Movies.action/Contents"
}
]
},
{
"value": 276,
"name": "GetSpecified Servers.action",
"path": "Automator/GetSpecified Servers.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/GetSpecified Servers.action/Contents"
}
]
},
{
"value": 272,
"name": "GetSpecified Text.action",
"path": "Automator/GetSpecified Text.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/GetSpecified Text.action/Contents"
}
]
},
{
"value": 288,
"name": "GetSpecified URLs.action",
"path": "Automator/GetSpecified URLs.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/GetSpecified URLs.action/Contents"
}
]
},
{
"value": 8,
"name": "GetText from Articles.action",
"path": "Automator/GetText from Articles.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/GetText from Articles.action/Contents"
}
]
},
{
"value": 40,
"name": "GetText from Webpage.action",
"path": "Automator/GetText from Webpage.action",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Automator/GetText from Webpage.action/Contents"
}
]
},
{
"value": 8,
"name": "Getthe Current Song.action",
"path": "Automator/Getthe Current Song.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/Getthe Current Song.action/Contents"
}
]
},
{
"value": 36,
"name": "GetValue of Variable.action",
"path": "Automator/GetValue of Variable.action",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Automator/GetValue of Variable.action/Contents"
}
]
},
{
"value": 280,
"name": "GroupMailer.action",
"path": "Automator/GroupMailer.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/GroupMailer.action/Contents"
}
]
},
{
"value": 8,
"name": "HideAll Applications.action",
"path": "Automator/HideAll Applications.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/HideAll Applications.action/Contents"
}
]
},
{
"value": 12,
"name": "HintMovies.action",
"path": "Automator/HintMovies.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/HintMovies.action/Contents"
}
]
},
{
"value": 0,
"name": "iCal.definition",
"path": "Automator/iCal.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/iCal.definition/Contents"
}
]
},
{
"value": 44,
"name": "ImportAudio Files.action",
"path": "Automator/ImportAudio Files.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/ImportAudio Files.action/Contents"
}
]
},
{
"value": 28,
"name": "ImportFiles into iPhoto.action",
"path": "Automator/ImportFiles into iPhoto.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/ImportFiles into iPhoto.action/Contents"
}
]
},
{
"value": 24,
"name": "ImportFiles into iTunes.action",
"path": "Automator/ImportFiles into iTunes.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/ImportFiles into iTunes.action/Contents"
}
]
},
{
"value": 256,
"name": "InitiateRemote Broadcast.action",
"path": "Automator/InitiateRemote Broadcast.action",
"children": [
{
"value": 256,
"name": "Contents",
"path": "Automator/InitiateRemote Broadcast.action/Contents"
}
]
},
{
"value": 0,
"name": "iPhoto.definition",
"path": "Automator/iPhoto.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/iPhoto.definition/Contents"
}
]
},
{
"value": 0,
"name": "iTunes.definition",
"path": "Automator/iTunes.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/iTunes.definition/Contents"
}
]
},
{
"value": 24,
"name": "LabelFinder Items.action",
"path": "Automator/LabelFinder Items.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/LabelFinder Items.action/Contents"
}
]
},
{
"value": 8,
"name": "LaunchApplication.action",
"path": "Automator/LaunchApplication.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/LaunchApplication.action/Contents"
}
]
},
{
"value": 24,
"name": "Loop.action",
"path": "Automator/Loop.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/Loop.action/Contents"
}
]
},
{
"value": 0,
"name": "Mail.definition",
"path": "Automator/Mail.definition",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/Mail.definition/Contents"
}
]
},
{
"value": 16,
"name": "MarkArticles.action",
"path": "Automator/MarkArticles.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/MarkArticles.action/Contents"
}
]
},
{
"value": 12,
"name": "MountDisk Image.action",
"path": "Automator/MountDisk Image.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/MountDisk Image.action/Contents"
}
]
},
{
"value": 12,
"name": "MoveFinder Items to Trash.action",
"path": "Automator/MoveFinder Items to Trash.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/MoveFinder Items to Trash.action/Contents"
}
]
},
{
"value": 28,
"name": "MoveFinder Items.action",
"path": "Automator/MoveFinder Items.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/MoveFinder Items.action/Contents"
}
]
},
{
"value": 108,
"name": "NewAliases.action",
"path": "Automator/NewAliases.action",
"children": [
{
"value": 108,
"name": "Contents",
"path": "Automator/NewAliases.action/Contents"
}
]
},
{
"value": 0,
"name": "NewAudio Capture.action",
"path": "Automator/NewAudio Capture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/NewAudio Capture.action/Contents"
}
]
},
{
"value": 676,
"name": "NewCalendar Events Leopard.action",
"path": "Automator/NewCalendar Events Leopard.action",
"children": [
{
"value": 676,
"name": "Contents",
"path": "Automator/NewCalendar Events Leopard.action/Contents"
}
]
},
{
"value": 24,
"name": "NewCalendar.action",
"path": "Automator/NewCalendar.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/NewCalendar.action/Contents"
}
]
},
{
"value": 64,
"name": "NewDisk Image.action",
"path": "Automator/NewDisk Image.action",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Automator/NewDisk Image.action/Contents"
}
]
},
{
"value": 20,
"name": "NewFolder.action",
"path": "Automator/NewFolder.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/NewFolder.action/Contents"
}
]
},
{
"value": 20,
"name": "NewiDVD Menu.action",
"path": "Automator/NewiDVD Menu.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/NewiDVD Menu.action/Contents"
}
]
},
{
"value": 20,
"name": "NewiDVD Movie Sequence.action",
"path": "Automator/NewiDVD Movie Sequence.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/NewiDVD Movie Sequence.action/Contents"
}
]
},
{
"value": 64,
"name": "NewiDVD Slideshow.action",
"path": "Automator/NewiDVD Slideshow.action",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Automator/NewiDVD Slideshow.action/Contents"
}
]
},
{
"value": 12,
"name": "NewiPhoto Album.action",
"path": "Automator/NewiPhoto Album.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/NewiPhoto Album.action/Contents"
}
]
},
{
"value": 32,
"name": "NewiPod Note.action",
"path": "Automator/NewiPod Note.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/NewiPod Note.action/Contents"
}
]
},
{
"value": 12,
"name": "NewiTunes Playlist.action",
"path": "Automator/NewiTunes Playlist.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/NewiTunes Playlist.action/Contents"
}
]
},
{
"value": 576,
"name": "NewMail Message.action",
"path": "Automator/NewMail Message.action",
"children": [
{
"value": 576,
"name": "Contents",
"path": "Automator/NewMail Message.action/Contents"
}
]
},
{
"value": 32,
"name": "NewPDF Contact Sheet.action",
"path": "Automator/NewPDF Contact Sheet.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/NewPDF Contact Sheet.action/Contents"
}
]
},
{
"value": 4444,
"name": "NewPDF from Images.action",
"path": "Automator/NewPDF from Images.action",
"children": [
{
"value": 4444,
"name": "Contents",
"path": "Automator/NewPDF from Images.action/Contents"
}
]
},
{
"value": 1976,
"name": "NewQuickTime Slideshow.action",
"path": "Automator/NewQuickTime Slideshow.action",
"children": [
{
"value": 1976,
"name": "Contents",
"path": "Automator/NewQuickTime Slideshow.action/Contents"
}
]
},
{
"value": 808,
"name": "NewReminders Item.action",
"path": "Automator/NewReminders Item.action",
"children": [
{
"value": 808,
"name": "Contents",
"path": "Automator/NewReminders Item.action/Contents"
}
]
},
{
"value": 0,
"name": "NewScreen Capture.action",
"path": "Automator/NewScreen Capture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/NewScreen Capture.action/Contents"
}
]
},
{
"value": 64,
"name": "NewText File.action",
"path": "Automator/NewText File.action",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Automator/NewText File.action/Contents"
}
]
},
{
"value": 8,
"name": "NewTextEdit Document.action",
"path": "Automator/NewTextEdit Document.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/NewTextEdit Document.action/Contents"
}
]
},
{
"value": 0,
"name": "NewVideo Capture.action",
"path": "Automator/NewVideo Capture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/NewVideo Capture.action/Contents"
}
]
},
{
"value": 28,
"name": "OpenFinder Items.action",
"path": "Automator/OpenFinder Items.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/OpenFinder Items.action/Contents"
}
]
},
{
"value": 12,
"name": "OpenImages in Preview.action",
"path": "Automator/OpenImages in Preview.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/OpenImages in Preview.action/Contents"
}
]
},
{
"value": 12,
"name": "OpenKeynote Presentations.action",
"path": "Automator/OpenKeynote Presentations.action",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Automator/OpenKeynote Presentations.action/Contents"
}
]
},
{
"value": 60,
"name": "PadImages.action",
"path": "Automator/PadImages.action",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Automator/PadImages.action/Contents"
}
]
},
{
"value": 0,
"name": "PauseCapture.action",
"path": "Automator/PauseCapture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/PauseCapture.action/Contents"
}
]
},
{
"value": 8,
"name": "PauseDVD Playback.action",
"path": "Automator/PauseDVD Playback.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/PauseDVD Playback.action/Contents"
}
]
},
{
"value": 8,
"name": "PauseiTunes.action",
"path": "Automator/PauseiTunes.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/PauseiTunes.action/Contents"
}
]
},
{
"value": 20,
"name": "Pause.action",
"path": "Automator/Pause.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/Pause.action/Contents"
}
]
},
{
"value": 3696,
"name": "PDFto Images.action",
"path": "Automator/PDFto Images.action",
"children": [
{
"value": 3696,
"name": "Contents",
"path": "Automator/PDFto Images.action/Contents"
}
]
},
{
"value": 276,
"name": "PlayDVD.action",
"path": "Automator/PlayDVD.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/PlayDVD.action/Contents"
}
]
},
{
"value": 8,
"name": "PlayiPhoto Slideshow.action",
"path": "Automator/PlayiPhoto Slideshow.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/PlayiPhoto Slideshow.action/Contents"
}
]
},
{
"value": 8,
"name": "PlayiTunes Playlist.action",
"path": "Automator/PlayiTunes Playlist.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/PlayiTunes Playlist.action/Contents"
}
]
},
{
"value": 264,
"name": "PlayMovies.action",
"path": "Automator/PlayMovies.action",
"children": [
{
"value": 264,
"name": "Contents",
"path": "Automator/PlayMovies.action/Contents"
}
]
},
{
"value": 20,
"name": "PrintFinder Items.action",
"path": "Automator/PrintFinder Items.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/PrintFinder Items.action/Contents"
}
]
},
{
"value": 108,
"name": "PrintImages.action",
"path": "Automator/PrintImages.action",
"children": [
{
"value": 108,
"name": "Contents",
"path": "Automator/PrintImages.action/Contents"
}
]
},
{
"value": 32,
"name": "PrintKeynote Presentation.action",
"path": "Automator/PrintKeynote Presentation.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/PrintKeynote Presentation.action/Contents"
}
]
},
{
"value": 288,
"name": "QuitAll Applications.action",
"path": "Automator/QuitAll Applications.action",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Automator/QuitAll Applications.action/Contents"
}
]
},
{
"value": 24,
"name": "QuitApplication.action",
"path": "Automator/QuitApplication.action",
"children": [
{
"value": 24,
"name": "Contents",
"path": "Automator/QuitApplication.action/Contents"
}
]
},
{
"value": 8,
"name": "RemoveEmpty Playlists.action",
"path": "Automator/RemoveEmpty Playlists.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/RemoveEmpty Playlists.action/Contents"
}
]
},
{
"value": 0,
"name": "RemoveFont Files.action",
"path": "Automator/RemoveFont Files.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/RemoveFont Files.action/Contents"
}
]
},
{
"value": 1092,
"name": "RenameFinder Items.action",
"path": "Automator/RenameFinder Items.action",
"children": [
{
"value": 1092,
"name": "Contents",
"path": "Automator/RenameFinder Items.action/Contents"
}
]
},
{
"value": 16,
"name": "RenamePDF Documents.action",
"path": "Automator/RenamePDF Documents.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/RenamePDF Documents.action/Contents"
}
]
},
{
"value": 32,
"name": "RenderPDF Pages as Images.action",
"path": "Automator/RenderPDF Pages as Images.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/RenderPDF Pages as Images.action/Contents"
}
]
},
{
"value": 2888,
"name": "RenderQuartz Compositions to Image Files.action",
"path": "Automator/RenderQuartz Compositions to Image Files.action",
"children": [
{
"value": 2888,
"name": "Contents",
"path": "Automator/RenderQuartz Compositions to Image Files.action/Contents"
}
]
},
{
"value": 0,
"name": "ResumeCapture.action",
"path": "Automator/ResumeCapture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/ResumeCapture.action/Contents"
}
]
},
{
"value": 8,
"name": "ResumeDVD Playback.action",
"path": "Automator/ResumeDVD Playback.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ResumeDVD Playback.action/Contents"
}
]
},
{
"value": 8,
"name": "RevealFinder Items.action",
"path": "Automator/RevealFinder Items.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/RevealFinder Items.action/Contents"
}
]
},
{
"value": 428,
"name": "ReviewPhotos.action",
"path": "Automator/ReviewPhotos.action",
"children": [
{
"value": 428,
"name": "Contents",
"path": "Automator/ReviewPhotos.action/Contents"
}
]
},
{
"value": 56,
"name": "RotateImages.action",
"path": "Automator/RotateImages.action",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Automator/RotateImages.action/Contents"
}
]
},
{
"value": 308,
"name": "RunAppleScript.action",
"path": "Automator/RunAppleScript.action",
"children": [
{
"value": 308,
"name": "Contents",
"path": "Automator/RunAppleScript.action/Contents"
}
]
},
{
"value": 20,
"name": "RunSelf-Test.action",
"path": "Automator/RunSelf-Test.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/RunSelf-Test.action/Contents"
}
]
},
{
"value": 316,
"name": "RunShell Script.action",
"path": "Automator/RunShell Script.action",
"children": [
{
"value": 316,
"name": "Contents",
"path": "Automator/RunShell Script.action/Contents"
}
]
},
{
"value": 36,
"name": "RunWeb Service.action",
"path": "Automator/RunWeb Service.action",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Automator/RunWeb Service.action/Contents"
}
]
},
{
"value": 416,
"name": "RunWorkflow.action",
"path": "Automator/RunWorkflow.action",
"children": [
{
"value": 416,
"name": "Contents",
"path": "Automator/RunWorkflow.action/Contents"
}
]
},
{
"value": 32,
"name": "SaveImages from Web Content.action",
"path": "Automator/SaveImages from Web Content.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/SaveImages from Web Content.action/Contents"
}
]
},
{
"value": 20,
"name": "ScaleImages.action",
"path": "Automator/ScaleImages.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/ScaleImages.action/Contents"
}
]
},
{
"value": 2112,
"name": "SearchPDFs.action",
"path": "Automator/SearchPDFs.action",
"children": [
{
"value": 2112,
"name": "Contents",
"path": "Automator/SearchPDFs.action/Contents"
}
]
},
{
"value": 0,
"name": "SelectFonts in Font Book.action",
"path": "Automator/SelectFonts in Font Book.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/SelectFonts in Font Book.action/Contents"
}
]
},
{
"value": 944,
"name": "SendBirthday Greetings.action",
"path": "Automator/SendBirthday Greetings.action",
"children": [
{
"value": 944,
"name": "Contents",
"path": "Automator/SendBirthday Greetings.action/Contents"
}
]
},
{
"value": 8,
"name": "SendOutgoing Messages.action",
"path": "Automator/SendOutgoing Messages.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/SendOutgoing Messages.action/Contents"
}
]
},
{
"value": 16,
"name": "SetApplication for Files.action",
"path": "Automator/SetApplication for Files.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/SetApplication for Files.action/Contents"
}
]
},
{
"value": 340,
"name": "SetComputer Volume.action",
"path": "Automator/SetComputer Volume.action",
"children": [
{
"value": 340,
"name": "Contents",
"path": "Automator/SetComputer Volume.action/Contents"
}
]
},
{
"value": 44,
"name": "SetContents of TextEdit Document.action",
"path": "Automator/SetContents of TextEdit Document.action",
"children": [
{
"value": 44,
"name": "Contents",
"path": "Automator/SetContents of TextEdit Document.action/Contents"
}
]
},
{
"value": 8,
"name": "SetDesktop Picture.action",
"path": "Automator/SetDesktop Picture.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/SetDesktop Picture.action/Contents"
}
]
},
{
"value": 820,
"name": "SetFolder Views.action",
"path": "Automator/SetFolder Views.action",
"children": [
{
"value": 820,
"name": "Contents",
"path": "Automator/SetFolder Views.action/Contents"
}
]
},
{
"value": 8,
"name": "SetiDVD Background Image.action",
"path": "Automator/SetiDVD Background Image.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/SetiDVD Background Image.action/Contents"
}
]
},
{
"value": 20,
"name": "SetiDVD Button Face.action",
"path": "Automator/SetiDVD Button Face.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/SetiDVD Button Face.action/Contents"
}
]
},
{
"value": 112,
"name": "SetInfo of iTunes Songs.action",
"path": "Automator/SetInfo of iTunes Songs.action",
"children": [
{
"value": 112,
"name": "Contents",
"path": "Automator/SetInfo of iTunes Songs.action/Contents"
}
]
},
{
"value": 408,
"name": "SetiTunes Equalizer.action",
"path": "Automator/SetiTunes Equalizer.action",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Automator/SetiTunes Equalizer.action/Contents"
}
]
},
{
"value": 32,
"name": "SetiTunes Volume.action",
"path": "Automator/SetiTunes Volume.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/SetiTunes Volume.action/Contents"
}
]
},
{
"value": 280,
"name": "SetMovie Annotations.action",
"path": "Automator/SetMovie Annotations.action",
"children": [
{
"value": 280,
"name": "Contents",
"path": "Automator/SetMovie Annotations.action/Contents"
}
]
},
{
"value": 256,
"name": "SetMovie Playback Properties.action",
"path": "Automator/SetMovie Playback Properties.action",
"children": [
{
"value": 256,
"name": "Contents",
"path": "Automator/SetMovie Playback Properties.action/Contents"
}
]
},
{
"value": 0,
"name": "SetMovie URL.action",
"path": "Automator/SetMovie URL.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/SetMovie URL.action/Contents"
}
]
},
{
"value": 408,
"name": "SetOptions of iTunes Songs.action",
"path": "Automator/SetOptions of iTunes Songs.action",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Automator/SetOptions of iTunes Songs.action/Contents"
}
]
},
{
"value": 408,
"name": "SetPDF Metadata.action",
"path": "Automator/SetPDF Metadata.action",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Automator/SetPDF Metadata.action/Contents"
}
]
},
{
"value": 8,
"name": "SetSpotlight Comments for Finder Items.action",
"path": "Automator/SetSpotlight Comments for Finder Items.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/SetSpotlight Comments for Finder Items.action/Contents"
}
]
},
{
"value": 20,
"name": "SetValue of Variable.action",
"path": "Automator/SetValue of Variable.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/SetValue of Variable.action/Contents"
}
]
},
{
"value": 8,
"name": "ShowMain iDVD Menu.action",
"path": "Automator/ShowMain iDVD Menu.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ShowMain iDVD Menu.action/Contents"
}
]
},
{
"value": 8,
"name": "ShowNext Keynote Slide.action",
"path": "Automator/ShowNext Keynote Slide.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ShowNext Keynote Slide.action/Contents"
}
]
},
{
"value": 8,
"name": "ShowPrevious Keynote Slide.action",
"path": "Automator/ShowPrevious Keynote Slide.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/ShowPrevious Keynote Slide.action/Contents"
}
]
},
{
"value": 16,
"name": "ShowSpecified Keynote Slide.action",
"path": "Automator/ShowSpecified Keynote Slide.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/ShowSpecified Keynote Slide.action/Contents"
}
]
},
{
"value": 36,
"name": "SortFinder Items.action",
"path": "Automator/SortFinder Items.action",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Automator/SortFinder Items.action/Contents"
}
]
},
{
"value": 32,
"name": "SpeakText.action",
"path": "Automator/SpeakText.action",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Automator/SpeakText.action/Contents"
}
]
},
{
"value": 20,
"name": "SpotlightLeopard.action",
"path": "Automator/SpotlightLeopard.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/SpotlightLeopard.action/Contents"
}
]
},
{
"value": 0,
"name": "StartCapture.action",
"path": "Automator/StartCapture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/StartCapture.action/Contents"
}
]
},
{
"value": 8,
"name": "StartiTunes Playing.action",
"path": "Automator/StartiTunes Playing.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StartiTunes Playing.action/Contents"
}
]
},
{
"value": 8,
"name": "StartiTunes Visuals.action",
"path": "Automator/StartiTunes Visuals.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StartiTunes Visuals.action/Contents"
}
]
},
{
"value": 16,
"name": "StartKeynote Slideshow.action",
"path": "Automator/StartKeynote Slideshow.action",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Automator/StartKeynote Slideshow.action/Contents"
}
]
},
{
"value": 8,
"name": "StartScreen Saver.action",
"path": "Automator/StartScreen Saver.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StartScreen Saver.action/Contents"
}
]
},
{
"value": 0,
"name": "StopCapture.action",
"path": "Automator/StopCapture.action",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Automator/StopCapture.action/Contents"
}
]
},
{
"value": 8,
"name": "StopDVD Playback.action",
"path": "Automator/StopDVD Playback.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StopDVD Playback.action/Contents"
}
]
},
{
"value": 8,
"name": "StopiTunes Visuals.action",
"path": "Automator/StopiTunes Visuals.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StopiTunes Visuals.action/Contents"
}
]
},
{
"value": 8,
"name": "StopKeynote Slideshow.action",
"path": "Automator/StopKeynote Slideshow.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/StopKeynote Slideshow.action/Contents"
}
]
},
{
"value": 28,
"name": "SystemProfile.action",
"path": "Automator/SystemProfile.action",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Automator/SystemProfile.action/Contents"
}
]
},
{
"value": 276,
"name": "TakePicture.action",
"path": "Automator/TakePicture.action",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Automator/TakePicture.action/Contents"
}
]
},
{
"value": 420,
"name": "TakeScreenshot.action",
"path": "Automator/TakeScreenshot.action",
"children": [
{
"value": 420,
"name": "Contents",
"path": "Automator/TakeScreenshot.action/Contents"
}
]
},
{
"value": 20,
"name": "TakeVideo Snapshot.action",
"path": "Automator/TakeVideo Snapshot.action",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Automator/TakeVideo Snapshot.action/Contents"
}
]
},
{
"value": 100,
"name": "Textto Audio File.action",
"path": "Automator/Textto Audio File.action",
"children": [
{
"value": 100,
"name": "Contents",
"path": "Automator/Textto Audio File.action/Contents"
}
]
},
{
"value": 436,
"name": "Textto EPUB File.action",
"path": "Automator/Textto EPUB File.action",
"children": [
{
"value": 436,
"name": "Contents",
"path": "Automator/Textto EPUB File.action/Contents"
}
]
},
{
"value": 8,
"name": "UpdateiPod.action",
"path": "Automator/UpdateiPod.action",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Automator/UpdateiPod.action/Contents"
}
]
},
{
"value": 264,
"name": "ValidateFont Files.action",
"path": "Automator/ValidateFont Files.action",
"children": [
{
"value": 264,
"name": "Contents",
"path": "Automator/ValidateFont Files.action/Contents"
}
]
},
{
"value": 272,
"name": "ViewResults.action",
"path": "Automator/ViewResults.action",
"children": [
{
"value": 272,
"name": "Contents",
"path": "Automator/ViewResults.action/Contents"
}
]
},
{
"value": 64,
"name": "Waitfor User Action.action",
"path": "Automator/Waitfor User Action.action",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Automator/Waitfor User Action.action/Contents"
}
]
},
{
"value": 456,
"name": "WatchMe Do.action",
"path": "Automator/WatchMe Do.action",
"children": [
{
"value": 456,
"name": "Contents",
"path": "Automator/WatchMe Do.action/Contents"
}
]
},
{
"value": 72,
"name": "WatermarkPDF Documents.action",
"path": "Automator/WatermarkPDF Documents.action",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Automator/WatermarkPDF Documents.action/Contents"
}
]
},
{
"value": 80,
"name": "WebsitePopup.action",
"path": "Automator/WebsitePopup.action",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Automator/WebsitePopup.action/Contents"
}
]
}
]
},
{
"value": 2868,
"name": "BridgeSupport",
"path": "BridgeSupport",
"children": [
{
"value": 0,
"name": "include",
"path": "BridgeSupport/include"
},
{
"value": 2840,
"name": "ruby-2.0",
"path": "BridgeSupport/ruby-2.0"
}
]
},
{
"value": 21988,
"name": "Caches",
"path": "Caches",
"children": [
{
"value": 2296,
"name": "com.apple.CVMS",
"path": "Caches/com.apple.CVMS"
},
{
"value": 19048,
"name": "com.apple.kext.caches",
"path": "Caches/com.apple.kext.caches",
"children": [
{
"value": 12,
"name": "Directories",
"path": "Caches/com.apple.kext.caches/Directories"
},
{
"value": 19036,
"name": "Startup",
"path": "Caches/com.apple.kext.caches/Startup"
}
]
}
]
},
{
"value": 2252,
"name": "ColorPickers",
"path": "ColorPickers",
"children": [
{
"value": 288,
"name": "NSColorPickerCrayon.colorPicker",
"path": "ColorPickers/NSColorPickerCrayon.colorPicker",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "ColorPickers/NSColorPickerCrayon.colorPicker/_CodeSignature"
},
{
"value": 288,
"name": "Resources",
"path": "ColorPickers/NSColorPickerCrayon.colorPicker/Resources"
}
]
},
{
"value": 524,
"name": "NSColorPickerPageableNameList.colorPicker",
"path": "ColorPickers/NSColorPickerPageableNameList.colorPicker",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "ColorPickers/NSColorPickerPageableNameList.colorPicker/_CodeSignature"
},
{
"value": 524,
"name": "Resources",
"path": "ColorPickers/NSColorPickerPageableNameList.colorPicker/Resources"
}
]
},
{
"value": 848,
"name": "NSColorPickerSliders.colorPicker",
"path": "ColorPickers/NSColorPickerSliders.colorPicker",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "ColorPickers/NSColorPickerSliders.colorPicker/_CodeSignature"
},
{
"value": 848,
"name": "Resources",
"path": "ColorPickers/NSColorPickerSliders.colorPicker/Resources"
}
]
},
{
"value": 532,
"name": "NSColorPickerUser.colorPicker",
"path": "ColorPickers/NSColorPickerUser.colorPicker",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "ColorPickers/NSColorPickerUser.colorPicker/_CodeSignature"
},
{
"value": 532,
"name": "Resources",
"path": "ColorPickers/NSColorPickerUser.colorPicker/Resources"
}
]
},
{
"value": 60,
"name": "NSColorPickerWheel.colorPicker",
"path": "ColorPickers/NSColorPickerWheel.colorPicker",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "ColorPickers/NSColorPickerWheel.colorPicker/_CodeSignature"
},
{
"value": 60,
"name": "Resources",
"path": "ColorPickers/NSColorPickerWheel.colorPicker/Resources"
}
]
}
]
},
{
"value": 0,
"name": "Colors",
"path": "Colors",
"children": [
{
"value": 0,
"name": "Apple.clr",
"path": "Colors/Apple.clr",
"children": [
{
"value": 0,
"name": "ar.lproj",
"path": "Colors/Apple.clr/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "Colors/Apple.clr/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "Colors/Apple.clr/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "Colors/Apple.clr/da.lproj"
},
{
"value": 0,
"name": "Dutch.lproj",
"path": "Colors/Apple.clr/Dutch.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "Colors/Apple.clr/el.lproj"
},
{
"value": 0,
"name": "English.lproj",
"path": "Colors/Apple.clr/English.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "Colors/Apple.clr/fi.lproj"
},
{
"value": 0,
"name": "French.lproj",
"path": "Colors/Apple.clr/French.lproj"
},
{
"value": 0,
"name": "German.lproj",
"path": "Colors/Apple.clr/German.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "Colors/Apple.clr/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "Colors/Apple.clr/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "Colors/Apple.clr/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "Colors/Apple.clr/id.lproj"
},
{
"value": 0,
"name": "Italian.lproj",
"path": "Colors/Apple.clr/Italian.lproj"
},
{
"value": 0,
"name": "Japanese.lproj",
"path": "Colors/Apple.clr/Japanese.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "Colors/Apple.clr/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "Colors/Apple.clr/ms.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "Colors/Apple.clr/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "Colors/Apple.clr/pl.lproj"
},
{
"value": 0,
"name": "pt.lproj",
"path": "Colors/Apple.clr/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "Colors/Apple.clr/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "Colors/Apple.clr/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "Colors/Apple.clr/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "Colors/Apple.clr/sk.lproj"
},
{
"value": 0,
"name": "Spanish.lproj",
"path": "Colors/Apple.clr/Spanish.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "Colors/Apple.clr/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "Colors/Apple.clr/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "Colors/Apple.clr/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "Colors/Apple.clr/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "Colors/Apple.clr/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "Colors/Apple.clr/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "Colors/Apple.clr/zh_TW.lproj"
}
]
},
{
"value": 0,
"name": "Crayons.clr",
"path": "Colors/Crayons.clr",
"children": [
{
"value": 0,
"name": "ar.lproj",
"path": "Colors/Crayons.clr/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "Colors/Crayons.clr/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "Colors/Crayons.clr/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "Colors/Crayons.clr/da.lproj"
},
{
"value": 0,
"name": "Dutch.lproj",
"path": "Colors/Crayons.clr/Dutch.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "Colors/Crayons.clr/el.lproj"
},
{
"value": 0,
"name": "English.lproj",
"path": "Colors/Crayons.clr/English.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "Colors/Crayons.clr/fi.lproj"
},
{
"value": 0,
"name": "French.lproj",
"path": "Colors/Crayons.clr/French.lproj"
},
{
"value": 0,
"name": "German.lproj",
"path": "Colors/Crayons.clr/German.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "Colors/Crayons.clr/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "Colors/Crayons.clr/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "Colors/Crayons.clr/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "Colors/Crayons.clr/id.lproj"
},
{
"value": 0,
"name": "Italian.lproj",
"path": "Colors/Crayons.clr/Italian.lproj"
},
{
"value": 0,
"name": "Japanese.lproj",
"path": "Colors/Crayons.clr/Japanese.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "Colors/Crayons.clr/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "Colors/Crayons.clr/ms.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "Colors/Crayons.clr/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "Colors/Crayons.clr/pl.lproj"
},
{
"value": 0,
"name": "pt.lproj",
"path": "Colors/Crayons.clr/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "Colors/Crayons.clr/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "Colors/Crayons.clr/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "Colors/Crayons.clr/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "Colors/Crayons.clr/sk.lproj"
},
{
"value": 0,
"name": "Spanish.lproj",
"path": "Colors/Crayons.clr/Spanish.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "Colors/Crayons.clr/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "Colors/Crayons.clr/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "Colors/Crayons.clr/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "Colors/Crayons.clr/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "Colors/Crayons.clr/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "Colors/Crayons.clr/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "Colors/Crayons.clr/zh_TW.lproj"
}
]
},
{
"value": 0,
"name": "System.clr",
"path": "Colors/System.clr",
"children": [
{
"value": 0,
"name": "ar.lproj",
"path": "Colors/System.clr/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "Colors/System.clr/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "Colors/System.clr/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "Colors/System.clr/da.lproj"
},
{
"value": 0,
"name": "Dutch.lproj",
"path": "Colors/System.clr/Dutch.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "Colors/System.clr/el.lproj"
},
{
"value": 0,
"name": "English.lproj",
"path": "Colors/System.clr/English.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "Colors/System.clr/fi.lproj"
},
{
"value": 0,
"name": "French.lproj",
"path": "Colors/System.clr/French.lproj"
},
{
"value": 0,
"name": "German.lproj",
"path": "Colors/System.clr/German.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "Colors/System.clr/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "Colors/System.clr/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "Colors/System.clr/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "Colors/System.clr/id.lproj"
},
{
"value": 0,
"name": "Italian.lproj",
"path": "Colors/System.clr/Italian.lproj"
},
{
"value": 0,
"name": "Japanese.lproj",
"path": "Colors/System.clr/Japanese.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "Colors/System.clr/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "Colors/System.clr/ms.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "Colors/System.clr/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "Colors/System.clr/pl.lproj"
},
{
"value": 0,
"name": "pt.lproj",
"path": "Colors/System.clr/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "Colors/System.clr/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "Colors/System.clr/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "Colors/System.clr/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "Colors/System.clr/sk.lproj"
},
{
"value": 0,
"name": "Spanish.lproj",
"path": "Colors/System.clr/Spanish.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "Colors/System.clr/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "Colors/System.clr/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "Colors/System.clr/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "Colors/System.clr/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "Colors/System.clr/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "Colors/System.clr/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "Colors/System.clr/zh_TW.lproj"
}
]
}
]
},
{
"value": 2908,
"name": "ColorSync",
"path": "ColorSync",
"children": [
{
"value": 2868,
"name": "Calibrators",
"path": "ColorSync/Calibrators",
"children": [
{
"value": 2868,
"name": "DisplayCalibrator.app",
"path": "ColorSync/Calibrators/DisplayCalibrator.app"
}
]
},
{
"value": 40,
"name": "Profiles",
"path": "ColorSync/Profiles"
}
]
},
{
"value": 21772,
"name": "Components",
"path": "Components",
"children": [
{
"value": 416,
"name": "AppleScript.component",
"path": "Components/AppleScript.component",
"children": [
{
"value": 416,
"name": "Contents",
"path": "Components/AppleScript.component/Contents"
}
]
},
{
"value": 2592,
"name": "AudioCodecs.component",
"path": "Components/AudioCodecs.component",
"children": [
{
"value": 2592,
"name": "Contents",
"path": "Components/AudioCodecs.component/Contents"
}
]
},
{
"value": 92,
"name": "AUSpeechSynthesis.component",
"path": "Components/AUSpeechSynthesis.component",
"children": [
{
"value": 92,
"name": "Contents",
"path": "Components/AUSpeechSynthesis.component/Contents"
}
]
},
{
"value": 18492,
"name": "CoreAudio.component",
"path": "Components/CoreAudio.component",
"children": [
{
"value": 18492,
"name": "Contents",
"path": "Components/CoreAudio.component/Contents"
}
]
},
{
"value": 28,
"name": "IOFWDVComponents.component",
"path": "Components/IOFWDVComponents.component",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Components/IOFWDVComponents.component/Contents"
}
]
},
{
"value": 16,
"name": "IOQTComponents.component",
"path": "Components/IOQTComponents.component",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Components/IOQTComponents.component/Contents"
}
]
},
{
"value": 12,
"name": "PDFImporter.component",
"path": "Components/PDFImporter.component",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Components/PDFImporter.component/Contents"
}
]
},
{
"value": 120,
"name": "SoundManagerComponents.component",
"path": "Components/SoundManagerComponents.component",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Components/SoundManagerComponents.component/Contents"
}
]
}
]
},
{
"value": 45728,
"name": "Compositions",
"path": "Compositions",
"children": [
{
"value": 0,
"name": ".Localization.bundle",
"path": "Compositions/.Localization.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Compositions/.Localization.bundle/Contents"
}
]
}
]
},
{
"value": 409060,
"name": "CoreServices",
"path": "CoreServices",
"children": [
{
"value": 1152,
"name": "AddPrinter.app",
"path": "CoreServices/AddPrinter.app",
"children": [
{
"value": 1152,
"name": "Contents",
"path": "CoreServices/AddPrinter.app/Contents"
}
]
},
{
"value": 72,
"name": "AddressBookUrlForwarder.app",
"path": "CoreServices/AddressBookUrlForwarder.app",
"children": [
{
"value": 72,
"name": "Contents",
"path": "CoreServices/AddressBookUrlForwarder.app/Contents"
}
]
},
{
"value": 20,
"name": "AirPlayUIAgent.app",
"path": "CoreServices/AirPlayUIAgent.app",
"children": [
{
"value": 20,
"name": "Contents",
"path": "CoreServices/AirPlayUIAgent.app/Contents"
}
]
},
{
"value": 56,
"name": "AirPortBase Station Agent.app",
"path": "CoreServices/AirPortBase Station Agent.app",
"children": [
{
"value": 56,
"name": "Contents",
"path": "CoreServices/AirPortBase Station Agent.app/Contents"
}
]
},
{
"value": 92,
"name": "AOS.bundle",
"path": "CoreServices/AOS.bundle",
"children": [
{
"value": 92,
"name": "Contents",
"path": "CoreServices/AOS.bundle/Contents"
}
]
},
{
"value": 1564,
"name": "AppDownloadLauncher.app",
"path": "CoreServices/AppDownloadLauncher.app",
"children": [
{
"value": 1564,
"name": "Contents",
"path": "CoreServices/AppDownloadLauncher.app/Contents"
}
]
},
{
"value": 376,
"name": "Apple80211Agent.app",
"path": "CoreServices/Apple80211Agent.app",
"children": [
{
"value": 376,
"name": "Contents",
"path": "CoreServices/Apple80211Agent.app/Contents"
}
]
},
{
"value": 480,
"name": "AppleFileServer.app",
"path": "CoreServices/AppleFileServer.app",
"children": [
{
"value": 480,
"name": "Contents",
"path": "CoreServices/AppleFileServer.app/Contents"
}
]
},
{
"value": 12,
"name": "AppleGraphicsWarning.app",
"path": "CoreServices/AppleGraphicsWarning.app",
"children": [
{
"value": 12,
"name": "Contents",
"path": "CoreServices/AppleGraphicsWarning.app/Contents"
}
]
},
{
"value": 1752,
"name": "AppleScriptUtility.app",
"path": "CoreServices/AppleScriptUtility.app",
"children": [
{
"value": 1752,
"name": "Contents",
"path": "CoreServices/AppleScriptUtility.app/Contents"
}
]
},
{
"value": 0,
"name": "ApplicationFirewall.bundle",
"path": "CoreServices/ApplicationFirewall.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "CoreServices/ApplicationFirewall.bundle/Contents"
}
]
},
{
"value": 14808,
"name": "Applications",
"path": "CoreServices/Applications",
"children": [
{
"value": 1792,
"name": "NetworkUtility.app",
"path": "CoreServices/Applications/NetworkUtility.app"
},
{
"value": 7328,
"name": "RAIDUtility.app",
"path": "CoreServices/Applications/RAIDUtility.app"
},
{
"value": 5688,
"name": "WirelessDiagnostics.app",
"path": "CoreServices/Applications/WirelessDiagnostics.app"
}
]
},
{
"value": 6620,
"name": "ArchiveUtility.app",
"path": "CoreServices/ArchiveUtility.app",
"children": [
{
"value": 6620,
"name": "Contents",
"path": "CoreServices/ArchiveUtility.app/Contents"
}
]
},
{
"value": 24,
"name": "AutomatorLauncher.app",
"path": "CoreServices/AutomatorLauncher.app",
"children": [
{
"value": 24,
"name": "Contents",
"path": "CoreServices/AutomatorLauncher.app/Contents"
}
]
},
{
"value": 584,
"name": "AutomatorRunner.app",
"path": "CoreServices/AutomatorRunner.app",
"children": [
{
"value": 584,
"name": "Contents",
"path": "CoreServices/AutomatorRunner.app/Contents"
}
]
},
{
"value": 412,
"name": "AVRCPAgent.app",
"path": "CoreServices/AVRCPAgent.app",
"children": [
{
"value": 412,
"name": "Contents",
"path": "CoreServices/AVRCPAgent.app/Contents"
}
]
},
{
"value": 1400,
"name": "backupd.bundle",
"path": "CoreServices/backupd.bundle",
"children": [
{
"value": 1400,
"name": "Contents",
"path": "CoreServices/backupd.bundle/Contents"
}
]
},
{
"value": 2548,
"name": "BluetoothSetup Assistant.app",
"path": "CoreServices/BluetoothSetup Assistant.app",
"children": [
{
"value": 2548,
"name": "Contents",
"path": "CoreServices/BluetoothSetup Assistant.app/Contents"
}
]
},
{
"value": 2588,
"name": "BluetoothUIServer.app",
"path": "CoreServices/BluetoothUIServer.app",
"children": [
{
"value": 2588,
"name": "Contents",
"path": "CoreServices/BluetoothUIServer.app/Contents"
}
]
},
{
"value": 1288,
"name": "CalendarFileHandler.app",
"path": "CoreServices/CalendarFileHandler.app",
"children": [
{
"value": 1288,
"name": "Contents",
"path": "CoreServices/CalendarFileHandler.app/Contents"
}
]
},
{
"value": 44,
"name": "CaptiveNetwork Assistant.app",
"path": "CoreServices/CaptiveNetwork Assistant.app",
"children": [
{
"value": 44,
"name": "Contents",
"path": "CoreServices/CaptiveNetwork Assistant.app/Contents"
}
]
},
{
"value": 12,
"name": "CarbonSpellChecker.bundle",
"path": "CoreServices/CarbonSpellChecker.bundle",
"children": [
{
"value": 12,
"name": "Contents",
"path": "CoreServices/CarbonSpellChecker.bundle/Contents"
}
]
},
{
"value": 27144,
"name": "CertificateAssistant.app",
"path": "CoreServices/CertificateAssistant.app",
"children": [
{
"value": 27144,
"name": "Contents",
"path": "CoreServices/CertificateAssistant.app/Contents"
}
]
},
{
"value": 28,
"name": "CommonCocoaPanels.bundle",
"path": "CoreServices/CommonCocoaPanels.bundle",
"children": [
{
"value": 28,
"name": "Contents",
"path": "CoreServices/CommonCocoaPanels.bundle/Contents"
}
]
},
{
"value": 676,
"name": "CoreLocationAgent.app",
"path": "CoreServices/CoreLocationAgent.app",
"children": [
{
"value": 676,
"name": "Contents",
"path": "CoreServices/CoreLocationAgent.app/Contents"
}
]
},
{
"value": 164,
"name": "CoreServicesUIAgent.app",
"path": "CoreServices/CoreServicesUIAgent.app",
"children": [
{
"value": 164,
"name": "Contents",
"path": "CoreServices/CoreServicesUIAgent.app/Contents"
}
]
},
{
"value": 171300,
"name": "CoreTypes.bundle",
"path": "CoreServices/CoreTypes.bundle",
"children": [
{
"value": 171300,
"name": "Contents",
"path": "CoreServices/CoreTypes.bundle/Contents"
}
]
},
{
"value": 308,
"name": "DatabaseEvents.app",
"path": "CoreServices/DatabaseEvents.app",
"children": [
{
"value": 308,
"name": "Contents",
"path": "CoreServices/DatabaseEvents.app/Contents"
}
]
},
{
"value": 6104,
"name": "DirectoryUtility.app",
"path": "CoreServices/DirectoryUtility.app",
"children": [
{
"value": 6104,
"name": "Contents",
"path": "CoreServices/DirectoryUtility.app/Contents"
}
]
},
{
"value": 1840,
"name": "DiskImageMounter.app",
"path": "CoreServices/DiskImageMounter.app",
"children": [
{
"value": 1840,
"name": "Contents",
"path": "CoreServices/DiskImageMounter.app/Contents"
}
]
},
{
"value": 8476,
"name": "Dock.app",
"path": "CoreServices/Dock.app",
"children": [
{
"value": 8476,
"name": "Contents",
"path": "CoreServices/Dock.app/Contents"
}
]
},
{
"value": 696,
"name": "Encodings",
"path": "CoreServices/Encodings"
},
{
"value": 1024,
"name": "ExpansionSlot Utility.app",
"path": "CoreServices/ExpansionSlot Utility.app",
"children": [
{
"value": 1024,
"name": "Contents",
"path": "CoreServices/ExpansionSlot Utility.app/Contents"
}
]
},
{
"value": 1732,
"name": "FileSync.app",
"path": "CoreServices/FileSync.app",
"children": [
{
"value": 1732,
"name": "Contents",
"path": "CoreServices/FileSync.app/Contents"
}
]
},
{
"value": 572,
"name": "FileSyncAgent.app",
"path": "CoreServices/FileSyncAgent.app",
"children": [
{
"value": 572,
"name": "Contents",
"path": "CoreServices/FileSyncAgent.app/Contents"
}
]
},
{
"value": 35168,
"name": "Finder.app",
"path": "CoreServices/Finder.app",
"children": [
{
"value": 35168,
"name": "Contents",
"path": "CoreServices/Finder.app/Contents"
}
]
},
{
"value": 0,
"name": "FirmwareUpdates",
"path": "CoreServices/FirmwareUpdates"
},
{
"value": 336,
"name": "FolderActions Dispatcher.app",
"path": "CoreServices/FolderActions Dispatcher.app",
"children": [
{
"value": 336,
"name": "Contents",
"path": "CoreServices/FolderActions Dispatcher.app/Contents"
}
]
},
{
"value": 1820,
"name": "FolderActions Setup.app",
"path": "CoreServices/FolderActions Setup.app",
"children": [
{
"value": 1820,
"name": "Contents",
"path": "CoreServices/FolderActions Setup.app/Contents"
}
]
},
{
"value": 3268,
"name": "HelpViewer.app",
"path": "CoreServices/HelpViewer.app",
"children": [
{
"value": 3268,
"name": "Contents",
"path": "CoreServices/HelpViewer.app/Contents"
}
]
},
{
"value": 352,
"name": "ImageEvents.app",
"path": "CoreServices/ImageEvents.app",
"children": [
{
"value": 352,
"name": "Contents",
"path": "CoreServices/ImageEvents.app/Contents"
}
]
},
{
"value": 2012,
"name": "InstallCommand Line Developer Tools.app",
"path": "CoreServices/InstallCommand Line Developer Tools.app",
"children": [
{
"value": 2012,
"name": "Contents",
"path": "CoreServices/InstallCommand Line Developer Tools.app/Contents"
}
]
},
{
"value": 108,
"name": "Installin Progress.app",
"path": "CoreServices/Installin Progress.app",
"children": [
{
"value": 108,
"name": "Contents",
"path": "CoreServices/Installin Progress.app/Contents"
}
]
},
{
"value": 7444,
"name": "Installer.app",
"path": "CoreServices/Installer.app",
"children": [
{
"value": 7444,
"name": "Contents",
"path": "CoreServices/Installer.app/Contents"
}
]
},
{
"value": 8,
"name": "InstallerStatusNotifications.bundle",
"path": "CoreServices/InstallerStatusNotifications.bundle",
"children": [
{
"value": 8,
"name": "Contents",
"path": "CoreServices/InstallerStatusNotifications.bundle/Contents"
}
]
},
{
"value": 0,
"name": "InternetSharing.bundle",
"path": "CoreServices/InternetSharing.bundle",
"children": [
{
"value": 0,
"name": "Resources",
"path": "CoreServices/InternetSharing.bundle/Resources"
}
]
},
{
"value": 244,
"name": "JarLauncher.app",
"path": "CoreServices/JarLauncher.app",
"children": [
{
"value": 244,
"name": "Contents",
"path": "CoreServices/JarLauncher.app/Contents"
}
]
},
{
"value": 152,
"name": "JavaWeb Start.app",
"path": "CoreServices/JavaWeb Start.app",
"children": [
{
"value": 152,
"name": "Contents",
"path": "CoreServices/JavaWeb Start.app/Contents"
}
]
},
{
"value": 12,
"name": "KernelEventAgent.bundle",
"path": "CoreServices/KernelEventAgent.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "CoreServices/KernelEventAgent.bundle/Contents"
},
{
"value": 12,
"name": "FileSystemUIAgent.app",
"path": "CoreServices/KernelEventAgent.bundle/FileSystemUIAgent.app"
}
]
},
{
"value": 1016,
"name": "KeyboardSetupAssistant.app",
"path": "CoreServices/KeyboardSetupAssistant.app",
"children": [
{
"value": 1016,
"name": "Contents",
"path": "CoreServices/KeyboardSetupAssistant.app/Contents"
}
]
},
{
"value": 840,
"name": "KeychainCircle Notification.app",
"path": "CoreServices/KeychainCircle Notification.app",
"children": [
{
"value": 840,
"name": "Contents",
"path": "CoreServices/KeychainCircle Notification.app/Contents"
}
]
},
{
"value": 1448,
"name": "LanguageChooser.app",
"path": "CoreServices/LanguageChooser.app",
"children": [
{
"value": 1448,
"name": "Contents",
"path": "CoreServices/LanguageChooser.app/Contents"
}
]
},
{
"value": 868,
"name": "LocationMenu.app",
"path": "CoreServices/LocationMenu.app",
"children": [
{
"value": 868,
"name": "Contents",
"path": "CoreServices/LocationMenu.app/Contents"
}
]
},
{
"value": 8260,
"name": "loginwindow.app",
"path": "CoreServices/loginwindow.app",
"children": [
{
"value": 8260,
"name": "Contents",
"path": "CoreServices/loginwindow.app/Contents"
}
]
},
{
"value": 3632,
"name": "ManagedClient.app",
"path": "CoreServices/ManagedClient.app",
"children": [
{
"value": 3632,
"name": "Contents",
"path": "CoreServices/ManagedClient.app/Contents"
}
]
},
{
"value": 0,
"name": "mDNSResponder.bundle",
"path": "CoreServices/mDNSResponder.bundle",
"children": [
{
"value": 0,
"name": "Resources",
"path": "CoreServices/mDNSResponder.bundle/Resources"
}
]
},
{
"value": 420,
"name": "MemorySlot Utility.app",
"path": "CoreServices/MemorySlot Utility.app",
"children": [
{
"value": 420,
"name": "Contents",
"path": "CoreServices/MemorySlot Utility.app/Contents"
}
]
},
{
"value": 4272,
"name": "MenuExtras",
"path": "CoreServices/MenuExtras",
"children": [
{
"value": 416,
"name": "AirPort.menu",
"path": "CoreServices/MenuExtras/AirPort.menu"
},
{
"value": 788,
"name": "Battery.menu",
"path": "CoreServices/MenuExtras/Battery.menu"
},
{
"value": 112,
"name": "Bluetooth.menu",
"path": "CoreServices/MenuExtras/Bluetooth.menu"
},
{
"value": 12,
"name": "Clock.menu",
"path": "CoreServices/MenuExtras/Clock.menu"
},
{
"value": 84,
"name": "Displays.menu",
"path": "CoreServices/MenuExtras/Displays.menu"
},
{
"value": 32,
"name": "Eject.menu",
"path": "CoreServices/MenuExtras/Eject.menu"
},
{
"value": 24,
"name": "ExpressCard.menu",
"path": "CoreServices/MenuExtras/ExpressCard.menu"
},
{
"value": 76,
"name": "Fax.menu",
"path": "CoreServices/MenuExtras/Fax.menu"
},
{
"value": 112,
"name": "HomeSync.menu",
"path": "CoreServices/MenuExtras/HomeSync.menu"
},
{
"value": 84,
"name": "iChat.menu",
"path": "CoreServices/MenuExtras/iChat.menu"
},
{
"value": 28,
"name": "Ink.menu",
"path": "CoreServices/MenuExtras/Ink.menu"
},
{
"value": 104,
"name": "IrDA.menu",
"path": "CoreServices/MenuExtras/IrDA.menu"
},
{
"value": 68,
"name": "PPP.menu",
"path": "CoreServices/MenuExtras/PPP.menu"
},
{
"value": 24,
"name": "PPPoE.menu",
"path": "CoreServices/MenuExtras/PPPoE.menu"
},
{
"value": 60,
"name": "RemoteDesktop.menu",
"path": "CoreServices/MenuExtras/RemoteDesktop.menu"
},
{
"value": 48,
"name": "Script Menu.menu",
"path": "CoreServices/MenuExtras/Script Menu.menu"
},
{
"value": 832,
"name": "TextInput.menu",
"path": "CoreServices/MenuExtras/TextInput.menu"
},
{
"value": 144,
"name": "TimeMachine.menu",
"path": "CoreServices/MenuExtras/TimeMachine.menu"
},
{
"value": 40,
"name": "UniversalAccess.menu",
"path": "CoreServices/MenuExtras/UniversalAccess.menu"
},
{
"value": 108,
"name": "User.menu",
"path": "CoreServices/MenuExtras/User.menu"
},
{
"value": 316,
"name": "Volume.menu",
"path": "CoreServices/MenuExtras/Volume.menu"
},
{
"value": 48,
"name": "VPN.menu",
"path": "CoreServices/MenuExtras/VPN.menu"
},
{
"value": 712,
"name": "WWAN.menu",
"path": "CoreServices/MenuExtras/WWAN.menu"
}
]
},
{
"value": 16,
"name": "MLTEFile.bundle",
"path": "CoreServices/MLTEFile.bundle",
"children": [
{
"value": 16,
"name": "Contents",
"path": "CoreServices/MLTEFile.bundle/Contents"
}
]
},
{
"value": 616,
"name": "MRTAgent.app",
"path": "CoreServices/MRTAgent.app",
"children": [
{
"value": 616,
"name": "Contents",
"path": "CoreServices/MRTAgent.app/Contents"
}
]
},
{
"value": 1540,
"name": "NetAuthAgent.app",
"path": "CoreServices/NetAuthAgent.app",
"children": [
{
"value": 1540,
"name": "Contents",
"path": "CoreServices/NetAuthAgent.app/Contents"
}
]
},
{
"value": 3388,
"name": "NetworkDiagnostics.app",
"path": "CoreServices/NetworkDiagnostics.app",
"children": [
{
"value": 3388,
"name": "Contents",
"path": "CoreServices/NetworkDiagnostics.app/Contents"
}
]
},
{
"value": 9384,
"name": "NetworkSetup Assistant.app",
"path": "CoreServices/NetworkSetup Assistant.app",
"children": [
{
"value": 9384,
"name": "Contents",
"path": "CoreServices/NetworkSetup Assistant.app/Contents"
}
]
},
{
"value": 716,
"name": "NotificationCenter.app",
"path": "CoreServices/NotificationCenter.app",
"children": [
{
"value": 716,
"name": "Contents",
"path": "CoreServices/NotificationCenter.app/Contents"
}
]
},
{
"value": 948,
"name": "OBEXAgent.app",
"path": "CoreServices/OBEXAgent.app",
"children": [
{
"value": 948,
"name": "Contents",
"path": "CoreServices/OBEXAgent.app/Contents"
}
]
},
{
"value": 1596,
"name": "ODSAgent.app",
"path": "CoreServices/ODSAgent.app",
"children": [
{
"value": 1596,
"name": "Contents",
"path": "CoreServices/ODSAgent.app/Contents"
}
]
},
{
"value": 492,
"name": "PassViewer.app",
"path": "CoreServices/PassViewer.app",
"children": [
{
"value": 492,
"name": "Contents",
"path": "CoreServices/PassViewer.app/Contents"
}
]
},
{
"value": 0,
"name": "PerformanceMetricLocalizations.bundle",
"path": "CoreServices/PerformanceMetricLocalizations.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "CoreServices/PerformanceMetricLocalizations.bundle/Contents"
}
]
},
{
"value": 88,
"name": "powerd.bundle",
"path": "CoreServices/powerd.bundle",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "CoreServices/powerd.bundle/_CodeSignature"
},
{
"value": 0,
"name": "ar.lproj",
"path": "CoreServices/powerd.bundle/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "CoreServices/powerd.bundle/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "CoreServices/powerd.bundle/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "CoreServices/powerd.bundle/da.lproj"
},
{
"value": 0,
"name": "Dutch.lproj",
"path": "CoreServices/powerd.bundle/Dutch.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "CoreServices/powerd.bundle/el.lproj"
},
{
"value": 0,
"name": "English.lproj",
"path": "CoreServices/powerd.bundle/English.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "CoreServices/powerd.bundle/fi.lproj"
},
{
"value": 0,
"name": "French.lproj",
"path": "CoreServices/powerd.bundle/French.lproj"
},
{
"value": 0,
"name": "German.lproj",
"path": "CoreServices/powerd.bundle/German.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "CoreServices/powerd.bundle/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "CoreServices/powerd.bundle/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "CoreServices/powerd.bundle/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "CoreServices/powerd.bundle/id.lproj"
},
{
"value": 0,
"name": "Italian.lproj",
"path": "CoreServices/powerd.bundle/Italian.lproj"
},
{
"value": 0,
"name": "Japanese.lproj",
"path": "CoreServices/powerd.bundle/Japanese.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "CoreServices/powerd.bundle/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "CoreServices/powerd.bundle/ms.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "CoreServices/powerd.bundle/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "CoreServices/powerd.bundle/pl.lproj"
},
{
"value": 0,
"name": "pt.lproj",
"path": "CoreServices/powerd.bundle/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "CoreServices/powerd.bundle/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "CoreServices/powerd.bundle/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "CoreServices/powerd.bundle/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "CoreServices/powerd.bundle/sk.lproj"
},
{
"value": 0,
"name": "Spanish.lproj",
"path": "CoreServices/powerd.bundle/Spanish.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "CoreServices/powerd.bundle/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "CoreServices/powerd.bundle/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "CoreServices/powerd.bundle/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "CoreServices/powerd.bundle/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "CoreServices/powerd.bundle/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "CoreServices/powerd.bundle/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "CoreServices/powerd.bundle/zh_TW.lproj"
}
]
},
{
"value": 776,
"name": "ProblemReporter.app",
"path": "CoreServices/ProblemReporter.app",
"children": [
{
"value": 776,
"name": "Contents",
"path": "CoreServices/ProblemReporter.app/Contents"
}
]
},
{
"value": 4748,
"name": "RawCamera.bundle",
"path": "CoreServices/RawCamera.bundle",
"children": [
{
"value": 4748,
"name": "Contents",
"path": "CoreServices/RawCamera.bundle/Contents"
}
]
},
{
"value": 2112,
"name": "RawCameraSupport.bundle",
"path": "CoreServices/RawCameraSupport.bundle",
"children": [
{
"value": 2112,
"name": "Contents",
"path": "CoreServices/RawCameraSupport.bundle/Contents"
}
]
},
{
"value": 24,
"name": "rcd.app",
"path": "CoreServices/rcd.app",
"children": [
{
"value": 24,
"name": "Contents",
"path": "CoreServices/rcd.app/Contents"
}
]
},
{
"value": 156,
"name": "RegisterPluginIMApp.app",
"path": "CoreServices/RegisterPluginIMApp.app",
"children": [
{
"value": 156,
"name": "Contents",
"path": "CoreServices/RegisterPluginIMApp.app/Contents"
}
]
},
{
"value": 3504,
"name": "RemoteManagement",
"path": "CoreServices/RemoteManagement",
"children": [
{
"value": 872,
"name": "AppleVNCServer.bundle",
"path": "CoreServices/RemoteManagement/AppleVNCServer.bundle"
},
{
"value": 2260,
"name": "ARDAgent.app",
"path": "CoreServices/RemoteManagement/ARDAgent.app"
},
{
"value": 144,
"name": "ScreensharingAgent.bundle",
"path": "CoreServices/RemoteManagement/ScreensharingAgent.bundle"
},
{
"value": 228,
"name": "screensharingd.bundle",
"path": "CoreServices/RemoteManagement/screensharingd.bundle"
}
]
},
{
"value": 672,
"name": "ReportPanic.app",
"path": "CoreServices/ReportPanic.app",
"children": [
{
"value": 672,
"name": "Contents",
"path": "CoreServices/ReportPanic.app/Contents"
}
]
},
{
"value": 0,
"name": "Resources",
"path": "CoreServices/Resources",
"children": [
{
"value": 0,
"name": "ar.lproj",
"path": "CoreServices/Resources/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "CoreServices/Resources/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "CoreServices/Resources/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "CoreServices/Resources/da.lproj"
},
{
"value": 0,
"name": "Dutch.lproj",
"path": "CoreServices/Resources/Dutch.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "CoreServices/Resources/el.lproj"
},
{
"value": 0,
"name": "English.lproj",
"path": "CoreServices/Resources/English.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "CoreServices/Resources/fi.lproj"
},
{
"value": 0,
"name": "French.lproj",
"path": "CoreServices/Resources/French.lproj"
},
{
"value": 0,
"name": "German.lproj",
"path": "CoreServices/Resources/German.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "CoreServices/Resources/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "CoreServices/Resources/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "CoreServices/Resources/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "CoreServices/Resources/id.lproj"
},
{
"value": 0,
"name": "Italian.lproj",
"path": "CoreServices/Resources/Italian.lproj"
},
{
"value": 0,
"name": "Japanese.lproj",
"path": "CoreServices/Resources/Japanese.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "CoreServices/Resources/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "CoreServices/Resources/ms.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "CoreServices/Resources/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "CoreServices/Resources/pl.lproj"
},
{
"value": 0,
"name": "Profiles",
"path": "CoreServices/Resources/Profiles"
},
{
"value": 0,
"name": "pt.lproj",
"path": "CoreServices/Resources/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "CoreServices/Resources/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "CoreServices/Resources/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "CoreServices/Resources/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "CoreServices/Resources/sk.lproj"
},
{
"value": 0,
"name": "Spanish.lproj",
"path": "CoreServices/Resources/Spanish.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "CoreServices/Resources/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "CoreServices/Resources/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "CoreServices/Resources/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "CoreServices/Resources/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "CoreServices/Resources/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "CoreServices/Resources/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "CoreServices/Resources/zh_TW.lproj"
}
]
},
{
"value": 20,
"name": "RFBEventHelper.bundle",
"path": "CoreServices/RFBEventHelper.bundle",
"children": [
{
"value": 20,
"name": "Contents",
"path": "CoreServices/RFBEventHelper.bundle/Contents"
}
]
},
{
"value": 3304,
"name": "ScreenSharing.app",
"path": "CoreServices/ScreenSharing.app",
"children": [
{
"value": 3304,
"name": "Contents",
"path": "CoreServices/ScreenSharing.app/Contents"
}
]
},
{
"value": 244,
"name": "Search.bundle",
"path": "CoreServices/Search.bundle",
"children": [
{
"value": 244,
"name": "Contents",
"path": "CoreServices/Search.bundle/Contents"
}
]
},
{
"value": 4128,
"name": "SecurityAgentPlugins",
"path": "CoreServices/SecurityAgentPlugins",
"children": [
{
"value": 304,
"name": "DiskUnlock.bundle",
"path": "CoreServices/SecurityAgentPlugins/DiskUnlock.bundle"
},
{
"value": 1192,
"name": "FamilyControls.bundle",
"path": "CoreServices/SecurityAgentPlugins/FamilyControls.bundle"
},
{
"value": 340,
"name": "HomeDirMechanism.bundle",
"path": "CoreServices/SecurityAgentPlugins/HomeDirMechanism.bundle"
},
{
"value": 1156,
"name": "KerberosAgent.bundle",
"path": "CoreServices/SecurityAgentPlugins/KerberosAgent.bundle"
},
{
"value": 276,
"name": "loginKC.bundle",
"path": "CoreServices/SecurityAgentPlugins/loginKC.bundle"
},
{
"value": 104,
"name": "loginwindow.bundle",
"path": "CoreServices/SecurityAgentPlugins/loginwindow.bundle"
},
{
"value": 384,
"name": "MCXMechanism.bundle",
"path": "CoreServices/SecurityAgentPlugins/MCXMechanism.bundle"
},
{
"value": 12,
"name": "PKINITMechanism.bundle",
"path": "CoreServices/SecurityAgentPlugins/PKINITMechanism.bundle"
},
{
"value": 360,
"name": "RestartAuthorization.bundle",
"path": "CoreServices/SecurityAgentPlugins/RestartAuthorization.bundle"
}
]
},
{
"value": 328,
"name": "SecurityFixer.app",
"path": "CoreServices/SecurityFixer.app",
"children": [
{
"value": 328,
"name": "Contents",
"path": "CoreServices/SecurityFixer.app/Contents"
}
]
},
{
"value": 28200,
"name": "SetupAssistant.app",
"path": "CoreServices/SetupAssistant.app",
"children": [
{
"value": 28200,
"name": "Contents",
"path": "CoreServices/SetupAssistant.app/Contents"
}
]
},
{
"value": 164,
"name": "SetupAssistantPlugins",
"path": "CoreServices/SetupAssistantPlugins",
"children": [
{
"value": 8,
"name": "AppStore.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/AppStore.icdplugin"
},
{
"value": 8,
"name": "Calendar.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Calendar.flplugin"
},
{
"value": 8,
"name": "FaceTime.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/FaceTime.icdplugin"
},
{
"value": 8,
"name": "Fonts.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Fonts.flplugin"
},
{
"value": 16,
"name": "GameCenter.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/GameCenter.icdplugin"
},
{
"value": 8,
"name": "Helpd.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Helpd.flplugin"
},
{
"value": 8,
"name": "iBooks.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/iBooks.icdplugin"
},
{
"value": 16,
"name": "IdentityServices.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/IdentityServices.icdplugin"
},
{
"value": 8,
"name": "iMessage.icdplugin",
"path": "CoreServices/SetupAssistantPlugins/iMessage.icdplugin"
},
{
"value": 8,
"name": "LaunchServices.flplugin",
"path": "CoreServices/SetupAssistantPlugins/LaunchServices.flplugin"
},
{
"value": 12,
"name": "Mail.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Mail.flplugin"
},
{
"value": 8,
"name": "QuickLook.flplugin",
"path": "CoreServices/SetupAssistantPlugins/QuickLook.flplugin"
},
{
"value": 8,
"name": "Safari.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Safari.flplugin"
},
{
"value": 8,
"name": "ServicesMenu.flplugin",
"path": "CoreServices/SetupAssistantPlugins/ServicesMenu.flplugin"
},
{
"value": 8,
"name": "SoftwareUpdateActions.flplugin",
"path": "CoreServices/SetupAssistantPlugins/SoftwareUpdateActions.flplugin"
},
{
"value": 8,
"name": "Spotlight.flplugin",
"path": "CoreServices/SetupAssistantPlugins/Spotlight.flplugin"
},
{
"value": 16,
"name": "UAU.flplugin",
"path": "CoreServices/SetupAssistantPlugins/UAU.flplugin"
}
]
},
{
"value": 48,
"name": "SocialPushAgent.app",
"path": "CoreServices/SocialPushAgent.app",
"children": [
{
"value": 48,
"name": "Contents",
"path": "CoreServices/SocialPushAgent.app/Contents"
}
]
},
{
"value": 2196,
"name": "SoftwareUpdate.app",
"path": "CoreServices/SoftwareUpdate.app",
"children": [
{
"value": 2196,
"name": "Contents",
"path": "CoreServices/SoftwareUpdate.app/Contents"
}
]
},
{
"value": 856,
"name": "Spotlight.app",
"path": "CoreServices/Spotlight.app",
"children": [
{
"value": 856,
"name": "Contents",
"path": "CoreServices/Spotlight.app/Contents"
}
]
},
{
"value": 384,
"name": "SystemEvents.app",
"path": "CoreServices/SystemEvents.app",
"children": [
{
"value": 384,
"name": "Contents",
"path": "CoreServices/SystemEvents.app/Contents"
}
]
},
{
"value": 2152,
"name": "SystemImage Utility.app",
"path": "CoreServices/SystemImage Utility.app",
"children": [
{
"value": 2152,
"name": "Contents",
"path": "CoreServices/SystemImage Utility.app/Contents"
}
]
},
{
"value": 0,
"name": "SystemFolderLocalizations",
"path": "CoreServices/SystemFolderLocalizations",
"children": [
{
"value": 0,
"name": "ar.lproj",
"path": "CoreServices/SystemFolderLocalizations/ar.lproj"
},
{
"value": 0,
"name": "ca.lproj",
"path": "CoreServices/SystemFolderLocalizations/ca.lproj"
},
{
"value": 0,
"name": "cs.lproj",
"path": "CoreServices/SystemFolderLocalizations/cs.lproj"
},
{
"value": 0,
"name": "da.lproj",
"path": "CoreServices/SystemFolderLocalizations/da.lproj"
},
{
"value": 0,
"name": "de.lproj",
"path": "CoreServices/SystemFolderLocalizations/de.lproj"
},
{
"value": 0,
"name": "el.lproj",
"path": "CoreServices/SystemFolderLocalizations/el.lproj"
},
{
"value": 0,
"name": "en.lproj",
"path": "CoreServices/SystemFolderLocalizations/en.lproj"
},
{
"value": 0,
"name": "es.lproj",
"path": "CoreServices/SystemFolderLocalizations/es.lproj"
},
{
"value": 0,
"name": "fi.lproj",
"path": "CoreServices/SystemFolderLocalizations/fi.lproj"
},
{
"value": 0,
"name": "fr.lproj",
"path": "CoreServices/SystemFolderLocalizations/fr.lproj"
},
{
"value": 0,
"name": "he.lproj",
"path": "CoreServices/SystemFolderLocalizations/he.lproj"
},
{
"value": 0,
"name": "hr.lproj",
"path": "CoreServices/SystemFolderLocalizations/hr.lproj"
},
{
"value": 0,
"name": "hu.lproj",
"path": "CoreServices/SystemFolderLocalizations/hu.lproj"
},
{
"value": 0,
"name": "id.lproj",
"path": "CoreServices/SystemFolderLocalizations/id.lproj"
},
{
"value": 0,
"name": "it.lproj",
"path": "CoreServices/SystemFolderLocalizations/it.lproj"
},
{
"value": 0,
"name": "ja.lproj",
"path": "CoreServices/SystemFolderLocalizations/ja.lproj"
},
{
"value": 0,
"name": "ko.lproj",
"path": "CoreServices/SystemFolderLocalizations/ko.lproj"
},
{
"value": 0,
"name": "ms.lproj",
"path": "CoreServices/SystemFolderLocalizations/ms.lproj"
},
{
"value": 0,
"name": "nl.lproj",
"path": "CoreServices/SystemFolderLocalizations/nl.lproj"
},
{
"value": 0,
"name": "no.lproj",
"path": "CoreServices/SystemFolderLocalizations/no.lproj"
},
{
"value": 0,
"name": "pl.lproj",
"path": "CoreServices/SystemFolderLocalizations/pl.lproj"
},
{
"value": 0,
"name": "pt.lproj",
"path": "CoreServices/SystemFolderLocalizations/pt.lproj"
},
{
"value": 0,
"name": "pt_PT.lproj",
"path": "CoreServices/SystemFolderLocalizations/pt_PT.lproj"
},
{
"value": 0,
"name": "ro.lproj",
"path": "CoreServices/SystemFolderLocalizations/ro.lproj"
},
{
"value": 0,
"name": "ru.lproj",
"path": "CoreServices/SystemFolderLocalizations/ru.lproj"
},
{
"value": 0,
"name": "sk.lproj",
"path": "CoreServices/SystemFolderLocalizations/sk.lproj"
},
{
"value": 0,
"name": "sv.lproj",
"path": "CoreServices/SystemFolderLocalizations/sv.lproj"
},
{
"value": 0,
"name": "th.lproj",
"path": "CoreServices/SystemFolderLocalizations/th.lproj"
},
{
"value": 0,
"name": "tr.lproj",
"path": "CoreServices/SystemFolderLocalizations/tr.lproj"
},
{
"value": 0,
"name": "uk.lproj",
"path": "CoreServices/SystemFolderLocalizations/uk.lproj"
},
{
"value": 0,
"name": "vi.lproj",
"path": "CoreServices/SystemFolderLocalizations/vi.lproj"
},
{
"value": 0,
"name": "zh_CN.lproj",
"path": "CoreServices/SystemFolderLocalizations/zh_CN.lproj"
},
{
"value": 0,
"name": "zh_TW.lproj",
"path": "CoreServices/SystemFolderLocalizations/zh_TW.lproj"
}
]
},
{
"value": 852,
"name": "SystemUIServer.app",
"path": "CoreServices/SystemUIServer.app",
"children": [
{
"value": 852,
"name": "Contents",
"path": "CoreServices/SystemUIServer.app/Contents"
}
]
},
{
"value": 132,
"name": "SystemVersion.bundle",
"path": "CoreServices/SystemVersion.bundle",
"children": [
{
"value": 4,
"name": "ar.lproj",
"path": "CoreServices/SystemVersion.bundle/ar.lproj"
},
{
"value": 4,
"name": "ca.lproj",
"path": "CoreServices/SystemVersion.bundle/ca.lproj"
},
{
"value": 4,
"name": "cs.lproj",
"path": "CoreServices/SystemVersion.bundle/cs.lproj"
},
{
"value": 4,
"name": "da.lproj",
"path": "CoreServices/SystemVersion.bundle/da.lproj"
},
{
"value": 4,
"name": "Dutch.lproj",
"path": "CoreServices/SystemVersion.bundle/Dutch.lproj"
},
{
"value": 4,
"name": "el.lproj",
"path": "CoreServices/SystemVersion.bundle/el.lproj"
},
{
"value": 4,
"name": "English.lproj",
"path": "CoreServices/SystemVersion.bundle/English.lproj"
},
{
"value": 4,
"name": "fi.lproj",
"path": "CoreServices/SystemVersion.bundle/fi.lproj"
},
{
"value": 4,
"name": "French.lproj",
"path": "CoreServices/SystemVersion.bundle/French.lproj"
},
{
"value": 4,
"name": "German.lproj",
"path": "CoreServices/SystemVersion.bundle/German.lproj"
},
{
"value": 4,
"name": "he.lproj",
"path": "CoreServices/SystemVersion.bundle/he.lproj"
},
{
"value": 4,
"name": "hr.lproj",
"path": "CoreServices/SystemVersion.bundle/hr.lproj"
},
{
"value": 4,
"name": "hu.lproj",
"path": "CoreServices/SystemVersion.bundle/hu.lproj"
},
{
"value": 4,
"name": "id.lproj",
"path": "CoreServices/SystemVersion.bundle/id.lproj"
},
{
"value": 4,
"name": "Italian.lproj",
"path": "CoreServices/SystemVersion.bundle/Italian.lproj"
},
{
"value": 4,
"name": "Japanese.lproj",
"path": "CoreServices/SystemVersion.bundle/Japanese.lproj"
},
{
"value": 4,
"name": "ko.lproj",
"path": "CoreServices/SystemVersion.bundle/ko.lproj"
},
{
"value": 4,
"name": "ms.lproj",
"path": "CoreServices/SystemVersion.bundle/ms.lproj"
},
{
"value": 4,
"name": "no.lproj",
"path": "CoreServices/SystemVersion.bundle/no.lproj"
},
{
"value": 4,
"name": "pl.lproj",
"path": "CoreServices/SystemVersion.bundle/pl.lproj"
},
{
"value": 4,
"name": "pt.lproj",
"path": "CoreServices/SystemVersion.bundle/pt.lproj"
},
{
"value": 4,
"name": "pt_PT.lproj",
"path": "CoreServices/SystemVersion.bundle/pt_PT.lproj"
},
{
"value": 4,
"name": "ro.lproj",
"path": "CoreServices/SystemVersion.bundle/ro.lproj"
},
{
"value": 4,
"name": "ru.lproj",
"path": "CoreServices/SystemVersion.bundle/ru.lproj"
},
{
"value": 4,
"name": "sk.lproj",
"path": "CoreServices/SystemVersion.bundle/sk.lproj"
},
{
"value": 4,
"name": "Spanish.lproj",
"path": "CoreServices/SystemVersion.bundle/Spanish.lproj"
},
{
"value": 4,
"name": "sv.lproj",
"path": "CoreServices/SystemVersion.bundle/sv.lproj"
},
{
"value": 4,
"name": "th.lproj",
"path": "CoreServices/SystemVersion.bundle/th.lproj"
},
{
"value": 4,
"name": "tr.lproj",
"path": "CoreServices/SystemVersion.bundle/tr.lproj"
},
{
"value": 4,
"name": "uk.lproj",
"path": "CoreServices/SystemVersion.bundle/uk.lproj"
},
{
"value": 4,
"name": "vi.lproj",
"path": "CoreServices/SystemVersion.bundle/vi.lproj"
},
{
"value": 4,
"name": "zh_CN.lproj",
"path": "CoreServices/SystemVersion.bundle/zh_CN.lproj"
},
{
"value": 4,
"name": "zh_TW.lproj",
"path": "CoreServices/SystemVersion.bundle/zh_TW.lproj"
}
]
},
{
"value": 3148,
"name": "TicketViewer.app",
"path": "CoreServices/TicketViewer.app",
"children": [
{
"value": 3148,
"name": "Contents",
"path": "CoreServices/TicketViewer.app/Contents"
}
]
},
{
"value": 532,
"name": "TypographyPanel.bundle",
"path": "CoreServices/TypographyPanel.bundle",
"children": [
{
"value": 532,
"name": "Contents",
"path": "CoreServices/TypographyPanel.bundle/Contents"
}
]
},
{
"value": 676,
"name": "UniversalAccessControl.app",
"path": "CoreServices/UniversalAccessControl.app",
"children": [
{
"value": 676,
"name": "Contents",
"path": "CoreServices/UniversalAccessControl.app/Contents"
}
]
},
{
"value": 52,
"name": "UnmountAssistantAgent.app",
"path": "CoreServices/UnmountAssistantAgent.app",
"children": [
{
"value": 52,
"name": "Contents",
"path": "CoreServices/UnmountAssistantAgent.app/Contents"
}
]
},
{
"value": 60,
"name": "UserNotificationCenter.app",
"path": "CoreServices/UserNotificationCenter.app",
"children": [
{
"value": 60,
"name": "Contents",
"path": "CoreServices/UserNotificationCenter.app/Contents"
}
]
},
{
"value": 456,
"name": "VoiceOver.app",
"path": "CoreServices/VoiceOver.app",
"children": [
{
"value": 456,
"name": "Contents",
"path": "CoreServices/VoiceOver.app/Contents"
}
]
},
{
"value": 44,
"name": "XsanManagerDaemon.bundle",
"path": "CoreServices/XsanManagerDaemon.bundle",
"children": [
{
"value": 44,
"name": "Contents",
"path": "CoreServices/XsanManagerDaemon.bundle/Contents"
}
]
},
{
"value": 844,
"name": "ZoomWindow.app",
"path": "CoreServices/ZoomWindow.app",
"children": [
{
"value": 844,
"name": "Contents",
"path": "CoreServices/ZoomWindow.app/Contents"
}
]
}
]
},
{
"value": 72,
"name": "DirectoryServices",
"path": "DirectoryServices",
"children": [
{
"value": 0,
"name": "DefaultLocalDB",
"path": "DirectoryServices/DefaultLocalDB"
},
{
"value": 72,
"name": "dscl",
"path": "DirectoryServices/dscl",
"children": [
{
"value": 44,
"name": "mcxcl.dsclext",
"path": "DirectoryServices/dscl/mcxcl.dsclext"
},
{
"value": 28,
"name": "mcxProfiles.dsclext",
"path": "DirectoryServices/dscl/mcxProfiles.dsclext"
}
]
},
{
"value": 0,
"name": "Templates",
"path": "DirectoryServices/Templates",
"children": [
{
"value": 0,
"name": "LDAPv3",
"path": "DirectoryServices/Templates/LDAPv3"
}
]
}
]
},
{
"value": 0,
"name": "Displays",
"path": "Displays",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "Displays/_CodeSignature"
},
{
"value": 0,
"name": "Overrides",
"path": "Displays/Overrides",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Displays/Overrides/Contents"
},
{
"value": 0,
"name": "DisplayVendorID-11a9",
"path": "Displays/Overrides/DisplayVendorID-11a9"
},
{
"value": 0,
"name": "DisplayVendorID-2283",
"path": "Displays/Overrides/DisplayVendorID-2283"
},
{
"value": 0,
"name": "DisplayVendorID-34a9",
"path": "Displays/Overrides/DisplayVendorID-34a9"
},
{
"value": 0,
"name": "DisplayVendorID-38a3",
"path": "Displays/Overrides/DisplayVendorID-38a3"
},
{
"value": 0,
"name": "DisplayVendorID-4c2d",
"path": "Displays/Overrides/DisplayVendorID-4c2d"
},
{
"value": 0,
"name": "DisplayVendorID-4dd9",
"path": "Displays/Overrides/DisplayVendorID-4dd9"
},
{
"value": 0,
"name": "DisplayVendorID-5a63",
"path": "Displays/Overrides/DisplayVendorID-5a63"
},
{
"value": 0,
"name": "DisplayVendorID-5b4",
"path": "Displays/Overrides/DisplayVendorID-5b4"
},
{
"value": 0,
"name": "DisplayVendorID-610",
"path": "Displays/Overrides/DisplayVendorID-610"
},
{
"value": 0,
"name": "DisplayVendorID-756e6b6e",
"path": "Displays/Overrides/DisplayVendorID-756e6b6e"
},
{
"value": 0,
"name": "DisplayVendorID-daf",
"path": "Displays/Overrides/DisplayVendorID-daf"
}
]
}
]
},
{
"value": 16,
"name": "DTDs",
"path": "DTDs"
},
{
"value": 400116,
"name": "Extensions",
"path": "Extensions",
"children": [
{
"value": 0,
"name": "10.5",
"path": "Extensions/10.5"
},
{
"value": 0,
"name": "10.6",
"path": "Extensions/10.6"
},
{
"value": 116,
"name": "Accusys6xxxx.kext",
"path": "Extensions/Accusys6xxxx.kext",
"children": [
{
"value": 116,
"name": "Contents",
"path": "Extensions/Accusys6xxxx.kext/Contents"
}
]
},
{
"value": 1236,
"name": "acfs.kext",
"path": "Extensions/acfs.kext",
"children": [
{
"value": 1236,
"name": "Contents",
"path": "Extensions/acfs.kext/Contents"
}
]
},
{
"value": 32,
"name": "acfsctl.kext",
"path": "Extensions/acfsctl.kext",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Extensions/acfsctl.kext/Contents"
}
]
},
{
"value": 196,
"name": "ALF.kext",
"path": "Extensions/ALF.kext",
"children": [
{
"value": 196,
"name": "Contents",
"path": "Extensions/ALF.kext/Contents"
}
]
},
{
"value": 1836,
"name": "AMD2400Controller.kext",
"path": "Extensions/AMD2400Controller.kext",
"children": [
{
"value": 1836,
"name": "Contents",
"path": "Extensions/AMD2400Controller.kext/Contents"
}
]
},
{
"value": 1840,
"name": "AMD2600Controller.kext",
"path": "Extensions/AMD2600Controller.kext",
"children": [
{
"value": 1840,
"name": "Contents",
"path": "Extensions/AMD2600Controller.kext/Contents"
}
]
},
{
"value": 1848,
"name": "AMD3800Controller.kext",
"path": "Extensions/AMD3800Controller.kext",
"children": [
{
"value": 1848,
"name": "Contents",
"path": "Extensions/AMD3800Controller.kext/Contents"
}
]
},
{
"value": 1828,
"name": "AMD4600Controller.kext",
"path": "Extensions/AMD4600Controller.kext",
"children": [
{
"value": 1828,
"name": "Contents",
"path": "Extensions/AMD4600Controller.kext/Contents"
}
]
},
{
"value": 1820,
"name": "AMD4800Controller.kext",
"path": "Extensions/AMD4800Controller.kext",
"children": [
{
"value": 1820,
"name": "Contents",
"path": "Extensions/AMD4800Controller.kext/Contents"
}
]
},
{
"value": 2268,
"name": "AMD5000Controller.kext",
"path": "Extensions/AMD5000Controller.kext",
"children": [
{
"value": 2268,
"name": "Contents",
"path": "Extensions/AMD5000Controller.kext/Contents"
}
]
},
{
"value": 2292,
"name": "AMD6000Controller.kext",
"path": "Extensions/AMD6000Controller.kext",
"children": [
{
"value": 2292,
"name": "Contents",
"path": "Extensions/AMD6000Controller.kext/Contents"
}
]
},
{
"value": 2316,
"name": "AMD7000Controller.kext",
"path": "Extensions/AMD7000Controller.kext",
"children": [
{
"value": 2316,
"name": "Contents",
"path": "Extensions/AMD7000Controller.kext/Contents"
}
]
},
{
"value": 164,
"name": "AMDFramebuffer.kext",
"path": "Extensions/AMDFramebuffer.kext",
"children": [
{
"value": 164,
"name": "Contents",
"path": "Extensions/AMDFramebuffer.kext/Contents"
}
]
},
{
"value": 1572,
"name": "AMDRadeonVADriver.bundle",
"path": "Extensions/AMDRadeonVADriver.bundle",
"children": [
{
"value": 1572,
"name": "Contents",
"path": "Extensions/AMDRadeonVADriver.bundle/Contents"
}
]
},
{
"value": 4756,
"name": "AMDRadeonX3000.kext",
"path": "Extensions/AMDRadeonX3000.kext",
"children": [
{
"value": 4756,
"name": "Contents",
"path": "Extensions/AMDRadeonX3000.kext/Contents"
}
]
},
{
"value": 11224,
"name": "AMDRadeonX3000GLDriver.bundle",
"path": "Extensions/AMDRadeonX3000GLDriver.bundle",
"children": [
{
"value": 11224,
"name": "Contents",
"path": "Extensions/AMDRadeonX3000GLDriver.bundle/Contents"
}
]
},
{
"value": 4532,
"name": "AMDRadeonX4000.kext",
"path": "Extensions/AMDRadeonX4000.kext",
"children": [
{
"value": 4532,
"name": "Contents",
"path": "Extensions/AMDRadeonX4000.kext/Contents"
}
]
},
{
"value": 17144,
"name": "AMDRadeonX4000GLDriver.bundle",
"path": "Extensions/AMDRadeonX4000GLDriver.bundle",
"children": [
{
"value": 17144,
"name": "Contents",
"path": "Extensions/AMDRadeonX4000GLDriver.bundle/Contents"
}
]
},
{
"value": 544,
"name": "AMDSupport.kext",
"path": "Extensions/AMDSupport.kext",
"children": [
{
"value": 544,
"name": "Contents",
"path": "Extensions/AMDSupport.kext/Contents"
}
]
},
{
"value": 148,
"name": "Apple16X50Serial.kext",
"path": "Extensions/Apple16X50Serial.kext",
"children": [
{
"value": 148,
"name": "Contents",
"path": "Extensions/Apple16X50Serial.kext/Contents"
}
]
},
{
"value": 60,
"name": "Apple_iSight.kext",
"path": "Extensions/Apple_iSight.kext",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Extensions/Apple_iSight.kext/Contents"
}
]
},
{
"value": 596,
"name": "AppleACPIPlatform.kext",
"path": "Extensions/AppleACPIPlatform.kext",
"children": [
{
"value": 596,
"name": "Contents",
"path": "Extensions/AppleACPIPlatform.kext/Contents"
}
]
},
{
"value": 208,
"name": "AppleAHCIPort.kext",
"path": "Extensions/AppleAHCIPort.kext",
"children": [
{
"value": 208,
"name": "Contents",
"path": "Extensions/AppleAHCIPort.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleAPIC.kext",
"path": "Extensions/AppleAPIC.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/AppleAPIC.kext/Contents"
}
]
},
{
"value": 84,
"name": "AppleBacklight.kext",
"path": "Extensions/AppleBacklight.kext",
"children": [
{
"value": 84,
"name": "Contents",
"path": "Extensions/AppleBacklight.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleBacklightExpert.kext",
"path": "Extensions/AppleBacklightExpert.kext",
"children": [
{
"value": 4,
"name": "_CodeSignature",
"path": "Extensions/AppleBacklightExpert.kext/_CodeSignature"
}
]
},
{
"value": 180,
"name": "AppleBluetoothMultitouch.kext",
"path": "Extensions/AppleBluetoothMultitouch.kext",
"children": [
{
"value": 180,
"name": "Contents",
"path": "Extensions/AppleBluetoothMultitouch.kext/Contents"
}
]
},
{
"value": 80,
"name": "AppleBMC.kext",
"path": "Extensions/AppleBMC.kext",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Extensions/AppleBMC.kext/Contents"
}
]
},
{
"value": 152,
"name": "AppleCameraInterface.kext",
"path": "Extensions/AppleCameraInterface.kext",
"children": [
{
"value": 152,
"name": "Contents",
"path": "Extensions/AppleCameraInterface.kext/Contents"
}
]
},
{
"value": 152,
"name": "AppleEFIRuntime.kext",
"path": "Extensions/AppleEFIRuntime.kext",
"children": [
{
"value": 152,
"name": "Contents",
"path": "Extensions/AppleEFIRuntime.kext/Contents"
}
]
},
{
"value": 88,
"name": "AppleFDEKeyStore.kext",
"path": "Extensions/AppleFDEKeyStore.kext",
"children": [
{
"value": 88,
"name": "Contents",
"path": "Extensions/AppleFDEKeyStore.kext/Contents"
}
]
},
{
"value": 48,
"name": "AppleFileSystemDriver.kext",
"path": "Extensions/AppleFileSystemDriver.kext",
"children": [
{
"value": 48,
"name": "Contents",
"path": "Extensions/AppleFileSystemDriver.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleFSCompressionTypeDataless.kext",
"path": "Extensions/AppleFSCompressionTypeDataless.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/AppleFSCompressionTypeDataless.kext/Contents"
}
]
},
{
"value": 60,
"name": "AppleFSCompressionTypeZlib.kext",
"path": "Extensions/AppleFSCompressionTypeZlib.kext",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Extensions/AppleFSCompressionTypeZlib.kext/Contents"
}
]
},
{
"value": 628,
"name": "AppleFWAudio.kext",
"path": "Extensions/AppleFWAudio.kext",
"children": [
{
"value": 628,
"name": "Contents",
"path": "Extensions/AppleFWAudio.kext/Contents"
}
]
},
{
"value": 396,
"name": "AppleGraphicsControl.kext",
"path": "Extensions/AppleGraphicsControl.kext",
"children": [
{
"value": 396,
"name": "Contents",
"path": "Extensions/AppleGraphicsControl.kext/Contents"
}
]
},
{
"value": 276,
"name": "AppleGraphicsPowerManagement.kext",
"path": "Extensions/AppleGraphicsPowerManagement.kext",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Extensions/AppleGraphicsPowerManagement.kext/Contents"
}
]
},
{
"value": 3112,
"name": "AppleHDA.kext",
"path": "Extensions/AppleHDA.kext",
"children": [
{
"value": 3112,
"name": "Contents",
"path": "Extensions/AppleHDA.kext/Contents"
}
]
},
{
"value": 488,
"name": "AppleHIDKeyboard.kext",
"path": "Extensions/AppleHIDKeyboard.kext",
"children": [
{
"value": 488,
"name": "Contents",
"path": "Extensions/AppleHIDKeyboard.kext/Contents"
}
]
},
{
"value": 184,
"name": "AppleHIDMouse.kext",
"path": "Extensions/AppleHIDMouse.kext",
"children": [
{
"value": 184,
"name": "Contents",
"path": "Extensions/AppleHIDMouse.kext/Contents"
}
]
},
{
"value": 52,
"name": "AppleHPET.kext",
"path": "Extensions/AppleHPET.kext",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Extensions/AppleHPET.kext/Contents"
}
]
},
{
"value": 64,
"name": "AppleHSSPIHIDDriver.kext",
"path": "Extensions/AppleHSSPIHIDDriver.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/AppleHSSPIHIDDriver.kext/Contents"
}
]
},
{
"value": 144,
"name": "AppleHSSPISupport.kext",
"path": "Extensions/AppleHSSPISupport.kext",
"children": [
{
"value": 144,
"name": "Contents",
"path": "Extensions/AppleHSSPISupport.kext/Contents"
}
]
},
{
"value": 64,
"name": "AppleHWAccess.kext",
"path": "Extensions/AppleHWAccess.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/AppleHWAccess.kext/Contents"
}
]
},
{
"value": 72,
"name": "AppleHWSensor.kext",
"path": "Extensions/AppleHWSensor.kext",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Extensions/AppleHWSensor.kext/Contents"
}
]
},
{
"value": 244,
"name": "AppleIntelCPUPowerManagement.kext",
"path": "Extensions/AppleIntelCPUPowerManagement.kext",
"children": [
{
"value": 244,
"name": "Contents",
"path": "Extensions/AppleIntelCPUPowerManagement.kext/Contents"
}
]
},
{
"value": 52,
"name": "AppleIntelCPUPowerManagementClient.kext",
"path": "Extensions/AppleIntelCPUPowerManagementClient.kext",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Extensions/AppleIntelCPUPowerManagementClient.kext/Contents"
}
]
},
{
"value": 480,
"name": "AppleIntelFramebufferAzul.kext",
"path": "Extensions/AppleIntelFramebufferAzul.kext",
"children": [
{
"value": 480,
"name": "Contents",
"path": "Extensions/AppleIntelFramebufferAzul.kext/Contents"
}
]
},
{
"value": 492,
"name": "AppleIntelFramebufferCapri.kext",
"path": "Extensions/AppleIntelFramebufferCapri.kext",
"children": [
{
"value": 492,
"name": "Contents",
"path": "Extensions/AppleIntelFramebufferCapri.kext/Contents"
}
]
},
{
"value": 604,
"name": "AppleIntelHD3000Graphics.kext",
"path": "Extensions/AppleIntelHD3000Graphics.kext",
"children": [
{
"value": 604,
"name": "Contents",
"path": "Extensions/AppleIntelHD3000Graphics.kext/Contents"
}
]
},
{
"value": 64,
"name": "AppleIntelHD3000GraphicsGA.plugin",
"path": "Extensions/AppleIntelHD3000GraphicsGA.plugin",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/AppleIntelHD3000GraphicsGA.plugin/Contents"
}
]
},
{
"value": 9164,
"name": "AppleIntelHD3000GraphicsGLDriver.bundle",
"path": "Extensions/AppleIntelHD3000GraphicsGLDriver.bundle",
"children": [
{
"value": 9164,
"name": "Contents",
"path": "Extensions/AppleIntelHD3000GraphicsGLDriver.bundle/Contents"
}
]
},
{
"value": 2520,
"name": "AppleIntelHD3000GraphicsVADriver.bundle",
"path": "Extensions/AppleIntelHD3000GraphicsVADriver.bundle",
"children": [
{
"value": 2520,
"name": "Contents",
"path": "Extensions/AppleIntelHD3000GraphicsVADriver.bundle/Contents"
}
]
},
{
"value": 536,
"name": "AppleIntelHD4000Graphics.kext",
"path": "Extensions/AppleIntelHD4000Graphics.kext",
"children": [
{
"value": 536,
"name": "Contents",
"path": "Extensions/AppleIntelHD4000Graphics.kext/Contents"
}
]
},
{
"value": 22996,
"name": "AppleIntelHD4000GraphicsGLDriver.bundle",
"path": "Extensions/AppleIntelHD4000GraphicsGLDriver.bundle",
"children": [
{
"value": 22996,
"name": "Contents",
"path": "Extensions/AppleIntelHD4000GraphicsGLDriver.bundle/Contents"
}
]
},
{
"value": 3608,
"name": "AppleIntelHD4000GraphicsVADriver.bundle",
"path": "Extensions/AppleIntelHD4000GraphicsVADriver.bundle",
"children": [
{
"value": 3608,
"name": "Contents",
"path": "Extensions/AppleIntelHD4000GraphicsVADriver.bundle/Contents"
}
]
},
{
"value": 564,
"name": "AppleIntelHD5000Graphics.kext",
"path": "Extensions/AppleIntelHD5000Graphics.kext",
"children": [
{
"value": 564,
"name": "Contents",
"path": "Extensions/AppleIntelHD5000Graphics.kext/Contents"
}
]
},
{
"value": 20692,
"name": "AppleIntelHD5000GraphicsGLDriver.bundle",
"path": "Extensions/AppleIntelHD5000GraphicsGLDriver.bundle",
"children": [
{
"value": 20692,
"name": "Contents",
"path": "Extensions/AppleIntelHD5000GraphicsGLDriver.bundle/Contents"
}
]
},
{
"value": 6120,
"name": "AppleIntelHD5000GraphicsVADriver.bundle",
"path": "Extensions/AppleIntelHD5000GraphicsVADriver.bundle",
"children": [
{
"value": 6120,
"name": "Contents",
"path": "Extensions/AppleIntelHD5000GraphicsVADriver.bundle/Contents"
}
]
},
{
"value": 976,
"name": "AppleIntelHDGraphics.kext",
"path": "Extensions/AppleIntelHDGraphics.kext",
"children": [
{
"value": 976,
"name": "Contents",
"path": "Extensions/AppleIntelHDGraphics.kext/Contents"
}
]
},
{
"value": 148,
"name": "AppleIntelHDGraphicsFB.kext",
"path": "Extensions/AppleIntelHDGraphicsFB.kext",
"children": [
{
"value": 148,
"name": "Contents",
"path": "Extensions/AppleIntelHDGraphicsFB.kext/Contents"
}
]
},
{
"value": 64,
"name": "AppleIntelHDGraphicsGA.plugin",
"path": "Extensions/AppleIntelHDGraphicsGA.plugin",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/AppleIntelHDGraphicsGA.plugin/Contents"
}
]
},
{
"value": 9108,
"name": "AppleIntelHDGraphicsGLDriver.bundle",
"path": "Extensions/AppleIntelHDGraphicsGLDriver.bundle",
"children": [
{
"value": 9108,
"name": "Contents",
"path": "Extensions/AppleIntelHDGraphicsGLDriver.bundle/Contents"
}
]
},
{
"value": 104,
"name": "AppleIntelHDGraphicsVADriver.bundle",
"path": "Extensions/AppleIntelHDGraphicsVADriver.bundle",
"children": [
{
"value": 104,
"name": "Contents",
"path": "Extensions/AppleIntelHDGraphicsVADriver.bundle/Contents"
}
]
},
{
"value": 96,
"name": "AppleIntelHSWVA.bundle",
"path": "Extensions/AppleIntelHSWVA.bundle",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Extensions/AppleIntelHSWVA.bundle/Contents"
}
]
},
{
"value": 96,
"name": "AppleIntelIVBVA.bundle",
"path": "Extensions/AppleIntelIVBVA.bundle",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Extensions/AppleIntelIVBVA.bundle/Contents"
}
]
},
{
"value": 72,
"name": "AppleIntelLpssDmac.kext",
"path": "Extensions/AppleIntelLpssDmac.kext",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Extensions/AppleIntelLpssDmac.kext/Contents"
}
]
},
{
"value": 76,
"name": "AppleIntelLpssGspi.kext",
"path": "Extensions/AppleIntelLpssGspi.kext",
"children": [
{
"value": 76,
"name": "Contents",
"path": "Extensions/AppleIntelLpssGspi.kext/Contents"
}
]
},
{
"value": 132,
"name": "AppleIntelLpssSpiController.kext",
"path": "Extensions/AppleIntelLpssSpiController.kext",
"children": [
{
"value": 132,
"name": "Contents",
"path": "Extensions/AppleIntelLpssSpiController.kext/Contents"
}
]
},
{
"value": 308,
"name": "AppleIntelSNBGraphicsFB.kext",
"path": "Extensions/AppleIntelSNBGraphicsFB.kext",
"children": [
{
"value": 308,
"name": "Contents",
"path": "Extensions/AppleIntelSNBGraphicsFB.kext/Contents"
}
]
},
{
"value": 144,
"name": "AppleIntelSNBVA.bundle",
"path": "Extensions/AppleIntelSNBVA.bundle",
"children": [
{
"value": 144,
"name": "Contents",
"path": "Extensions/AppleIntelSNBVA.bundle/Contents"
}
]
},
{
"value": 72,
"name": "AppleIRController.kext",
"path": "Extensions/AppleIRController.kext",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Extensions/AppleIRController.kext/Contents"
}
]
},
{
"value": 208,
"name": "AppleKextExcludeList.kext",
"path": "Extensions/AppleKextExcludeList.kext",
"children": [
{
"value": 208,
"name": "Contents",
"path": "Extensions/AppleKextExcludeList.kext/Contents"
}
]
},
{
"value": 120,
"name": "AppleKeyStore.kext",
"path": "Extensions/AppleKeyStore.kext",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Extensions/AppleKeyStore.kext/Contents"
}
]
},
{
"value": 48,
"name": "AppleKeyswitch.kext",
"path": "Extensions/AppleKeyswitch.kext",
"children": [
{
"value": 48,
"name": "Contents",
"path": "Extensions/AppleKeyswitch.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleLPC.kext",
"path": "Extensions/AppleLPC.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/AppleLPC.kext/Contents"
}
]
},
{
"value": 188,
"name": "AppleLSIFusionMPT.kext",
"path": "Extensions/AppleLSIFusionMPT.kext",
"children": [
{
"value": 188,
"name": "Contents",
"path": "Extensions/AppleLSIFusionMPT.kext/Contents"
}
]
},
{
"value": 36,
"name": "AppleMatch.kext",
"path": "Extensions/AppleMatch.kext",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Extensions/AppleMatch.kext/Contents"
}
]
},
{
"value": 140,
"name": "AppleMCCSControl.kext",
"path": "Extensions/AppleMCCSControl.kext",
"children": [
{
"value": 140,
"name": "Contents",
"path": "Extensions/AppleMCCSControl.kext/Contents"
}
]
},
{
"value": 64,
"name": "AppleMCEDriver.kext",
"path": "Extensions/AppleMCEDriver.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/AppleMCEDriver.kext/Contents"
}
]
},
{
"value": 76,
"name": "AppleMCP89RootPortPM.kext",
"path": "Extensions/AppleMCP89RootPortPM.kext",
"children": [
{
"value": 76,
"name": "Contents",
"path": "Extensions/AppleMCP89RootPortPM.kext/Contents"
}
]
},
{
"value": 156,
"name": "AppleMIDIFWDriver.plugin",
"path": "Extensions/AppleMIDIFWDriver.plugin",
"children": [
{
"value": 156,
"name": "Contents",
"path": "Extensions/AppleMIDIFWDriver.plugin/Contents"
}
]
},
{
"value": 236,
"name": "AppleMIDIIACDriver.plugin",
"path": "Extensions/AppleMIDIIACDriver.plugin",
"children": [
{
"value": 236,
"name": "Contents",
"path": "Extensions/AppleMIDIIACDriver.plugin/Contents"
}
]
},
{
"value": 416,
"name": "AppleMIDIRTPDriver.plugin",
"path": "Extensions/AppleMIDIRTPDriver.plugin",
"children": [
{
"value": 416,
"name": "Contents",
"path": "Extensions/AppleMIDIRTPDriver.plugin/Contents"
}
]
},
{
"value": 248,
"name": "AppleMIDIUSBDriver.plugin",
"path": "Extensions/AppleMIDIUSBDriver.plugin",
"children": [
{
"value": 248,
"name": "Contents",
"path": "Extensions/AppleMIDIUSBDriver.plugin/Contents"
}
]
},
{
"value": 68,
"name": "AppleMikeyHIDDriver.kext",
"path": "Extensions/AppleMikeyHIDDriver.kext",
"children": [
{
"value": 68,
"name": "Contents",
"path": "Extensions/AppleMikeyHIDDriver.kext/Contents"
}
]
},
{
"value": 28,
"name": "AppleMobileDevice.kext",
"path": "Extensions/AppleMobileDevice.kext",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Extensions/AppleMobileDevice.kext/Contents"
}
]
},
{
"value": 860,
"name": "AppleMultitouchDriver.kext",
"path": "Extensions/AppleMultitouchDriver.kext",
"children": [
{
"value": 860,
"name": "Contents",
"path": "Extensions/AppleMultitouchDriver.kext/Contents"
}
]
},
{
"value": 136,
"name": "ApplePlatformEnabler.kext",
"path": "Extensions/ApplePlatformEnabler.kext",
"children": [
{
"value": 136,
"name": "Contents",
"path": "Extensions/ApplePlatformEnabler.kext/Contents"
}
]
},
{
"value": 240,
"name": "AppleRAID.kext",
"path": "Extensions/AppleRAID.kext",
"children": [
{
"value": 240,
"name": "Contents",
"path": "Extensions/AppleRAID.kext/Contents"
}
]
},
{
"value": 372,
"name": "AppleRAIDCard.kext",
"path": "Extensions/AppleRAIDCard.kext",
"children": [
{
"value": 372,
"name": "Contents",
"path": "Extensions/AppleRAIDCard.kext/Contents"
}
]
},
{
"value": 80,
"name": "AppleRTC.kext",
"path": "Extensions/AppleRTC.kext",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Extensions/AppleRTC.kext/Contents"
}
]
},
{
"value": 148,
"name": "AppleSDXC.kext",
"path": "Extensions/AppleSDXC.kext",
"children": [
{
"value": 148,
"name": "Contents",
"path": "Extensions/AppleSDXC.kext/Contents"
}
]
},
{
"value": 76,
"name": "AppleSEP.kext",
"path": "Extensions/AppleSEP.kext",
"children": [
{
"value": 76,
"name": "Contents",
"path": "Extensions/AppleSEP.kext/Contents"
}
]
},
{
"value": 88,
"name": "AppleSmartBatteryManager.kext",
"path": "Extensions/AppleSmartBatteryManager.kext",
"children": [
{
"value": 88,
"name": "Contents",
"path": "Extensions/AppleSmartBatteryManager.kext/Contents"
}
]
},
{
"value": 60,
"name": "AppleSMBIOS.kext",
"path": "Extensions/AppleSMBIOS.kext",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Extensions/AppleSMBIOS.kext/Contents"
}
]
},
{
"value": 116,
"name": "AppleSMBusController.kext",
"path": "Extensions/AppleSMBusController.kext",
"children": [
{
"value": 116,
"name": "Contents",
"path": "Extensions/AppleSMBusController.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleSMBusPCI.kext",
"path": "Extensions/AppleSMBusPCI.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/AppleSMBusPCI.kext/Contents"
}
]
},
{
"value": 120,
"name": "AppleSMC.kext",
"path": "Extensions/AppleSMC.kext",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Extensions/AppleSMC.kext/Contents"
}
]
},
{
"value": 172,
"name": "AppleSMCLMU.kext",
"path": "Extensions/AppleSMCLMU.kext",
"children": [
{
"value": 172,
"name": "Contents",
"path": "Extensions/AppleSMCLMU.kext/Contents"
}
]
},
{
"value": 88,
"name": "AppleSRP.kext",
"path": "Extensions/AppleSRP.kext",
"children": [
{
"value": 88,
"name": "Contents",
"path": "Extensions/AppleSRP.kext/Contents"
}
]
},
{
"value": 1936,
"name": "AppleStorageDrivers.kext",
"path": "Extensions/AppleStorageDrivers.kext",
"children": [
{
"value": 1936,
"name": "Contents",
"path": "Extensions/AppleStorageDrivers.kext/Contents"
}
]
},
{
"value": 264,
"name": "AppleThunderboltDPAdapters.kext",
"path": "Extensions/AppleThunderboltDPAdapters.kext",
"children": [
{
"value": 264,
"name": "Contents",
"path": "Extensions/AppleThunderboltDPAdapters.kext/Contents"
}
]
},
{
"value": 204,
"name": "AppleThunderboltEDMService.kext",
"path": "Extensions/AppleThunderboltEDMService.kext",
"children": [
{
"value": 204,
"name": "Contents",
"path": "Extensions/AppleThunderboltEDMService.kext/Contents"
}
]
},
{
"value": 216,
"name": "AppleThunderboltIP.kext",
"path": "Extensions/AppleThunderboltIP.kext",
"children": [
{
"value": 216,
"name": "Contents",
"path": "Extensions/AppleThunderboltIP.kext/Contents"
}
]
},
{
"value": 168,
"name": "AppleThunderboltNHI.kext",
"path": "Extensions/AppleThunderboltNHI.kext",
"children": [
{
"value": 168,
"name": "Contents",
"path": "Extensions/AppleThunderboltNHI.kext/Contents"
}
]
},
{
"value": 172,
"name": "AppleThunderboltPCIAdapters.kext",
"path": "Extensions/AppleThunderboltPCIAdapters.kext",
"children": [
{
"value": 172,
"name": "Contents",
"path": "Extensions/AppleThunderboltPCIAdapters.kext/Contents"
}
]
},
{
"value": 164,
"name": "AppleThunderboltUTDM.kext",
"path": "Extensions/AppleThunderboltUTDM.kext",
"children": [
{
"value": 164,
"name": "Contents",
"path": "Extensions/AppleThunderboltUTDM.kext/Contents"
}
]
},
{
"value": 188,
"name": "AppleTopCase.kext",
"path": "Extensions/AppleTopCase.kext",
"children": [
{
"value": 188,
"name": "Contents",<|fim▁hole|> ]
},
{
"value": 92,
"name": "AppleTyMCEDriver.kext",
"path": "Extensions/AppleTyMCEDriver.kext",
"children": [
{
"value": 92,
"name": "Contents",
"path": "Extensions/AppleTyMCEDriver.kext/Contents"
}
]
},
{
"value": 72,
"name": "AppleUpstreamUserClient.kext",
"path": "Extensions/AppleUpstreamUserClient.kext",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Extensions/AppleUpstreamUserClient.kext/Contents"
}
]
},
{
"value": 408,
"name": "AppleUSBAudio.kext",
"path": "Extensions/AppleUSBAudio.kext",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Extensions/AppleUSBAudio.kext/Contents"
}
]
},
{
"value": 76,
"name": "AppleUSBDisplays.kext",
"path": "Extensions/AppleUSBDisplays.kext",
"children": [
{
"value": 76,
"name": "Contents",
"path": "Extensions/AppleUSBDisplays.kext/Contents"
}
]
},
{
"value": 144,
"name": "AppleUSBEthernetHost.kext",
"path": "Extensions/AppleUSBEthernetHost.kext",
"children": [
{
"value": 144,
"name": "Contents",
"path": "Extensions/AppleUSBEthernetHost.kext/Contents"
}
]
},
{
"value": 160,
"name": "AppleUSBMultitouch.kext",
"path": "Extensions/AppleUSBMultitouch.kext",
"children": [
{
"value": 160,
"name": "Contents",
"path": "Extensions/AppleUSBMultitouch.kext/Contents"
}
]
},
{
"value": 728,
"name": "AppleUSBTopCase.kext",
"path": "Extensions/AppleUSBTopCase.kext",
"children": [
{
"value": 728,
"name": "Contents",
"path": "Extensions/AppleUSBTopCase.kext/Contents"
}
]
},
{
"value": 3576,
"name": "AppleVADriver.bundle",
"path": "Extensions/AppleVADriver.bundle",
"children": [
{
"value": 3576,
"name": "Contents",
"path": "Extensions/AppleVADriver.bundle/Contents"
}
]
},
{
"value": 60,
"name": "AppleWWANAutoEject.kext",
"path": "Extensions/AppleWWANAutoEject.kext",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Extensions/AppleWWANAutoEject.kext/Contents"
}
]
},
{
"value": 56,
"name": "AppleXsanFilter.kext",
"path": "Extensions/AppleXsanFilter.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/AppleXsanFilter.kext/Contents"
}
]
},
{
"value": 2976,
"name": "ATIRadeonX2000.kext",
"path": "Extensions/ATIRadeonX2000.kext",
"children": [
{
"value": 2976,
"name": "Contents",
"path": "Extensions/ATIRadeonX2000.kext/Contents"
}
]
},
{
"value": 88,
"name": "ATIRadeonX2000GA.plugin",
"path": "Extensions/ATIRadeonX2000GA.plugin",
"children": [
{
"value": 88,
"name": "Contents",
"path": "Extensions/ATIRadeonX2000GA.plugin/Contents"
}
]
},
{
"value": 5808,
"name": "ATIRadeonX2000GLDriver.bundle",
"path": "Extensions/ATIRadeonX2000GLDriver.bundle",
"children": [
{
"value": 5808,
"name": "Contents",
"path": "Extensions/ATIRadeonX2000GLDriver.bundle/Contents"
}
]
},
{
"value": 396,
"name": "ATIRadeonX2000VADriver.bundle",
"path": "Extensions/ATIRadeonX2000VADriver.bundle",
"children": [
{
"value": 396,
"name": "Contents",
"path": "Extensions/ATIRadeonX2000VADriver.bundle/Contents"
}
]
},
{
"value": 496,
"name": "ATTOCelerityFC.kext",
"path": "Extensions/ATTOCelerityFC.kext",
"children": [
{
"value": 496,
"name": "Contents",
"path": "Extensions/ATTOCelerityFC.kext/Contents"
}
]
},
{
"value": 268,
"name": "ATTOExpressPCI4.kext",
"path": "Extensions/ATTOExpressPCI4.kext",
"children": [
{
"value": 268,
"name": "Contents",
"path": "Extensions/ATTOExpressPCI4.kext/Contents"
}
]
},
{
"value": 252,
"name": "ATTOExpressSASHBA.kext",
"path": "Extensions/ATTOExpressSASHBA.kext",
"children": [
{
"value": 252,
"name": "Contents",
"path": "Extensions/ATTOExpressSASHBA.kext/Contents"
}
]
},
{
"value": 388,
"name": "ATTOExpressSASHBA3.kext",
"path": "Extensions/ATTOExpressSASHBA3.kext",
"children": [
{
"value": 388,
"name": "Contents",
"path": "Extensions/ATTOExpressSASHBA3.kext/Contents"
}
]
},
{
"value": 212,
"name": "ATTOExpressSASRAID.kext",
"path": "Extensions/ATTOExpressSASRAID.kext",
"children": [
{
"value": 212,
"name": "Contents",
"path": "Extensions/ATTOExpressSASRAID.kext/Contents"
}
]
},
{
"value": 72,
"name": "AudioAUUC.kext",
"path": "Extensions/AudioAUUC.kext",
"children": [
{
"value": 4,
"name": "_CodeSignature",
"path": "Extensions/AudioAUUC.kext/_CodeSignature"
}
]
},
{
"value": 144,
"name": "autofs.kext",
"path": "Extensions/autofs.kext",
"children": [
{
"value": 144,
"name": "Contents",
"path": "Extensions/autofs.kext/Contents"
}
]
},
{
"value": 80,
"name": "BootCache.kext",
"path": "Extensions/BootCache.kext",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Extensions/BootCache.kext/Contents"
}
]
},
{
"value": 64,
"name": "cd9660.kext",
"path": "Extensions/cd9660.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/cd9660.kext/Contents"
}
]
},
{
"value": 48,
"name": "cddafs.kext",
"path": "Extensions/cddafs.kext",
"children": [
{
"value": 48,
"name": "Contents",
"path": "Extensions/cddafs.kext/Contents"
}
]
},
{
"value": 432,
"name": "CellPhoneHelper.kext",
"path": "Extensions/CellPhoneHelper.kext",
"children": [
{
"value": 432,
"name": "Contents",
"path": "Extensions/CellPhoneHelper.kext/Contents"
}
]
},
{
"value": 0,
"name": "ch34xsigned.kext",
"path": "Extensions/ch34xsigned.kext"
},
{
"value": 308,
"name": "corecrypto.kext",
"path": "Extensions/corecrypto.kext",
"children": [
{
"value": 308,
"name": "Contents",
"path": "Extensions/corecrypto.kext/Contents"
}
]
},
{
"value": 1324,
"name": "CoreStorage.kext",
"path": "Extensions/CoreStorage.kext",
"children": [
{
"value": 1324,
"name": "Contents",
"path": "Extensions/CoreStorage.kext/Contents"
}
]
},
{
"value": 72,
"name": "DontSteal Mac OS X.kext",
"path": "Extensions/DontSteal Mac OS X.kext",
"children": [
{
"value": 68,
"name": "Contents",
"path": "Extensions/DontSteal Mac OS X.kext/Contents"
}
]
},
{
"value": 36,
"name": "DSACL.ppp",
"path": "Extensions/DSACL.ppp",
"children": [
{
"value": 36,
"name": "Contents",
"path": "Extensions/DSACL.ppp/Contents"
}
]
},
{
"value": 40,
"name": "DSAuth.ppp",
"path": "Extensions/DSAuth.ppp",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Extensions/DSAuth.ppp/Contents"
}
]
},
{
"value": 56,
"name": "DVFamily.bundle",
"path": "Extensions/DVFamily.bundle",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/DVFamily.bundle/Contents"
}
]
},
{
"value": 312,
"name": "EAP-KRB.ppp",
"path": "Extensions/EAP-KRB.ppp",
"children": [
{
"value": 312,
"name": "Contents",
"path": "Extensions/EAP-KRB.ppp/Contents"
}
]
},
{
"value": 792,
"name": "EAP-RSA.ppp",
"path": "Extensions/EAP-RSA.ppp",
"children": [
{
"value": 792,
"name": "Contents",
"path": "Extensions/EAP-RSA.ppp/Contents"
}
]
},
{
"value": 308,
"name": "EAP-TLS.ppp",
"path": "Extensions/EAP-TLS.ppp",
"children": [
{
"value": 308,
"name": "Contents",
"path": "Extensions/EAP-TLS.ppp/Contents"
}
]
},
{
"value": 88,
"name": "exfat.kext",
"path": "Extensions/exfat.kext",
"children": [
{
"value": 88,
"name": "Contents",
"path": "Extensions/exfat.kext/Contents"
}
]
},
{
"value": 776,
"name": "GeForce.kext",
"path": "Extensions/GeForce.kext",
"children": [
{
"value": 776,
"name": "Contents",
"path": "Extensions/GeForce.kext/Contents"
}
]
},
{
"value": 160,
"name": "GeForceGA.plugin",
"path": "Extensions/GeForceGA.plugin",
"children": [
{
"value": 160,
"name": "Contents",
"path": "Extensions/GeForceGA.plugin/Contents"
}
]
},
{
"value": 67212,
"name": "GeForceGLDriver.bundle",
"path": "Extensions/GeForceGLDriver.bundle",
"children": [
{
"value": 67212,
"name": "Contents",
"path": "Extensions/GeForceGLDriver.bundle/Contents"
}
]
},
{
"value": 1100,
"name": "GeForceTesla.kext",
"path": "Extensions/GeForceTesla.kext",
"children": [
{
"value": 1100,
"name": "Contents",
"path": "Extensions/GeForceTesla.kext/Contents"
}
]
},
{
"value": 67012,
"name": "GeForceTeslaGLDriver.bundle",
"path": "Extensions/GeForceTeslaGLDriver.bundle",
"children": [
{
"value": 67012,
"name": "Contents",
"path": "Extensions/GeForceTeslaGLDriver.bundle/Contents"
}
]
},
{
"value": 1584,
"name": "GeForceTeslaVADriver.bundle",
"path": "Extensions/GeForceTeslaVADriver.bundle",
"children": [
{
"value": 1584,
"name": "Contents",
"path": "Extensions/GeForceTeslaVADriver.bundle/Contents"
}
]
},
{
"value": 1476,
"name": "GeForceVADriver.bundle",
"path": "Extensions/GeForceVADriver.bundle",
"children": [
{
"value": 1476,
"name": "Contents",
"path": "Extensions/GeForceVADriver.bundle/Contents"
}
]
},
{
"value": 212,
"name": "intelhaxm.kext",
"path": "Extensions/intelhaxm.kext",
"children": [
{
"value": 212,
"name": "Contents",
"path": "Extensions/intelhaxm.kext/Contents"
}
]
},
{
"value": 10488,
"name": "IO80211Family.kext",
"path": "Extensions/IO80211Family.kext",
"children": [
{
"value": 10488,
"name": "Contents",
"path": "Extensions/IO80211Family.kext/Contents"
}
]
},
{
"value": 56,
"name": "IOAccelerator2D.plugin",
"path": "Extensions/IOAccelerator2D.plugin",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/IOAccelerator2D.plugin/Contents"
}
]
},
{
"value": 448,
"name": "IOAcceleratorFamily.kext",
"path": "Extensions/IOAcceleratorFamily.kext",
"children": [
{
"value": 448,
"name": "Contents",
"path": "Extensions/IOAcceleratorFamily.kext/Contents"
}
]
},
{
"value": 508,
"name": "IOAcceleratorFamily2.kext",
"path": "Extensions/IOAcceleratorFamily2.kext",
"children": [
{
"value": 508,
"name": "Contents",
"path": "Extensions/IOAcceleratorFamily2.kext/Contents"
}
]
},
{
"value": 76,
"name": "IOACPIFamily.kext",
"path": "Extensions/IOACPIFamily.kext",
"children": [
{
"value": 76,
"name": "Contents",
"path": "Extensions/IOACPIFamily.kext/Contents"
}
]
},
{
"value": 448,
"name": "IOAHCIFamily.kext",
"path": "Extensions/IOAHCIFamily.kext",
"children": [
{
"value": 448,
"name": "Contents",
"path": "Extensions/IOAHCIFamily.kext/Contents"
}
]
},
{
"value": 872,
"name": "IOATAFamily.kext",
"path": "Extensions/IOATAFamily.kext",
"children": [
{
"value": 872,
"name": "Contents",
"path": "Extensions/IOATAFamily.kext/Contents"
}
]
},
{
"value": 276,
"name": "IOAudioFamily.kext",
"path": "Extensions/IOAudioFamily.kext",
"children": [
{
"value": 276,
"name": "Contents",
"path": "Extensions/IOAudioFamily.kext/Contents"
}
]
},
{
"value": 692,
"name": "IOAVBFamily.kext",
"path": "Extensions/IOAVBFamily.kext",
"children": [
{
"value": 692,
"name": "Contents",
"path": "Extensions/IOAVBFamily.kext/Contents"
}
]
},
{
"value": 4808,
"name": "IOBDStorageFamily.kext",
"path": "Extensions/IOBDStorageFamily.kext",
"children": [
{
"value": 4808,
"name": "Contents",
"path": "Extensions/IOBDStorageFamily.kext/Contents"
}
]
},
{
"value": 4460,
"name": "IOBluetoothFamily.kext",
"path": "Extensions/IOBluetoothFamily.kext",
"children": [
{
"value": 4460,
"name": "Contents",
"path": "Extensions/IOBluetoothFamily.kext/Contents"
}
]
},
{
"value": 260,
"name": "IOBluetoothHIDDriver.kext",
"path": "Extensions/IOBluetoothHIDDriver.kext",
"children": [
{
"value": 260,
"name": "Contents",
"path": "Extensions/IOBluetoothHIDDriver.kext/Contents"
}
]
},
{
"value": 4816,
"name": "IOCDStorageFamily.kext",
"path": "Extensions/IOCDStorageFamily.kext",
"children": [
{
"value": 4816,
"name": "Contents",
"path": "Extensions/IOCDStorageFamily.kext/Contents"
}
]
},
{
"value": 9656,
"name": "IODVDStorageFamily.kext",
"path": "Extensions/IODVDStorageFamily.kext",
"children": [
{
"value": 9656,
"name": "Contents",
"path": "Extensions/IODVDStorageFamily.kext/Contents"
}
]
},
{
"value": 288,
"name": "IOFireWireAVC.kext",
"path": "Extensions/IOFireWireAVC.kext",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Extensions/IOFireWireAVC.kext/Contents"
}
]
},
{
"value": 1424,
"name": "IOFireWireFamily.kext",
"path": "Extensions/IOFireWireFamily.kext",
"children": [
{
"value": 1424,
"name": "Contents",
"path": "Extensions/IOFireWireFamily.kext/Contents"
}
]
},
{
"value": 236,
"name": "IOFireWireIP.kext",
"path": "Extensions/IOFireWireIP.kext",
"children": [
{
"value": 236,
"name": "Contents",
"path": "Extensions/IOFireWireIP.kext/Contents"
}
]
},
{
"value": 288,
"name": "IOFireWireSBP2.kext",
"path": "Extensions/IOFireWireSBP2.kext",
"children": [
{
"value": 288,
"name": "Contents",
"path": "Extensions/IOFireWireSBP2.kext/Contents"
}
]
},
{
"value": 68,
"name": "IOFireWireSerialBusProtocolTransport.kext",
"path": "Extensions/IOFireWireSerialBusProtocolTransport.kext",
"children": [
{
"value": 68,
"name": "Contents",
"path": "Extensions/IOFireWireSerialBusProtocolTransport.kext/Contents"
}
]
},
{
"value": 320,
"name": "IOGraphicsFamily.kext",
"path": "Extensions/IOGraphicsFamily.kext",
"children": [
{
"value": 4,
"name": "_CodeSignature",
"path": "Extensions/IOGraphicsFamily.kext/_CodeSignature"
}
]
},
{
"value": 804,
"name": "IOHDIXController.kext",
"path": "Extensions/IOHDIXController.kext",
"children": [
{
"value": 804,
"name": "Contents",
"path": "Extensions/IOHDIXController.kext/Contents"
}
]
},
{
"value": 940,
"name": "IOHIDFamily.kext",
"path": "Extensions/IOHIDFamily.kext",
"children": [
{
"value": 940,
"name": "Contents",
"path": "Extensions/IOHIDFamily.kext/Contents"
}
]
},
{
"value": 108,
"name": "IONDRVSupport.kext",
"path": "Extensions/IONDRVSupport.kext",
"children": [
{
"value": 4,
"name": "_CodeSignature",
"path": "Extensions/IONDRVSupport.kext/_CodeSignature"
}
]
},
{
"value": 2396,
"name": "IONetworkingFamily.kext",
"path": "Extensions/IONetworkingFamily.kext",
"children": [
{
"value": 2396,
"name": "Contents",
"path": "Extensions/IONetworkingFamily.kext/Contents"
}
]
},
{
"value": 228,
"name": "IOPCIFamily.kext",
"path": "Extensions/IOPCIFamily.kext",
"children": [
{
"value": 4,
"name": "_CodeSignature",
"path": "Extensions/IOPCIFamily.kext/_CodeSignature"
}
]
},
{
"value": 1400,
"name": "IOPlatformPluginFamily.kext",
"path": "Extensions/IOPlatformPluginFamily.kext",
"children": [
{
"value": 1400,
"name": "Contents",
"path": "Extensions/IOPlatformPluginFamily.kext/Contents"
}
]
},
{
"value": 108,
"name": "IOReportFamily.kext",
"path": "Extensions/IOReportFamily.kext",
"children": [
{
"value": 108,
"name": "Contents",
"path": "Extensions/IOReportFamily.kext/Contents"
}
]
},
{
"value": 13020,
"name": "IOSCSIArchitectureModelFamily.kext",
"path": "Extensions/IOSCSIArchitectureModelFamily.kext",
"children": [
{
"value": 13020,
"name": "Contents",
"path": "Extensions/IOSCSIArchitectureModelFamily.kext/Contents"
}
]
},
{
"value": 120,
"name": "IOSCSIParallelFamily.kext",
"path": "Extensions/IOSCSIParallelFamily.kext",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Extensions/IOSCSIParallelFamily.kext/Contents"
}
]
},
{
"value": 1292,
"name": "IOSerialFamily.kext",
"path": "Extensions/IOSerialFamily.kext",
"children": [
{
"value": 1292,
"name": "Contents",
"path": "Extensions/IOSerialFamily.kext/Contents"
}
]
},
{
"value": 52,
"name": "IOSMBusFamily.kext",
"path": "Extensions/IOSMBusFamily.kext",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Extensions/IOSMBusFamily.kext/Contents"
}
]
},
{
"value": 2064,
"name": "IOStorageFamily.kext",
"path": "Extensions/IOStorageFamily.kext",
"children": [
{
"value": 2064,
"name": "Contents",
"path": "Extensions/IOStorageFamily.kext/Contents"
}
]
},
{
"value": 164,
"name": "IOStreamFamily.kext",
"path": "Extensions/IOStreamFamily.kext",
"children": [
{
"value": 164,
"name": "Contents",
"path": "Extensions/IOStreamFamily.kext/Contents"
}
]
},
{
"value": 124,
"name": "IOSurface.kext",
"path": "Extensions/IOSurface.kext",
"children": [
{
"value": 124,
"name": "Contents",
"path": "Extensions/IOSurface.kext/Contents"
}
]
},
{
"value": 1040,
"name": "IOThunderboltFamily.kext",
"path": "Extensions/IOThunderboltFamily.kext",
"children": [
{
"value": 1040,
"name": "Contents",
"path": "Extensions/IOThunderboltFamily.kext/Contents"
}
]
},
{
"value": 248,
"name": "IOTimeSyncFamily.kext",
"path": "Extensions/IOTimeSyncFamily.kext",
"children": [
{
"value": 248,
"name": "Contents",
"path": "Extensions/IOTimeSyncFamily.kext/Contents"
}
]
},
{
"value": 96,
"name": "IOUSBAttachedSCSI.kext",
"path": "Extensions/IOUSBAttachedSCSI.kext",
"children": [
{
"value": 96,
"name": "Contents",
"path": "Extensions/IOUSBAttachedSCSI.kext/Contents"
}
]
},
{
"value": 4628,
"name": "IOUSBFamily.kext",
"path": "Extensions/IOUSBFamily.kext",
"children": [
{
"value": 4628,
"name": "Contents",
"path": "Extensions/IOUSBFamily.kext/Contents"
}
]
},
{
"value": 140,
"name": "IOUSBMassStorageClass.kext",
"path": "Extensions/IOUSBMassStorageClass.kext",
"children": [
{
"value": 140,
"name": "Contents",
"path": "Extensions/IOUSBMassStorageClass.kext/Contents"
}
]
},
{
"value": 100,
"name": "IOUserEthernet.kext",
"path": "Extensions/IOUserEthernet.kext",
"children": [
{
"value": 100,
"name": "Contents",
"path": "Extensions/IOUserEthernet.kext/Contents"
}
]
},
{
"value": 172,
"name": "IOVideoFamily.kext",
"path": "Extensions/IOVideoFamily.kext",
"children": [
{
"value": 172,
"name": "Contents",
"path": "Extensions/IOVideoFamily.kext/Contents"
}
]
},
{
"value": 168,
"name": "iPodDriver.kext",
"path": "Extensions/iPodDriver.kext",
"children": [
{
"value": 168,
"name": "Contents",
"path": "Extensions/iPodDriver.kext/Contents"
}
]
},
{
"value": 108,
"name": "JMicronATA.kext",
"path": "Extensions/JMicronATA.kext",
"children": [
{
"value": 108,
"name": "Contents",
"path": "Extensions/JMicronATA.kext/Contents"
}
]
},
{
"value": 208,
"name": "L2TP.ppp",
"path": "Extensions/L2TP.ppp",
"children": [
{
"value": 208,
"name": "Contents",
"path": "Extensions/L2TP.ppp/Contents"
}
]
},
{
"value": 64,
"name": "mcxalr.kext",
"path": "Extensions/mcxalr.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/mcxalr.kext/Contents"
}
]
},
{
"value": 92,
"name": "msdosfs.kext",
"path": "Extensions/msdosfs.kext",
"children": [
{
"value": 92,
"name": "Contents",
"path": "Extensions/msdosfs.kext/Contents"
}
]
},
{
"value": 408,
"name": "ntfs.kext",
"path": "Extensions/ntfs.kext",
"children": [
{
"value": 408,
"name": "Contents",
"path": "Extensions/ntfs.kext/Contents"
}
]
},
{
"value": 2128,
"name": "NVDAGF100Hal.kext",
"path": "Extensions/NVDAGF100Hal.kext",
"children": [
{
"value": 2128,
"name": "Contents",
"path": "Extensions/NVDAGF100Hal.kext/Contents"
}
]
},
{
"value": 1952,
"name": "NVDAGK100Hal.kext",
"path": "Extensions/NVDAGK100Hal.kext",
"children": [
{
"value": 1952,
"name": "Contents",
"path": "Extensions/NVDAGK100Hal.kext/Contents"
}
]
},
{
"value": 3104,
"name": "NVDANV50HalTesla.kext",
"path": "Extensions/NVDANV50HalTesla.kext",
"children": [
{
"value": 3104,
"name": "Contents",
"path": "Extensions/NVDANV50HalTesla.kext/Contents"
}
]
},
{
"value": 2524,
"name": "NVDAResman.kext",
"path": "Extensions/NVDAResman.kext",
"children": [
{
"value": 2524,
"name": "Contents",
"path": "Extensions/NVDAResman.kext/Contents"
}
]
},
{
"value": 2540,
"name": "NVDAResmanTesla.kext",
"path": "Extensions/NVDAResmanTesla.kext",
"children": [
{
"value": 2540,
"name": "Contents",
"path": "Extensions/NVDAResmanTesla.kext/Contents"
}
]
},
{
"value": 56,
"name": "NVDAStartup.kext",
"path": "Extensions/NVDAStartup.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/NVDAStartup.kext/Contents"
}
]
},
{
"value": 104,
"name": "NVSMU.kext",
"path": "Extensions/NVSMU.kext",
"children": [
{
"value": 104,
"name": "Contents",
"path": "Extensions/NVSMU.kext/Contents"
}
]
},
{
"value": 92,
"name": "OSvKernDSPLib.kext",
"path": "Extensions/OSvKernDSPLib.kext",
"children": [
{
"value": 92,
"name": "Contents",
"path": "Extensions/OSvKernDSPLib.kext/Contents"
}
]
},
{
"value": 72,
"name": "PPP.kext",
"path": "Extensions/PPP.kext",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Extensions/PPP.kext/Contents"
}
]
},
{
"value": 120,
"name": "PPPoE.ppp",
"path": "Extensions/PPPoE.ppp",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Extensions/PPPoE.ppp/Contents"
}
]
},
{
"value": 1572,
"name": "PPPSerial.ppp",
"path": "Extensions/PPPSerial.ppp",
"children": [
{
"value": 1572,
"name": "Contents",
"path": "Extensions/PPPSerial.ppp/Contents"
}
]
},
{
"value": 120,
"name": "PPTP.ppp",
"path": "Extensions/PPTP.ppp",
"children": [
{
"value": 120,
"name": "Contents",
"path": "Extensions/PPTP.ppp/Contents"
}
]
},
{
"value": 64,
"name": "pthread.kext",
"path": "Extensions/pthread.kext",
"children": [
{
"value": 64,
"name": "Contents",
"path": "Extensions/pthread.kext/Contents"
}
]
},
{
"value": 56,
"name": "Quarantine.kext",
"path": "Extensions/Quarantine.kext",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/Quarantine.kext/Contents"
}
]
},
{
"value": 56,
"name": "Radius.ppp",
"path": "Extensions/Radius.ppp",
"children": [
{
"value": 56,
"name": "Contents",
"path": "Extensions/Radius.ppp/Contents"
}
]
},
{
"value": 52,
"name": "RemoteVirtualInterface.kext",
"path": "Extensions/RemoteVirtualInterface.kext",
"children": [
{
"value": 52,
"name": "Contents",
"path": "Extensions/RemoteVirtualInterface.kext/Contents"
}
]
},
{
"value": 108,
"name": "Sandbox.kext",
"path": "Extensions/Sandbox.kext",
"children": [
{
"value": 108,
"name": "Contents",
"path": "Extensions/Sandbox.kext/Contents"
}
]
},
{
"value": 68,
"name": "SMARTLib.plugin",
"path": "Extensions/SMARTLib.plugin",
"children": [
{
"value": 68,
"name": "Contents",
"path": "Extensions/SMARTLib.plugin/Contents"
}
]
},
{
"value": 376,
"name": "smbfs.kext",
"path": "Extensions/smbfs.kext",
"children": [
{
"value": 376,
"name": "Contents",
"path": "Extensions/smbfs.kext/Contents"
}
]
},
{
"value": 80,
"name": "SMCMotionSensor.kext",
"path": "Extensions/SMCMotionSensor.kext",
"children": [
{
"value": 80,
"name": "Contents",
"path": "Extensions/SMCMotionSensor.kext/Contents"
}
]
},
{
"value": 504,
"name": "System.kext",
"path": "Extensions/System.kext",
"children": [
{
"value": 20,
"name": "_CodeSignature",
"path": "Extensions/System.kext/_CodeSignature"
},
{
"value": 476,
"name": "PlugIns",
"path": "Extensions/System.kext/PlugIns"
}
]
},
{
"value": 56,
"name": "TMSafetyNet.kext",
"path": "Extensions/TMSafetyNet.kext",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Extensions/TMSafetyNet.kext/Contents"
},
{
"value": 16,
"name": "Helpers",
"path": "Extensions/TMSafetyNet.kext/Helpers"
}
]
},
{
"value": 40,
"name": "triggers.kext",
"path": "Extensions/triggers.kext",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Extensions/triggers.kext/Contents"
}
]
},
{
"value": 296,
"name": "udf.kext",
"path": "Extensions/udf.kext",
"children": [
{
"value": 296,
"name": "Contents",
"path": "Extensions/udf.kext/Contents"
}
]
},
{
"value": 212,
"name": "vecLib.kext",
"path": "Extensions/vecLib.kext",
"children": [
{
"value": 212,
"name": "Contents",
"path": "Extensions/vecLib.kext/Contents"
}
]
},
{
"value": 176,
"name": "webcontentfilter.kext",
"path": "Extensions/webcontentfilter.kext",
"children": [
{
"value": 176,
"name": "Contents",
"path": "Extensions/webcontentfilter.kext/Contents"
}
]
},
{
"value": 232,
"name": "webdav_fs.kext",
"path": "Extensions/webdav_fs.kext",
"children": [
{
"value": 232,
"name": "Contents",
"path": "Extensions/webdav_fs.kext/Contents"
}
]
}
]
},
{
"value": 11992,
"name": "Filesystems",
"path": "Filesystems",
"children": [
{
"value": 5740,
"name": "acfs.fs",
"path": "Filesystems/acfs.fs",
"children": [
{
"value": 5644,
"name": "Contents",
"path": "Filesystems/acfs.fs/Contents"
}
]
},
{
"value": 636,
"name": "AppleShare",
"path": "Filesystems/AppleShare",
"children": [
{
"value": 524,
"name": "afpfs.kext",
"path": "Filesystems/AppleShare/afpfs.kext"
},
{
"value": 88,
"name": "asp_tcp.kext",
"path": "Filesystems/AppleShare/asp_tcp.kext"
},
{
"value": 16,
"name": "check_afp.app",
"path": "Filesystems/AppleShare/check_afp.app"
}
]
},
{
"value": 16,
"name": "cd9660.fs",
"path": "Filesystems/cd9660.fs",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Filesystems/cd9660.fs/Contents"
}
]
},
{
"value": 32,
"name": "cddafs.fs",
"path": "Filesystems/cddafs.fs",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Filesystems/cddafs.fs/Contents"
}
]
},
{
"value": 76,
"name": "exfat.fs",
"path": "Filesystems/exfat.fs",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Filesystems/exfat.fs/Contents"
}
]
},
{
"value": 36,
"name": "ftp.fs",
"path": "Filesystems/ftp.fs",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Filesystems/ftp.fs/Contents"
}
]
},
{
"value": 3180,
"name": "hfs.fs",
"path": "Filesystems/hfs.fs",
"children": [
{
"value": 452,
"name": "Contents",
"path": "Filesystems/hfs.fs/Contents"
},
{
"value": 2724,
"name": "Encodings",
"path": "Filesystems/hfs.fs/Encodings"
}
]
},
{
"value": 64,
"name": "msdos.fs",
"path": "Filesystems/msdos.fs",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Filesystems/msdos.fs/Contents"
}
]
},
{
"value": 172,
"name": "NetFSPlugins",
"path": "Filesystems/NetFSPlugins",
"children": [
{
"value": 44,
"name": "afp.bundle",
"path": "Filesystems/NetFSPlugins/afp.bundle"
},
{
"value": 20,
"name": "ftp.bundle",
"path": "Filesystems/NetFSPlugins/ftp.bundle"
},
{
"value": 36,
"name": "http.bundle",
"path": "Filesystems/NetFSPlugins/http.bundle"
},
{
"value": 16,
"name": "nfs.bundle",
"path": "Filesystems/NetFSPlugins/nfs.bundle"
},
{
"value": 56,
"name": "smb.bundle",
"path": "Filesystems/NetFSPlugins/smb.bundle"
}
]
},
{
"value": 0,
"name": "nfs.fs",
"path": "Filesystems/nfs.fs",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Filesystems/nfs.fs/Contents"
}
]
},
{
"value": 24,
"name": "ntfs.fs",
"path": "Filesystems/ntfs.fs",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Filesystems/ntfs.fs/Contents"
}
]
},
{
"value": 1800,
"name": "prlufs.fs",
"path": "Filesystems/prlufs.fs",
"children": [
{
"value": 1800,
"name": "Support",
"path": "Filesystems/prlufs.fs/Support"
}
]
},
{
"value": 0,
"name": "smbfs.fs",
"path": "Filesystems/smbfs.fs",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Filesystems/smbfs.fs/Contents"
}
]
},
{
"value": 204,
"name": "udf.fs",
"path": "Filesystems/udf.fs",
"children": [
{
"value": 200,
"name": "Contents",
"path": "Filesystems/udf.fs/Contents"
}
]
},
{
"value": 8,
"name": "webdav.fs",
"path": "Filesystems/webdav.fs",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Filesystems/webdav.fs/Contents"
},
{
"value": 8,
"name": "Support",
"path": "Filesystems/webdav.fs/Support"
}
]
}
]
},
{
"value": 112,
"name": "Filters",
"path": "Filters"
},
{
"value": 201212,
"name": "Fonts",
"path": "Fonts"
},
{
"value": 647772,
"name": "Frameworks",
"path": "Frameworks",
"children": [
{
"value": 9800,
"name": "Accelerate.framework",
"path": "Frameworks/Accelerate.framework",
"children": [
{
"value": 9788,
"name": "Versions",
"path": "Frameworks/Accelerate.framework/Versions"
}
]
},
{
"value": 100,
"name": "Accounts.framework",
"path": "Frameworks/Accounts.framework",
"children": [
{
"value": 92,
"name": "Versions",
"path": "Frameworks/Accounts.framework/Versions"
}
]
},
{
"value": 10144,
"name": "AddressBook.framework",
"path": "Frameworks/AddressBook.framework",
"children": [
{
"value": 10136,
"name": "Versions",
"path": "Frameworks/AddressBook.framework/Versions"
}
]
},
{
"value": 64,
"name": "AGL.framework",
"path": "Frameworks/AGL.framework",
"children": [
{
"value": 56,
"name": "Versions",
"path": "Frameworks/AGL.framework/Versions"
}
]
},
{
"value": 30320,
"name": "AppKit.framework",
"path": "Frameworks/AppKit.framework",
"children": [
{
"value": 30308,
"name": "Versions",
"path": "Frameworks/AppKit.framework/Versions"
}
]
},
{
"value": 12,
"name": "AppKitScripting.framework",
"path": "Frameworks/AppKitScripting.framework",
"children": [
{
"value": 4,
"name": "Versions",
"path": "Frameworks/AppKitScripting.framework/Versions"
}
]
},
{
"value": 632,
"name": "AppleScriptKit.framework",
"path": "Frameworks/AppleScriptKit.framework",
"children": [
{
"value": 624,
"name": "Versions",
"path": "Frameworks/AppleScriptKit.framework/Versions"
}
]
},
{
"value": 104,
"name": "AppleScriptObjC.framework",
"path": "Frameworks/AppleScriptObjC.framework",
"children": [
{
"value": 96,
"name": "Versions",
"path": "Frameworks/AppleScriptObjC.framework/Versions"
}
]
},
{
"value": 324,
"name": "AppleShareClientCore.framework",
"path": "Frameworks/AppleShareClientCore.framework",
"children": [
{
"value": 316,
"name": "Versions",
"path": "Frameworks/AppleShareClientCore.framework/Versions"
}
]
},
{
"value": 77200,
"name": "ApplicationServices.framework",
"path": "Frameworks/ApplicationServices.framework",
"children": [
{
"value": 77188,
"name": "Versions",
"path": "Frameworks/ApplicationServices.framework/Versions"
}
]
},
{
"value": 1792,
"name": "AudioToolbox.framework",
"path": "Frameworks/AudioToolbox.framework",
"children": [
{
"value": 1716,
"name": "Versions",
"path": "Frameworks/AudioToolbox.framework/Versions"
},
{
"value": 68,
"name": "XPCServices",
"path": "Frameworks/AudioToolbox.framework/XPCServices"
}
]
},
{
"value": 40,
"name": "AudioUnit.framework",
"path": "Frameworks/AudioUnit.framework",
"children": [
{
"value": 32,
"name": "Versions",
"path": "Frameworks/AudioUnit.framework/Versions"
}
]
},
{
"value": 736,
"name": "AudioVideoBridging.framework",
"path": "Frameworks/AudioVideoBridging.framework",
"children": [
{
"value": 728,
"name": "Versions",
"path": "Frameworks/AudioVideoBridging.framework/Versions"
}
]
},
{
"value": 11496,
"name": "Automator.framework",
"path": "Frameworks/Automator.framework",
"children": [
{
"value": 4,
"name": "Frameworks",
"path": "Frameworks/Automator.framework/Frameworks"
},
{
"value": 11484,
"name": "Versions",
"path": "Frameworks/Automator.framework/Versions"
}
]
},
{
"value": 1648,
"name": "AVFoundation.framework",
"path": "Frameworks/AVFoundation.framework",
"children": [
{
"value": 1640,
"name": "Versions",
"path": "Frameworks/AVFoundation.framework/Versions"
}
]
},
{
"value": 408,
"name": "AVKit.framework",
"path": "Frameworks/AVKit.framework",
"children": [
{
"value": 400,
"name": "Versions",
"path": "Frameworks/AVKit.framework/Versions"
}
]
},
{
"value": 1132,
"name": "CalendarStore.framework",
"path": "Frameworks/CalendarStore.framework",
"children": [
{
"value": 1124,
"name": "Versions",
"path": "Frameworks/CalendarStore.framework/Versions"
}
]
},
{
"value": 25920,
"name": "Carbon.framework",
"path": "Frameworks/Carbon.framework",
"children": [
{
"value": 25908,
"name": "Versions",
"path": "Frameworks/Carbon.framework/Versions"
}
]
},
{
"value": 2000,
"name": "CFNetwork.framework",
"path": "Frameworks/CFNetwork.framework",
"children": [
{
"value": 1992,
"name": "Versions",
"path": "Frameworks/CFNetwork.framework/Versions"
}
]
},
{
"value": 20,
"name": "Cocoa.framework",
"path": "Frameworks/Cocoa.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "Frameworks/Cocoa.framework/Versions"
}
]
},
{
"value": 900,
"name": "Collaboration.framework",
"path": "Frameworks/Collaboration.framework",
"children": [
{
"value": 892,
"name": "Versions",
"path": "Frameworks/Collaboration.framework/Versions"
}
]
},
{
"value": 432,
"name": "CoreAudio.framework",
"path": "Frameworks/CoreAudio.framework",
"children": [
{
"value": 420,
"name": "Versions",
"path": "Frameworks/CoreAudio.framework/Versions"
}
]
},
{
"value": 716,
"name": "CoreAudioKit.framework",
"path": "Frameworks/CoreAudioKit.framework",
"children": [
{
"value": 708,
"name": "Versions",
"path": "Frameworks/CoreAudioKit.framework/Versions"
}
]
},
{
"value": 2632,
"name": "CoreData.framework",
"path": "Frameworks/CoreData.framework",
"children": [
{
"value": 2624,
"name": "Versions",
"path": "Frameworks/CoreData.framework/Versions"
}
]
},
{
"value": 2608,
"name": "CoreFoundation.framework",
"path": "Frameworks/CoreFoundation.framework",
"children": [
{
"value": 2600,
"name": "Versions",
"path": "Frameworks/CoreFoundation.framework/Versions"
}
]
},
{
"value": 9152,
"name": "CoreGraphics.framework",
"path": "Frameworks/CoreGraphics.framework",
"children": [
{
"value": 9144,
"name": "Versions",
"path": "Frameworks/CoreGraphics.framework/Versions"
}
]
},
{
"value": 14552,
"name": "CoreLocation.framework",
"path": "Frameworks/CoreLocation.framework",
"children": [
{
"value": 14540,
"name": "Versions",
"path": "Frameworks/CoreLocation.framework/Versions"
}
]
},
{
"value": 452,
"name": "CoreMedia.framework",
"path": "Frameworks/CoreMedia.framework",
"children": [
{
"value": 440,
"name": "Versions",
"path": "Frameworks/CoreMedia.framework/Versions"
}
]
},
{
"value": 2876,
"name": "CoreMediaIO.framework",
"path": "Frameworks/CoreMediaIO.framework",
"children": [
{
"value": 2864,
"name": "Versions",
"path": "Frameworks/CoreMediaIO.framework/Versions"
}
]
},
{
"value": 320,
"name": "CoreMIDI.framework",
"path": "Frameworks/CoreMIDI.framework",
"children": [
{
"value": 308,
"name": "Versions",
"path": "Frameworks/CoreMIDI.framework/Versions"
}
]
},
{
"value": 20,
"name": "CoreMIDIServer.framework",
"path": "Frameworks/CoreMIDIServer.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "Frameworks/CoreMIDIServer.framework/Versions"
}
]
},
{
"value": 12024,
"name": "CoreServices.framework",
"path": "Frameworks/CoreServices.framework",
"children": [
{
"value": 12012,
"name": "Versions",
"path": "Frameworks/CoreServices.framework/Versions"
}
]
},
{
"value": 1472,
"name": "CoreText.framework",
"path": "Frameworks/CoreText.framework",
"children": [
{
"value": 1464,
"name": "Versions",
"path": "Frameworks/CoreText.framework/Versions"
}
]
},
{
"value": 204,
"name": "CoreVideo.framework",
"path": "Frameworks/CoreVideo.framework",
"children": [
{
"value": 196,
"name": "Versions",
"path": "Frameworks/CoreVideo.framework/Versions"
}
]
},
{
"value": 520,
"name": "CoreWiFi.framework",
"path": "Frameworks/CoreWiFi.framework",
"children": [
{
"value": 512,
"name": "Versions",
"path": "Frameworks/CoreWiFi.framework/Versions"
}
]
},
{
"value": 536,
"name": "CoreWLAN.framework",
"path": "Frameworks/CoreWLAN.framework",
"children": [
{
"value": 528,
"name": "Versions",
"path": "Frameworks/CoreWLAN.framework/Versions"
}
]
},
{
"value": 88,
"name": "DirectoryService.framework",
"path": "Frameworks/DirectoryService.framework",
"children": [
{
"value": 80,
"name": "Versions",
"path": "Frameworks/DirectoryService.framework/Versions"
}
]
},
{
"value": 1352,
"name": "DiscRecording.framework",
"path": "Frameworks/DiscRecording.framework",
"children": [
{
"value": 1344,
"name": "Versions",
"path": "Frameworks/DiscRecording.framework/Versions"
}
]
},
{
"value": 1384,
"name": "DiscRecordingUI.framework",
"path": "Frameworks/DiscRecordingUI.framework",
"children": [
{
"value": 1376,
"name": "Versions",
"path": "Frameworks/DiscRecordingUI.framework/Versions"
}
]
},
{
"value": 76,
"name": "DiskArbitration.framework",
"path": "Frameworks/DiskArbitration.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "Frameworks/DiskArbitration.framework/Versions"
}
]
},
{
"value": 32,
"name": "DrawSprocket.framework",
"path": "Frameworks/DrawSprocket.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "Frameworks/DrawSprocket.framework/Versions"
}
]
},
{
"value": 20,
"name": "DVComponentGlue.framework",
"path": "Frameworks/DVComponentGlue.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "Frameworks/DVComponentGlue.framework/Versions"
}
]
},
{
"value": 1420,
"name": "DVDPlayback.framework",
"path": "Frameworks/DVDPlayback.framework",
"children": [
{
"value": 1412,
"name": "Versions",
"path": "Frameworks/DVDPlayback.framework/Versions"
}
]
},
{
"value": 232,
"name": "EventKit.framework",
"path": "Frameworks/EventKit.framework",
"children": [
{
"value": 224,
"name": "Versions",
"path": "Frameworks/EventKit.framework/Versions"
}
]
},
{
"value": 32,
"name": "ExceptionHandling.framework",
"path": "Frameworks/ExceptionHandling.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "Frameworks/ExceptionHandling.framework/Versions"
}
]
},
{
"value": 32,
"name": "ForceFeedback.framework",
"path": "Frameworks/ForceFeedback.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "Frameworks/ForceFeedback.framework/Versions"
}
]
},
{
"value": 4228,
"name": "Foundation.framework",
"path": "Frameworks/Foundation.framework",
"children": [
{
"value": 4216,
"name": "Versions",
"path": "Frameworks/Foundation.framework/Versions"
}
]
},
{
"value": 52,
"name": "FWAUserLib.framework",
"path": "Frameworks/FWAUserLib.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "Frameworks/FWAUserLib.framework/Versions"
}
]
},
{
"value": 60,
"name": "GameController.framework",
"path": "Frameworks/GameController.framework",
"children": [
{
"value": 52,
"name": "Versions",
"path": "Frameworks/GameController.framework/Versions"
}
]
},
{
"value": 44244,
"name": "GameKit.framework",
"path": "Frameworks/GameKit.framework",
"children": [
{
"value": 44236,
"name": "Versions",
"path": "Frameworks/GameKit.framework/Versions"
}
]
},
{
"value": 132,
"name": "GLKit.framework",
"path": "Frameworks/GLKit.framework",
"children": [
{
"value": 124,
"name": "Versions",
"path": "Frameworks/GLKit.framework/Versions"
}
]
},
{
"value": 1740,
"name": "GLUT.framework",
"path": "Frameworks/GLUT.framework",
"children": [
{
"value": 1732,
"name": "Versions",
"path": "Frameworks/GLUT.framework/Versions"
}
]
},
{
"value": 280,
"name": "GSS.framework",
"path": "Frameworks/GSS.framework",
"children": [
{
"value": 272,
"name": "Versions",
"path": "Frameworks/GSS.framework/Versions"
}
]
},
{
"value": 236,
"name": "ICADevices.framework",
"path": "Frameworks/ICADevices.framework",
"children": [
{
"value": 228,
"name": "Versions",
"path": "Frameworks/ICADevices.framework/Versions"
}
]
},
{
"value": 392,
"name": "ImageCaptureCore.framework",
"path": "Frameworks/ImageCaptureCore.framework",
"children": [
{
"value": 384,
"name": "Versions",
"path": "Frameworks/ImageCaptureCore.framework/Versions"
}
]
},
{
"value": 4008,
"name": "ImageIO.framework",
"path": "Frameworks/ImageIO.framework",
"children": [
{
"value": 4000,
"name": "Versions",
"path": "Frameworks/ImageIO.framework/Versions"
}
]
},
{
"value": 104,
"name": "IMServicePlugIn.framework",
"path": "Frameworks/IMServicePlugIn.framework",
"children": [
{
"value": 28,
"name": "IMServicePlugInAgent.app",
"path": "Frameworks/IMServicePlugIn.framework/IMServicePlugInAgent.app"
},
{
"value": 64,
"name": "Versions",
"path": "Frameworks/IMServicePlugIn.framework/Versions"
}
]
},
{
"value": 368,
"name": "InputMethodKit.framework",
"path": "Frameworks/InputMethodKit.framework",
"children": [
{
"value": 356,
"name": "Versions",
"path": "Frameworks/InputMethodKit.framework/Versions"
}
]
},
{
"value": 360,
"name": "InstallerPlugins.framework",
"path": "Frameworks/InstallerPlugins.framework",
"children": [
{
"value": 352,
"name": "Versions",
"path": "Frameworks/InstallerPlugins.framework/Versions"
}
]
},
{
"value": 76,
"name": "InstantMessage.framework",
"path": "Frameworks/InstantMessage.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "Frameworks/InstantMessage.framework/Versions"
}
]
},
{
"value": 904,
"name": "IOBluetooth.framework",
"path": "Frameworks/IOBluetooth.framework",
"children": [
{
"value": 892,
"name": "Versions",
"path": "Frameworks/IOBluetooth.framework/Versions"
}
]
},
{
"value": 4592,
"name": "IOBluetoothUI.framework",
"path": "Frameworks/IOBluetoothUI.framework",
"children": [
{
"value": 4584,
"name": "Versions",
"path": "Frameworks/IOBluetoothUI.framework/Versions"
}
]
},
{
"value": 688,
"name": "IOKit.framework",
"path": "Frameworks/IOKit.framework",
"children": [
{
"value": 680,
"name": "Versions",
"path": "Frameworks/IOKit.framework/Versions"
}
]
},
{
"value": 48,
"name": "IOSurface.framework",
"path": "Frameworks/IOSurface.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "Frameworks/IOSurface.framework/Versions"
}
]
},
{
"value": 28,
"name": "JavaFrameEmbedding.framework",
"path": "Frameworks/JavaFrameEmbedding.framework",
"children": [
{
"value": 20,
"name": "Versions",
"path": "Frameworks/JavaFrameEmbedding.framework/Versions"
}
]
},
{
"value": 3336,
"name": "JavaScriptCore.framework",
"path": "Frameworks/JavaScriptCore.framework",
"children": [
{
"value": 3328,
"name": "Versions",
"path": "Frameworks/JavaScriptCore.framework/Versions"
}
]
},
{
"value": 2756,
"name": "JavaVM.framework",
"path": "Frameworks/JavaVM.framework",
"children": [
{
"value": 2728,
"name": "Versions",
"path": "Frameworks/JavaVM.framework/Versions"
}
]
},
{
"value": 168,
"name": "Kerberos.framework",
"path": "Frameworks/Kerberos.framework",
"children": [
{
"value": 160,
"name": "Versions",
"path": "Frameworks/Kerberos.framework/Versions"
}
]
},
{
"value": 36,
"name": "Kernel.framework",
"path": "Frameworks/Kernel.framework",
"children": [
{
"value": 32,
"name": "Versions",
"path": "Frameworks/Kernel.framework/Versions"
}
]
},
{
"value": 200,
"name": "LatentSemanticMapping.framework",
"path": "Frameworks/LatentSemanticMapping.framework",
"children": [
{
"value": 192,
"name": "Versions",
"path": "Frameworks/LatentSemanticMapping.framework/Versions"
}
]
},
{
"value": 284,
"name": "LDAP.framework",
"path": "Frameworks/LDAP.framework",
"children": [
{
"value": 276,
"name": "Versions",
"path": "Frameworks/LDAP.framework/Versions"
}
]
},
{
"value": 1872,
"name": "MapKit.framework",
"path": "Frameworks/MapKit.framework",
"children": [
{
"value": 1864,
"name": "Versions",
"path": "Frameworks/MapKit.framework/Versions"
}
]
},
{
"value": 56,
"name": "MediaAccessibility.framework",
"path": "Frameworks/MediaAccessibility.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "Frameworks/MediaAccessibility.framework/Versions"
}
]
},
{
"value": 100,
"name": "MediaLibrary.framework",
"path": "Frameworks/MediaLibrary.framework",
"children": [
{
"value": 88,
"name": "Versions",
"path": "Frameworks/MediaLibrary.framework/Versions"
}
]
},
{
"value": 3708,
"name": "MediaToolbox.framework",
"path": "Frameworks/MediaToolbox.framework",
"children": [
{
"value": 3700,
"name": "Versions",
"path": "Frameworks/MediaToolbox.framework/Versions"
}
]
},
{
"value": 16,
"name": "Message.framework",
"path": "Frameworks/Message.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "Frameworks/Message.framework/Versions"
}
]
},
{
"value": 64,
"name": "NetFS.framework",
"path": "Frameworks/NetFS.framework",
"children": [
{
"value": 56,
"name": "Versions",
"path": "Frameworks/NetFS.framework/Versions"
}
]
},
{
"value": 192,
"name": "OpenAL.framework",
"path": "Frameworks/OpenAL.framework",
"children": [
{
"value": 184,
"name": "Versions",
"path": "Frameworks/OpenAL.framework/Versions"
}
]
},
{
"value": 78380,
"name": "OpenCL.framework",
"path": "Frameworks/OpenCL.framework",
"children": [
{
"value": 78368,
"name": "Versions",
"path": "Frameworks/OpenCL.framework/Versions"
}
]
},
{
"value": 288,
"name": "OpenDirectory.framework",
"path": "Frameworks/OpenDirectory.framework",
"children": [
{
"value": 252,
"name": "Versions",
"path": "Frameworks/OpenDirectory.framework/Versions"
}
]
},
{
"value": 25628,
"name": "OpenGL.framework",
"path": "Frameworks/OpenGL.framework",
"children": [
{
"value": 25616,
"name": "Versions",
"path": "Frameworks/OpenGL.framework/Versions"
}
]
},
{
"value": 1136,
"name": "OSAKit.framework",
"path": "Frameworks/OSAKit.framework",
"children": [
{
"value": 1128,
"name": "Versions",
"path": "Frameworks/OSAKit.framework/Versions"
}
]
},
{
"value": 88,
"name": "PCSC.framework",
"path": "Frameworks/PCSC.framework",
"children": [
{
"value": 80,
"name": "Versions",
"path": "Frameworks/PCSC.framework/Versions"
}
]
},
{
"value": 192,
"name": "PreferencePanes.framework",
"path": "Frameworks/PreferencePanes.framework",
"children": [
{
"value": 180,
"name": "Versions",
"path": "Frameworks/PreferencePanes.framework/Versions"
}
]
},
{
"value": 1012,
"name": "PubSub.framework",
"path": "Frameworks/PubSub.framework",
"children": [
{
"value": 1004,
"name": "Versions",
"path": "Frameworks/PubSub.framework/Versions"
}
]
},
{
"value": 129696,
"name": "Python.framework",
"path": "Frameworks/Python.framework",
"children": [
{
"value": 129684,
"name": "Versions",
"path": "Frameworks/Python.framework/Versions"
}
]
},
{
"value": 2516,
"name": "QTKit.framework",
"path": "Frameworks/QTKit.framework",
"children": [
{
"value": 2504,
"name": "Versions",
"path": "Frameworks/QTKit.framework/Versions"
}
]
},
{
"value": 23712,
"name": "Quartz.framework",
"path": "Frameworks/Quartz.framework",
"children": [
{
"value": 23700,
"name": "Versions",
"path": "Frameworks/Quartz.framework/Versions"
}
]
},
{
"value": 6644,
"name": "QuartzCore.framework",
"path": "Frameworks/QuartzCore.framework",
"children": [
{
"value": 6632,
"name": "Versions",
"path": "Frameworks/QuartzCore.framework/Versions"
}
]
},
{
"value": 3960,
"name": "QuickLook.framework",
"path": "Frameworks/QuickLook.framework",
"children": [
{
"value": 3948,
"name": "Versions",
"path": "Frameworks/QuickLook.framework/Versions"
}
]
},
{
"value": 3460,
"name": "QuickTime.framework",
"path": "Frameworks/QuickTime.framework",
"children": [
{
"value": 3452,
"name": "Versions",
"path": "Frameworks/QuickTime.framework/Versions"
}
]
},
{
"value": 13168,
"name": "Ruby.framework",
"path": "Frameworks/Ruby.framework",
"children": [
{
"value": 13160,
"name": "Versions",
"path": "Frameworks/Ruby.framework/Versions"
}
]
},
{
"value": 204,
"name": "RubyCocoa.framework",
"path": "Frameworks/RubyCocoa.framework",
"children": [
{
"value": 196,
"name": "Versions",
"path": "Frameworks/RubyCocoa.framework/Versions"
}
]
},
{
"value": 3628,
"name": "SceneKit.framework",
"path": "Frameworks/SceneKit.framework",
"children": [
{
"value": 3616,
"name": "Versions",
"path": "Frameworks/SceneKit.framework/Versions"
}
]
},
{
"value": 1812,
"name": "ScreenSaver.framework",
"path": "Frameworks/ScreenSaver.framework",
"children": [
{
"value": 1804,
"name": "Versions",
"path": "Frameworks/ScreenSaver.framework/Versions"
}
]
},
{
"value": 12,
"name": "Scripting.framework",
"path": "Frameworks/Scripting.framework",
"children": [
{
"value": 4,
"name": "Versions",
"path": "Frameworks/Scripting.framework/Versions"
}
]
},
{
"value": 144,
"name": "ScriptingBridge.framework",
"path": "Frameworks/ScriptingBridge.framework",
"children": [
{
"value": 136,
"name": "Versions",
"path": "Frameworks/ScriptingBridge.framework/Versions"
}
]
},
{
"value": 6224,
"name": "Security.framework",
"path": "Frameworks/Security.framework",
"children": [
{
"value": 124,
"name": "PlugIns",
"path": "Frameworks/Security.framework/PlugIns"
},
{
"value": 6088,
"name": "Versions",
"path": "Frameworks/Security.framework/Versions"
}
]
},
{
"value": 2076,
"name": "SecurityFoundation.framework",
"path": "Frameworks/SecurityFoundation.framework",
"children": [
{
"value": 2068,
"name": "Versions",
"path": "Frameworks/SecurityFoundation.framework/Versions"
}
]
},
{
"value": 8660,
"name": "SecurityInterface.framework",
"path": "Frameworks/SecurityInterface.framework",
"children": [
{
"value": 8652,
"name": "Versions",
"path": "Frameworks/SecurityInterface.framework/Versions"
}
]
},
{
"value": 88,
"name": "ServiceManagement.framework",
"path": "Frameworks/ServiceManagement.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "Frameworks/ServiceManagement.framework/Versions"
},
{
"value": 12,
"name": "XPCServices",
"path": "Frameworks/ServiceManagement.framework/XPCServices"
}
]
},
{
"value": 1112,
"name": "Social.framework",
"path": "Frameworks/Social.framework",
"children": [
{
"value": 516,
"name": "Versions",
"path": "Frameworks/Social.framework/Versions"
},
{
"value": 588,
"name": "XPCServices",
"path": "Frameworks/Social.framework/XPCServices"
}
]
},
{
"value": 500,
"name": "SpriteKit.framework",
"path": "Frameworks/SpriteKit.framework",
"children": [
{
"value": 492,
"name": "Versions",
"path": "Frameworks/SpriteKit.framework/Versions"
}
]
},
{
"value": 96,
"name": "StoreKit.framework",
"path": "Frameworks/StoreKit.framework",
"children": [
{
"value": 88,
"name": "Versions",
"path": "Frameworks/StoreKit.framework/Versions"
}
]
},
{
"value": 1608,
"name": "SyncServices.framework",
"path": "Frameworks/SyncServices.framework",
"children": [
{
"value": 1600,
"name": "Versions",
"path": "Frameworks/SyncServices.framework/Versions"
}
]
},
{
"value": 44,
"name": "System.framework",
"path": "Frameworks/System.framework",
"children": [
{
"value": 36,
"name": "Versions",
"path": "Frameworks/System.framework/Versions"
}
]
},
{
"value": 576,
"name": "SystemConfiguration.framework",
"path": "Frameworks/SystemConfiguration.framework",
"children": [
{
"value": 568,
"name": "Versions",
"path": "Frameworks/SystemConfiguration.framework/Versions"
}
]
},
{
"value": 3208,
"name": "Tcl.framework",
"path": "Frameworks/Tcl.framework",
"children": [
{
"value": 3200,
"name": "Versions",
"path": "Frameworks/Tcl.framework/Versions"
}
]
},
{
"value": 3172,
"name": "Tk.framework",
"path": "Frameworks/Tk.framework",
"children": [
{
"value": 3160,
"name": "Versions",
"path": "Frameworks/Tk.framework/Versions"
}
]
},
{
"value": 76,
"name": "TWAIN.framework",
"path": "Frameworks/TWAIN.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "Frameworks/TWAIN.framework/Versions"
}
]
},
{
"value": 24,
"name": "VideoDecodeAcceleration.framework",
"path": "Frameworks/VideoDecodeAcceleration.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "Frameworks/VideoDecodeAcceleration.framework/Versions"
}
]
},
{
"value": 3648,
"name": "VideoToolbox.framework",
"path": "Frameworks/VideoToolbox.framework",
"children": [
{
"value": 3636,
"name": "Versions",
"path": "Frameworks/VideoToolbox.framework/Versions"
}
]
},
{
"value": 17668,
"name": "WebKit.framework",
"path": "Frameworks/WebKit.framework",
"children": [
{
"value": 17512,
"name": "Versions",
"path": "Frameworks/WebKit.framework/Versions"
},
{
"value": 116,
"name": "WebKitPluginHost.app",
"path": "Frameworks/WebKit.framework/WebKitPluginHost.app"
}
]
}
]
},
{
"value": 1076,
"name": "Graphics",
"path": "Graphics",
"children": [
{
"value": 876,
"name": "QuartzComposer Patches",
"path": "Graphics/QuartzComposer Patches",
"children": [
{
"value": 148,
"name": "Backdrops.plugin",
"path": "Graphics/QuartzComposer Patches/Backdrops.plugin"
},
{
"value": 36,
"name": "FaceEffects.plugin",
"path": "Graphics/QuartzComposer Patches/FaceEffects.plugin"
}
]
},
{
"value": 200,
"name": "QuartzComposer Plug-Ins",
"path": "Graphics/QuartzComposer Plug-Ins",
"children": [
{
"value": 200,
"name": "WOTD.plugin",
"path": "Graphics/QuartzComposer Plug-Ins/WOTD.plugin"
}
]
}
]
},
{
"value": 0,
"name": "IdentityServices",
"path": "IdentityServices",
"children": [
{
"value": 0,
"name": "ServiceDefinitions",
"path": "IdentityServices/ServiceDefinitions"
}
]
},
{
"value": 2900,
"name": "ImageCapture",
"path": "ImageCapture",
"children": [
{
"value": 200,
"name": "Automatic Tasks",
"path": "ImageCapture/Automatic Tasks",
"children": [
{
"value": 52,
"name": "Build Web Page.app",
"path": "ImageCapture/Automatic Tasks/Build Web Page.app"
},
{
"value": 148,
"name": "MakePDF.app",
"path": "ImageCapture/Automatic Tasks/MakePDF.app"
}
]
},
{
"value": 480,
"name": "Devices",
"path": "ImageCapture/Devices",
"children": [
{
"value": 84,
"name": "AirScanScanner.app",
"path": "ImageCapture/Devices/AirScanScanner.app"
},
{
"value": 44,
"name": "MassStorageCamera.app",
"path": "ImageCapture/Devices/MassStorageCamera.app"
},
{
"value": 124,
"name": "PTPCamera.app",
"path": "ImageCapture/Devices/PTPCamera.app"
},
{
"value": 36,
"name": "Type4Camera.app",
"path": "ImageCapture/Devices/Type4Camera.app"
},
{
"value": 32,
"name": "Type5Camera.app",
"path": "ImageCapture/Devices/Type5Camera.app"
},
{
"value": 36,
"name": "Type8Camera.app",
"path": "ImageCapture/Devices/Type8Camera.app"
},
{
"value": 124,
"name": "VirtualScanner.app",
"path": "ImageCapture/Devices/VirtualScanner.app"
}
]
},
{
"value": 2212,
"name": "Support",
"path": "ImageCapture/Support",
"children": [
{
"value": 432,
"name": "Application",
"path": "ImageCapture/Support/Application"
},
{
"value": 1608,
"name": "Icons",
"path": "ImageCapture/Support/Icons"
},
{
"value": 172,
"name": "Image Capture Extension.app",
"path": "ImageCapture/Support/Image Capture Extension.app"
},
{
"value": 3184,
"name": "CoreDeploy.bundle",
"path": "Java/Support/CoreDeploy.bundle"
},
{
"value": 2732,
"name": "Deploy.bundle",
"path": "Java/Support/Deploy.bundle"
}
]
},
{
"value": 8,
"name": "Tools",
"path": "ImageCapture/Tools"
},
{
"value": 0,
"name": "TWAIN Data Sources",
"path": "ImageCapture/TWAIN Data Sources"
}
]
},
{
"value": 23668,
"name": "InputMethods",
"path": "InputMethods",
"children": [
{
"value": 1400,
"name": "50onPaletteServer.app",
"path": "InputMethods/50onPaletteServer.app",
"children": [
{
"value": 1400,
"name": "Contents",
"path": "InputMethods/50onPaletteServer.app/Contents"
}
]
},
{
"value": 5728,
"name": "CharacterPalette.app",
"path": "InputMethods/CharacterPalette.app",
"children": [
{
"value": 5728,
"name": "Contents",
"path": "InputMethods/CharacterPalette.app/Contents"
}
]
},
{
"value": 2476,
"name": "DictationIM.app",
"path": "InputMethods/DictationIM.app",
"children": [
{
"value": 2476,
"name": "Contents",
"path": "InputMethods/DictationIM.app/Contents"
}
]
},
{
"value": 88,
"name": "InkServer.app",
"path": "InputMethods/InkServer.app",
"children": [
{
"value": 88,
"name": "Contents",
"path": "InputMethods/InkServer.app/Contents"
}
]
},
{
"value": 736,
"name": "KeyboardViewer.app",
"path": "InputMethods/KeyboardViewer.app",
"children": [
{
"value": 736,
"name": "Contents",
"path": "InputMethods/KeyboardViewer.app/Contents"
}
]
},
{
"value": 1144,
"name": "KoreanIM.app",
"path": "InputMethods/KoreanIM.app",
"children": [
{
"value": 1144,
"name": "Contents",
"path": "InputMethods/KoreanIM.app/Contents"
}
]
},
{
"value": 2484,
"name": "Kotoeri.app",
"path": "InputMethods/Kotoeri.app",
"children": [
{
"value": 2484,
"name": "Contents",
"path": "InputMethods/Kotoeri.app/Contents"
}
]
},
{
"value": 40,
"name": "PluginIM.app",
"path": "InputMethods/PluginIM.app",
"children": [
{
"value": 40,
"name": "Contents",
"path": "InputMethods/PluginIM.app/Contents"
}
]
},
{
"value": 24,
"name": "PressAndHold.app",
"path": "InputMethods/PressAndHold.app",
"children": [
{
"value": 24,
"name": "Contents",
"path": "InputMethods/PressAndHold.app/Contents"
}
]
},
{
"value": 64,
"name": "SCIM.app",
"path": "InputMethods/SCIM.app",
"children": [
{
"value": 64,
"name": "Contents",
"path": "InputMethods/SCIM.app/Contents"
}
]
},
{
"value": 6916,
"name": "Switch Control.app",
"path": "InputMethods/Switch Control.app",
"children": [
{
"value": 6916,
"name": "Contents",
"path": "InputMethods/Switch Control.app/Contents"
}
]
},
{
"value": 104,
"name": "TamilIM.app",
"path": "InputMethods/TamilIM.app",
"children": [
{
"value": 104,
"name": "Contents",
"path": "InputMethods/TamilIM.app/Contents"
}
]
},
{
"value": 92,
"name": "TCIM.app",
"path": "InputMethods/TCIM.app",
"children": [
{
"value": 92,
"name": "Contents",
"path": "InputMethods/TCIM.app/Contents"
}
]
},
{
"value": 1820,
"name": "TrackpadIM.app",
"path": "InputMethods/TrackpadIM.app",
"children": [
{
"value": 1820,
"name": "Contents",
"path": "InputMethods/TrackpadIM.app/Contents"
}
]
},
{
"value": 552,
"name": "VietnameseIM.app",
"path": "InputMethods/VietnameseIM.app",
"children": [
{
"value": 552,
"name": "Contents",
"path": "InputMethods/VietnameseIM.app/Contents"
}
]
}
]
},
{
"value": 17668,
"name": "InternetAccounts",
"path": "InternetAccounts",
"children": [
{
"value": 336,
"name": "126.iaplugin",
"path": "InternetAccounts/126.iaplugin",
"children": [
{
"value": 336,
"name": "Contents",
"path": "InternetAccounts/126.iaplugin/Contents"
}
]
},
{
"value": 332,
"name": "163.iaplugin",
"path": "InternetAccounts/163.iaplugin",
"children": [
{
"value": 332,
"name": "Contents",
"path": "InternetAccounts/163.iaplugin/Contents"
}
]
},
{
"value": 48,
"name": "AddressBook.iaplugin",
"path": "InternetAccounts/AddressBook.iaplugin",
"children": [
{
"value": 48,
"name": "Contents",
"path": "InternetAccounts/AddressBook.iaplugin/Contents"
}
]
},
{
"value": 304,
"name": "AOL.iaplugin",
"path": "InternetAccounts/AOL.iaplugin",
"children": [
{
"value": 304,
"name": "Contents",
"path": "InternetAccounts/AOL.iaplugin/Contents"
}
]
},
{
"value": 44,
"name": "Calendar.iaplugin",
"path": "InternetAccounts/Calendar.iaplugin",
"children": [
{
"value": 44,
"name": "Contents",
"path": "InternetAccounts/Calendar.iaplugin/Contents"
}
]
},
{
"value": 784,
"name": "Exchange.iaplugin",
"path": "InternetAccounts/Exchange.iaplugin",
"children": [
{
"value": 784,
"name": "Contents",
"path": "InternetAccounts/Exchange.iaplugin/Contents"
}
]
},
{
"value": 996,
"name": "Facebook.iaplugin",
"path": "InternetAccounts/Facebook.iaplugin",
"children": [
{
"value": 996,
"name": "Contents",
"path": "InternetAccounts/Facebook.iaplugin/Contents"
}
]
},
{
"value": 596,
"name": "Flickr.iaplugin",
"path": "InternetAccounts/Flickr.iaplugin",
"children": [
{
"value": 596,
"name": "Contents",
"path": "InternetAccounts/Flickr.iaplugin/Contents"
}
]
},
{
"value": 384,
"name": "Google.iaplugin",
"path": "InternetAccounts/Google.iaplugin",
"children": [
{
"value": 384,
"name": "Contents",
"path": "InternetAccounts/Google.iaplugin/Contents"
}
]
},
{
"value": 32,
"name": "iChat.iaplugin",
"path": "InternetAccounts/iChat.iaplugin",
"children": [
{
"value": 32,
"name": "Contents",
"path": "InternetAccounts/iChat.iaplugin/Contents"
}
]
},
{
"value": 7436,
"name": "iCloud.iaplugin",
"path": "InternetAccounts/iCloud.iaplugin",
"children": [
{
"value": 7436,
"name": "Contents",
"path": "InternetAccounts/iCloud.iaplugin/Contents"
}
]
},
{
"value": 840,
"name": "LinkedIn.iaplugin",
"path": "InternetAccounts/LinkedIn.iaplugin",
"children": [
{
"value": 840,
"name": "Contents",
"path": "InternetAccounts/LinkedIn.iaplugin/Contents"
}
]
},
{
"value": 28,
"name": "Mail.iaplugin",
"path": "InternetAccounts/Mail.iaplugin",
"children": [
{
"value": 28,
"name": "Contents",
"path": "InternetAccounts/Mail.iaplugin/Contents"
}
]
},
{
"value": 32,
"name": "Notes.iaplugin",
"path": "InternetAccounts/Notes.iaplugin",
"children": [
{
"value": 32,
"name": "Contents",
"path": "InternetAccounts/Notes.iaplugin/Contents"
}
]
},
{
"value": 416,
"name": "OSXServer.iaplugin",
"path": "InternetAccounts/OSXServer.iaplugin",
"children": [
{
"value": 416,
"name": "Contents",
"path": "InternetAccounts/OSXServer.iaplugin/Contents"
}
]
},
{
"value": 376,
"name": "QQ.iaplugin",
"path": "InternetAccounts/QQ.iaplugin",
"children": [
{
"value": 376,
"name": "Contents",
"path": "InternetAccounts/QQ.iaplugin/Contents"
}
]
},
{
"value": 32,
"name": "Reminders.iaplugin",
"path": "InternetAccounts/Reminders.iaplugin",
"children": [
{
"value": 32,
"name": "Contents",
"path": "InternetAccounts/Reminders.iaplugin/Contents"
}
]
},
{
"value": 1024,
"name": "SetupPlugins",
"path": "InternetAccounts/SetupPlugins",
"children": [
{
"value": 412,
"name": "CalUIAccountSetup.iaplugin",
"path": "InternetAccounts/SetupPlugins/CalUIAccountSetup.iaplugin"
},
{
"value": 580,
"name": "Contacts.iaplugin",
"path": "InternetAccounts/SetupPlugins/Contacts.iaplugin"
},
{
"value": 8,
"name": "MailAccountSetup.iaplugin",
"path": "InternetAccounts/SetupPlugins/MailAccountSetup.iaplugin"
},
{
"value": 16,
"name": "Messages.iaplugin",
"path": "InternetAccounts/SetupPlugins/Messages.iaplugin"
},
{
"value": 8,
"name": "NotesAccountSetup.iaplugin",
"path": "InternetAccounts/SetupPlugins/NotesAccountSetup.iaplugin"
}
]
},
{
"value": 392,
"name": "TencentWeibo.iaplugin",
"path": "InternetAccounts/TencentWeibo.iaplugin",
"children": [
{
"value": 392,
"name": "Contents",
"path": "InternetAccounts/TencentWeibo.iaplugin/Contents"
}
]
},
{
"value": 612,
"name": "Tudou.iaplugin",
"path": "InternetAccounts/Tudou.iaplugin",
"children": [
{
"value": 612,
"name": "Contents",
"path": "InternetAccounts/Tudou.iaplugin/Contents"
}
]
},
{
"value": 608,
"name": "TwitterPlugin.iaplugin",
"path": "InternetAccounts/TwitterPlugin.iaplugin",
"children": [
{
"value": 608,
"name": "Contents",
"path": "InternetAccounts/TwitterPlugin.iaplugin/Contents"
}
]
},
{
"value": 584,
"name": "Vimeo.iaplugin",
"path": "InternetAccounts/Vimeo.iaplugin",
"children": [
{
"value": 584,
"name": "Contents",
"path": "InternetAccounts/Vimeo.iaplugin/Contents"
}
]
},
{
"value": 468,
"name": "Weibo.iaplugin",
"path": "InternetAccounts/Weibo.iaplugin",
"children": [
{
"value": 468,
"name": "Contents",
"path": "InternetAccounts/Weibo.iaplugin/Contents"
}
]
},
{
"value": 316,
"name": "Yahoo.iaplugin",
"path": "InternetAccounts/Yahoo.iaplugin",
"children": [
{
"value": 316,
"name": "Contents",
"path": "InternetAccounts/Yahoo.iaplugin/Contents"
}
]
},
{
"value": 648,
"name": "Youku.iaplugin",
"path": "InternetAccounts/Youku.iaplugin",
"children": [
{
"value": 648,
"name": "Contents",
"path": "InternetAccounts/Youku.iaplugin/Contents"
}
]
}
]
},
{
"value": 68776,
"name": "Java",
"path": "Java",
"children": [
{
"value": 8848,
"name": "Extensions",
"path": "Java/Extensions"
},
{
"value": 54012,
"name": "JavaVirtualMachines",
"path": "Java/JavaVirtualMachines",
"children": [
{
"value": 54012,
"name": "1.6.0.jdk",
"path": "Java/JavaVirtualMachines/1.6.0.jdk"
}
]
},
{
"value": 5916,
"name": "Support",
"path": "Java/Support",
"children": [
{
"value": 432,
"name": "Application",
"path": "ImageCapture/Support/Application"
},
{
"value": 1608,
"name": "Icons",
"path": "ImageCapture/Support/Icons"
},
{
"value": 172,
"name": "Image Capture Extension.app",
"path": "ImageCapture/Support/Image Capture Extension.app"
},
{
"value": 3184,
"name": "CoreDeploy.bundle",
"path": "Java/Support/CoreDeploy.bundle"
},
{
"value": 2732,
"name": "Deploy.bundle",
"path": "Java/Support/Deploy.bundle"
}
]
}
]
},
{
"value": 48,
"name": "KerberosPlugins",
"path": "KerberosPlugins",
"children": [
{
"value": 48,
"name": "KerberosFrameworkPlugins",
"path": "KerberosPlugins/KerberosFrameworkPlugins",
"children": [
{
"value": 8,
"name": "heimdalodpac.bundle",
"path": "KerberosPlugins/KerberosFrameworkPlugins/heimdalodpac.bundle"
},
{
"value": 16,
"name": "LKDCLocate.bundle",
"path": "KerberosPlugins/KerberosFrameworkPlugins/LKDCLocate.bundle"
},
{
"value": 12,
"name": "Reachability.bundle",
"path": "KerberosPlugins/KerberosFrameworkPlugins/Reachability.bundle"
},
{
"value": 12,
"name": "SCKerberosConfig.bundle",
"path": "KerberosPlugins/KerberosFrameworkPlugins/SCKerberosConfig.bundle"
}
]
}
]
},
{
"value": 276,
"name": "KeyboardLayouts",
"path": "KeyboardLayouts",
"children": [
{
"value": 276,
"name": "AppleKeyboardLayouts.bundle",
"path": "KeyboardLayouts/AppleKeyboardLayouts.bundle",
"children": [
{
"value": 276,
"name": "Contents",
"path": "KeyboardLayouts/AppleKeyboardLayouts.bundle/Contents"
}
]
}
]
},
{
"value": 408,
"name": "Keychains",
"path": "Keychains"
},
{
"value": 4,
"name": "LaunchAgents",
"path": "LaunchAgents"
},
{
"value": 20,
"name": "LaunchDaemons",
"path": "LaunchDaemons"
},
{
"value": 96532,
"name": "LinguisticData",
"path": "LinguisticData",
"children": [
{
"value": 8,
"name": "da",
"path": "LinguisticData/da"
},
{
"value": 16476,
"name": "de",
"path": "LinguisticData/de"
},
{
"value": 9788,
"name": "en",
"path": "LinguisticData/en",
"children": [
{
"value": 36,
"name": "GB",
"path": "LinguisticData/en/GB"
},
{
"value": 28,
"name": "US",
"path": "LinguisticData/en/US"
}
]
},
{
"value": 10276,
"name": "es",
"path": "LinguisticData/es"
},
{
"value": 0,
"name": "fi",
"path": "LinguisticData/fi"
},
{
"value": 12468,
"name": "fr",
"path": "LinguisticData/fr"
},
{
"value": 7336,
"name": "it",
"path": "LinguisticData/it"
},
{
"value": 192,
"name": "ko",
"path": "LinguisticData/ko"
},
{
"value": 48,
"name": "nl",
"path": "LinguisticData/nl"
},
{
"value": 112,
"name": "no",
"path": "LinguisticData/no"
},
{
"value": 4496,
"name": "pt",
"path": "LinguisticData/pt"
},
{
"value": 24,
"name": "ru",
"path": "LinguisticData/ru"
},
{
"value": 20,
"name": "sv",
"path": "LinguisticData/sv"
},
{
"value": 0,
"name": "tr",
"path": "LinguisticData/tr"
},
{
"value": 35288,
"name": "zh",
"path": "LinguisticData/zh",
"children": [
{
"value": 2604,
"name": "Hans",
"path": "LinguisticData/zh/Hans"
},
{
"value": 2868,
"name": "Hant",
"path": "LinguisticData/zh/Hant"
}
]
}
]
},
{
"value": 4,
"name": "LocationBundles",
"path": "LocationBundles"
},
{
"value": 800,
"name": "LoginPlugins",
"path": "LoginPlugins",
"children": [
{
"value": 348,
"name": "BezelServices.loginPlugin",
"path": "LoginPlugins/BezelServices.loginPlugin",
"children": [
{
"value": 348,
"name": "Contents",
"path": "LoginPlugins/BezelServices.loginPlugin/Contents"
}
]
},
{
"value": 108,
"name": "DisplayServices.loginPlugin",
"path": "LoginPlugins/DisplayServices.loginPlugin",
"children": [
{
"value": 108,
"name": "Contents",
"path": "LoginPlugins/DisplayServices.loginPlugin/Contents"
}
]
},
{
"value": 344,
"name": "FSDisconnect.loginPlugin",
"path": "LoginPlugins/FSDisconnect.loginPlugin",
"children": [
{
"value": 344,
"name": "Contents",
"path": "LoginPlugins/FSDisconnect.loginPlugin/Contents"
}
]
}
]
},
{
"value": 188,
"name": "Messages",
"path": "Messages",
"children": [
{
"value": 188,
"name": "PlugIns",
"path": "Messages/PlugIns",
"children": [
{
"value": 12,
"name": "Balloons.transcriptstyle",
"path": "Messages/PlugIns/Balloons.transcriptstyle"
},
{
"value": 8,
"name": "Boxes.transcriptstyle",
"path": "Messages/PlugIns/Boxes.transcriptstyle"
},
{
"value": 8,
"name": "Compact.transcriptstyle",
"path": "Messages/PlugIns/Compact.transcriptstyle"
},
{
"value": 76,
"name": "FaceTime.imservice",
"path": "Messages/PlugIns/FaceTime.imservice"
},
{
"value": 84,
"name": "iMessage.imservice",
"path": "Messages/PlugIns/iMessage.imservice"
}
]
}
]
},
{
"value": 0,
"name": "Metadata",
"path": "Metadata",
"children": [
{
"value": 0,
"name": "com.apple.finder.legacy.mdlabels",
"path": "Metadata/com.apple.finder.legacy.mdlabels",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Metadata/com.apple.finder.legacy.mdlabels/Contents"
}
]
}
]
},
{
"value": 3276,
"name": "MonitorPanels",
"path": "MonitorPanels",
"children": [
{
"value": 860,
"name": "AppleDisplay.monitorPanels",
"path": "MonitorPanels/AppleDisplay.monitorPanels",
"children": [
{
"value": 860,
"name": "Contents",
"path": "MonitorPanels/AppleDisplay.monitorPanels/Contents"
}
]
},
{
"value": 36,
"name": "Arrange.monitorPanel",
"path": "MonitorPanels/Arrange.monitorPanel",
"children": [
{
"value": 36,
"name": "Contents",
"path": "MonitorPanels/Arrange.monitorPanel/Contents"
}
]
},
{
"value": 2080,
"name": "Display.monitorPanel",
"path": "MonitorPanels/Display.monitorPanel",
"children": [
{
"value": 2080,
"name": "Contents",
"path": "MonitorPanels/Display.monitorPanel/Contents"
}
]
},
{
"value": 300,
"name": "Profile.monitorPanel",
"path": "MonitorPanels/Profile.monitorPanel",
"children": [
{
"value": 300,
"name": "Contents",
"path": "MonitorPanels/Profile.monitorPanel/Contents"
}
]
}
]
},
{
"value": 652,
"name": "OpenDirectory",
"path": "OpenDirectory",
"children": [
{
"value": 8,
"name": "Configurations",
"path": "OpenDirectory/Configurations"
},
{
"value": 0,
"name": "DynamicNodeTemplates",
"path": "OpenDirectory/DynamicNodeTemplates"
},
{
"value": 0,
"name": "ManagedClient",
"path": "OpenDirectory/ManagedClient"
},
{
"value": 12,
"name": "Mappings",
"path": "OpenDirectory/Mappings"
},
{
"value": 612,
"name": "Modules",
"path": "OpenDirectory/Modules",
"children": [
{
"value": 68,
"name": "ActiveDirectory.bundle",
"path": "OpenDirectory/Modules/ActiveDirectory.bundle"
},
{
"value": 12,
"name": "AppleID.bundle",
"path": "OpenDirectory/Modules/AppleID.bundle"
},
{
"value": 76,
"name": "AppleODClientLDAP.bundle",
"path": "OpenDirectory/Modules/AppleODClientLDAP.bundle"
},
{
"value": 68,
"name": "AppleODClientPWS.bundle",
"path": "OpenDirectory/Modules/AppleODClientPWS.bundle"
},
{
"value": 12,
"name": "ConfigurationProfiles.bundle",
"path": "OpenDirectory/Modules/ConfigurationProfiles.bundle"
},
{
"value": 20,
"name": "configure.bundle",
"path": "OpenDirectory/Modules/configure.bundle"
},
{
"value": 8,
"name": "FDESupport.bundle",
"path": "OpenDirectory/Modules/FDESupport.bundle"
},
{
"value": 12,
"name": "Kerberosv5.bundle",
"path": "OpenDirectory/Modules/Kerberosv5.bundle"
},
{
"value": 8,
"name": "keychain.bundle",
"path": "OpenDirectory/Modules/keychain.bundle"
},
{
"value": 44,
"name": "ldap.bundle",
"path": "OpenDirectory/Modules/ldap.bundle"
},
{
"value": 12,
"name": "legacy.bundle",
"path": "OpenDirectory/Modules/legacy.bundle"
},
{
"value": 12,
"name": "NetLogon.bundle",
"path": "OpenDirectory/Modules/NetLogon.bundle"
},
{
"value": 24,
"name": "nis.bundle",
"path": "OpenDirectory/Modules/nis.bundle"
},
{
"value": 68,
"name": "PlistFile.bundle",
"path": "OpenDirectory/Modules/PlistFile.bundle"
},
{
"value": 16,
"name": "proxy.bundle",
"path": "OpenDirectory/Modules/proxy.bundle"
},
{
"value": 20,
"name": "search.bundle",
"path": "OpenDirectory/Modules/search.bundle"
},
{
"value": 8,
"name": "statistics.bundle",
"path": "OpenDirectory/Modules/statistics.bundle"
},
{
"value": 124,
"name": "SystemCache.bundle",
"path": "OpenDirectory/Modules/SystemCache.bundle"
}
]
},
{
"value": 8,
"name": "Templates",
"path": "OpenDirectory/Templates",
"children": [
{
"value": 0,
"name": "LDAPv3",
"path": "DirectoryServices/Templates/LDAPv3"
}
]
}
]
},
{
"value": 0,
"name": "OpenSSL",
"path": "OpenSSL",
"children": [
{
"value": 0,
"name": "certs",
"path": "OpenSSL/certs"
},
{
"value": 0,
"name": "misc",
"path": "OpenSSL/misc"
},
{
"value": 0,
"name": "private",
"path": "OpenSSL/private"
}
]
},
{
"value": 8,
"name": "PasswordServer Filters",
"path": "PasswordServer Filters"
},
{
"value": 0,
"name": "PerformanceMetrics",
"path": "PerformanceMetrics"
},
{
"value": 57236,
"name": "Perl",
"path": "Perl",
"children": [
{
"value": 14848,
"name": "5.12",
"path": "Perl/5.12",
"children": [
{
"value": 20,
"name": "App",
"path": "Perl/5.12/App"
},
{
"value": 48,
"name": "Archive",
"path": "Perl/5.12/Archive"
},
{
"value": 12,
"name": "Attribute",
"path": "Perl/5.12/Attribute"
},
{
"value": 16,
"name": "autodie",
"path": "Perl/5.12/autodie"
},
{
"value": 56,
"name": "B",
"path": "Perl/5.12/B"
},
{
"value": 0,
"name": "Carp",
"path": "Perl/5.12/Carp"
},
{
"value": 32,
"name": "CGI",
"path": "Perl/5.12/CGI"
},
{
"value": 8,
"name": "Class",
"path": "Perl/5.12/Class"
},
{
"value": 12,
"name": "Compress",
"path": "Perl/5.12/Compress"
},
{
"value": 0,
"name": "Config",
"path": "Perl/5.12/Config"
},
{
"value": 120,
"name": "CPAN",
"path": "Perl/5.12/CPAN"
},
{
"value": 180,
"name": "CPANPLUS",
"path": "Perl/5.12/CPANPLUS"
},
{
"value": 7064,
"name": "darwin-thread-multi-2level",
"path": "Perl/5.12/darwin-thread-multi-2level"
},
{
"value": 0,
"name": "DBM_Filter",
"path": "Perl/5.12/DBM_Filter"
},
{
"value": 0,
"name": "Devel",
"path": "Perl/5.12/Devel"
},
{
"value": 0,
"name": "Digest",
"path": "Perl/5.12/Digest"
},
{
"value": 12,
"name": "Encode",
"path": "Perl/5.12/Encode"
},
{
"value": 0,
"name": "encoding",
"path": "Perl/5.12/encoding"
},
{
"value": 0,
"name": "Exporter",
"path": "Perl/5.12/Exporter"
},
{
"value": 224,
"name": "ExtUtils",
"path": "Perl/5.12/ExtUtils"
},
{
"value": 104,
"name": "File",
"path": "Perl/5.12/File"
},
{
"value": 12,
"name": "Filter",
"path": "Perl/5.12/Filter"
},
{
"value": 28,
"name": "Getopt",
"path": "Perl/5.12/Getopt"
},
{
"value": 24,
"name": "I18N",
"path": "Perl/5.12/I18N"
},
{
"value": 0,
"name": "inc",
"path": "Perl/5.12/inc"
},
{
"value": 152,
"name": "IO",
"path": "Perl/5.12/IO"
},
{
"value": 24,
"name": "IPC",
"path": "Perl/5.12/IPC"
},
{
"value": 60,
"name": "Locale",
"path": "Perl/5.12/Locale"
},
{
"value": 8,
"name": "Log",
"path": "Perl/5.12/Log"
},
{
"value": 144,
"name": "Math",
"path": "Perl/5.12/Math"
},
{
"value": 8,
"name": "Memoize",
"path": "Perl/5.12/Memoize"
},
{
"value": 284,
"name": "Module",
"path": "Perl/5.12/Module"
},
{
"value": 80,
"name": "Net",
"path": "Perl/5.12/Net"
},
{
"value": 8,
"name": "Object",
"path": "Perl/5.12/Object"
},
{
"value": 0,
"name": "overload",
"path": "Perl/5.12/overload"
},
{
"value": 0,
"name": "Package",
"path": "Perl/5.12/Package"
},
{
"value": 8,
"name": "Params",
"path": "Perl/5.12/Params"
},
{
"value": 0,
"name": "Parse",
"path": "Perl/5.12/Parse"
},
{
"value": 0,
"name": "PerlIO",
"path": "Perl/5.12/PerlIO"
},
{
"value": 312,
"name": "Pod",
"path": "Perl/5.12/Pod"
},
{
"value": 2452,
"name": "pods",
"path": "Perl/5.12/pods"
},
{
"value": 0,
"name": "Search",
"path": "Perl/5.12/Search"
},
{
"value": 32,
"name": "TAP",
"path": "Perl/5.12/TAP"
},
{
"value": 36,
"name": "Term",
"path": "Perl/5.12/Term"
},
{
"value": 60,
"name": "Test",
"path": "Perl/5.12/Test"
},
{
"value": 20,
"name": "Text",
"path": "Perl/5.12/Text"
},
{
"value": 8,
"name": "Thread",
"path": "Perl/5.12/Thread"
},
{
"value": 28,
"name": "Tie",
"path": "Perl/5.12/Tie"
},
{
"value": 8,
"name": "Time",
"path": "Perl/5.12/Time"
},
{
"value": 280,
"name": "Unicode",
"path": "Perl/5.12/Unicode"
},
{
"value": 2348,
"name": "unicore",
"path": "Perl/5.12/unicore"
},
{
"value": 8,
"name": "User",
"path": "Perl/5.12/User"
},
{
"value": 12,
"name": "version",
"path": "Perl/5.12/version"
},
{
"value": 0,
"name": "warnings",
"path": "Perl/5.12/warnings"
}
]
},
{
"value": 14072,
"name": "5.16",
"path": "Perl/5.16",
"children": [
{
"value": 20,
"name": "App",
"path": "Perl/5.16/App"
},
{
"value": 48,
"name": "Archive",
"path": "Perl/5.16/Archive"
},
{
"value": 12,
"name": "Attribute",
"path": "Perl/5.16/Attribute"
},
{
"value": 16,
"name": "autodie",
"path": "Perl/5.16/autodie"
},
{
"value": 56,
"name": "B",
"path": "Perl/5.16/B"
},
{
"value": 0,
"name": "Carp",
"path": "Perl/5.16/Carp"
},
{
"value": 32,
"name": "CGI",
"path": "Perl/5.16/CGI"
},
{
"value": 8,
"name": "Class",
"path": "Perl/5.16/Class"
},
{
"value": 12,
"name": "Compress",
"path": "Perl/5.16/Compress"
},
{
"value": 0,
"name": "Config",
"path": "Perl/5.16/Config"
},
{
"value": 192,
"name": "CPAN",
"path": "Perl/5.16/CPAN"
},
{
"value": 180,
"name": "CPANPLUS",
"path": "Perl/5.16/CPANPLUS"
},
{
"value": 7328,
"name": "darwin-thread-multi-2level",
"path": "Perl/5.16/darwin-thread-multi-2level"
},
{
"value": 0,
"name": "DBM_Filter",
"path": "Perl/5.16/DBM_Filter"
},
{
"value": 0,
"name": "Devel",
"path": "Perl/5.16/Devel"
},
{
"value": 0,
"name": "Digest",
"path": "Perl/5.16/Digest"
},
{
"value": 12,
"name": "Encode",
"path": "Perl/5.16/Encode"
},
{
"value": 0,
"name": "encoding",
"path": "Perl/5.16/encoding"
},
{
"value": 0,
"name": "Exporter",
"path": "Perl/5.16/Exporter"
},
{
"value": 248,
"name": "ExtUtils",
"path": "Perl/5.16/ExtUtils"
},
{
"value": 96,
"name": "File",
"path": "Perl/5.16/File"
},
{
"value": 12,
"name": "Filter",
"path": "Perl/5.16/Filter"
},
{
"value": 28,
"name": "Getopt",
"path": "Perl/5.16/Getopt"
},
{
"value": 12,
"name": "HTTP",
"path": "Perl/5.16/HTTP"
},
{
"value": 24,
"name": "I18N",
"path": "Perl/5.16/I18N"
},
{
"value": 0,
"name": "inc",
"path": "Perl/5.16/inc"
},
{
"value": 168,
"name": "IO",
"path": "Perl/5.16/IO"
},
{
"value": 28,
"name": "IPC",
"path": "Perl/5.16/IPC"
},
{
"value": 28,
"name": "JSON",
"path": "Perl/5.16/JSON"
},
{
"value": 372,
"name": "Locale",
"path": "Perl/5.16/Locale"
},
{
"value": 8,
"name": "Log",
"path": "Perl/5.16/Log"
},
{
"value": 148,
"name": "Math",
"path": "Perl/5.16/Math"
},
{
"value": 8,
"name": "Memoize",
"path": "Perl/5.16/Memoize"
},
{
"value": 212,
"name": "Module",
"path": "Perl/5.16/Module"
},
{
"value": 80,
"name": "Net",
"path": "Perl/5.16/Net"
},
{
"value": 8,
"name": "Object",
"path": "Perl/5.16/Object"
},
{
"value": 0,
"name": "overload",
"path": "Perl/5.16/overload"
},
{
"value": 0,
"name": "Package",
"path": "Perl/5.16/Package"
},
{
"value": 8,
"name": "Params",
"path": "Perl/5.16/Params"
},
{
"value": 0,
"name": "Parse",
"path": "Perl/5.16/Parse"
},
{
"value": 0,
"name": "Perl",
"path": "Perl/5.16/Perl"
},
{
"value": 0,
"name": "PerlIO",
"path": "Perl/5.16/PerlIO"
},
{
"value": 324,
"name": "Pod",
"path": "Perl/5.16/Pod"
},
{
"value": 2452,
"name": "pods",
"path": "Perl/5.16/pods"
},
{
"value": 0,
"name": "Search",
"path": "Perl/5.16/Search"
},
{
"value": 44,
"name": "TAP",
"path": "Perl/5.16/TAP"
},
{
"value": 36,
"name": "Term",
"path": "Perl/5.16/Term"
},
{
"value": 60,
"name": "Test",
"path": "Perl/5.16/Test"
},
{
"value": 20,
"name": "Text",
"path": "Perl/5.16/Text"
},
{
"value": 8,
"name": "Thread",
"path": "Perl/5.16/Thread"
},
{
"value": 28,
"name": "Tie",
"path": "Perl/5.16/Tie"
},
{
"value": 8,
"name": "Time",
"path": "Perl/5.16/Time"
},
{
"value": 684,
"name": "Unicode",
"path": "Perl/5.16/Unicode"
},
{
"value": 468,
"name": "unicore",
"path": "Perl/5.16/unicore"
},
{
"value": 8,
"name": "User",
"path": "Perl/5.16/User"
},
{
"value": 12,
"name": "version",
"path": "Perl/5.16/version"
},
{
"value": 0,
"name": "warnings",
"path": "Perl/5.16/warnings"
}
]
},
{
"value": 28316,
"name": "Extras",
"path": "Perl/Extras",
"children": [
{
"value": 14188,
"name": "5.12",
"path": "Perl/Extras/5.12"
},
{
"value": 14128,
"name": "5.16",
"path": "Perl/Extras/5.16"
}
]
}
]
},
{
"value": 226552,
"name": "PreferencePanes",
"path": "PreferencePanes",
"children": [
{
"value": 5380,
"name": "Accounts.prefPane",
"path": "PreferencePanes/Accounts.prefPane",
"children": [
{
"value": 5380,
"name": "Contents",
"path": "PreferencePanes/Accounts.prefPane/Contents"
}
]
},
{
"value": 1448,
"name": "Appearance.prefPane",
"path": "PreferencePanes/Appearance.prefPane",
"children": [
{
"value": 1448,
"name": "Contents",
"path": "PreferencePanes/Appearance.prefPane/Contents"
}
]
},
{
"value": 2008,
"name": "AppStore.prefPane",
"path": "PreferencePanes/AppStore.prefPane",
"children": [
{
"value": 2008,
"name": "Contents",
"path": "PreferencePanes/AppStore.prefPane/Contents"
}
]
},
{
"value": 1636,
"name": "Bluetooth.prefPane",
"path": "PreferencePanes/Bluetooth.prefPane",
"children": [
{
"value": 1636,
"name": "Contents",
"path": "PreferencePanes/Bluetooth.prefPane/Contents"
}
]
},
{
"value": 2348,
"name": "DateAndTime.prefPane",
"path": "PreferencePanes/DateAndTime.prefPane",
"children": [
{
"value": 2348,
"name": "Contents",
"path": "PreferencePanes/DateAndTime.prefPane/Contents"
}
]
},
{
"value": 4644,
"name": "DesktopScreenEffectsPref.prefPane",
"path": "PreferencePanes/DesktopScreenEffectsPref.prefPane",
"children": [
{
"value": 4644,
"name": "Contents",
"path": "PreferencePanes/DesktopScreenEffectsPref.prefPane/Contents"
}
]
},
{
"value": 2148,
"name": "DigiHubDiscs.prefPane",
"path": "PreferencePanes/DigiHubDiscs.prefPane",
"children": [
{
"value": 2148,
"name": "Contents",
"path": "PreferencePanes/DigiHubDiscs.prefPane/Contents"
}
]
},
{
"value": 624,
"name": "Displays.prefPane",
"path": "PreferencePanes/Displays.prefPane",
"children": [
{
"value": 624,
"name": "Contents",
"path": "PreferencePanes/Displays.prefPane/Contents"
}
]
},
{
"value": 1012,
"name": "Dock.prefPane",
"path": "PreferencePanes/Dock.prefPane",
"children": [
{
"value": 1012,
"name": "Contents",
"path": "PreferencePanes/Dock.prefPane/Contents"
}
]
},
{
"value": 2568,
"name": "EnergySaver.prefPane",
"path": "PreferencePanes/EnergySaver.prefPane",
"children": [
{
"value": 2568,
"name": "Contents",
"path": "PreferencePanes/EnergySaver.prefPane/Contents"
}
]
},
{
"value": 3056,
"name": "Expose.prefPane",
"path": "PreferencePanes/Expose.prefPane",
"children": [
{
"value": 3056,
"name": "Contents",
"path": "PreferencePanes/Expose.prefPane/Contents"
}
]
},
{
"value": 156,
"name": "FibreChannel.prefPane",
"path": "PreferencePanes/FibreChannel.prefPane",
"children": [
{
"value": 156,
"name": "Contents",
"path": "PreferencePanes/FibreChannel.prefPane/Contents"
}
]
},
{
"value": 252,
"name": "iCloudPref.prefPane",
"path": "PreferencePanes/iCloudPref.prefPane",
"children": [
{
"value": 252,
"name": "Contents",
"path": "PreferencePanes/iCloudPref.prefPane/Contents"
}
]
},
{
"value": 1588,
"name": "Ink.prefPane",
"path": "PreferencePanes/Ink.prefPane",
"children": [
{
"value": 1588,
"name": "Contents",
"path": "PreferencePanes/Ink.prefPane/Contents"
}
]
},
{
"value": 4616,
"name": "InternetAccounts.prefPane",
"path": "PreferencePanes/InternetAccounts.prefPane",
"children": [
{
"value": 4616,
"name": "Contents",
"path": "PreferencePanes/InternetAccounts.prefPane/Contents"
}
]
},
{
"value": 3676,
"name": "Keyboard.prefPane",
"path": "PreferencePanes/Keyboard.prefPane",
"children": [
{
"value": 3676,
"name": "Contents",
"path": "PreferencePanes/Keyboard.prefPane/Contents"
}
]
},
{
"value": 3468,
"name": "Localization.prefPane",
"path": "PreferencePanes/Localization.prefPane",
"children": [
{
"value": 3468,
"name": "Contents",
"path": "PreferencePanes/Localization.prefPane/Contents"
}
]
},
{
"value": 23180,
"name": "Mouse.prefPane",
"path": "PreferencePanes/Mouse.prefPane",
"children": [
{
"value": 23180,
"name": "Contents",
"path": "PreferencePanes/Mouse.prefPane/Contents"
}
]
},
{
"value": 20588,
"name": "Network.prefPane",
"path": "PreferencePanes/Network.prefPane",
"children": [
{
"value": 20588,
"name": "Contents",
"path": "PreferencePanes/Network.prefPane/Contents"
}
]
},
{
"value": 1512,
"name": "Notifications.prefPane",
"path": "PreferencePanes/Notifications.prefPane",
"children": [
{
"value": 1512,
"name": "Contents",
"path": "PreferencePanes/Notifications.prefPane/Contents"
}
]
},
{
"value": 7648,
"name": "ParentalControls.prefPane",
"path": "PreferencePanes/ParentalControls.prefPane",
"children": [
{
"value": 7648,
"name": "Contents",
"path": "PreferencePanes/ParentalControls.prefPane/Contents"
}
]
},
{
"value": 4060,
"name": "PrintAndScan.prefPane",
"path": "PreferencePanes/PrintAndScan.prefPane",
"children": [
{
"value": 4060,
"name": "Contents",
"path": "PreferencePanes/PrintAndScan.prefPane/Contents"
}
]
},
{
"value": 1904,
"name": "Profiles.prefPane",
"path": "PreferencePanes/Profiles.prefPane",
"children": [
{
"value": 1904,
"name": "Contents",
"path": "PreferencePanes/Profiles.prefPane/Contents"
}
]
},
{
"value": 6280,
"name": "Security.prefPane",
"path": "PreferencePanes/Security.prefPane",
"children": [
{
"value": 6280,
"name": "Contents",
"path": "PreferencePanes/Security.prefPane/Contents"
}
]
},
{
"value": 9608,
"name": "SharingPref.prefPane",
"path": "PreferencePanes/SharingPref.prefPane",
"children": [
{
"value": 9608,
"name": "Contents",
"path": "PreferencePanes/SharingPref.prefPane/Contents"
}
]
},
{
"value": 2204,
"name": "Sound.prefPane",
"path": "PreferencePanes/Sound.prefPane",
"children": [
{
"value": 2204,
"name": "Contents",
"path": "PreferencePanes/Sound.prefPane/Contents"
}
]
},
{
"value": 1072,
"name": "Speech.prefPane",
"path": "PreferencePanes/Speech.prefPane",
"children": [
{
"value": 1072,
"name": "Contents",
"path": "PreferencePanes/Speech.prefPane/Contents"
}
]
},
{
"value": 1112,
"name": "Spotlight.prefPane",
"path": "PreferencePanes/Spotlight.prefPane",
"children": [
{
"value": 1112,
"name": "Contents",
"path": "PreferencePanes/Spotlight.prefPane/Contents"
}
]
},
{
"value": 2040,
"name": "StartupDisk.prefPane",
"path": "PreferencePanes/StartupDisk.prefPane",
"children": [
{
"value": 2040,
"name": "Contents",
"path": "PreferencePanes/StartupDisk.prefPane/Contents"
}
]
},
{
"value": 3080,
"name": "TimeMachine.prefPane",
"path": "PreferencePanes/TimeMachine.prefPane",
"children": [
{
"value": 3080,
"name": "Contents",
"path": "PreferencePanes/TimeMachine.prefPane/Contents"
}
]
},
{
"value": 93312,
"name": "Trackpad.prefPane",
"path": "PreferencePanes/Trackpad.prefPane",
"children": [
{
"value": 93312,
"name": "Contents",
"path": "PreferencePanes/Trackpad.prefPane/Contents"
}
]
},
{
"value": 7680,
"name": "UniversalAccessPref.prefPane",
"path": "PreferencePanes/UniversalAccessPref.prefPane",
"children": [
{
"value": 7680,
"name": "Contents",
"path": "PreferencePanes/UniversalAccessPref.prefPane/Contents"
}
]
},
{
"value": 640,
"name": "Xsan.prefPane",
"path": "PreferencePanes/Xsan.prefPane",
"children": [
{
"value": 640,
"name": "Contents",
"path": "PreferencePanes/Xsan.prefPane/Contents"
}
]
}
]
},
{
"value": 224,
"name": "Printers",
"path": "Printers",
"children": [
{
"value": 224,
"name": "Libraries",
"path": "Printers/Libraries",
"children": [
{
"value": 24,
"name": "USBGenericPrintingClass.plugin",
"path": "Printers/Libraries/USBGenericPrintingClass.plugin"
},
{
"value": 24,
"name": "USBGenericTOPrintingClass.plugin",
"path": "Printers/Libraries/USBGenericTOPrintingClass.plugin"
}
]
}
]
},
{
"value": 586092,
"name": "PrivateFrameworks",
"path": "PrivateFrameworks",
"children": [
{
"value": 52,
"name": "AccessibilityBundles.framework",
"path": "PrivateFrameworks/AccessibilityBundles.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/AccessibilityBundles.framework/Versions"
}
]
},
{
"value": 348,
"name": "AccountsDaemon.framework",
"path": "PrivateFrameworks/AccountsDaemon.framework",
"children": [
{
"value": 332,
"name": "Versions",
"path": "PrivateFrameworks/AccountsDaemon.framework/Versions"
},
{
"value": 8,
"name": "XPCServices",
"path": "PrivateFrameworks/AccountsDaemon.framework/XPCServices"
}
]
},
{
"value": 168,
"name": "Admin.framework",
"path": "PrivateFrameworks/Admin.framework",
"children": [
{
"value": 160,
"name": "Versions",
"path": "PrivateFrameworks/Admin.framework/Versions"
}
]
},
{
"value": 408,
"name": "AirPortDevices.framework",
"path": "PrivateFrameworks/AirPortDevices.framework",
"children": [
{
"value": 408,
"name": "Versions",
"path": "PrivateFrameworks/AirPortDevices.framework/Versions"
}
]
},
{
"value": 1324,
"name": "AirTrafficHost.framework",
"path": "PrivateFrameworks/AirTrafficHost.framework",
"children": [
{
"value": 1276,
"name": "Versions",
"path": "PrivateFrameworks/AirTrafficHost.framework/Versions"
}
]
},
{
"value": 2408,
"name": "Altitude.framework",
"path": "PrivateFrameworks/Altitude.framework",
"children": [
{
"value": 2400,
"name": "Versions",
"path": "PrivateFrameworks/Altitude.framework/Versions"
}
]
},
{
"value": 224,
"name": "AOSAccounts.framework",
"path": "PrivateFrameworks/AOSAccounts.framework",
"children": [
{
"value": 216,
"name": "Versions",
"path": "PrivateFrameworks/AOSAccounts.framework/Versions"
}
]
},
{
"value": 4672,
"name": "AOSKit.framework",
"path": "PrivateFrameworks/AOSKit.framework",
"children": [
{
"value": 4656,
"name": "Versions",
"path": "PrivateFrameworks/AOSKit.framework/Versions"
}
]
},
{
"value": 20,
"name": "AOSMigrate.framework",
"path": "PrivateFrameworks/AOSMigrate.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "PrivateFrameworks/AOSMigrate.framework/Versions"
}
]
},
{
"value": 1300,
"name": "AOSNotification.framework",
"path": "PrivateFrameworks/AOSNotification.framework",
"children": [
{
"value": 52,
"name": "Versions",
"path": "PrivateFrameworks/AOSNotification.framework/Versions"
}
]
},
{
"value": 16500,
"name": "AOSUI.framework",
"path": "PrivateFrameworks/AOSUI.framework",
"children": [
{
"value": 16492,
"name": "Versions",
"path": "PrivateFrameworks/AOSUI.framework/Versions"
}
]
},
{
"value": 124,
"name": "AppContainer.framework",
"path": "PrivateFrameworks/AppContainer.framework",
"children": [
{
"value": 116,
"name": "Versions",
"path": "PrivateFrameworks/AppContainer.framework/Versions"
}
]
},
{
"value": 324,
"name": "Apple80211.framework",
"path": "PrivateFrameworks/Apple80211.framework",
"children": [
{
"value": 316,
"name": "Versions",
"path": "PrivateFrameworks/Apple80211.framework/Versions"
}
]
},
{
"value": 20,
"name": "AppleAppSupport.framework",
"path": "PrivateFrameworks/AppleAppSupport.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "PrivateFrameworks/AppleAppSupport.framework/Versions"
}
]
},
{
"value": 88,
"name": "AppleFSCompression.framework",
"path": "PrivateFrameworks/AppleFSCompression.framework",
"children": [
{
"value": 80,
"name": "Versions",
"path": "PrivateFrameworks/AppleFSCompression.framework/Versions"
}
]
},
{
"value": 712,
"name": "AppleGVA.framework",
"path": "PrivateFrameworks/AppleGVA.framework",
"children": [
{
"value": 704,
"name": "Versions",
"path": "PrivateFrameworks/AppleGVA.framework/Versions"
}
]
},
{
"value": 88,
"name": "AppleGVACore.framework",
"path": "PrivateFrameworks/AppleGVACore.framework",
"children": [
{
"value": 80,
"name": "Versions",
"path": "PrivateFrameworks/AppleGVACore.framework/Versions"
}
]
},
{
"value": 52,
"name": "AppleLDAP.framework",
"path": "PrivateFrameworks/AppleLDAP.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/AppleLDAP.framework/Versions"
}
]
},
{
"value": 588,
"name": "AppleProfileFamily.framework",
"path": "PrivateFrameworks/AppleProfileFamily.framework",
"children": [
{
"value": 580,
"name": "Versions",
"path": "PrivateFrameworks/AppleProfileFamily.framework/Versions"
}
]
},
{
"value": 508,
"name": "ApplePushService.framework",
"path": "PrivateFrameworks/ApplePushService.framework",
"children": [
{
"value": 128,
"name": "Versions",
"path": "PrivateFrameworks/ApplePushService.framework/Versions"
}
]
},
{
"value": 672,
"name": "AppleScript.framework",
"path": "PrivateFrameworks/AppleScript.framework",
"children": [
{
"value": 664,
"name": "Versions",
"path": "PrivateFrameworks/AppleScript.framework/Versions"
}
]
},
{
"value": 68,
"name": "AppleSRP.framework",
"path": "PrivateFrameworks/AppleSRP.framework",
"children": [
{
"value": 60,
"name": "Versions",
"path": "PrivateFrameworks/AppleSRP.framework/Versions"
}
]
},
{
"value": 44,
"name": "AppleSystemInfo.framework",
"path": "PrivateFrameworks/AppleSystemInfo.framework",
"children": [
{
"value": 36,
"name": "Versions",
"path": "PrivateFrameworks/AppleSystemInfo.framework/Versions"
}
]
},
{
"value": 336,
"name": "AppleVA.framework",
"path": "PrivateFrameworks/AppleVA.framework",
"children": [
{
"value": 328,
"name": "Versions",
"path": "PrivateFrameworks/AppleVA.framework/Versions"
}
]
},
{
"value": 72,
"name": "AppSandbox.framework",
"path": "PrivateFrameworks/AppSandbox.framework",
"children": [
{
"value": 64,
"name": "Versions",
"path": "PrivateFrameworks/AppSandbox.framework/Versions"
}
]
},
{
"value": 380,
"name": "Assistant.framework",
"path": "PrivateFrameworks/Assistant.framework",
"children": [
{
"value": 372,
"name": "Versions",
"path": "PrivateFrameworks/Assistant.framework/Versions"
}
]
},
{
"value": 1772,
"name": "AssistantServices.framework",
"path": "PrivateFrameworks/AssistantServices.framework",
"children": [
{
"value": 116,
"name": "Versions",
"path": "PrivateFrameworks/AssistantServices.framework/Versions"
}
]
},
{
"value": 684,
"name": "AssistiveControlSupport.framework",
"path": "PrivateFrameworks/AssistiveControlSupport.framework",
"children": [
{
"value": 224,
"name": "Frameworks",
"path": "PrivateFrameworks/AssistiveControlSupport.framework/Frameworks"
},
{
"value": 452,
"name": "Versions",
"path": "PrivateFrameworks/AssistiveControlSupport.framework/Versions"
}
]
},
{
"value": 1880,
"name": "AVConference.framework",
"path": "PrivateFrameworks/AVConference.framework",
"children": [
{
"value": 388,
"name": "Frameworks",
"path": "PrivateFrameworks/AVConference.framework/Frameworks"
},
{
"value": 1484,
"name": "Versions",
"path": "PrivateFrameworks/AVConference.framework/Versions"
}
]
},
{
"value": 168,
"name": "AVCore.framework",
"path": "PrivateFrameworks/AVCore.framework",
"children": [
{
"value": 160,
"name": "Versions",
"path": "PrivateFrameworks/AVCore.framework/Versions"
}
]
},
{
"value": 296,
"name": "AVFoundationCF.framework",
"path": "PrivateFrameworks/AVFoundationCF.framework",
"children": [
{
"value": 288,
"name": "Versions",
"path": "PrivateFrameworks/AVFoundationCF.framework/Versions"
}
]
},
{
"value": 3728,
"name": "Backup.framework",
"path": "PrivateFrameworks/Backup.framework",
"children": [
{
"value": 3720,
"name": "Versions",
"path": "PrivateFrameworks/Backup.framework/Versions"
}
]
},
{
"value": 52,
"name": "BezelServices.framework",
"path": "PrivateFrameworks/BezelServices.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/BezelServices.framework/Versions"
}
]
},
{
"value": 316,
"name": "Bom.framework",
"path": "PrivateFrameworks/Bom.framework",
"children": [
{
"value": 308,
"name": "Versions",
"path": "PrivateFrameworks/Bom.framework/Versions"
}
]
},
{
"value": 88,
"name": "BookKit.framework",
"path": "PrivateFrameworks/BookKit.framework",
"children": [
{
"value": 76,
"name": "Versions",
"path": "PrivateFrameworks/BookKit.framework/Versions"
}
]
},
{
"value": 124,
"name": "BookmarkDAV.framework",
"path": "PrivateFrameworks/BookmarkDAV.framework",
"children": [
{
"value": 108,
"name": "Versions",
"path": "PrivateFrameworks/BookmarkDAV.framework/Versions"
}
]
},
{
"value": 1732,
"name": "BrowserKit.framework",
"path": "PrivateFrameworks/BrowserKit.framework",
"children": [
{
"value": 1724,
"name": "Versions",
"path": "PrivateFrameworks/BrowserKit.framework/Versions"
}
]
},
{
"value": 52,
"name": "ByteRangeLocking.framework",
"path": "PrivateFrameworks/ByteRangeLocking.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/ByteRangeLocking.framework/Versions"
}
]
},
{
"value": 64,
"name": "Calculate.framework",
"path": "PrivateFrameworks/Calculate.framework",
"children": [
{
"value": 56,
"name": "Versions",
"path": "PrivateFrameworks/Calculate.framework/Versions"
}
]
},
{
"value": 356,
"name": "CalDAV.framework",
"path": "PrivateFrameworks/CalDAV.framework",
"children": [
{
"value": 348,
"name": "Versions",
"path": "PrivateFrameworks/CalDAV.framework/Versions"
}
]
},
{
"value": 104,
"name": "CalendarAgent.framework",
"path": "PrivateFrameworks/CalendarAgent.framework",
"children": [
{
"value": 8,
"name": "Executables",
"path": "PrivateFrameworks/CalendarAgent.framework/Executables"
},
{
"value": 88,
"name": "Versions",
"path": "PrivateFrameworks/CalendarAgent.framework/Versions"
}
]
},
{
"value": 88,
"name": "CalendarAgentLink.framework",
"path": "PrivateFrameworks/CalendarAgentLink.framework",
"children": [
{
"value": 80,
"name": "Versions",
"path": "PrivateFrameworks/CalendarAgentLink.framework/Versions"
}
]
},
{
"value": 220,
"name": "CalendarDraw.framework",
"path": "PrivateFrameworks/CalendarDraw.framework",
"children": [
{
"value": 212,
"name": "Versions",
"path": "PrivateFrameworks/CalendarDraw.framework/Versions"
}
]
},
{
"value": 196,
"name": "CalendarFoundation.framework",
"path": "PrivateFrameworks/CalendarFoundation.framework",
"children": [
{
"value": 188,
"name": "Versions",
"path": "PrivateFrameworks/CalendarFoundation.framework/Versions"
}
]
},
{
"value": 4872,
"name": "CalendarPersistence.framework",
"path": "PrivateFrameworks/CalendarPersistence.framework",
"children": [
{
"value": 4864,
"name": "Versions",
"path": "PrivateFrameworks/CalendarPersistence.framework/Versions"
}
]
},
{
"value": 900,
"name": "CalendarUI.framework",
"path": "PrivateFrameworks/CalendarUI.framework",
"children": [
{
"value": 892,
"name": "Versions",
"path": "PrivateFrameworks/CalendarUI.framework/Versions"
}
]
},
{
"value": 76,
"name": "CaptiveNetwork.framework",
"path": "PrivateFrameworks/CaptiveNetwork.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "PrivateFrameworks/CaptiveNetwork.framework/Versions"
}
]
},
{
"value": 1180,
"name": "CharacterPicker.framework",
"path": "PrivateFrameworks/CharacterPicker.framework",
"children": [
{
"value": 1168,
"name": "Versions",
"path": "PrivateFrameworks/CharacterPicker.framework/Versions"
}
]
},
{
"value": 192,
"name": "ChunkingLibrary.framework",
"path": "PrivateFrameworks/ChunkingLibrary.framework",
"children": [
{
"value": 184,
"name": "Versions",
"path": "PrivateFrameworks/ChunkingLibrary.framework/Versions"
}
]
},
{
"value": 48,
"name": "ClockMenuExtraPreferences.framework",
"path": "PrivateFrameworks/ClockMenuExtraPreferences.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/ClockMenuExtraPreferences.framework/Versions"
}
]
},
{
"value": 160,
"name": "CloudServices.framework",
"path": "PrivateFrameworks/CloudServices.framework",
"children": [
{
"value": 104,
"name": "Versions",
"path": "PrivateFrameworks/CloudServices.framework/Versions"
},
{
"value": 48,
"name": "XPCServices",
"path": "PrivateFrameworks/CloudServices.framework/XPCServices"
}
]
},
{
"value": 10768,
"name": "CommerceKit.framework",
"path": "PrivateFrameworks/CommerceKit.framework",
"children": [
{
"value": 10752,
"name": "Versions",
"path": "PrivateFrameworks/CommerceKit.framework/Versions"
}
]
},
{
"value": 68,
"name": "CommonAuth.framework",
"path": "PrivateFrameworks/CommonAuth.framework",
"children": [
{
"value": 60,
"name": "Versions",
"path": "PrivateFrameworks/CommonAuth.framework/Versions"
}
]
},
{
"value": 120,
"name": "CommonCandidateWindow.framework",
"path": "PrivateFrameworks/CommonCandidateWindow.framework",
"children": [
{
"value": 112,
"name": "Versions",
"path": "PrivateFrameworks/CommonCandidateWindow.framework/Versions"
}
]
},
{
"value": 72,
"name": "CommunicationsFilter.framework",
"path": "PrivateFrameworks/CommunicationsFilter.framework",
"children": [
{
"value": 28,
"name": "CMFSyncAgent.app",
"path": "PrivateFrameworks/CommunicationsFilter.framework/CMFSyncAgent.app"
},
{
"value": 36,
"name": "Versions",
"path": "PrivateFrameworks/CommunicationsFilter.framework/Versions"
}
]
},
{
"value": 24,
"name": "ConfigProfileHelper.framework",
"path": "PrivateFrameworks/ConfigProfileHelper.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/ConfigProfileHelper.framework/Versions"
}
]
},
{
"value": 156,
"name": "ConfigurationProfiles.framework",
"path": "PrivateFrameworks/ConfigurationProfiles.framework",
"children": [
{
"value": 148,
"name": "Versions",
"path": "PrivateFrameworks/ConfigurationProfiles.framework/Versions"
}
]
},
{
"value": 20,
"name": "ContactsAssistantServices.framework",
"path": "PrivateFrameworks/ContactsAssistantServices.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "PrivateFrameworks/ContactsAssistantServices.framework/Versions"
}
]
},
{
"value": 72,
"name": "ContactsAutocomplete.framework",
"path": "PrivateFrameworks/ContactsAutocomplete.framework",
"children": [
{
"value": 64,
"name": "Versions",
"path": "PrivateFrameworks/ContactsAutocomplete.framework/Versions"
}
]
},
{
"value": 24,
"name": "ContactsData.framework",
"path": "PrivateFrameworks/ContactsData.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/ContactsData.framework/Versions"
}
]
},
{
"value": 60,
"name": "ContactsFoundation.framework",
"path": "PrivateFrameworks/ContactsFoundation.framework",
"children": [
{
"value": 52,
"name": "Versions",
"path": "PrivateFrameworks/ContactsFoundation.framework/Versions"
}
]
},
{
"value": 100,
"name": "ContactsUI.framework",
"path": "PrivateFrameworks/ContactsUI.framework",
"children": [
{
"value": 92,
"name": "Versions",
"path": "PrivateFrameworks/ContactsUI.framework/Versions"
}
]
},
{
"value": 1668,
"name": "CoreADI.framework",
"path": "PrivateFrameworks/CoreADI.framework",
"children": [
{
"value": 1660,
"name": "Versions",
"path": "PrivateFrameworks/CoreADI.framework/Versions"
}
]
},
{
"value": 4092,
"name": "CoreAUC.framework",
"path": "PrivateFrameworks/CoreAUC.framework",
"children": [
{
"value": 4084,
"name": "Versions",
"path": "PrivateFrameworks/CoreAUC.framework/Versions"
}
]
},
{
"value": 200,
"name": "CoreAVCHD.framework",
"path": "PrivateFrameworks/CoreAVCHD.framework",
"children": [
{
"value": 192,
"name": "Versions",
"path": "PrivateFrameworks/CoreAVCHD.framework/Versions"
}
]
},
{
"value": 2624,
"name": "CoreChineseEngine.framework",
"path": "PrivateFrameworks/CoreChineseEngine.framework",
"children": [
{
"value": 2616,
"name": "Versions",
"path": "PrivateFrameworks/CoreChineseEngine.framework/Versions"
}
]
},
{
"value": 240,
"name": "CoreDaemon.framework",
"path": "PrivateFrameworks/CoreDaemon.framework",
"children": [
{
"value": 232,
"name": "Versions",
"path": "PrivateFrameworks/CoreDaemon.framework/Versions"
}
]
},
{
"value": 488,
"name": "CoreDAV.framework",
"path": "PrivateFrameworks/CoreDAV.framework",
"children": [
{
"value": 480,
"name": "Versions",
"path": "PrivateFrameworks/CoreDAV.framework/Versions"
}
]
},
{
"value": 19280,
"name": "CoreFP.framework",
"path": "PrivateFrameworks/CoreFP.framework",
"children": [
{
"value": 19268,
"name": "Versions",
"path": "PrivateFrameworks/CoreFP.framework/Versions"
}
]
},
{
"value": 16124,
"name": "CoreHandwriting.framework",
"path": "PrivateFrameworks/CoreHandwriting.framework",
"children": [
{
"value": 16116,
"name": "Versions",
"path": "PrivateFrameworks/CoreHandwriting.framework/Versions"
}
]
},
{
"value": 2124,
"name": "CoreKE.framework",
"path": "PrivateFrameworks/CoreKE.framework",
"children": [
{
"value": 2116,
"name": "Versions",
"path": "PrivateFrameworks/CoreKE.framework/Versions"
}
]
},
{
"value": 7856,
"name": "CoreLSKD.framework",
"path": "PrivateFrameworks/CoreLSKD.framework",
"children": [
{
"value": 7848,
"name": "Versions",
"path": "PrivateFrameworks/CoreLSKD.framework/Versions"
}
]
},
{
"value": 824,
"name": "CoreMediaAuthoring.framework",
"path": "PrivateFrameworks/CoreMediaAuthoring.framework",
"children": [
{
"value": 816,
"name": "Versions",
"path": "PrivateFrameworks/CoreMediaAuthoring.framework/Versions"
}
]
},
{
"value": 784,
"name": "CoreMediaIOServicesPrivate.framework",
"path": "PrivateFrameworks/CoreMediaIOServicesPrivate.framework",
"children": [
{
"value": 776,
"name": "Versions",
"path": "PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions"
}
]
},
{
"value": 116,
"name": "CoreMediaPrivate.framework",
"path": "PrivateFrameworks/CoreMediaPrivate.framework",
"children": [
{
"value": 108,
"name": "Versions",
"path": "PrivateFrameworks/CoreMediaPrivate.framework/Versions"
}
]
},
{
"value": 292,
"name": "CoreMediaStream.framework",
"path": "PrivateFrameworks/CoreMediaStream.framework",
"children": [
{
"value": 284,
"name": "Versions",
"path": "PrivateFrameworks/CoreMediaStream.framework/Versions"
}
]
},
{
"value": 1436,
"name": "CorePDF.framework",
"path": "PrivateFrameworks/CorePDF.framework",
"children": [
{
"value": 1428,
"name": "Versions",
"path": "PrivateFrameworks/CorePDF.framework/Versions"
}
]
},
{
"value": 1324,
"name": "CoreProfile.framework",
"path": "PrivateFrameworks/CoreProfile.framework",
"children": [
{
"value": 1312,
"name": "Versions",
"path": "PrivateFrameworks/CoreProfile.framework/Versions"
}
]
},
{
"value": 1384,
"name": "CoreRAID.framework",
"path": "PrivateFrameworks/CoreRAID.framework",
"children": [
{
"value": 1372,
"name": "Versions",
"path": "PrivateFrameworks/CoreRAID.framework/Versions"
}
]
},
{
"value": 128,
"name": "CoreRecents.framework",
"path": "PrivateFrameworks/CoreRecents.framework",
"children": [
{
"value": 120,
"name": "Versions",
"path": "PrivateFrameworks/CoreRecents.framework/Versions"
}
]
},
{
"value": 832,
"name": "CoreRecognition.framework",
"path": "PrivateFrameworks/CoreRecognition.framework",
"children": [
{
"value": 824,
"name": "Versions",
"path": "PrivateFrameworks/CoreRecognition.framework/Versions"
}
]
},
{
"value": 104,
"name": "CoreSDB.framework",
"path": "PrivateFrameworks/CoreSDB.framework",
"children": [
{
"value": 96,
"name": "Versions",
"path": "PrivateFrameworks/CoreSDB.framework/Versions"
}
]
},
{
"value": 280,
"name": "CoreServicesInternal.framework",
"path": "PrivateFrameworks/CoreServicesInternal.framework",
"children": [
{
"value": 272,
"name": "Versions",
"path": "PrivateFrameworks/CoreServicesInternal.framework/Versions"
}
]
},
{
"value": 576,
"name": "CoreSymbolication.framework",
"path": "PrivateFrameworks/CoreSymbolication.framework",
"children": [
{
"value": 536,
"name": "Versions",
"path": "PrivateFrameworks/CoreSymbolication.framework/Versions"
}
]
},
{
"value": 476,
"name": "CoreThemeDefinition.framework",
"path": "PrivateFrameworks/CoreThemeDefinition.framework",
"children": [
{
"value": 468,
"name": "Versions",
"path": "PrivateFrameworks/CoreThemeDefinition.framework/Versions"
}
]
},
{
"value": 4976,
"name": "CoreUI.framework",
"path": "PrivateFrameworks/CoreUI.framework",
"children": [
{
"value": 4968,
"name": "Versions",
"path": "PrivateFrameworks/CoreUI.framework/Versions"
}
]
},
{
"value": 576,
"name": "CoreUtils.framework",
"path": "PrivateFrameworks/CoreUtils.framework",
"children": [
{
"value": 568,
"name": "Versions",
"path": "PrivateFrameworks/CoreUtils.framework/Versions"
}
]
},
{
"value": 3476,
"name": "CoreWLANKit.framework",
"path": "PrivateFrameworks/CoreWLANKit.framework",
"children": [
{
"value": 3468,
"name": "Versions",
"path": "PrivateFrameworks/CoreWLANKit.framework/Versions"
}
]
},
{
"value": 92,
"name": "CrashReporterSupport.framework",
"path": "PrivateFrameworks/CrashReporterSupport.framework",
"children": [
{
"value": 84,
"name": "Versions",
"path": "PrivateFrameworks/CrashReporterSupport.framework/Versions"
}
]
},
{
"value": 132,
"name": "DashboardClient.framework",
"path": "PrivateFrameworks/DashboardClient.framework",
"children": [
{
"value": 124,
"name": "Versions",
"path": "PrivateFrameworks/DashboardClient.framework/Versions"
}
]
},
{
"value": 1716,
"name": "DataDetectors.framework",
"path": "PrivateFrameworks/DataDetectors.framework",
"children": [
{
"value": 1708,
"name": "Versions",
"path": "PrivateFrameworks/DataDetectors.framework/Versions"
}
]
},
{
"value": 4952,
"name": "DataDetectorsCore.framework",
"path": "PrivateFrameworks/DataDetectorsCore.framework",
"children": [
{
"value": 4940,
"name": "Versions",
"path": "PrivateFrameworks/DataDetectorsCore.framework/Versions"
}
]
},
{
"value": 500,
"name": "DCERPC.framework",
"path": "PrivateFrameworks/DCERPC.framework",
"children": [
{
"value": 492,
"name": "Versions",
"path": "PrivateFrameworks/DCERPC.framework/Versions"
}
]
},
{
"value": 232,
"name": "DebugSymbols.framework",
"path": "PrivateFrameworks/DebugSymbols.framework",
"children": [
{
"value": 224,
"name": "Versions",
"path": "PrivateFrameworks/DebugSymbols.framework/Versions"
}
]
},
{
"value": 1792,
"name": "DesktopServicesPriv.framework",
"path": "PrivateFrameworks/DesktopServicesPriv.framework",
"children": [
{
"value": 1780,
"name": "Versions",
"path": "PrivateFrameworks/DesktopServicesPriv.framework/Versions"
}
]
},
{
"value": 128,
"name": "DeviceLink.framework",
"path": "PrivateFrameworks/DeviceLink.framework",
"children": [
{
"value": 120,
"name": "Versions",
"path": "PrivateFrameworks/DeviceLink.framework/Versions"
}
]
},
{
"value": 464,
"name": "DeviceToDeviceKit.framework",
"path": "PrivateFrameworks/DeviceToDeviceKit.framework",
"children": [
{
"value": 456,
"name": "Versions",
"path": "PrivateFrameworks/DeviceToDeviceKit.framework/Versions"
}
]
},
{
"value": 52,
"name": "DeviceToDeviceManager.framework",
"path": "PrivateFrameworks/DeviceToDeviceManager.framework",
"children": [
{
"value": 28,
"name": "PlugIns",
"path": "PrivateFrameworks/DeviceToDeviceManager.framework/PlugIns"
},
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/DeviceToDeviceManager.framework/Versions"
}
]
},
{
"value": 28,
"name": "DiagnosticLogCollection.framework",
"path": "PrivateFrameworks/DiagnosticLogCollection.framework",
"children": [
{
"value": 20,
"name": "Versions",
"path": "PrivateFrameworks/DiagnosticLogCollection.framework/Versions"
}
]
},
{
"value": 56,
"name": "DigiHubPreference.framework",
"path": "PrivateFrameworks/DigiHubPreference.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/DigiHubPreference.framework/Versions"
}
]
},
{
"value": 1344,
"name": "DirectoryEditor.framework",
"path": "PrivateFrameworks/DirectoryEditor.framework",
"children": [
{
"value": 1336,
"name": "Versions",
"path": "PrivateFrameworks/DirectoryEditor.framework/Versions"
}
]
},
{
"value": 104,
"name": "DirectoryServer.framework",
"path": "PrivateFrameworks/DirectoryServer.framework",
"children": [
{
"value": 52,
"name": "Frameworks",
"path": "PrivateFrameworks/DirectoryServer.framework/Frameworks"
},
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/DirectoryServer.framework/Versions"
}
]
},
{
"value": 1596,
"name": "DiskImages.framework",
"path": "PrivateFrameworks/DiskImages.framework",
"children": [
{
"value": 1588,
"name": "Versions",
"path": "PrivateFrameworks/DiskImages.framework/Versions"
}
]
},
{
"value": 1168,
"name": "DiskManagement.framework",
"path": "PrivateFrameworks/DiskManagement.framework",
"children": [
{
"value": 1160,
"name": "Versions",
"path": "PrivateFrameworks/DiskManagement.framework/Versions"
}
]
},
{
"value": 80,
"name": "DisplayServices.framework",
"path": "PrivateFrameworks/DisplayServices.framework",
"children": [
{
"value": 72,
"name": "Versions",
"path": "PrivateFrameworks/DisplayServices.framework/Versions"
}
]
},
{
"value": 32,
"name": "DMNotification.framework",
"path": "PrivateFrameworks/DMNotification.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "PrivateFrameworks/DMNotification.framework/Versions"
}
]
},
{
"value": 24,
"name": "DVD.framework",
"path": "PrivateFrameworks/DVD.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/DVD.framework/Versions"
}
]
},
{
"value": 272,
"name": "EAP8021X.framework",
"path": "PrivateFrameworks/EAP8021X.framework",
"children": [
{
"value": 20,
"name": "Support",
"path": "PrivateFrameworks/EAP8021X.framework/Support"
},
{
"value": 244,
"name": "Versions",
"path": "PrivateFrameworks/EAP8021X.framework/Versions"
}
]
},
{
"value": 56,
"name": "EasyConfig.framework",
"path": "PrivateFrameworks/EasyConfig.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/EasyConfig.framework/Versions"
}
]
},
{
"value": 872,
"name": "EFILogin.framework",
"path": "PrivateFrameworks/EFILogin.framework",
"children": [
{
"value": 864,
"name": "Versions",
"path": "PrivateFrameworks/EFILogin.framework/Versions"
}
]
},
{
"value": 32,
"name": "EmailAddressing.framework",
"path": "PrivateFrameworks/EmailAddressing.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "PrivateFrameworks/EmailAddressing.framework/Versions"
}
]
},
{
"value": 444,
"name": "ExchangeWebServices.framework",
"path": "PrivateFrameworks/ExchangeWebServices.framework",
"children": [
{
"value": 436,
"name": "Versions",
"path": "PrivateFrameworks/ExchangeWebServices.framework/Versions"
}
]
},
{
"value": 23556,
"name": "FaceCore.framework",
"path": "PrivateFrameworks/FaceCore.framework",
"children": [
{
"value": 23548,
"name": "Versions",
"path": "PrivateFrameworks/FaceCore.framework/Versions"
}
]
},
{
"value": 12,
"name": "FaceCoreLight.framework",
"path": "PrivateFrameworks/FaceCoreLight.framework",
"children": [
{
"value": 8,
"name": "Versions",
"path": "PrivateFrameworks/FaceCoreLight.framework/Versions"
}
]
},
{
"value": 2836,
"name": "FamilyControls.framework",
"path": "PrivateFrameworks/FamilyControls.framework",
"children": [
{
"value": 2828,
"name": "Versions",
"path": "PrivateFrameworks/FamilyControls.framework/Versions"
}
]
},
{
"value": 104,
"name": "FileSync.framework",
"path": "PrivateFrameworks/FileSync.framework",
"children": [
{
"value": 96,
"name": "Versions",
"path": "PrivateFrameworks/FileSync.framework/Versions"
}
]
},
{
"value": 12048,
"name": "FinderKit.framework",
"path": "PrivateFrameworks/FinderKit.framework",
"children": [
{
"value": 12040,
"name": "Versions",
"path": "PrivateFrameworks/FinderKit.framework/Versions"
}
]
},
{
"value": 1068,
"name": "FindMyMac.framework",
"path": "PrivateFrameworks/FindMyMac.framework",
"children": [
{
"value": 1044,
"name": "Versions",
"path": "PrivateFrameworks/FindMyMac.framework/Versions"
},
{
"value": 16,
"name": "XPCServices",
"path": "PrivateFrameworks/FindMyMac.framework/XPCServices"
}
]
},
{
"value": 32,
"name": "FTClientServices.framework",
"path": "PrivateFrameworks/FTClientServices.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "PrivateFrameworks/FTClientServices.framework/Versions"
}
]
},
{
"value": 156,
"name": "FTServices.framework",
"path": "PrivateFrameworks/FTServices.framework",
"children": [
{
"value": 148,
"name": "Versions",
"path": "PrivateFrameworks/FTServices.framework/Versions"
}
]
},
{
"value": 216,
"name": "FWAVC.framework",
"path": "PrivateFrameworks/FWAVC.framework",
"children": [
{
"value": 208,
"name": "Versions",
"path": "PrivateFrameworks/FWAVC.framework/Versions"
}
]
},
{
"value": 116,
"name": "FWAVCPrivate.framework",
"path": "PrivateFrameworks/FWAVCPrivate.framework",
"children": [
{
"value": 108,
"name": "Versions",
"path": "PrivateFrameworks/FWAVCPrivate.framework/Versions"
}
]
},
{
"value": 624,
"name": "GameKitServices.framework",
"path": "PrivateFrameworks/GameKitServices.framework",
"children": [
{
"value": 616,
"name": "Versions",
"path": "PrivateFrameworks/GameKitServices.framework/Versions"
}
]
},
{
"value": 312,
"name": "GenerationalStorage.framework",
"path": "PrivateFrameworks/GenerationalStorage.framework",
"children": [
{
"value": 300,
"name": "Versions",
"path": "PrivateFrameworks/GenerationalStorage.framework/Versions"
}
]
},
{
"value": 14920,
"name": "GeoKit.framework",
"path": "PrivateFrameworks/GeoKit.framework",
"children": [
{
"value": 14912,
"name": "Versions",
"path": "PrivateFrameworks/GeoKit.framework/Versions"
}
]
},
{
"value": 27272,
"name": "GeoServices.framework",
"path": "PrivateFrameworks/GeoServices.framework",
"children": [
{
"value": 2104,
"name": "Versions",
"path": "PrivateFrameworks/GeoServices.framework/Versions"
}
]
},
{
"value": 152,
"name": "GPUSupport.framework",
"path": "PrivateFrameworks/GPUSupport.framework",
"children": [
{
"value": 144,
"name": "Versions",
"path": "PrivateFrameworks/GPUSupport.framework/Versions"
}
]
},
{
"value": 28,
"name": "GraphicsAppSupport.framework",
"path": "PrivateFrameworks/GraphicsAppSupport.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/GraphicsAppSupport.framework/Versions"
}
]
},
{
"value": 336,
"name": "GraphKit.framework",
"path": "PrivateFrameworks/GraphKit.framework",
"children": [
{
"value": 328,
"name": "Versions",
"path": "PrivateFrameworks/GraphKit.framework/Versions"
}
]
},
{
"value": 56,
"name": "HDAInterface.framework",
"path": "PrivateFrameworks/HDAInterface.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/HDAInterface.framework/Versions"
}
]
},
{
"value": 1044,
"name": "Heimdal.framework",
"path": "PrivateFrameworks/Heimdal.framework",
"children": [
{
"value": 508,
"name": "Helpers",
"path": "PrivateFrameworks/Heimdal.framework/Helpers"
},
{
"value": 528,
"name": "Versions",
"path": "PrivateFrameworks/Heimdal.framework/Versions"
}
]
},
{
"value": 56,
"name": "HeimODAdmin.framework",
"path": "PrivateFrameworks/HeimODAdmin.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/HeimODAdmin.framework/Versions"
}
]
},
{
"value": 232,
"name": "HelpData.framework",
"path": "PrivateFrameworks/HelpData.framework",
"children": [
{
"value": 224,
"name": "Versions",
"path": "PrivateFrameworks/HelpData.framework/Versions"
}
]
},
{
"value": 104,
"name": "IASUtilities.framework",
"path": "PrivateFrameworks/IASUtilities.framework",
"children": [
{
"value": 92,
"name": "Versions",
"path": "PrivateFrameworks/IASUtilities.framework/Versions"
}
]
},
{
"value": 224,
"name": "iCalendar.framework",
"path": "PrivateFrameworks/iCalendar.framework",
"children": [
{
"value": 216,
"name": "Versions",
"path": "PrivateFrameworks/iCalendar.framework/Versions"
}
]
},
{
"value": 116,
"name": "ICANotifications.framework",
"path": "PrivateFrameworks/ICANotifications.framework",
"children": [
{
"value": 108,
"name": "Versions",
"path": "PrivateFrameworks/ICANotifications.framework/Versions"
}
]
},
{
"value": 308,
"name": "IconServices.framework",
"path": "PrivateFrameworks/IconServices.framework",
"children": [
{
"value": 296,
"name": "Versions",
"path": "PrivateFrameworks/IconServices.framework/Versions"
}
]
},
{
"value": 256,
"name": "IDS.framework",
"path": "PrivateFrameworks/IDS.framework",
"children": [
{
"value": 248,
"name": "Versions",
"path": "PrivateFrameworks/IDS.framework/Versions"
}
]
},
{
"value": 4572,
"name": "IDSCore.framework",
"path": "PrivateFrameworks/IDSCore.framework",
"children": [
{
"value": 1300,
"name": "identityservicesd.app",
"path": "PrivateFrameworks/IDSCore.framework/identityservicesd.app"
},
{
"value": 3264,
"name": "Versions",
"path": "PrivateFrameworks/IDSCore.framework/Versions"
}
]
},
{
"value": 116,
"name": "IDSFoundation.framework",
"path": "PrivateFrameworks/IDSFoundation.framework",
"children": [
{
"value": 108,
"name": "Versions",
"path": "PrivateFrameworks/IDSFoundation.framework/Versions"
}
]
},
{
"value": 24,
"name": "IDSSystemPreferencesSignIn.framework",
"path": "PrivateFrameworks/IDSSystemPreferencesSignIn.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/IDSSystemPreferencesSignIn.framework/Versions"
}
]
},
{
"value": 16772,
"name": "iLifeMediaBrowser.framework",
"path": "PrivateFrameworks/iLifeMediaBrowser.framework",
"children": [
{
"value": 16764,
"name": "Versions",
"path": "PrivateFrameworks/iLifeMediaBrowser.framework/Versions"
}
]
},
{
"value": 252,
"name": "IMAP.framework",
"path": "PrivateFrameworks/IMAP.framework",
"children": [
{
"value": 244,
"name": "Versions",
"path": "PrivateFrameworks/IMAP.framework/Versions"
}
]
},
{
"value": 396,
"name": "IMAVCore.framework",
"path": "PrivateFrameworks/IMAVCore.framework",
"children": [
{
"value": 388,
"name": "Versions",
"path": "PrivateFrameworks/IMAVCore.framework/Versions"
}
]
},
{
"value": 856,
"name": "IMCore.framework",
"path": "PrivateFrameworks/IMCore.framework",
"children": [
{
"value": 148,
"name": "imagent.app",
"path": "PrivateFrameworks/IMCore.framework/imagent.app"
},
{
"value": 700,
"name": "Versions",
"path": "PrivateFrameworks/IMCore.framework/Versions"
}
]
},
{
"value": 364,
"name": "IMDaemonCore.framework",
"path": "PrivateFrameworks/IMDaemonCore.framework",
"children": [
{
"value": 356,
"name": "Versions",
"path": "PrivateFrameworks/IMDaemonCore.framework/Versions"
}
]
},
{
"value": 68,
"name": "IMDMessageServices.framework",
"path": "PrivateFrameworks/IMDMessageServices.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/IMDMessageServices.framework/Versions"
},
{
"value": 44,
"name": "XPCServices",
"path": "PrivateFrameworks/IMDMessageServices.framework/XPCServices"
}
]
},
{
"value": 316,
"name": "IMDPersistence.framework",
"path": "PrivateFrameworks/IMDPersistence.framework",
"children": [
{
"value": 240,
"name": "Versions",
"path": "PrivateFrameworks/IMDPersistence.framework/Versions"
},
{
"value": 68,
"name": "XPCServices",
"path": "PrivateFrameworks/IMDPersistence.framework/XPCServices"
}
]
},
{
"value": 596,
"name": "IMFoundation.framework",
"path": "PrivateFrameworks/IMFoundation.framework",
"children": [
{
"value": 484,
"name": "Versions",
"path": "PrivateFrameworks/IMFoundation.framework/Versions"
},
{
"value": 24,
"name": "XPCServices",
"path": "PrivateFrameworks/IMFoundation.framework/XPCServices"
}
]
},
{
"value": 88,
"name": "IMTranscoding.framework",
"path": "PrivateFrameworks/IMTranscoding.framework",
"children": [
{
"value": 20,
"name": "Versions",
"path": "PrivateFrameworks/IMTranscoding.framework/Versions"
},
{
"value": 60,
"name": "XPCServices",
"path": "PrivateFrameworks/IMTranscoding.framework/XPCServices"
}
]
},
{
"value": 92,
"name": "IMTransferServices.framework",
"path": "PrivateFrameworks/IMTransferServices.framework",
"children": [
{
"value": 28,
"name": "Versions",
"path": "PrivateFrameworks/IMTransferServices.framework/Versions"
},
{
"value": 56,
"name": "XPCServices",
"path": "PrivateFrameworks/IMTransferServices.framework/XPCServices"
}
]
},
{
"value": 48,
"name": "IncomingCallFilter.framework",
"path": "PrivateFrameworks/IncomingCallFilter.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/IncomingCallFilter.framework/Versions"
}
]
},
{
"value": 1668,
"name": "Install.framework",
"path": "PrivateFrameworks/Install.framework",
"children": [
{
"value": 644,
"name": "Frameworks",
"path": "PrivateFrameworks/Install.framework/Frameworks"
},
{
"value": 1016,
"name": "Versions",
"path": "PrivateFrameworks/Install.framework/Versions"
}
]
},
{
"value": 24,
"name": "International.framework",
"path": "PrivateFrameworks/International.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/International.framework/Versions"
}
]
},
{
"value": 2052,
"name": "InternetAccounts.framework",
"path": "PrivateFrameworks/InternetAccounts.framework",
"children": [
{
"value": 2040,
"name": "Versions",
"path": "PrivateFrameworks/InternetAccounts.framework/Versions"
}
]
},
{
"value": 216,
"name": "IntlPreferences.framework",
"path": "PrivateFrameworks/IntlPreferences.framework",
"children": [
{
"value": 208,
"name": "Versions",
"path": "PrivateFrameworks/IntlPreferences.framework/Versions"
}
]
},
{
"value": 52,
"name": "IOAccelerator.framework",
"path": "PrivateFrameworks/IOAccelerator.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/IOAccelerator.framework/Versions"
}
]
},
{
"value": 68,
"name": "IOAccelMemoryInfo.framework",
"path": "PrivateFrameworks/IOAccelMemoryInfo.framework",
"children": [
{
"value": 60,
"name": "Versions",
"path": "PrivateFrameworks/IOAccelMemoryInfo.framework/Versions"
}
]
},
{
"value": 20,
"name": "IOPlatformPluginFamily.framework",
"path": "PrivateFrameworks/IOPlatformPluginFamily.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "PrivateFrameworks/IOPlatformPluginFamily.framework/Versions"
}
]
},
{
"value": 44,
"name": "iPod.framework",
"path": "PrivateFrameworks/iPod.framework",
"children": [
{
"value": 36,
"name": "Versions",
"path": "PrivateFrameworks/iPod.framework/Versions"
}
]
},
{
"value": 160,
"name": "iPodSync.framework",
"path": "PrivateFrameworks/iPodSync.framework",
"children": [
{
"value": 152,
"name": "Versions",
"path": "PrivateFrameworks/iPodSync.framework/Versions"
}
]
},
{
"value": 516,
"name": "ISSupport.framework",
"path": "PrivateFrameworks/ISSupport.framework",
"children": [
{
"value": 508,
"name": "Versions",
"path": "PrivateFrameworks/ISSupport.framework/Versions"
}
]
},
{
"value": 644,
"name": "iTunesAccess.framework",
"path": "PrivateFrameworks/iTunesAccess.framework",
"children": [
{
"value": 636,
"name": "Versions",
"path": "PrivateFrameworks/iTunesAccess.framework/Versions"
}
]
},
{
"value": 92,
"name": "JavaApplicationLauncher.framework",
"path": "PrivateFrameworks/JavaApplicationLauncher.framework",
"children": [
{
"value": 84,
"name": "Versions",
"path": "PrivateFrameworks/JavaApplicationLauncher.framework/Versions"
}
]
},
{
"value": 48,
"name": "JavaLaunching.framework",
"path": "PrivateFrameworks/JavaLaunching.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/JavaLaunching.framework/Versions"
}
]
},
{
"value": 8,
"name": "KerberosHelper",
"path": "PrivateFrameworks/KerberosHelper",
"children": [
{
"value": 8,
"name": "Helpers",
"path": "PrivateFrameworks/KerberosHelper/Helpers"
}
]
},
{
"value": 132,
"name": "KerberosHelper.framework",
"path": "PrivateFrameworks/KerberosHelper.framework",
"children": [
{
"value": 40,
"name": "Helpers",
"path": "PrivateFrameworks/KerberosHelper.framework/Helpers"
},
{
"value": 84,
"name": "Versions",
"path": "PrivateFrameworks/KerberosHelper.framework/Versions"
}
]
},
{
"value": 44,
"name": "kperf.framework",
"path": "PrivateFrameworks/kperf.framework",
"children": [
{
"value": 36,
"name": "Versions",
"path": "PrivateFrameworks/kperf.framework/Versions"
}
]
},
{
"value": 100,
"name": "Librarian.framework",
"path": "PrivateFrameworks/Librarian.framework",
"children": [
{
"value": 92,
"name": "Versions",
"path": "PrivateFrameworks/Librarian.framework/Versions"
}
]
},
{
"value": 56,
"name": "LibraryRepair.framework",
"path": "PrivateFrameworks/LibraryRepair.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/LibraryRepair.framework/Versions"
}
]
},
{
"value": 144,
"name": "login.framework",
"path": "PrivateFrameworks/login.framework",
"children": [
{
"value": 132,
"name": "Versions",
"path": "PrivateFrameworks/login.framework/Versions"
}
]
},
{
"value": 4060,
"name": "LoginUIKit.framework",
"path": "PrivateFrameworks/LoginUIKit.framework",
"children": [
{
"value": 4048,
"name": "Versions",
"path": "PrivateFrameworks/LoginUIKit.framework/Versions"
}
]
},
{
"value": 576,
"name": "Lookup.framework",
"path": "PrivateFrameworks/Lookup.framework",
"children": [
{
"value": 568,
"name": "Versions",
"path": "PrivateFrameworks/Lookup.framework/Versions"
}
]
},
{
"value": 32,
"name": "MachineSettings.framework",
"path": "PrivateFrameworks/MachineSettings.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "PrivateFrameworks/MachineSettings.framework/Versions"
}
]
},
{
"value": 2812,
"name": "Mail.framework",
"path": "PrivateFrameworks/Mail.framework",
"children": [
{
"value": 2800,
"name": "Versions",
"path": "PrivateFrameworks/Mail.framework/Versions"
}
]
},
{
"value": 1856,
"name": "MailCore.framework",
"path": "PrivateFrameworks/MailCore.framework",
"children": [
{
"value": 1848,
"name": "Versions",
"path": "PrivateFrameworks/MailCore.framework/Versions"
}
]
},
{
"value": 68,
"name": "MailService.framework",
"path": "PrivateFrameworks/MailService.framework",
"children": [
{
"value": 56,
"name": "Versions",
"path": "PrivateFrameworks/MailService.framework/Versions"
}
]
},
{
"value": 292,
"name": "MailUI.framework",
"path": "PrivateFrameworks/MailUI.framework",
"children": [
{
"value": 280,
"name": "Versions",
"path": "PrivateFrameworks/MailUI.framework/Versions"
}
]
},
{
"value": 80,
"name": "ManagedClient.framework",
"path": "PrivateFrameworks/ManagedClient.framework",
"children": [
{
"value": 72,
"name": "Versions",
"path": "PrivateFrameworks/ManagedClient.framework/Versions"
}
]
},
{
"value": 44,
"name": "Mangrove.framework",
"path": "PrivateFrameworks/Mangrove.framework",
"children": [
{
"value": 32,
"name": "Versions",
"path": "PrivateFrameworks/Mangrove.framework/Versions"
}
]
},
{
"value": 28,
"name": "Marco.framework",
"path": "PrivateFrameworks/Marco.framework",
"children": [
{
"value": 20,
"name": "Versions",
"path": "PrivateFrameworks/Marco.framework/Versions"
}
]
},
{
"value": 52,
"name": "MDSChannel.framework",
"path": "PrivateFrameworks/MDSChannel.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/MDSChannel.framework/Versions"
}
]
},
{
"value": 1488,
"name": "MediaControlSender.framework",
"path": "PrivateFrameworks/MediaControlSender.framework",
"children": [
{
"value": 1480,
"name": "Versions",
"path": "PrivateFrameworks/MediaControlSender.framework/Versions"
}
]
},
{
"value": 480,
"name": "MediaKit.framework",
"path": "PrivateFrameworks/MediaKit.framework",
"children": [
{
"value": 468,
"name": "Versions",
"path": "PrivateFrameworks/MediaKit.framework/Versions"
}
]
},
{
"value": 288,
"name": "MediaUI.framework",
"path": "PrivateFrameworks/MediaUI.framework",
"children": [
{
"value": 280,
"name": "Versions",
"path": "PrivateFrameworks/MediaUI.framework/Versions"
}
]
},
{
"value": 56,
"name": "MessageProtection.framework",
"path": "PrivateFrameworks/MessageProtection.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/MessageProtection.framework/Versions"
}
]
},
{
"value": 680,
"name": "MessagesHelperKit.framework",
"path": "PrivateFrameworks/MessagesHelperKit.framework",
"children": [
{
"value": 640,
"name": "PlugIns",
"path": "PrivateFrameworks/MessagesHelperKit.framework/PlugIns"
},
{
"value": 32,
"name": "Versions",
"path": "PrivateFrameworks/MessagesHelperKit.framework/Versions"
}
]
},
{
"value": 160,
"name": "MessagesKit.framework",
"path": "PrivateFrameworks/MessagesKit.framework",
"children": [
{
"value": 112,
"name": "Versions",
"path": "PrivateFrameworks/MessagesKit.framework/Versions"
},
{
"value": 40,
"name": "XPCServices",
"path": "PrivateFrameworks/MessagesKit.framework/XPCServices"
}
]
},
{
"value": 372,
"name": "MMCS.framework",
"path": "PrivateFrameworks/MMCS.framework",
"children": [
{
"value": 364,
"name": "Versions",
"path": "PrivateFrameworks/MMCS.framework/Versions"
}
]
},
{
"value": 56,
"name": "MMCSServices.framework",
"path": "PrivateFrameworks/MMCSServices.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/MMCSServices.framework/Versions"
}
]
},
{
"value": 1932,
"name": "MobileDevice.framework",
"path": "PrivateFrameworks/MobileDevice.framework",
"children": [
{
"value": 1924,
"name": "Versions",
"path": "PrivateFrameworks/MobileDevice.framework/Versions"
}
]
},
{
"value": 80,
"name": "MonitorPanel.framework",
"path": "PrivateFrameworks/MonitorPanel.framework",
"children": [
{
"value": 72,
"name": "Versions",
"path": "PrivateFrameworks/MonitorPanel.framework/Versions"
}
]
},
{
"value": 132,
"name": "MultitouchSupport.framework",
"path": "PrivateFrameworks/MultitouchSupport.framework",
"children": [
{
"value": 124,
"name": "Versions",
"path": "PrivateFrameworks/MultitouchSupport.framework/Versions"
}
]
},
{
"value": 76,
"name": "NetAuth.framework",
"path": "PrivateFrameworks/NetAuth.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "PrivateFrameworks/NetAuth.framework/Versions"
}
]
},
{
"value": 52,
"name": "NetFSServer.framework",
"path": "PrivateFrameworks/NetFSServer.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/NetFSServer.framework/Versions"
}
]
},
{
"value": 56,
"name": "NetworkDiagnosticsUI.framework",
"path": "PrivateFrameworks/NetworkDiagnosticsUI.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/NetworkDiagnosticsUI.framework/Versions"
}
]
},
{
"value": 84,
"name": "NetworkMenusCommon.framework",
"path": "PrivateFrameworks/NetworkMenusCommon.framework",
"children": [
{
"value": 0,
"name": "_CodeSignature",
"path": "PrivateFrameworks/NetworkMenusCommon.framework/_CodeSignature"
}
]
},
{
"value": 32,
"name": "NetworkStatistics.framework",
"path": "PrivateFrameworks/NetworkStatistics.framework",
"children": [
{
"value": 24,
"name": "Versions",
"path": "PrivateFrameworks/NetworkStatistics.framework/Versions"
}
]
},
{
"value": 416,
"name": "Notes.framework",
"path": "PrivateFrameworks/Notes.framework",
"children": [
{
"value": 400,
"name": "Versions",
"path": "PrivateFrameworks/Notes.framework/Versions"
}
]
},
{
"value": 84,
"name": "nt.framework",
"path": "PrivateFrameworks/nt.framework",
"children": [
{
"value": 76,
"name": "Versions",
"path": "PrivateFrameworks/nt.framework/Versions"
}
]
},
{
"value": 24,
"name": "OAuth.framework",
"path": "PrivateFrameworks/OAuth.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/OAuth.framework/Versions"
}
]
},
{
"value": 6676,
"name": "OfficeImport.framework",
"path": "PrivateFrameworks/OfficeImport.framework",
"children": [
{
"value": 6668,
"name": "Versions",
"path": "PrivateFrameworks/OfficeImport.framework/Versions"
}
]
},
{
"value": 160,
"name": "oncrpc.framework",
"path": "PrivateFrameworks/oncrpc.framework",
"children": [
{
"value": 36,
"name": "bin",
"path": "PrivateFrameworks/oncrpc.framework/bin"
},
{
"value": 116,
"name": "Versions",
"path": "PrivateFrameworks/oncrpc.framework/Versions"
}
]
},
{
"value": 140,
"name": "OpenDirectoryConfig.framework",
"path": "PrivateFrameworks/OpenDirectoryConfig.framework",
"children": [
{
"value": 132,
"name": "Versions",
"path": "PrivateFrameworks/OpenDirectoryConfig.framework/Versions"
}
]
},
{
"value": 1292,
"name": "OpenDirectoryConfigUI.framework",
"path": "PrivateFrameworks/OpenDirectoryConfigUI.framework",
"children": [
{
"value": 1284,
"name": "Versions",
"path": "PrivateFrameworks/OpenDirectoryConfigUI.framework/Versions"
}
]
},
{
"value": 1140,
"name": "PackageKit.framework",
"path": "PrivateFrameworks/PackageKit.framework",
"children": [
{
"value": 272,
"name": "Frameworks",
"path": "PrivateFrameworks/PackageKit.framework/Frameworks"
},
{
"value": 860,
"name": "Versions",
"path": "PrivateFrameworks/PackageKit.framework/Versions"
}
]
},
{
"value": 64,
"name": "PacketFilter.framework",
"path": "PrivateFrameworks/PacketFilter.framework",
"children": [
{
"value": 56,
"name": "Versions",
"path": "PrivateFrameworks/PacketFilter.framework/Versions"
}
]
},
{
"value": 3312,
"name": "PassKit.framework",
"path": "PrivateFrameworks/PassKit.framework",
"children": [
{
"value": 3300,
"name": "Versions",
"path": "PrivateFrameworks/PassKit.framework/Versions"
}
]
},
{
"value": 216,
"name": "PasswordServer.framework",
"path": "PrivateFrameworks/PasswordServer.framework",
"children": [
{
"value": 208,
"name": "Versions",
"path": "PrivateFrameworks/PasswordServer.framework/Versions"
}
]
},
{
"value": 400,
"name": "PerformanceAnalysis.framework",
"path": "PrivateFrameworks/PerformanceAnalysis.framework",
"children": [
{
"value": 360,
"name": "Versions",
"path": "PrivateFrameworks/PerformanceAnalysis.framework/Versions"
},
{
"value": 32,
"name": "XPCServices",
"path": "PrivateFrameworks/PerformanceAnalysis.framework/XPCServices"
}
]
},
{
"value": 80,
"name": "PhoneNumbers.framework",
"path": "PrivateFrameworks/PhoneNumbers.framework",
"children": [
{
"value": 72,
"name": "Versions",
"path": "PrivateFrameworks/PhoneNumbers.framework/Versions"
}
]
},
{
"value": 152,
"name": "PhysicsKit.framework",
"path": "PrivateFrameworks/PhysicsKit.framework",
"children": [
{
"value": 144,
"name": "Versions",
"path": "PrivateFrameworks/PhysicsKit.framework/Versions"
}
]
},
{
"value": 112,
"name": "PlatformHardwareManagement.framework",
"path": "PrivateFrameworks/PlatformHardwareManagement.framework",
"children": [
{
"value": 104,
"name": "Versions",
"path": "PrivateFrameworks/PlatformHardwareManagement.framework/Versions"
}
]
},
{
"value": 76,
"name": "PodcastProducerCore.framework",
"path": "PrivateFrameworks/PodcastProducerCore.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "PrivateFrameworks/PodcastProducerCore.framework/Versions"
}
]
},
{
"value": 612,
"name": "PodcastProducerKit.framework",
"path": "PrivateFrameworks/PodcastProducerKit.framework",
"children": [
{
"value": 604,
"name": "Versions",
"path": "PrivateFrameworks/PodcastProducerKit.framework/Versions"
}
]
},
{
"value": 956,
"name": "PreferencePanesSupport.framework",
"path": "PrivateFrameworks/PreferencePanesSupport.framework",
"children": [
{
"value": 948,
"name": "Versions",
"path": "PrivateFrameworks/PreferencePanesSupport.framework/Versions"
}
]
},
{
"value": 9580,
"name": "PrintingPrivate.framework",
"path": "PrivateFrameworks/PrintingPrivate.framework",
"children": [
{
"value": 9572,
"name": "Versions",
"path": "PrivateFrameworks/PrintingPrivate.framework/Versions"
}
]
},
{
"value": 104432,
"name": "ProKit.framework",
"path": "PrivateFrameworks/ProKit.framework",
"children": [
{
"value": 104424,
"name": "Versions",
"path": "PrivateFrameworks/ProKit.framework/Versions"
}
]
},
{
"value": 9784,
"name": "ProofReader.framework",
"path": "PrivateFrameworks/ProofReader.framework",
"children": [
{
"value": 9776,
"name": "Versions",
"path": "PrivateFrameworks/ProofReader.framework/Versions"
}
]
},
{
"value": 76,
"name": "ProtocolBuffer.framework",
"path": "PrivateFrameworks/ProtocolBuffer.framework",
"children": [
{
"value": 68,
"name": "Versions",
"path": "PrivateFrameworks/ProtocolBuffer.framework/Versions"
}
]
},
{
"value": 7628,
"name": "PSNormalizer.framework",
"path": "PrivateFrameworks/PSNormalizer.framework",
"children": [
{
"value": 7616,
"name": "Versions",
"path": "PrivateFrameworks/PSNormalizer.framework/Versions"
}
]
},
{
"value": 96,
"name": "RemotePacketCapture.framework",
"path": "PrivateFrameworks/RemotePacketCapture.framework",
"children": [
{
"value": 88,
"name": "Versions",
"path": "PrivateFrameworks/RemotePacketCapture.framework/Versions"
}
]
},
{
"value": 388,
"name": "RemoteViewServices.framework",
"path": "PrivateFrameworks/RemoteViewServices.framework",
"children": [
{
"value": 304,
"name": "Versions",
"path": "PrivateFrameworks/RemoteViewServices.framework/Versions"
},
{
"value": 76,
"name": "XPCServices",
"path": "PrivateFrameworks/RemoteViewServices.framework/XPCServices"
}
]
},
{
"value": 420,
"name": "Restore.framework",
"path": "PrivateFrameworks/Restore.framework",
"children": [
{
"value": 412,
"name": "Versions",
"path": "PrivateFrameworks/Restore.framework/Versions"
}
]
},
{
"value": 56,
"name": "RTCReporting.framework",
"path": "PrivateFrameworks/RTCReporting.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/RTCReporting.framework/Versions"
}
]
},
{
"value": 6168,
"name": "Safari.framework",
"path": "PrivateFrameworks/Safari.framework",
"children": [
{
"value": 6156,
"name": "Versions",
"path": "PrivateFrameworks/Safari.framework/Versions"
}
]
},
{
"value": 40,
"name": "SafariServices.framework",
"path": "PrivateFrameworks/SafariServices.framework",
"children": [
{
"value": 28,
"name": "Versions",
"path": "PrivateFrameworks/SafariServices.framework/Versions"
}
]
},
{
"value": 432,
"name": "SAObjects.framework",
"path": "PrivateFrameworks/SAObjects.framework",
"children": [
{
"value": 424,
"name": "Versions",
"path": "PrivateFrameworks/SAObjects.framework/Versions"
}
]
},
{
"value": 84,
"name": "SCEP.framework",
"path": "PrivateFrameworks/SCEP.framework",
"children": [
{
"value": 76,
"name": "Versions",
"path": "PrivateFrameworks/SCEP.framework/Versions"
}
]
},
{
"value": 24256,
"name": "ScreenReader.framework",
"path": "PrivateFrameworks/ScreenReader.framework",
"children": [
{
"value": 24244,
"name": "Versions",
"path": "PrivateFrameworks/ScreenReader.framework/Versions"
}
]
},
{
"value": 528,
"name": "ScreenSharing.framework",
"path": "PrivateFrameworks/ScreenSharing.framework",
"children": [
{
"value": 520,
"name": "Versions",
"path": "PrivateFrameworks/ScreenSharing.framework/Versions"
}
]
},
{
"value": 36,
"name": "SecCodeWrapper.framework",
"path": "PrivateFrameworks/SecCodeWrapper.framework",
"children": [
{
"value": 28,
"name": "Versions",
"path": "PrivateFrameworks/SecCodeWrapper.framework/Versions"
}
]
},
{
"value": 36,
"name": "SecureNetworking.framework",
"path": "PrivateFrameworks/SecureNetworking.framework",
"children": [
{
"value": 28,
"name": "Versions",
"path": "PrivateFrameworks/SecureNetworking.framework/Versions"
}
]
},
{
"value": 60,
"name": "SecurityTokend.framework",
"path": "PrivateFrameworks/SecurityTokend.framework",
"children": [
{
"value": 52,
"name": "Versions",
"path": "PrivateFrameworks/SecurityTokend.framework/Versions"
}
]
},
{
"value": 280,
"name": "SemanticDocumentManagement.framework",
"path": "PrivateFrameworks/SemanticDocumentManagement.framework",
"children": [
{
"value": 272,
"name": "Versions",
"path": "PrivateFrameworks/SemanticDocumentManagement.framework/Versions"
}
]
},
{
"value": 720,
"name": "ServerFoundation.framework",
"path": "PrivateFrameworks/ServerFoundation.framework",
"children": [
{
"value": 712,
"name": "Versions",
"path": "PrivateFrameworks/ServerFoundation.framework/Versions"
}
]
},
{
"value": 320,
"name": "ServerInformation.framework",
"path": "PrivateFrameworks/ServerInformation.framework",
"children": [
{
"value": 312,
"name": "Versions",
"path": "PrivateFrameworks/ServerInformation.framework/Versions"
}
]
},
{
"value": 176,
"name": "SetupAssistantSupport.framework",
"path": "PrivateFrameworks/SetupAssistantSupport.framework",
"children": [
{
"value": 168,
"name": "Versions",
"path": "PrivateFrameworks/SetupAssistantSupport.framework/Versions"
}
]
},
{
"value": 5512,
"name": "ShareKit.framework",
"path": "PrivateFrameworks/ShareKit.framework",
"children": [
{
"value": 5496,
"name": "Versions",
"path": "PrivateFrameworks/ShareKit.framework/Versions"
}
]
},
{
"value": 100,
"name": "Sharing.framework",
"path": "PrivateFrameworks/Sharing.framework",
"children": [
{
"value": 92,
"name": "Versions",
"path": "PrivateFrameworks/Sharing.framework/Versions"
}
]
},
{
"value": 616,
"name": "Shortcut.framework",
"path": "PrivateFrameworks/Shortcut.framework",
"children": [
{
"value": 608,
"name": "Versions",
"path": "PrivateFrameworks/Shortcut.framework/Versions"
}
]
},
{
"value": 20,
"name": "SleepServices.framework",
"path": "PrivateFrameworks/SleepServices.framework",
"children": [
{
"value": 12,
"name": "Versions",
"path": "PrivateFrameworks/SleepServices.framework/Versions"
}
]
},
{
"value": 62320,
"name": "Slideshows.framework",
"path": "PrivateFrameworks/Slideshows.framework",
"children": [
{
"value": 62312,
"name": "Versions",
"path": "PrivateFrameworks/Slideshows.framework/Versions"
}
]
},
{
"value": 144,
"name": "SMBClient.framework",
"path": "PrivateFrameworks/SMBClient.framework",
"children": [
{
"value": 136,
"name": "Versions",
"path": "PrivateFrameworks/SMBClient.framework/Versions"
}
]
},
{
"value": 112,
"name": "SocialAppsCore.framework",
"path": "PrivateFrameworks/SocialAppsCore.framework",
"children": [
{
"value": 104,
"name": "Versions",
"path": "PrivateFrameworks/SocialAppsCore.framework/Versions"
}
]
},
{
"value": 936,
"name": "SocialUI.framework",
"path": "PrivateFrameworks/SocialUI.framework",
"children": [
{
"value": 924,
"name": "Versions",
"path": "PrivateFrameworks/SocialUI.framework/Versions"
}
]
},
{
"value": 444,
"name": "SoftwareUpdate.framework",
"path": "PrivateFrameworks/SoftwareUpdate.framework",
"children": [
{
"value": 436,
"name": "Versions",
"path": "PrivateFrameworks/SoftwareUpdate.framework/Versions"
}
]
},
{
"value": 2112,
"name": "SpeechDictionary.framework",
"path": "PrivateFrameworks/SpeechDictionary.framework",
"children": [
{
"value": 2104,
"name": "Versions",
"path": "PrivateFrameworks/SpeechDictionary.framework/Versions"
}
]
},
{
"value": 8492,
"name": "SpeechObjects.framework",
"path": "PrivateFrameworks/SpeechObjects.framework",
"children": [
{
"value": 8484,
"name": "Versions",
"path": "PrivateFrameworks/SpeechObjects.framework/Versions"
}
]
},
{
"value": 4248,
"name": "SpeechRecognitionCore.framework",
"path": "PrivateFrameworks/SpeechRecognitionCore.framework",
"children": [
{
"value": 4236,
"name": "Versions",
"path": "PrivateFrameworks/SpeechRecognitionCore.framework/Versions"
}
]
},
{
"value": 2212,
"name": "SpotlightIndex.framework",
"path": "PrivateFrameworks/SpotlightIndex.framework",
"children": [
{
"value": 2204,
"name": "Versions",
"path": "PrivateFrameworks/SpotlightIndex.framework/Versions"
}
]
},
{
"value": 48,
"name": "SPSupport.framework",
"path": "PrivateFrameworks/SPSupport.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/SPSupport.framework/Versions"
}
]
},
{
"value": 184,
"name": "StoreJavaScript.framework",
"path": "PrivateFrameworks/StoreJavaScript.framework",
"children": [
{
"value": 176,
"name": "Versions",
"path": "PrivateFrameworks/StoreJavaScript.framework/Versions"
}
]
},
{
"value": 844,
"name": "StoreUI.framework",
"path": "PrivateFrameworks/StoreUI.framework",
"children": [
{
"value": 836,
"name": "Versions",
"path": "PrivateFrameworks/StoreUI.framework/Versions"
}
]
},
{
"value": 32,
"name": "StoreXPCServices.framework",
"path": "PrivateFrameworks/StoreXPCServices.framework",
"children": [
{
"value": 20,
"name": "Versions",
"path": "PrivateFrameworks/StoreXPCServices.framework/Versions"
}
]
},
{
"value": 72,
"name": "StreamingZip.framework",
"path": "PrivateFrameworks/StreamingZip.framework",
"children": [
{
"value": 60,
"name": "Versions",
"path": "PrivateFrameworks/StreamingZip.framework/Versions"
}
]
},
{
"value": 456,
"name": "Suggestions.framework",
"path": "PrivateFrameworks/Suggestions.framework",
"children": [
{
"value": 448,
"name": "Versions",
"path": "PrivateFrameworks/Suggestions.framework/Versions"
}
]
},
{
"value": 504,
"name": "Symbolication.framework",
"path": "PrivateFrameworks/Symbolication.framework",
"children": [
{
"value": 496,
"name": "Versions",
"path": "PrivateFrameworks/Symbolication.framework/Versions"
}
]
},
{
"value": 320,
"name": "Symptoms.framework",
"path": "PrivateFrameworks/Symptoms.framework",
"children": [
{
"value": 312,
"name": "Frameworks",
"path": "PrivateFrameworks/Symptoms.framework/Frameworks"
},
{
"value": 4,
"name": "Versions",
"path": "PrivateFrameworks/Symptoms.framework/Versions"
}
]
},
{
"value": 280,
"name": "SyncedDefaults.framework",
"path": "PrivateFrameworks/SyncedDefaults.framework",
"children": [
{
"value": 216,
"name": "Support",
"path": "PrivateFrameworks/SyncedDefaults.framework/Support"
},
{
"value": 56,
"name": "Versions",
"path": "PrivateFrameworks/SyncedDefaults.framework/Versions"
}
]
},
{
"value": 5272,
"name": "SyncServicesUI.framework",
"path": "PrivateFrameworks/SyncServicesUI.framework",
"children": [
{
"value": 5264,
"name": "Versions",
"path": "PrivateFrameworks/SyncServicesUI.framework/Versions"
}
]
},
{
"value": 932,
"name": "SystemAdministration.framework",
"path": "PrivateFrameworks/SystemAdministration.framework",
"children": [
{
"value": 864,
"name": "Versions",
"path": "PrivateFrameworks/SystemAdministration.framework/Versions"
},
{
"value": 60,
"name": "XPCServices",
"path": "PrivateFrameworks/SystemAdministration.framework/XPCServices"
}
]
},
{
"value": 5656,
"name": "SystemMigration.framework",
"path": "PrivateFrameworks/SystemMigration.framework",
"children": [
{
"value": 508,
"name": "Frameworks",
"path": "PrivateFrameworks/SystemMigration.framework/Frameworks"
},
{
"value": 5140,
"name": "Versions",
"path": "PrivateFrameworks/SystemMigration.framework/Versions"
}
]
},
{
"value": 52,
"name": "SystemUIPlugin.framework",
"path": "PrivateFrameworks/SystemUIPlugin.framework",
"children": [
{
"value": 44,
"name": "Versions",
"path": "PrivateFrameworks/SystemUIPlugin.framework/Versions"
}
]
},
{
"value": 144,
"name": "TCC.framework",
"path": "PrivateFrameworks/TCC.framework",
"children": [
{
"value": 136,
"name": "Versions",
"path": "PrivateFrameworks/TCC.framework/Versions"
}
]
},
{
"value": 48,
"name": "TrustEvaluationAgent.framework",
"path": "PrivateFrameworks/TrustEvaluationAgent.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/TrustEvaluationAgent.framework/Versions"
}
]
},
{
"value": 720,
"name": "Ubiquity.framework",
"path": "PrivateFrameworks/Ubiquity.framework",
"children": [
{
"value": 708,
"name": "Versions",
"path": "PrivateFrameworks/Ubiquity.framework/Versions"
}
]
},
{
"value": 136,
"name": "UIRecording.framework",
"path": "PrivateFrameworks/UIRecording.framework",
"children": [
{
"value": 128,
"name": "Versions",
"path": "PrivateFrameworks/UIRecording.framework/Versions"
}
]
},
{
"value": 56,
"name": "Uninstall.framework",
"path": "PrivateFrameworks/Uninstall.framework",
"children": [
{
"value": 48,
"name": "Versions",
"path": "PrivateFrameworks/Uninstall.framework/Versions"
}
]
},
{
"value": 2320,
"name": "UniversalAccess.framework",
"path": "PrivateFrameworks/UniversalAccess.framework",
"children": [
{
"value": 2308,
"name": "Versions",
"path": "PrivateFrameworks/UniversalAccess.framework/Versions"
}
]
},
{
"value": 1248,
"name": "VCXMPP.framework",
"path": "PrivateFrameworks/VCXMPP.framework",
"children": [
{
"value": 1232,
"name": "Versions",
"path": "PrivateFrameworks/VCXMPP.framework/Versions"
}
]
},
{
"value": 2016,
"name": "VectorKit.framework",
"path": "PrivateFrameworks/VectorKit.framework",
"children": [
{
"value": 2008,
"name": "Versions",
"path": "PrivateFrameworks/VectorKit.framework/Versions"
}
]
},
{
"value": 1164,
"name": "VideoConference.framework",
"path": "PrivateFrameworks/VideoConference.framework",
"children": [
{
"value": 1156,
"name": "Versions",
"path": "PrivateFrameworks/VideoConference.framework/Versions"
}
]
},
{
"value": 2152,
"name": "VideoProcessing.framework",
"path": "PrivateFrameworks/VideoProcessing.framework",
"children": [
{
"value": 2144,
"name": "Versions",
"path": "PrivateFrameworks/VideoProcessing.framework/Versions"
}
]
},
{
"value": 420,
"name": "ViewBridge.framework",
"path": "PrivateFrameworks/ViewBridge.framework",
"children": [
{
"value": 412,
"name": "Versions",
"path": "PrivateFrameworks/ViewBridge.framework/Versions"
}
]
},
{
"value": 164,
"name": "vmutils.framework",
"path": "PrivateFrameworks/vmutils.framework",
"children": [
{
"value": 156,
"name": "Versions",
"path": "PrivateFrameworks/vmutils.framework/Versions"
}
]
},
{
"value": 284,
"name": "WeatherKit.framework",
"path": "PrivateFrameworks/WeatherKit.framework",
"children": [
{
"value": 272,
"name": "Versions",
"path": "PrivateFrameworks/WeatherKit.framework/Versions"
}
]
},
{
"value": 2228,
"name": "WebContentAnalysis.framework",
"path": "PrivateFrameworks/WebContentAnalysis.framework",
"children": [
{
"value": 2220,
"name": "Versions",
"path": "PrivateFrameworks/WebContentAnalysis.framework/Versions"
}
]
},
{
"value": 24,
"name": "WebFilterDNS.framework",
"path": "PrivateFrameworks/WebFilterDNS.framework",
"children": [
{
"value": 16,
"name": "Versions",
"path": "PrivateFrameworks/WebFilterDNS.framework/Versions"
}
]
},
{
"value": 132,
"name": "WebInspector.framework",
"path": "PrivateFrameworks/WebInspector.framework",
"children": [
{
"value": 124,
"name": "Versions",
"path": "PrivateFrameworks/WebInspector.framework/Versions"
}
]
},
{
"value": 1228,
"name": "WebInspectorUI.framework",
"path": "PrivateFrameworks/WebInspectorUI.framework",
"children": [
{
"value": 1220,
"name": "Versions",
"path": "PrivateFrameworks/WebInspectorUI.framework/Versions"
}
]
},
{
"value": 2672,
"name": "WebKit2.framework",
"path": "PrivateFrameworks/WebKit2.framework",
"children": [
{
"value": 16,
"name": "NetworkProcess.app",
"path": "PrivateFrameworks/WebKit2.framework/NetworkProcess.app"
},
{
"value": 8,
"name": "OfflineStorageProcess.app",
"path": "PrivateFrameworks/WebKit2.framework/OfflineStorageProcess.app"
},
{
"value": 20,
"name": "PluginProcess.app",
"path": "PrivateFrameworks/WebKit2.framework/PluginProcess.app"
},
{
"value": 8,
"name": "SharedWorkerProcess.app",
"path": "PrivateFrameworks/WebKit2.framework/SharedWorkerProcess.app"
},
{
"value": 2592,
"name": "Versions",
"path": "PrivateFrameworks/WebKit2.framework/Versions"
},
{
"value": 16,
"name": "WebProcess.app",
"path": "PrivateFrameworks/WebKit2.framework/WebProcess.app"
}
]
},
{
"value": 496,
"name": "WhitePages.framework",
"path": "PrivateFrameworks/WhitePages.framework",
"children": [
{
"value": 488,
"name": "Versions",
"path": "PrivateFrameworks/WhitePages.framework/Versions"
}
]
},
{
"value": 36,
"name": "WiFiCloudSyncEngine.framework",
"path": "PrivateFrameworks/WiFiCloudSyncEngine.framework",
"children": [
{
"value": 28,
"name": "Versions",
"path": "PrivateFrameworks/WiFiCloudSyncEngine.framework/Versions"
}
]
},
{
"value": 444,
"name": "WirelessDiagnosticsSupport.framework",
"path": "PrivateFrameworks/WirelessDiagnosticsSupport.framework",
"children": [
{
"value": 436,
"name": "Versions",
"path": "PrivateFrameworks/WirelessDiagnosticsSupport.framework/Versions"
}
]
},
{
"value": 372,
"name": "XMPPCore.framework",
"path": "PrivateFrameworks/XMPPCore.framework",
"children": [
{
"value": 364,
"name": "Versions",
"path": "PrivateFrameworks/XMPPCore.framework/Versions"
}
]
},
{
"value": 48,
"name": "XPCObjects.framework",
"path": "PrivateFrameworks/XPCObjects.framework",
"children": [
{
"value": 40,
"name": "Versions",
"path": "PrivateFrameworks/XPCObjects.framework/Versions"
}
]
},
{
"value": 60,
"name": "XPCService.framework",
"path": "PrivateFrameworks/XPCService.framework",
"children": [
{
"value": 52,
"name": "Versions",
"path": "PrivateFrameworks/XPCService.framework/Versions"
}
]
},
{
"value": 516,
"name": "XQuery.framework",
"path": "PrivateFrameworks/XQuery.framework",
"children": [
{
"value": 508,
"name": "Versions",
"path": "PrivateFrameworks/XQuery.framework/Versions"
}
]
}
]
},
{
"value": 2988,
"name": "QuickLook",
"path": "QuickLook",
"children": [
{
"value": 8,
"name": "Audio.qlgenerator",
"path": "QuickLook/Audio.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/Audio.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "Bookmark.qlgenerator",
"path": "QuickLook/Bookmark.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/Bookmark.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "Clippings.qlgenerator",
"path": "QuickLook/Clippings.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/Clippings.qlgenerator/Contents"
}
]
},
{
"value": 232,
"name": "Contact.qlgenerator",
"path": "QuickLook/Contact.qlgenerator",
"children": [
{
"value": 232,
"name": "Contents",
"path": "QuickLook/Contact.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "EPS.qlgenerator",
"path": "QuickLook/EPS.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/EPS.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "Font.qlgenerator",
"path": "QuickLook/Font.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/Font.qlgenerator/Contents"
}
]
},
{
"value": 1432,
"name": "iCal.qlgenerator",
"path": "QuickLook/iCal.qlgenerator",
"children": [
{
"value": 1432,
"name": "Contents",
"path": "QuickLook/iCal.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "iChat.qlgenerator",
"path": "QuickLook/iChat.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/iChat.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "Icon.qlgenerator",
"path": "QuickLook/Icon.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/Icon.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "Image.qlgenerator",
"path": "QuickLook/Image.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/Image.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "LocPDF.qlgenerator",
"path": "QuickLook/LocPDF.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/LocPDF.qlgenerator/Contents"
}
]
},
{
"value": 28,
"name": "Mail.qlgenerator",
"path": "QuickLook/Mail.qlgenerator",
"children": [
{
"value": 28,
"name": "Contents",
"path": "QuickLook/Mail.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "Movie.qlgenerator",
"path": "QuickLook/Movie.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/Movie.qlgenerator/Contents"
}
]
},
{
"value": 20,
"name": "Notes.qlgenerator",
"path": "QuickLook/Notes.qlgenerator",
"children": [
{
"value": 20,
"name": "Contents",
"path": "QuickLook/Notes.qlgenerator/Contents"
}
]
},
{
"value": 24,
"name": "Office.qlgenerator",
"path": "QuickLook/Office.qlgenerator",
"children": [
{
"value": 24,
"name": "Contents",
"path": "QuickLook/Office.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "Package.qlgenerator",
"path": "QuickLook/Package.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/Package.qlgenerator/Contents"
}
]
},
{
"value": 20,
"name": "PDF.qlgenerator",
"path": "QuickLook/PDF.qlgenerator",
"children": [
{
"value": 20,
"name": "Contents",
"path": "QuickLook/PDF.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "SceneKit.qlgenerator",
"path": "QuickLook/SceneKit.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/SceneKit.qlgenerator/Contents"
}
]
},
{
"value": 36,
"name": "Security.qlgenerator",
"path": "QuickLook/Security.qlgenerator",
"children": [
{
"value": 36,
"name": "Contents",
"path": "QuickLook/Security.qlgenerator/Contents"
}
]
},
{
"value": 1060,
"name": "StandardBundles.qlgenerator",
"path": "QuickLook/StandardBundles.qlgenerator",
"children": [
{
"value": 1060,
"name": "Contents",
"path": "QuickLook/StandardBundles.qlgenerator/Contents"
}
]
},
{
"value": 12,
"name": "Text.qlgenerator",
"path": "QuickLook/Text.qlgenerator",
"children": [
{
"value": 12,
"name": "Contents",
"path": "QuickLook/Text.qlgenerator/Contents"
}
]
},
{
"value": 8,
"name": "Web.qlgenerator",
"path": "QuickLook/Web.qlgenerator",
"children": [
{
"value": 8,
"name": "Contents",
"path": "QuickLook/Web.qlgenerator/Contents"
}
]
}
]
},
{
"value": 17888,
"name": "QuickTime",
"path": "QuickTime",
"children": [
{
"value": 24,
"name": "AppleGVAHW.component",
"path": "QuickTime/AppleGVAHW.component",
"children": [
{
"value": 24,
"name": "Contents",
"path": "QuickTime/AppleGVAHW.component/Contents"
}
]
},
{
"value": 60,
"name": "ApplePixletVideo.component",
"path": "QuickTime/ApplePixletVideo.component",
"children": [
{
"value": 60,
"name": "Contents",
"path": "QuickTime/ApplePixletVideo.component/Contents"
}
]
},
{
"value": 216,
"name": "AppleProResDecoder.component",
"path": "QuickTime/AppleProResDecoder.component",
"children": [
{
"value": 216,
"name": "Contents",
"path": "QuickTime/AppleProResDecoder.component/Contents"
}
]
},
{
"value": 756,
"name": "AppleVAH264HW.component",
"path": "QuickTime/AppleVAH264HW.component",
"children": [
{
"value": 756,
"name": "Contents",
"path": "QuickTime/AppleVAH264HW.component/Contents"
}
]
},
{
"value": 24,
"name": "QuartzComposer.component",
"path": "QuickTime/QuartzComposer.component",
"children": [
{
"value": 24,
"name": "Contents",
"path": "QuickTime/QuartzComposer.component/Contents"
}
]
},
{
"value": 520,
"name": "QuickTime3GPP.component",
"path": "QuickTime/QuickTime3GPP.component",
"children": [
{
"value": 520,
"name": "Contents",
"path": "QuickTime/QuickTime3GPP.component/Contents"
}
]
},
{
"value": 11548,
"name": "QuickTimeComponents.component",
"path": "QuickTime/QuickTimeComponents.component",
"children": [
{
"value": 11548,
"name": "Contents",
"path": "QuickTime/QuickTimeComponents.component/Contents"
}
]
},
{
"value": 76,
"name": "QuickTimeFireWireDV.component",
"path": "QuickTime/QuickTimeFireWireDV.component",
"children": [
{
"value": 76,
"name": "Contents",
"path": "QuickTime/QuickTimeFireWireDV.component/Contents"
}
]
},
{
"value": 1592,
"name": "QuickTimeH264.component",
"path": "QuickTime/QuickTimeH264.component",
"children": [
{
"value": 1592,
"name": "Contents",
"path": "QuickTime/QuickTimeH264.component/Contents"
}
]
},
{
"value": 64,
"name": "QuickTimeIIDCDigitizer.component",
"path": "QuickTime/QuickTimeIIDCDigitizer.component",
"children": [
{
"value": 64,
"name": "Contents",
"path": "QuickTime/QuickTimeIIDCDigitizer.component/Contents"
}
]
},
{
"value": 832,
"name": "QuickTimeImporters.component",
"path": "QuickTime/QuickTimeImporters.component",
"children": [
{
"value": 832,
"name": "Contents",
"path": "QuickTime/QuickTimeImporters.component/Contents"
}
]
},
{
"value": 200,
"name": "QuickTimeMPEG.component",
"path": "QuickTime/QuickTimeMPEG.component",
"children": [
{
"value": 200,
"name": "Contents",
"path": "QuickTime/QuickTimeMPEG.component/Contents"
}
]
},
{
"value": 564,
"name": "QuickTimeMPEG4.component",
"path": "QuickTime/QuickTimeMPEG4.component",
"children": [
{
"value": 564,
"name": "Contents",
"path": "QuickTime/QuickTimeMPEG4.component/Contents"
}
]
},
{
"value": 968,
"name": "QuickTimeStreaming.component",
"path": "QuickTime/QuickTimeStreaming.component",
"children": [
{
"value": 968,
"name": "Contents",
"path": "QuickTime/QuickTimeStreaming.component/Contents"
}
]
},
{
"value": 120,
"name": "QuickTimeUSBVDCDigitizer.component",
"path": "QuickTime/QuickTimeUSBVDCDigitizer.component",
"children": [
{
"value": 120,
"name": "Contents",
"path": "QuickTime/QuickTimeUSBVDCDigitizer.component/Contents"
}
]
},
{
"value": 324,
"name": "QuickTimeVR.component",
"path": "QuickTime/QuickTimeVR.component",
"children": [
{
"value": 324,
"name": "Contents",
"path": "QuickTime/QuickTimeVR.component/Contents"
}
]
}
]
},
{
"value": 28,
"name": "QuickTimeJava",
"path": "QuickTimeJava",
"children": [
{
"value": 28,
"name": "QuickTimeJava.bundle",
"path": "QuickTimeJava/QuickTimeJava.bundle",
"children": [
{
"value": 28,
"name": "Contents",
"path": "QuickTimeJava/QuickTimeJava.bundle/Contents"
}
]
}
]
},
{
"value": 20,
"name": "Recents",
"path": "Recents",
"children": [
{
"value": 20,
"name": "Plugins",
"path": "Recents/Plugins",
"children": [
{
"value": 36,
"name": "AddressBook.assistantBundle",
"path": "Assistant/Plugins/AddressBook.assistantBundle"
},
{
"value": 8,
"name": "GenericAddressHandler.addresshandler",
"path": "Recents/Plugins/GenericAddressHandler.addresshandler"
},
{
"value": 12,
"name": "MapsRecents.addresshandler",
"path": "Recents/Plugins/MapsRecents.addresshandler"
}
]
}
]
},
{
"value": 12,
"name": "Sandbox",
"path": "Sandbox",
"children": [
{
"value": 12,
"name": "Profiles",
"path": "Sandbox/Profiles"
}
]
},
{
"value": 1052,
"name": "ScreenSavers",
"path": "ScreenSavers",
"children": [
{
"value": 8,
"name": "FloatingMessage.saver",
"path": "ScreenSavers/FloatingMessage.saver",
"children": [
{
"value": 8,
"name": "Contents",
"path": "ScreenSavers/FloatingMessage.saver/Contents"
}
]
},
{
"value": 360,
"name": "Flurry.saver",
"path": "ScreenSavers/Flurry.saver",
"children": [
{
"value": 360,
"name": "Contents",
"path": "ScreenSavers/Flurry.saver/Contents"
}
]
},
{
"value": 568,
"name": "iTunes Artwork.saver",
"path": "ScreenSavers/iTunes Artwork.saver",
"children": [
{
"value": 568,
"name": "Contents",
"path": "ScreenSavers/iTunes Artwork.saver/Contents"
}
]
},
{
"value": 52,
"name": "Random.saver",
"path": "ScreenSavers/Random.saver",
"children": [
{
"value": 52,
"name": "Contents",
"path": "ScreenSavers/Random.saver/Contents"
}
]
}
]
},
{
"value": 1848,
"name": "ScreenReader",
"path": "ScreenReader",
"children": [
{
"value": 556,
"name": "BrailleDrivers",
"path": "ScreenReader/BrailleDrivers",
"children": [
{
"value": 28,
"name": "Alva6 Series.brailledriver",
"path": "ScreenReader/BrailleDrivers/Alva6 Series.brailledriver"
},
{
"value": 16,
"name": "Alva.brailledriver",
"path": "ScreenReader/BrailleDrivers/Alva.brailledriver"
},
{
"value": 28,
"name": "BrailleConnect.brailledriver",
"path": "ScreenReader/BrailleDrivers/BrailleConnect.brailledriver"
},
{
"value": 24,
"name": "BrailleNoteApex.brailledriver",
"path": "ScreenReader/BrailleDrivers/BrailleNoteApex.brailledriver"
},
{
"value": 16,
"name": "BrailleNote.brailledriver",
"path": "ScreenReader/BrailleDrivers/BrailleNote.brailledriver"
},
{
"value": 24,
"name": "BrailleSense.brailledriver",
"path": "ScreenReader/BrailleDrivers/BrailleSense.brailledriver"
},
{
"value": 28,
"name": "Brailliant2.brailledriver",
"path": "ScreenReader/BrailleDrivers/Brailliant2.brailledriver"
},
{
"value": 28,
"name": "Brailliant.brailledriver",
"path": "ScreenReader/BrailleDrivers/Brailliant.brailledriver"
},
{
"value": 16,
"name": "Deininger.brailledriver",
"path": "ScreenReader/BrailleDrivers/Deininger.brailledriver"
},
{
"value": 20,
"name": "EasyLink.brailledriver",
"path": "ScreenReader/BrailleDrivers/EasyLink.brailledriver"
},
{
"value": 28,
"name": "Eurobraille.brailledriver",
"path": "ScreenReader/BrailleDrivers/Eurobraille.brailledriver"
},
{
"value": 28,
"name": "FreedomScientific.brailledriver",
"path": "ScreenReader/BrailleDrivers/FreedomScientific.brailledriver"
},
{
"value": 32,
"name": "HandyTech.brailledriver",
"path": "ScreenReader/BrailleDrivers/HandyTech.brailledriver"
},
{
"value": 20,
"name": "HIMSDriver.brailledriver",
"path": "ScreenReader/BrailleDrivers/HIMSDriver.brailledriver"
},
{
"value": 28,
"name": "KGSDriver.brailledriver",
"path": "ScreenReader/BrailleDrivers/KGSDriver.brailledriver"
},
{
"value": 28,
"name": "MDV.brailledriver",
"path": "ScreenReader/BrailleDrivers/MDV.brailledriver"
},
{
"value": 24,
"name": "NinepointSystems.brailledriver",
"path": "ScreenReader/BrailleDrivers/NinepointSystems.brailledriver"
},
{
"value": 24,
"name": "Papenmeier.brailledriver",
"path": "ScreenReader/BrailleDrivers/Papenmeier.brailledriver"
},
{
"value": 28,
"name": "Refreshabraille.brailledriver",
"path": "ScreenReader/BrailleDrivers/Refreshabraille.brailledriver"
},
{
"value": 32,
"name": "Seika.brailledriver",
"path": "ScreenReader/BrailleDrivers/Seika.brailledriver"
},
{
"value": 16,
"name": "SyncBraille.brailledriver",
"path": "ScreenReader/BrailleDrivers/SyncBraille.brailledriver"
},
{
"value": 24,
"name": "VarioPro.brailledriver",
"path": "ScreenReader/BrailleDrivers/VarioPro.brailledriver"
},
{
"value": 16,
"name": "Voyager.brailledriver",
"path": "ScreenReader/BrailleDrivers/Voyager.brailledriver"
}
]
},
{
"value": 1292,
"name": "BrailleTables",
"path": "ScreenReader/BrailleTables",
"children": [
{
"value": 1292,
"name": "Duxbury.brailletable",
"path": "ScreenReader/BrailleTables/Duxbury.brailletable"
}
]
}
]
},
{
"value": 1408,
"name": "ScriptingAdditions",
"path": "ScriptingAdditions",
"children": [
{
"value": 8,
"name": "DigitalHub Scripting.osax",
"path": "ScriptingAdditions/DigitalHub Scripting.osax",
"children": [
{
"value": 8,
"name": "Contents",
"path": "ScriptingAdditions/DigitalHub Scripting.osax/Contents"
}
]
},
{
"value": 1400,
"name": "StandardAdditions.osax",
"path": "ScriptingAdditions/StandardAdditions.osax",
"children": [
{
"value": 1400,
"name": "Contents",
"path": "ScriptingAdditions/StandardAdditions.osax/Contents"
}
]
}
]
},
{
"value": 0,
"name": "ScriptingDefinitions",
"path": "ScriptingDefinitions"
},
{
"value": 0,
"name": "SDKSettingsPlist",
"path": "SDKSettingsPlist"
},
{
"value": 312,
"name": "Security",
"path": "Security",
"children": [
{
"value": 100,
"name": "dotmac_tp.bundle",
"path": "Security/dotmac_tp.bundle",
"children": [
{
"value": 100,
"name": "Contents",
"path": "Security/dotmac_tp.bundle/Contents"
}
]
},
{
"value": 72,
"name": "ldapdl.bundle",
"path": "Security/ldapdl.bundle",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Security/ldapdl.bundle/Contents"
}
]
},
{
"value": 132,
"name": "tokend",
"path": "Security/tokend",
"children": [
{
"value": 132,
"name": "uiplugins",
"path": "Security/tokend/uiplugins"
}
]
}
]
},
{
"value": 18208,
"name": "Services",
"path": "Services",
"children": [
{
"value": 0,
"name": "Addto iTunes as a Spoken Track.workflow",
"path": "Services/Addto iTunes as a Spoken Track.workflow",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Services/Addto iTunes as a Spoken Track.workflow/Contents"
}
]
},
{
"value": 14308,
"name": "AppleSpell.service",
"path": "Services/AppleSpell.service",
"children": [
{
"value": 14308,
"name": "Contents",
"path": "Services/AppleSpell.service/Contents"
}
]
},
{
"value": 556,
"name": "ChineseTextConverterService.app",
"path": "Services/ChineseTextConverterService.app",
"children": [
{
"value": 556,
"name": "Contents",
"path": "Services/ChineseTextConverterService.app/Contents"
}
]
},
{
"value": 48,
"name": "EncodeSelected Audio Files.workflow",
"path": "Services/EncodeSelected Audio Files.workflow",
"children": [
{
"value": 48,
"name": "Contents",
"path": "Services/EncodeSelected Audio Files.workflow/Contents"
}
]
},
{
"value": 40,
"name": "EncodeSelected Video Files.workflow",
"path": "Services/EncodeSelected Video Files.workflow",
"children": [
{
"value": 40,
"name": "Contents",
"path": "Services/EncodeSelected Video Files.workflow/Contents"
}
]
},
{
"value": 1344,
"name": "ImageCaptureService.app",
"path": "Services/ImageCaptureService.app",
"children": [
{
"value": 1344,
"name": "Contents",
"path": "Services/ImageCaptureService.app/Contents"
}
]
},
{
"value": 16,
"name": "OpenSpell.service",
"path": "Services/OpenSpell.service",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Services/OpenSpell.service/Contents"
}
]
},
{
"value": 0,
"name": "SetDesktop Picture.workflow",
"path": "Services/SetDesktop Picture.workflow",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Services/SetDesktop Picture.workflow/Contents"
}
]
},
{
"value": 0,
"name": "ShowAddress in Google Maps.workflow",
"path": "Services/ShowAddress in Google Maps.workflow",
"children": [
{
"value": 0,
"name": "Contents",
"path": "Services/ShowAddress in Google Maps.workflow/Contents"
}
]
},
{
"value": 60,
"name": "ShowMap.workflow",
"path": "Services/ShowMap.workflow",
"children": [
{
"value": 60,
"name": "Contents",
"path": "Services/ShowMap.workflow/Contents"
}
]
},
{
"value": 12,
"name": "SpeechService.service",
"path": "Services/SpeechService.service",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Services/SpeechService.service/Contents"
}
]
},
{
"value": 8,
"name": "Spotlight.service",
"path": "Services/Spotlight.service",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Services/Spotlight.service/Contents"
}
]
},
{
"value": 1816,
"name": "SummaryService.app",
"path": "Services/SummaryService.app",
"children": [
{
"value": 1816,
"name": "Contents",
"path": "Services/SummaryService.app/Contents"
}
]
}
]
},
{
"value": 700,
"name": "Sounds",
"path": "Sounds"
},
{
"value": 1512668,
"name": "Speech",
"path": "Speech",
"children": [
{
"value": 2804,
"name": "Recognizers",
"path": "Speech/Recognizers",
"children": [
{
"value": 2804,
"name": "AppleSpeakableItems.SpeechRecognizer",
"path": "Speech/Recognizers/AppleSpeakableItems.SpeechRecognizer"
}
]
},
{
"value": 6684,
"name": "Synthesizers",
"path": "Speech/Synthesizers",
"children": [
{
"value": 800,
"name": "MacinTalk.SpeechSynthesizer",
"path": "Speech/Synthesizers/MacinTalk.SpeechSynthesizer"
},
{
"value": 3468,
"name": "MultiLingual.SpeechSynthesizer",
"path": "Speech/Synthesizers/MultiLingual.SpeechSynthesizer"
},
{
"value": 2416,
"name": "Polyglot.SpeechSynthesizer",
"path": "Speech/Synthesizers/Polyglot.SpeechSynthesizer"
}
]
},
{
"value": 1503180,
"name": "Voices",
"path": "Speech/Voices",
"children": [
{
"value": 1540,
"name": "Agnes.SpeechVoice",
"path": "Speech/Voices/Agnes.SpeechVoice"
},
{
"value": 20,
"name": "Albert.SpeechVoice",
"path": "Speech/Voices/Albert.SpeechVoice"
},
{
"value": 412132,
"name": "Alex.SpeechVoice",
"path": "Speech/Voices/Alex.SpeechVoice"
},
{
"value": 624,
"name": "AliceCompact.SpeechVoice",
"path": "Speech/Voices/AliceCompact.SpeechVoice"
},
{
"value": 908,
"name": "AlvaCompact.SpeechVoice",
"path": "Speech/Voices/AlvaCompact.SpeechVoice"
},
{
"value": 668,
"name": "AmelieCompact.SpeechVoice",
"path": "Speech/Voices/AmelieCompact.SpeechVoice"
},
{
"value": 1016,
"name": "AnnaCompact.SpeechVoice",
"path": "Speech/Voices/AnnaCompact.SpeechVoice"
},
{
"value": 12,
"name": "BadNews.SpeechVoice",
"path": "Speech/Voices/BadNews.SpeechVoice"
},
{
"value": 20,
"name": "Bahh.SpeechVoice",
"path": "Speech/Voices/Bahh.SpeechVoice"
},
{
"value": 48,
"name": "Bells.SpeechVoice",
"path": "Speech/Voices/Bells.SpeechVoice"
},
{
"value": 20,
"name": "Boing.SpeechVoice",
"path": "Speech/Voices/Boing.SpeechVoice"
},
{
"value": 1684,
"name": "Bruce.SpeechVoice",
"path": "Speech/Voices/Bruce.SpeechVoice"
},
{
"value": 12,
"name": "Bubbles.SpeechVoice",
"path": "Speech/Voices/Bubbles.SpeechVoice"
},
{
"value": 24,
"name": "Cellos.SpeechVoice",
"path": "Speech/Voices/Cellos.SpeechVoice"
},
{
"value": 720,
"name": "DamayantiCompact.SpeechVoice",
"path": "Speech/Voices/DamayantiCompact.SpeechVoice"
},
{
"value": 1000,
"name": "DanielCompact.SpeechVoice",
"path": "Speech/Voices/DanielCompact.SpeechVoice"
},
{
"value": 24,
"name": "Deranged.SpeechVoice",
"path": "Speech/Voices/Deranged.SpeechVoice"
},
{
"value": 740,
"name": "EllenCompact.SpeechVoice",
"path": "Speech/Voices/EllenCompact.SpeechVoice"
},
{
"value": 12,
"name": "Fred.SpeechVoice",
"path": "Speech/Voices/Fred.SpeechVoice"
},
{
"value": 12,
"name": "GoodNews.SpeechVoice",
"path": "Speech/Voices/GoodNews.SpeechVoice"
},
{
"value": 28,
"name": "Hysterical.SpeechVoice",
"path": "Speech/Voices/Hysterical.SpeechVoice"
},
{
"value": 492,
"name": "IoanaCompact.SpeechVoice",
"path": "Speech/Voices/IoanaCompact.SpeechVoice"
},
{
"value": 596,
"name": "JoanaCompact.SpeechVoice",
"path": "Speech/Voices/JoanaCompact.SpeechVoice"
},
{
"value": 12,
"name": "Junior.SpeechVoice",
"path": "Speech/Voices/Junior.SpeechVoice"
},
{
"value": 1336,
"name": "KanyaCompact.SpeechVoice",
"path": "Speech/Voices/KanyaCompact.SpeechVoice"
},
{
"value": 1004,
"name": "KarenCompact.SpeechVoice",
"path": "Speech/Voices/KarenCompact.SpeechVoice"
},
{
"value": 12,
"name": "Kathy.SpeechVoice",
"path": "Speech/Voices/Kathy.SpeechVoice"
},
{
"value": 408836,
"name": "Kyoko.SpeechVoice",
"path": "Speech/Voices/Kyoko.SpeechVoice"
},
{
"value": 2620,
"name": "KyokoCompact.SpeechVoice",
"path": "Speech/Voices/KyokoCompact.SpeechVoice"
},
{
"value": 496,
"name": "LauraCompact.SpeechVoice",
"path": "Speech/Voices/LauraCompact.SpeechVoice"
},
{
"value": 2104,
"name": "LekhaCompact.SpeechVoice",
"path": "Speech/Voices/LekhaCompact.SpeechVoice"
},
{
"value": 548,
"name": "LucianaCompact.SpeechVoice",
"path": "Speech/Voices/LucianaCompact.SpeechVoice"
},
{
"value": 504,
"name": "MariskaCompact.SpeechVoice",
"path": "Speech/Voices/MariskaCompact.SpeechVoice"
},
{
"value": 2092,
"name": "Mei-JiaCompact.SpeechVoice",
"path": "Speech/Voices/Mei-JiaCompact.SpeechVoice"
},
{
"value": 1020,
"name": "MelinaCompact.SpeechVoice",
"path": "Speech/Voices/MelinaCompact.SpeechVoice"
},
{
"value": 2160,
"name": "MilenaCompact.SpeechVoice",
"path": "Speech/Voices/MilenaCompact.SpeechVoice"
},
{
"value": 728,
"name": "MoiraCompact.SpeechVoice",
"path": "Speech/Voices/MoiraCompact.SpeechVoice"
},
{
"value": 612,
"name": "MonicaCompact.SpeechVoice",
"path": "Speech/Voices/MonicaCompact.SpeechVoice"
},
{
"value": 824,
"name": "NoraCompact.SpeechVoice",
"path": "Speech/Voices/NoraCompact.SpeechVoice"
},
{
"value": 24,
"name": "Organ.SpeechVoice",
"path": "Speech/Voices/Organ.SpeechVoice"
},
{
"value": 664,
"name": "PaulinaCompact.SpeechVoice",
"path": "Speech/Voices/PaulinaCompact.SpeechVoice"
},
{
"value": 12,
"name": "Princess.SpeechVoice",
"path": "Speech/Voices/Princess.SpeechVoice"
},
{
"value": 12,
"name": "Ralph.SpeechVoice",
"path": "Speech/Voices/Ralph.SpeechVoice"
},
{
"value": 908,
"name": "SamanthaCompact.SpeechVoice",
"path": "Speech/Voices/SamanthaCompact.SpeechVoice"
},
{
"value": 828,
"name": "SaraCompact.SpeechVoice",
"path": "Speech/Voices/SaraCompact.SpeechVoice"
},
{
"value": 664,
"name": "SatuCompact.SpeechVoice",
"path": "Speech/Voices/SatuCompact.SpeechVoice"
},
{
"value": 2336,
"name": "Sin-jiCompact.SpeechVoice",
"path": "Speech/Voices/Sin-jiCompact.SpeechVoice"
},
{
"value": 2856,
"name": "TarikCompact.SpeechVoice",
"path": "Speech/Voices/TarikCompact.SpeechVoice"
},
{
"value": 948,
"name": "TessaCompact.SpeechVoice",
"path": "Speech/Voices/TessaCompact.SpeechVoice"
},
{
"value": 660,
"name": "ThomasCompact.SpeechVoice",
"path": "Speech/Voices/ThomasCompact.SpeechVoice"
},
{
"value": 610156,
"name": "Ting-Ting.SpeechVoice",
"path": "Speech/Voices/Ting-Ting.SpeechVoice"
},
{
"value": 1708,
"name": "Ting-TingCompact.SpeechVoice",
"path": "Speech/Voices/Ting-TingCompact.SpeechVoice"
},
{
"value": 12,
"name": "Trinoids.SpeechVoice",
"path": "Speech/Voices/Trinoids.SpeechVoice"
},
{
"value": 28632,
"name": "Vicki.SpeechVoice",
"path": "Speech/Voices/Vicki.SpeechVoice"
},
{
"value": 1664,
"name": "Victoria.SpeechVoice",
"path": "Speech/Voices/Victoria.SpeechVoice"
},
{
"value": 12,
"name": "Whisper.SpeechVoice",
"path": "Speech/Voices/Whisper.SpeechVoice"
},
{
"value": 992,
"name": "XanderCompact.SpeechVoice",
"path": "Speech/Voices/XanderCompact.SpeechVoice"
},
{
"value": 756,
"name": "YeldaCompact.SpeechVoice",
"path": "Speech/Voices/YeldaCompact.SpeechVoice"
},
{
"value": 728,
"name": "YunaCompact.SpeechVoice",
"path": "Speech/Voices/YunaCompact.SpeechVoice"
},
{
"value": 12,
"name": "Zarvox.SpeechVoice",
"path": "Speech/Voices/Zarvox.SpeechVoice"
},
{
"value": 564,
"name": "ZosiaCompact.SpeechVoice",
"path": "Speech/Voices/ZosiaCompact.SpeechVoice"
},
{
"value": 772,
"name": "ZuzanaCompact.SpeechVoice",
"path": "Speech/Voices/ZuzanaCompact.SpeechVoice"
}
]
}
]
},
{
"value": 1060,
"name": "Spelling",
"path": "Spelling"
},
{
"value": 412,
"name": "Spotlight",
"path": "Spotlight",
"children": [
{
"value": 20,
"name": "Application.mdimporter",
"path": "Spotlight/Application.mdimporter",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Spotlight/Application.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "Archives.mdimporter",
"path": "Spotlight/Archives.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/Archives.mdimporter/Contents"
}
]
},
{
"value": 20,
"name": "Audio.mdimporter",
"path": "Spotlight/Audio.mdimporter",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Spotlight/Audio.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "Automator.mdimporter",
"path": "Spotlight/Automator.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/Automator.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "Bookmarks.mdimporter",
"path": "Spotlight/Bookmarks.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/Bookmarks.mdimporter/Contents"
}
]
},
{
"value": 16,
"name": "Chat.mdimporter",
"path": "Spotlight/Chat.mdimporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Spotlight/Chat.mdimporter/Contents"
}
]
},
{
"value": 28,
"name": "CoreMedia.mdimporter",
"path": "Spotlight/CoreMedia.mdimporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Spotlight/CoreMedia.mdimporter/Contents"
}
]
},
{
"value": 32,
"name": "Font.mdimporter",
"path": "Spotlight/Font.mdimporter",
"children": [
{
"value": 32,
"name": "Contents",
"path": "Spotlight/Font.mdimporter/Contents"
}
]
},
{
"value": 16,
"name": "iCal.mdimporter",
"path": "Spotlight/iCal.mdimporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Spotlight/iCal.mdimporter/Contents"
}
]
},
{
"value": 28,
"name": "Image.mdimporter",
"path": "Spotlight/Image.mdimporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "Spotlight/Image.mdimporter/Contents"
}
]
},
{
"value": 72,
"name": "iPhoto.mdimporter",
"path": "Spotlight/iPhoto.mdimporter",
"children": [
{
"value": 72,
"name": "Contents",
"path": "Spotlight/iPhoto.mdimporter/Contents"
}
]
},
{
"value": 16,
"name": "iPhoto8.mdimporter",
"path": "Spotlight/iPhoto8.mdimporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Spotlight/iPhoto8.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "Mail.mdimporter",
"path": "Spotlight/Mail.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/Mail.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "MIDI.mdimporter",
"path": "Spotlight/MIDI.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/MIDI.mdimporter/Contents"
}
]
},
{
"value": 8,
"name": "Notes.mdimporter",
"path": "Spotlight/Notes.mdimporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "Spotlight/Notes.mdimporter/Contents"
}
]
},
{
"value": 16,
"name": "PDF.mdimporter",
"path": "Spotlight/PDF.mdimporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Spotlight/PDF.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "PS.mdimporter",
"path": "Spotlight/PS.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/PS.mdimporter/Contents"
}
]
},
{
"value": 12,
"name": "QuartzComposer.mdimporter",
"path": "Spotlight/QuartzComposer.mdimporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "Spotlight/QuartzComposer.mdimporter/Contents"
}
]
},
{
"value": 20,
"name": "RichText.mdimporter",
"path": "Spotlight/RichText.mdimporter",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Spotlight/RichText.mdimporter/Contents"
}
]
},
{
"value": 16,
"name": "SystemPrefs.mdimporter",
"path": "Spotlight/SystemPrefs.mdimporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "Spotlight/SystemPrefs.mdimporter/Contents"
}
]
},
{
"value": 20,
"name": "vCard.mdimporter",
"path": "Spotlight/vCard.mdimporter",
"children": [
{
"value": 20,
"name": "Contents",
"path": "Spotlight/vCard.mdimporter/Contents"
}
]
}
]
},
{
"value": 0,
"name": "StartupItems",
"path": "StartupItems"
},
{
"value": 168,
"name": "SyncServices",
"path": "SyncServices",
"children": [
{
"value": 0,
"name": "AutoRegistration",
"path": "SyncServices/AutoRegistration",
"children": [
{
"value": 0,
"name": "Clients",
"path": "SyncServices/AutoRegistration/Clients"
},
{
"value": 0,
"name": "Schemas",
"path": "SyncServices/AutoRegistration/Schemas"
}
]
},
{
"value": 168,
"name": "Schemas",
"path": "SyncServices/Schemas",
"children": [
{
"value": 24,
"name": "Bookmarks.syncschema",
"path": "SyncServices/Schemas/Bookmarks.syncschema"
},
{
"value": 68,
"name": "Calendars.syncschema",
"path": "SyncServices/Schemas/Calendars.syncschema"
},
{
"value": 48,
"name": "Contacts.syncschema",
"path": "SyncServices/Schemas/Contacts.syncschema"
},
{
"value": 16,
"name": "Notes.syncschema",
"path": "SyncServices/Schemas/Notes.syncschema"
},
{
"value": 12,
"name": "Palm.syncschema",
"path": "SyncServices/Schemas/Palm.syncschema"
}
]
}
]
},
{
"value": 3156,
"name": "SystemConfiguration",
"path": "SystemConfiguration",
"children": [
{
"value": 8,
"name": "ApplicationFirewallStartup.bundle",
"path": "SystemConfiguration/ApplicationFirewallStartup.bundle",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemConfiguration/ApplicationFirewallStartup.bundle/Contents"
}
]
},
{
"value": 116,
"name": "EAPOLController.bundle",
"path": "SystemConfiguration/EAPOLController.bundle",
"children": [
{
"value": 116,
"name": "Contents",
"path": "SystemConfiguration/EAPOLController.bundle/Contents"
}
]
},
{
"value": 0,
"name": "InterfaceNamer.bundle",
"path": "SystemConfiguration/InterfaceNamer.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/InterfaceNamer.bundle/Contents"
}
]
},
{
"value": 132,
"name": "IPConfiguration.bundle",
"path": "SystemConfiguration/IPConfiguration.bundle",
"children": [
{
"value": 132,
"name": "Contents",
"path": "SystemConfiguration/IPConfiguration.bundle/Contents"
}
]
},
{
"value": 0,
"name": "IPMonitor.bundle",
"path": "SystemConfiguration/IPMonitor.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/IPMonitor.bundle/Contents"
}
]
},
{
"value": 0,
"name": "KernelEventMonitor.bundle",
"path": "SystemConfiguration/KernelEventMonitor.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/KernelEventMonitor.bundle/Contents"
}
]
},
{
"value": 0,
"name": "LinkConfiguration.bundle",
"path": "SystemConfiguration/LinkConfiguration.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/LinkConfiguration.bundle/Contents"
}
]
},
{
"value": 20,
"name": "Logger.bundle",
"path": "SystemConfiguration/Logger.bundle",
"children": [
{
"value": 20,
"name": "Contents",
"path": "SystemConfiguration/Logger.bundle/Contents"
}
]
},
{
"value": 2804,
"name": "PPPController.bundle",
"path": "SystemConfiguration/PPPController.bundle",
"children": [
{
"value": 2804,
"name": "Contents",
"path": "SystemConfiguration/PPPController.bundle/Contents"
}
]
},
{
"value": 0,
"name": "PreferencesMonitor.bundle",
"path": "SystemConfiguration/PreferencesMonitor.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/PreferencesMonitor.bundle/Contents"
}
]
},
{
"value": 76,
"name": "PrinterNotifications.bundle",
"path": "SystemConfiguration/PrinterNotifications.bundle",
"children": [
{
"value": 76,
"name": "Contents",
"path": "SystemConfiguration/PrinterNotifications.bundle/Contents"
}
]
},
{
"value": 0,
"name": "SCNetworkReachability.bundle",
"path": "SystemConfiguration/SCNetworkReachability.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "SystemConfiguration/SCNetworkReachability.bundle/Contents"
}
]
}
]
},
{
"value": 1520,
"name": "SystemProfiler",
"path": "SystemProfiler",
"children": [
{
"value": 84,
"name": "SPAirPortReporter.spreporter",
"path": "SystemProfiler/SPAirPortReporter.spreporter",
"children": [
{
"value": 84,
"name": "Contents",
"path": "SystemProfiler/SPAirPortReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPApplicationsReporter.spreporter",
"path": "SystemProfiler/SPApplicationsReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPApplicationsReporter.spreporter/Contents"
}
]
},
{
"value": 28,
"name": "SPAudioReporter.spreporter",
"path": "SystemProfiler/SPAudioReporter.spreporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "SystemProfiler/SPAudioReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPBluetoothReporter.spreporter",
"path": "SystemProfiler/SPBluetoothReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPBluetoothReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPCameraReporter.spreporter",
"path": "SystemProfiler/SPCameraReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPCameraReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPCardReaderReporter.spreporter",
"path": "SystemProfiler/SPCardReaderReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPCardReaderReporter.spreporter/Contents"
}
]
},
{
"value": 28,
"name": "SPComponentReporter.spreporter",
"path": "SystemProfiler/SPComponentReporter.spreporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "SystemProfiler/SPComponentReporter.spreporter/Contents"
}
]
},
{
"value": 28,
"name": "SPConfigurationProfileReporter.spreporter",
"path": "SystemProfiler/SPConfigurationProfileReporter.spreporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "SystemProfiler/SPConfigurationProfileReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPDeveloperToolsReporter.spreporter",
"path": "SystemProfiler/SPDeveloperToolsReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPDeveloperToolsReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPDiagnosticsReporter.spreporter",
"path": "SystemProfiler/SPDiagnosticsReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPDiagnosticsReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPDisabledApplicationsReporter.spreporter",
"path": "SystemProfiler/SPDisabledApplicationsReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPDisabledApplicationsReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPDiscBurningReporter.spreporter",
"path": "SystemProfiler/SPDiscBurningReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPDiscBurningReporter.spreporter/Contents"
}
]
},
{
"value": 284,
"name": "SPDisplaysReporter.spreporter",
"path": "SystemProfiler/SPDisplaysReporter.spreporter",
"children": [
{
"value": 284,
"name": "Contents",
"path": "SystemProfiler/SPDisplaysReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPEthernetReporter.spreporter",
"path": "SystemProfiler/SPEthernetReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPEthernetReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPExtensionsReporter.spreporter",
"path": "SystemProfiler/SPExtensionsReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPExtensionsReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPFibreChannelReporter.spreporter",
"path": "SystemProfiler/SPFibreChannelReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPFibreChannelReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPFirewallReporter.spreporter",
"path": "SystemProfiler/SPFirewallReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPFirewallReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPFireWireReporter.spreporter",
"path": "SystemProfiler/SPFireWireReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPFireWireReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPFontReporter.spreporter",
"path": "SystemProfiler/SPFontReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPFontReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPFrameworksReporter.spreporter",
"path": "SystemProfiler/SPFrameworksReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPFrameworksReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPHardwareRAIDReporter.spreporter",
"path": "SystemProfiler/SPHardwareRAIDReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPHardwareRAIDReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPInstallHistoryReporter.spreporter",
"path": "SystemProfiler/SPInstallHistoryReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPInstallHistoryReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPLogsReporter.spreporter",
"path": "SystemProfiler/SPLogsReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPLogsReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPManagedClientReporter.spreporter",
"path": "SystemProfiler/SPManagedClientReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPManagedClientReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPMemoryReporter.spreporter",
"path": "SystemProfiler/SPMemoryReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPMemoryReporter.spreporter/Contents"
}
]
},
{
"value": 264,
"name": "SPNetworkLocationReporter.spreporter",
"path": "SystemProfiler/SPNetworkLocationReporter.spreporter",
"children": [
{
"value": 264,
"name": "Contents",
"path": "SystemProfiler/SPNetworkLocationReporter.spreporter/Contents"
}
]
},
{
"value": 268,
"name": "SPNetworkReporter.spreporter",
"path": "SystemProfiler/SPNetworkReporter.spreporter",
"children": [
{
"value": 268,
"name": "Contents",
"path": "SystemProfiler/SPNetworkReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPNetworkVolumeReporter.spreporter",
"path": "SystemProfiler/SPNetworkVolumeReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPNetworkVolumeReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPOSReporter.spreporter",
"path": "SystemProfiler/SPOSReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPOSReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPParallelATAReporter.spreporter",
"path": "SystemProfiler/SPParallelATAReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPParallelATAReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPParallelSCSIReporter.spreporter",
"path": "SystemProfiler/SPParallelSCSIReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPParallelSCSIReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPPCIReporter.spreporter",
"path": "SystemProfiler/SPPCIReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPPCIReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPPlatformReporter.spreporter",
"path": "SystemProfiler/SPPlatformReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPPlatformReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPPowerReporter.spreporter",
"path": "SystemProfiler/SPPowerReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPPowerReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPPrefPaneReporter.spreporter",
"path": "SystemProfiler/SPPrefPaneReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPPrefPaneReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPPrintersReporter.spreporter",
"path": "SystemProfiler/SPPrintersReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPPrintersReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPPrintersSoftwareReporter.spreporter",
"path": "SystemProfiler/SPPrintersSoftwareReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPPrintersSoftwareReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPSASReporter.spreporter",
"path": "SystemProfiler/SPSASReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPSASReporter.spreporter/Contents"
}
]
},
{
"value": 16,
"name": "SPSerialATAReporter.spreporter",
"path": "SystemProfiler/SPSerialATAReporter.spreporter",
"children": [
{
"value": 16,
"name": "Contents",
"path": "SystemProfiler/SPSerialATAReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPSPIReporter.spreporter",
"path": "SystemProfiler/SPSPIReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPSPIReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPStartupItemReporter.spreporter",
"path": "SystemProfiler/SPStartupItemReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPStartupItemReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPStorageReporter.spreporter",
"path": "SystemProfiler/SPStorageReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPStorageReporter.spreporter/Contents"
}
]
},
{
"value": 12,
"name": "SPSyncReporter.spreporter",
"path": "SystemProfiler/SPSyncReporter.spreporter",
"children": [
{
"value": 12,
"name": "Contents",
"path": "SystemProfiler/SPSyncReporter.spreporter/Contents"
}
]
},
{
"value": 28,
"name": "SPThunderboltReporter.spreporter",
"path": "SystemProfiler/SPThunderboltReporter.spreporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "SystemProfiler/SPThunderboltReporter.spreporter/Contents"
}
]
},
{
"value": 8,
"name": "SPUniversalAccessReporter.spreporter",
"path": "SystemProfiler/SPUniversalAccessReporter.spreporter",
"children": [
{
"value": 8,
"name": "Contents",
"path": "SystemProfiler/SPUniversalAccessReporter.spreporter/Contents"
}
]
},
{
"value": 40,
"name": "SPUSBReporter.spreporter",
"path": "SystemProfiler/SPUSBReporter.spreporter",
"children": [
{
"value": 40,
"name": "Contents",
"path": "SystemProfiler/SPUSBReporter.spreporter/Contents"
}
]
},
{
"value": 28,
"name": "SPWWANReporter.spreporter",
"path": "SystemProfiler/SPWWANReporter.spreporter",
"children": [
{
"value": 28,
"name": "Contents",
"path": "SystemProfiler/SPWWANReporter.spreporter/Contents"
}
]
}
]
},
{
"value": 9608,
"name": "Tcl",
"path": "Tcl",
"children": [
{
"value": 3568,
"name": "8.4",
"path": "Tcl/8.4",
"children": [
{
"value": 156,
"name": "expect5.45",
"path": "Tcl/8.4/expect5.45"
},
{
"value": 28,
"name": "Ffidl0.6.1",
"path": "Tcl/8.4/Ffidl0.6.1"
},
{
"value": 784,
"name": "Img1.4",
"path": "Tcl/8.4/Img1.4"
},
{
"value": 88,
"name": "itcl3.4",
"path": "Tcl/8.4/itcl3.4"
},
{
"value": 24,
"name": "itk3.4",
"path": "Tcl/8.4/itk3.4"
},
{
"value": 28,
"name": "Memchan2.2.1",
"path": "Tcl/8.4/Memchan2.2.1"
},
{
"value": 228,
"name": "Mk4tcl2.4.9.7",
"path": "Tcl/8.4/Mk4tcl2.4.9.7"
},
{
"value": 96,
"name": "QuickTimeTcl3.2",
"path": "Tcl/8.4/QuickTimeTcl3.2"
},
{
"value": 196,
"name": "snack2.2",
"path": "Tcl/8.4/snack2.2"
},
{
"value": 24,
"name": "tbcload1.7",
"path": "Tcl/8.4/tbcload1.7"
},
{
"value": 76,
"name": "tclAE2.0.5",
"path": "Tcl/8.4/tclAE2.0.5"
},
{
"value": 20,
"name": "Tclapplescript1.0",
"path": "Tcl/8.4/Tclapplescript1.0"
},
{
"value": 56,
"name": "Tcldom2.6",
"path": "Tcl/8.4/Tcldom2.6"
},
{
"value": 56,
"name": "tcldomxml2.6",
"path": "Tcl/8.4/tcldomxml2.6"
},
{
"value": 108,
"name": "Tclexpat2.6",
"path": "Tcl/8.4/Tclexpat2.6"
},
{
"value": 16,
"name": "Tclresource1.1.2",
"path": "Tcl/8.4/Tclresource1.1.2"
},
{
"value": 288,
"name": "tclx8.4",
"path": "Tcl/8.4/tclx8.4"
},
{
"value": 60,
"name": "Tclxml2.6",
"path": "Tcl/8.4/Tclxml2.6"
},
{
"value": 20,
"name": "Tclxslt2.6",
"path": "Tcl/8.4/Tclxslt2.6"
},
{
"value": 396,
"name": "tdom0.8.3",
"path": "Tcl/8.4/tdom0.8.3"
},
{
"value": 80,
"name": "thread2.6.6",
"path": "Tcl/8.4/thread2.6.6"
},
{
"value": 68,
"name": "Tktable2.10",
"path": "Tcl/8.4/Tktable2.10"
},
{
"value": 36,
"name": "tls1.6.1",
"path": "Tcl/8.4/tls1.6.1"
},
{
"value": 32,
"name": "tnc0.3.0",
"path": "Tcl/8.4/tnc0.3.0"
},
{
"value": 180,
"name": "treectrl2.2.10",
"path": "Tcl/8.4/treectrl2.2.10"
},
{
"value": 120,
"name": "Trf2.1.4",
"path": "Tcl/8.4/Trf2.1.4"
},
{
"value": 108,
"name": "vfs1.4.1",
"path": "Tcl/8.4/vfs1.4.1"
},
{
"value": 196,
"name": "xotcl1.6.6",
"path": "Tcl/8.4/xotcl1.6.6"
}
]
},
{
"value": 3384,
"name": "8.5",
"path": "Tcl/8.5",
"children": [
{
"value": 156,
"name": "expect5.45",
"path": "Tcl/8.5/expect5.45"
},
{
"value": 32,
"name": "Ffidl0.6.1",
"path": "Tcl/8.5/Ffidl0.6.1"
},
{
"value": 972,
"name": "Img1.4",
"path": "Tcl/8.5/Img1.4"
},
{
"value": 88,
"name": "itcl3.4",
"path": "Tcl/8.5/itcl3.4"
},
{
"value": 44,
"name": "itk3.4",
"path": "Tcl/8.5/itk3.4"
},
{
"value": 32,
"name": "Memchan2.2.1",
"path": "Tcl/8.5/Memchan2.2.1"
},
{
"value": 228,
"name": "Mk4tcl2.4.9.7",
"path": "Tcl/8.5/Mk4tcl2.4.9.7"
},
{
"value": 24,
"name": "tbcload1.7",
"path": "Tcl/8.5/tbcload1.7"
},
{
"value": 76,
"name": "tclAE2.0.5",
"path": "Tcl/8.5/tclAE2.0.5"
},
{
"value": 56,
"name": "Tcldom2.6",
"path": "Tcl/8.5/Tcldom2.6"
},
{
"value": 56,
"name": "tcldomxml2.6",
"path": "Tcl/8.5/tcldomxml2.6"
},
{
"value": 108,
"name": "Tclexpat2.6",
"path": "Tcl/8.5/Tclexpat2.6"
},
{
"value": 336,
"name": "tclx8.4",
"path": "Tcl/8.5/tclx8.4"
},
{
"value": 60,
"name": "Tclxml2.6",
"path": "Tcl/8.5/Tclxml2.6"
},
{
"value": 20,
"name": "Tclxslt2.6",
"path": "Tcl/8.5/Tclxslt2.6"
},
{
"value": 400,
"name": "tdom0.8.3",
"path": "Tcl/8.5/tdom0.8.3"
},
{
"value": 80,
"name": "thread2.6.6",
"path": "Tcl/8.5/thread2.6.6"
},
{
"value": 124,
"name": "Tktable2.10",
"path": "Tcl/8.5/Tktable2.10"
},
{
"value": 36,
"name": "tls1.6.1",
"path": "Tcl/8.5/tls1.6.1"
},
{
"value": 32,
"name": "tnc0.3.0",
"path": "Tcl/8.5/tnc0.3.0"
},
{
"value": 120,
"name": "Trf2.1.4",
"path": "Tcl/8.5/Trf2.1.4"
},
{
"value": 108,
"name": "vfs1.4.1",
"path": "Tcl/8.5/vfs1.4.1"
},
{
"value": 196,
"name": "xotcl1.6.6",
"path": "Tcl/8.5/xotcl1.6.6"
}
]
},
{
"value": 80,
"name": "bin",
"path": "Tcl/bin"
},
{
"value": 224,
"name": "bwidget1.9.1",
"path": "Tcl/bwidget1.9.1",
"children": [
{
"value": 100,
"name": "images",
"path": "Tcl/bwidget1.9.1/images"
},
{
"value": 0,
"name": "lang",
"path": "Tcl/bwidget1.9.1/lang"
}
]
},
{
"value": 324,
"name": "iwidgets4.0.2",
"path": "Tcl/iwidgets4.0.2",
"children": [
{
"value": 324,
"name": "scripts",
"path": "Tcl/iwidgets4.0.2/scripts"
}
]
},
{
"value": 40,
"name": "sqlite3",
"path": "Tcl/sqlite3"
},
{
"value": 1456,
"name": "tcllib1.12",
"path": "Tcl/tcllib1.12",
"children": [
{
"value": 8,
"name": "aes",
"path": "Tcl/tcllib1.12/aes"
},
{
"value": 16,
"name": "amazon-s3",
"path": "Tcl/tcllib1.12/amazon-s3"
},
{
"value": 12,
"name": "asn",
"path": "Tcl/tcllib1.12/asn"
},
{
"value": 0,
"name": "base32",
"path": "Tcl/tcllib1.12/base32"
},
{
"value": 0,
"name": "base64",
"path": "Tcl/tcllib1.12/base64"
},
{
"value": 8,
"name": "bee",
"path": "Tcl/tcllib1.12/bee"
},
{
"value": 16,
"name": "bench",
"path": "Tcl/tcllib1.12/bench"
},
{
"value": 8,
"name": "bibtex",
"path": "Tcl/tcllib1.12/bibtex"
},
{
"value": 12,
"name": "blowfish",
"path": "Tcl/tcllib1.12/blowfish"
},
{
"value": 0,
"name": "cache",
"path": "Tcl/tcllib1.12/cache"
},
{
"value": 8,
"name": "cmdline",
"path": "Tcl/tcllib1.12/cmdline"
},
{
"value": 16,
"name": "comm",
"path": "Tcl/tcllib1.12/comm"
},
{
"value": 0,
"name": "control",
"path": "Tcl/tcllib1.12/control"
},
{
"value": 0,
"name": "coroutine",
"path": "Tcl/tcllib1.12/coroutine"
},
{
"value": 12,
"name": "counter",
"path": "Tcl/tcllib1.12/counter"
},
{
"value": 8,
"name": "crc",
"path": "Tcl/tcllib1.12/crc"
},
{
"value": 8,
"name": "csv",
"path": "Tcl/tcllib1.12/csv"
},
{
"value": 24,
"name": "des",
"path": "Tcl/tcllib1.12/des"
},
{
"value": 36,
"name": "dns",
"path": "Tcl/tcllib1.12/dns"
},
{
"value": 0,
"name": "docstrip",
"path": "Tcl/tcllib1.12/docstrip"
},
{
"value": 44,
"name": "doctools",
"path": "Tcl/tcllib1.12/doctools"
},
{
"value": 8,
"name": "doctools2base",
"path": "Tcl/tcllib1.12/doctools2base"
},
{
"value": 12,
"name": "doctools2idx",
"path": "Tcl/tcllib1.12/doctools2idx"
},
{
"value": 12,
"name": "doctools2toc",
"path": "Tcl/tcllib1.12/doctools2toc"
},
{
"value": 36,
"name": "fileutil",
"path": "Tcl/tcllib1.12/fileutil"
},
{
"value": 16,
"name": "ftp",
"path": "Tcl/tcllib1.12/ftp"
},
{
"value": 16,
"name": "ftpd",
"path": "Tcl/tcllib1.12/ftpd"
},
{
"value": 84,
"name": "fumagic",
"path": "Tcl/tcllib1.12/fumagic"
},
{
"value": 0,
"name": "gpx",
"path": "Tcl/tcllib1.12/gpx"
},
{
"value": 20,
"name": "grammar_fa",
"path": "Tcl/tcllib1.12/grammar_fa"
},
{
"value": 8,
"name": "grammar_me",
"path": "Tcl/tcllib1.12/grammar_me"
},
{
"value": 8,
"name": "grammar_peg",
"path": "Tcl/tcllib1.12/grammar_peg"
},
{
"value": 12,
"name": "html",
"path": "Tcl/tcllib1.12/html"
},
{
"value": 12,
"name": "htmlparse",
"path": "Tcl/tcllib1.12/htmlparse"
},
{
"value": 8,
"name": "http",
"path": "Tcl/tcllib1.12/http"
},
{
"value": 0,
"name": "ident",
"path": "Tcl/tcllib1.12/ident"
},
{
"value": 12,
"name": "imap4",
"path": "Tcl/tcllib1.12/imap4"
},
{
"value": 0,
"name": "inifile",
"path": "Tcl/tcllib1.12/inifile"
},
{
"value": 0,
"name": "interp",
"path": "Tcl/tcllib1.12/interp"
},
{
"value": 0,
"name": "irc",
"path": "Tcl/tcllib1.12/irc"
},
{
"value": 0,
"name": "javascript",
"path": "Tcl/tcllib1.12/javascript"
},
{
"value": 12,
"name": "jpeg",
"path": "Tcl/tcllib1.12/jpeg"
},
{
"value": 0,
"name": "json",
"path": "Tcl/tcllib1.12/json"
},
{
"value": 28,
"name": "ldap",
"path": "Tcl/tcllib1.12/ldap"
},
{
"value": 20,
"name": "log",
"path": "Tcl/tcllib1.12/log"
},
{
"value": 0,
"name": "map",
"path": "Tcl/tcllib1.12/map"
},
{
"value": 12,
"name": "mapproj",
"path": "Tcl/tcllib1.12/mapproj"
},
{
"value": 140,
"name": "math",
"path": "Tcl/tcllib1.12/math"
},
{
"value": 8,
"name": "md4",
"path": "Tcl/tcllib1.12/md4"
},
{
"value": 16,
"name": "md5",
"path": "Tcl/tcllib1.12/md5"
},
{
"value": 0,
"name": "md5crypt",
"path": "Tcl/tcllib1.12/md5crypt"
},
{
"value": 36,
"name": "mime",
"path": "Tcl/tcllib1.12/mime"
},
{
"value": 0,
"name": "multiplexer",
"path": "Tcl/tcllib1.12/multiplexer"
},
{
"value": 0,
"name": "namespacex",
"path": "Tcl/tcllib1.12/namespacex"
},
{
"value": 12,
"name": "ncgi",
"path": "Tcl/tcllib1.12/ncgi"
},
{
"value": 0,
"name": "nmea",
"path": "Tcl/tcllib1.12/nmea"
},
{
"value": 8,
"name": "nns",
"path": "Tcl/tcllib1.12/nns"
},
{
"value": 8,
"name": "nntp",
"path": "Tcl/tcllib1.12/nntp"
},
{
"value": 0,
"name": "ntp",
"path": "Tcl/tcllib1.12/ntp"
},
{
"value": 8,
"name": "otp",
"path": "Tcl/tcllib1.12/otp"
},
{
"value": 48,
"name": "page",
"path": "Tcl/tcllib1.12/page"
},
{
"value": 0,
"name": "pluginmgr",
"path": "Tcl/tcllib1.12/pluginmgr"
},
{
"value": 0,
"name": "png",
"path": "Tcl/tcllib1.12/png"
},
{
"value": 8,
"name": "pop3",
"path": "Tcl/tcllib1.12/pop3"
},
{
"value": 8,
"name": "pop3d",
"path": "Tcl/tcllib1.12/pop3d"
},
{
"value": 8,
"name": "profiler",
"path": "Tcl/tcllib1.12/profiler"
},
{
"value": 72,
"name": "pt",
"path": "Tcl/tcllib1.12/pt"
},
{
"value": 0,
"name": "rc4",
"path": "Tcl/tcllib1.12/rc4"
},
{
"value": 0,
"name": "rcs",
"path": "Tcl/tcllib1.12/rcs"
},
{
"value": 12,
"name": "report",
"path": "Tcl/tcllib1.12/report"
},
{
"value": 8,
"name": "rest",
"path": "Tcl/tcllib1.12/rest"
},
{
"value": 16,
"name": "ripemd",
"path": "Tcl/tcllib1.12/ripemd"
},
{
"value": 8,
"name": "sasl",
"path": "Tcl/tcllib1.12/sasl"
},
{
"value": 24,
"name": "sha1",
"path": "Tcl/tcllib1.12/sha1"
},
{
"value": 0,
"name": "simulation",
"path": "Tcl/tcllib1.12/simulation"
},
{
"value": 8,
"name": "smtpd",
"path": "Tcl/tcllib1.12/smtpd"
},
{
"value": 84,
"name": "snit",
"path": "Tcl/tcllib1.12/snit"
},
{
"value": 0,
"name": "soundex",
"path": "Tcl/tcllib1.12/soundex"
},
{
"value": 12,
"name": "stooop",
"path": "Tcl/tcllib1.12/stooop"
},
{
"value": 48,
"name": "stringprep",
"path": "Tcl/tcllib1.12/stringprep"
},
{
"value": 156,
"name": "struct",
"path": "Tcl/tcllib1.12/struct"
},
{
"value": 0,
"name": "tar",
"path": "Tcl/tcllib1.12/tar"
},
{
"value": 24,
"name": "tepam",
"path": "Tcl/tcllib1.12/tepam"
},
{
"value": 0,
"name": "term",
"path": "Tcl/tcllib1.12/term"
},
{
"value": 52,
"name": "textutil",
"path": "Tcl/tcllib1.12/textutil"
},
{
"value": 0,
"name": "tie",
"path": "Tcl/tcllib1.12/tie"
},
{
"value": 8,
"name": "tiff",
"path": "Tcl/tcllib1.12/tiff"
},
{
"value": 0,
"name": "transfer",
"path": "Tcl/tcllib1.12/transfer"
},
{
"value": 0,
"name": "treeql",
"path": "Tcl/tcllib1.12/treeql"
},
{
"value": 0,
"name": "uev",
"path": "Tcl/tcllib1.12/uev"
},
{
"value": 8,
"name": "units",
"path": "Tcl/tcllib1.12/units"
},
{
"value": 8,
"name": "uri",
"path": "Tcl/tcllib1.12/uri"
},
{
"value": 0,
"name": "uuid",
"path": "Tcl/tcllib1.12/uuid"
},
{
"value": 0,
"name": "virtchannel_base",
"path": "Tcl/tcllib1.12/virtchannel_base"
},
{
"value": 0,
"name": "virtchannel_core",
"path": "Tcl/tcllib1.12/virtchannel_core"
},
{
"value": 0,
"name": "virtchannel_transform",
"path": "Tcl/tcllib1.12/virtchannel_transform"
},
{
"value": 16,
"name": "wip",
"path": "Tcl/tcllib1.12/wip"
},
{
"value": 12,
"name": "yaml",
"path": "Tcl/tcllib1.12/yaml"
}
]
},
{
"value": 60,
"name": "tclsoap1.6.8",
"path": "Tcl/tclsoap1.6.8",
"children": [
{
"value": 0,
"name": "interop",
"path": "Tcl/tclsoap1.6.8/interop"
}
]
},
{
"value": 56,
"name": "tkcon2.6",
"path": "Tcl/tkcon2.6"
},
{
"value": 412,
"name": "tklib0.5",
"path": "Tcl/tklib0.5",
"children": [
{
"value": 0,
"name": "autoscroll",
"path": "Tcl/tklib0.5/autoscroll"
},
{
"value": 8,
"name": "canvas",
"path": "Tcl/tklib0.5/canvas"
},
{
"value": 8,
"name": "chatwidget",
"path": "Tcl/tklib0.5/chatwidget"
},
{
"value": 28,
"name": "controlwidget",
"path": "Tcl/tklib0.5/controlwidget"
},
{
"value": 0,
"name": "crosshair",
"path": "Tcl/tklib0.5/crosshair"
},
{
"value": 8,
"name": "ctext",
"path": "Tcl/tklib0.5/ctext"
},
{
"value": 0,
"name": "cursor",
"path": "Tcl/tklib0.5/cursor"
},
{
"value": 0,
"name": "datefield",
"path": "Tcl/tklib0.5/datefield"
},
{
"value": 24,
"name": "diagrams",
"path": "Tcl/tklib0.5/diagrams"
},
{
"value": 0,
"name": "getstring",
"path": "Tcl/tklib0.5/getstring"
},
{
"value": 0,
"name": "history",
"path": "Tcl/tklib0.5/history"
},
{
"value": 24,
"name": "ico",
"path": "Tcl/tklib0.5/ico"
},
{
"value": 8,
"name": "ipentry",
"path": "Tcl/tklib0.5/ipentry"
},
{
"value": 16,
"name": "khim",
"path": "Tcl/tklib0.5/khim"
},
{
"value": 20,
"name": "menubar",
"path": "Tcl/tklib0.5/menubar"
},
{
"value": 16,
"name": "ntext",
"path": "Tcl/tklib0.5/ntext"
},
{
"value": 48,
"name": "plotchart",
"path": "Tcl/tklib0.5/plotchart"
},
{
"value": 8,
"name": "style",
"path": "Tcl/tklib0.5/style"
},
{
"value": 0,
"name": "swaplist",
"path": "Tcl/tklib0.5/swaplist"
},
{
"value": 148,
"name": "tablelist",
"path": "Tcl/tklib0.5/tablelist"
},
{
"value": 8,
"name": "tkpiechart",
"path": "Tcl/tklib0.5/tkpiechart"
},
{
"value": 8,
"name": "tooltip",
"path": "Tcl/tklib0.5/tooltip"
},
{
"value": 32,
"name": "widget",
"path": "Tcl/tklib0.5/widget"
}
]
}
]
},
{
"value": 80,
"name": "TextEncodings",
"path": "TextEncodings",
"children": [
{
"value": 0,
"name": "ArabicEncodings.bundle",
"path": "TextEncodings/ArabicEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/ArabicEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "CentralEuropean Encodings.bundle",
"path": "TextEncodings/CentralEuropean Encodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/CentralEuropean Encodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "ChineseEncodings Supplement.bundle",
"path": "TextEncodings/ChineseEncodings Supplement.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/ChineseEncodings Supplement.bundle/Contents"
}
]
},
{
"value": 28,
"name": "ChineseEncodings.bundle",
"path": "TextEncodings/ChineseEncodings.bundle",
"children": [
{
"value": 28,
"name": "Contents",
"path": "TextEncodings/ChineseEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "CoreEncodings.bundle",
"path": "TextEncodings/CoreEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/CoreEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "CyrillicEncodings.bundle",
"path": "TextEncodings/CyrillicEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/CyrillicEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "GreekEncodings.bundle",
"path": "TextEncodings/GreekEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/GreekEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "HebrewEncodings.bundle",
"path": "TextEncodings/HebrewEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/HebrewEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "IndicEncodings.bundle",
"path": "TextEncodings/IndicEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/IndicEncodings.bundle/Contents"
}
]
},
{
"value": 20,
"name": "JapaneseEncodings.bundle",
"path": "TextEncodings/JapaneseEncodings.bundle",
"children": [
{
"value": 20,
"name": "Contents",
"path": "TextEncodings/JapaneseEncodings.bundle/Contents"
}
]
},
{
"value": 16,
"name": "KoreanEncodings.bundle",
"path": "TextEncodings/KoreanEncodings.bundle",
"children": [
{
"value": 16,
"name": "Contents",
"path": "TextEncodings/KoreanEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "SymbolEncodings.bundle",
"path": "TextEncodings/SymbolEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/SymbolEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "ThaiEncodings.bundle",
"path": "TextEncodings/ThaiEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/ThaiEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "TurkishEncodings.bundle",
"path": "TextEncodings/TurkishEncodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/TurkishEncodings.bundle/Contents"
}
]
},
{
"value": 16,
"name": "UnicodeEncodings.bundle",
"path": "TextEncodings/UnicodeEncodings.bundle",
"children": [
{
"value": 16,
"name": "Contents",
"path": "TextEncodings/UnicodeEncodings.bundle/Contents"
}
]
},
{
"value": 0,
"name": "WesternLanguage Encodings.bundle",
"path": "TextEncodings/WesternLanguage Encodings.bundle",
"children": [
{
"value": 0,
"name": "Contents",
"path": "TextEncodings/WesternLanguage Encodings.bundle/Contents"
}
]
}
]
},
{
"value": 600,
"name": "UserEventPlugins",
"path": "UserEventPlugins",
"children": [
{
"value": 60,
"name": "ACRRDaemon.plugin",
"path": "UserEventPlugins/ACRRDaemon.plugin",
"children": [
{
"value": 60,
"name": "Contents",
"path": "UserEventPlugins/ACRRDaemon.plugin/Contents"
}
]
},
{
"value": 16,
"name": "AirPortUserAgent.plugin",
"path": "UserEventPlugins/AirPortUserAgent.plugin",
"children": [
{
"value": 16,
"name": "Contents",
"path": "UserEventPlugins/AirPortUserAgent.plugin/Contents"
}
]
},
{
"value": 0,
"name": "alfUIplugin.plugin",
"path": "UserEventPlugins/alfUIplugin.plugin",
"children": [
{
"value": 0,
"name": "Contents",
"path": "UserEventPlugins/alfUIplugin.plugin/Contents"
}
]
},
{
"value": 12,
"name": "AppleHIDMouseAgent.plugin",
"path": "UserEventPlugins/AppleHIDMouseAgent.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/AppleHIDMouseAgent.plugin/Contents"
}
]
},
{
"value": 12,
"name": "AssistantUEA.plugin",
"path": "UserEventPlugins/AssistantUEA.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/AssistantUEA.plugin/Contents"
}
]
},
{
"value": 16,
"name": "AutoTimeZone.plugin",
"path": "UserEventPlugins/AutoTimeZone.plugin",
"children": [
{
"value": 16,
"name": "Contents",
"path": "UserEventPlugins/AutoTimeZone.plugin/Contents"
}
]
},
{
"value": 20,
"name": "BluetoothUserAgent-Plugin.plugin",
"path": "UserEventPlugins/BluetoothUserAgent-Plugin.plugin",
"children": [
{
"value": 20,
"name": "Contents",
"path": "UserEventPlugins/BluetoothUserAgent-Plugin.plugin/Contents"
}
]
},
{
"value": 12,
"name": "BonjourEvents.plugin",
"path": "UserEventPlugins/BonjourEvents.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/BonjourEvents.plugin/Contents"
}
]
},
{
"value": 16,
"name": "BTMMPortInUseAgent.plugin",
"path": "UserEventPlugins/BTMMPortInUseAgent.plugin",
"children": [
{
"value": 16,
"name": "Contents",
"path": "UserEventPlugins/BTMMPortInUseAgent.plugin/Contents"
}
]
},
{
"value": 8,
"name": "CalendarMonitor.plugin",
"path": "UserEventPlugins/CalendarMonitor.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/CalendarMonitor.plugin/Contents"
}
]
},
{
"value": 88,
"name": "CaptiveSystemAgent.plugin",
"path": "UserEventPlugins/CaptiveSystemAgent.plugin",
"children": [
{
"value": 88,
"name": "Contents",
"path": "UserEventPlugins/CaptiveSystemAgent.plugin/Contents"
}
]
},
{
"value": 12,
"name": "CaptiveUserAgent.plugin",
"path": "UserEventPlugins/CaptiveUserAgent.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/CaptiveUserAgent.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.bonjour.plugin",
"path": "UserEventPlugins/com.apple.bonjour.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.bonjour.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.cfnotification.plugin",
"path": "UserEventPlugins/com.apple.cfnotification.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.cfnotification.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.diskarbitration.plugin",
"path": "UserEventPlugins/com.apple.diskarbitration.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.diskarbitration.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.dispatch.vfs.plugin",
"path": "UserEventPlugins/com.apple.dispatch.vfs.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.dispatch.vfs.plugin/Contents"
}
]
},
{
"value": 12,
"name": "com.apple.fsevents.matching.plugin",
"path": "UserEventPlugins/com.apple.fsevents.matching.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/com.apple.fsevents.matching.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.iokit.matching.plugin",
"path": "UserEventPlugins/com.apple.iokit.matching.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.iokit.matching.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.KeyStore.plugin",
"path": "UserEventPlugins/com.apple.KeyStore.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.KeyStore.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.launchd.helper.plugin",
"path": "UserEventPlugins/com.apple.launchd.helper.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.launchd.helper.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.locationd.events.plugin",
"path": "UserEventPlugins/com.apple.locationd.events.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.locationd.events.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.notifyd.matching.plugin",
"path": "UserEventPlugins/com.apple.notifyd.matching.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.notifyd.matching.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.opendirectory.matching.plugin",
"path": "UserEventPlugins/com.apple.opendirectory.matching.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.opendirectory.matching.plugin/Contents"
}
]
},
{
"value": 12,
"name": "com.apple.rcdevent.matching.plugin",
"path": "UserEventPlugins/com.apple.rcdevent.matching.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/com.apple.rcdevent.matching.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.reachability.plugin",
"path": "UserEventPlugins/com.apple.reachability.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.reachability.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.systemconfiguration.plugin",
"path": "UserEventPlugins/com.apple.systemconfiguration.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.systemconfiguration.plugin/Contents"
}
]
},
{
"value": 44,
"name": "com.apple.telemetry.plugin",
"path": "UserEventPlugins/com.apple.telemetry.plugin",
"children": [
{
"value": 44,
"name": "Contents",
"path": "UserEventPlugins/com.apple.telemetry.plugin/Contents"
}
]
},
{
"value": 24,
"name": "com.apple.time.plugin",
"path": "UserEventPlugins/com.apple.time.plugin",
"children": [
{
"value": 24,
"name": "Contents",
"path": "UserEventPlugins/com.apple.time.plugin/Contents"
}
]
},
{
"value": 12,
"name": "com.apple.TimeMachine.plugin",
"path": "UserEventPlugins/com.apple.TimeMachine.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/com.apple.TimeMachine.plugin/Contents"
}
]
},
{
"value": 20,
"name": "com.apple.TimeMachine.System.plugin",
"path": "UserEventPlugins/com.apple.TimeMachine.System.plugin",
"children": [
{
"value": 20,
"name": "Contents",
"path": "UserEventPlugins/com.apple.TimeMachine.System.plugin/Contents"
}
]
},
{
"value": 12,
"name": "com.apple.universalaccess.events.plugin",
"path": "UserEventPlugins/com.apple.universalaccess.events.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/com.apple.universalaccess.events.plugin/Contents"
}
]
},
{
"value": 8,
"name": "com.apple.usernotificationcenter.matching.plugin",
"path": "UserEventPlugins/com.apple.usernotificationcenter.matching.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/com.apple.usernotificationcenter.matching.plugin/Contents"
}
]
},
{
"value": 12,
"name": "com.apple.WorkstationService.plugin",
"path": "UserEventPlugins/com.apple.WorkstationService.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/com.apple.WorkstationService.plugin/Contents"
}
]
},
{
"value": 28,
"name": "EAPOLMonitor.plugin",
"path": "UserEventPlugins/EAPOLMonitor.plugin",
"children": [
{
"value": 28,
"name": "Contents",
"path": "UserEventPlugins/EAPOLMonitor.plugin/Contents"
}
]
},
{
"value": 8,
"name": "GSSNotificationForwarder.plugin",
"path": "UserEventPlugins/GSSNotificationForwarder.plugin",
"children": [
{
"value": 8,
"name": "Contents",
"path": "UserEventPlugins/GSSNotificationForwarder.plugin/Contents"
}
]
},
{
"value": 12,
"name": "LocationMenu.plugin",
"path": "UserEventPlugins/LocationMenu.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/LocationMenu.plugin/Contents"
}
]
},
{
"value": 12,
"name": "PrinterMonitor.plugin",
"path": "UserEventPlugins/PrinterMonitor.plugin",
"children": [
{
"value": 12,
"name": "Contents",
"path": "UserEventPlugins/PrinterMonitor.plugin/Contents"
}
]
},
{
"value": 16,
"name": "SCMonitor.plugin",
"path": "UserEventPlugins/SCMonitor.plugin",
"children": [
{
"value": 16,
"name": "Contents",
"path": "UserEventPlugins/SCMonitor.plugin/Contents"
}
]
}
]
},
{
"value": 536,
"name": "Video",
"path": "Video",
"children": [
{
"value": 536,
"name": "Plug-Ins",
"path": "Video/Plug-Ins",
"children": [
{
"value": 536,
"name": "AppleProResCodec.bundle",
"path": "Video/Plug-Ins/AppleProResCodec.bundle"
}
]
}
]
},
{
"value": 272,
"name": "WidgetResources",
"path": "WidgetResources",
"children": [
{
"value": 16,
"name": ".parsers",
"path": "WidgetResources/.parsers"
},
{
"value": 172,
"name": "AppleClasses",
"path": "WidgetResources/AppleClasses",
"children": [
{
"value": 156,
"name": "Images",
"path": "WidgetResources/AppleClasses/Images"
}
]
},
{
"value": 0,
"name": "AppleParser",
"path": "WidgetResources/AppleParser"
},
{
"value": 48,
"name": "button",
"path": "WidgetResources/button"
},
{
"value": 32,
"name": "ibutton",
"path": "WidgetResources/ibutton"
}
]
}
]
);<|fim▁end|> | "path": "Extensions/AppleTopCase.kext/Contents"
} |
<|file_name|>2d.line.cap.butt.worker.js<|end_file_name|><|fim▁begin|>// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.line.cap.butt
// Description:lineCap 'butt' is rendered correctly
// Note:
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
var t = async_test("lineCap 'butt' is rendered correctly");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.lineCap = 'butt';
ctx.lineWidth = 20;<|fim▁hole|>ctx.strokeStyle = '#0f0';
ctx.fillRect(15, 15, 20, 20);
ctx.beginPath();
ctx.moveTo(25, 15);
ctx.lineTo(25, 35);
ctx.stroke();
ctx.fillStyle = '#0f0';
ctx.strokeStyle = '#f00';
ctx.beginPath();
ctx.moveTo(75, 15);
ctx.lineTo(75, 35);
ctx.stroke();
ctx.fillRect(65, 15, 20, 20);
_assertPixel(canvas, 25,14, 0,255,0,255, "25,14", "0,255,0,255");
_assertPixel(canvas, 25,15, 0,255,0,255, "25,15", "0,255,0,255");
_assertPixel(canvas, 25,16, 0,255,0,255, "25,16", "0,255,0,255");
_assertPixel(canvas, 25,34, 0,255,0,255, "25,34", "0,255,0,255");
_assertPixel(canvas, 25,35, 0,255,0,255, "25,35", "0,255,0,255");
_assertPixel(canvas, 25,36, 0,255,0,255, "25,36", "0,255,0,255");
_assertPixel(canvas, 75,14, 0,255,0,255, "75,14", "0,255,0,255");
_assertPixel(canvas, 75,15, 0,255,0,255, "75,15", "0,255,0,255");
_assertPixel(canvas, 75,16, 0,255,0,255, "75,16", "0,255,0,255");
_assertPixel(canvas, 75,34, 0,255,0,255, "75,34", "0,255,0,255");
_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255");
_assertPixel(canvas, 75,36, 0,255,0,255, "75,36", "0,255,0,255");
t.done();
});
done();<|fim▁end|> | ctx.fillStyle = '#f00'; |
<|file_name|>L0MSBuildLocation.ts<|end_file_name|><|fim▁begin|>import ma = require('vsts-task-lib/mock-answer');
import tmrm = require('vsts-task-lib/mock-run');
import path = require('path');
import os = require('os');
let taskPath = path.join(__dirname, '..', 'xamarinios.js');
let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);
<|fim▁hole|>tr.setInput('args', '');
tr.setInput('clean', 'true');
tr.setInput('packageApp', ''); //boolean
tr.setInput('forSimulator', ''); //boolean
tr.setInput('runNugetRestore', 'true'); //boolean
tr.setInput('iosSigningIdentity', '');
tr.setInput('provProfileUuid', '');
tr.setInput('buildToolLocation', '/home/bin/msbuild');
// provide answers for task mock
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
"getVariable": {
"HOME": "/user/home"
},
"which": {
"nuget": "/home/bin/nuget"
},
"exec": {
"/home/bin/msbuild src/project.sln /p:Configuration=Release /p:Platform=iPhone /t:Clean": {
"code": 0,
"stdout": "msbuild"
},
"/home/bin/nuget restore src/project.sln": {
"code": 0,
"stdout": "nuget restore"
},
"/home/bin/msbuild src/project.sln /p:Configuration=Release /p:Platform=iPhone": {
"code": 0,
"stdout": "msbuild"
}
},
"checkPath" : {
"/user/build": true,
"/home/bin/msbuild": true,
"/home/bin/nuget": true,
"src/project.sln": true
},
"findMatch" : {
"src/project.sln": ["src/project.sln"]
}
};
tr.setAnswers(a);
os.platform = () => {
return 'darwin';
}
tr.registerMock('os', os);
tr.run();<|fim▁end|> | process.env['HOME']='/user/home'; //replace with mock of setVariable when task-lib has the support
tr.setInput('solution', 'src/project.sln'); //path
tr.setInput('configuration', 'Release'); |
<|file_name|>fix_cortex_topology.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import argparse
import sys
from soma import aims
<|fim▁hole|>import highres_cortex.cortex_topo
def fix_cortex_topology_files(input_filename, output_filename,
filling_size, fclosing):
"""Call highres_cortex.cortex_topo.fix_cortex_topology on files."""
input_volume = aims.read(input_filename)
output = highres_cortex.cortex_topo.fix_cortex_topology(
input_volume, filling_size, fclosing)
# BUG: aims.write offers no error checking, so the program will exit
# successfully even if writing fails
aims.write(output, output_filename)
def parse_command_line(argv=sys.argv):
"""Parse the script's command line."""
parser = argparse.ArgumentParser(
description="""\
Impose the topology of a hollow sphere onto the cortex in a voxelwise
segmentation, which uses the following labels: 100 in the cortex itself, 0
outside (CSF), 200 inside (white matter). In the output, the cortex is defined
using 6-connectivity, each other compartment using 26-connectivity.
""")
parser.add_argument("input",
help="3D volume containing the input segmentation")
parser.add_argument("output",
help="output 3D volume")
parser.add_argument("--filling-size", type=float, default=2.,
help="""\
The size, in millimetres, of the largest holes in either cortical boundary that
will be filled. This must be smaller than the thinnest cortex in the image. The
default value is 2 mm, which is appropriate for a human brain.""")
parser.add_argument("--fclosing", type=float, default=10.,
help="""\
The radius of the morphological closing which is used by VipHomotopic in
Cortical surface mode to retrieve the brain's outer envelope. The default
value, 10 mm, is appropriate for a human brain.""")
args = parser.parse_args(argv[1:])
if not args.filling_size >= 0:
parser.error("filling_size must be a non-negative number")
if not args.fclosing >= 0:
parser.error("fclosing must be a non-negative number")
return args
def main(argv=sys.argv):
"""The script's entry point."""
args = parse_command_line(argv)
return fix_cortex_topology_files(
args.input, args.output, args.filling_size, args.fclosing) or 0
if __name__ == "__main__":
sys.exit(main())<|fim▁end|> | |
<|file_name|>zfs.py<|end_file_name|><|fim▁begin|>"""ZFS based backup workflows."""
import datetime
import shlex
import gflags
<|fim▁hole|>import lvm
import workflow
FLAGS = gflags.FLAGS
gflags.DEFINE_string('rsync_options',
'--archive --acls --numeric-ids --delete --inplace',
'rsync command options')
gflags.DEFINE_string('rsync_path', '/usr/bin/rsync', 'path to rsync binary')
gflags.DEFINE_string('zfs_snapshot_prefix', 'ari-backup-',
'prefix for historical ZFS snapshots')
gflags.DEFINE_string('zfs_snapshot_timestamp_format', '%Y-%m-%d--%H%M',
'strftime() formatted timestamp used when naming new ZFS snapshots')
class ZFSLVMBackup(lvm.LVMSourceMixIn, workflow.BaseWorkflow):
"""Workflow for backing up a logical volume to a ZFS dataset.
Data is copied from and LVM snapshot to a ZFS dataset using rsync and then
ZFS commands are issued to create historical snapshots. The ZFS snapshot
lifecycle is also managed by this class. When a backup completes, snapshots
older than snapshot_expiration_days are destroyed.
This approach has some benefits over rdiff-backup in that all backup
datapoints are easily browseable and replication of the backup data using
ZFS streams is generally less resource intensive than using something like
rsync to mirror the files created by rdiff-backup.
One downside is that it's easier to store all file metadata using
rdiff-backup. Rsync can only store metadata for files that the destination
file system can also store. For example, if extended file system
attributes are used on the source file system, but aren't available on the
destination, rdiff-backup will still record those attributes in its own
files. If faced with that same scenario, rsync would lose those attributes.
Furthermore, rsync must have root privilege to write arbitrary file
metadata.
New post-job hooks are added for creating ZFS snapshots and trimming old
ones.
"""
def __init__(self, label, source_hostname, rsync_dst, zfs_hostname,
dataset_name, snapshot_expiration_days, **kwargs):
"""Configure a ZFSLVMBackup object.
Args:
label: str, label for the backup job (e.g. database-server1).
source_hostname: str, the name of the host with the source data to
backup.
rsync_dst: str, the destination argument for the rsync command line
(e.g. backupbox:/backup-store/database-server1).
zfs_hostname: str, the name of the backup destination host where we will
be managing the ZFS snapshots.
dataset_name: str, the full ZFS path (not file system path) to the
dataset holding the backups for this job
(e.g. tank/backup-store/database-server1).
snapshot_expiration_days: int, the maxmium age of a ZFS snapshot in days.
Pro tip: It's a good practice to reuse the label argument as the last
path component in the rsync_dst and dataset_name arguments.
"""
# Call our super class's constructor to enable LVM snapshot management
super(ZFSLVMBackup, self).__init__(label, **kwargs)
# Assign instance vars specific to this class.
self.source_hostname = source_hostname
self.rsync_dst = rsync_dst
self.zfs_hostname = zfs_hostname
self.dataset_name = dataset_name
# Assign flags to instance vars so they might be easily overridden in
# workflow configs.
self.rsync_options = FLAGS.rsync_options
self.rsync_path = FLAGS.rsync_path
self.zfs_snapshot_prefix = FLAGS.zfs_snapshot_prefix
self.zfs_snapshot_timestamp_format = FLAGS.zfs_snapshot_timestamp_format
self.add_post_hook(self._create_zfs_snapshot)
self.add_post_hook(self._destroy_expired_zfs_snapshots,
{'days': snapshot_expiration_days})
def _get_current_datetime(self):
"""Returns datetime object with the current date and time.
This method is mostly useful for testing purposes.
"""
return datetime.datetime.now()
def _run_custom_workflow(self):
"""Run rsync backup of LVM snapshot to ZFS dataset."""
# TODO(jpwoodbu) Consider throwing an exception if we see things in the
# include or exclude lists since we don't use them in this class.
self.logger.debug('ZFSLVMBackup._run_custom_workflow started.')
# Since we're dealing with ZFS datasets, let's always exclude the .zfs
# directory in our rsync options.
rsync_options = shlex.split(self.rsync_options) + ['--exclude', '/.zfs']
# We add a trailing slash to the src path otherwise rsync will make a
# subdirectory at the destination, even if the destination is already a
# directory.
rsync_src = self._snapshot_mount_point_base_path + '/'
command = [self.rsync_path] + rsync_options + [rsync_src, self.rsync_dst]
self.run_command(command, self.source_hostname)
self.logger.debug('ZFSLVMBackup._run_custom_workflow completed.')
def _create_zfs_snapshot(self, error_case):
"""Creates a new ZFS snapshot of our destination dataset.
The name of the snapshot will include the zfs_snapshot_prefix provided by
FLAGS and a timestamp. The zfs_snapshot_prefix is used by
_remove_zfs_snapshots_older_than() when deciding which snapshots to
destroy. The timestamp encoded in a snapshot name is only for end-user
convenience. The creation metadata on the ZFS snapshot is what is used to
determine a snapshot's age.
This method does nothing if error_case is True.
Args:
error_case: bool, whether an error has occurred during the backup.
"""
if not error_case:
self.logger.info('Creating ZFS snapshot...')
timestamp = self._get_current_datetime().strftime(
self.zfs_snapshot_timestamp_format)
snapshot_name = self.zfs_snapshot_prefix + timestamp
snapshot_path = '{dataset_name}@{snapshot_name}'.format(
dataset_name=self.dataset_name, snapshot_name=snapshot_name)
command = ['zfs', 'snapshot', snapshot_path]
self.run_command(command, self.zfs_hostname)
def _find_snapshots_older_than(self, days):
"""Returns snapshots older than the given number of days.
Only snapshots that meet the following criteria are returned:
1. They were created at least "days" ago.
2. Their name is prefixed with FLAGS.zfs_snapshot_prefix.
Args:
days: int, the minimum age of the snapshots in days.
Returns:
A list of filtered snapshots.
"""
expiration = self._get_current_datetime() - datetime.timedelta(days=days)
# Let's find all the snapshots for this dataset.
command = ['zfs', 'get', '-rH', '-o', 'name,value', 'type',
self.dataset_name]
stdout, unused_stderr = self.run_command(command, self.zfs_hostname)
snapshots = list()
# Sometimes we get extra lines which are empty, so we'll strip the lines.
for line in stdout.strip().splitlines():
name, dataset_type = line.split('\t')
if dataset_type == 'snapshot':
# Let's try to only consider destroying snapshots made by us ;)
if name.split('@')[1].startswith(self.zfs_snapshot_prefix):
snapshots.append(name)
expired_snapshots = list()
for snapshot in snapshots:
creation_time = self._get_snapshot_creation_time(snapshot)
if creation_time <= expiration:
expired_snapshots.append(snapshot)
return expired_snapshots
def _get_snapshot_creation_time(self, snapshot):
"""Gets the creation time of a snapshot as a Python datetime object
Args:
snapshot: str, the fule ZFS path to the snapshot.
Returns:
A datetime object representing the creation time of the snapshot.
"""
command = ['zfs', 'get', '-H', '-o', 'value', 'creation', snapshot]
stdout, unused_stderr = self.run_command(command, self.zfs_hostname)
return datetime.datetime.strptime(stdout.strip(), '%a %b %d %H:%M %Y')
def _destroy_expired_zfs_snapshots(self, days, error_case):
"""Destroy snapshots older than the given numnber of days.
Any snapshots in the target dataset with a name that starts with
FLAGS.zfs_snapshot_prefix and a creation date older than days will be
destroyed. Depending on the size of the snapshots and the performance of
the disk subsystem, this operation could take a while.
This method does nothing if error_case is True.
Args:
days: int, the max age of a snapshot in days.
error_case: bool, whether an error has occurred during the backup.
"""
if not error_case:
self.logger.info('Looking for expired ZFS snapshots...')
snapshots = self._find_snapshots_older_than(days)
# Sentinel value used to log if we destroyed no snapshots.
snapshots_destroyed = False
# Destroy expired snapshots.
for snapshot in snapshots:
command = ['zfs', 'destroy', snapshot]
self.run_command(command, self.zfs_hostname)
snapshots_destroyed = True
self.logger.info('{snapshot} destroyed.'.format(snapshot=snapshot))
if not snapshots_destroyed:
self.logger.info('Found no expired ZFS snapshots.')<|fim▁end|> | |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package storageimportexport
import "github.com/Azure/azure-sdk-for-go/version"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/" + Version() + " storageimportexport/2016-11-01"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {<|fim▁hole|> return version.Number
}<|fim▁end|> | |
<|file_name|>case_index.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Display, Formatter};
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct CaseIndex(usize);
impl CaseIndex {
pub fn next(self) -> CaseIndex {
CaseIndex(self.0 + 1)
}
pub fn start() -> CaseIndex {
CaseIndex(1)
}
}
impl Default for CaseIndex {
fn default() -> CaseIndex {
CaseIndex::start()<|fim▁hole|> }
}
impl Display for CaseIndex {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "Case #{}", self.0)
}
}
pub fn case_range(num_cases: usize) -> impl Iterator<Item = CaseIndex> {
(1..=num_cases).map(CaseIndex)
}
pub fn cases() -> impl Iterator<Item = CaseIndex> {
(1..).map(CaseIndex)
}<|fim▁end|> | |
<|file_name|>fixtures.py<|end_file_name|><|fim▁begin|>"""All pytest-django fixtures"""
from __future__ import with_statement
import os
import warnings
import pytest
from . import live_server_helper
from .db_reuse import (monkey_patch_creation_for_db_reuse,
monkey_patch_creation_for_db_suffix)
from .django_compat import is_django_unittest
from .lazy_django import get_django_version, skip_if_no_django
__all__ = ['_django_db_setup', 'db', 'transactional_db', 'admin_user',
'django_user_model', 'django_username_field',
'client', 'admin_client', 'rf', 'settings', 'live_server',
'_live_server_helper']
# ############### Internal Fixtures ################
@pytest.fixture(scope='session')
def _django_db_setup(request,
_django_test_environment,
_django_cursor_wrapper):
"""Session-wide database setup, internal to pytest-django"""
skip_if_no_django()
from .compat import setup_databases, teardown_databases
# xdist
if hasattr(request.config, 'slaveinput'):
db_suffix = request.config.slaveinput['slaveid']
else:
db_suffix = None
monkey_patch_creation_for_db_suffix(db_suffix)
_handle_south()
if request.config.getvalue('nomigrations'):
_disable_native_migrations()
db_args = {}
with _django_cursor_wrapper:
if (request.config.getvalue('reuse_db') and
not request.config.getvalue('create_db')):
if get_django_version() >= (1, 8):
db_args['keepdb'] = True
else:
monkey_patch_creation_for_db_reuse()
# Create the database
db_cfg = setup_databases(verbosity=pytest.config.option.verbose,
interactive=False, **db_args)
def teardown_database():
with _django_cursor_wrapper:
teardown_databases(db_cfg)
if not request.config.getvalue('reuse_db'):
request.addfinalizer(teardown_database)
def _django_db_fixture_helper(transactional, request, _django_cursor_wrapper):
if is_django_unittest(request):
return
if not transactional and 'live_server' in request.funcargnames:
# Do nothing, we get called with transactional=True, too.
return
django_case = None
_django_cursor_wrapper.enable()
request.addfinalizer(_django_cursor_wrapper.disable)
if transactional:
from django import get_version
if get_version() >= '1.5':
from django.test import TransactionTestCase as django_case
else:
# Django before 1.5 flushed the DB during setUp.
# Use pytest-django's old behavior with it.
def flushdb():
"""Flush the database and close database connections"""
# Django does this by default *before* each test
# instead of after.
from django.db import connections
from django.core.management import call_command
for db in connections:
call_command('flush', interactive=False, database=db,
verbosity=pytest.config.option.verbose)
for conn in connections.all():
conn.close()
request.addfinalizer(flushdb)
else:
from django.test import TestCase as django_case
if django_case:
case = django_case(methodName='__init__')
case._pre_setup()
request.addfinalizer(case._post_teardown)
def _handle_south():
from django.conf import settings
# NOTE: Django 1.7 does not have `management._commands` anymore, which
# is used by South's `patch_for_test_db_setup` and the code below.
if 'south' not in settings.INSTALLED_APPS or get_django_version() > (1, 7):
return
from django.core import management
try:
# if `south` >= 0.7.1 we can use the test helper
from south.management.commands import patch_for_test_db_setup
except ImportError:
# if `south` < 0.7.1 make sure its migrations are disabled
management.get_commands()
management._commands['syncdb'] = 'django.core'
else:
# Monkey-patch south.hacks.django_1_0.SkipFlushCommand to load
# initial data.
# Ref: http://south.aeracode.org/ticket/1395#comment:3
import south.hacks.django_1_0
from django.core.management.commands.flush import (
Command as FlushCommand)
class SkipFlushCommand(FlushCommand):
def handle_noargs(self, **options):
# Reinstall the initial_data fixture.
from django.core.management import call_command
# `load_initial_data` got introduces with Django 1.5.
load_initial_data = options.get('load_initial_data', None)
if load_initial_data or load_initial_data is None:
# Reinstall the initial_data fixture.
call_command('loaddata', 'initial_data', **options)
# no-op to avoid calling flush
return
south.hacks.django_1_0.SkipFlushCommand = SkipFlushCommand
patch_for_test_db_setup()
def _disable_native_migrations():
from django.conf import settings
from .migrations import DisableMigrations
settings.MIGRATION_MODULES = DisableMigrations()
# ############### User visible fixtures ################
<|fim▁hole|> This database will be setup with the default fixtures and will have
the transaction management disabled. At the end of the test the outer
transaction that wraps the test itself will be rolled back to undo any
changes to the database (in case the backend supports transactions).
This is more limited than the ``transactional_db`` resource but
faster.
If both this and ``transactional_db`` are requested then the
database setup will behave as only ``transactional_db`` was
requested.
"""
if 'transactional_db' in request.funcargnames \
or 'live_server' in request.funcargnames:
request.getfuncargvalue('transactional_db')
else:
_django_db_fixture_helper(False, request, _django_cursor_wrapper)
@pytest.fixture(scope='function')
def transactional_db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a django test database with transaction support
This will re-initialise the django database for each test and is
thus slower than the normal ``db`` fixture.
If you want to use the database with transactions you must request
this resource. If both this and ``db`` are requested then the
database setup will behave as only ``transactional_db`` was
requested.
"""
_django_db_fixture_helper(True, request, _django_cursor_wrapper)
@pytest.fixture()
def client():
"""A Django test client instance."""
skip_if_no_django()
from django.test.client import Client
return Client()
@pytest.fixture()
def django_user_model(db):
"""The class of Django's user model."""
try:
from django.contrib.auth import get_user_model
except ImportError:
assert get_django_version() < (1, 5)
from django.contrib.auth.models import User as UserModel
else:
UserModel = get_user_model()
return UserModel
@pytest.fixture()
def django_username_field(django_user_model):
"""The fieldname for the username used with Django's user model."""
try:
return django_user_model.USERNAME_FIELD
except AttributeError:
assert get_django_version() < (1, 5)
return 'username'
@pytest.fixture()
def admin_user(db, django_user_model, django_username_field):
"""A Django admin user.
This uses an existing user with username "admin", or creates a new one with
password "password".
"""
UserModel = django_user_model
username_field = django_username_field
try:
user = UserModel._default_manager.get(**{username_field: 'admin'})
except UserModel.DoesNotExist:
extra_fields = {}
if username_field != 'username':
extra_fields[username_field] = 'admin'
user = UserModel._default_manager.create_superuser(
'admin', '[email protected]', 'password', **extra_fields)
return user
@pytest.fixture()
def admin_client(db, admin_user):
"""A Django test client logged in as an admin user."""
from django.test.client import Client
client = Client()
client.login(username=admin_user.username, password='password')
return client
@pytest.fixture()
def rf():
"""RequestFactory instance"""
skip_if_no_django()
from django.test.client import RequestFactory
return RequestFactory()
class MonkeyPatchWrapper(object):
def __init__(self, monkeypatch, wrapped_object):
super(MonkeyPatchWrapper, self).__setattr__('monkeypatch', monkeypatch)
super(MonkeyPatchWrapper, self).__setattr__('wrapped_object',
wrapped_object)
def __getattr__(self, attr):
return getattr(self.wrapped_object, attr)
def __setattr__(self, attr, value):
self.monkeypatch.setattr(self.wrapped_object, attr, value,
raising=False)
def __delattr__(self, attr):
self.monkeypatch.delattr(self.wrapped_object, attr)
@pytest.fixture()
def settings(monkeypatch):
"""A Django settings object which restores changes after the testrun"""
skip_if_no_django()
from django.conf import settings as django_settings
return MonkeyPatchWrapper(monkeypatch, django_settings)
@pytest.fixture(scope='session')
def live_server(request):
"""Run a live Django server in the background during tests
The address the server is started from is taken from the
--liveserver command line option or if this is not provided from
the DJANGO_LIVE_TEST_SERVER_ADDRESS environment variable. If
neither is provided ``localhost:8081,8100-8200`` is used. See the
Django documentation for it's full syntax.
NOTE: If the live server needs database access to handle a request
your test will have to request database access. Furthermore
when the tests want to see data added by the live-server (or
the other way around) transactional database access will be
needed as data inside a transaction is not shared between
the live server and test code.
Static assets will be served for all versions of Django.
Except for django >= 1.7, if ``django.contrib.staticfiles`` is not
installed.
"""
skip_if_no_django()
addr = request.config.getvalue('liveserver')
if not addr:
addr = os.getenv('DJANGO_LIVE_TEST_SERVER_ADDRESS')
if not addr:
addr = os.getenv('DJANGO_TEST_LIVE_SERVER_ADDRESS')
if addr:
warnings.warn('Please use DJANGO_LIVE_TEST_SERVER_ADDRESS'
' instead of DJANGO_TEST_LIVE_SERVER_ADDRESS.',
DeprecationWarning)
if not addr:
addr = 'localhost:8081,8100-8200'
server = live_server_helper.LiveServer(addr)
request.addfinalizer(server.stop)
return server
@pytest.fixture(autouse=True, scope='function')
def _live_server_helper(request):
"""Helper to make live_server work, internal to pytest-django.
This helper will dynamically request the transactional_db fixture
for a test which uses the live_server fixture. This allows the
server and test to access the database without having to mark
this explicitly which is handy since it is usually required and
matches the Django behaviour.
The separate helper is required since live_server can not request
transactional_db directly since it is session scoped instead of
function-scoped.
"""
if 'live_server' in request.funcargnames:
request.getfuncargvalue('transactional_db')<|fim▁end|> | @pytest.fixture(scope='function')
def db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a django test database
|
<|file_name|>Classifier_MaxEnt.java<|end_file_name|><|fim▁begin|>package org.melodi.learning.service;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.melodi.tools.dataset.DataSet_Corpora;
import org.melodi.tools.evaluation.Evaluation_Service;
import opennlp.maxent.BasicEventStream;
import opennlp.maxent.GIS;
import opennlp.maxent.PlainTextByLineDataStream;
import opennlp.model.AbstractModel;
import opennlp.model.EventStream;
public class Classifier_MaxEnt {
AbstractModel model;
public static double SMOOTHING_OBSERVATION = 0.1;
public Classifier_MaxEnt() {
}
public AbstractModel train(FeatureGenerator_Service featureGen, int iteration, int cutoff, boolean USE_SMOOTHING, double value_smooth) throws IOException{
this.SMOOTHING_OBSERVATION = value_smooth;
return this.train(featureGen,iteration,cutoff,USE_SMOOTHING);
}
public AbstractModel train(FeatureGenerator_Service featureGen, int iteration, int cutoff) throws IOException{
return this.train(featureGen,iteration,cutoff,false);
}
public AbstractModel train(FeatureGenerator_Service featureGen, int iteration) throws IOException{
return this.train(featureGen,iteration,0,false);
}
public AbstractModel train(FeatureGenerator_Service featureGen) throws IOException{
return this.train(featureGen,100,0,false);
}
public AbstractModel train(FeatureGenerator_Service featureGen, int iteration, int cutoff, boolean USE_SMOOTHING) throws IOException {
// TODO : Utilisable mais améliorable sans passer par écriture/lecture!
// TODO : Ecrire un vrai wrapper.
featureGen.writeMaxEnt("dataset_train.txt");
FileReader datafr = new FileReader(new File("dataset_train.txt"));
EventStream es = new BasicEventStream(new PlainTextByLineDataStream(<|fim▁hole|> GIS.SMOOTHING_OBSERVATION = SMOOTHING_OBSERVATION;
model = GIS.trainModel(es, iteration, cutoff, USE_SMOOTHING, true );
// Data Structures
// datastructure[0] = model parameters
// datastructure[1] = java.util.Map (mapping model predicate to unique integers)
// datastructure[2] = java.lang.String[] names of outcomes
// datastructure[3] = java.lang.integer : value of models correction constante
// datastructure[4] = java.lang.Double : value of models correction paramter
return model;
}
public Evaluation_Service predict(AbstractModel model, DataSet_Corpora corpora, FeatureGenerator_Service featureGen) {
Evaluation_Service evaluator = new Evaluation_Service();
evaluator.setName("evaluator");
evaluator.setCorpora(corpora);
for(PairUnit_Features currPair : featureGen){
predict(model, currPair);
}
return evaluator;
}
public void predict(AbstractModel model, PairUnit_Features currPair){
String predicates = "";
for(String currString : currPair.getFeatures()){
predicates += currString + " ";
}
String[] contexts = predicates.split(" ");
double[] ocs = model.eval(contexts);
currPair.getUnit().setPredict_y(model.getBestOutcome(ocs));
// System.out.println("For context: " + predicates+ "\n" + model.getAllOutcomes(ocs) + "\n");
}
}<|fim▁end|> | datafr)); |
<|file_name|>httpRequester.js<|end_file_name|><|fim▁begin|>var httpRequester = (function() {
var makeHttpRequest = function(url, type, data) {
var deferred = $.Deferred();
$.ajax({
url: url,
type: type,
contentType: 'application/json',
data: data,
success: function(resultData) {
deferred.resolve(resultData);
},
error: function(error) {
deferred.reject(error);
}
});
return deferred;
};
var sendRequest = function(url, type, data) {
return makeHttpRequest(url, type, data);
};<|fim▁hole|> sendRequest: sendRequest
};
}());<|fim▁end|> |
return { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.