text:
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010 FUJIWARA, Yusuke
//
//    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.
//
#endregion -- License Terms --

using System;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace MsgPack.Rpc
{
	/// <summary>
	///		Utility to ensure valid identifier.
	/// </summary>
	internal static class RpcIdentifierUtility
	{
		// There is NO SPEC for RPC identifiers, so use UAX-31.
		// See http://www.unicode.org/reports/tr31/
		// Note that UAX-31 (and CLS) does not allow leading underscore('_') in the identifier.
		private const string _idStart = @"\p{L}\p{Nl}";
		private const string _idContinue = @"\p{L}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}";

		private static readonly Regex _validIdentififerPattern =
			new Regex(
				"^[" + _idStart + "]([" + _idContinue + "]*)$",
#if !SILVERLIGHT
 RegexOptions.Compiled |
#endif
 RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.Singleline
			);

		/// <summary>
		///		Verifies the specified identifier is compliant to MessagePack-RPC spec and returns normalized one.
		/// </summary>
		/// <param name="identifier">The target indentifier.</param>
		/// <param name="parameterName">The parameter name to be used in the error message.</param>
		/// <returns>
		///		Normalized identifier.
		/// </returns>
		public static string EnsureValidIdentifier( string identifier, string parameterName )
		{
			if ( String.IsNullOrEmpty( identifier ) )
			{
				return identifier;
			}

			string normalized =
#if !SILVERLIGHT
				identifier.Normalize( NormalizationForm.FormC );
#else
				identifier;
#endif
			if ( !_validIdentififerPattern.IsMatch( normalized ) )
			{
				throw new ArgumentException(
					String.Format(
						CultureInfo.CurrentCulture,
						"'{0}' is not valid identifier.",
						Escape( identifier )
					),
					parameterName
				);
			}

			return normalized;
		}

		private static string Escape( string identifier )
		{
			var buffer = new StringBuilder( identifier.Length );
			foreach ( var c in identifier )
			{
				switch ( CharUnicodeInfo.GetUnicodeCategory( c ) )
				{
					case UnicodeCategory.Control:
					case UnicodeCategory.OtherNotAssigned:
					case UnicodeCategory.PrivateUse:
					{
						buffer.AppendFormat( CultureInfo.InvariantCulture, "\\u{0:X}", ( ushort )c );
						break;
					}
					default:
					{
						buffer.Append( c );
						break;
					}
				}
			}

			return buffer.ToString();
		}
	}
}


text:
require 'json'
require 'hashery/open_cascade'
require 'fileutils'

module Rdb
  class Settings
    def initialize
      @settings = Hashery::OpenCascade.new
    end

    def include(obj)
      case obj
      when String
        include_file(obj)
      when Hash
        include_hash(obj)
      end
    end

    def save(file)
      dir = File.dirname(file)
      if !Dir.exist?(dir)
        FileUtils.mkdir_p(dir)
      end

      File.write(file, JSON.pretty_generate(@settings))
    end

    def method_missing(sym, *args, &block)
      @settings.send(sym, *args, &block)
    end

    private

    def include_file(file)
      return if !File.exist?(file)

      content = File.read(file)
      settings = JSON.parse(content, symbolize_names: true)
      include_hash(settings)
    end

    def include_hash(hash)
      merge!(@settings, hash)
    end

    def merge!(left, right)
      keys = (left.keys + right.keys).uniq
      keys.each do |key|
        lvalue, rvalue = left[key], right[key]
        if lvalue.nil?
          left[key] = rvalue
        elsif !rvalue.nil?
          if rvalue.is_a? Hash
            if lvalue.is_a? Hash
              merge!(lvalue, rvalue)
            else
              left[key] = rvalue
            end
          else
            left[key] = rvalue
          end
        end
      end

      left
    end
  end

  class AppSettings < Settings
    def initialize(overrides = {})
      super()
      self.include(DEFAULTS)
      self.include(FILE)
      self.include(ENV)
      self.include(overrides)
    end

    def save!
      save(FILE)
    end

    DEFAULTS = {
      web: {
        host: 'localhost',
        port: 4567
      }
    }

    ENV = {
      web: {
        host: ENV['RDB_HOST'],
        port: ENV['RDB_PORT']
      }
    }

    FILE = File.join(Dir.home, '.rdb', 'settings.json')
  end
end

redpajama_set_name: RedPajamaGithub


text:
describe('Admins Service', function () {

    var AdminsService;
    var $httpBackend;

    beforeEach(angular.mock.module('vorbs.services'));

    beforeEach(inject(function (_AdminsService_, _$httpBackend_) {
        $httpBackend = _$httpBackend_;
        AdminsService = _AdminsService_;
    }));

    afterEach(function () {
        $httpBackend.verifyNoOutstandingExpectation();
    });

    it('should be defined', function () {
        expect(AdminsService).toBeDefined();
    });

    describe('update method', function () {

        it('should exist', function () {
            expect(AdminsService.update).not.toEqual(null);
            expect(AdminsService.update).toBeDefined();
        })

        it('should update an admin\'s details', function () {

            var admin = adminMockData.getAdminUser();

            var newPermissionLevel = 1;

            admin.permissionLevel = newPermissionLevel;

            $httpBackend.expectPUT('/api/admin/' + admin.id)
                .respond(200);

            AdminsService.update({
                id: admin.id
            }, admin);

            expect($httpBackend.flush).not.toThrow();
        });
    });

});


text:
.class public final Lo/NW;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/io/FilenameFilter;

# annotations
.annotation build Lo/Ah;
.end annotation

# instance fields
.field private final ˊ:Ljava/util/regex/Pattern;

# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1

    .line 48
    invoke-static {p1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v0

    invoke-direct {p0, v0}, Lo/NW;-><init>(Ljava/util/regex/Pattern;)V

    .line 49
    return-void
.end method

.method public constructor <init>(Ljava/util/regex/Pattern;)V
    .locals 1

    .line 55
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 56
    invoke-static {p1}, Lo/Bk;->ˊ(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/regex/Pattern;

    iput-object v0, p0, Lo/NW;->ˊ:Ljava/util/regex/Pattern;

    .line 57
    return-void
.end method

# virtual methods
.method public accept(Ljava/io/File;Ljava/lang/String;)Z
    .locals 1
    .param p1    # Ljava/io/File;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param

    .line 60
    iget-object v0, p0, Lo/NW;->ˊ:Ljava/util/regex/Pattern;

    invoke-virtual {v0, p2}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z

    move-result v0

    return v0
.end method


text:
using System;

namespace MarcelJoachimKloubert.Extensions
{
    // IEEERemainder()
    static partial class MJKCoreExtensionMethods
    {
        #region Methods (2)

        /// <summary>
        /// Returns the remainder resulting from the division of a specified number by another specified number.
        /// </summary>
        /// <param name="value">The input value.</param>
        /// <param name="divisor">The divisor.</param>
        /// <returns>The output value.</returns>
        public static double IEEERemainder(this double value, double divisor)
        {
            return Math.IEEERemainder(value, divisor);
        }

        /// <summary>
        /// Returns the remainder resulting from the division of a specified number by another specified number.
        /// </summary>
        /// <param name="value">The input value.</param>
        /// <param name="divisor">The divisor.</param>
        /// <returns>The output value or <see langword="null" /> if <paramref name="value" />
        /// is <see langword="null" />.</returns>
        public static double? IEEERemainder(this double? value, double divisor)
        {
            return value.HasValue ? IEEERemainder(value.Value, divisor) : (double?)null;
        }

        #endregion Methods (2)
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    	http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
    	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

	<jpa:repositories base-package="org.ngrinder"  />

	<tx:annotation-driven proxy-target-class="true" />

	<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>

</beans>


text:
{-# LANGUAGE MagicHash #-}
module DissociatedPress.NGram (
    NGram (..),
    empty, insert, DissociatedPress.NGram.lookup, delete, (!), elems,
    fold, merge, weightKey, weightIn, numChildren, subNGram, childList
  ) where
import qualified Data.Map.Strict as M
import Data.Maybe
import Data.List (foldl')
import Data.Int

data NGram = NGram {
    weight   :: !Int,
    children :: !(M.Map Int NGram)
  } deriving Show

-- | An empty n-gram trie
empty :: NGram
empty = NGram {weight = 0, children = id $! M.empty}

-- | Returns the set of keys following the given key.
(!) :: NGram -> [Int] -> [(Int, Int)]
t ! k = fromJust $ DissociatedPress.NGram.lookup k t

-- | Standard fold over all n-grams in the trie.
fold :: (a -> [(Int, Int)] -> a) -> a -> NGram -> a
fold f acc ngram = foldl' f acc (elems ngram)

-- | Return the number of children this node has.
numChildren :: NGram -> Int
numChildren = M.size . children

-- | Return a list of all children belonging to this node.
childList :: NGram -> [(Int, Int)]
childList (NGram _ ch) =
  M.foldrWithKey (\k (NGram w _) xs ->
                    xs `seq` (k, fromIntegral w):xs) [] ch

-- | Return the n-gram trie pointed to by the given key.
subNGram :: [Int] -> NGram -> Maybe NGram
subNGram (x:xs) n =
  M.lookup x (children n) >>= subNGram xs
subNGram _ n =
  return n

-- | Merge two n-gram tries together.
merge :: NGram -> NGram -> NGram
merge a b = fold ins b a
  where
    ins t k = insert (map fst k) t

-- | Return a list of all n-grams in the trie.
elems :: NGram -> [[(Int, Int)]]
elems (NGram w t) = M.foldrWithKey extract [] t
  where
    extract k v acc =
      case elems v of
        [] -> [(k, fromIntegral w)]:acc
        ev ->  (map ((k, fromIntegral w):) ev) ++ acc

-- | Insert a new n-gram into the trie.
insert :: [Int] -> NGram -> NGram
insert (k:ks) t =
  t {weight = weight t + 1,
     children = let x = M.alter f k (children t) in x `seq` x}
    where
      f (Just t') = Just $! insert ks $! t'
      f _         = Just $! insert ks $! empty
insert _ t =
  t {weight = weight t + 1}

-- | Return all keys following the given key in the trie.
lookup :: [Int] -> NGram -> Maybe [(Int, Int)]
lookup (k:ks) t = do
  child <- M.lookup k (children t)
  DissociatedPress.NGram.lookup ks child
lookup [] (NGram _ t) =
  if null $ M.keys t
     then Nothing
     else Just $ map (\(k, NGram w _) -> (k, fromIntegral w))
               $ M.toList t

-- | Returns the probability weights for each section of the given key.
weightKey :: [Int] -> NGram -> Maybe [(Int, Int)]
weightKey (k:ks) (NGram w ch) = do
  child@(NGram w' ch') <- M.lookup k ch
  child' <- weightKey ks child
  return $ (k, fromIntegral w') : child'
weightKey [] (NGram _ t) =
  return []

-- | Get the weight of the given key in the given dictionary.
--   This weight is calculated so that the closer to the beginning of the key
--   a subkey appears, the less it affects the key's weight. The first word
--   is worth half as much as the second, which is worth half as much as the
--   third, etc.
weightIn :: [Int] -> NGram -> Int
weightIn k t =
  case weightKey k t of
    Just k' -> (`div` length k) $ fst
             $ foldr (\w (n, w') -> (w*w'+n, w'*2)) (0, startWeight)
             $ map snd k'
    _       -> 0
  where startWeight = 1

-- | Delete a key from the trie. Note that deleting a key will also remove all
--   children of that key. For example, delete "abc" $ insert "abcde" will
--   leave you with an empty trie.
delete :: [Int] -> NGram -> NGram
delete (k:ks@(_:_)) t =
  t {children = id $! M.alter f k (children t)}
    where
      f (Just t') = Just $! delete ks t'
      f _         = Nothing
delete [_] t =
  DissociatedPress.NGram.empty
delete [] t  =
  DissociatedPress.NGram.empty


text:
<?php
/**
 * Created by JiangJiaCai.
 * User: Administrator
 * Date: 2017/11/29 0029
 * Time: 17:26
 */

namespace com_jjcbs\test\resource;
//{use template}

class TestRequestApiAnnotation
{
    //{method template}

    /**
     * @@com_jjcbs\test\resource\annotation\RequestApi(name="dsfsds")
     * @return array
     */
    public function getList(){
        return [];
    }
}


text:
package org.apache.lens.cube.parse;

interface TrackDenormContext {

  /**
   * Get denormalization context
   *
   * @return DenormalizationContext
   */
  DenormalizationResolver.DenormalizationContext getDeNormCtx();

  /**
   * Set denormalization context
   *
   * @param deNormCtx DenormalizationContext
   */
  void setDeNormCtx(DenormalizationResolver.DenormalizationContext deNormCtx);

}


text:
module.exports = function()
{
	function EmitKeysHandler()
	{
		this.type = 'emitkeys';
	}

	// This is an extremely silly kind of job.
	EmitKeysHandler.prototype.work = function(payload, callback)
	{
		var keys = Object.keys(payload);
		for (var i = 0; i < keys.length; i++)
			console.log(keys[i]);
		callback('success');
	};

	var handler = new EmitKeysHandler();
	return handler;
};


text:
ceeblocks
=========

Specs for ceeBlocks - composable IoT hardware blocks

▲❤
We practice Ethical Design.

License: Apache 2.0
-------------------

**Copyright 2015 Rafael Teixeira**

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.


text:
using System;
using System.Collections.Generic;
using System.Threading;
using Jcq.Core.Contracts;

namespace Jcq.Core
{
    public class ServiceProvider<TS> : Service, IServiceProvider<TS> where TS : IService
    {
        private const int WaitTimeout = 20000;
        private readonly ReaderWriterLock _lock;
        private readonly Dictionary<Type, TS> _services;

        public ServiceProvider()
        {
            _lock = new ReaderWriterLock();
            _services = new Dictionary<Type, TS>();
        }

        public TC GetService<TC>()
            where TC : TS
        {
            TC serviceImplementation = default(TC);
            Type serviceContract = typeof(TC);

            try
            {
                _lock.AcquireReaderLock(WaitTimeout);

                if (!_services.ContainsKey(serviceContract))
                {
                    Type serviceImplementationType = Kernel.Mapper.GetImplementationType<TC>();

                    foreach (var pair in _services)
                    {
                        if (pair.GetType() == serviceImplementationType ||
                            pair.GetType().IsSubclassOf(serviceImplementationType) ||
                            serviceImplementationType.IsSubclassOf(pair.GetType()))
                        {
                            serviceImplementation = (TC) pair.Value;
                        }
                    }

                    if (serviceImplementation == null)
                        serviceImplementation = Kernel.Mapper.CreateImplementation<TC>();

                    if (serviceImplementation != null)
                    {
                        LockCookie cookie = _lock.UpgradeToWriterLock(WaitTimeout);

                        try
                        {
                            _services.Add(serviceContract, serviceImplementation);
                        }
                        finally
                        {
                            _lock.DowngradeFromWriterLock(ref cookie);
                        }
                    }
                }
                else
                {
                    serviceImplementation = (TC) _services[serviceContract];
                }
            }
            catch (Exception ex)
            {
                if (ex is ServiceNotFoundException)
                {
                    throw;
                }
                else
                {
                    throw new ServiceNotFoundException(serviceContract, ex);
                }
            }
            finally
            {
                _lock.ReleaseReaderLock();
            }

            return serviceImplementation;
        }
    }
}


text:
module Projects
  class AfterImportService
    RESERVED_REF_PREFIXES = Repository::RESERVED_REFS_NAMES.map { |n| File.join('refs', n, '/') }

    def initialize(project)
      @project = project
    end

    def execute
      service = Projects::HousekeepingService.new(@project)

      service.execute do
        repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
      end

      # Right now we don't actually have a way to know if a project
      # import actually changed, so we increment the counter to avoid
      # causing GC to run every time.
      service.increment!
    rescue Projects::HousekeepingService::LeaseTaken => e
      Rails.logger.info( # rubocop:disable Gitlab/RailsLogger
        "Could not perform housekeeping for project #{@project.full_path} (#{@project.id}): #{e}")
    end

    private

    def repository
      @repository ||= @project.repository
    end
  end
end


text:
typedef void (^CDUnknownBlockType)(void); // return type and parameters are unknown

#pragma mark Named Structures

struct CGPoint {
    double x;
    double y;
};

struct CGRect {
    struct CGPoint origin;
    struct CGSize size;
};

struct CGSize {
    double width;
    double height;
};

struct _PSDImageInfo {
    unsigned int width;
    unsigned int height;
    unsigned short mode;
    unsigned short bitsPerSample;
    unsigned short samplesPerPixel;
    int isDrawable;
};

struct _renditionkeyfmt {
    unsigned int _field1;
    unsigned int _field2;
    unsigned int _field3;
    unsigned int _field4[0];
};

struct _renditionkeytoken {
    unsigned short identifier;
    unsigned short value;
};

#pragma mark Typedef'd Structures

typedef struct {
    double top;
    double left;
    double bottom;
    double right;
} CDStruct_3c058996;

typedef struct {
    int _field1;
    int _field2;
} CDStruct_1ef3fb1f;

typedef struct {
    char *_field1;
    char *_field2;
    struct _renditionkeytoken _field3[5];
    long long _field4;
    long long _field5;
    struct {
        char *_field1;
        char *_field2;
        long long _field3;
        unsigned long long _field4;
    } _field6[12];
} CDStruct_26b2aa83;

typedef struct {
    struct CGSize _field1;
    struct CGSize _field2;
    struct CGSize _field3;
} CDStruct_1ba92a5e;

typedef struct {
    char *_field1;
    char *_field2;
    _Bool _field3;
    long long _field4;
    CDStruct_26b2aa83 _field5[7];
} CDStruct_e3362728;

#pragma mark -

//
// File: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CoreThemeDefinition.framework/CoreThemeDefinition
// UUID: 5D95731C-961B-3D18-81C6-4C481BFE5F20
//
//                           Arch: x86_64
//                Current version: 181.0.0
//          Compatibility version: 1.0.0
//                 Source version: 181.0.0.0.0
//            Minimum iOS version: 8.0.0
//                    SDK version: 8.0.0
//
// Objective-C Garbage Collection: Unsupported
//

@protocol TDElementAttributes
- (void)setAttributesFromData:(NSData *)arg1;
- (NSData *)dataFromAttributes;
@end

@interface CTDPSDPreviewRef : CUIPSDImageRef
{
    struct _PSDImageInfo _imageInfo;
    long long _layerCount;
    long long _sliceCount;
    long long _columnWidth;
    long long _rowHeight;
    NSArray *_layerIndexLayout;
    long long _sliceRowCount;
    long long _sliceColumnCount;
    NSArray *_sliceRects;
}

- (long long)indexOfDrawingLayerType:(long long)arg1;
- (long long)numberOfAlphaChannels;
- (long long)numberOfGradientLayers;
- (_Bool)hasGradient;
- (_Bool)hasRegularSliceGrid;
- (void)evaluateSliceGrid;
- (long long)sliceColumnCount;
- (long long)sliceRowCount;
- (void)dealloc;
- (id)initWithPath:(id)arg1;

@end

@interface CoreThemeAlignmentMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)performCustomValidationForEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;
- (_Bool)createRelationshipsForDestinationInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface CoreThemeAssetMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)performCustomValidationForEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;
- (_Bool)createRelationshipsForDestinationInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface CoreThemeConstantEnumerator : NSObject
{
    void *_globalListPointer;
    long long _listIndex;
    long long _indexOfLastEntry;
    _Bool _isPastLastEntry;
}

+ (id)enumeratorForGlobalListAtAddress:(void *)arg1;
- (id)lastConstantHelper;
- (id)firstConstantHelper;
- (id)previousConstantHelper;
- (id)nextConstantHelper;
- (id)currentConstantHelper;
- (long long)constantCount;
- (void)_moveToIndexOfLastEntry;
- (id)initWithGlobalListAtAddress:(void *)arg1;

@end

@interface CoreThemeConstantHelper : NSObject
{
    unsigned long long _identifier;
    NSString *_label;
    NSString *_displayName;
}

+ (id)helperForStructAtIndex:(long long)arg1 inAssociatedGlobalList:(void *)arg2;
- (id)description;
- (void)dealloc;
- (id)displayName;
- (id)label;
- (long long)identifier;

@end

@interface CoreThemeConstantMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface CoreThemeDefinitionMigrator : NSObject
{
    NSMigrationManager *_migrationManager;
    NSURL *_documentURL;
    long long _oldVersion;
    long long _newVersion;
    NSString *temporaryMigrationPath;
}

@property(copy) NSString *temporaryMigrationPath; // @synthesize temporaryMigrationPath;
- (_Bool)migrateWithError:(id *)arg1;
- (id)mappingModelForMigrationWithError:(id *)arg1;
- (void)dealloc;
- (id)initWithURL:(id)arg1 oldVersion:(long long)arg2 newVersion:(long long)arg3;
- (_Bool)_updateMetadata:(id *)arg1;
- (_Bool)_checkDiskSpace:(id *)arg1;

@end

@interface TDPersistentDocument : NSObject
{
    NSManagedObjectModel *_managedObjectModel;
    NSManagedObjectContext *_managedObjectContext;
    id _store;
    NSURL *_fileURL;
    NSString *_fileType;
    NSURL *_temporaryFileURL;
}

+ (id)_fileModificationDateForURL:(id)arg1;
@property(copy, nonatomic) NSURL *temporaryFileURL; // @synthesize temporaryFileURL=_temporaryFileURL;
@property(copy, nonatomic) NSString *fileType; // @synthesize fileType=_fileType;
@property(copy, nonatomic) NSURL *fileURL; // @synthesize fileURL=_fileURL;
- (id)persistentStoreTypeForFileType:(id)arg1;
- (_Bool)configurePersistentStoreCoordinatorForURL:(id)arg1 ofType:(id)arg2 modelConfiguration:(id)arg3 storeOptions:(id)arg4 error:(id *)arg5;
- (void)close;
- (id)_persistentStoreCoordinator;
- (id)managedObjectContext;
- (void)setManagedObjectContext:(id)arg1;
- (id)managedObjectModel;
- (void)saveDocument:(id)arg1;
- (_Bool)readFromURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
- (void)dealloc;
- (id)initWithType:(id)arg1 error:(id *)arg2;
- (id)initWithContentsOfURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
- (id)undoManager;
- (id)displayName;

@end

@interface CoreThemeDocument : TDPersistentDocument
{
    NSMutableDictionary *constantArrayControllers;
    NSMutableDictionary *cachedConstantArrays;
    long long cachedMaxIdentifierInUse;
    TDHistorian *m_historian;
    TDThreadMOCOrganizer *m_mocOrganizer;
    NSManagedObjectModel *m_managedObjectModel;
    NSString *pathToRepresentedDocument;
    NSString *_relativePathToProductionData;
    NSString *_targetPlatform;
    _Bool m_didMigrate;
    int _updateVersionMetadataState;
    long long _capabilities;
    id <TDAssetManagementDelegate> _assetManagementDelegate;
    id <TDCustomAssetProvider> _customAssetProvider;
}

+ (id)defaultThemeBitSourceURLForDocumentURL:(id)arg1;
+ (void)doneWithColorConversion;
+ (int)shouldConvertColorsFromColorSpaceWithIdentifier:(unsigned long long)arg1 toIdentifier:(unsigned long long)arg2 error:(id *)arg3;
+ (unsigned long long)standardColorSpaceID;
+ (void)closeMigrationProgress;
+ (void)presentMigrationProgress;
+ (id)dataModelNameForVersion:(long long)arg1;
+ (long long)dataModelVersion;
+ (long long)targetPlatformForMOC:(id)arg1;
+ (long long)defaultTargetPlatform;
+ (long long)platformForPersistentString:(id)arg1;
+ (id)persistentStringForPlatform:(long long)arg1;
+ (id)_imageAssetURLsByCopyingFileURLs:(id)arg1 toManagedLocationAtURL:(id)arg2 error:(id *)arg3;
+ (id)migrateDocumentAtURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
+ (long long)dataModelVersionFromMetadata:(id)arg1;
+ (id)createConfiguredDocumentAtURL:(id)arg1 error:(id *)arg2;
+ (void)_addThemeDocument:(id)arg1;
+ (id)_sharedDocumentList;
+ (void)initialize;
@property(nonatomic) id <TDCustomAssetProvider> customAssetProvider; // @synthesize customAssetProvider=_customAssetProvider;
@property(nonatomic) id <TDAssetManagementDelegate> assetManagementDelegate; // @synthesize assetManagementDelegate=_assetManagementDelegate;
@property(copy) NSString *pathToRepresentedDocument; // @synthesize pathToRepresentedDocument;
@property(nonatomic) long long documentCapabilities; // @synthesize documentCapabilities=_capabilities;
- (void)_delete:(id)arg1 withRendition:(id)arg2;
- (void)_removeRedundantPDFBasedRenditionsForAssets:(id)arg1;
- (void)addThemeBitSourceAtPath:(id)arg1;
- (void)addThemeBitSourceAtPath:(id)arg1 createProductions:(_Bool)arg2;
@property(readonly, nonatomic) NSURL *themeBitSourceURL;
- (void)_configureAfterFirstSave;
- (void)_synchronousSave;
- (_Bool)readFromURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
- (_Bool)checkCompatibilityOfDocumentAtURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
- (_Bool)configurePersistentStoreCoordinatorForURL:(id)arg1 ofType:(id)arg2 modelConfiguration:(id)arg3 storeOptions:(id)arg4 error:(id *)arg5;
- (id)updatedVersionsMetadataFromMetadata:(id)arg1;
- (id)persistentStoreTypeForFileType:(id)arg1;
- (void)importCursorsFromURL:(id)arg1 getUnusedImportedCursors:(id *)arg2 getUnupdatedCursors:(id *)arg3;
- (void)exportCursorsToURL:(id)arg1;
- (void)importColorsFromURL:(id)arg1 valuesOnly:(_Bool)arg2 getUnusedColorNames:(id *)arg3;
- (void)exportColorsToURL:(id)arg1;
- (id)namedEffectProductions;
- (id)namedArtworkProductions;
- (id)schemaPartDefinitionWithElementID:(long long)arg1 partID:(long long)arg2;
- (id)schemaDefinitionWithElementID:(long long)arg1;
- (_Bool)customizeSchemaPartDefinition:(id)arg1 usingArtworkFormat:(id)arg2 nameElement:(id)arg3 shouldReplaceExisting:(_Bool)arg4 error:(id *)arg5;
- (_Bool)customizeSchemaEffectDefinition:(id)arg1 shouldReplaceExisting:(_Bool)arg2 error:(id *)arg3;
- (_Bool)customizeSchemaElementDefinition:(id)arg1 usingArtworkFormat:(id)arg2 shouldReplaceExisting:(_Bool)arg3 error:(id *)arg4;
- (void)removeCustomizationForSchemaDefinition:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (_Bool)customizationExistsForSchemaDefinition:(id)arg1;
- (id)_customizedSchemaDefinitionsForEntity:(id)arg1;
- (id)customizedSchemaEffectDefinitions;
- (id)customizedSchemaElementDefinitions;
- (_Bool)usesCUISystemThemeRenditionKey;
- (long long)renditionKeySpecAttributeCount;
- (int)renditionKeySemantics;
- (const struct _renditionkeyfmt *)renditionKeyFormat;
- (void)convertColorsFromColorSpaceWithIdentifier:(unsigned long long)arg1 toIdentifier:(unsigned long long)arg2;
- (unsigned long long)colorSpaceID;
- (_Bool)didMigrate;
- (void)primeArrayControllers;
- (void)resetThemeConstants;
- (void)buildModel;
- (long long)targetPlatform;
- (void)setTargetPlatform:(long long)arg1;
- (void)setArtworkFormat:(id)arg1;
- (id)artworkFormat;
- (unsigned int)checksum;
- (void)setUuid:(id)arg1;
- (id)uuid;
- (unsigned long long)countOfRenditionsMatchingRenditionKeySpecs:(id)arg1;
- (unsigned long long)countOfRenditionsMatchingRenditionKeySpec:(id)arg1;
- (id)renditionsMatchingRenditionKeySpec:(id)arg1;
- (_Bool)isCustomLook;
- (void)setRelativePathToProductionData:(id)arg1;
- (id)relativePathToProductionData;
- (id)rootPathForProductionData;
- (id)pathToAsset:(id)arg1;
- (void)setMetadatum:(id)arg1 forKey:(id)arg2;
- (id)metadatumForKey:(id)arg1;
- (id)_addAssetsAtFileURLs:(id)arg1 createProductions:(_Bool)arg2 referenceFiles:(_Bool)arg3 bitSource:(id)arg4 customInfos:(id)arg5 sortedCustomInfos:(id *)arg6;
- (id)addAssetsAtFileURLs:(id)arg1 createProductions:(_Bool)arg2 referenceFiles:(_Bool)arg3 bitSource:(id)arg4 customInfos:(id)arg5;
- (id)addAssetsAtFileURLs:(id)arg1 createProductions:(_Bool)arg2;
- (id)addAssetsAtFileURLs:(id)arg1;
- (id)assetAtFileURL:(id)arg1;
- (id)assetAtPath:(id)arg1;
- (id)createAssetWithName:(id)arg1 fileType:(id)arg2 scaleFactor:(unsigned int)arg3 inCategory:(id)arg4 forThemeBitSource:(id)arg5;
- (id)createAssetWithName:(id)arg1 scaleFactor:(unsigned int)arg2 inCategory:(id)arg3 forThemeBitSource:(id)arg4;
- (id)createAssetWithName:(id)arg1 inCategory:(id)arg2 forThemeBitSource:(id)arg3;
- (id)createElementProductionWithAsset:(id)arg1;
- (id)_genericPartDefinition;
- (void)importCustomAssetsWithImportInfos:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (_Bool)createCustomArtworkProductionsForCustomAssets:(id)arg1 withImportInfos:(id)arg2 error:(id *)arg3;
- (id)_addAssetsFromCustomAssetInfos:(id)arg1 bitSource:(id)arg2 error:(id *)arg3;
- (void)deleteNamedAssets:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)importNamedAssetsWithImportInfos:(id)arg1 referenceFiles:(_Bool)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)importNamedAssetsWithImportInfos:(id)arg1 completionHandler:(CDUnknownBlockType)arg2;
- (void)importNamedAssetsFromFileURLs:(id)arg1 referenceFiles:(_Bool)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (id)createNamedArtworkProductionsForAssets:(id)arg1 customInfos:(id)arg2 error:(id *)arg3;
- (id)slicesComputedForImageSize:(struct CGSize)arg1 usingSliceInsets:(CDStruct_3c058996)arg2 resizableSliceSize:(struct CGSize)arg3 withRenditionType:(long long)arg4;
- (id)namedArtworkProductionWithName:(id)arg1;
- (id)elementProductionsWithName:(id)arg1;
- (id)namedElementsForElementDefinition:(id)arg1;
- (id)namedElementWithName:(id)arg1;
- (id)_createNamedElementWithIdentifier:(long long)arg1;
- (id)_createNamedElementWithNextAvailableIdentifier;
- (id)_namedImagePartDefinition;
- (id)_createPhotoshopElementProductionWithAsset:(id)arg1;
- (id)createNamedEffectProductionWithName:(id)arg1 isText:(_Bool)arg2;
- (id)_namedImageEffectPartDefinition;
- (id)_namedTextEffectPartDefinition;
- (id)namedEffectProductionWithName:(id)arg1;
- (id)createEffectStyleProductionForPartDefinition:(id)arg1 withNameIdentifier:(id)arg2;
- (id)createEffectStyleProductionForPartDefinition:(id)arg1;
- (void)_normalizeRenditionKeySpec:(id)arg1 forSchemaRendition:(id)arg2;
- (id)createProductionWithRenditionGroup:(id)arg1 forPartDefinition:(id)arg2 artworkFormat:(id)arg3 nameElement:(id)arg4 shouldReplaceExisting:(_Bool)arg5 error:(id *)arg6;
- (id)createProductionWithRenditionGroup:(id)arg1 forPartDefinition:(id)arg2 artworkFormat:(id)arg3 shouldReplaceExisting:(_Bool)arg4 error:(id *)arg5;
- (_Bool)allowMultipleInstancesOfElementID:(long long)arg1;
- (_Bool)createPSDReferenceArtworkForRenditionGroup:(id)arg1 atDestination:(id)arg2 error:(id *)arg3;
- (id)_themeBitSourceForReferencedFilesAtURLs:(id)arg1 createIfNecessary:(_Bool)arg2;
- (id)_themeBitSource:(id *)arg1;
- (id)createReferencePNGForSchemaRendition:(id)arg1 withPartDefinition:(id)arg2 atLocation:(id)arg3 error:(id *)arg4;
- (id)defaultPathComponentsForPartDefinition:(id)arg1;
- (id)defaultBaseFileNameForSchemaRendition:(id)arg1 withPartDefinition:(id)arg2;
- (id)defaultPNGFileNameForSchemaRendition:(id)arg1 withPartDefinition:(id)arg2;
- (id)folderNameFromRenditionKey:(id)arg1 forPartDefinition:(id)arg2;
- (id)minimalDisplayNameForThemeConstant:(id)arg1;
- (void)deleteProductions:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (void)deleteProduction:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (void)deleteObject:(id)arg1;
- (void)deleteObjects:(id)arg1;
- (id)newObjectForEntity:(id)arg1;
- (unsigned long long)countForEntity:(id)arg1 withPredicate:(id)arg2;
- (id)objectsForEntity:(id)arg1 withPredicate:(id)arg2 sortDescriptors:(id)arg3 error:(id *)arg4;
- (id)objectsForEntity:(id)arg1 withPredicate:(id)arg2 sortDescriptors:(id)arg3;
- (id)allObjectsForEntity:(id)arg1 withSortDescriptors:(id)arg2 error:(id *)arg3;
- (id)allObjectsForEntity:(id)arg1 withSortDescriptors:(id)arg2;
- (id)mappingForPhotoshopLayerIndex:(long long)arg1 themeDrawingLayerIdentifier:(long long)arg2;
- (id)artworkDraftTypeWithIdentifier:(long long)arg1;
- (id)zeroCodeArtworkInfoWithIdentifier:(long long)arg1;
- (id)psdImageRefForAsset:(id)arg1;
- (id)constantWithName:(id)arg1 forIdentifier:(long long)arg2;
- (id)iterationTypeWithIdentifier:(int)arg1;
- (id)renditionSubtypeWithIdentifier:(unsigned int)arg1;
- (id)renditionTypeWithIdentifier:(long long)arg1;
- (id)effectComponentWithType:(unsigned int)arg1 inRendition:(id)arg2 createIfNeeded:(_Bool)arg3;
- (id)effectParameterValueWithType:(unsigned int)arg1 inComponent:(id)arg2 createIfNeeded:(_Bool)arg3;
- (id)effectParameterTypeWithIdentifier:(unsigned int)arg1;
- (id)effectTypeWithIdentifier:(unsigned int)arg1;
- (id)schemaCategoryWithIdentifier:(long long)arg1;
- (id)lookWithIdentifier:(long long)arg1;
- (id)templateRenderingModeWithIdentifier:(long long)arg1;
- (id)sizeClassWithIdentifier:(long long)arg1;
- (id)idiomWithIdentifier:(long long)arg1;
- (id)drawingLayerWithIdentifier:(long long)arg1;
- (id)previousValueWithIdentifier:(long long)arg1;
- (id)valueWithIdentifier:(long long)arg1;
- (id)presentationStateWithIdentifier:(long long)arg1;
- (id)previousStateWithIdentifier:(long long)arg1;
- (id)stateWithIdentifier:(long long)arg1;
- (id)directionWithIdentifier:(long long)arg1;
- (id)sizeWithIdentifier:(long long)arg1;
- (id)partWithIdentifier:(long long)arg1;
- (id)elementWithIdentifier:(long long)arg1;
- (id)themeConstant:(id)arg1 withIdentifier:(long long)arg2;
- (id)_cachedConstantsForEntity:(id)arg1;
- (void)recacheThemeConstant:(id)arg1;
- (id)historian;
- (id)mocOrganizer;
- (id)managedObjectModel;
- (id)updateToEmbeddedSchemaVersion2AndReturnAlertString:(id *)arg1;
- (void)checkVersionsAndUpdateIfNecessary;
- (void)dealloc;
- (id)initWithContentsOfURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3;
- (id)initWithType:(id)arg1 error:(id *)arg2;
- (id)initWithType:(id)arg1 targetPlatform:(long long)arg2 error:(id *)arg3;
- (id)init;
- (void)_getFilename:(id *)arg1 scaleFactor:(unsigned int *)arg2 category:(id *)arg3 bitSource:(id *)arg4 forFileURL:(id)arg5;
- (id)_predicateForRenditionKeySpec:(id)arg1;
- (void)changedObjectsNotification:(id)arg1;
- (void)updateRenditionSpec:(id)arg1;

@end

@interface CoreThemeRenditionKeyMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)performCustomValidationForEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;
- (_Bool)createRelationshipsForDestinationInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface CoreThemeSliceMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)performCustomValidationForEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;
- (_Bool)createRelationshipsForDestinationInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface CoreThemeTemplateMigrationPolicy : NSEntityMigrationPolicy
{
}

- (_Bool)performCustomValidationForEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;
- (_Bool)createRelationshipsForDestinationInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)createDestinationInstancesForSourceInstance:(id)arg1 entityMapping:(id)arg2 manager:(id)arg3 error:(id *)arg4;
- (_Bool)beginEntityMapping:(id)arg1 manager:(id)arg2 error:(id *)arg3;

@end

@interface NSManagedObject (TrackingAPI)
+ (_Bool)isTracked;
@end

@interface TDAsset : NSManagedObject
{
    unsigned int _scaleFactor;
}

+ (long long)subtypeFromImageFilename:(id)arg1;
+ (long long)idiomFromImageFilename:(id)arg1;
+ (_Bool)isTemplateFromImageFilename:(id)arg1;
+ (unsigned int)scaleFactorFromImageFilename:(id)arg1;
+ (id)_filenameRegex;
@property(readonly, nonatomic) NSString *baseName;
- (void)setHasProduction:(id)arg1;
- (_Bool)hasProduction;
- (id)fileURLWithDocument:(id)arg1;
- (id)sourceRelativePath;
- (id)_sourceRelativePathComponents;
- (unsigned int)scaleFactor;
- (void)setScaleFactor:(unsigned int)arg1;

// Remaining properties
@property(retain, nonatomic) NSString *category; // @dynamic category;
@property(retain, nonatomic) NSString *name; // @dynamic name;
@property(retain, nonatomic) TDThemeBitSource *source; // @dynamic source;
@property(retain, nonatomic) TDTemplateRenderingMode *templateRenderingMode; // @dynamic templateRenderingMode;

@end

@interface TDColorDefinition : NSManagedObject <TDElementAttributes>
{
}

- (id)colorAsString;
- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (void)setAttributesFromData:(id)arg1;
- (id)dataFromAttributes;
- (void)copyAttributesInto:(id)arg1;

// Remaining properties
@property(retain, nonatomic) NSManagedObject *colorStatus; // @dynamic colorStatus;
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) TDThemeLook *look; // @dynamic look;
@property(retain, nonatomic) TDColorName *name; // @dynamic name;
@property(retain, nonatomic) NSNumber *physicalColor; // @dynamic physicalColor;

@end

@interface TDColorName : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) NSSet *colorDefinitions; // @dynamic colorDefinitions;
@property(retain, nonatomic) NSString *colorDescription; // @dynamic colorDescription;
@property(retain, nonatomic) NSString *displayName; // @dynamic displayName;
@property(retain, nonatomic) NSString *illustrationURL; // @dynamic illustrationURL;
@property(retain, nonatomic) NSNumber *isExcludedFromFilter; // @dynamic isExcludedFromFilter;
@property(retain, nonatomic) NSString *selector; // @dynamic selector;
@end

@interface TDFacetDefinition : NSManagedObject
{
}

- (id)keySpec;
- (void)copyAttributesInto:(id)arg1;
- (void)setDateOfLastChange:(id)arg1;
- (id)dateOfLastChange;

@end

@interface TDCursorFacetDefinition : TDFacetDefinition
{
}

- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (void)copyAttributesInto:(id)arg1;

@end

@interface TDElementProduction : NSManagedObject
{
}

- (void)deleteRenditionsInDocument:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (id)associatedFileModificationDateWithDocument:(id)arg1;
- (id)associatedFileURLWithDocument:(id)arg1;
- (id)relativePath;

// Remaining properties
@property(retain, nonatomic) TDThemeConstant *artworkDraftType; // @dynamic artworkDraftType;
@property(retain, nonatomic) TDRenditionKeySpec *baseKeySpec; // @dynamic baseKeySpec;
@property(retain, nonatomic) NSString *comment; // @dynamic comment;
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) NSNumber *isExcludedFromFilter; // @dynamic isExcludedFromFilter;
@property(retain, nonatomic) TDNamedElement *name; // @dynamic name;
@property(retain, nonatomic) TDSchemaPartDefinition *partDefinition; // @dynamic partDefinition;
@property(retain, nonatomic) TDThemeConstant *renditionSubtype; // @dynamic renditionSubtype;
@property(retain, nonatomic) TDRenditionType *renditionType; // @dynamic renditionType;
@property(retain, nonatomic) NSSet *renditions; // @dynamic renditions;
@property(retain, nonatomic) TDThemeConstant *zeroCodeArtworkInfo; // @dynamic zeroCodeArtworkInfo;

@end

@interface TDPhotoshopElementProduction : TDElementProduction <TDElementAttributes>
{
    NSMutableAttributedString *log;
    CUIPSDImageRef *psdImageRef;
    NSDate *_cachedImageDate;
    CUIImage *_edgeMetricsMask;
    CUIImage *_textMetricsMask;
    CUIImage *_baselineMetricsMask;
    _Bool _didCheckForMetricsMasks;
}

+ (unsigned int)sliceColumnsPerRendition:(long long)arg1;
+ (unsigned int)sliceRowsPerRendition:(long long)arg1;
- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (void)setAttributesFromData:(id)arg1;
- (id)_layerMappingForPhotoshopLayer:(long long)arg1 drawingLayer:(long long)arg2;
- (id)dataFromAttributes;
- (void)copyAttributesInto:(id)arg1;
- (void)deleteRenditionsInDocument:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (_Bool)generateRenditionsWithEntityName:(id)arg1 document:(id)arg2 errorDescription:(id *)arg3;
- (void)appendToLog:(id)arg1;
- (id)log;
- (id)baselineMetricsMaskWithDocument:(id)arg1;
- (id)textMetricsMaskWithDocument:(id)arg1;
- (id)edgeMetricsMaskWithDocument:(id)arg1;
- (void)_loadMetricsMasksWithDocument:(id)arg1;
- (id)psdImageRefWithDocument:(id)arg1;
- (void)fillIterationKeyAttribute:(id)arg1 iteration:(int)arg2 rowOrColumn:(int)arg3 document:(id)arg4;
- (void)getDrawingLayerIndices:(id *)arg1 themeLayers:(id *)arg2 lowestIndex:(long long *)arg3;
- (void)addDrawingLayerIndex:(id)arg1 themeLayer:(id)arg2 toIndices:(id)arg3 layers:(id)arg4 lowestIndex:(long long *)arg5;
- (id)associatedFileURLWithDocument:(id)arg1;
- (id)relativePath;
- (void)setRowIterationType:(id)arg1;
- (void)setColumnIterationType:(id)arg1;
- (void)setIsActive:(id)arg1;
- (id)baseKeySpec;
- (id)isActive;
- (id)rowIterationType;
- (id)columnIterationType;
- (void)setColumnCount:(id)arg1;
- (id)columnCount;
- (void)setRowCount:(id)arg1;
- (id)rowCount;
- (void)dealloc;

// Remaining properties
@property(retain, nonatomic) TDPhotoshopAsset *asset; // @dynamic asset;

@end

@interface TDCursorPhotoshopProduction : TDPhotoshopElementProduction
{
}

@end

@interface TDSimpleArtworkElementProduction : TDElementProduction
{
}

- (id)associatedFileModificationDateWithDocument:(id)arg1;
- (void)deleteRenditionsInDocument:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;

// Remaining properties
@property(retain, nonatomic) TDTemplateRenderingMode *templateRenderingMode; // @dynamic templateRenderingMode;

@end

@interface TDCustomArtworkProduction : TDSimpleArtworkElementProduction
{
    _Bool _hasCustomDateOfLastChange;
}

@property(nonatomic) _Bool hasCustomDateOfLastChange; // @synthesize hasCustomDateOfLastChange=_hasCustomDateOfLastChange;
- (void)setDateOfLastChange:(id)arg1;

@end

@interface TDRenditionSpec : NSManagedObject
{
}

@property(retain, nonatomic) TDRenditionType *renditionType; // @dynamic renditionType;
- (id)createCSIRepresentationWithCompression:(_Bool)arg1 colorSpaceID:(unsigned long long)arg2 document:(id)arg3;
- (void)resetToBaseKeySpec;
- (void)awakeFromInsert;

// Remaining properties
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) TDRenditionKeySpec *keySpec; // @dynamic keySpec;
@property(retain, nonatomic) TDElementProduction *production; // @dynamic production;

@end

@interface TDSimpleArtworkRenditionSpec : TDRenditionSpec
{
    struct CGRect _alignmentRect;
    _Bool _allowsMultiPassEncoding;
}

+ (void)initialize;
@property(nonatomic) _Bool allowsMultiPassEncoding; // @synthesize allowsMultiPassEncoding=_allowsMultiPassEncoding;
- (id)createCSIRepresentationWithCompression:(_Bool)arg1 colorSpaceID:(unsigned long long)arg2 document:(id)arg3;
- (CDStruct_1ba92a5e)_edgeMetricsForAlignmentRect:(struct CGRect)arg1 originalRenditionSize:(CDStruct_1ef3fb1f)arg2 newRenditionSize:(CDStruct_1ef3fb1f)arg3;
- (id)_sliceRectanglesForRenditionSize:(CDStruct_1ef3fb1f)arg1;
- (id)_slicesToUseForCSI;
- (void)_logExtra:(id)arg1;
- (void)_logWarning:(id)arg1;
- (void)_logError:(id)arg1;
- (id)associatedFileModificationDateWithDocument:(id)arg1;
- (void)awakeFromFetch;
@property(nonatomic) struct CGRect alignmentRect; // @dynamic alignmentRect;
@property(nonatomic) struct CGRect primitiveAlignmentRect;
- (id)initWithEntity:(id)arg1 insertIntoManagedObjectContext:(id)arg2;

// Remaining properties
@property(retain, nonatomic) NSString *alignmentRectString; // @dynamic alignmentRectString;
@property(retain, nonatomic) TDPNGAsset *asset; // @dynamic asset;
@property(retain, nonatomic) NSOrderedSet *slices; // @dynamic slices;

@end

@interface TDCustomArtworkRenditionSpec : TDSimpleArtworkRenditionSpec
{
}

@end

@interface TDPNGAsset : TDAsset
{
    int _exifOrientation;
    unsigned int _fileScaleFactor;
}

- (_Bool)hasProduction;
- (_Bool)hasCursorProduction;
- (unsigned int)fileScaleFactor;
- (void)setFileScaleFactor:(unsigned int)arg1;
- (int)exifOrientation;
- (id)sourceImageWithDocument:(id)arg1;
- (struct CGSize)sourceImageSizeWithDocument:(id)arg1;
- (void)_logError:(id)arg1;

// Remaining properties
@property(retain, nonatomic) NSSet *renditions; // @dynamic renditions;

@end

@interface TDCustomAsset : TDPNGAsset
{
}

- (id)sourceImageWithDocument:(id)arg1;
- (struct CGSize)sourceImageSizeWithDocument:(id)arg1;

// Remaining properties
@property(retain, nonatomic) NSString *referenceData; // @dynamic referenceData;

@end

@interface TDCustomAssetImportInfo : NSObject
{
    CUIRenditionKey *_renditionKey;
    NSString *_elementName;
    NSString *_partName;
    NSObject<TDCustomAssetSource> *_customAsset;
    NSDate *_modificationDate;
    long long _renditionType;
    long long _resizingMode;
    long long _templateRenderingMode;
    NSString *_name;
    struct CGSize _resizableSliceSize;
    CDStruct_3c058996 _sliceInsets;
    struct CGRect _alignmentRect;
}

@property(copy, nonatomic) NSString *name; // @synthesize name=_name;
@property(nonatomic) struct CGRect alignmentRect; // @synthesize alignmentRect=_alignmentRect;
@property(nonatomic) long long templateRenderingMode; // @synthesize templateRenderingMode=_templateRenderingMode;
@property(nonatomic) struct CGSize resizableSliceSize; // @synthesize resizableSliceSize=_resizableSliceSize;
@property(nonatomic) long long resizingMode; // @synthesize resizingMode=_resizingMode;
@property(nonatomic) long long renditionType; // @synthesize renditionType=_renditionType;
@property(nonatomic) CDStruct_3c058996 sliceInsets; // @synthesize sliceInsets=_sliceInsets;
@property(copy, nonatomic) NSDate *modificationDate; // @synthesize modificationDate=_modificationDate;
@property(retain) NSObject<TDCustomAssetSource> *customAsset; // @synthesize customAsset=_customAsset;
@property(copy, nonatomic) NSString *partName; // @synthesize partName=_partName;
@property(copy, nonatomic) NSString *elementName; // @synthesize elementName=_elementName;
@property(copy, nonatomic) CUIRenditionKey *renditionKey; // @synthesize renditionKey=_renditionKey;
@property(nonatomic) _Bool isTemplate;
- (long long)renditionSubtype;
- (void)dealloc;

@end

@interface TDDistillRunner : NSObject
{
    long long _capabilities;
    TDDistiller *_distiller;
    NSURL *_carScratchURL;
    NSURL *_outputURL;
    TDLogger *_logger;
    NSString *_assetStoreVersionString;
    long long _assetStoreVersionNumber;
}

@property long long assetStoreVersionNumber; // @synthesize assetStoreVersionNumber=_assetStoreVersionNumber;
@property(copy) NSString *assetStoreVersionString; // @synthesize assetStoreVersionString=_assetStoreVersionString;
@property(retain, nonatomic) TDLogger *logger; // @synthesize logger=_logger;
@property(copy, nonatomic) NSURL *outputURL; // @synthesize outputURL=_outputURL;
- (void)dealloc;
- (_Bool)runDistillWithDocumentURL:(id)arg1 outputURL:(id)arg2 attemptIncremental:(_Bool)arg3 forceDistill:(_Bool)arg4;
- (void)setDocumentCapabilities:(long long)arg1;
- (_Bool)_isDistillUnnecessaryForDocument:(id)arg1;
- (void)_moveScratchToOutputPath;
- (void)_removeScratchPath;
- (id)carScratchURL;
- (id)init;

@end

@interface TDDistiller : NSObject
{
    CoreThemeDocument *document;
    CUIMutableCommonAssetStorage *assetStore;
    NSMutableArray *renditionEntries;
    NSArray *_changedProductions;
    NSArray *_mainThreadPerformRunLoopModes;
    _Bool _incremental;
    _Bool _cancelled;
    _Bool _successful;
    _Bool _finished;
    NSString *_assetStoreVersionString;
    long long _assetStoreVersionNumber;
    TDLogger *_logger;
    NSString *_accumulatedErrorDescription;
    NSThread *_callbackThread;
    CDUnknownBlockType _oldCompletionHandler;
    CDUnknownBlockType _completionHandler;
}

@property(copy) CDUnknownBlockType completionHandler; // @synthesize completionHandler=_completionHandler;
@property(copy) CDUnknownBlockType oldCompletionHandler; // @synthesize oldCompletionHandler=_oldCompletionHandler;
@property(retain) NSThread *callbackThread; // @synthesize callbackThread=_callbackThread;
@property(retain, nonatomic) NSString *accumulatedErrorDescription; // @synthesize accumulatedErrorDescription=_accumulatedErrorDescription;
@property(getter=isFinished) _Bool finished; // @synthesize finished=_finished;
@property(retain) TDLogger *logger; // @synthesize logger=_logger;
@property(getter=isSuccessful) _Bool successful; // @synthesize successful=_successful;
@property(getter=isCancelled) _Bool cancelled; // @synthesize cancelled=_cancelled;
@property long long assetStoreVersionNumber; // @synthesize assetStoreVersionNumber=_assetStoreVersionNumber;
@property(copy) NSString *assetStoreVersionString; // @synthesize assetStoreVersionString=_assetStoreVersionString;
@property(getter=isIncremental) _Bool incremental; // @synthesize incremental=_incremental;
- (void)performSelectorOnCallbackThread:(SEL)arg1 withObject:(id)arg2 waitUntilDone:(_Bool)arg3;
- (void)cancelDistill;
- (void)waitTimerDidFire:(id)arg1;
- (void)waitUntilFinished;
- (void)saveAndDistillWithCompletionHandler:(CDUnknownBlockType)arg1;
- (void)distillWithCompletionHandler:(CDUnknownBlockType)arg1;
- (void)beginDistillWithCompletionHandler:(CDUnknownBlockType)arg1;
- (void)_distill:(id)arg1;
- (void)_distillChanges:(id)arg1;
- (void)_resetDocumentUuid:(id)arg1;
- (void)markDistillationAsFinished;
- (void)finishDistillationWithSuccess:(_Bool)arg1;
- (_Bool)distillDebuggingInfo;
- (void)_distillDebuggingInfoForConstants:(id)arg1 isElement:(_Bool)arg2;
- (_Bool)distillCursorFacetDefinitions;
- (_Bool)_distillCursorFacetDefinitions:(id)arg1;
- (_Bool)distillZeroCodeArtworkElementAndPartIdentifiers;
- (_Bool)distillZeroCodeArtworkInfoOfType:(long long)arg1;
- (_Bool)distillZeroCodeArtworkInfo:(id)arg1 ofType:(long long)arg2;
- (id)zeroCodeArtworkInfoOfType:(long long)arg1 error:(id *)arg2;
- (_Bool)distillNamedElements;
- (_Bool)_distillNamedElements:(id)arg1;
- (id)_copyStandardEffectDefinitions;
- (_Bool)distillCustomFontSizes;
- (_Bool)distillCustomFonts;
- (_Bool)_distillFonts:(id)arg1;
- (_Bool)distillCustomColors;
- (_Bool)_distillColorDefinitions:(id)arg1;
- (_Bool)distillRenditions;
- (_Bool)_recordRenditionEntryFromRendition:(id)arg1;
- (id)_productionForRenditionSpec:(id)arg1;
- (_Bool)sortAndStoreRenditions;
- (void)_storeRenditions;
- (unsigned long long)_removeRenditionsWithKeySpecs:(id)arg1;
- (_Bool)_sortRenditionEntries;
- (void)setAsset:(id)arg1 withKey:(const struct _renditionkeytoken *)arg2 fromRenditionSpec:(id)arg3;
- (id)_renditionsFromProductions:(id)arg1 error:(id *)arg2;
- (id)_renditionsWithError:(id *)arg1;
- (id)_keyDataFromKey:(const struct _renditionkeytoken *)arg1;
- (id)keyFormatData;
- (void)dealloc;
- (id)documentPath;
- (id)initWithDocument:(id)arg1 outputPath:(id)arg2 attemptIncremental:(_Bool)arg3 versionString:(id)arg4;
- (id)initWithDocument:(id)arg1 outputPath:(id)arg2 attemptIncremental:(_Bool)arg3;
- (id)initWithDocument:(id)arg1 outputPath:(id)arg2 versionString:(id)arg3;
- (id)initWithDocument:(id)arg1 outputPath:(id)arg2;
- (id)_keySpecsToRemoveFromKeySpecs:(id)arg1;
- (_Bool)_setupWithOutputPath:(id)arg1 attemptIncremental:(_Bool)arg2;
- (void)_logErrorAndAccumulateDescription:(id)arg1;
- (void)_accumulateErrorDescription:(id)arg1;
- (void)_logExtra:(id)arg1;
- (void)_logInfo:(id)arg1;
- (void)_logWarning:(id)arg1;
- (void)_logError:(id)arg1;

@end

@interface TDEffectComponent : NSManagedObject
{
}

- (void)updatePresetParameters:(id)arg1 atIndex:(unsigned long long)arg2;
- (void)setEffectParametersFromPreset:(id)arg1 atIndex:(unsigned long long)arg2 withDocument:(id)arg3;

// Remaining properties
@property(retain, nonatomic) TDEffectType *effectType; // @dynamic effectType;
@property(nonatomic) _Bool isEnabled; // @dynamic isEnabled;
@property(retain, nonatomic) NSSet *parameters; // @dynamic parameters;
@property(retain, nonatomic) TDEffectRenditionSpec *rendition; // @dynamic rendition;

@end

@interface TDThemeConstant : NSManagedObject
{
    int _identifier;
}

- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (id)debugDescription;
- (id)constantName;
- (void)setConstantName:(id)arg1;
- (id)displayName;
- (void)setDisplayName:(id)arg1;
- (unsigned int)identifier;
- (void)setIdentifier:(unsigned int)arg1;

@end

@interface TDEffectParameterType : TDThemeConstant
{
}

@end

@interface TDEffectParameterValue : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) NSNumber *angleValue; // @dynamic angleValue;
@property(retain, nonatomic) NSNumber *colorValue; // @dynamic colorValue;
@property(retain, nonatomic) TDEffectComponent *component; // @dynamic component;
@property(retain, nonatomic) NSNumber *floatValue; // @dynamic floatValue;
@property(retain, nonatomic) NSNumber *intValue; // @dynamic intValue;
@property(retain, nonatomic) TDEffectParameterType *parameterType; // @dynamic parameterType;
@end

@interface TDEffectRenditionSpec : TDRenditionSpec
{
}

- (id)createCSIRepresentationWithCompression:(_Bool)arg1 colorSpaceID:(unsigned long long)arg2 document:(id)arg3;
- (id)effectPreset;
- (void)setComponentsFromEffectPreset:(id)arg1 withDocument:(id)arg2;

// Remaining properties
@property(retain, nonatomic) NSSet *components; // @dynamic components;
@property(retain, nonatomic) NSNumber *effectScale; // @dynamic effectScale;

@end

@interface TDEffectStyleProduction : TDElementProduction
{
}

- (id)displayName;
- (void)deleteRenditionsInDocument:(id)arg1 shouldDeleteAssetFiles:(_Bool)arg2;
- (id)associatedFileModificationDateWithDocument:(id)arg1;
- (void)generateRenditionsWithDocument:(id)arg1;

@end

@interface TDEffectType : TDThemeConstant
{
}

@end

@interface TDFontDefinition : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) NSNumber *baselineOffset; // @dynamic baselineOffset;
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) NSString *postscriptName; // @dynamic postscriptName;
@property(retain, nonatomic) TDMetafontSelector *selector; // @dynamic selector;
@end

@interface TDFontSizeDefinition : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) NSNumber *pointSize; // @dynamic pointSize;
@property(retain, nonatomic) TDMetafontSizeSelector *selector; // @dynamic selector;
@end

@interface TDHistorian : NSObject
{
    CoreThemeDocument *document;
}

- (id)initWithDocument:(id)arg1;
- (id)keySpecsForRenditionsRemovedSinceDate:(id)arg1;
- (id)facetDefinitionsChangedSinceDate:(id)arg1;
- (id)namedElementsChangedSinceDate:(id)arg1;
- (id)fontSizesChangedSinceDate:(id)arg1;
- (id)fontsChangedSinceDate:(id)arg1;
- (id)colorsChangedSinceDate:(id)arg1;
- (id)productionsChangedSinceDate:(id)arg1 uuidNeedsReset:(_Bool *)arg2;
- (id)productionsWithModifiedAssets;
- (_Bool)foundDataChangesSinceDate:(id)arg1;
- (void)updateEntriesForManagedObjects:(id)arg1;
- (void)_updateEntryForManagedObject:(id)arg1;
- (id)_updateRecordsWithName:(id)arg1 sinceDate:(id)arg2;

@end

@interface TDIterationType : TDThemeConstant
{
}

@end

@interface TDLayerMapping : NSManagedObject
{
}

- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;

@end

@interface TDLogger : NSObject
{
    NSObject<OS_dispatch_queue> *_loggingQueue;
    int _verbosity;
    int _logMaxVerbosity;
}

+ (id)logger;
- (void)waitForLoggingToComplete;
- (_Bool)isVerbosityLogEverything;
- (_Bool)isVerbosityLogWarningsAndErrors;
- (_Bool)isVerbosityLogErrorsOnly;
- (void)logErrorWithFormat:(id)arg1;
- (void)logWarningWithFormat:(id)arg1;
- (void)logInfoWithFormat:(id)arg1;
- (void)logExtraWithFormat:(id)arg1;
- (void)logError:(id)arg1;
- (void)logWarning:(id)arg1;
- (void)logInfo:(id)arg1;
- (void)logExtra:(id)arg1;
- (void)logMessage:(id)arg1 whenVerbosity:(int)arg2;
- (void)dealloc;
@property(nonatomic) int verbosity;
- (id)init;

@end

@interface TDMetafontSelector : TDThemeConstant
{
}

// Remaining properties
@property(retain, nonatomic) TDFontDefinition *definition; // @dynamic definition;
@end

@interface TDMetafontSizeSelector : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) TDThemeSize *controlSize; // @dynamic controlSize;
@property(retain, nonatomic) TDFontSizeDefinition *definition; // @dynamic definition;
@property(retain, nonatomic) NSString *displayName; // @dynamic displayName;
@property(retain, nonatomic) NSNumber *identifier; // @dynamic identifier;
@property(retain, nonatomic) NSString *selectorName; // @dynamic selectorName;
@end

@interface TDNamedArtworkProduction : TDSimpleArtworkElementProduction
{
    _Bool _hasCustomDateOfLastChange;
}

@property(nonatomic) _Bool hasCustomDateOfLastChange; // @synthesize hasCustomDateOfLastChange=_hasCustomDateOfLastChange;
- (void)setDateOfLastChange:(id)arg1;

@end

@interface TDNamedAssetImportInfo : NSObject
{
    NSString *_name;
    long long _nameIdentifier;
    NSURL *_fileURL;
    NSDate *_modificationDate;
    long long _idiom;
    long long _subtype;
    unsigned long long _scaleFactor;
    long long _renditionType;
    long long _resizingMode;
    long long _templateRenderingMode;
    long long _sizeClassHorizontal;
    long long _sizeClassVertical;
    unsigned long long _memoryClass;
    unsigned long long _graphicsClass;
    struct CGSize _resizableSliceSize;
    CDStruct_3c058996 _sliceInsets;
    struct CGRect _alignmentRect;
}

@property(nonatomic) unsigned long long graphicsClass; // @synthesize graphicsClass=_graphicsClass;
@property(nonatomic) unsigned long long memoryClass; // @synthesize memoryClass=_memoryClass;
@property(nonatomic) long long sizeClassVertical; // @synthesize sizeClassVertical=_sizeClassVertical;
@property(nonatomic) long long sizeClassHorizontal; // @synthesize sizeClassHorizontal=_sizeClassHorizontal;
@property(nonatomic) struct CGRect alignmentRect; // @synthesize alignmentRect=_alignmentRect;
@property(nonatomic) long long templateRenderingMode; // @synthesize templateRenderingMode=_templateRenderingMode;
@property(nonatomic) struct CGSize resizableSliceSize; // @synthesize resizableSliceSize=_resizableSliceSize;
@property(nonatomic) long long resizingMode; // @synthesize resizingMode=_resizingMode;
@property(nonatomic) long long renditionType; // @synthesize renditionType=_renditionType;
@property(nonatomic) CDStruct_3c058996 sliceInsets; // @synthesize sliceInsets=_sliceInsets;
@property(nonatomic) unsigned long long scaleFactor; // @synthesize scaleFactor=_scaleFactor;
@property(nonatomic) long long subtype; // @synthesize subtype=_subtype;
@property(nonatomic) long long idiom; // @synthesize idiom=_idiom;
@property(copy, nonatomic) NSDate *modificationDate; // @synthesize modificationDate=_modificationDate;
@property(copy, nonatomic) NSURL *fileURL; // @synthesize fileURL=_fileURL;
@property(nonatomic) long long nameIdentifier; // @synthesize nameIdentifier=_nameIdentifier;
@property(copy, nonatomic) NSString *name; // @synthesize name=_name;
@property(nonatomic) _Bool isTemplate;
- (long long)renditionSubtype;
- (void)dealloc;
- (id)init;

@end

@interface TDNamedEffectProduction : TDEffectStyleProduction
{
}

- (id)displayName;
- (id)_nameAssociatedWithNameIdentifier:(unsigned int)arg1;

@end

@interface TDNamedElement : NSManagedObject
{
}

// Remaining properties
@property(retain, nonatomic) NSDate *dateOfLastChange; // @dynamic dateOfLastChange;
@property(retain, nonatomic) NSNumber *identifier; // @dynamic identifier;
@property(retain, nonatomic) NSString *name; // @dynamic name;
@property(retain, nonatomic) TDElementProduction *production; // @dynamic production;
@end

@interface TDPhotoshopAsset : TDAsset
{
}

- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (_Bool)hasProduction;
- (id)production;
- (_Bool)hasCursorProduction;
- (id)_productionWithRenditionsInProductions:(id)arg1;
- (id)_activeProductionWithRenditionsInProductions:(id)arg1;

// Remaining properties
@property(retain, nonatomic) NSSet *productions; // @dynamic productions;

@end

@interface TDPhotoshopLayer : NSManagedObject
{
}

- (id)hierarchicalLayerNames;

// Remaining properties
@property(retain, nonatomic) TDPhotoshopLayer *childLayer; // @dynamic childLayer;
@property(retain, nonatomic) NSString *name; // @dynamic name;
@property(retain, nonatomic) TDPhotoshopLayer *parentLayer; // @dynamic parentLayer;
@property(retain, nonatomic) TDPhotoshopRenditionSpec *rendition; // @dynamic rendition;

@end

@interface TDPhotoshopRenditionSpec : TDRenditionSpec
{
}

- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (void)copyAttributesInto:(id)arg1;
- (int)_layerIndexInPSDImage:(id)arg1;
- (id)createCSIRepresentationFromPSDImage:(id)arg1 withCompression:(_Bool)arg2 colorSpaceID:(unsigned long long)arg3;
- (id)createCSIRepresentationWithCompression:(_Bool)arg1 colorSpaceID:(unsigned long long)arg2 document:(id)arg3;
- (id)createCSIRepresentationFromGradientPSDImage:(id)arg1 withCompression:(_Bool)arg2 colorSpaceID:(unsigned long long)arg3;
- (id)createCSIRepresentationFromPSDImage:(id)arg1 withCompression:(_Bool)arg2 edgeMetricsMask:(id)arg3 textMetricsMask:(id)arg4 baselineMetricsMask:(id)arg5 colorSpaceID:(unsigned long long)arg6;
- (void)_logExtra:(id)arg1;
- (void)_logWarning:(id)arg1;
- (void)_logError:(id)arg1;
- (id)debugDescription;
- (int)psdSliceNumberForRenditionRow:(int)arg1 sliceRow:(int)arg2 renditionColumn:(int)arg3 sliceColumn:(int)arg4 rowsPerRendition:(int)arg5 columnsPerRendition:(int)arg6 renditionColumnCount:(int)arg7;

// Remaining properties
@property(retain, nonatomic) TDPhotoshopLayer *photoshopLayer; // @dynamic photoshopLayer;

@end

@interface TDProMergeableCommonAssetStorage : CUIMutableCommonAssetStorage
{
}

- (id)initWithPath:(id)arg1;

@end

@interface TDRenditionEntry : NSObject
{
    struct _renditionkeytoken *key;
    struct _renditionkeytoken stackKey[16];
    const struct _renditionkeyfmt *keyFormat;
    NSData *assetData;
    TDRenditionSpec *renditionSpec;
}

@property(readonly, retain, nonatomic) TDRenditionSpec *renditionSpec; // @synthesize renditionSpec;
@property(readonly, retain, nonatomic) NSData *assetData; // @synthesize assetData;
- (long long)compare:(id)arg1;
- (void)dealloc;
- (id)initWithKey:(const struct _renditionkeytoken *)arg1 keyFormat:(const struct _renditionkeyfmt *)arg2 assetData:(id)arg3 renditionSpec:(id)arg4;

@end

@interface TDRenditionKeySpec : NSManagedObject <TDElementAttributes>
{
    unsigned int _dimension1;
    unsigned int _dimension2;
    unsigned int _scaleFactor;
    unsigned int _subtype;
    unsigned int _nameIdentifier;
    unsigned int _memoryClass;
    unsigned int _graphicsClass;
    struct _renditionkeytoken _stackScratchKey[16];
    struct _renditionkeytoken *_scratchKey;
}

+ (id)keyPathsForValuesAffectingValueForKey:(id)arg1;
- (void)setAttributesFromCopyData:(id)arg1;
- (id)copyDataFromAttributes;
- (void)setAttributesFromData:(id)arg1;
- (id)dataFromAttributes;
- (void)copyAttributesInto:(id)arg1;
- (id)keyDescription;
- (const struct _renditionkeytoken *)key;
- (void)getKey:(struct _renditionkeytoken *)arg1;
- (void)setAttributesFromRenditionKey:(const struct _renditionkeytoken *)arg1 withDocument:(id)arg2;
- (long long)attributeCount;
- (const struct _renditionkeyfmt *)keyFormat;
- (id)debugDescription;
- (void)setScaleFactorString:(id)arg1;
- (id)scaleFactorString;
- (unsigned int)graphicsClass;
- (void)setGraphicsClass:(unsigned int)arg1;
- (unsigned int)memoryClass;
- (void)setMemoryClass:(unsigned int)arg1;
- (unsigned int)nameIdentifier;
- (void)setNameIdentifier:(unsigned int)arg1;
- (unsigned int)subtype;
- (void)setSubtype:(unsigned int)arg1;
- (unsigned int)scaleFactor;
- (void)setScaleFactor:(unsigned int)arg1;
- (unsigned int)dimension2;
- (void)setDimension2:(unsigned int)arg1;
- (unsigned int)dimension1;
- (void)setDimension1:(unsigned int)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)dealloc;

// Remaining properties
@property(retain, nonatomic) TDThemeDirection *direction; // @dynamic direction;
@property(retain, nonatomic) TDThemeElement *element; // @dynamic element;
@property(retain, nonatomic) TDThemeIdiom *idiom; // @dynamic idiom;
@property(retain, nonatomic) TDThemeDrawingLayer *layer; // @dynamic layer;
@property(retain, nonatomic) TDThemePart *part; // @dynamic part;
@property(retain, nonatomic) TDThemePresentationState *presentationState; // @dynamic presentationState;
@property(retain, nonatomic) TDThemeState *previousState; // @dynamic previousState;
@property(retain, nonatomic) TDThemeValue *previousValue; // @dynamic previousValue;
@property(retain, nonatomic) TDThemeSize *size; // @dynamic size;
@property(retain, nonatomic) TDThemeUISizeClass *sizeClassHorizontal; // @dynamic sizeClassHorizontal;
@property(retain, nonatomic) TDThemeUISizeClass *sizeClassVertical; // @dynamic sizeClassVertical;
@property(retain, nonatomic) TDThemeState *state; // @dynamic state;
@property(retain, nonatomic) TDThemeValue *value; // @dynamic value;

@end

@interface TDRenditionSubtype : TDThemeConstant
{
}

@end

@interface TDRenditionType : TDThemeConstant
{
}

@end

@interface TDRenditionsDistiller : NSObject
{
    CoreThemeDocument *document;
    NSMutableArray *renditionInQueue;
    NSMutableArray *psiDataInfoOutQueue;
    NSConditionLock *inQueueLock;
    NSConditionLock *outQueueLock;
    _Bool shouldCompressCSIDataFlag;
    _Bool noMoreCSIDataInfo;
    _Bool noMoreRenditions;
    TDLogger *_logger;
}

@property(retain) TDLogger *logger; // @synthesize logger=_logger;
- (id)nextCSIDataInfoFromQueue;
- (void)enqueueRenditionSpec:(id)arg1;
- (void)enqueueAbortFlag;
- (void)enqueueLastRenditionFlag;
- (void)detachDistillationThread;
- (void)_distill:(id)arg1;
- (id)_nextObjectFromInQueue;
- (void)_enqueueDistillingAbortedInfo;
- (void)_enqueueLastCSIDataInfoFlag;
- (void)_enqueueCSIDataInfo:(id)arg1;
- (void)_enqueueOnOutQueueTheObject:(id)arg1;
- (void)_enqueueOnInQueueTheObject:(id)arg1;
- (void)_enqueueOnQueue:(id)arg1 withQueueLock:(id)arg2 object:(id)arg3;
- (void)dealloc;
- (id)initWithDocument:(id)arg1 shouldCompressCSIDataFlag:(_Bool)arg2;

@end

@interface TDSchemaCategory : TDThemeConstant
{
}

// Remaining properties
@property(retain, nonatomic) NSSet *elements; // @dynamic elements;
@end

@interface TDSchemaDefinition : NSManagedObject
{
}

+ (const CDStruct_e3362728 *)elementDefinitionWithName:(id)arg1 withSchema:(id)arg2;
+ (const CDStruct_e3362728 *)sortedElementDefinitionAtIndex:(unsigned long long)arg1 withSchema:(id)arg2;
+ (unsigned long long)elementDefinitionCountWithSchema:(id)arg1;
- (id)displayName;
- (id)previewImage;

// Remaining properties
@property(retain, nonatomic) TDSchemaCategory *category; // @dynamic category;
@property(retain, nonatomic) NSString *name; // @dynamic name;
@property(retain, nonatomic) NSSet *parts; // @dynamic parts;
@property _Bool published; // @dynamic published;

@end

@interface TDSchemaEffectDefinition : TDSchemaDefinition
{
}

+ (const CDStruct_e3362728 *)elementDefinitionWithName:(id)arg1 withSchema:(id)arg2;
+ (const CDStruct_e3362728 *)sortedElementDefinitionAtIndex:(unsigned long long)arg1 withSchema:(id)arg2;
+ (unsigned long long)elementDefinitionCountWithSchema:(id)arg1;

@end

@interface TDSchemaElementDefinition : TDSchemaDefinition
{
}

+ (const CDStruct_e3362728 *)elementDefinitionWithName:(id)arg1 withSchema:(id)arg2;
+ (const CDStruct_e3362728 *)sortedElementDefinitionAtIndex:(unsigned long long)arg1 withSchema:(id)arg2;
+ (unsigned long long)elementDefinitionCountWithSchema:(id)arg1;

@end

@interface TDSchemaElementProduction : TDSimpleArtworkElementProduction
{
}

- (void)generateNewRendition;
- (id)associatedFileURLWithDocument:(id)arg1;
- (id)relativePath;

// Remaining properties
@property(retain, nonatomic) NSString *folderName; // @dynamic folderName;
@property(retain, nonatomic) NSOrderedSet *slices; // @dynamic slices;

@end

@interface TDSchemaPartDefinition : NSManagedObject
{
    CUIImage *previewImage;
    NSArray *renditions;
    NSArray *renditionGroups;
    unsigned long long partFeatures;
}

@property(nonatomic) unsigned long long partFeatures; // @synthesize partFeatures;
@property(retain, nonatomic) NSArray *renditionGroups; // @synthesize renditionGroups;
@property(copy, nonatomic) NSArray *renditions; // @synthesize renditions;
@property(retain, nonatomic) CUIImage *previewImage; // @synthesize previewImage;
- (void)didTurnIntoFault;
- (const CDStruct_26b2aa83 *)cuiPartDefinition;
- (id)displayName;
- (long long)partID;
- (long long)elementID;
- (long long)_renditionKeyValueForTokenIdentifier:(unsigned short)arg1;
- (id)validStatesWithDocument:(id)arg1;
- (void)updateDerivedRenditionData;
- (id)_schema;
- (id)bestPreviewRendition;

// Remaining properties
@property(retain, nonatomic) TDSchemaDefinition *element; // @dynamic element;
@property(retain, nonatomic) NSString *name; // @dynamic name;
@property(retain, nonatomic) NSSet *productions; // @dynamic productions;
@property(retain, nonatomic) NSString *widgetID; // @dynamic widgetID;

@end

@interface TDSchemaRenditionSpec : TDSimpleArtworkRenditionSpec
{
}

- (id)_slicesToUseForCSI;

@end

@interface TDSlice : NSManagedObject
{
    struct CGRect _sliceRect;
}

- (void)awakeFromFetch;
@property(nonatomic) struct CGRect sliceRect; // @dynamic sliceRect;
@property(nonatomic) struct CGRect primitiveSliceRect;

// Remaining properties
@property(retain, nonatomic) NSString *sliceRectString; // @dynamic sliceRectString;

@end

@interface TDTemplateRenderingMode : TDThemeConstant
{
}

@end

@interface TDThemeBitSource : NSManagedObject
{
}

- (id)fileURLWithDocument:(id)arg1;
- (void)setName:(id)arg1;
- (id)name;

// Remaining properties
@property(retain, nonatomic) NSSet *assets; // @dynamic assets;
@property(retain, nonatomic) NSString *path; // @dynamic path;

@end

@interface TDThemeDirection : TDThemeConstant
{
}

@end

@interface TDThemeDrawingLayer : TDThemeConstant
{
}

@end

@interface TDThemeElement : TDThemeConstant
{
}

- (id)debugDescription;

@end

@interface TDThemeIdiom : TDThemeConstant
{
}

@end

@interface TDThemeLook : TDThemeConstant
{
    _Bool _supportsContrastAdjustment;
}

- (_Bool)supportsContrastAdjustment;
- (void)setSupportsContrastAdjustment:(_Bool)arg1;

@end

@interface TDThemePart : TDThemeConstant
{
}

- (id)debugDescription;

@end

@interface TDThemePresentationState : TDThemeConstant
{
}

@end

@interface TDThemePreviousState : TDThemeConstant
{
}

@end

@interface TDThemePreviousValue : TDThemeConstant
{
}

@end

@interface TDThemeSchema : NSObject
{
    CoreThemeDocument *_doc;
}

+ (_Bool)loadThemeConstantsForEntity:(id)arg1 inContext:(id)arg2;
- (void)resetThemeConstants;
- (void)loadSchemaDefinitions;
- (void)loadSchemaCategories;
- (void)loadStandardEffectDefinitions;
- (void)loadTemplateRenderingModeConstants;
- (void)loadEffectConstants;
- (void)loadDefaultFontCustomizations;
- (void)loadMetafontSizes;
- (void)loadMetafontSelectors;
- (void)loadArtworkDraftTypes;
- (void)loadColorStatuses;
- (void)loadColorNames;
- (void)loadZeroCodeArtworkInfo;
- (void)loadRenditionSubtypes;
- (void)loadRenditionTypes;
- (void)loadThemeDefaultLook;
- (void)loadThemeLooks;
- (void)loadIterationTypes;
- (void)loadThemeUISizeClasses;
- (void)loadThemeIdioms;
- (void)loadThemeDrawingLayers;
- (void)loadThemeDirections;
- (void)loadThemePresentationStates;
- (void)loadThemeStates;
- (void)loadBasicThemePart;
- (void)loadThemeParts;
- (void)loadThemeElements;
- (void)loadThemeValues;
- (void)loadThemeSizes;
- (void)sanityCheckAndUpdateDocumentIfNecessary;
- (void)_sanityCheckSchemaAssets;
- (_Bool)_renditionKey:(const struct _renditionkeytoken *)arg1 isEqualToKeyIgnoringLook:(const struct _renditionkeytoken *)arg2;
- (void)_sanityCheckSchemaDefinitionsAndUpdateIfNecessary;
- (void)_sanityCheckSchemaCategoriesAndUpdateIfNecessary;
- (void)_addSchemaPartDefinitionsForStandardElement:(const CDStruct_e3362728 *)arg1 withElement:(id)arg2;
- (void)_sanityCheckSchemaPartDefinitionsForStandardElement:(const CDStruct_e3362728 *)arg1 withElement:(id)arg2;
- (void)_sanityCheckColorNamesAndUpdateIfNecessary;
- (void)_sanityCheckMetafontSizeSelectorsAndUpdateIfNecessary;
- (void)_sanityCheckObjectsWithEntityName:(id)arg1 globalDescriptor:(void *)arg2 matchIdentifierOnly:(_Bool)arg3;
- (void)dealloc;
- (id)initWithThemeDocument:(id)arg1;

@end

@interface TDThemeSize : TDThemeConstant
{
}

@end

@interface TDThemeState : TDThemeConstant
{
}

@end

@interface TDThemeUISizeClass : TDThemeConstant
{
}

@end

@interface TDThemeValue : TDThemeConstant
{
}

@end

@interface TDThreadMOCOrganizer : NSObject
{
    NSThread *mainThread;
    CoreThemeDocument *document;
}

- (id)initWithDocument:(id)arg1 mainThread:(id)arg2;
- (id)init;
- (id)threadMOC;
- (id)mainMOC;
- (id)document;
- (id)mainThread;
- (void)setThreadMOC:(id)arg1;

@end


text:
package com.google.errorprone.bugpatterns.time;

import static com.google.errorprone.BugPattern.SeverityLevel.WARNING;
import static com.google.errorprone.fixes.SuggestedFixes.qualifyType;
import static com.google.errorprone.util.ASTHelpers.getStartPosition;

import com.google.common.collect.Iterables;
import com.google.errorprone.BugPattern;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher;
import com.google.errorprone.fixes.SuggestedFix;
import com.google.errorprone.matchers.Description;
import com.google.errorprone.matchers.Matcher;
import com.google.errorprone.matchers.Matchers;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.MethodInvocationTree;

/** Check for calls to {@code instant.withMillis(long)}. */
@BugPattern(
    summary =
        "Use of instant.withMillis(long) is not allowed. Use Instant.ofEpochMilli(long) instead.",
    explanation =
        "Joda-Time's 'instant.withMillis(long)' method is often a source of bugs because it "
            + "doesn't mutate the current instance but rather returns a new immutable Instant "
            + "instance. Please use Instant.ofEpochMilli(long) instead.",
    severity = WARNING)
public final class JodaInstantWithMillis extends BugChecker implements MethodInvocationTreeMatcher {
  private static final Matcher<ExpressionTree> MATCHER =
      Matchers.allOf(
          Matchers.instanceMethod()
              .onExactClass("org.joda.time.Instant")
              .named("withMillis")
              .withParameters("long"),
          // Allow usage by JodaTime itself
          Matchers.not(Matchers.packageStartsWith("org.joda.time")));

  @Override
  public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
    if (!MATCHER.matches(tree, state)) {
      return Description.NO_MATCH;
    }

    SuggestedFix.Builder builder = SuggestedFix.builder();
    String replacement = qualifyType(state, builder, "org.joda.time.Instant") + ".ofEpochMilli(";
    ExpressionTree millisArg = Iterables.getOnlyElement(tree.getArguments());

    builder.replace(getStartPosition(tree), getStartPosition(millisArg), replacement);
    return describeMatch(tree, builder.build());
  }
}


text:
'use strict';

describe('Directive: draggable', function () {

  // load the directive's module
  beforeEach(module('iLayers'));

  var directive, isoScope, element, main, footer, window;

  beforeEach(inject(function ($compile, $rootScope, $window) {
    var scope = $rootScope.$new(),
        elem = angular.element("
<draggable></draggable>
");

    window = $window;
    directive = $compile(elem)(scope);
    scope.$digest();
    element = elem.find('.draggable');
    main = elem.find('main');
    footer = elem.find('footer#journal-wrapper');
    isoScope = element.isolateScope();
  }));

  it('should add class "dragging" on mousedown', function() {
    expect(element.hasClass('dragging')).toBeFalsy();
    element.find('.drag-handle').triggerHandler('mousedown');
    expect(element.hasClass('dragging')).toBeTruthy();
  });

  it('should remove class "dragging" on mouseup', function() {
    element.addClass('dragging');
    $('body').triggerHandler('mouseup');
    expect(element.hasClass('dragging')).toBeFalsy();
  });

  describe('when mousemove', function() {
    beforeEach(function() {
      window.innerHeight = 1000;
      spyOn(isoScope, 'updatePosition');
    });

    it('should do nothing if not "dragging"', function() {
      $('body').triggerHandler({
        type : 'mousemove',
        pageX: 0,
        pageY: 500
      });

      expect(isoScope.updatePosition).not.toHaveBeenCalled();
    });

    it('should set main and footer size when "dragging"', function() {
      element.addClass('dragging');

      $('body').triggerHandler({
        type : 'mousemove',
        pageX: 0,
        pageY: 500
      });

      expect(isoScope.updatePosition).toHaveBeenCalledWith(500);
    });
  });
});


text:
layout: post
date: 2004-12-30
time: "09:00:00"
authors: ["Greg Wilson"]
title: "Python Software Foundation Grant"
tags: ["Grants"]
---

Greg Wilson has been awared a grant from the Python Software Foundation to revamp his course on "Software Engineering for Scientists and Engineers", and put it under an open license, so that it can be used at other institutions.  W00t!


text:
import time
import pytest
from _pytest._code.code import TerminalRepr, ExceptionInfo

class RecordFailure:
    """Mock pytest internal reporter to emulate CallInfo.

    Creates a class that can be safely passed into
    pytest_runtest_makereport to add failure report based on an
    arbitrary exception.
    """
    def __init__(self, exception, when="setup"):
        self.when = when
        self.start = time.time()
        self.stop = time.time()

        # We need to generate a traceback to continue. ExceptionInfo
        # calls sys.exc_info() internally
        try:
            raise exception
        except Exception:
            self.excinfo = ExceptionInfo()

class PytestException(Exception):
    @classmethod
    def makereport(cls, item, *args, **kwargs):
        when = kwargs.pop('when', 'setup')
        call = RecordFailure(cls(*args, **kwargs), when=when)
        hook = item.ihook
        report = hook.pytest_runtest_makereport(item=item, call=call)
        hook.pytest_runtest_logreport(report=report)

class ExceptionRepr(TerminalRepr):
    def __init__(self, excinfo, longrepr):
        self.excinfo = excinfo
        self.longrepr = longrepr

    def toterminal(self, tw):
        try:
            self.excinfo.value.toterminal(self.longrepr, tw)
        except AttributeError:
            self.longrepr.toterminal(tw)

    def terminal_summary(self, terminalreporter, header):
        try:
            header = self.excinfo.value.summary_header(header)
        except AttributeError:
            pass

        _, _, word = self.excinfo.value.__teststatus__
        terminalreporter.write_sep('_', header, **word[1])
        self.toterminal(terminalreporter._tw)

def pytest_namespace():
    return {'Exception': PytestException}

@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
    outcome = yield
    report = outcome.get_result()
    if call.excinfo and call.excinfo.errisinstance(PytestException):
        report.excinfo = call.excinfo
        report.longrepr = ExceptionRepr(report.excinfo,
                                        report.longrepr)

def pytest_report_teststatus(report):
    if hasattr(report, 'excinfo'):
        return getattr(report.excinfo.value, '__teststatus__', None)

def pytest_terminal_summary(terminalreporter):
    categories = set()
    for cls in PytestException.__subclasses__():
        teststatus = getattr(cls, '__teststatus__', None)
        if teststatus:
            categories.add(teststatus[0])

    for cat in categories:
        for report in terminalreporter.getreports(cat):
            header = terminalreporter._getfailureheadline(report)
            report.longrepr.terminal_summary(terminalreporter, header)


text:
package search

import (
	"github.com/amirblum/SynergyAI/model"
	"math/rand"
	//    "fmt"
)

type SearchAlgorithm interface {
	SearchTeam(*model.World, model.Task) *model.Team
}

// An iterator that returns successors sequentially
func IncrementalSuccessorIterator(team *model.Team, allWorkers []model.Worker) (func() (*model.Team, bool), bool) {
	return successorIterator(team, allWorkers, incrementalIterator(len(allWorkers)+team.Length()))
}

func incrementalIterator(incrementRange int) func(int) (int, bool) {
	return func(num int) (int, bool) {
		num++
		return num, num < incrementRange-1
	}
}

// An iterator that returns a random successor
func RandomSuccessorIterator(team *model.Team, allWorkers []model.Worker) (func() (*model.Team, bool), bool) {
	return successorIterator(team, allWorkers, randomIterator(len(allWorkers)+team.Length()))
}

func randomIterator(incrementRange int) func(int) (int, bool) {
	permutation := rand.Perm(incrementRange)
	//    fmt.Println(permutation)
	current := -1
	return func(num int) (int, bool) {
		current++
		return permutation[current], current < incrementRange-1
	}
}

// Iterator producing the successors of a given teamNode.
// First add all the workers (that are not in the team) one by one
// Then remove the workers in the team on by one
func successorIterator(node *model.Team, allWorkers []model.Worker, indexIterator func(int) (int, bool)) (func() (*model.Team, bool), bool) {
	// Init iterator
	nextWorker, nextHasNext := findNextIndex(indexIterator, -1, allWorkers, node)

	return func() (*model.Team, bool) {
		currentWorker := nextWorker
		hasNext := nextHasNext

		if nextHasNext {
			nextWorker, nextHasNext = findNextIndex(indexIterator, nextWorker, allWorkers, node)
		}

		// Copy the team
		newTeam := node.Copy()

		// If there are more workers to add, add
		if currentWorker < len(allWorkers) {
			if node.WorkerMap[currentWorker] == true {
				return newTeam, hasNext
			}

			//            fmt.Println("To team:\n", node, "\nAdding worker", currentWorker, "hasNext", hasNext, "nextHasNext:", nextHasNext)
			newTeam.Workers = append(newTeam.Workers, allWorkers[currentWorker])
			newTeam.WorkerMap[allWorkers[currentWorker].ID] = true

			return newTeam, hasNext
		}

		// Finished returning teams with added workers, start removing workers
		idToRemove := currentWorker - len(allWorkers)
		workerToRemove := newTeam.Workers[idToRemove]
		newTeam.Workers = append(newTeam.Workers[:idToRemove], newTeam.Workers[idToRemove+1:]...)
		newTeam.WorkerMap[workerToRemove.ID] = false

		//        fmt.Println("To team:\n", node, "\nRemoving worker", workerToRemove, "hasNext", hasNext, "nextHasNext:", nextHasNext)

		return newTeam, hasNext

	}, nextHasNext
}

func findNextIndex(indexIterator func(int) (int, bool), currentIndex int, allWorkers []model.Worker, node *model.Team) (int, bool) {
	nextIndex, hasNext := indexIterator(currentIndex)

	// Find next worker that is not in the team
	for nextIndex <= len(allWorkers) && node.WorkerMap[nextIndex] == true && hasNext {
		nextIndex, hasNext = indexIterator(nextIndex)
	}

	return nextIndex, hasNext
}


text:
function popAndUpdate() {
    var doneRequest = new Request({
            'url': '/done',
            'method': 'POST',
            'data': 'done',
            });
    var nextRequest = new Request.JSON({
            'url': '/now.json',
            'method': 'GET',
            });
    nextRequest.addEvent('success', function (text) {
            $("theThing").set('text', text);
            });
    doneRequest.addEvent('complete', function () {
            nextRequest.send();
            });

    doneRequest.send();
}

function showDoneButton() {
    var doneButton = new Element('p', {
            'id': 'theDoneButton',
            'html': 'done.',
            'events': {
                'click': function () {
                    popAndUpdate();
                    hideDoneButton();
                },
                'mouseout': function () {
                    hideDoneButton();
                },
            },
            'styles': {
                'font-size': $('theThing').getStyle('height'),
                'height': $('theThing').getStyle('height'),
                'width': $('theThing').getStyle('width'),
            },
            'tween': {duration: 200},
        });
    doneButton.fade('hide');
    doneButton.setPosition($('theThing').getPosition());
    doneButton.inject($('box'), 'bottom');
    doneButton.fade(0.95);
}

function hideDoneButton() {
    $('theDoneButton').get('tween', {
        duration: 300,
        property: 'opacity',
    }).addEvent('complete', function(){$('theDoneButton').destroy();}).start(0);
}

window.addEvent('domready', function () {
        $("theThing").addEvent('mouseover', showDoneButton);
        });


text:
<?php
namespace CarnegieLearning\LdapOrmBundle\Entity\Ldap;

use CarnegieLearning\LdapOrmBundle\Annotation\Ldap\Attribute;
use CarnegieLearning\LdapOrmBundle\Annotation\Ldap\ObjectClass;

/**
 * Class to represent a person within EDS ou=people,dc=example,dc=com
 *
 * @author jgabler
 * @author Ronald Chaplin <rchaplin@t73.biz>
 *
 * @ObjectClass("organizationalUnit")
 *
 * @codeCoverageIgnore
 */
class OrganizationalUnit extends LdapEntity {
    /**
     * @Attribute("businessCategory")
     * @var string
     */
    protected $businessCategory;

    /**
     * @Attribute("description")
     * @var string
     */
    protected $description;

    /**
     * @Attribute("destinationIndicator")
     * @var string
     */
    protected $destinationIndicator;

    /**
     * @Attribute("facsimileTelephoneNumber")
     * @var string
     */
    protected $facsimileTelephoneNumber;

    /**
     * @Attribute("internationaliSDNNumber")
     * @var string
     */
    protected $internationaliSDNNumber;

    /**
     * @Attribute("l")
     * @var string
     */
    protected $l;

    /**
     * @Attribute("physicalDeliveryOfficeName")
     * @var string
     */
    protected $physicalDeliveryOfficeName;

    /**
     * @Attribute("postalAddress")
     * @var string
     */
    protected $postalAddress;

    /**
     * @Attribute("postalCode")
     * @var string
     */
    protected $postalCode;

    /**
     * @Attribute("postOfficeBox")
     * @var string
     */
    protected $postOfficeBox;

    /**
     * @Attribute("preferredDeliveryMethod")
     * @var string
     */
    protected $preferredDeliveryMethod;

    /**
     * @Attribute("registeredAddress")
     * @var string
     */
    protected $registeredAddress;

    /**
     * @Attribute("searchGuide")
     * @var string
     */
    protected $searchGuide;

    /**
     * @Attribute("seeAlso")
     * @var string
     */
    protected $seeAlso;

    /**
     * @Attribute("ou")
     * A MUST attribute
     * @var string
     */
    protected $ou;

    /**
     * @Attribute("st")
     * @var string
     */
    protected $st;

    /**
     * @Attribute("street")
     * @var string
     */
    protected $street;

    /**
     * @Attribute("telephoneNumber")
     * @var string
     */
    protected $telephoneNumber;

    /**
     * @Attribute("teletexTerminalIdentifier")
     * @var string
     */
    protected $teletexTerminalIdentifier;

    /**
     * @Attribute("telexNumber")
     * @var string
     */
    protected $telexNumber;

    /**
     * @Attribute("userPassword")
     * @var string
     */
    protected $userPassword;

    /**
     * @Attribute("x121Address")
     * @var string
     */
    protected $x121Address;

    /**
     * @return string
     */
    function getBusinessCategory() {
        return $this->businessCategory;
    }

    /**
     * @return string
     */
    function getDescription() {
        return $this->description;
    }

    /**
     * @return string
     */
    function getDestinationIndicator() {
        return $this->destinationIndicator;
    }

    /**
     * @return string
     */
    function getFacsimileTelephoneNumber() {
        return $this->facsimileTelephoneNumber;
    }

    /**
     * @return string
     */
    function getInternationaliSDNNumber() {
        return $this->internationaliSDNNumber;
    }

    /**
     * @return string
     */
    function getL() {
        return $this->l;
    }

    /**
     * @return string
     */
    function getPhysicalDeliveryOfficeName() {
        return $this->physicalDeliveryOfficeName;
    }

    /**
     * @return string
     */
    function getPostalAddress() {
        return $this->postalAddress;
    }

    /**
     * @return string
     */
    function getPostalCode() {
        return $this->postalCode;
    }

    /**
     * @return string
     */
    function getPostOfficeBox() {
        return $this->postOfficeBox;
    }

    /**
     * @return string
     */
    function getPreferredDeliveryMethod() {
        return $this->preferredDeliveryMethod;
    }

    /**
     * @return string
     */
    function getRegisteredAddress() {
        return $this->registeredAddress;
    }

    /**
     * @return string
     */
    function getSearchGuide() {
        return $this->searchGuide;
    }

    /**
     * @return string
     */
    function getSeeAlso() {
        return $this->seeAlso;
    }

    /**
     * @return string
     */
    function getOu() {
        return $this->ou;
    }

    /**
     * @return string
     */
    function getSt() {
        return $this->st;
    }

    /**
     * @return string
     */
    function getStreet() {
        return $this->street;
    }

    /**
     * @return string
     */
    function getTelephoneNumber() {
        return $this->telephoneNumber;
    }

    /**
     * @return string
     */
    function getTeletexTerminalIdentifier() {
        return $this->teletexTerminalIdentifier;
    }

    /**
     * @return string
     */
    function getTelexNumber() {
        return $this->telexNumber;
    }

    /**
     * @return string
     */
    function getUserPassword() {
        return $this->userPassword;
    }

    /**
     * @return string
     */
    function getX121Address() {
        return $this->x121Address;
    }

    /**
     * @param $businessCategory
     * @return OrganizationalUnit
     */
    function setBusinessCategory($businessCategory) {
        $this->businessCategory = $businessCategory;

        return $this;
    }

    /**
     * @param $description
     * @return OrganizationalUnit
     */
    function setDescription($description) {
        $this->description = $description;

        return $this;
    }

    /**
     * @param $destinationIndicator
     * @return OrganizationalUnit
     */
    function setDestinationIndicator($destinationIndicator) {
        $this->destinationIndicator = $destinationIndicator;

        return $this;
    }

    /**
     * @param $facsimileTelephoneNumber
     * @return OrganizationalUnit
     */
    function setFacsimileTelephoneNumber($facsimileTelephoneNumber) {
        $this->facsimileTelephoneNumber = $facsimileTelephoneNumber;

        return $this;
    }

    /**
     * @param $internationaliSDNNumber
     * @return OrganizationalUnit
     */
    function setInternationaliSDNNumber($internationaliSDNNumber) {
        $this->internationaliSDNNumber = $internationaliSDNNumber;

        return $this;
    }

    /**
     * @param $l
     * @return OrganizationalUnit
     */
    function setL($l) {
        $this->l = $l;

        return $this;
    }

    /**
     * @param $physicalDeliveryOfficeName
     * @return OrganizationalUnit
     */
    function setPhysicalDeliveryOfficeName($physicalDeliveryOfficeName) {
        $this->physicalDeliveryOfficeName = $physicalDeliveryOfficeName;

        return $this;
    }

    /**
     * @param $postalAddress
     * @return OrganizationalUnit
     */
    function setPostalAddress($postalAddress) {
        $this->postalAddress = $postalAddress;

        return $this;
    }

    /**
     * @param $postalCode
     * @return OrganizationalUnit
     */
    function setPostalCode($postalCode) {
        $this->postalCode = $postalCode;

        return $this;
    }

    /**
     * @param $postOfficeBox
     * @return OrganizationalUnit
     */
    function setPostOfficeBox($postOfficeBox) {
        $this->postOfficeBox = $postOfficeBox;

        return $this;
    }

    /**
     * @param $preferredDeliveryMethod
     * @return OrganizationalUnit
     */
    function setPreferredDeliveryMethod($preferredDeliveryMethod) {
        $this->preferredDeliveryMethod = $preferredDeliveryMethod;

        return $this;
    }

    /**
     * @param $registeredAddress
     * @return OrganizationalUnit
     */
    function setRegisteredAddress($registeredAddress) {
        $this->registeredAddress = $registeredAddress;

        return $this;
    }

    /**
     * @param $searchGuide
     * @return OrganizationalUnit
     */
    function setSearchGuide($searchGuide) {
        $this->searchGuide = $searchGuide;

        return $this;
    }

    /**
     * @param $seeAlso
     * @return OrganizationalUnit
     */
    function setSeeAlso($seeAlso) {
        $this->seeAlso = $seeAlso;

        return $this;
    }

    /**
     * @param $ou
     * @return OrganizationalUnit
     */
    function setOu($ou) {
        $this->ou = $ou;

        return $this;
    }

    /**
     * @param $st
     * @return OrganizationalUnit
     */
    function setSt($st) {
        $this->st = $st;

        return $this;
    }

    /**
     * @param $street
     * @return OrganizationalUnit
     */
    function setStreet($street) {
        $this->street = $street;

        return $this;
    }

    /**
     * @param $telephoneNumber
     * @return OrganizationalUnit
     */
    function setTelephoneNumber($telephoneNumber) {
        $this->telephoneNumber = $telephoneNumber;

        return $this;
    }

    /**
     * @param $teletexTerminalIdentifier
     * @return OrganizationalUnit
     */
    function setTeletexTerminalIdentifier($teletexTerminalIdentifier) {
        $this->teletexTerminalIdentifier = $teletexTerminalIdentifier;

        return $this;
    }

    /**
     * @param $telexNumber
     * @return OrganizationalUnit
     */
    function setTelexNumber($telexNumber) {
        $this->telexNumber = $telexNumber;

        return $this;
    }

    /**
     * @param $userPassword
     * @return OrganizationalUnit
     */
    function setUserPassword($userPassword) {
        $this->userPassword = $userPassword;

        return $this;
    }

    /**
     * @param $x121Address
     * @return OrganizationalUnit
     */
    function setX121Address($x121Address) {
        $this->x121Address = $x121Address;

        return $this;
    }
}