text:
package parser

import (
	"fmt"
	"io/ioutil"
	"reflect"
	"strings"
	"testing"

	"github.com/graphql-go/graphql/gqlerrors"
	"github.com/graphql-go/graphql/language/ast"
	"github.com/graphql-go/graphql/language/location"
	"github.com/graphql-go/graphql/language/source"
)

func TestBadToken(t *testing.T) {
	_, err := Parse(ParseParams{
		Source: &source.Source{
			Body: "query _ {\n  me {\n    id`\n  }\n}",
			Name: "GraphQL",
		},
	})
	if err == nil {
		t.Fatal("expected a parse error")
	}
}

func TestAcceptsOptionToNotIncludeSource(t *testing.T) {
	opts := ParseOptions{
		NoSource: true,
	}
	params := ParseParams{
		Source:  "{ field }",
		Options: opts,
	}
	document, err := Parse(params)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	oDef := ast.OperationDefinition{
		Kind: "OperationDefinition",
		Loc: &ast.Location{
			Start: 0, End: 9,
		},
		Operation:  "query",
		Directives: []*ast.Directive{},
		SelectionSet: &ast.SelectionSet{
			Kind: "SelectionSet",
			Loc: &ast.Location{
				Start: 0, End: 9,
			},
			Selections: []ast.Selection{
				&ast.Field{
					Kind: "Field",
					Loc: &ast.Location{
						Start: 2, End: 7,
					},
					Name: &ast.Name{
						Kind: "Name",
						Loc: &ast.Location{
							Start: 2, End: 7,
						},
						Value: "field",
					},
					Arguments:  []*ast.Argument{},
					Directives: []*ast.Directive{},
				},
			},
		},
	}
	expectedDocument := ast.NewDocument(&ast.Document{
		Loc: &ast.Location{
			Start: 0, End: 9,
		},
		Definitions: []ast.Node{&oDef},
	})
	if !reflect.DeepEqual(document, expectedDocument) {
		t.Fatalf("unexpected document, expected: %v, got: %v", expectedDocument, document)
	}
}

func TestParseProvidesUsefulErrors(t *testing.T) {
	opts := ParseOptions{
		NoSource: true,
	}
	params := ParseParams{
		Source:  "{",
		Options: opts,
	}
	_, err := Parse(params)

	expectedError := &gqlerrors.Error{
		Message: `Syntax Error GraphQL (1:2) Expected Name, found EOF

1: {
    ^
`,
		Positions: []int{1},
		Locations: []location.SourceLocation{{1, 2}},
	}
	checkError(t, err, expectedError)

	testErrorMessagesTable := []errorMessageTest{
		{
			`{ ...MissingOn }
fragment MissingOn Type
`,
			`Syntax Error GraphQL (2:20) Expected "on", found Name "Type"`,
			false,
		},
		{
			`{ field: {} }`,
			`Syntax Error GraphQL (1:10) Expected Name, found {`,
			false,
		},
		{
			`notanoperation Foo { field }`,
			`Syntax Error GraphQL (1:1) Unexpected Name "notanoperation"`,
			false,
		},
		{
			"...",
			`Syntax Error GraphQL (1:1) Unexpected ...`,
			false,
		},
	}
	for _, test := range testErrorMessagesTable {
		if test.skipped != false {
			t.Skipf("Skipped test: %v", test.source)
		}
		_, err := Parse(ParseParams{Source: test.source})
		checkErrorMessage(t, err, test.expectedMessage)
	}

}

func TestParseProvidesUsefulErrorsWhenUsingSource(t *testing.T) {
	test := errorMessageTest{
		source.NewSource(&source.Source{Body: "query", Name: "MyQuery.graphql"}),
		`Syntax Error MyQuery.graphql (1:6) Expected Name, found EOF`,
		false,
	}
	testErrorMessage(t, test)
}

func TestParsesVariableInlineValues(t *testing.T) {
	source := `{ field(complex: { a: { b: [ $var ] } }) }`
	// should not return error
	_, err := Parse(ParseParams{Source: source})
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
}

func TestParsesConstantDefaultValues(t *testing.T) {
	test := errorMessageTest{
		`query Foo($x: Complex = { a: { b: [ $var ] } }) { field }`,
		`Syntax Error GraphQL (1:37) Unexpected $`,
		false,
	}
	testErrorMessage(t, test)
}

func TestDuplicatedKeysInInputObject(t *testing.T) {
	test := errorMessageTest{
		`{ field(arg: { a: 1, a: 2 }) }'`,
		`Syntax Error GraphQL (1:22) Duplicate input object field a.`,
		false,
	}
	testErrorMessage(t, test)
}

func TestDoesNotAcceptFragmentsNameOn(t *testing.T) {
	test := errorMessageTest{
		`fragment on on on { on }`,
		`Syntax Error GraphQL (1:10) Unexpected Name "on"`,
		false,
	}
	testErrorMessage(t, test)
}

func TestDoesNotAcceptFragmentsSpreadOfOn(t *testing.T) {
	test := errorMessageTest{
		`{ ...on }'`,
		`Syntax Error GraphQL (1:9) Expected Name, found }`,
		false,
	}
	testErrorMessage(t, test)
}

func TestDoesNotAllowNullAsValue(t *testing.T) {
	test := errorMessageTest{
		`{ fieldWithNullableStringInput(input: null) }'`,
		`Syntax Error GraphQL (1:39) Unexpected Name "null"`,
		false,
	}
	testErrorMessage(t, test)
}

func TestParsesKitchenSink(t *testing.T) {
	b, err := ioutil.ReadFile("../../kitchen-sink.graphql")
	if err != nil {
		t.Fatalf("unable to load kitchen-sink.graphql")
	}
	source := string(b)
	_, err = Parse(ParseParams{Source: source})
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
}

func TestAllowsNonKeywordsAnywhereNameIsAllowed(t *testing.T) {
	nonKeywords := []string{
		"on",
		"fragment",
		"query",
		"mutation",
		"true",
		"false",
	}
	for _, keyword := range nonKeywords {
		fragmentName := keyword
		// You can't define or reference a fragment named `on`.
		if keyword == "on" {
			fragmentName = "a"
		}
		source := fmt.Sprintf(`query %v {
			... %v
			... on %v { field }
		}
		fragment %v on Type {
		%v(%v: $%v) @%v(%v: $%v)
		}
		`, keyword, fragmentName, keyword, fragmentName, keyword, keyword, keyword, keyword, keyword, keyword)
		_, err := Parse(ParseParams{Source: source})
		if err != nil {
			t.Fatalf("unexpected error: %v", err)
		}
	}
}

func TestParsesExperimentalSubscriptionFeature(t *testing.T) {
	source := `
      subscription Foo {
        subscriptionField
      }
    `
	_, err := Parse(ParseParams{Source: source})
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
}

func TestParseCreatesAst(t *testing.T) {
	body := `{
  node(id: 4) {
    id,
    name
  }
}
`
	source := source.NewSource(&source.Source{Body: body})
	document, err := Parse(
		ParseParams{
			Source: source,
			Options: ParseOptions{
				NoSource: true,
			},
		},
	)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	oDef := ast.OperationDefinition{
		Kind: "OperationDefinition",
		Loc: &ast.Location{
			Start: 0, End: 40,
		},
		Operation:  "query",
		Directives: []*ast.Directive{},
		SelectionSet: &ast.SelectionSet{
			Kind: "SelectionSet",
			Loc: &ast.Location{
				Start: 0, End: 40,
			},
			Selections: []ast.Selection{
				&ast.Field{
					Kind: "Field",
					Loc: &ast.Location{
						Start: 4, End: 38,
					},
					Name: &ast.Name{
						Kind: "Name",
						Loc: &ast.Location{
							Start: 4, End: 8,
						},
						Value: "node",
					},
					Arguments: []*ast.Argument{
						{
							Kind: "Argument",
							Name: &ast.Name{
								Kind: "Name",
								Loc: &ast.Location{
									Start: 9, End: 11,
								},
								Value: "id",
							},
							Value: &ast.IntValue{
								Kind: "IntValue",
								Loc: &ast.Location{
									Start: 13, End: 14,
								},
								Value: "4",
							},
							Loc: &ast.Location{
								Start: 9, End: 14,
							},
						},
					},
					Directives: []*ast.Directive{},
					SelectionSet: &ast.SelectionSet{
						Kind: "SelectionSet",
						Loc: &ast.Location{
							Start: 16, End: 38,
						},
						Selections: []ast.Selection{
							&ast.Field{
								Kind: "Field",
								Loc: &ast.Location{
									Start: 22, End: 24,
								},
								Name: &ast.Name{
									Kind: "Name",
									Loc: &ast.Location{
										Start: 22, End: 24,
									},
									Value: "id",
								},
								Arguments:    []*ast.Argument{},
								Directives:   []*ast.Directive{},
								SelectionSet: nil,
							},
							&ast.Field{
								Kind: "Field",
								Loc: &ast.Location{
									Start: 30, End: 34,
								},
								Name: &ast.Name{
									Kind: "Name",
									Loc: &ast.Location{
										Start: 30, End: 34,
									},
									Value: "name",
								},
								Arguments:    []*ast.Argument{},
								Directives:   []*ast.Directive{},
								SelectionSet: nil,
							},
						},
					},
				},
			},
		},
	}
	expectedDocument := ast.NewDocument(&ast.Document{
		Loc: &ast.Location{
			Start: 0, End: 41,
		},
		Definitions: []ast.Node{&oDef},
	})
	if !reflect.DeepEqual(document, expectedDocument) {
		t.Fatalf("unexpected document, expected: %v, got: %v", expectedDocument, document.Definitions)
	}

}

type errorMessageTest struct {
	source          interface{}
	expectedMessage string
	skipped         bool
}

func testErrorMessage(t *testing.T, test errorMessageTest) {
	if test.skipped != false {
		t.Skipf("Skipped test: %v", test.source)
	}
	_, err := Parse(ParseParams{Source: test.source})
	checkErrorMessage(t, err, test.expectedMessage)
}

func checkError(t *testing.T, err error, expectedError *gqlerrors.Error) {
	if expectedError == nil {
		if err != nil {
			t.Fatalf("unexpected error: %v", err)
		}
		return // ok
	}
	// else expectedError != nil
	if err == nil {
		t.Fatalf("unexpected nil error\nexpected:\n%v\n\ngot:\n%v", expectedError, err)
	}
	if err.Error() != expectedError.Message {
		t.Fatalf("unexpected error.\nexpected:\n%v\n\ngot:\n%v", expectedError, err.Error())
	}
	gErr := toError(err)
	if gErr == nil {
		t.Fatalf("unexpected nil Error")
	}
	if len(expectedError.Positions) > 0 && !reflect.DeepEqual(gErr.Positions, expectedError.Positions) {
		t.Fatalf("unexpected Error.Positions.\nexpected:\n%v\n\ngot:\n%v", expectedError.Positions, gErr.Positions)
	}
	if len(expectedError.Locations) > 0 && !reflect.DeepEqual(gErr.Locations, expectedError.Locations) {
		t.Fatalf("unexpected Error.Locations.\nexpected:\n%v\n\ngot:\n%v", expectedError.Locations, gErr.Locations)
	}
}

func checkErrorMessage(t *testing.T, err error, expectedMessage string) {
	if err == nil {
		t.Fatalf("unexpected nil error\nexpected:\n%v\n\ngot:\n%v", expectedMessage, err)
	}
	if err.Error() != expectedMessage {
		// only check first line of error message
		lines := strings.Split(err.Error(), "\n")
		if lines[0] != expectedMessage {
			t.Fatalf("unexpected error.\nexpected:\n%v\n\ngot:\n%v", expectedMessage, lines[0])
		}
	}
}

func toError(err error) *gqlerrors.Error {
	if err == nil {
		return nil
	}
	switch err := err.(type) {
	case *gqlerrors.Error:
		return err
	default:
		return nil
	}
}

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;
using System.Xml.Linq;
using NUnit.Framework;
using Testura.Android.Device.Ui.Nodes;
using Testura.Android.Device.Ui.Nodes.Data;
using Testura.Android.Device.Ui.Search;

namespace Testura.Android.Tests.Device.UiAutomator.Ui.Util
{
    [TestFixture]
    public class NodeFinderTests
    {
        private NodeFinder _nodeFinder;
        private IList<Node> _nodes;

        [SetUp]
        public void SetUp()
        {
            _nodes = new List<Node>
            {
                new Node(new XElement("node", new XAttribute("package", "myPackage")), null),
                new Node(new XElement("node", new XAttribute("index", 1)), null),
                new Node(new XElement("node", new XAttribute("text", "Buss")), null),
                new Node(new XElement("node", new XAttribute("resource-id", "android:id/search_src_text")), null),
                new Node(new XElement("node", new XAttribute("content-desc", "Number_ListItem_Container")), null),
                new Node(new XElement("node", new XAttribute("text", "Buss"), new XAttribute("class", "android.widget.TextView")), new Node(new XElement("node", new XAttribute("class", "android.support.v7.app.ActionBar$Tab")), null)),
                new Node(new XElement("node", new XAttribute("content-desc", "Number_ListItem")), null),
                new Node(new XElement("node", new XAttribute("content-desc", "Number_ListItem")), null)
            };
            _nodeFinder = new NodeFinder();
        }

        [Test]
        public void NodeChecker_WhenGettingNodeThatDontExist_ShouldReturnEmptyList()
        {
            Assert.IsEmpty(_nodeFinder.FindNodes(_nodes, new[] { Where.Text("fdsfsdf") }));
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithText_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.Text("Buss") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("Buss", foundNode.Text);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithTextAndWildcard_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.Text($"B{Where.Wildcard}s") }, "us");
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("Buss", foundNode.Text);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithResourceId_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.ResourceId("android:id/search_src_text") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("android:id/search_src_text", foundNode.ResourceId);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithContentDesc_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.ContentDesc("Number_ListItem_Container") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("Number_ListItem_Container", foundNode.ContentDesc);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithClass_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.Class("android.widget.TextView") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("android.widget.TextView", foundNode.Class);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithIndex_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.Index("1") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("1", foundNode.Index);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithPackage_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[] { Where.Package("myPackage") });
            Assert.IsNotNull(foundNode);
            Assert.AreEqual("myPackage", foundNode.Package);
        }

        [Test]
        public void NodeChecker_WhenGettingNodeWithLamba_ShouldReturnNode()
        {
            var foundNode = _nodeFinder.FindNode(_nodes, new[]
            {
                Where.Lambda((node, w) =>
                    node.Text == "Buss" &&
                    node.Class == "android.widget.TextView" &&
                    node.Parent.Class == "android.support.v7.app.ActionBar$Tab")
            });
            Assert.IsNotNull(foundNode);
        }

        [Test]
        public void NodeChecker_WhenGettingMultipleNodes_ShouldReturnAllMatchingNodes()
        {
            var nodes = _nodeFinder.FindNodes(_nodes, new[] { Where.Lambda((n, w) => n.ContentDesc == "Number_ListItem") });
            Assert.AreEqual(2, nodes.Count);
        }
    }
}


text:
namespace {

// String we will use to convert mime type to plugin type.
const char kWindowsMediaPlayerType[] = "application/x-mplayer2";
const char kSilverlightTypePrefix[] = "application/x-silverlight";
const char kRealPlayerTypePrefix[] = "audio/x-pn-realaudio";
const char kJavaTypeSubstring[] = "application/x-java-applet";
const char kQuickTimeType[] = "video/quicktime";

// Arrays containing file extensions connected with specific plugins.
// Note: THE ARRAYS MUST BE SORTED BECAUSE BINARY SEARCH IS USED ON THEM!
const char* const kWindowsMediaPlayerExtensions[] = {".asx"};

const char* const kRealPlayerExtensions[] = {".ra",  ".ram", ".rm",
                                             ".rmm", ".rmp", ".rpm"};

const char* const kQuickTimeExtensions[] = {".moov", ".mov", ".qif",
                                            ".qt",   ".qti", ".qtif"};

const char* const kShockwaveFlashExtensions[] = {".spl", ".swf"};

}  // namespace.

class UMASenderImpl : public PluginUMAReporter::UMASender {
  void SendPluginUMA(PluginUMAReporter::ReportType report_type,
                     PluginUMAReporter::PluginType plugin_type) override;
};

void UMASenderImpl::SendPluginUMA(PluginUMAReporter::ReportType report_type,
                                  PluginUMAReporter::PluginType plugin_type) {
  // UMA_HISTOGRAM_ENUMERATION requires constant histogram name. Use string
  // constants explicitly instead of trying to use variables for names.
  switch (report_type) {
    case PluginUMAReporter::MISSING_PLUGIN:
      UMA_HISTOGRAM_ENUMERATION("Plugin.MissingPlugins",
                                plugin_type,
                                PluginUMAReporter::PLUGIN_TYPE_MAX);
      break;
    case PluginUMAReporter::DISABLED_PLUGIN:
      UMA_HISTOGRAM_ENUMERATION("Plugin.DisabledPlugins",
                                plugin_type,
                                PluginUMAReporter::PLUGIN_TYPE_MAX);
      break;
    default:
      NOTREACHED();
  }
}

// static.
PluginUMAReporter* PluginUMAReporter::GetInstance() {
  return base::Singleton<PluginUMAReporter>::get();
}

void PluginUMAReporter::ReportPluginMissing(const std::string& plugin_mime_type,
                                            const GURL& plugin_src) {
  report_sender_->SendPluginUMA(MISSING_PLUGIN,
                                GetPluginType(plugin_mime_type, plugin_src));
}

void PluginUMAReporter::ReportPluginDisabled(
    const std::string& plugin_mime_type,
    const GURL& plugin_src) {
  report_sender_->SendPluginUMA(DISABLED_PLUGIN,
                                GetPluginType(plugin_mime_type, plugin_src));
}

PluginUMAReporter::PluginUMAReporter() : report_sender_(new UMASenderImpl()) {}

PluginUMAReporter::~PluginUMAReporter() {}

// static.
bool PluginUMAReporter::CompareCStrings(const char* first, const char* second) {
  return strcmp(first, second) < 0;
}

bool PluginUMAReporter::CStringArrayContainsCString(const char* const* array,
                                                    size_t array_size,
                                                    const char* str) {
  return std::binary_search(array, array + array_size, str, CompareCStrings);
}

void PluginUMAReporter::ExtractFileExtension(const GURL& src,
                                             std::string* extension) {
  std::string extension_file_path(src.ExtractFileName());
  if (extension_file_path.empty())
    extension_file_path = src.host();

  size_t last_dot = extension_file_path.find_last_of('.');
  if (last_dot != std::string::npos) {
    *extension = extension_file_path.substr(last_dot);
  } else {
    extension->clear();
  }

  *extension = base::ToLowerASCII(*extension);
}

PluginUMAReporter::PluginType PluginUMAReporter::GetPluginType(
    const std::string& plugin_mime_type,
    const GURL& plugin_src) {
  // If we know plugin's mime type, we use it to determine plugin's type. Else,
  // we try to determine plugin type using plugin source's extension.
  if (!plugin_mime_type.empty())
    return MimeTypeToPluginType(base::ToLowerASCII(plugin_mime_type));

  return SrcToPluginType(plugin_src);
}

PluginUMAReporter::PluginType PluginUMAReporter::SrcToPluginType(
    const GURL& src) {
  std::string file_extension;
  ExtractFileExtension(src, &file_extension);
  if (CStringArrayContainsCString(kWindowsMediaPlayerExtensions,
                                  arraysize(kWindowsMediaPlayerExtensions),
                                  file_extension.c_str())) {
    return WINDOWS_MEDIA_PLAYER;
  }

  if (CStringArrayContainsCString(kQuickTimeExtensions,
                                  arraysize(kQuickTimeExtensions),
                                  file_extension.c_str())) {
    return QUICKTIME;
  }

  if (CStringArrayContainsCString(kRealPlayerExtensions,
                                  arraysize(kRealPlayerExtensions),
                                  file_extension.c_str())) {
    return REALPLAYER;
  }

  if (CStringArrayContainsCString(kShockwaveFlashExtensions,
                                  arraysize(kShockwaveFlashExtensions),
                                  file_extension.c_str())) {
    return SHOCKWAVE_FLASH;
  }

  return UNSUPPORTED_EXTENSION;
}

PluginUMAReporter::PluginType PluginUMAReporter::MimeTypeToPluginType(
    const std::string& mime_type) {
  if (mime_type == kWindowsMediaPlayerType)
    return WINDOWS_MEDIA_PLAYER;

  size_t prefix_length = strlen(kSilverlightTypePrefix);
  if (strncmp(mime_type.c_str(), kSilverlightTypePrefix, prefix_length) == 0)
    return SILVERLIGHT;

  prefix_length = strlen(kRealPlayerTypePrefix);
  if (strncmp(mime_type.c_str(), kRealPlayerTypePrefix, prefix_length) == 0)
    return REALPLAYER;

  if (strstr(mime_type.c_str(), kJavaTypeSubstring))
    return JAVA;

  if (mime_type == kQuickTimeType)
    return QUICKTIME;

  if (mime_type == content::kBrowserPluginMimeType)
    return BROWSER_PLUGIN;

  if (mime_type == content::kFlashPluginSwfMimeType ||
      mime_type == content::kFlashPluginSplMimeType) {
    return SHOCKWAVE_FLASH;
  }

#if BUILDFLAG(ENABLE_PEPPER_CDMS)
  if (mime_type == kWidevineCdmPluginMimeType)
    return WIDEVINE_CDM;
#endif

  return UNSUPPORTED_MIMETYPE;
}


text:
import io
import os

import setuptools

name = "google-cloud-dms"
description = "Cloud Database Migration Service client library"
version = "1.4.3"
release_status = "Development Status :: 5 - Production/Stable"
url = "https://github.com/googleapis/python-dms"
dependencies = [
    "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
    "proto-plus >= 1.22.0, <2.0.0dev",
    "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, "README.rst")
with io.open(readme_filename, encoding="utf-8") as readme_file:
    readme = readme_file.read()

packages = [
    package
    for package in setuptools.PEP420PackageFinder.find()
    if package.startswith("google")
]

namespaces = ["google"]
if "google.cloud" in packages:
    namespaces.append("google.cloud")

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author="Google LLC",
    author_email="googleapis-packages@google.com",
    license="Apache 2.0",
    url=url,
    classifiers=[
        release_status,
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Operating System :: OS Independent",
        "Topic :: Internet",
    ],
    platforms="Posix; MacOS X; Windows",
    packages=packages,
    python_requires=">=3.7",
    namespace_packages=namespaces,
    install_requires=dependencies,
    include_package_data=True,
    zip_safe=False,
)


text:
using System;
using System.Collections.Generic;

using Core.Bus;

namespace Core.Entities
{
    public class Entity
    {
        private readonly Dictionary<Type, Action<object>> _router;

        public Entity()
        {
            _router = new Dictionary<Type, Action<object>>();
        }

        public Guid Id { get; protected set; }

        public override bool Equals(object obj)
        {
            return Id.Equals(((Entity)obj).Id);
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode();
        }

        public void Register<TEvent>(Action<TEvent> handler) where TEvent : Event
        {
            if (!_router.TryGetValue(typeof(TEvent), out Action<object> handle))
            {
                _router.Add(typeof(TEvent), @event => handler((TEvent)@event));
            }
        }

        public void Route(object @event)
        {
            if (_router.TryGetValue(@event.GetType(), out Action<object> handler))
            {
                handler(@event);
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/content_holder"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:orientation="horizontal">
    <ImageView
        android:id="@+id/contact_image"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="20dp"
        android:gravity="center|left"
        android:orientation="vertical">

        <TextView
            android:id="@+id/contact_name"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:paddingBottom="1dp"
            android:paddingLeft="0dp"
            android:textColor="@color/material_grey_700"
            android:textSize="14sp"
            android:gravity="left|center"
            android:text="sadfsdfa"
            android:fontFamily="sans-serif" />

    </LinearLayout>

</LinearLayout>


text:
package sas

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// RebootMachine invokes the sas.RebootMachine API synchronously
func (client *Client) RebootMachine(request *RebootMachineRequest) (response *RebootMachineResponse, err error) {
	response = CreateRebootMachineResponse()
	err = client.DoAction(request, response)
	return
}

// RebootMachineWithChan invokes the sas.RebootMachine API asynchronously
func (client *Client) RebootMachineWithChan(request *RebootMachineRequest) (<-chan *RebootMachineResponse, <-chan error) {
	responseChan := make(chan *RebootMachineResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.RebootMachine(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// RebootMachineWithCallback invokes the sas.RebootMachine API asynchronously
func (client *Client) RebootMachineWithCallback(request *RebootMachineRequest, callback func(response *RebootMachineResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *RebootMachineResponse
		var err error
		defer close(result)
		response, err = client.RebootMachine(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// RebootMachineRequest is the request struct for api RebootMachine
type RebootMachineRequest struct {
	*requests.RpcRequest
	Uuid     string `position:"Query" name:"Uuid"`
	SourceIp string `position:"Query" name:"SourceIp"`
}

// RebootMachineResponse is the response struct for api RebootMachine
type RebootMachineResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
}

// CreateRebootMachineRequest creates a request to invoke RebootMachine API
func CreateRebootMachineRequest() (request *RebootMachineRequest) {
	request = &RebootMachineRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Sas", "2018-12-03", "RebootMachine", "sas", "openAPI")
	request.Method = requests.POST
	return
}

// CreateRebootMachineResponse creates a response to parse from RebootMachine response
func CreateRebootMachineResponse() (response *RebootMachineResponse) {
	response = &RebootMachineResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
import { TestBed, inject, async } from '@angular/core/testing';
import { DOCUMENT, By } from '@angular/platform-browser';
import { Component } from '@angular/core';
import { MdlIconToggleModule, MdlIconToggleComponent } from './mdl-icon-toggle.component';
import { FormsModule} from '@angular/forms';

describe('Component: MdlIconToggle', () => {

  var doc: HTMLDocument;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [FormsModule, MdlIconToggleModule],
      declarations: [ MdlTestIconToggleComponent ],
    });

  }));

  beforeEach(async(inject([DOCUMENT], function (document) {
    doc = document;
  })));

  it('should add the css class mdl-icon-toggle to the host element', () => {

    let fixture = TestBed.createComponent(MdlTestIconToggleComponent);
    fixture.detectChanges();

    let checkboxEl: HTMLElement = fixture.nativeElement.children.item(0);
    expect(checkboxEl.classList.contains('mdl-icon-toggle')).toBe(true);

  });

  it('should fire a change event if the state changed', async(() => {
    let fixture = TestBed.createComponent(MdlTestIconToggleComponent);
    fixture.detectChanges();

    let instance = fixture.componentInstance;

    spyOn(instance, 'onChange');

    fixture.debugElement.query(By.directive(MdlIconToggleComponent)).nativeElement.click();

    expect(instance.onChange).toHaveBeenCalledWith(true);
  }));

  // the following test, tests implicity that annotation are inherited (@Input @BooleanPorperty is defined in the
  // class MdlCheckboxComponent and not in MdlTestIconToggleComponent
  it('should be possible to disable the icon toggle', async(() => {
    let fixture = TestBed.createComponent(MdlTestIconToggleComponent);
    fixture.detectChanges();

    let instance = fixture.componentInstance;
    let cbDebugElem = fixture.debugElement.query(By.directive(MdlIconToggleComponent));

    cbDebugElem.componentInstance.setDisabledState(true);
    fixture.detectChanges();

    let checkboxEl: HTMLElement = cbDebugElem.nativeElement;
    expect(checkboxEl.classList.contains('is-disabled')).toBe(true, 'should have css is-disabled');

    // should not change on click
    cbDebugElem.nativeElement.click();
    expect(instance.checkboxValue1).toEqual(false);

  }));
});

@Component({
  selector: 'test-icon',
  template: `
    <mdl-icon-toggle [disabled]="false" [(ngModel)]="checkboxValue1" mdl-ripple (change)="onChange($event)">
    format_bold
    </mdl-icon-toggle>
  `
})
class MdlTestIconToggleComponent {

  public checkboxValue1 = false;
  public onChange(v: boolean) {}
}


text:
{% extends "dynoforms/base.html" %}
{% block title %} Dynamic Forms {% endblock %}
{% block content %}

        {% include "dynoforms/dynoform.html" %}

{% endblock %}


text:
/*++

Module Name:

    FileFormat.h

Abstract:

    Headers for the FileFormat class for the SNAP sequencer

Authors:

    Ravi Pandya, February 2013

Environment:

    User mode service.

Revision History:

--*/

#pragma once

#include "Compat.h"
#include "Tables.h"
#include "Read.h"
#include "Genome.h"
#include "LandauVishkin.h"
#include "AlignerOptions.h"
#include "GTFReader.h"

//
// abstract class defining format-specific operations
// for reading and writing files of reads
//
class FileFormat
{
public:
    //
    // files
    //

    // return true if the filename is for this format based on extension etc.
    virtual bool isFormatOf(const char* filename) const = 0;

    // reading
    //

    virtual void getSortInfo(const Genome* genome, char* buffer, _int64 bytes, unsigned* o_location, unsigned* o_readBytes, int* o_refID = NULL, int* o_pos = NULL) const = 0;

    /*

    virtual ReadReader* createReader(const DataSupplier* supplier, const char *fileName,
        const Genome *genome, _int64 startingOffset, _int64 amountOfFileToProcess,
        ReadClippingType clipping = ClipBack) = 0;

    virtual PairedReadReader* createPairedReader(const DataSupplier* supplier, const char *fileName,
        const Genome *genome, _int64 startingOffset, _int64 amountOfFileToProcess,
        ReadClippingType clipping = ClipBack) = 0;

    virtual ReadSupplierGenerator *createReadSupplierGenerator(const char *fileName, int numThreads,
        const Genome *genome, ReadClippingType clipping = ClipBack) = 0;

    virtual PairedReadSupplierGenerator *createPairedReadSupplierGenerator(const char *fileName,
        int numThreads, const Genome *genome, ReadClippingType clipping = ClipBack) = 0;

    // parse header and match against genome
    virtual bool parseHeader(const char *fileName, char *firstLine, char *endOfBuffer,
        const Genome *genome, _int64 *o_headerSize) = 0;

    */

    //
    // writing
    //

    virtual ReadWriterSupplier* getWriterSupplier(AlignerOptions* options, const Genome* genome, const Genome* transcriptome, const GTFReader* gtf) const = 0;

    virtual bool writeHeader(
        const ReaderContext& context, char *header, size_t headerBufferSize, size_t *headerActualSize,
        bool sorted, int argc, const char **argv, const char *version, const char *rgLine) const = 0;

    virtual bool writeRead(
        const Genome * genome, const Genome * transcriptome, const GTFReader * gtf,
        LandauVishkinWithCigar * lv, char * buffer, size_t bufferSpace,
        size_t * spaceUsed, size_t qnameLen, Read * read, AlignmentResult result,
        int mapQuality, unsigned genomeLocation, Direction direction, bool isTranscriptome = false, unsigned tlocation = 0,
        bool hasMate = false, bool firstInPair = false, Read * mate = NULL,
        AlignmentResult mateResult = NotFound, unsigned mateLocation = 0, Direction mateDirection = FORWARD,
        bool mateIsTranscriptome = false, unsigned mateTlocation= 0) const = 0;

    //
    // formats
    //

    static const FileFormat* SAM[2]; // 0 for =, 1 for M (useM flag)
    static const FileFormat* BAM[2];
    static const FileFormat* FASTQ;
    static const FileFormat* FASTQZ;
};


text:
/) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<false>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(ctx,
                                                               conv_index,
                                                               deps,
                                                               cpu::dnnl_utils::OpType::CONVOLUTION,
                                                               scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    std::function<decltype(runtime::cpu::kernel::convolution<float, float, float>)>
                        kernel;

                    SELECT_KERNEL_3ARGS(
                        kernel, out[0].get_element_type(), runtime::cpu::kernel::convolution)

                    auto window_movement_strides = convolution->get_window_movement_strides();
                    auto window_dilation_strides = convolution->get_window_dilation_strides();
                    auto padding_below = convolution->get_padding_below();
                    auto padding_above = convolution->get_padding_above();
                    auto data_dilation_strides = convolution->get_data_dilation_strides();

                    auto functor = [&,
                                    kernel,
                                    arg0_shape,
                                    arg1_shape,
                                    result_shape,
                                    window_movement_strides,
                                    window_dilation_strides,
                                    padding_below,
                                    padding_above,
                                    data_dilation_strides,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        kernel(ctx->buffer_data[arg0_buffer_index],
                               ctx->buffer_data[arg1_buffer_index],
                               ctx->buffer_data[out_buffer_index],
                               arg0_shape,
                               arg1_shape,
                               result_shape,
                               window_movement_strides,
                               window_dilation_strides,
                               padding_below,
                               padding_above,
                               data_dilation_strides,
                               nullptr,
                               nullptr,
                               nullptr,
                               nullptr,
                               nullptr,
                               nullptr);
                    };
                    functors.emplace_back(functor);
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::ConvolutionRelu)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter->get_convolution_forward_desc<ngraph::op::ConvolutionRelu>(
                            node);
                    auto conv_attr =
                        dnnl_emitter->get_convolution_forward_attr<ngraph::op::ConvolutionRelu>(
                            node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init();
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<false>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONRELU,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("ConvolutionRelu is only supported with DNNL kernel.");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::ConvolutionBias)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto arg2_buffer_index = external_function->get_buffer_index(args[2].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter->get_convolution_forward_desc<ngraph::op::v0::ConvolutionBias>(
                            node);
                    auto conv_attr =
                        dnnl_emitter->get_convolution_forward_attr<ngraph::op::v0::ConvolutionBias>(
                            node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init(true);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    arg2_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<true>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[arg2_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[3], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONBIAS,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("ConvolutionBias is only supported with DNNL kernel.");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::ConvolutionBiasAdd)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto arg2_buffer_index = external_function->get_buffer_index(args[2].get_name());
                auto arg3_buffer_index = external_function->get_buffer_index(args[3].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());
                size_t arg3_size = node->get_input_tensor(3).size();

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter
                            ->get_convolution_forward_desc<ngraph::op::v0::ConvolutionBiasAdd>(
                                node);
                    auto conv_attr =
                        dnnl_emitter
                            ->get_convolution_forward_attr<ngraph::op::v0::ConvolutionBiasAdd>(
                                node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init(true);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg3_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    arg2_buffer_index,
                                    arg3_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<true>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        if (ctx->buffer_data[out_buffer_index] !=
                            ctx->buffer_data[arg3_buffer_index])
                        {
                            memcpy(static_cast<char*>(ctx->buffer_data[out_buffer_index]),
                                   static_cast<char*>(ctx->buffer_data[arg3_buffer_index]),
                                   arg3_size);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[arg2_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[3], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONBIASADD,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("ConvolutionBiasAdd is only supported with DNNL kernel.");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::ConvolutionAdd)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto arg2_buffer_index = external_function->get_buffer_index(args[2].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());
                size_t arg2_size = node->get_input_tensor(2).size();

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter->get_convolution_forward_desc<ngraph::op::ConvolutionAdd>(
                            node);
                    auto conv_attr =
                        dnnl_emitter->get_convolution_forward_attr<ngraph::op::ConvolutionAdd>(
                            node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init(false);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg2_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    arg2_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<false>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        if (ctx->buffer_data[out_buffer_index] !=
                            ctx->buffer_data[arg2_buffer_index])
                        {
                            memcpy(static_cast<char*>(ctx->buffer_data[out_buffer_index]),
                                   static_cast<char*>(ctx->buffer_data[arg2_buffer_index]),
                                   arg2_size);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONADD,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("ConvolutionAdd is only supported with DNNL kernel.");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::ConvolutionBackpropData)
            {
                auto convolution =
                    static_cast<const ngraph::op::v0::ConvolutionBackpropData*>(node);

                auto& functors = external_function->get_functors();

                auto arg0_shape = args[0].get_shape();
                auto arg1_shape = args[1].get_shape();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto bwd_desc = dnnl_emitter->get_convolution_backward_data_desc<
                        ngraph::op::v0::ConvolutionBackpropData>(node);
                    auto fwd_desc = dnnl_emitter->get_convolution_forward_desc_for_backward_op<
                        ngraph::op::v0::ConvolutionBackpropData>(node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_backward_data, fwd_desc, bwd_desc);

                    // ConvolutionBackpropData needs 4 primitives: weights, diff_dst, diff_src,
                    // and convolution_backward_data.
                    auto conv_index = dnnl_emitter->reserve_primitive_space(4);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    bwd_desc,
                                    fwd_desc,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_backward_data(ctx->dnnl_memories,
                                                                          ctx->dnnl_primitives,
                                                                          ctx->dnnl_scratchpad_mds,
                                                                          bwd_desc,
                                                                          fwd_desc,
                                                                          deps,
                                                                          conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONBACKPROPDATA,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    std::function<decltype(runtime::cpu::kernel::convolution_backprop_in<float>)>
                        kernel;

                    SELECT_KERNEL(kernel,
                                  out[0].get_element_type(),
                                  runtime::cpu::kernel::convolution_backprop_in)
                    auto& in_shape = convolution->get_data_batch_shape();
                    auto data_dilation_strides = convolution->get_data_dilation_strides_forward();
                    auto window_dilation_strides =
                        convolution->get_window_dilation_strides_forward();
                    auto padding_below = convolution->get_padding_below_forward();
                    auto padding_above = convolution->get_padding_above_forward();
                    auto window_movement_strides =
                        convolution->get_window_movement_strides_forward();
                    auto backward_delta_out_pad_below =
                        convolution->compute_backward_delta_out_pad_below();
                    auto backward_delta_out_pad_above =
                        convolution->compute_backward_delta_out_pad_above();

                    auto functor = [&,
                                    kernel,
                                    arg0_shape,
                                    arg1_shape,
                                    in_shape,
                                    data_dilation_strides,
                                    window_dilation_strides,
                                    backward_delta_out_pad_below,
                                    backward_delta_out_pad_above,
                                    window_movement_strides,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        kernel(ctx->buffer_data[arg1_buffer_index],
                               ctx->buffer_data[arg0_buffer_index],
                               ctx->buffer_data[out_buffer_index],
                               arg1_shape,
                               arg0_shape,
                               in_shape,
                               data_dilation_strides,
                               window_dilation_strides,
                               backward_delta_out_pad_below,
                               backward_delta_out_pad_above,
                               window_movement_strides);
                    };
                    functors.emplace_back(functor);
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::ConvolutionBackpropFilters)
            {
                auto convolution =
                    static_cast<const ngraph::op::v0::ConvolutionBackpropFilters*>(node);

                auto& functors = external_function->get_functors();

                auto arg0_shape = args[0].get_shape();
                auto arg1_shape = args[1].get_shape();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto bwd_desc = dnnl_emitter->get_convolution_backward_weights_desc<
                        ngraph::op::v0::ConvolutionBackpropFilters>(node);
                    auto fwd_desc = dnnl_emitter->get_convolution_forward_desc_for_backward_op<
                        ngraph::op::v0::ConvolutionBackpropFilters>(node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_backward_weights, fwd_desc, bwd_desc);

                    // ConvolutionBackpropFilter needs 4 primitives: src, diff_dst, diff_weights,
                    // and convolution_backward_weights.
                    auto conv_index = dnnl_emitter->reserve_primitive_space(4);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    bwd_desc,
                                    fwd_desc,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_backward_weights(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                bwd_desc,
                                fwd_desc,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONBACKPROPWEIGHTS,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    std::function<decltype(
                        runtime::cpu::kernel::convolution_backprop_filter<float>)>
                        kernel;

                    SELECT_KERNEL(kernel,
                                  out[0].get_element_type(),
                                  runtime::cpu::kernel::convolution_backprop_filter)

                    auto& filters_shape = convolution->get_filters_shape();
                    auto window_dilation_strides =
                        convolution->get_window_dilation_strides_forward();
                    auto window_movement_strides =
                        convolution->get_window_movement_strides_forward();
                    auto padding_below = convolution->get_padding_below_forward();
                    auto padding_above = convolution->get_padding_above_forward();
                    auto data_dilation_strides = convolution->get_data_dilation_strides_forward();
                    CoordinateDiff backward_in_pad_above =
                        convolution->compute_backward_in_pad_above();

                    auto functor = [&,
                                    kernel,
                                    arg0_shape,
                                    arg1_shape,
                                    filters_shape,
                                    window_dilation_strides,
                                    window_movement_strides,
                                    padding_below,
                                    backward_in_pad_above,
                                    data_dilation_strides,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        kernel(ctx->buffer_data[arg0_buffer_index],
                               ctx->buffer_data[arg1_buffer_index],
                               ctx->buffer_data[out_buffer_index],
                               arg0_shape,
                               arg1_shape,
                               filters_shape,
                               window_movement_strides,
                               window_dilation_strides,
                               padding_below,
                               backward_in_pad_above,
                               data_dilation_strides);
                    };
                    functors.emplace_back(functor);
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::ConvolutionBiasBackpropFiltersBias)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto out0_buffer_index = external_function->get_buffer_index(out[0].get_name());
                auto out1_buffer_index = external_function->get_buffer_index(out[1].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto bwd_desc = dnnl_emitter->get_convolution_backward_weights_desc<
                        ngraph::op::v0::ConvolutionBiasBackpropFiltersBias>(node);
                    auto fwd_desc = dnnl_emitter->get_convolution_forward_desc_for_backward_op<
                        ngraph::op::v0::ConvolutionBiasBackpropFiltersBias>(node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_backward_weights, fwd_desc, bwd_desc);

                    // ConvolutionBackpropFiltersBias needs 5 primitives: src, diff_dst,
                    // diff_weights, diff_bias, and convolution_backward_weights.
                    auto conv_index = dnnl_emitter->reserve_primitive_space(5);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    bwd_desc,
                                    fwd_desc,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out0_buffer_index,
                                    out1_buffer_index](CPURuntimeContext* ctx,
                                                       CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_backward_weights_bias(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                bwd_desc,
                                fwd_desc,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[3], ctx->buffer_data[out1_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::CONVOLUTIONBACKPROPWEIGHTSBIAS,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error(
                        "ConvolutionBiasBackpropFiltersBias is only supported with DNNL kernel.");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::v0::GroupConvolution)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter
                            ->get_convolution_forward_desc<ngraph::op::v0::GroupConvolution>(node);
                    auto conv_attr =
                        dnnl_emitter
                            ->get_convolution_forward_attr<ngraph::op::v0::GroupConvolution>(node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init();
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<false>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }

                        // group convolution
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::GROUPCONVOLUTION,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("unsupported parameters for GroupConvolution");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::GroupConvolutionBias)
            {
                auto& functors = external_function->get_functors();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto arg2_buffer_index = external_function->get_buffer_index(args[2].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto conv_desc =
                        dnnl_emitter
                            ->get_convolution_forward_desc<ngraph::op::GroupConvolutionBias>(node);
                    auto conv_attr =
                        dnnl_emitter
                            ->get_convolution_forward_attr<ngraph::op::GroupConvolutionBias>(node);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD_2ARGS(convolution_forward, conv_desc, conv_attr);

                    size_t conv_index = dnnl_emitter->convolution_forward_init(true);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    conv_desc,
                                    conv_attr,
                                    conv_index,
                                    scratchpad_size,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    arg2_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_convolution_forward<true>(
                                ctx->dnnl_memories,
                                ctx->dnnl_primitives,
                                ctx->dnnl_scratchpad_mds,
                                conv_desc,
                                conv_attr,
                                executor::global_cpu_engine,
                                deps,
                                conv_index);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[arg2_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[3], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::GROUPCONVOLUTIONBIAS,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("unsupported parameters for GroupConvolutionBias");
                }
            }

            template <>
            void Builder::BUILDER_DECL(ngraph::op::DeconvolutionBias)
            {
                auto& functors = external_function->get_functors();

                auto arg0_shape = args[0].get_shape();
                auto arg1_shape = args[1].get_shape();
                auto arg2_shape = args[2].get_shape();
                auto result_shape = out[0].get_shape();

                auto arg0_buffer_index = external_function->get_buffer_index(args[0].get_name());
                auto arg1_buffer_index = external_function->get_buffer_index(args[1].get_name());
                auto arg2_buffer_index = external_function->get_buffer_index(args[2].get_name());
                auto out_buffer_index = external_function->get_buffer_index(out[0].get_name());

                if (runtime::cpu::dnnl_utils::use_dnnl_kernel(node))
                {
                    auto& dnnl_emitter = external_function->get_dnnl_emitter();
                    auto deconvbias_desc =
                        dnnl_emitter
                            ->get_deconvolutionbias_forward_data<ngraph::op::DeconvolutionBias>(
                                node);
                    auto weights_desc = dnnl_utils::get_input_dnnl_md(node, 0);
                    size_t scratchpad_size =
                        QUERY_SCRATCHPAD(deconvolution_forward, deconvbias_desc);

                    // DeconvolutionBias needs 5 primitives: weights, delta, bias, result,
                    // and deconvolutionbias.
                    auto conv_index = dnnl_emitter->reserve_primitive_space(5);
                    auto& deps = dnnl_emitter->get_primitive_deps(conv_index);

                    auto functor = [&,
                                    deconvbias_desc,
                                    conv_index,
                                    scratchpad_size,
                                    weights_desc,
                                    arg0_buffer_index,
                                    arg1_buffer_index,
                                    arg2_buffer_index,
                                    out_buffer_index](CPURuntimeContext* ctx,
                                                      CPUExecutionContext* /* ectx */) {
                        if (ctx->first_iteration)
                        {
                            dnnl_emitter->build_deconvolutionbias_forward(ctx->dnnl_memories,
                                                                          ctx->dnnl_primitives,
                                                                          ctx->dnnl_scratchpad_mds,
                                                                          deconvbias_desc,
                                                                          deps,
                                                                          conv_index,
                                                                          weights_desc);
                        }
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[0], ctx->buffer_data[arg0_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[1], ctx->buffer_data[arg1_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[2], ctx->buffer_data[arg2_buffer_index]);
                        cpu::dnnl_utils::set_memory_ptr(
                            ctx, deps[3], ctx->buffer_data[out_buffer_index]);

                        cpu::dnnl_utils::dnnl_invoke_primitive(
                            ctx,
                            conv_index,
                            deps,
                            cpu::dnnl_utils::OpType::DECONVOLUTIONBIAS,
                            scratchpad_size);
                    };
                    functors.emplace_back(functor);
                }
                else
                {
                    throw ngraph_error("DeconvolutionBias is only supported with DNNL kernel");
                }
            }

            void register_builders_convolution_cpp()
            {
                REGISTER_OP_BUILDER(ngraph::op::v0::Convolution);
                REGISTER_OP_BUILDER(ngraph::op::ConvolutionRelu);
                REGISTER_OP_BUILDER(ngraph::op::v0::ConvolutionBias);
                REGISTER_OP_BUILDER(ngraph::op::v0::ConvolutionBiasAdd);
                REGISTER_OP_BUILDER(ngraph::op::v0::ConvolutionBackpropData);
                REGISTER_OP_BUILDER(ngraph::op::v0::ConvolutionBackpropFilters);
                REGISTER_OP_BUILDER(ngraph::op::v0::ConvolutionBiasBackpropFiltersBias);
                REGISTER_OP_BUILDER(ngraph::op::v0::GroupConvolution);
                REGISTER_OP_BUILDER(ngraph::op::ConvolutionAdd);
                REGISTER_OP_BUILDER(ngraph::op::GroupConvolutionBias);
                REGISTER_OP_BUILDER(ngraph::op::DeconvolutionBias);
            }
        }
    }
}


text:
define(
  ["ember","exports"],
  function(__dependency1__, __exports__) {
    "use strict";
    var Ember = __dependency1__["default"] || __dependency1__;

    var translationMissing = function(keyPath) {
      return 'translation missing: ' + foreigner.locale + '.' + keyPath;
    };

    __exports__["default"] = function(key, options) {
      var attrs = options.hash;
      return new Ember.Handlebars.SafeString(foreigner.t(key, attrs) || translationMissing(key));
    }
  });


text:
require "maybe_so/core_ext/string"
require "maybe_so/core_ext/integer"
require "maybe_so/core_ext/true_class"
require "maybe_so/core_ext/false_class"
require "maybe_so/core_ext/nil_class"


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
DetailedRemoveException (ATG Java API)
</TITLE>

<META NAME="keywords" CONTENT="atg.repository.xml.DetailedRemoveException class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

atg.repository.xml

Class DetailedRemoveException

java.lang.Object
  java.lang.Throwable
      java.lang.Exception
          atg.core.exception.ContainerException
              atg.repository.xml.DetailedRemoveException

All Implemented Interfaces:
ContainableException, java.io.Serializable

public class DetailedRemoveException
extends ContainerException

Exception used to indicate errors occured while removing items from a
 repository.

See Also:
Serialized Form

Field Summary

static java.lang.String
CLASS_VERSION

Constructor Summary

DetailedRemoveException()

          Default constructor.

DetailedRemoveException(java.lang.String pStr)

          Constructor which takes String input.

DetailedRemoveException(java.lang.String pStr,
                        java.lang.Throwable pSourceException)

          Constructor that takes another exception to wrap it, and also String.

DetailedRemoveException(java.lang.Throwable pSourceException)

          Constructor that takes another exception to wrap it.

Method Summary

 java.util.Map
getErrorsMap()

          Returns Map of error messages to the exception messages.

 java.lang.String
getItemDescriptorName()

          Returns Name of the ItemDescriptor of the item to be removed.

 java.lang.String[]
getRemovedItemIds()

          Returns Ids of the items that have been removed

 java.lang.String
getRepositoryName()

          Returns Repository name of the item

 void
setErrorsMap(java.util.Map pErrorsMap)

          Sets Map of error messages to the exception messages.

 void
setItemDescriptorName(java.lang.String pItemDescriptorName)

          Sets Name of the ItemDescriptor of the item to be removed.

 void
setRemovedItemIds(java.lang.String[] pRemovedItemIds)

          Sets Ids of the items that have been removed

 void
setRepositoryName(java.lang.String pRepositoryName)

          Sets Repository name of the item

Methods inherited from class atg.core.exception.ContainerException

getSourceException, printStackTrace, printStackTrace, printStackTrace, printStackTrace, setSourceException, toString, toString

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

Constructor Detail

DetailedRemoveException

public DetailedRemoveException()

Default constructor.

DetailedRemoveException

public DetailedRemoveException(java.lang.String pStr)

Constructor which takes String input.

DetailedRemoveException

public DetailedRemoveException(java.lang.Throwable pSourceException)

Constructor that takes another exception to wrap it.

DetailedRemoveException

public DetailedRemoveException(java.lang.String pStr,
                               java.lang.Throwable pSourceException)

Constructor that takes another exception to wrap it, and also String.

Method Detail

getItemDescriptorName

public java.lang.String getItemDescriptorName()

Returns Name of the ItemDescriptor of the item to be removed.

Returns:
the ItemDescriptorName

setItemDescriptorName

public void setItemDescriptorName(java.lang.String pItemDescriptorName)

Sets Name of the ItemDescriptor of the item to be removed.

getRepositoryName

public java.lang.String getRepositoryName()

Returns Repository name of the item

Returns:
the RepositoryName

setRepositoryName

public void setRepositoryName(java.lang.String pRepositoryName)

Sets Repository name of the item

getRemovedItemIds

public java.lang.String[] getRemovedItemIds()

Returns Ids of the items that have been removed

Returns:
the RemovedItemIds

setRemovedItemIds

public void setRemovedItemIds(java.lang.String[] pRemovedItemIds)

Sets Ids of the items that have been removed

getErrorsMap

public java.util.Map getErrorsMap()

Returns Map of error messages to the exception messages.

Returns:
the ErrorsMap

setErrorsMap

public void setErrorsMap(java.util.Map pErrorsMap)

Sets Map of error messages to the exception messages.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
footer do
  copyright :text => "8th Light, Inc. Copyright 2007"
end


text:
static const CGFloat ExerciseAmbiguityInterval = .5;
static char *const NameTagKey = "flk_nameTag";

@implementation UIView (FLKAutoLayoutDebug)

- (void)flk_exerciseAmbiguityInLayout:(BOOL)recursive
{
#ifdef DEBUG
    if (self.hasAmbiguousLayout) {
        [NSTimer scheduledTimerWithTimeInterval:ExerciseAmbiguityInterval target:self selector:@selector(flk_changeAmbiguousLayout) userInfo:nil repeats:YES];
    }
    if (recursive) {
        for (UIView *subview in self.subviews) {
            [subview flk_exerciseAmbiguityInLayout:recursive];
        }
    }
#endif
}

- (void)flk_changeAmbiguousLayout
{
#ifdef DEBUG
    [self exerciseAmbiguityInLayout];
#endif
}

- (NSString *)flk_autolayoutTrace
{
    return nil;
}

- (void)setFlk_nameTag:(NSString *)nameTag
{
    objc_setAssociatedObject(self, NameTagKey, nameTag, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSString *)flk_nameTag
{
    return objc_getAssociatedObject(self, NameTagKey);
}

@end