file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
common.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // source: common.proto package cross import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf type SIHeartBeat struct { XXX_unrecognized []byte `json:"-"` } func (m *SIHeartBeat) Reset() { *m = SIHeartBeat{} } func (m *SIHeartBeat) String() string { return proto.CompactTextString(m) } func (*SIHeartBeat) ProtoMessage() {} func (*SIHeartBeat) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } type ISHeartBeat struct { XXX_unrecognized []byte `json:"-"` } func (m *ISHeartBeat) Reset() { *m = ISHeartBeat{} } func (m *ISHeartBeat) String() string { return proto.CompactTextString(m) } func (*ISHeartBeat) ProtoMessage() {} func (*ISHeartBeat) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{1} } func
() { proto.RegisterType((*SIHeartBeat)(nil), "cross.SIHeartBeat") proto.RegisterType((*ISHeartBeat)(nil), "cross.ISHeartBeat") } func init() { proto.RegisterFile("common.proto", fileDescriptor8) } var fileDescriptor8 = []byte{ // 66 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4d, 0x2e, 0xca, 0x2f, 0x2e, 0x56, 0xe2, 0xe5, 0xe2, 0x0e, 0xf6, 0xf4, 0x48, 0x4d, 0x2c, 0x2a, 0x71, 0x4a, 0x4d, 0x2c, 0x01, 0x71, 0x3d, 0x83, 0xe1, 0x5c, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0xbf, 0x3c, 0xc7, 0x33, 0x00, 0x00, 0x00, }
init
alt_registry.rs
use cargotest::ChannelChanger; use cargotest::support::registry::{self, alt_api_path, Package}; use cargotest::support::{execs, paths, project}; use hamcrest::assert_that; use std::fs::File; use std::io::Write; #[test] fn is_feature_gated() { let p = project("foo") .file( "Cargo.toml", r#" [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("bar", "0.0.1").alternative(true).publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs() .with_status(101) .with_stderr_contains(" feature `alternative-registries` is required"), ); } #[test] fn depend_on_alt_registry() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("bar", "0.0.1").alternative(true).publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [UPDATING] registry `{reg}` [DOWNLOADING] bar v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url(), reg = registry::alt_registry() )), ); assert_that( p.cargo("clean").masquerade_as_nightly_cargo(), execs().with_status(0), ); // Don't download a second time assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [COMPILING] bar v0.0.1 (registry `file://[..]`) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url() )), ); } #[test] fn depend_on_alt_registry_depends_on_same_registry_no_index() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("baz", "0.0.1").alternative(true).publish(); Package::new("bar", "0.0.1") .dep("baz", "0.0.1") .alternative(true) .publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [UPDATING] registry `{reg}` [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url(), reg = registry::alt_registry() )), ); } #[test] fn depend_on_alt_registry_depends_on_same_registry() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("baz", "0.0.1").alternative(true).publish(); Package::new("bar", "0.0.1") .registry_dep("baz", "0.0.1", registry::alt_registry().as_str()) .alternative(true) .publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [UPDATING] registry `{reg}` [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url(), reg = registry::alt_registry() )), ); } #[test] fn depend_on_alt_registry_depends_on_crates_io() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1") .registry_dep("baz", "0.0.1", registry::registry().as_str()) .alternative(true) .publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [UPDATING] registry `{alt_reg}` [UPDATING] registry `{reg}` [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 (registry `file://[..]`) [COMPILING] bar v0.0.1 (registry `file://[..]`) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url(), alt_reg = registry::alt_registry(), reg = registry::registry() )), ); } #[test] fn
() { registry::init(); let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] path = "bar" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .file( "bar/Cargo.toml", r#" [project] name = "bar" version = "0.0.1" authors = [] "#, ) .file("bar/src/lib.rs", "") .build(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(0).with_stderr(&format!( "\ [COMPILING] bar v0.0.1 ({dir}/bar) [COMPILING] foo v0.0.1 ({dir}) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", dir = p.url() )), ); } #[test] fn registry_incompatible_with_git() { registry::init(); let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] git = "" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); assert_that(p.cargo("build").masquerade_as_nightly_cargo(), execs().with_status(101) .with_stderr_contains(" dependency (bar) specification is ambiguous. Only one of `git` or `registry` is allowed.")); } #[test] fn cannot_publish_to_crates_io_with_registry_dependency() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("bar", "0.0.1").alternative(true).publish(); assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--index") .arg(registry::registry().to_string()), execs().with_status(101), ); } #[test] fn publish_with_registry_dependency() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies.bar] version = "0.0.1" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("bar", "0.0.1").alternative(true).publish(); // Login so that we have the token available assert_that( p.cargo("login") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("TOKEN") .arg("-Zunstable-options"), execs().with_status(0), ); assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("-Zunstable-options"), execs().with_status(0), ); } #[test] fn alt_registry_and_crates_io_deps() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] [dependencies] crates_io_dep = "0.0.1" [dependencies.alt_reg_dep] version = "0.1.0" registry = "alternative" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("crates_io_dep", "0.0.1").publish(); Package::new("alt_reg_dep", "0.1.0") .alternative(true) .publish(); assert_that( p.cargo("build").masquerade_as_nightly_cargo(), execs() .with_status(0) .with_stderr_contains(format!( "[UPDATING] registry `{}`", registry::alt_registry() )) .with_stderr_contains(&format!("[UPDATING] registry `{}`", registry::registry())) .with_stderr_contains("[DOWNLOADING] crates_io_dep v0.0.1 (registry `file://[..]`)") .with_stderr_contains("[DOWNLOADING] alt_reg_dep v0.1.0 (registry `file://[..]`)") .with_stderr_contains("[COMPILING] alt_reg_dep v0.1.0 (registry `file://[..]`)") .with_stderr_contains("[COMPILING] crates_io_dep v0.0.1") .with_stderr_contains(&format!("[COMPILING] foo v0.0.1 ({})", p.url())) .with_stderr_contains( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s", ), ) } #[test] fn block_publish_due_to_no_token() { let p = project("foo") .file( "Cargo.toml", r#" [project] name = "foo" version = "0.0.1" authors = [] "#, ) .file("src/main.rs", "fn main() {}") .build(); // Setup the registry by publishing a package Package::new("bar", "0.0.1").alternative(true).publish(); // Now perform the actual publish assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("-Zunstable-options"), execs() .with_status(101) .with_stderr_contains("error: no upload token found, please run `cargo login`"), ); } #[test] fn publish_to_alt_registry() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] "#, ) .file("src/main.rs", "fn main() {}") .build(); // Setup the registry by publishing a package Package::new("bar", "0.0.1").alternative(true).publish(); // Login so that we have the token available assert_that( p.cargo("login") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("TOKEN") .arg("-Zunstable-options"), execs().with_status(0), ); // Now perform the actual publish assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("-Zunstable-options"), execs().with_status(0), ); // Ensure that the crate is uploaded assert!(alt_api_path().join("api/v1/crates/new").exists()); } #[test] fn publish_with_crates_io_dep() { let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = ["me"] license = "MIT" description = "foo" [dependencies.bar] version = "0.0.1" "#, ) .file("src/main.rs", "fn main() {}") .build(); Package::new("bar", "0.0.1").publish(); // Login so that we have the token available assert_that( p.cargo("login") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("TOKEN") .arg("-Zunstable-options"), execs().with_status(0), ); assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("-Zunstable-options"), execs().with_status(0), ); } #[test] fn credentials_in_url_forbidden() { registry::init(); let config = paths::home().join(".cargo/config"); File::create(config) .unwrap() .write_all( br#" [registries.alternative] index = "ssh://git:[email protected]" "#, ) .unwrap(); let p = project("foo") .file( "Cargo.toml", r#" cargo-features = ["alternative-registries"] [project] name = "foo" version = "0.0.1" authors = [] "#, ) .file("src/main.rs", "fn main() {}") .build(); assert_that( p.cargo("publish") .masquerade_as_nightly_cargo() .arg("--registry") .arg("alternative") .arg("-Zunstable-options"), execs() .with_status(101) .with_stderr_contains("error: Registry URLs may not contain credentials"), ); }
registry_and_path_dep_works
token.module.ts
import { Module } from '@nestjs/common'; import { TokenService } from './token.service'; import { TokenController } from './token.controller'; @Module({ providers: [TokenService], controllers: [TokenController], exports: [TokenModule] }) export class
{ }
TokenModule
yaml_test.go
package loader import ( "bytes" "fmt" "testing" ) var _ = fmt.Println var yamlTestData = []byte(` stringkey: stringvalue boolkey: true intkey: 123 `) func TestYAMLLoader(t *testing.T)
{ var ( vals map[string]interface{} val interface{} found bool ) l := YAML(bytes.NewReader(yamlTestData)) if err := l.Load(&vals); err != nil { t.Fatalf("Failed loading YAML: %s", err) } if val, found = vals["stringkey"]; !found { t.Fatalf("Failed to lookup key 'stringkey'") } sval := val.(string) if sval != "stringvalue" { t.Fatalf("Unexpected value for sval '%s', expected 'stringvalue'", sval) } if val, found = vals["boolkey"]; !found { t.Fatalf("Failed to lookup key 'boolkey'") } bval := val.(bool) if !bval { t.Fatalf("bval unexpectedly false") } if val, found = vals["intkey"]; !found { t.Fatalf("Failed to lookup key 'intkey'") } ival := val.(int) if ival != 123 { t.Fatalf("Unexpected value for ival %d, expected 123", ival) } }
uno-i2cdetect.rs
#![no_std] #![no_main] use arduino_uno::prelude::*; use panic_halt as _; #[arduino_uno::entry] fn main() -> !
{ let dp = arduino_uno::Peripherals::take().unwrap(); let mut pins = arduino_uno::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD); let mut serial = arduino_uno::Serial::new( dp.USART0, pins.d0, pins.d1.into_output(&mut pins.ddr), 57600, ); let mut i2c = arduino_uno::I2c::new( dp.TWI, pins.a4.into_pull_up_input(&mut pins.ddr), pins.a5.into_pull_up_input(&mut pins.ddr), 50000, ); ufmt::uwriteln!(&mut serial, "Write direction test:\r").void_unwrap(); i2c.i2cdetect(&mut serial, arduino_uno::hal::i2c::Direction::Write) .void_unwrap(); ufmt::uwriteln!(&mut serial, "\r\nRead direction test:\r").void_unwrap(); i2c.i2cdetect(&mut serial, arduino_uno::hal::i2c::Direction::Read) .void_unwrap(); loop { arduino_uno::delay_ms(1000); } }
tags.go
// Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package models import ( "bytes" "errors" "fmt" "sort" "strings" "github.com/m3db/m3/src/metrics/generated/proto/metricpb" xerrors "github.com/m3db/m3/src/x/errors" "github.com/cespare/xxhash/v2" ) var ( errNoTags = errors.New("no tags") ) // NewTags builds a tags with the given size and tag options. func NewTags(size int, opts TagOptions) Tags { if opts == nil { opts = NewTagOptions() } return Tags{ // Todo: Pool these Tags: make([]Tag, 0, size), Opts: opts, } } // EmptyTags returns empty tags with a default tag options. func EmptyTags() Tags { return NewTags(0, nil) } // LastComputedID returns the last computed ID; this should only be // used when it is guaranteed that no tag transforms take place between calls. func (t *Tags) LastComputedID() []byte { if t.id == nil { t.id = t.ID() } return t.id } // ID returns a byte slice representation of the tags, using the generation // strategy from the tag options. func (t Tags) ID() []byte { return id(t) } func (t Tags) tagSubset(keys [][]byte, include bool) Tags { tags := NewTags(t.Len(), t.Opts) for _, tag := range t.Tags { found := false for _, k := range keys { if bytes.Equal(tag.Name, k) { found = true break } } if found == include { tags = tags.AddTag(tag) } } return tags } // TagsWithoutKeys returns only the tags which do not have the given keys. func (t Tags) TagsWithoutKeys(excludeKeys [][]byte) Tags { return t.tagSubset(excludeKeys, false) } // TagsWithKeys returns only the tags which have the given keys. func (t Tags) TagsWithKeys(includeKeys [][]byte) Tags { return t.tagSubset(includeKeys, true) } // WithoutName copies the tags excluding the name tag. func (t Tags) WithoutName() Tags { return t.TagsWithoutKeys([][]byte{t.Opts.MetricName()}) } // Get returns the value for the tag with the given name. func (t Tags) Get(key []byte) ([]byte, bool) { for _, tag := range t.Tags { if bytes.Equal(tag.Name, key) { return tag.Value, true } } return nil, false } // Clone returns a copy of the tags. func (t Tags) Clone() Tags { // TODO: Pool these clonedTags := make([]Tag, t.Len()) for i, tag := range t.Tags { clonedTags[i] = tag.Clone() } return Tags{ Tags: clonedTags, Opts: t.Opts, } } // AddTag is used to add a single tag and maintain sorted order. func (t Tags) AddTag(tag Tag) Tags { t.Tags = append(t.Tags, tag) return t.Normalize() } // AddTagWithoutNormalizing is used to add a single tag. func (t Tags) AddTagWithoutNormalizing(tag Tag) Tags { t.Tags = append(t.Tags, tag) return t } // SetName sets the metric name. func (t Tags) SetName(value []byte) Tags { return t.AddOrUpdateTag(Tag{Name: t.Opts.MetricName(), Value: value}) } // Name gets the metric name. func (t Tags) Name() ([]byte, bool) { return t.Get(t.Opts.MetricName()) } // SetBucket sets the bucket tag value. func (t Tags) SetBucket(value []byte) Tags { return t.AddOrUpdateTag(Tag{Name: t.Opts.BucketName(), Value: value}) } // Bucket gets the bucket tag value. func (t Tags) Bucket() ([]byte, bool) { return t.Get(t.Opts.BucketName()) } // AddTags is used to add a list of tags and maintain sorted order. func (t Tags) AddTags(tags []Tag) Tags { t.Tags = append(t.Tags, tags...) return t.Normalize() } // AddOrUpdateTag is used to add a single tag and maintain sorted order, // or to replace the value of an existing tag. func (t Tags) AddOrUpdateTag(tag Tag) Tags { tags := t.Tags for i, tt := range tags { if bytes.Equal(tag.Name, tt.Name) { tags[i].Value = tag.Value return t } } return t.AddTag(tag) } // AddTagsIfNotExists is used to add a list of tags with unique names // and maintain sorted order. func (t Tags) AddTagsIfNotExists(tags []Tag) Tags { for _, tt := range tags { t = t.addIfMissingTag(tt) } return t.Normalize() } // addIfMissingTag is used to add a single tag and maintain sorted order, // or to replace the value of an existing tag. func (t Tags) addIfMissingTag(tag Tag) Tags { tags := t.Tags for _, tt := range tags { if bytes.Equal(tag.Name, tt.Name) { return t } } return t.AddTag(tag) } // Add is used to add two tag structures and maintain sorted order. func (t Tags) Add(other Tags) Tags { t.Tags = append(t.Tags, other.Tags...) return t.Normalize() } // Ensure Tags implements sort interface. var _ sort.Interface = Tags{} func (t Tags) Len() int { return len(t.Tags) } func (t Tags) Swap(i, j int) { t.Tags[i], t.Tags[j] = t.Tags[j], t.Tags[i] } func (t Tags) Less(i, j int) bool { return bytes.Compare(t.Tags[i].Name, t.Tags[j].Name) == -1 } // Ensure sortableTagsNumericallyAsc implements sort interface. var _ sort.Interface = sortableTagsNumericallyAsc{} type sortableTagsNumericallyAsc Tags func (t sortableTagsNumericallyAsc) Len() int { return len(t.Tags) } func (t sortableTagsNumericallyAsc) Swap(i, j int) { t.Tags[i], t.Tags[j] = t.Tags[j], t.Tags[i] } func (t sortableTagsNumericallyAsc) Less(i, j int) bool { iName, jName := t.Tags[i].Name, t.Tags[j].Name lenDiff := len(iName) - len(jName) if lenDiff < 0 { return true } if lenDiff > 0 { return false } return bytes.Compare(iName, jName) == -1 } // Normalize normalizes the tags by sorting them in place. // In the future, it might also ensure other things like uniqueness. func (t Tags) Normalize() Tags { if t.Opts.IDSchemeType() == TypeGraphite { // Graphite tags are sorted numerically rather than lexically. sort.Sort(sortableTagsNumericallyAsc(t)) } else { sort.Sort(t) } return t } // Validate will validate there are tag values, and the // tags are ordered and there are no duplicates. func (t Tags) Validate() error {
if err := t.validate(); err != nil { return xerrors.NewInvalidParamsError(err) } return nil } func (t Tags) validate() error { n := t.Len() if n == 0 { return errNoTags } if t.Opts.IDSchemeType() == TypeGraphite { // Graphite tags are sorted numerically rather than lexically. tags := sortableTagsNumericallyAsc(t) for i, tag := range tags.Tags { if len(tag.Name) == 0 { return fmt.Errorf("tag name empty: index=%d", i) } if i == 0 { continue // Don't check order/unique attributes. } if !tags.Less(i-1, i) { return fmt.Errorf("graphite tags out of order: '%s' appears after"+ " '%s', tags: %v", tags.Tags[i-1].Name, tags.Tags[i].Name, tags.Tags) } prev := tags.Tags[i-1] if bytes.Compare(prev.Name, tag.Name) == 0 { return fmt.Errorf("tags duplicate: '%s' appears more than once", tags.Tags[i-1].Name) } } } else { var ( allowTagNameDuplicates = t.Opts.AllowTagNameDuplicates() allowTagValueEmpty = t.Opts.AllowTagValueEmpty() ) // Sorted alphanumerically otherwise, use bytes.Compare once for // both order and unique test. for i, tag := range t.Tags { if len(tag.Name) == 0 { return fmt.Errorf("tag name empty: index=%d", i) } if !allowTagValueEmpty && len(tag.Value) == 0 { return fmt.Errorf("tag value empty: index=%d, name=%s", i, t.Tags[i].Name) } if i == 0 { continue // Don't check order/unique attributes. } prev := t.Tags[i-1] cmp := bytes.Compare(prev.Name, t.Tags[i].Name) if cmp > 0 { return fmt.Errorf("tags out of order: '%s' appears after '%s', tags: %v", prev.Name, tag.Name, t.Tags) } if !allowTagNameDuplicates && cmp == 0 { return fmt.Errorf("tags duplicate: '%s' appears more than once in '%s'", prev.Name, t) } } } return nil } // Reset resets the tags for reuse. func (t Tags) Reset() Tags { t.Tags = t.Tags[:0] return t } // HashedID returns the hashed ID for the tags. func (t Tags) HashedID() uint64 { return xxhash.Sum64(t.ID()) } // LastComputedHashedID returns the last computed hashed ID; this should only be // used when it is guaranteed that no tag transforms take place between calls. func (t *Tags) LastComputedHashedID() uint64 { if t.hashedID == 0 { t.hashedID = xxhash.Sum64(t.LastComputedID()) } return t.hashedID } // Equals returns a boolean reporting whether the compared tags have the same // values. // // NB: does not check that compared tags have the same underlying bytes. func (t Tags) Equals(other Tags) bool { if t.Len() != other.Len() { return false } if !t.Opts.Equals(other.Opts) { return false } for i, t := range t.Tags { if !t.Equals(other.Tags[i]) { return false } } return true } var tagSeperator = []byte(", ") // String returns the string representation of the tags. func (t Tags) String() string { var sb strings.Builder for i, tt := range t.Tags { if i != 0 { sb.Write(tagSeperator) } sb.WriteString(tt.String()) } return sb.String() } // TagsFromProto converts proto tags to models.Tags. func TagsFromProto(pbTags []*metricpb.Tag) []Tag { tags := make([]Tag, 0, len(pbTags)) for _, tag := range pbTags { tags = append(tags, Tag{ Name: tag.Name, Value: tag.Value, }) } return tags } // ToProto converts the models.Tags to proto tags. func (t Tag) ToProto() *metricpb.Tag { return &metricpb.Tag{ Name: t.Name, Value: t.Value, } } // String returns the string representation of the tag. func (t Tag) String() string { return fmt.Sprintf("%s: %s", t.Name, t.Value) } // Equals returns a boolean indicating whether the provided tags are equal. // // NB: does not check that compared tags have the same underlying bytes. func (t Tag) Equals(other Tag) bool { return bytes.Equal(t.Name, other.Name) && bytes.Equal(t.Value, other.Value) } // Clone returns a copy of the tag. func (t Tag) Clone() Tag { // Todo: Pool these clonedName := make([]byte, len(t.Name)) clonedVal := make([]byte, len(t.Value)) copy(clonedName, t.Name) copy(clonedVal, t.Value) return Tag{ Name: clonedName, Value: clonedVal, } }
// Wrap call to validate to make sure a validation error // is always an invalid parameters error so we return bad request // instead of internal server error at higher in the stack.
views.py
from rest_framework.generics import GenericAPIView from drf_spectacular.types import OpenApiTypes from crum import get_current_user from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.utils import timezone from django.core.exceptions import ValidationError from django.utils.decorators import method_decorator from drf_yasg.inspectors.base import NotHandled from drf_yasg.inspectors.query import CoreAPICompatInspector from rest_framework import viewsets, mixins, status from rest_framework.response import Response from django.db import IntegrityError from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated from rest_framework.decorators import action from rest_framework.parsers import MultiPartParser from django_filters.rest_framework import DjangoFilterBackend from drf_yasg import openapi from drf_yasg.utils import swagger_auto_schema, no_body import base64 from dojo.engagement.services import close_engagement, reopen_engagement from dojo.importers.reimporter.utils import get_target_engagement_if_exists, get_target_product_if_exists, get_target_test_if_exists from dojo.models import Language_Type, Languages, Notifications, Product, Product_Type, Engagement, Test, Test_Import, Test_Type, Finding, \ User, Stub_Finding, Finding_Template, Notes, \ JIRA_Issue, Tool_Product_Settings, Tool_Configuration, Tool_Type, \ Endpoint, JIRA_Project, JIRA_Instance, DojoMeta, Development_Environment, \ Dojo_User, Note_Type, System_Settings, App_Analysis, Endpoint_Status, \ Sonarqube_Issue, Sonarqube_Issue_Transition, Regulation, \ BurpRawRequestResponse, FileUpload, Product_Type_Member, Product_Member, Dojo_Group, \ Product_Group, Product_Type_Group, Role, Global_Role, Dojo_Group_Member, Engagement_Presets, Network_Locations, \ UserContactInfo, Product_API_Scan_Configuration from dojo.endpoint.views import get_endpoint_ids from dojo.reports.views import report_url_resolver, prefetch_related_findings_for_report from dojo.finding.views import set_finding_as_original_internal, reset_finding_duplicate_status_internal, \ duplicate_cluster from dojo.filters import ReportFindingFilter, \ ApiFindingFilter, ApiProductFilter, ApiEngagementFilter, ApiEndpointFilter, \ ApiAppAnalysisFilter, ApiTestFilter, ApiTemplateFindingFilter from dojo.risk_acceptance import api as ra_api from dateutil.relativedelta import relativedelta from django.conf import settings from datetime import datetime from dojo.utils import get_period_counts_legacy, get_system_setting from dojo.api_v2 import serializers, permissions, prefetch, schema import dojo.jira_link.helper as jira_helper import logging import tagulous from dojo.product_type.queries import get_authorized_product_types, get_authorized_product_type_members, \ get_authorized_product_type_groups from dojo.product.queries import get_authorized_products, get_authorized_app_analysis, get_authorized_dojo_meta, \ get_authorized_product_members, get_authorized_product_groups, get_authorized_languages, \ get_authorized_engagement_presets, get_authorized_product_api_scan_configurations from dojo.engagement.queries import get_authorized_engagements from dojo.test.queries import get_authorized_tests, get_authorized_test_imports from dojo.finding.queries import get_authorized_findings, get_authorized_stub_findings from dojo.endpoint.queries import get_authorized_endpoints, get_authorized_endpoint_status from dojo.group.queries import get_authorized_groups, get_authorized_group_members from dojo.jira_link.queries import get_authorized_jira_projects, get_authorized_jira_issues from dojo.tool_product.queries import get_authorized_tool_product_settings from drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schema, extend_schema_view from dojo.authorization.roles_permissions import Permissions logger = logging.getLogger(__name__) # Authorization: authenticated users class RoleViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): serializer_class = serializers.RoleSerializer queryset = Role.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name') permission_classes = (IsAuthenticated, ) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class DojoGroupViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.DojoGroupSerializer queryset = Dojo_Group.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name') swagger_schema = prefetch.get_prefetch_schema(["dojo_groups_list", "dojo_groups_read"], serializers.DojoGroupSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasDojoGroupPermission) def get_queryset(self): return get_authorized_groups(Permissions.Group_View).distinct() # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class DojoGroupMemberViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.DojoGroupMemberSerializer queryset = Dojo_Group_Member.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'group_id', 'user_id') swagger_schema = prefetch.get_prefetch_schema(["dojo_group_members_list", "dojo_group_members_read"], serializers.DojoGroupMemberSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasDojoGroupMemberPermission) def get_queryset(self): return get_authorized_group_members(Permissions.Group_View).distinct() def partial_update(self, request, pk=None): # Object authorization won't work if not all data is provided response = {'message': 'Patch function is not offered in this path.'} return Response(response, status=status.HTTP_405_METHOD_NOT_ALLOWED) # Authorization: superuser class GlobalRoleViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.GlobalRoleSerializer queryset = Global_Role.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'user', 'group', 'role') swagger_schema = prefetch.get_prefetch_schema(["global_roles_list", "global_roles_read"], serializers.GlobalRoleSerializer).to_schema() permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) # Authorization: object-based class EndPointViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.EndpointSerializer queryset = Endpoint.objects.none() filter_backends = (DjangoFilterBackend,) filter_class = ApiEndpointFilter permission_classes = (IsAuthenticated, permissions.UserHasEndpointPermission) def get_queryset(self): return get_authorized_endpoints(Permissions.Endpoint_View).distinct() @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=True, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request, pk=None): endpoint = self.get_object() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, endpoint, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) # Authorization: object-based class EndpointStatusViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.EndpointStatusSerializer queryset = Endpoint_Status.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('mitigated', 'false_positive', 'out_of_scope', 'risk_accepted', 'mitigated_by', 'finding', 'endpoint') permission_classes = (IsAuthenticated, permissions.UserHasEndpointStatusPermission) def get_queryset(self): return get_authorized_endpoint_status(Permissions.Endpoint_View).distinct() # Authorization: object-based class EngagementViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, ra_api.AcceptedRisksMixin, viewsets.GenericViewSet): serializer_class = serializers.EngagementSerializer queryset = Engagement.objects.none() filter_backends = (DjangoFilterBackend,) filter_class = ApiEngagementFilter permission_classes = (IsAuthenticated, permissions.UserHasEngagementPermission) @property def risk_application_model_class(self): return Engagement def get_queryset(self): return get_authorized_engagements(Permissions.Engagement_View).prefetch_related( 'notes', 'risk_acceptance', 'files').distinct() @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_200_OK: ""} ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_200_OK: ""} ) @action(detail=True, methods=["post"]) def close(self, request, pk=None): eng = self.get_object() close_engagement(eng) return HttpResponse() @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_200_OK: ""} ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_200_OK: ""} ) @action(detail=True, methods=["post"]) def reopen(self, request, pk=None): eng = self.get_object() reopen_engagement(eng) return HttpResponse() @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=True, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request, pk=None): engagement = self.get_object() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, engagement, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.EngagementToNotesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.EngagementToNotesSerializer} ) @swagger_auto_schema( methods=['post'], request_body=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @action(detail=True, methods=["get", "post"]) def notes(self, request, pk=None): engagement = self.get_object() if request.method == 'POST': new_note = serializers.AddNewNoteOptionSerializer(data=request.data) if new_note.is_valid(): entry = new_note.validated_data['entry'] private = new_note.validated_data.get('private', False) note_type = new_note.validated_data.get('note_type', None) else: return Response(new_note.errors, status=status.HTTP_400_BAD_REQUEST) author = request.user note = Notes(entry=entry, author=author, private=private, note_type=note_type) note.save() engagement.notes.add(note) serialized_note = serializers.NoteSerializer({ "author": author, "entry": entry, "private": private }) result = serializers.EngagementToNotesSerializer({ "engagement_id": engagement, "notes": [serialized_note.data] }) return Response(serialized_note.data, status=status.HTTP_201_CREATED) notes = engagement.notes.all() serialized_notes = serializers.EngagementToNotesSerializer({ "engagement_id": engagement, "notes": notes }) return Response(serialized_notes.data, status=status.HTTP_200_OK) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.EngagementToFilesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.EngagementToFilesSerializer} ) @swagger_auto_schema( method='post', request_body=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @action(detail=True, methods=["get", "post"], parser_classes=(MultiPartParser,)) def files(self, request, pk=None): engagement = self.get_object() if request.method == 'POST': new_file = serializers.FileSerializer(data=request.data) if new_file.is_valid(): title = new_file.validated_data['title'] file = new_file.validated_data['file'] else: return Response(new_file.errors, status=status.HTTP_400_BAD_REQUEST) file = FileUpload(title=title, file=file) file.save() engagement.files.add(file) serialized_file = serializers.FileSerializer(file) return Response(serialized_file.data, status=status.HTTP_201_CREATED) files = engagement.files.all() serialized_files = serializers.EngagementToFilesSerializer({ "engagement_id": engagement, "files": files }) return Response(serialized_files.data, status=status.HTTP_200_OK) # These are technologies in the UI and the API! # Authorization: object-based class AppAnalysisViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.AppAnalysisSerializer queryset = App_Analysis.objects.none() filter_backends = (DjangoFilterBackend,) filter_class = ApiAppAnalysisFilter permission_classes = (IsAuthenticated, permissions.UserHasAppAnalysisPermission) def get_queryset(self): return get_authorized_app_analysis(Permissions.Product_View) # Authorization: configuration class FindingTemplatesViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.FindingTemplateSerializer queryset = Finding_Template.objects.all() filter_backends = (DjangoFilterBackend,) filter_class = ApiTemplateFindingFilter permission_classes = (permissions.UserHasConfigurationPermissionStaff, ) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("related_fields", OpenApiTypes.BOOL, OpenApiParameter.QUERY, required=False, description="Expand finding external relations (engagement, environment, product, \ product_type, test, test_type)"), OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("related_fields", OpenApiTypes.BOOL, OpenApiParameter.QUERY, required=False, description="Expand finding external relations (engagement, environment, product, \ product_type, test, test_type)"), OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class FindingViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, ra_api.AcceptedFindingsMixin, viewsets.GenericViewSet): serializer_class = serializers.FindingSerializer queryset = Finding.objects.none() filter_backends = (DjangoFilterBackend,) filterset_class = ApiFindingFilter permission_classes = (IsAuthenticated, permissions.UserHasFindingPermission) _related_field_parameters = [openapi.Parameter( name="related_fields", in_=openapi.IN_QUERY, description="Expand finding external relations (engagement, environment, product, product_type, test, test_type)", type=openapi.TYPE_BOOLEAN)] swagger_schema = prefetch.get_prefetch_schema(["findings_list", "findings_read"], serializers.FindingSerializer). \ composeWith(schema.ExtraParameters("findings_list", _related_field_parameters)). \ composeWith(schema.ExtraParameters("findings_read", _related_field_parameters)). \ to_schema() # Overriding mixins.UpdateModeMixin perform_update() method to grab push_to_jira # data and add that as a parameter to .save() def perform_update(self, serializer): # IF JIRA is enabled and this product has a JIRA configuration push_to_jira = serializer.validated_data.get('push_to_jira') jira_project = jira_helper.get_jira_project(serializer.instance) if get_system_setting('enable_jira') and jira_project: push_to_jira = push_to_jira or jira_project.push_all_issues serializer.save(push_to_jira=push_to_jira) def get_queryset(self): findings = get_authorized_findings(Permissions.Finding_View).prefetch_related('endpoints', 'reviewers', 'found_by', 'notes', 'risk_acceptance_set', 'test', 'tags', 'jira_issue', 'finding_group_set', 'files', 'burprawrequestresponse_set', 'endpoint_status', 'finding_meta', 'test__test_type', 'test__engagement', 'test__environment', 'test__engagement__product', 'test__engagement__product__prod_type') return findings.distinct() def get_serializer_class(self): if self.request and self.request.method == 'POST': return serializers.FindingCreateSerializer else: return serializers.FindingSerializer @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.TagSerializer} ) @extend_schema( methods=['POST'], request=serializers.TagSerializer, responses={status.HTTP_201_CREATED: serializers.TagSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.TagSerializer} ) @swagger_auto_schema( method='post', request_body=serializers.TagSerializer, responses={status.HTTP_200_OK: serializers.TagSerializer} ) @action(detail=True, methods=['get', 'post']) def tags(self, request, pk=None): finding = self.get_object() if request.method == 'POST': new_tags = serializers.TagSerializer(data=request.data) if new_tags.is_valid(): all_tags = finding.tags all_tags = serializers.TagSerializer({"tags": all_tags}).data['tags'] for tag in tagulous.utils.parse_tags(new_tags.validated_data['tags']): if tag not in all_tags: all_tags.append(tag) new_tags = tagulous.utils.render_tags(all_tags) finding.tags = new_tags finding.save() else: return Response(new_tags.errors, status=status.HTTP_400_BAD_REQUEST) tags = finding.tags serialized_tags = serializers.TagSerializer({"tags": tags}) return Response(serialized_tags.data) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.BurpRawRequestResponseSerializer} ) @extend_schema( methods=['POST'], request=serializers.BurpRawRequestResponseSerializer, responses={status.HTTP_201_CREATED: serializers.BurpRawRequestResponseSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.BurpRawRequestResponseSerializer} ) @swagger_auto_schema( method='post', request_body=serializers.BurpRawRequestResponseSerializer, responses={status.HTTP_200_OK: serializers.BurpRawRequestResponseSerializer} ) @action(detail=True, methods=['get', 'post']) def request_response(self, request, pk=None): finding = self.get_object() if request.method == 'POST': burps = serializers.BurpRawRequestResponseSerializer(data=request.data, many=isinstance(request.data, list)) if burps.is_valid(): for pair in burps.validated_data['req_resp']: burp_rr = BurpRawRequestResponse( finding=finding, burpRequestBase64=base64.b64encode(pair["request"].encode("utf-8")), burpResponseBase64=base64.b64encode(pair["response"].encode("utf-8")), ) burp_rr.clean() burp_rr.save() else: return Response(burps.errors, status=status.HTTP_400_BAD_REQUEST) burp_req_resp = BurpRawRequestResponse.objects.filter(finding=finding) burp_list = [] for burp in burp_req_resp: request = burp.get_request() response = burp.get_response() burp_list.append({'request': request, 'response': response}) serialized_burps = serializers.BurpRawRequestResponseSerializer({'req_resp': burp_list}) return Response(serialized_burps.data) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.FindingToNotesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.FindingToNotesSerializer} ) @swagger_auto_schema( methods=['post'], request_body=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @action(detail=True, methods=["get", "post"]) def notes(self, request, pk=None): finding = self.get_object() if request.method == 'POST': new_note = serializers.AddNewNoteOptionSerializer(data=request.data) if new_note.is_valid(): entry = new_note.validated_data['entry'] private = new_note.validated_data.get('private', False) note_type = new_note.validated_data.get('note_type', None) else: return Response(new_note.errors, status=status.HTTP_400_BAD_REQUEST) author = request.user note = Notes(entry=entry, author=author, private=private, note_type=note_type) note.save() finding.notes.add(note) if finding.has_jira_issue: jira_helper.add_comment(finding, note) elif finding.has_jira_group_issue: jira_helper.add_comment(finding.finding_group, note) serialized_note = serializers.NoteSerializer({ "author": author, "entry": entry, "private": private }) result = serializers.FindingToNotesSerializer({ "finding_id": finding, "notes": [serialized_note.data] }) return Response(serialized_note.data, status=status.HTTP_201_CREATED) notes = finding.notes.all() serialized_notes = serializers.FindingToNotesSerializer({ "finding_id": finding, "notes": notes }) return Response(serialized_notes.data, status=status.HTTP_200_OK) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.FindingToFilesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.FindingToFilesSerializer} ) @swagger_auto_schema( method='post', request_body=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @action(detail=True, methods=["get", "post"], parser_classes=(MultiPartParser,)) def files(self, request, pk=None): finding = self.get_object() if request.method == 'POST': new_file = serializers.FileSerializer(data=request.data) if new_file.is_valid(): title = new_file.validated_data['title'] file = new_file.validated_data['file'] else: return Response(new_file.errors, status=status.HTTP_400_BAD_REQUEST) file = FileUpload(title=title, file=file) file.save() finding.files.add(file) serialized_file = serializers.FileSerializer(file) return Response(serialized_file.data, status=status.HTTP_201_CREATED) files = finding.files.all() serialized_files = serializers.FindingToFilesSerializer({ "finding_id": finding, "files": files }) return Response(serialized_files.data, status=status.HTTP_200_OK) @extend_schema( request=serializers.FindingNoteSerializer, responses={status.HTTP_204_NO_CONTENT: ""} ) @swagger_auto_schema( request_body=serializers.FindingNoteSerializer, responses={status.HTTP_204_NO_CONTENT: ""} ) @action(detail=True, methods=["patch"]) def remove_note(self, request, pk=None): """Remove Note From Finding Note""" finding = self.get_object() notes = finding.notes.all() if request.data['note_id']: note = get_object_or_404(Notes.objects, id=request.data['note_id']) if note not in notes: return Response({"error": "Selected Note is not assigned to this Finding"}, status=status.HTTP_400_BAD_REQUEST) else: return Response({"error": "('note_id') parameter missing"}, status=status.HTTP_400_BAD_REQUEST) if note.author.username == request.user.username or request.user.is_superuser: finding.notes.remove(note) note.delete() else: return Response({"error": "Delete Failed, You are not the Note's author"}, status=status.HTTP_400_BAD_REQUEST) return Response({"Success": "Selected Note has been Removed successfully"}, status=status.HTTP_204_NO_CONTENT) @extend_schema( methods=['PUT', 'PATCH'], request=serializers.TagSerializer, responses={status.HTTP_204_NO_CONTENT: ""}, ) @swagger_auto_schema( methods=['put', 'patch'], request_body=serializers.TagSerializer, responses={status.HTTP_204_NO_CONTENT: ""}, ) @action(detail=True, methods=["put", "patch"]) def remove_tags(self, request, pk=None): """ Remove Tag(s) from finding list of tags """ finding = self.get_object() delete_tags = serializers.TagSerializer(data=request.data) if delete_tags.is_valid(): all_tags = finding.tags all_tags = serializers.TagSerializer({"tags": all_tags}).data['tags'] # serializer turns it into a string, but we need a list del_tags = tagulous.utils.parse_tags(delete_tags.validated_data['tags']) if len(del_tags) < 1: return Response({"error": "Empty Tag List Not Allowed"}, status=status.HTTP_400_BAD_REQUEST) for tag in del_tags: if tag not in all_tags: return Response({"error": "'{}' is not a valid tag in list".format(tag)}, status=status.HTTP_400_BAD_REQUEST) all_tags.remove(tag) new_tags = tagulous.utils.render_tags(all_tags) finding.tags = new_tags finding.save() return Response({"success": "Tag(s) Removed"}, status=status.HTTP_204_NO_CONTENT) else: return Response(delete_tags.errors, status=status.HTTP_400_BAD_REQUEST) @extend_schema( responses={status.HTTP_200_OK: serializers.FindingSerializer(many=True)} ) @swagger_auto_schema( responses={status.HTTP_200_OK: serializers.FindingSerializer(many=True)} ) @action(detail=True, methods=['get'], url_path=r'duplicate', filter_backends=[], pagination_class=None) def get_duplicate_cluster(self, request, pk): finding = self.get_object() result = duplicate_cluster(request, finding) serializer = serializers.FindingSerializer(instance=result, many=True, context={"request": request}) return Response(serializer.data, status=status.HTTP_200_OK) @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_204_NO_CONTENT: ""}, ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_204_NO_CONTENT: ""}, ) @action(detail=True, methods=['post'], url_path=r'duplicate/reset') def reset_finding_duplicate_status(self, request, pk): finding = self.get_object() checked_duplicate_id = reset_finding_duplicate_status_internal(request.user, pk) if checked_duplicate_id is None: return Response(status=status.HTTP_400_BAD_REQUEST) return Response(status=status.HTTP_204_NO_CONTENT) @extend_schema( request=OpenApiTypes.NONE, parameters=[ OpenApiParameter("new_fid", OpenApiTypes.INT, OpenApiParameter.PATH) ], responses={status.HTTP_204_NO_CONTENT: ""}, ) @swagger_auto_schema( responses={status.HTTP_204_NO_CONTENT: ""}, request_body=no_body ) @action(detail=True, methods=['post'], url_path=r'original/(?P<new_fid>\d+)') def set_finding_as_original(self, request, pk, new_fid): finding = self.get_object() success = set_finding_as_original_internal(request.user, pk, new_fid) if not success: return Response(status=status.HTTP_400_BAD_REQUEST) return Response(status=status.HTTP_204_NO_CONTENT) @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=False, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request): findings = self.get_queryset() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, findings, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) def _get_metadata(self, request, finding): metadata = DojoMeta.objects.filter(finding=finding) serializer = serializers.FindingMetaSerializer(instance=metadata, many=True) return Response(serializer.data, status=status.HTTP_200_OK) def _edit_metadata(self, request, finding): metadata_name = request.query_params.get("name", None) if metadata_name is None: return Response("Metadata name is required", status=status.HTTP_400_BAD_REQUEST) try: DojoMeta.objects.update_or_create( name=metadata_name, finding=finding, defaults={ "name": request.data.get("name"), "value": request.data.get("value") } ) return Response(data=request.data, status=status.HTTP_200_OK) except IntegrityError: return Response("Update failed because the new name already exists", status=status.HTTP_400_BAD_REQUEST) def _add_metadata(self, request, finding): metadata_data = serializers.FindingMetaSerializer(data=request.data) if metadata_data.is_valid(): name = metadata_data.validated_data["name"] value = metadata_data.validated_data["value"] metadata = DojoMeta(finding=finding, name=name, value=value) try: metadata.validate_unique() metadata.save() except ValidationError: return Response("Create failed probably because the name of the metadata already exists", status=status.HTTP_400_BAD_REQUEST) return Response(data=metadata_data.data, status=status.HTTP_200_OK) else: return Response(metadata_data.errors, status=status.HTTP_400_BAD_REQUEST) def _remove_metadata(self, request, finding): name = request.query_params.get("name", None) if name is None: return Response("A metadata name must be provided", status=status.HTTP_400_BAD_REQUEST) metadata = get_object_or_404(DojoMeta.objects, finding=finding, name=name) metadata.delete() return Response("Metadata deleted", status=status.HTTP_200_OK) @extend_schema( methods=['GET'], responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer(many=True), status.HTTP_404_NOT_FOUND: OpenApiResponse(description="Returned if finding does not exist"), }, ) @extend_schema( methods=['DELETE'], parameters=[ OpenApiParameter("name", OpenApiTypes.INT, OpenApiParameter.QUERY, required=True, description="name of the metadata to retrieve. If name is empty, return all the \ metadata associated with the finding") ], responses={ status.HTTP_200_OK: OpenApiResponse(description="Returned if the metadata was correctly deleted"), status.HTTP_404_NOT_FOUND: OpenApiResponse(description="Returned if finding does not exist"), status.HTTP_400_BAD_REQUEST: OpenApiResponse(description="Returned if there was a problem with the metadata information"), }, # manual_parameters=[openapi.Parameter( # name="name", in_=openapi.IN_QUERY, type=openapi.TYPE_STRING, # description="name of the metadata to retrieve. If name is empty, return all the \ # metadata associated with the finding")] ) @extend_schema( methods=['PUT'], request=serializers.FindingMetaSerializer, responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer, status.HTTP_404_NOT_FOUND: OpenApiResponse(description="Returned if finding does not exist"), status.HTTP_400_BAD_REQUEST: OpenApiResponse(description="Returned if there was a problem with the metadata information"), }, # manual_parameters=[openapi.Parameter( # name="name", in_=openapi.IN_QUERY, required=True, type=openapi.TYPE_STRING, # description="name of the metadata to edit")], ) @extend_schema( methods=['POST'], request=serializers.FindingMetaSerializer, responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer, status.HTTP_404_NOT_FOUND: OpenApiResponse(description="Returned if finding does not exist"), status.HTTP_400_BAD_REQUEST: OpenApiResponse(description="Returned if there was a problem with the metadata information"), }, ) @swagger_auto_schema( responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer(many=True), status.HTTP_404_NOT_FOUND: "Returned if finding does not exist" }, methods=['get'] ) @swagger_auto_schema( responses={ status.HTTP_200_OK: "Returned if the metadata was correctly deleted", status.HTTP_404_NOT_FOUND: "Returned if finding does not exist", status.HTTP_400_BAD_REQUEST: "Returned if there was a problem with the metadata information" }, methods=['delete'], manual_parameters=[openapi.Parameter( name="name", in_=openapi.IN_QUERY, required=True, type=openapi.TYPE_STRING, description="name of the metadata to retrieve. If name is empty, return all the \ metadata associated with the finding")] ) @swagger_auto_schema( responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer, status.HTTP_404_NOT_FOUND: "Returned if finding does not exist", status.HTTP_400_BAD_REQUEST: "Returned if there was a problem with the metadata information" }, methods=['put'], manual_parameters=[openapi.Parameter( name="name", in_=openapi.IN_QUERY, required=True, type=openapi.TYPE_STRING, description="name of the metadata to edit")], request_body=serializers.FindingMetaSerializer ) @swagger_auto_schema( responses={ status.HTTP_200_OK: serializers.FindingMetaSerializer, status.HTTP_404_NOT_FOUND: "Returned if finding does not exist", status.HTTP_400_BAD_REQUEST: "Returned if there was a problem with the metadata information" }, methods=['post'], request_body=serializers.FindingMetaSerializer ) @action(detail=True, methods=["post", "put", "delete", "get"], filter_backends=[], pagination_class=None) def metadata(self, request, pk=None): finding = self.get_object() if request.method == "GET": return self._get_metadata(request, finding) elif request.method == "POST": return self._add_metadata(request, finding) elif request.method == "PUT": return self._edit_metadata(request, finding) elif request.method == "PATCH": return self._edit_metadata(request, finding) elif request.method == "DELETE": return self._remove_metadata(request, finding) return Response({"error", "unsupported method"}, status=status.HTTP_400_BAD_REQUEST) # Authorization: configuration class JiraInstanceViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.JIRAInstanceSerializer queryset = JIRA_Instance.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'url') permission_classes = (permissions.UserHasConfigurationPermissionSuperuser, ) # Authorization: object-based class JiraIssuesViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.JIRAIssueSerializer queryset = JIRA_Issue.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'jira_id', 'jira_key', 'finding', 'engagement', 'finding_group') permission_classes = (IsAuthenticated, permissions.UserHasJiraIssuePermission) def get_queryset(self): return get_authorized_jira_issues(Permissions.Product_View) # Authorization: object-based class JiraProjectViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.JIRAProjectSerializer queryset = JIRA_Project.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'jira_instance', 'product', 'engagement', 'component', 'project_key', 'push_all_issues', 'enable_engagement_epic_mapping', 'push_notes') permission_classes = (IsAuthenticated, permissions.UserHasJiraProductPermission) def get_queryset(self): return get_authorized_jira_projects(Permissions.Product_View) # Authorization: superuser class SonarqubeIssueViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.SonarqubeIssueSerializer queryset = Sonarqube_Issue.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'key', 'status', 'type') permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) # Authorization: superuser class SonarqubeIssueTransitionViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.SonarqubeIssueTransitionSerializer queryset = Sonarqube_Issue_Transition.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'sonarqube_issue', 'finding_status', 'sonarqube_status', 'transitions') permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) # Authorization: object-based class ProductAPIScanConfigurationViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductAPIScanConfigurationSerializer queryset = Product_API_Scan_Configuration.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product', 'tool_configuration', 'service_key_1', 'service_key_2', 'service_key_3') permission_classes = (IsAuthenticated, permissions.UserHasProductAPIScanConfigurationPermission) def get_queryset(self): return get_authorized_product_api_scan_configurations(Permissions.Product_API_Scan_Configuration_View) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class DojoMetaViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.MetaSerializer queryset = DojoMeta.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product', 'endpoint', 'finding', 'name', 'value') permission_classes = (IsAuthenticated, permissions.UserHasDojoMetaPermission) swagger_schema = prefetch.get_prefetch_schema(["metadata_list", "metadata_read"], serializers.MetaSerializer).to_schema() def get_queryset(self): return get_authorized_dojo_meta(Permissions.Product_View) # Authorization: object-based class DjangoFilterDescriptionInspector(CoreAPICompatInspector): def get_filter_parameters(self, filter_backend): if isinstance(filter_backend, DjangoFilterBackend): result = super(DjangoFilterDescriptionInspector, self).get_filter_parameters(filter_backend) for param in result: if not param.get('description', ''): param.description = "Filter the returned list by {field_name}".format(field_name=param.name) return result return NotHandled @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) @method_decorator(name='list', decorator=swagger_auto_schema( filter_inspectors=[DjangoFilterDescriptionInspector] )) class ProductViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductSerializer # TODO: prefetch queryset = Product.objects.none() filter_backends = (DjangoFilterBackend,) filterset_class = ApiProductFilter swagger_schema = prefetch.get_prefetch_schema(["products_list", "products_read"], serializers.ProductSerializer). \ to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductPermission) def get_queryset(self): return get_authorized_products(Permissions.Product_View).distinct() # def list(self, request): # print(vars(request)) # # Note the use of `get_queryset()` instead of `self.queryset` # queryset = self.get_queryset() # serializer = self.serializer_class(queryset, many=True) # return Response(serializer.data) @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=True, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request, pk=None): product = self.get_object() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, product, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class ProductMemberViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductMemberSerializer queryset = Product_Member.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product_id', 'user_id') swagger_schema = prefetch.get_prefetch_schema(["product_members_list", "product_members_read"], serializers.ProductMemberSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductMemberPermission) def get_queryset(self): return get_authorized_product_members(Permissions.Product_View).distinct() @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) def partial_update(self, request, pk=None): # Object authorization won't work if not all data is provided response = {'message': 'Patch function is not offered in this path.'} return Response(response, status=status.HTTP_405_METHOD_NOT_ALLOWED) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class ProductGroupViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductGroupSerializer queryset = Product_Group.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product_id', 'group_id') swagger_schema = prefetch.get_prefetch_schema(["product_groups_list", "product_groups_read"], serializers.ProductGroupSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductGroupPermission) def get_queryset(self): return get_authorized_product_groups(Permissions.Product_Group_View).distinct() @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) def partial_update(self, request, pk=None): # Object authorization won't work if not all data is provided response = {'message': 'Patch function is not offered in this path.'} return Response(response, status=status.HTTP_405_METHOD_NOT_ALLOWED) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class ProductTypeViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductTypeSerializer queryset = Product_Type.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'critical_product', 'key_product', 'created', 'updated') swagger_schema = prefetch.get_prefetch_schema(["product_types_list", "product_types_read"], serializers.ProductTypeSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductTypePermission) def get_queryset(self): return get_authorized_product_types(Permissions.Product_Type_View).distinct() # Overwrite perfom_create of CreateModelMixin to add current user as owner def perform_create(self, serializer): serializer.save() product_type_data = serializer.data product_type_data.pop('authorization_groups') product_type_data.pop('members') member = Product_Type_Member() member.user = self.request.user member.product_type = Product_Type(**product_type_data) member.role = Role.objects.get(is_owner=True) member.save() @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=True, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request, pk=None): product_type = self.get_object() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, product_type, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class ProductTypeMemberViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductTypeMemberSerializer queryset = Product_Type_Member.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product_type_id', 'user_id') swagger_schema = prefetch.get_prefetch_schema(["product_type_members_list", "product_type_members_read"], serializers.ProductTypeMemberSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductTypeMemberPermission) def get_queryset(self): return get_authorized_product_type_members(Permissions.Product_Type_View).distinct() def destroy(self, request, *args, **kwargs): instance = self.get_object() if instance.role.is_owner: owners = Product_Type_Member.objects.filter(product_type=instance.product_type, role__is_owner=True).count() if owners <= 1: return Response('There must be at least one owner', status=status.HTTP_400_BAD_REQUEST) self.perform_destroy(instance) return Response(status=status.HTTP_204_NO_CONTENT) @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) def partial_update(self, request, pk=None): # Object authorization won't work if not all data is provided response = {'message': 'Patch function is not offered in this path.'} return Response(response, status=status.HTTP_405_METHOD_NOT_ALLOWED) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class ProductTypeGroupViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ProductTypeGroupSerializer queryset = Product_Type_Group.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'product_type_id', 'group_id') swagger_schema = prefetch.get_prefetch_schema(["product_type_groups_list", "product_type_groups_read"], serializers.ProductTypeGroupSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasProductTypeGroupPermission) def get_queryset(self): return get_authorized_product_type_groups(Permissions.Product_Type_Group_View).distinct() @extend_schema( request=OpenApiTypes.NONE, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) @swagger_auto_schema( request_body=no_body, responses={status.HTTP_405_METHOD_NOT_ALLOWED: ""}, ) def partial_update(self, request, pk=None): # Object authorization won't work if not all data is provided response = {'message': 'Patch function is not offered in this path.'} return Response(response, status=status.HTTP_405_METHOD_NOT_ALLOWED) # Authorization: object-based class StubFindingsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.StubFindingSerializer queryset = Stub_Finding.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'title', 'date', 'severity', 'description') permission_classes = (IsAuthenticated, permissions.UserHasFindingPermission) def get_queryset(self): return get_authorized_stub_findings(Permissions.Finding_View).distinct() def get_serializer_class(self): if self.request and self.request.method == 'POST': return serializers.StubFindingCreateSerializer else: return serializers.StubFindingSerializer # Authorization: authenticated, configuration class DevelopmentEnvironmentViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.DevelopmentEnvironmentSerializer queryset = Development_Environment.objects.all() filter_backends = (DjangoFilterBackend,) permission_classes = (IsAuthenticated, DjangoModelPermissions) # Authorization: object-based class TestsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, ra_api.AcceptedRisksMixin, viewsets.GenericViewSet): serializer_class = serializers.TestSerializer queryset = Test.objects.none() filter_backends = (DjangoFilterBackend,) filter_class = ApiTestFilter permission_classes = (IsAuthenticated, permissions.UserHasTestPermission) @property def risk_application_model_class(self): return Test def get_queryset(self): return get_authorized_tests(Permissions.Test_View).prefetch_related( 'notes', 'files').distinct() def get_serializer_class(self): if self.request and self.request.method == 'POST': if self.action == 'accept_risks': return ra_api.AcceptedRiskSerializer return serializers.TestCreateSerializer else: return serializers.TestSerializer @extend_schema( request=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @swagger_auto_schema( request_body=serializers.ReportGenerateOptionSerializer, responses={status.HTTP_200_OK: serializers.ReportGenerateSerializer}, ) @action(detail=True, methods=['post'], permission_classes=[IsAuthenticated]) def generate_report(self, request, pk=None): test = self.get_object() options = {} # prepare post data report_options = serializers.ReportGenerateOptionSerializer(data=request.data) if report_options.is_valid(): options['include_finding_notes'] = report_options.validated_data['include_finding_notes'] options['include_finding_images'] = report_options.validated_data['include_finding_images'] options['include_executive_summary'] = report_options.validated_data['include_executive_summary'] options['include_table_of_contents'] = report_options.validated_data['include_table_of_contents'] else: return Response(report_options.errors, status=status.HTTP_400_BAD_REQUEST) data = report_generate(request, test, options) report = serializers.ReportGenerateSerializer(data) return Response(report.data) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.TestToNotesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.TestToNotesSerializer} ) @swagger_auto_schema( methods=['post'], request_body=serializers.AddNewNoteOptionSerializer, responses={status.HTTP_201_CREATED: serializers.NoteSerializer} ) @action(detail=True, methods=["get", "post"]) def notes(self, request, pk=None): test = self.get_object() if request.method == 'POST': new_note = serializers.AddNewNoteOptionSerializer(data=request.data) if new_note.is_valid(): entry = new_note.validated_data['entry'] private = new_note.validated_data.get('private', False) note_type = new_note.validated_data.get('note_type', None) else: return Response(new_note.errors, status=status.HTTP_400_BAD_REQUEST) author = request.user note = Notes(entry=entry, author=author, private=private, note_type=note_type) note.save() test.notes.add(note) serialized_note = serializers.NoteSerializer({ "author": author, "entry": entry, "private": private }) result = serializers.TestToNotesSerializer({ "test_id": test, "notes": [serialized_note.data] }) return Response(serialized_note.data, status=status.HTTP_201_CREATED) notes = test.notes.all() serialized_notes = serializers.TestToNotesSerializer({ "test_id": test, "notes": notes }) return Response(serialized_notes.data, status=status.HTTP_200_OK) @extend_schema( methods=['GET'], responses={status.HTTP_200_OK: serializers.TestToFilesSerializer} ) @extend_schema( methods=['POST'], request=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.TestToFilesSerializer} ) @swagger_auto_schema( method='post', request_body=serializers.AddNewFileOptionSerializer, responses={status.HTTP_201_CREATED: serializers.FileSerializer} ) @action(detail=True, methods=["get", "post"], parser_classes=(MultiPartParser,)) def files(self, request, pk=None): test = self.get_object() if request.method == 'POST': new_file = serializers.FileSerializer(data=request.data) if new_file.is_valid(): title = new_file.validated_data['title'] file = new_file.validated_data['file'] else: return Response(new_file.errors, status=status.HTTP_400_BAD_REQUEST) file = FileUpload(title=title, file=file) file.save() test.files.add(file) serialized_file = serializers.FileSerializer(file) return Response(serialized_file.data, status=status.HTTP_201_CREATED) files = test.files.all() serialized_files = serializers.TestToFilesSerializer({ "test_id": test, "files": files }) return Response(serialized_files.data, status=status.HTTP_200_OK) # Authorization: authenticated, configuration class TestTypesViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.TestTypeSerializer queryset = Test_Type.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('name',) permission_classes = (IsAuthenticated, DjangoModelPermissions) @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class TestImportViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.TestImportSerializer queryset = Test_Import.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('test', 'findings_affected', 'version', 'branch_tag', 'build_id', 'commit_hash', 'test_import_finding_action__action', 'test_import_finding_action__finding', 'test_import_finding_action__created') swagger_schema = prefetch.get_prefetch_schema(["test_imports_list", "test_imports_read"], serializers.TestImportSerializer). \ to_schema() permission_classes = (IsAuthenticated, permissions.UserHasTestImportPermission) def get_queryset(self): return get_authorized_test_imports(Permissions.Test_View).prefetch_related( 'test_import_finding_action_set', 'findings_affected', 'findings_affected__endpoints', 'findings_affected__endpoint_status', 'findings_affected__finding_meta', 'findings_affected__jira_issue', 'findings_affected__burprawrequestresponse_set', 'findings_affected__jira_issue', 'findings_affected__jira_issue', 'findings_affected__jira_issue', 'findings_affected__reviewers', 'findings_affected__notes', 'findings_affected__notes__author', 'findings_affected__notes__history', 'findings_affected__files', 'findings_affected__found_by', 'findings_affected__tags', 'findings_affected__risk_acceptance_set', 'test', 'test__tags', 'test__notes', 'test__notes__author', 'test__files', 'test__test_type', 'test__engagement', 'test__environment', 'test__engagement__product', 'test__engagement__product__prod_type') # Authorization: configurations class ToolConfigurationsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ToolConfigurationSerializer queryset = Tool_Configuration.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'tool_type', 'url', 'authentication_type') permission_classes = (permissions.UserHasConfigurationPermissionSuperuser, ) # Authorization: object-based class ToolProductSettingsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ToolProductSettingsSerializer queryset = Tool_Product_Settings.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'product', 'tool_configuration', 'tool_project_id', 'url') permission_classes = (IsAuthenticated, permissions.UserHasToolProductSettingsPermission) def get_queryset(self): return get_authorized_tool_product_settings(Permissions.Product_View) # Authorization: configuration class ToolTypesViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ToolTypeSerializer queryset = Tool_Type.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'description') permission_classes = (permissions.UserHasConfigurationPermissionSuperuser, ) # Authorization: authenticated, configuration class RegulationsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.RegulationSerializer queryset = Regulation.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'description') permission_classes = (IsAuthenticated, DjangoModelPermissions) # Authorization: configuration class UsersViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.UserSerializer queryset = User.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'username', 'first_name', 'last_name', 'email') permission_classes = (permissions.UserHasConfigurationPermissionSuperuser, ) def destroy(self, request, *args, **kwargs): instance = self.get_object() if request.user == instance: return Response('Users may not delete themselves', status=status.HTTP_400_BAD_REQUEST) self.perform_destroy(instance) return Response(status=status.HTTP_204_NO_CONTENT) # Authorization: superuser @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class UserContactInfoViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): serializer_class = serializers.UserContactInfoSerializer queryset = UserContactInfo.objects.all() swagger_schema = prefetch.get_prefetch_schema(["user_contact_infos_list", "user_contact_infos_read"], serializers.UserContactInfoSerializer).to_schema() filter_backends = (DjangoFilterBackend,) filter_fields = '__all__' permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) # Authorization: authenticated users class UserProfileView(GenericAPIView): permission_classes = (IsAuthenticated, ) pagination_class = None serializer_class = serializers.UserProfileSerializer @swagger_auto_schema( method='get', responses={status.HTTP_200_OK: serializers.UserProfileSerializer} ) @action(detail=True, methods=["get"], filter_backends=[], pagination_class=None) def get(self, request, format=None): user = get_current_user() user_contact_info = user.usercontactinfo if hasattr(user, 'usercontactinfo') else None global_role = user.global_role if hasattr(user, 'global_role') else None dojo_group_member = Dojo_Group_Member.objects.filter(user=user) product_type_member = Product_Type_Member.objects.filter(user=user) product_member = Product_Member.objects.filter(user=user) serializer = serializers.UserProfileSerializer( {"user": user, "user_contact_info": user_contact_info, "global_role": global_role, "dojo_group_member": dojo_group_member, "product_type_member": product_type_member, "product_member": product_member}, many=False) return Response(serializer.data) # Authorization: authenticated users, DjangoModelPermissions class ImportScanView(mixins.CreateModelMixin, viewsets.GenericViewSet): """ Imports a scan report into an engagement or product. By ID: - Create a Product (or use an existing product) - Create an Engagement inside the product - Provide the id of the engagement in the `engagement` parameter In this scenario a new Test will be created inside the engagement. By Names: - Create a Product (or use an existing product) - Create an Engagement inside the product - Provide `product_name` - Provide `engagement_name` - Optionally provide `product_type_name` In this scenario Defect Dojo will look up the Engagement by the provided details. When using names you can let the importer automatically create Engagements, Products and Product_Types by using `auto_create_context=True`. """ serializer_class = serializers.ImportScanSerializer parser_classes = [MultiPartParser] queryset = Test.objects.none() permission_classes = (IsAuthenticated, permissions.UserHasImportPermission) def perform_create(self, serializer): _, _, _, engagement_id, engagement_name, product_name, product_type_name, auto_create_context = serializers.get_import_meta_data_from_dict(serializer.validated_data) product = get_target_product_if_exists(product_name) engagement = get_target_engagement_if_exists(engagement_id, engagement_name, product) # when using auto_create_context, the engagement or product may not have been created yet jira_driver = engagement if engagement else product if product else None jira_project = jira_helper.get_jira_project(jira_driver) if jira_driver else None push_to_jira = serializer.validated_data.get('push_to_jira') if get_system_setting('enable_jira') and jira_project: push_to_jira = push_to_jira or jira_project.push_all_issues logger.debug('push_to_jira: %s', serializer.validated_data.get('push_to_jira')) serializer.save(push_to_jira=push_to_jira) def get_queryset(self): return get_authorized_tests(Permissions.Import_Scan_Result) # Authorization: authenticated users, DjangoModelPermissions class EndpointMetaImporterView(mixins.CreateModelMixin, viewsets.GenericViewSet): """ Imports a CSV file into a product to propogate arbitrary meta and tags on endpoints. By Names: - Provide `product_name` of existing product By ID: - Provide the id of the product in the `product` parameter In this scenario Defect Dojo will look up the product by the provided details. """ serializer_class = serializers.EndpointMetaImporterSerializer parser_classes = [MultiPartParser] queryset = Product.objects.all() permission_classes = (IsAuthenticated, permissions.UserHasMetaImportPermission) def perform_create(self, serializer): serializer.save() def get_queryset(self): return get_authorized_products(Permissions.Endpoint_Edit) # Authorization: configuration class LanguageTypeViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.LanguageTypeSerializer queryset = Language_Type.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'language', 'color') permission_classes = (permissions.UserHasConfigurationPermissionStaff, ) # Authorization: object-based @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class LanguageViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.UpdateModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.LanguageSerializer queryset = Languages.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'language', 'product') swagger_schema = prefetch.get_prefetch_schema(["languages_list", "languages_read"], serializers.LanguageSerializer).to_schema() permission_classes = (IsAuthenticated, permissions.UserHasLanguagePermission) def get_queryset(self): return get_authorized_languages(Permissions.Language_View).distinct() # Authorization: object-based class ImportLanguagesView(mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.ImportLanguagesSerializer parser_classes = [MultiPartParser] queryset = Product.objects.none() permission_classes = (IsAuthenticated, permissions.UserHasLanguagePermission) def get_queryset(self): return get_authorized_products(Permissions.Language_Add) # Authorization: object-based class ReImportScanView(mixins.CreateModelMixin, viewsets.GenericViewSet): """ Reimports a scan report into an existing test. By ID: - Create a Product (or use an existing product) - Create an Engagement inside the product - Import a scan report and find the id of the Test - Provide this in the `test` parameter By Names: - Create a Product (or use an existing product) - Create an Engagement inside the product - Import a report which will create a Test - Provide `product_name` - Provide `engagement_name` - Optional: Provide `test_title` In this scenario Defect Dojo will look up the Test by the provided details. If no `test_title` is provided, the latest test inside the engagement will be chosen based on scan_type. When using names you can let the importer automatically create Engagements, Products and Product_Types by using `auto_create_context=True`. """ serializer_class = serializers.ReImportScanSerializer parser_classes = [MultiPartParser] queryset = Test.objects.none() permission_classes = (IsAuthenticated, permissions.UserHasReimportPermission) def get_queryset(self): return get_authorized_tests(Permissions.Import_Scan_Result) def perform_create(self, serializer): test_id, test_title, scan_type, _, engagement_name, product_name, product_type_name, auto_create_context = serializers.get_import_meta_data_from_dict(serializer.validated_data) product = get_target_product_if_exists(product_name) engagement = get_target_engagement_if_exists(None, engagement_name, product) test = get_target_test_if_exists(test_id, test_title, scan_type, engagement) # when using auto_create_context, the engagement or product may not have been created yet jira_driver = test if test else engagement if engagement else product if product else None jira_project = jira_helper.get_jira_project(jira_driver) if jira_driver else None push_to_jira = serializer.validated_data.get('push_to_jira') if get_system_setting('enable_jira') and jira_project: push_to_jira = push_to_jira or jira_project.push_all_issues logger.debug('push_to_jira: %s', serializer.validated_data.get('push_to_jira')) serializer.save(push_to_jira=push_to_jira) # Authorization: configuration class NoteTypeViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.NoteTypeSerializer queryset = Note_Type.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'name', 'description', 'is_single', 'is_active', 'is_mandatory') permission_classes = (permissions.UserHasConfigurationPermissionSuperuser, ) # Authorization: superuser class NotesViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.NoteSerializer queryset = Notes.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'entry', 'author', 'private', 'date', 'edited', 'edit_time', 'editor') permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) def report_generate(request, obj, options): user = Dojo_User.objects.get(id=request.user.id) product_type = None product = None engagement = None test = None endpoint = None endpoints = None endpoint_all_findings = None endpoint_monthly_counts = None endpoint_active_findings = None accepted_findings = None open_findings = None closed_findings = None verified_findings = None report_title = None report_subtitle = None include_finding_notes = False include_finding_images = False include_executive_summary = False include_table_of_contents = False report_info = "Generated By %s on %s" % ( user.get_full_name(), (timezone.now().strftime("%m/%d/%Y %I:%M%p %Z"))) # generate = "_generate" in request.GET report_name = str(obj) report_type = type(obj).__name__ include_finding_notes = options.get('include_finding_notes', False) include_finding_images = options.get('include_finding_images', False) include_executive_summary = options.get('include_executive_summary', False) include_table_of_contents = options.get('include_table_of_contents', False) if type(obj).__name__ == "Product_Type": product_type = obj report_name = "Product Type Report: " + str(product_type) report_title = "Product Type Report" report_subtitle = str(product_type) findings = ReportFindingFilter(request.GET, prod_type=product_type, queryset=prefetch_related_findings_for_report(Finding.objects.filter( test__engagement__product__prod_type=product_type))) products = Product.objects.filter(prod_type=product_type, engagement__test__finding__in=findings.qs).distinct() engagements = Engagement.objects.filter(product__prod_type=product_type, test__finding__in=findings.qs).distinct() tests = Test.objects.filter(engagement__product__prod_type=product_type, finding__in=findings.qs).distinct() if len(findings.qs) > 0: start_date = timezone.make_aware(datetime.combine(findings.qs.last().date, datetime.min.time())) else: start_date = timezone.now() end_date = timezone.now() r = relativedelta(end_date, start_date) months_between = (r.years * 12) + r.months # include current month months_between += 1 endpoint_monthly_counts = get_period_counts_legacy(findings.qs.order_by('numerical_severity'), findings.qs.order_by('numerical_severity'), None, months_between, start_date, relative_delta='months') elif type(obj).__name__ == "Product": product = obj report_name = "Product Report: " + str(product) report_title = "Product Report" report_subtitle = str(product) findings = ReportFindingFilter(request.GET, product=product, queryset=prefetch_related_findings_for_report(Finding.objects.filter( test__engagement__product=product))) ids = set(finding.id for finding in findings.qs) engagements = Engagement.objects.filter(test__finding__id__in=ids).distinct() tests = Test.objects.filter(finding__id__in=ids).distinct() ids = get_endpoint_ids(Endpoint.objects.filter(product=product).distinct()) endpoints = Endpoint.objects.filter(id__in=ids) elif type(obj).__name__ == "Engagement": engagement = obj findings = ReportFindingFilter(request.GET, engagement=engagement, queryset=prefetch_related_findings_for_report(Finding.objects.filter(test__engagement=engagement))) report_name = "Engagement Report: " + str(engagement) report_title = "Engagement Report" report_subtitle = str(engagement) ids = set(finding.id for finding in findings.qs) tests = Test.objects.filter(finding__id__in=ids).distinct() ids = get_endpoint_ids(Endpoint.objects.filter(product=engagement.product).distinct()) endpoints = Endpoint.objects.filter(id__in=ids) elif type(obj).__name__ == "Test": test = obj findings = ReportFindingFilter(request.GET, engagement=test.engagement, queryset=prefetch_related_findings_for_report(Finding.objects.filter(test=test))) filename = "test_finding_report.pdf" template = "dojo/test_pdf_report.html" report_name = "Test Report: " + str(test) report_title = "Test Report" report_subtitle = str(test) elif type(obj).__name__ == "Endpoint": endpoint = obj host = endpoint.host report_name = "Endpoint Report: " + host report_type = "Endpoint" endpoints = Endpoint.objects.filter(host=host, product=endpoint.product).distinct() report_title = "Endpoint Report" report_subtitle = host findings = ReportFindingFilter(request.GET, queryset=prefetch_related_findings_for_report(Finding.objects.filter(endpoints__in=endpoints))) elif type(obj).__name__ == "CastTaggedQuerySet": findings = ReportFindingFilter(request.GET, queryset=prefetch_related_findings_for_report(obj).distinct()) report_name = 'Finding' report_type = 'Finding' report_title = "Finding Report" report_subtitle = '' else: raise Http404() result = { 'product_type': product_type, 'product': product, 'engagement': engagement, 'report_name': report_name, 'report_info': report_info, 'test': test, 'endpoint': endpoint, 'endpoints': endpoints, 'findings': findings.qs.order_by('numerical_severity'), 'include_table_of_contents': include_table_of_contents, 'user': user, 'team_name': settings.TEAM_NAME, 'title': 'Generate Report', 'user_id': request.user.id, 'host': report_url_resolver(request), } finding_notes = [] finding_files = [] if include_finding_images: for finding in findings.qs.order_by('numerical_severity'): files = finding.files.all() if files: finding_files.append( { "finding_id": finding, "files": files } ) result['finding_files'] = finding_files if include_finding_notes: for finding in findings.qs.order_by('numerical_severity'): notes = finding.notes.filter(private=False) if notes: finding_notes.append( { "finding_id": finding, "notes": notes } ) result['finding_notes'] = finding_notes # Generating Executive summary based on obj type if include_executive_summary and type(obj).__name__ != "Endpoint": executive_summary = {} # Declare all required fields for executive summary engagement_name = None engagement_target_start = None engagement_target_end = None test_type_name = None test_target_start = None test_target_end = None test_environment_name = "unknown" # a default of "unknown" test_strategy_ref = None total_findings = 0 if type(obj).__name__ == "Product_Type": for prod_typ in obj.prod_type.all(): engmnts = prod_typ.engagement_set.all() if engmnts: for eng in engmnts: if eng.name: engagement_name = eng.name engagement_target_start = eng.target_start if eng.target_end: engagement_target_end = eng.target_end else: engagement_target_end = "ongoing" if eng.test_set.all(): for t in eng.test_set.all(): test_type_name = t.test_type.name if t.environment: test_environment_name = t.environment.name test_target_start = t.target_start if t.target_end: test_target_end = t.target_end else: test_target_end = "ongoing" if eng.test_strategy: test_strategy_ref = eng.test_strategy else: test_strategy_ref = "" total_findings = len(findings.qs.all()) elif type(obj).__name__ == "Product": engs = obj.engagement_set.all() if engs: for eng in engs: if eng.name: engagement_name = eng.name engagement_target_start = eng.target_start if eng.target_end: engagement_target_end = eng.target_end else: engagement_target_end = "ongoing" if eng.test_set.all(): for t in eng.test_set.all(): test_type_name = t.test_type.name if t.environment: test_environment_name = t.environment.name if eng.test_strategy: test_strategy_ref = eng.test_strategy else: test_strategy_ref = "" total_findings = len(findings.qs.all()) elif type(obj).__name__ == "Engagement": eng = obj if eng.name: engagement_name = eng.name engagement_target_start = eng.target_start if eng.target_end: engagement_target_end = eng.target_end else: engagement_target_end = "ongoing" if eng.test_set.all(): for t in eng.test_set.all(): test_type_name = t.test_type.name if t.environment: test_environment_name = t.environment.name if eng.test_strategy: test_strategy_ref = eng.test_strategy else: test_strategy_ref = "" total_findings = len(findings.qs.all()) elif type(obj).__name__ == "Test": t = obj test_type_name = t.test_type.name test_target_start = t.target_start if t.target_end: test_target_end = t.target_end else: test_target_end = "ongoing" total_findings = len(findings.qs.all()) if t.engagement.name: engagement_name = t.engagement.name engagement_target_start = t.engagement.target_start if t.engagement.target_end: engagement_target_end = t.engagement.target_end else: engagement_target_end = "ongoing" else: pass # do nothing executive_summary = { 'engagement_name': engagement_name, 'engagement_target_start': engagement_target_start, 'engagement_target_end': engagement_target_end, 'test_type_name': test_type_name, 'test_target_start': test_target_start, 'test_target_end': test_target_end, 'test_environment_name': test_environment_name, 'test_strategy_ref': test_strategy_ref, 'total_findings': total_findings } # End of executive summary generation result['executive_summary'] = executive_summary return result # Authorization: superuser class SystemSettingsViewSet(mixins.ListModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): """ Basic control over System Settings. Use 'id' 1 for PUT, PATCH operations """ permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) serializer_class = serializers.SystemSettingsSerializer queryset = System_Settings.objects.all() # Authorization: superuser @extend_schema_view( list=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ), retrieve=extend_schema(parameters=[ OpenApiParameter("prefetch", OpenApiTypes.STR, OpenApiParameter.QUERY, required=False, description="List of fields for which to prefetch model instances and add those to the response"), ], ) ) class NotificationsViewSet(prefetch.PrefetchListMixin, prefetch.PrefetchRetrieveMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.NotificationsSerializer queryset = Notifications.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'user', 'product') permission_classes = (permissions.IsSuperUser, DjangoModelPermissions) swagger_schema = prefetch.get_prefetch_schema(["notifications_list", "notifications_read"], serializers.NotificationsSerializer).to_schema() class EngagementPresetsViewset(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.EngagementPresetsSerializer queryset = Engagement_Presets.objects.none() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'title', 'product') permission_classes = (IsAuthenticated, permissions.UserHasEngagementPresetPermission) def get_queryset(self): return get_authorized_engagement_presets(Permissions.Product_View) class NetworkLocationsViewset(mixins.ListModelMixin,
mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): serializer_class = serializers.NetworkLocationsSerializer queryset = Network_Locations.objects.all() filter_backends = (DjangoFilterBackend,) filter_fields = ('id', 'location') permission_classes = (IsAuthenticated, DjangoModelPermissions)
IInbox.d.ts
/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ import { ethers, EventFilter, Signer, BigNumber, BigNumberish, PopulatedTransaction, } from 'ethers' import { Contract, ContractTransaction, Overrides, PayableOverrides, CallOverrides, } from '@ethersproject/contracts' import { BytesLike } from '@ethersproject/bytes' import { Listener, Provider } from '@ethersproject/providers' import { FunctionFragment, EventFragment, Result } from '@ethersproject/abi' interface IInboxInterface extends ethers.utils.Interface { functions: { 'bridge()': FunctionFragment 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)': FunctionFragment 'depositEth(uint256)': FunctionFragment 'sendContractTransaction(uint256,uint256,address,uint256,bytes)': FunctionFragment 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)': FunctionFragment 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)': FunctionFragment 'sendL2Message(bytes)': FunctionFragment 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)': FunctionFragment } encodeFunctionData(functionFragment: 'bridge', values?: undefined): string encodeFunctionData( functionFragment: 'createRetryableTicket', values: [ string, BigNumberish, BigNumberish, string, string, BigNumberish, BigNumberish, BytesLike ] ): string encodeFunctionData( functionFragment: 'depositEth', values: [BigNumberish] ): string encodeFunctionData( functionFragment: 'sendContractTransaction', values: [BigNumberish, BigNumberish, string, BigNumberish, BytesLike] ): string encodeFunctionData( functionFragment: 'sendL1FundedContractTransaction', values: [BigNumberish, BigNumberish, string, BytesLike] ): string encodeFunctionData( functionFragment: 'sendL1FundedUnsignedTransaction', values: [BigNumberish, BigNumberish, BigNumberish, string, BytesLike] ): string encodeFunctionData( functionFragment: 'sendL2Message', values: [BytesLike] ): string encodeFunctionData( functionFragment: 'sendUnsignedTransaction', values: [ BigNumberish, BigNumberish, BigNumberish, string, BigNumberish, BytesLike ] ): string decodeFunctionResult(functionFragment: 'bridge', data: BytesLike): Result decodeFunctionResult( functionFragment: 'createRetryableTicket', data: BytesLike ): Result decodeFunctionResult(functionFragment: 'depositEth', data: BytesLike): Result decodeFunctionResult( functionFragment: 'sendContractTransaction', data: BytesLike ): Result decodeFunctionResult( functionFragment: 'sendL1FundedContractTransaction', data: BytesLike ): Result decodeFunctionResult( functionFragment: 'sendL1FundedUnsignedTransaction', data: BytesLike ): Result decodeFunctionResult( functionFragment: 'sendL2Message', data: BytesLike ): Result decodeFunctionResult( functionFragment: 'sendUnsignedTransaction', data: BytesLike ): Result events: { 'InboxMessageDelivered(uint256,bytes)': EventFragment 'InboxMessageDeliveredFromOrigin(uint256)': EventFragment } getEvent(nameOrSignatureOrTopic: 'InboxMessageDelivered'): EventFragment getEvent( nameOrSignatureOrTopic: 'InboxMessageDeliveredFromOrigin' ): EventFragment } export class
extends Contract { connect(signerOrProvider: Signer | Provider | string): this attach(addressOrName: string): this deployed(): Promise<this> on(event: EventFilter | string, listener: Listener): this once(event: EventFilter | string, listener: Listener): this addListener(eventName: EventFilter | string, listener: Listener): this removeAllListeners(eventName: EventFilter | string): this removeListener(eventName: any, listener: Listener): this interface: IInboxInterface functions: { bridge(overrides?: CallOverrides): Promise<[string]> 'bridge()'(overrides?: CallOverrides): Promise<[string]> createRetryableTicket( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)'( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> depositEth( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<ContractTransaction> 'depositEth(uint256)'( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<ContractTransaction> sendContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendContractTransaction(uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> sendL1FundedContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> sendL1FundedUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> sendL2Message( messageData: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendL2Message(bytes)'( messageData: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> sendUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> } bridge(overrides?: CallOverrides): Promise<string> 'bridge()'(overrides?: CallOverrides): Promise<string> createRetryableTicket( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)'( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> depositEth( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<ContractTransaction> 'depositEth(uint256)'( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<ContractTransaction> sendContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendContractTransaction(uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> sendL1FundedContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> sendL1FundedUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<ContractTransaction> sendL2Message( messageData: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendL2Message(bytes)'( messageData: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> sendUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<ContractTransaction> callStatic: { bridge(overrides?: CallOverrides): Promise<string> 'bridge()'(overrides?: CallOverrides): Promise<string> createRetryableTicket( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)'( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> depositEth( maxSubmissionCost: BigNumberish, overrides?: CallOverrides ): Promise<BigNumber> 'depositEth(uint256)'( maxSubmissionCost: BigNumberish, overrides?: CallOverrides ): Promise<BigNumber> sendContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'sendContractTransaction(uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> sendL1FundedContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> sendL1FundedUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> sendL2Message( messageData: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'sendL2Message(bytes)'( messageData: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> sendUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: CallOverrides ): Promise<BigNumber> } filters: { InboxMessageDelivered( messageNum: BigNumberish | null, data: null ): EventFilter InboxMessageDeliveredFromOrigin( messageNum: BigNumberish | null ): EventFilter } estimateGas: { bridge(overrides?: CallOverrides): Promise<BigNumber> 'bridge()'(overrides?: CallOverrides): Promise<BigNumber> createRetryableTicket( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)'( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> depositEth( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<BigNumber> 'depositEth(uint256)'( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<BigNumber> sendContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<BigNumber> 'sendContractTransaction(uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<BigNumber> sendL1FundedContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> sendL1FundedUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<BigNumber> sendL2Message( messageData: BytesLike, overrides?: Overrides ): Promise<BigNumber> 'sendL2Message(bytes)'( messageData: BytesLike, overrides?: Overrides ): Promise<BigNumber> sendUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<BigNumber> 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<BigNumber> } populateTransaction: { bridge(overrides?: CallOverrides): Promise<PopulatedTransaction> 'bridge()'(overrides?: CallOverrides): Promise<PopulatedTransaction> createRetryableTicket( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> 'createRetryableTicket(address,uint256,uint256,address,address,uint256,uint256,bytes)'( destAddr: string, arbTxCallValue: BigNumberish, maxSubmissionCost: BigNumberish, submissionRefundAddress: string, valueRefundAddress: string, maxGas: BigNumberish, gasPriceBid: BigNumberish, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> depositEth( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<PopulatedTransaction> 'depositEth(uint256)'( maxSubmissionCost: BigNumberish, overrides?: PayableOverrides ): Promise<PopulatedTransaction> sendContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> 'sendContractTransaction(uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> sendL1FundedContractTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> 'sendL1FundedContractTransaction(uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> sendL1FundedUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> 'sendL1FundedUnsignedTransaction(uint256,uint256,uint256,address,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, data: BytesLike, overrides?: PayableOverrides ): Promise<PopulatedTransaction> sendL2Message( messageData: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> 'sendL2Message(bytes)'( messageData: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> sendUnsignedTransaction( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> 'sendUnsignedTransaction(uint256,uint256,uint256,address,uint256,bytes)'( maxGas: BigNumberish, gasPriceBid: BigNumberish, nonce: BigNumberish, destAddr: string, amount: BigNumberish, data: BytesLike, overrides?: Overrides ): Promise<PopulatedTransaction> } }
IInbox
tables.rs
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // NOTE: The following code was generated by "src/etc/unicode.py", do not edit directly #![allow(missing_docs, non_upper_case_globals, non_snake_case)] /// The version of [Unicode](http://www.unicode.org/) /// that the `UnicodeChar` and `UnicodeStrPrelude` traits are based on. pub const UNICODE_VERSION: (uint, uint, uint) = (7, 0, 0); fn
(c: char, r: &'static [(char,char)]) -> bool { use core::cmp::{Equal, Less, Greater}; use core::slice::SlicePrelude; r.binary_search(|&(lo,hi)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }).found().is_some() } pub mod general_category { pub static C_table: &'static [(char, char)] = &[ ('\x00', '\x1f'), ('\x7f', '\u009f'), ('\u00ad', '\u00ad'), ('\u0378', '\u0379'), ('\u0380', '\u0383'), ('\u038b', '\u038b'), ('\u038d', '\u038d'), ('\u03a2', '\u03a2'), ('\u0530', '\u0530'), ('\u0557', '\u0558'), ('\u0560', '\u0560'), ('\u0588', '\u0588'), ('\u058b', '\u058c'), ('\u0590', '\u0590'), ('\u05c8', '\u05cf'), ('\u05eb', '\u05ef'), ('\u05f5', '\u0605'), ('\u061c', '\u061d'), ('\u06dd', '\u06dd'), ('\u070e', '\u070f'), ('\u074b', '\u074c'), ('\u07b2', '\u07bf'), ('\u07fb', '\u07ff'), ('\u082e', '\u082f'), ('\u083f', '\u083f'), ('\u085c', '\u085d'), ('\u085f', '\u089f'), ('\u08b3', '\u08e3'), ('\u0984', '\u0984'), ('\u098d', '\u098e'), ('\u0991', '\u0992'), ('\u09a9', '\u09a9'), ('\u09b1', '\u09b1'), ('\u09b3', '\u09b5'), ('\u09ba', '\u09bb'), ('\u09c5', '\u09c6'), ('\u09c9', '\u09ca'), ('\u09cf', '\u09d6'), ('\u09d8', '\u09db'), ('\u09de', '\u09de'), ('\u09e4', '\u09e5'), ('\u09fc', '\u0a00'), ('\u0a04', '\u0a04'), ('\u0a0b', '\u0a0e'), ('\u0a11', '\u0a12'), ('\u0a29', '\u0a29'), ('\u0a31', '\u0a31'), ('\u0a34', '\u0a34'), ('\u0a37', '\u0a37'), ('\u0a3a', '\u0a3b'), ('\u0a3d', '\u0a3d'), ('\u0a43', '\u0a46'), ('\u0a49', '\u0a4a'), ('\u0a4e', '\u0a50'), ('\u0a52', '\u0a58'), ('\u0a5d', '\u0a5d'), ('\u0a5f', '\u0a65'), ('\u0a76', '\u0a80'), ('\u0a84', '\u0a84'), ('\u0a8e', '\u0a8e'), ('\u0a92', '\u0a92'), ('\u0aa9', '\u0aa9'), ('\u0ab1', '\u0ab1'), ('\u0ab4', '\u0ab4'), ('\u0aba', '\u0abb'), ('\u0ac6', '\u0ac6'), ('\u0aca', '\u0aca'), ('\u0ace', '\u0acf'), ('\u0ad1', '\u0adf'), ('\u0ae4', '\u0ae5'), ('\u0af2', '\u0b00'), ('\u0b04', '\u0b04'), ('\u0b0d', '\u0b0e'), ('\u0b11', '\u0b12'), ('\u0b29', '\u0b29'), ('\u0b31', '\u0b31'), ('\u0b34', '\u0b34'), ('\u0b3a', '\u0b3b'), ('\u0b45', '\u0b46'), ('\u0b49', '\u0b4a'), ('\u0b4e', '\u0b55'), ('\u0b58', '\u0b5b'), ('\u0b5e', '\u0b5e'), ('\u0b64', '\u0b65'), ('\u0b78', '\u0b81'), ('\u0b84', '\u0b84'), ('\u0b8b', '\u0b8d'), ('\u0b91', '\u0b91'), ('\u0b96', '\u0b98'), ('\u0b9b', '\u0b9b'), ('\u0b9d', '\u0b9d'), ('\u0ba0', '\u0ba2'), ('\u0ba5', '\u0ba7'), ('\u0bab', '\u0bad'), ('\u0bba', '\u0bbd'), ('\u0bc3', '\u0bc5'), ('\u0bc9', '\u0bc9'), ('\u0bce', '\u0bcf'), ('\u0bd1', '\u0bd6'), ('\u0bd8', '\u0be5'), ('\u0bfb', '\u0bff'), ('\u0c04', '\u0c04'), ('\u0c0d', '\u0c0d'), ('\u0c11', '\u0c11'), ('\u0c29', '\u0c29'), ('\u0c3a', '\u0c3c'), ('\u0c45', '\u0c45'), ('\u0c49', '\u0c49'), ('\u0c4e', '\u0c54'), ('\u0c57', '\u0c57'), ('\u0c5a', '\u0c5f'), ('\u0c64', '\u0c65'), ('\u0c70', '\u0c77'), ('\u0c80', '\u0c80'), ('\u0c84', '\u0c84'), ('\u0c8d', '\u0c8d'), ('\u0c91', '\u0c91'), ('\u0ca9', '\u0ca9'), ('\u0cb4', '\u0cb4'), ('\u0cba', '\u0cbb'), ('\u0cc5', '\u0cc5'), ('\u0cc9', '\u0cc9'), ('\u0cce', '\u0cd4'), ('\u0cd7', '\u0cdd'), ('\u0cdf', '\u0cdf'), ('\u0ce4', '\u0ce5'), ('\u0cf0', '\u0cf0'), ('\u0cf3', '\u0d00'), ('\u0d04', '\u0d04'), ('\u0d0d', '\u0d0d'), ('\u0d11', '\u0d11'), ('\u0d3b', '\u0d3c'), ('\u0d45', '\u0d45'), ('\u0d49', '\u0d49'), ('\u0d4f', '\u0d56'), ('\u0d58', '\u0d5f'), ('\u0d64', '\u0d65'), ('\u0d76', '\u0d78'), ('\u0d80', '\u0d81'), ('\u0d84', '\u0d84'), ('\u0d97', '\u0d99'), ('\u0db2', '\u0db2'), ('\u0dbc', '\u0dbc'), ('\u0dbe', '\u0dbf'), ('\u0dc7', '\u0dc9'), ('\u0dcb', '\u0dce'), ('\u0dd5', '\u0dd5'), ('\u0dd7', '\u0dd7'), ('\u0de0', '\u0de5'), ('\u0df0', '\u0df1'), ('\u0df5', '\u0e00'), ('\u0e3b', '\u0e3e'), ('\u0e5c', '\u0e80'), ('\u0e83', '\u0e83'), ('\u0e85', '\u0e86'), ('\u0e89', '\u0e89'), ('\u0e8b', '\u0e8c'), ('\u0e8e', '\u0e93'), ('\u0e98', '\u0e98'), ('\u0ea0', '\u0ea0'), ('\u0ea4', '\u0ea4'), ('\u0ea6', '\u0ea6'), ('\u0ea8', '\u0ea9'), ('\u0eac', '\u0eac'), ('\u0eba', '\u0eba'), ('\u0ebe', '\u0ebf'), ('\u0ec5', '\u0ec5'), ('\u0ec7', '\u0ec7'), ('\u0ece', '\u0ecf'), ('\u0eda', '\u0edb'), ('\u0ee0', '\u0eff'), ('\u0f48', '\u0f48'), ('\u0f6d', '\u0f70'), ('\u0f98', '\u0f98'), ('\u0fbd', '\u0fbd'), ('\u0fcd', '\u0fcd'), ('\u0fdb', '\u0fff'), ('\u10c6', '\u10c6'), ('\u10c8', '\u10cc'), ('\u10ce', '\u10cf'), ('\u1249', '\u1249'), ('\u124e', '\u124f'), ('\u1257', '\u1257'), ('\u1259', '\u1259'), ('\u125e', '\u125f'), ('\u1289', '\u1289'), ('\u128e', '\u128f'), ('\u12b1', '\u12b1'), ('\u12b6', '\u12b7'), ('\u12bf', '\u12bf'), ('\u12c1', '\u12c1'), ('\u12c6', '\u12c7'), ('\u12d7', '\u12d7'), ('\u1311', '\u1311'), ('\u1316', '\u1317'), ('\u135b', '\u135c'), ('\u137d', '\u137f'), ('\u139a', '\u139f'), ('\u13f5', '\u13ff'), ('\u169d', '\u169f'), ('\u16f9', '\u16ff'), ('\u170d', '\u170d'), ('\u1715', '\u171f'), ('\u1737', '\u173f'), ('\u1754', '\u175f'), ('\u176d', '\u176d'), ('\u1771', '\u1771'), ('\u1774', '\u177f'), ('\u17de', '\u17df'), ('\u17ea', '\u17ef'), ('\u17fa', '\u17ff'), ('\u180e', '\u180f'), ('\u181a', '\u181f'), ('\u1878', '\u187f'), ('\u18ab', '\u18af'), ('\u18f6', '\u18ff'), ('\u191f', '\u191f'), ('\u192c', '\u192f'), ('\u193c', '\u193f'), ('\u1941', '\u1943'), ('\u196e', '\u196f'), ('\u1975', '\u197f'), ('\u19ac', '\u19af'), ('\u19ca', '\u19cf'), ('\u19db', '\u19dd'), ('\u1a1c', '\u1a1d'), ('\u1a5f', '\u1a5f'), ('\u1a7d', '\u1a7e'), ('\u1a8a', '\u1a8f'), ('\u1a9a', '\u1a9f'), ('\u1aae', '\u1aaf'), ('\u1abf', '\u1aff'), ('\u1b4c', '\u1b4f'), ('\u1b7d', '\u1b7f'), ('\u1bf4', '\u1bfb'), ('\u1c38', '\u1c3a'), ('\u1c4a', '\u1c4c'), ('\u1c80', '\u1cbf'), ('\u1cc8', '\u1ccf'), ('\u1cf7', '\u1cf7'), ('\u1cfa', '\u1cff'), ('\u1df6', '\u1dfb'), ('\u1f16', '\u1f17'), ('\u1f1e', '\u1f1f'), ('\u1f46', '\u1f47'), ('\u1f4e', '\u1f4f'), ('\u1f58', '\u1f58'), ('\u1f5a', '\u1f5a'), ('\u1f5c', '\u1f5c'), ('\u1f5e', '\u1f5e'), ('\u1f7e', '\u1f7f'), ('\u1fb5', '\u1fb5'), ('\u1fc5', '\u1fc5'), ('\u1fd4', '\u1fd5'), ('\u1fdc', '\u1fdc'), ('\u1ff0', '\u1ff1'), ('\u1ff5', '\u1ff5'), ('\u1fff', '\u1fff'), ('\u200b', '\u200f'), ('\u202a', '\u202e'), ('\u2060', '\u206f'), ('\u2072', '\u2073'), ('\u208f', '\u208f'), ('\u209d', '\u209f'), ('\u20be', '\u20cf'), ('\u20f1', '\u20ff'), ('\u218a', '\u218f'), ('\u23fb', '\u23ff'), ('\u2427', '\u243f'), ('\u244b', '\u245f'), ('\u2b74', '\u2b75'), ('\u2b96', '\u2b97'), ('\u2bba', '\u2bbc'), ('\u2bc9', '\u2bc9'), ('\u2bd2', '\u2bff'), ('\u2c2f', '\u2c2f'), ('\u2c5f', '\u2c5f'), ('\u2cf4', '\u2cf8'), ('\u2d26', '\u2d26'), ('\u2d28', '\u2d2c'), ('\u2d2e', '\u2d2f'), ('\u2d68', '\u2d6e'), ('\u2d71', '\u2d7e'), ('\u2d97', '\u2d9f'), ('\u2da7', '\u2da7'), ('\u2daf', '\u2daf'), ('\u2db7', '\u2db7'), ('\u2dbf', '\u2dbf'), ('\u2dc7', '\u2dc7'), ('\u2dcf', '\u2dcf'), ('\u2dd7', '\u2dd7'), ('\u2ddf', '\u2ddf'), ('\u2e43', '\u2e7f'), ('\u2e9a', '\u2e9a'), ('\u2ef4', '\u2eff'), ('\u2fd6', '\u2fef'), ('\u2ffc', '\u2fff'), ('\u3040', '\u3040'), ('\u3097', '\u3098'), ('\u3100', '\u3104'), ('\u312e', '\u3130'), ('\u318f', '\u318f'), ('\u31bb', '\u31bf'), ('\u31e4', '\u31ef'), ('\u321f', '\u321f'), ('\u32ff', '\u32ff'), ('\u3401', '\u4db4'), ('\u4db6', '\u4dbf'), ('\u4e01', '\u9fcb'), ('\u9fcd', '\u9fff'), ('\ua48d', '\ua48f'), ('\ua4c7', '\ua4cf'), ('\ua62c', '\ua63f'), ('\ua69e', '\ua69e'), ('\ua6f8', '\ua6ff'), ('\ua78f', '\ua78f'), ('\ua7ae', '\ua7af'), ('\ua7b2', '\ua7f6'), ('\ua82c', '\ua82f'), ('\ua83a', '\ua83f'), ('\ua878', '\ua87f'), ('\ua8c5', '\ua8cd'), ('\ua8da', '\ua8df'), ('\ua8fc', '\ua8ff'), ('\ua954', '\ua95e'), ('\ua97d', '\ua97f'), ('\ua9ce', '\ua9ce'), ('\ua9da', '\ua9dd'), ('\ua9ff', '\ua9ff'), ('\uaa37', '\uaa3f'), ('\uaa4e', '\uaa4f'), ('\uaa5a', '\uaa5b'), ('\uaac3', '\uaada'), ('\uaaf7', '\uab00'), ('\uab07', '\uab08'), ('\uab0f', '\uab10'), ('\uab17', '\uab1f'), ('\uab27', '\uab27'), ('\uab2f', '\uab2f'), ('\uab60', '\uab63'), ('\uab66', '\uabbf'), ('\uabee', '\uabef'), ('\uabfa', '\uabff'), ('\uac01', '\ud7a2'), ('\ud7a4', '\ud7af'), ('\ud7c7', '\ud7ca'), ('\ud7fc', '\ud7ff'), ('\ue000', '\uf8ff'), ('\ufa6e', '\ufa6f'), ('\ufada', '\ufaff'), ('\ufb07', '\ufb12'), ('\ufb18', '\ufb1c'), ('\ufb37', '\ufb37'), ('\ufb3d', '\ufb3d'), ('\ufb3f', '\ufb3f'), ('\ufb42', '\ufb42'), ('\ufb45', '\ufb45'), ('\ufbc2', '\ufbd2'), ('\ufd40', '\ufd4f'), ('\ufd90', '\ufd91'), ('\ufdc8', '\ufdef'), ('\ufdfe', '\ufdff'), ('\ufe1a', '\ufe1f'), ('\ufe2e', '\ufe2f'), ('\ufe53', '\ufe53'), ('\ufe67', '\ufe67'), ('\ufe6c', '\ufe6f'), ('\ufe75', '\ufe75'), ('\ufefd', '\uff00'), ('\uffbf', '\uffc1'), ('\uffc8', '\uffc9'), ('\uffd0', '\uffd1'), ('\uffd8', '\uffd9'), ('\uffdd', '\uffdf'), ('\uffe7', '\uffe7'), ('\uffef', '\ufffb'), ('\ufffe', '\uffff'), ('\U0001000c', '\U0001000c'), ('\U00010027', '\U00010027'), ('\U0001003b', '\U0001003b'), ('\U0001003e', '\U0001003e'), ('\U0001004e', '\U0001004f'), ('\U0001005e', '\U0001007f'), ('\U000100fb', '\U000100ff'), ('\U00010103', '\U00010106'), ('\U00010134', '\U00010136'), ('\U0001018d', '\U0001018f'), ('\U0001019c', '\U0001019f'), ('\U000101a1', '\U000101cf'), ('\U000101fe', '\U0001027f'), ('\U0001029d', '\U0001029f'), ('\U000102d1', '\U000102df'), ('\U000102fc', '\U000102ff'), ('\U00010324', '\U0001032f'), ('\U0001034b', '\U0001034f'), ('\U0001037b', '\U0001037f'), ('\U0001039e', '\U0001039e'), ('\U000103c4', '\U000103c7'), ('\U000103d6', '\U000103ff'), ('\U0001049e', '\U0001049f'), ('\U000104aa', '\U000104ff'), ('\U00010528', '\U0001052f'), ('\U00010564', '\U0001056e'), ('\U00010570', '\U000105ff'), ('\U00010737', '\U0001073f'), ('\U00010756', '\U0001075f'), ('\U00010768', '\U000107ff'), ('\U00010806', '\U00010807'), ('\U00010809', '\U00010809'), ('\U00010836', '\U00010836'), ('\U00010839', '\U0001083b'), ('\U0001083d', '\U0001083e'), ('\U00010856', '\U00010856'), ('\U0001089f', '\U000108a6'), ('\U000108b0', '\U000108ff'), ('\U0001091c', '\U0001091e'), ('\U0001093a', '\U0001093e'), ('\U00010940', '\U0001097f'), ('\U000109b8', '\U000109bd'), ('\U000109c0', '\U000109ff'), ('\U00010a04', '\U00010a04'), ('\U00010a07', '\U00010a0b'), ('\U00010a14', '\U00010a14'), ('\U00010a18', '\U00010a18'), ('\U00010a34', '\U00010a37'), ('\U00010a3b', '\U00010a3e'), ('\U00010a48', '\U00010a4f'), ('\U00010a59', '\U00010a5f'), ('\U00010aa0', '\U00010abf'), ('\U00010ae7', '\U00010aea'), ('\U00010af7', '\U00010aff'), ('\U00010b36', '\U00010b38'), ('\U00010b56', '\U00010b57'), ('\U00010b73', '\U00010b77'), ('\U00010b92', '\U00010b98'), ('\U00010b9d', '\U00010ba8'), ('\U00010bb0', '\U00010bff'), ('\U00010c49', '\U00010e5f'), ('\U00010e7f', '\U00010fff'), ('\U0001104e', '\U00011051'), ('\U00011070', '\U0001107e'), ('\U000110bd', '\U000110bd'), ('\U000110c2', '\U000110cf'), ('\U000110e9', '\U000110ef'), ('\U000110fa', '\U000110ff'), ('\U00011135', '\U00011135'), ('\U00011144', '\U0001114f'), ('\U00011177', '\U0001117f'), ('\U000111c9', '\U000111cc'), ('\U000111ce', '\U000111cf'), ('\U000111db', '\U000111e0'), ('\U000111f5', '\U000111ff'), ('\U00011212', '\U00011212'), ('\U0001123e', '\U000112af'), ('\U000112eb', '\U000112ef'), ('\U000112fa', '\U00011300'), ('\U00011304', '\U00011304'), ('\U0001130d', '\U0001130e'), ('\U00011311', '\U00011312'), ('\U00011329', '\U00011329'), ('\U00011331', '\U00011331'), ('\U00011334', '\U00011334'), ('\U0001133a', '\U0001133b'), ('\U00011345', '\U00011346'), ('\U00011349', '\U0001134a'), ('\U0001134e', '\U00011356'), ('\U00011358', '\U0001135c'), ('\U00011364', '\U00011365'), ('\U0001136d', '\U0001136f'), ('\U00011375', '\U0001147f'), ('\U000114c8', '\U000114cf'), ('\U000114da', '\U0001157f'), ('\U000115b6', '\U000115b7'), ('\U000115ca', '\U000115ff'), ('\U00011645', '\U0001164f'), ('\U0001165a', '\U0001167f'), ('\U000116b8', '\U000116bf'), ('\U000116ca', '\U0001189f'), ('\U000118f3', '\U000118fe'), ('\U00011900', '\U00011abf'), ('\U00011af9', '\U00011fff'), ('\U00012399', '\U000123ff'), ('\U0001246f', '\U0001246f'), ('\U00012475', '\U00012fff'), ('\U0001342f', '\U000167ff'), ('\U00016a39', '\U00016a3f'), ('\U00016a5f', '\U00016a5f'), ('\U00016a6a', '\U00016a6d'), ('\U00016a70', '\U00016acf'), ('\U00016aee', '\U00016aef'), ('\U00016af6', '\U00016aff'), ('\U00016b46', '\U00016b4f'), ('\U00016b5a', '\U00016b5a'), ('\U00016b62', '\U00016b62'), ('\U00016b78', '\U00016b7c'), ('\U00016b90', '\U00016eff'), ('\U00016f45', '\U00016f4f'), ('\U00016f7f', '\U00016f8e'), ('\U00016fa0', '\U0001afff'), ('\U0001b002', '\U0001bbff'), ('\U0001bc6b', '\U0001bc6f'), ('\U0001bc7d', '\U0001bc7f'), ('\U0001bc89', '\U0001bc8f'), ('\U0001bc9a', '\U0001bc9b'), ('\U0001bca0', '\U0001cfff'), ('\U0001d0f6', '\U0001d0ff'), ('\U0001d127', '\U0001d128'), ('\U0001d173', '\U0001d17a'), ('\U0001d1de', '\U0001d1ff'), ('\U0001d246', '\U0001d2ff'), ('\U0001d357', '\U0001d35f'), ('\U0001d372', '\U0001d3ff'), ('\U0001d455', '\U0001d455'), ('\U0001d49d', '\U0001d49d'), ('\U0001d4a0', '\U0001d4a1'), ('\U0001d4a3', '\U0001d4a4'), ('\U0001d4a7', '\U0001d4a8'), ('\U0001d4ad', '\U0001d4ad'), ('\U0001d4ba', '\U0001d4ba'), ('\U0001d4bc', '\U0001d4bc'), ('\U0001d4c4', '\U0001d4c4'), ('\U0001d506', '\U0001d506'), ('\U0001d50b', '\U0001d50c'), ('\U0001d515', '\U0001d515'), ('\U0001d51d', '\U0001d51d'), ('\U0001d53a', '\U0001d53a'), ('\U0001d53f', '\U0001d53f'), ('\U0001d545', '\U0001d545'), ('\U0001d547', '\U0001d549'), ('\U0001d551', '\U0001d551'), ('\U0001d6a6', '\U0001d6a7'), ('\U0001d7cc', '\U0001d7cd'), ('\U0001d800', '\U0001e7ff'), ('\U0001e8c5', '\U0001e8c6'), ('\U0001e8d7', '\U0001edff'), ('\U0001ee04', '\U0001ee04'), ('\U0001ee20', '\U0001ee20'), ('\U0001ee23', '\U0001ee23'), ('\U0001ee25', '\U0001ee26'), ('\U0001ee28', '\U0001ee28'), ('\U0001ee33', '\U0001ee33'), ('\U0001ee38', '\U0001ee38'), ('\U0001ee3a', '\U0001ee3a'), ('\U0001ee3c', '\U0001ee41'), ('\U0001ee43', '\U0001ee46'), ('\U0001ee48', '\U0001ee48'), ('\U0001ee4a', '\U0001ee4a'), ('\U0001ee4c', '\U0001ee4c'), ('\U0001ee50', '\U0001ee50'), ('\U0001ee53', '\U0001ee53'), ('\U0001ee55', '\U0001ee56'), ('\U0001ee58', '\U0001ee58'), ('\U0001ee5a', '\U0001ee5a'), ('\U0001ee5c', '\U0001ee5c'), ('\U0001ee5e', '\U0001ee5e'), ('\U0001ee60', '\U0001ee60'), ('\U0001ee63', '\U0001ee63'), ('\U0001ee65', '\U0001ee66'), ('\U0001ee6b', '\U0001ee6b'), ('\U0001ee73', '\U0001ee73'), ('\U0001ee78', '\U0001ee78'), ('\U0001ee7d', '\U0001ee7d'), ('\U0001ee7f', '\U0001ee7f'), ('\U0001ee8a', '\U0001ee8a'), ('\U0001ee9c', '\U0001eea0'), ('\U0001eea4', '\U0001eea4'), ('\U0001eeaa', '\U0001eeaa'), ('\U0001eebc', '\U0001eeef'), ('\U0001eef2', '\U0001efff'), ('\U0001f02c', '\U0001f02f'), ('\U0001f094', '\U0001f09f'), ('\U0001f0af', '\U0001f0b0'), ('\U0001f0c0', '\U0001f0c0'), ('\U0001f0d0', '\U0001f0d0'), ('\U0001f0f6', '\U0001f0ff'), ('\U0001f10d', '\U0001f10f'), ('\U0001f12f', '\U0001f12f'), ('\U0001f16c', '\U0001f16f'), ('\U0001f19b', '\U0001f1e5'), ('\U0001f203', '\U0001f20f'), ('\U0001f23b', '\U0001f23f'), ('\U0001f249', '\U0001f24f'), ('\U0001f252', '\U0001f2ff'), ('\U0001f32d', '\U0001f32f'), ('\U0001f37e', '\U0001f37f'), ('\U0001f3cf', '\U0001f3d3'), ('\U0001f3f8', '\U0001f3ff'), ('\U0001f4ff', '\U0001f4ff'), ('\U0001f54b', '\U0001f54f'), ('\U0001f57a', '\U0001f57a'), ('\U0001f5a4', '\U0001f5a4'), ('\U0001f643', '\U0001f644'), ('\U0001f6d0', '\U0001f6df'), ('\U0001f6ed', '\U0001f6ef'), ('\U0001f6f4', '\U0001f6ff'), ('\U0001f774', '\U0001f77f'), ('\U0001f7d5', '\U0001f7ff'), ('\U0001f80c', '\U0001f80f'), ('\U0001f848', '\U0001f84f'), ('\U0001f85a', '\U0001f85f'), ('\U0001f888', '\U0001f88f'), ('\U0001f8ae', '\U0001ffff'), ('\U00020001', '\U0002a6d5'), ('\U0002a6d7', '\U0002a6ff'), ('\U0002a701', '\U0002b733'), ('\U0002b735', '\U0002b73f'), ('\U0002b741', '\U0002b81c'), ('\U0002b81e', '\U0002f7ff'), ('\U0002fa1e', '\U000e00ff'), ('\U000e01f0', '\U0010ffff') ]; pub static Cc_table: &'static [(char, char)] = &[ ('\x00', '\x1f'), ('\x7f', '\u009f') ]; pub fn Cc(c: char) -> bool { super::bsearch_range_table(c, Cc_table) } pub static Cf_table: &'static [(char, char)] = &[ ('\u00ad', '\u00ad'), ('\u0600', '\u0605'), ('\u061c', '\u061c'), ('\u06dd', '\u06dd'), ('\u070f', '\u070f'), ('\u180e', '\u180e'), ('\u200b', '\u200f'), ('\u202a', '\u202e'), ('\u2060', '\u2064'), ('\u2066', '\u206f'), ('\ufeff', '\ufeff'), ('\ufff9', '\ufffb'), ('\U000110bd', '\U000110bd'), ('\U0001bca0', '\U0001bca3'), ('\U0001d173', '\U0001d17a'), ('\U000e0001', '\U000e0001'), ('\U000e0020', '\U000e007f') ]; pub static Cn_table: &'static [(char, char)] = &[ ('\u0378', '\u0379'), ('\u0380', '\u0383'), ('\u038b', '\u038b'), ('\u038d', '\u038d'), ('\u03a2', '\u03a2'), ('\u0530', '\u0530'), ('\u0557', '\u0558'), ('\u0560', '\u0560'), ('\u0588', '\u0588'), ('\u058b', '\u058c'), ('\u0590', '\u0590'), ('\u05c8', '\u05cf'), ('\u05eb', '\u05ef'), ('\u05f5', '\u05ff'), ('\u061d', '\u061d'), ('\u070e', '\u070e'), ('\u074b', '\u074c'), ('\u07b2', '\u07bf'), ('\u07fb', '\u07ff'), ('\u082e', '\u082f'), ('\u083f', '\u083f'), ('\u085c', '\u085d'), ('\u085f', '\u089f'), ('\u08b3', '\u08e3'), ('\u0984', '\u0984'), ('\u098d', '\u098e'), ('\u0991', '\u0992'), ('\u09a9', '\u09a9'), ('\u09b1', '\u09b1'), ('\u09b3', '\u09b5'), ('\u09ba', '\u09bb'), ('\u09c5', '\u09c6'), ('\u09c9', '\u09ca'), ('\u09cf', '\u09d6'), ('\u09d8', '\u09db'), ('\u09de', '\u09de'), ('\u09e4', '\u09e5'), ('\u09fc', '\u0a00'), ('\u0a04', '\u0a04'), ('\u0a0b', '\u0a0e'), ('\u0a11', '\u0a12'), ('\u0a29', '\u0a29'), ('\u0a31', '\u0a31'), ('\u0a34', '\u0a34'), ('\u0a37', '\u0a37'), ('\u0a3a', '\u0a3b'), ('\u0a3d', '\u0a3d'), ('\u0a43', '\u0a46'), ('\u0a49', '\u0a4a'), ('\u0a4e', '\u0a50'), ('\u0a52', '\u0a58'), ('\u0a5d', '\u0a5d'), ('\u0a5f', '\u0a65'), ('\u0a76', '\u0a80'), ('\u0a84', '\u0a84'), ('\u0a8e', '\u0a8e'), ('\u0a92', '\u0a92'), ('\u0aa9', '\u0aa9'), ('\u0ab1', '\u0ab1'), ('\u0ab4', '\u0ab4'), ('\u0aba', '\u0abb'), ('\u0ac6', '\u0ac6'), ('\u0aca', '\u0aca'), ('\u0ace', '\u0acf'), ('\u0ad1', '\u0adf'), ('\u0ae4', '\u0ae5'), ('\u0af2', '\u0b00'), ('\u0b04', '\u0b04'), ('\u0b0d', '\u0b0e'), ('\u0b11', '\u0b12'), ('\u0b29', '\u0b29'), ('\u0b31', '\u0b31'), ('\u0b34', '\u0b34'), ('\u0b3a', '\u0b3b'), ('\u0b45', '\u0b46'), ('\u0b49', '\u0b4a'), ('\u0b4e', '\u0b55'), ('\u0b58', '\u0b5b'), ('\u0b5e', '\u0b5e'), ('\u0b64', '\u0b65'), ('\u0b78', '\u0b81'), ('\u0b84', '\u0b84'), ('\u0b8b', '\u0b8d'), ('\u0b91', '\u0b91'), ('\u0b96', '\u0b98'), ('\u0b9b', '\u0b9b'), ('\u0b9d', '\u0b9d'), ('\u0ba0', '\u0ba2'), ('\u0ba5', '\u0ba7'), ('\u0bab', '\u0bad'), ('\u0bba', '\u0bbd'), ('\u0bc3', '\u0bc5'), ('\u0bc9', '\u0bc9'), ('\u0bce', '\u0bcf'), ('\u0bd1', '\u0bd6'), ('\u0bd8', '\u0be5'), ('\u0bfb', '\u0bff'), ('\u0c04', '\u0c04'), ('\u0c0d', '\u0c0d'), ('\u0c11', '\u0c11'), ('\u0c29', '\u0c29'), ('\u0c3a', '\u0c3c'), ('\u0c45', '\u0c45'), ('\u0c49', '\u0c49'), ('\u0c4e', '\u0c54'), ('\u0c57', '\u0c57'), ('\u0c5a', '\u0c5f'), ('\u0c64', '\u0c65'), ('\u0c70', '\u0c77'), ('\u0c80', '\u0c80'), ('\u0c84', '\u0c84'), ('\u0c8d', '\u0c8d'), ('\u0c91', '\u0c91'), ('\u0ca9', '\u0ca9'), ('\u0cb4', '\u0cb4'), ('\u0cba', '\u0cbb'), ('\u0cc5', '\u0cc5'), ('\u0cc9', '\u0cc9'), ('\u0cce', '\u0cd4'), ('\u0cd7', '\u0cdd'), ('\u0cdf', '\u0cdf'), ('\u0ce4', '\u0ce5'), ('\u0cf0', '\u0cf0'), ('\u0cf3', '\u0d00'), ('\u0d04', '\u0d04'), ('\u0d0d', '\u0d0d'), ('\u0d11', '\u0d11'), ('\u0d3b', '\u0d3c'), ('\u0d45', '\u0d45'), ('\u0d49', '\u0d49'), ('\u0d4f', '\u0d56'), ('\u0d58', '\u0d5f'), ('\u0d64', '\u0d65'), ('\u0d76', '\u0d78'), ('\u0d80', '\u0d81'), ('\u0d84', '\u0d84'), ('\u0d97', '\u0d99'), ('\u0db2', '\u0db2'), ('\u0dbc', '\u0dbc'), ('\u0dbe', '\u0dbf'), ('\u0dc7', '\u0dc9'), ('\u0dcb', '\u0dce'), ('\u0dd5', '\u0dd5'), ('\u0dd7', '\u0dd7'), ('\u0de0', '\u0de5'), ('\u0df0', '\u0df1'), ('\u0df5', '\u0e00'), ('\u0e3b', '\u0e3e'), ('\u0e5c', '\u0e80'), ('\u0e83', '\u0e83'), ('\u0e85', '\u0e86'), ('\u0e89', '\u0e89'), ('\u0e8b', '\u0e8c'), ('\u0e8e', '\u0e93'), ('\u0e98', '\u0e98'), ('\u0ea0', '\u0ea0'), ('\u0ea4', '\u0ea4'), ('\u0ea6', '\u0ea6'), ('\u0ea8', '\u0ea9'), ('\u0eac', '\u0eac'), ('\u0eba', '\u0eba'), ('\u0ebe', '\u0ebf'), ('\u0ec5', '\u0ec5'), ('\u0ec7', '\u0ec7'), ('\u0ece', '\u0ecf'), ('\u0eda', '\u0edb'), ('\u0ee0', '\u0eff'), ('\u0f48', '\u0f48'), ('\u0f6d', '\u0f70'), ('\u0f98', '\u0f98'), ('\u0fbd', '\u0fbd'), ('\u0fcd', '\u0fcd'), ('\u0fdb', '\u0fff'), ('\u10c6', '\u10c6'), ('\u10c8', '\u10cc'), ('\u10ce', '\u10cf'), ('\u1249', '\u1249'), ('\u124e', '\u124f'), ('\u1257', '\u1257'), ('\u1259', '\u1259'), ('\u125e', '\u125f'), ('\u1289', '\u1289'), ('\u128e', '\u128f'), ('\u12b1', '\u12b1'), ('\u12b6', '\u12b7'), ('\u12bf', '\u12bf'), ('\u12c1', '\u12c1'), ('\u12c6', '\u12c7'), ('\u12d7', '\u12d7'), ('\u1311', '\u1311'), ('\u1316', '\u1317'), ('\u135b', '\u135c'), ('\u137d', '\u137f'), ('\u139a', '\u139f'), ('\u13f5', '\u13ff'), ('\u169d', '\u169f'), ('\u16f9', '\u16ff'), ('\u170d', '\u170d'), ('\u1715', '\u171f'), ('\u1737', '\u173f'), ('\u1754', '\u175f'), ('\u176d', '\u176d'), ('\u1771', '\u1771'), ('\u1774', '\u177f'), ('\u17de', '\u17df'), ('\u17ea', '\u17ef'), ('\u17fa', '\u17ff'), ('\u180f', '\u180f'), ('\u181a', '\u181f'), ('\u1878', '\u187f'), ('\u18ab', '\u18af'), ('\u18f6', '\u18ff'), ('\u191f', '\u191f'), ('\u192c', '\u192f'), ('\u193c', '\u193f'), ('\u1941', '\u1943'), ('\u196e', '\u196f'), ('\u1975', '\u197f'), ('\u19ac', '\u19af'), ('\u19ca', '\u19cf'), ('\u19db', '\u19dd'), ('\u1a1c', '\u1a1d'), ('\u1a5f', '\u1a5f'), ('\u1a7d', '\u1a7e'), ('\u1a8a', '\u1a8f'), ('\u1a9a', '\u1a9f'), ('\u1aae', '\u1aaf'), ('\u1abf', '\u1aff'), ('\u1b4c', '\u1b4f'), ('\u1b7d', '\u1b7f'), ('\u1bf4', '\u1bfb'), ('\u1c38', '\u1c3a'), ('\u1c4a', '\u1c4c'), ('\u1c80', '\u1cbf'), ('\u1cc8', '\u1ccf'), ('\u1cf7', '\u1cf7'), ('\u1cfa', '\u1cff'), ('\u1df6', '\u1dfb'), ('\u1f16', '\u1f17'), ('\u1f1e', '\u1f1f'), ('\u1f46', '\u1f47'), ('\u1f4e', '\u1f4f'), ('\u1f58', '\u1f58'), ('\u1f5a', '\u1f5a'), ('\u1f5c', '\u1f5c'), ('\u1f5e', '\u1f5e'), ('\u1f7e', '\u1f7f'), ('\u1fb5', '\u1fb5'), ('\u1fc5', '\u1fc5'), ('\u1fd4', '\u1fd5'), ('\u1fdc', '\u1fdc'), ('\u1ff0', '\u1ff1'), ('\u1ff5', '\u1ff5'), ('\u1fff', '\u1fff'), ('\u2065', '\u2065'), ('\u2072', '\u2073'), ('\u208f', '\u208f'), ('\u209d', '\u209f'), ('\u20be', '\u20cf'), ('\u20f1', '\u20ff'), ('\u218a', '\u218f'), ('\u23fb', '\u23ff'), ('\u2427', '\u243f'), ('\u244b', '\u245f'), ('\u2b74', '\u2b75'), ('\u2b96', '\u2b97'), ('\u2bba', '\u2bbc'), ('\u2bc9', '\u2bc9'), ('\u2bd2', '\u2bff'), ('\u2c2f', '\u2c2f'), ('\u2c5f', '\u2c5f'), ('\u2cf4', '\u2cf8'), ('\u2d26', '\u2d26'), ('\u2d28', '\u2d2c'), ('\u2d2e', '\u2d2f'), ('\u2d68', '\u2d6e'), ('\u2d71', '\u2d7e'), ('\u2d97', '\u2d9f'), ('\u2da7', '\u2da7'), ('\u2daf', '\u2daf'), ('\u2db7', '\u2db7'), ('\u2dbf', '\u2dbf'), ('\u2dc7', '\u2dc7'), ('\u2dcf', '\u2dcf'), ('\u2dd7', '\u2dd7'), ('\u2ddf', '\u2ddf'), ('\u2e43', '\u2e7f'), ('\u2e9a', '\u2e9a'), ('\u2ef4', '\u2eff'), ('\u2fd6', '\u2fef'), ('\u2ffc', '\u2fff'), ('\u3040', '\u3040'), ('\u3097', '\u3098'), ('\u3100', '\u3104'), ('\u312e', '\u3130'), ('\u318f', '\u318f'), ('\u31bb', '\u31bf'), ('\u31e4', '\u31ef'), ('\u321f', '\u321f'), ('\u32ff', '\u32ff'), ('\u3401', '\u4db4'), ('\u4db6', '\u4dbf'), ('\u4e01', '\u9fcb'), ('\u9fcd', '\u9fff'), ('\ua48d', '\ua48f'), ('\ua4c7', '\ua4cf'), ('\ua62c', '\ua63f'), ('\ua69e', '\ua69e'), ('\ua6f8', '\ua6ff'), ('\ua78f', '\ua78f'), ('\ua7ae', '\ua7af'), ('\ua7b2', '\ua7f6'), ('\ua82c', '\ua82f'), ('\ua83a', '\ua83f'), ('\ua878', '\ua87f'), ('\ua8c5', '\ua8cd'), ('\ua8da', '\ua8df'), ('\ua8fc', '\ua8ff'), ('\ua954', '\ua95e'), ('\ua97d', '\ua97f'), ('\ua9ce', '\ua9ce'), ('\ua9da', '\ua9dd'), ('\ua9ff', '\ua9ff'), ('\uaa37', '\uaa3f'), ('\uaa4e', '\uaa4f'), ('\uaa5a', '\uaa5b'), ('\uaac3', '\uaada'), ('\uaaf7', '\uab00'), ('\uab07', '\uab08'), ('\uab0f', '\uab10'), ('\uab17', '\uab1f'), ('\uab27', '\uab27'), ('\uab2f', '\uab2f'), ('\uab60', '\uab63'), ('\uab66', '\uabbf'), ('\uabee', '\uabef'), ('\uabfa', '\uabff'), ('\uac01', '\ud7a2'), ('\ud7a4', '\ud7af'), ('\ud7c7', '\ud7ca'), ('\ud7fc', '\ud7ff'), ('\ue001', '\uf8fe'), ('\ufa6e', '\ufa6f'), ('\ufada', '\ufaff'), ('\ufb07', '\ufb12'), ('\ufb18', '\ufb1c'), ('\ufb37', '\ufb37'), ('\ufb3d', '\ufb3d'), ('\ufb3f', '\ufb3f'), ('\ufb42', '\ufb42'), ('\ufb45', '\ufb45'), ('\ufbc2', '\ufbd2'), ('\ufd40', '\ufd4f'), ('\ufd90', '\ufd91'), ('\ufdc8', '\ufdef'), ('\ufdfe', '\ufdff'), ('\ufe1a', '\ufe1f'), ('\ufe2e', '\ufe2f'), ('\ufe53', '\ufe53'), ('\ufe67', '\ufe67'), ('\ufe6c', '\ufe6f'), ('\ufe75', '\ufe75'), ('\ufefd', '\ufefe'), ('\uff00', '\uff00'), ('\uffbf', '\uffc1'), ('\uffc8', '\uffc9'), ('\uffd0', '\uffd1'), ('\uffd8', '\uffd9'), ('\uffdd', '\uffdf'), ('\uffe7', '\uffe7'), ('\uffef', '\ufff8'), ('\ufffe', '\uffff'), ('\U0001000c', '\U0001000c'), ('\U00010027', '\U00010027'), ('\U0001003b', '\U0001003b'), ('\U0001003e', '\U0001003e'), ('\U0001004e', '\U0001004f'), ('\U0001005e', '\U0001007f'), ('\U000100fb', '\U000100ff'), ('\U00010103', '\U00010106'), ('\U00010134', '\U00010136'), ('\U0001018d', '\U0001018f'), ('\U0001019c', '\U0001019f'), ('\U000101a1', '\U000101cf'), ('\U000101fe', '\U0001027f'), ('\U0001029d', '\U0001029f'), ('\U000102d1', '\U000102df'), ('\U000102fc', '\U000102ff'), ('\U00010324', '\U0001032f'), ('\U0001034b', '\U0001034f'), ('\U0001037b', '\U0001037f'), ('\U0001039e', '\U0001039e'), ('\U000103c4', '\U000103c7'), ('\U000103d6', '\U000103ff'), ('\U0001049e', '\U0001049f'), ('\U000104aa', '\U000104ff'), ('\U00010528', '\U0001052f'), ('\U00010564', '\U0001056e'), ('\U00010570', '\U000105ff'), ('\U00010737', '\U0001073f'), ('\U00010756', '\U0001075f'), ('\U00010768', '\U000107ff'), ('\U00010806', '\U00010807'), ('\U00010809', '\U00010809'), ('\U00010836', '\U00010836'), ('\U00010839', '\U0001083b'), ('\U0001083d', '\U0001083e'), ('\U00010856', '\U00010856'), ('\U0001089f', '\U000108a6'), ('\U000108b0', '\U000108ff'), ('\U0001091c', '\U0001091e'), ('\U0001093a', '\U0001093e'), ('\U00010940', '\U0001097f'), ('\U000109b8', '\U000109bd'), ('\U000109c0', '\U000109ff'), ('\U00010a04', '\U00010a04'), ('\U00010a07', '\U00010a0b'), ('\U00010a14', '\U00010a14'), ('\U00010a18', '\U00010a18'), ('\U00010a34', '\U00010a37'), ('\U00010a3b', '\U00010a3e'), ('\U00010a48', '\U00010a4f'), ('\U00010a59', '\U00010a5f'), ('\U00010aa0', '\U00010abf'), ('\U00010ae7', '\U00010aea'), ('\U00010af7', '\U00010aff'), ('\U00010b36', '\U00010b38'), ('\U00010b56', '\U00010b57'), ('\U00010b73', '\U00010b77'), ('\U00010b92', '\U00010b98'), ('\U00010b9d', '\U00010ba8'), ('\U00010bb0', '\U00010bff'), ('\U00010c49', '\U00010e5f'), ('\U00010e7f', '\U00010fff'), ('\U0001104e', '\U00011051'), ('\U00011070', '\U0001107e'), ('\U000110c2', '\U000110cf'), ('\U000110e9', '\U000110ef'), ('\U000110fa', '\U000110ff'), ('\U00011135', '\U00011135'), ('\U00011144', '\U0001114f'), ('\U00011177', '\U0001117f'), ('\U000111c9', '\U000111cc'), ('\U000111ce', '\U000111cf'), ('\U000111db', '\U000111e0'), ('\U000111f5', '\U000111ff'), ('\U00011212', '\U00011212'), ('\U0001123e', '\U000112af'), ('\U000112eb', '\U000112ef'), ('\U000112fa', '\U00011300'), ('\U00011304', '\U00011304'), ('\U0001130d', '\U0001130e'), ('\U00011311', '\U00011312'), ('\U00011329', '\U00011329'), ('\U00011331', '\U00011331'), ('\U00011334', '\U00011334'), ('\U0001133a', '\U0001133b'), ('\U00011345', '\U00011346'), ('\U00011349', '\U0001134a'), ('\U0001134e', '\U00011356'), ('\U00011358', '\U0001135c'), ('\U00011364', '\U00011365'), ('\U0001136d', '\U0001136f'), ('\U00011375', '\U0001147f'), ('\U000114c8', '\U000114cf'), ('\U000114da', '\U0001157f'), ('\U000115b6', '\U000115b7'), ('\U000115ca', '\U000115ff'), ('\U00011645', '\U0001164f'), ('\U0001165a', '\U0001167f'), ('\U000116b8', '\U000116bf'), ('\U000116ca', '\U0001189f'), ('\U000118f3', '\U000118fe'), ('\U00011900', '\U00011abf'), ('\U00011af9', '\U00011fff'), ('\U00012399', '\U000123ff'), ('\U0001246f', '\U0001246f'), ('\U00012475', '\U00012fff'), ('\U0001342f', '\U000167ff'), ('\U00016a39', '\U00016a3f'), ('\U00016a5f', '\U00016a5f'), ('\U00016a6a', '\U00016a6d'), ('\U00016a70', '\U00016acf'), ('\U00016aee', '\U00016aef'), ('\U00016af6', '\U00016aff'), ('\U00016b46', '\U00016b4f'), ('\U00016b5a', '\U00016b5a'), ('\U00016b62', '\U00016b62'), ('\U00016b78', '\U00016b7c'), ('\U00016b90', '\U00016eff'), ('\U00016f45', '\U00016f4f'), ('\U00016f7f', '\U00016f8e'), ('\U00016fa0', '\U0001afff'), ('\U0001b002', '\U0001bbff'), ('\U0001bc6b', '\U0001bc6f'), ('\U0001bc7d', '\U0001bc7f'), ('\U0001bc89', '\U0001bc8f'), ('\U0001bc9a', '\U0001bc9b'), ('\U0001bca4', '\U0001cfff'), ('\U0001d0f6', '\U0001d0ff'), ('\U0001d127', '\U0001d128'), ('\U0001d1de', '\U0001d1ff'), ('\U0001d246', '\U0001d2ff'), ('\U0001d357', '\U0001d35f'), ('\U0001d372', '\U0001d3ff'), ('\U0001d455', '\U0001d455'), ('\U0001d49d', '\U0001d49d'), ('\U0001d4a0', '\U0001d4a1'), ('\U0001d4a3', '\U0001d4a4'), ('\U0001d4a7', '\U0001d4a8'), ('\U0001d4ad', '\U0001d4ad'), ('\U0001d4ba', '\U0001d4ba'), ('\U0001d4bc', '\U0001d4bc'), ('\U0001d4c4', '\U0001d4c4'), ('\U0001d506', '\U0001d506'), ('\U0001d50b', '\U0001d50c'), ('\U0001d515', '\U0001d515'), ('\U0001d51d', '\U0001d51d'), ('\U0001d53a', '\U0001d53a'), ('\U0001d53f', '\U0001d53f'), ('\U0001d545', '\U0001d545'), ('\U0001d547', '\U0001d549'), ('\U0001d551', '\U0001d551'), ('\U0001d6a6', '\U0001d6a7'), ('\U0001d7cc', '\U0001d7cd'), ('\U0001d800', '\U0001e7ff'), ('\U0001e8c5', '\U0001e8c6'), ('\U0001e8d7', '\U0001edff'), ('\U0001ee04', '\U0001ee04'), ('\U0001ee20', '\U0001ee20'), ('\U0001ee23', '\U0001ee23'), ('\U0001ee25', '\U0001ee26'), ('\U0001ee28', '\U0001ee28'), ('\U0001ee33', '\U0001ee33'), ('\U0001ee38', '\U0001ee38'), ('\U0001ee3a', '\U0001ee3a'), ('\U0001ee3c', '\U0001ee41'), ('\U0001ee43', '\U0001ee46'), ('\U0001ee48', '\U0001ee48'), ('\U0001ee4a', '\U0001ee4a'), ('\U0001ee4c', '\U0001ee4c'), ('\U0001ee50', '\U0001ee50'), ('\U0001ee53', '\U0001ee53'), ('\U0001ee55', '\U0001ee56'), ('\U0001ee58', '\U0001ee58'), ('\U0001ee5a', '\U0001ee5a'), ('\U0001ee5c', '\U0001ee5c'), ('\U0001ee5e', '\U0001ee5e'), ('\U0001ee60', '\U0001ee60'), ('\U0001ee63', '\U0001ee63'), ('\U0001ee65', '\U0001ee66'), ('\U0001ee6b', '\U0001ee6b'), ('\U0001ee73', '\U0001ee73'), ('\U0001ee78', '\U0001ee78'), ('\U0001ee7d', '\U0001ee7d'), ('\U0001ee7f', '\U0001ee7f'), ('\U0001ee8a', '\U0001ee8a'), ('\U0001ee9c', '\U0001eea0'), ('\U0001eea4', '\U0001eea4'), ('\U0001eeaa', '\U0001eeaa'), ('\U0001eebc', '\U0001eeef'), ('\U0001eef2', '\U0001efff'), ('\U0001f02c', '\U0001f02f'), ('\U0001f094', '\U0001f09f'), ('\U0001f0af', '\U0001f0b0'), ('\U0001f0c0', '\U0001f0c0'), ('\U0001f0d0', '\U0001f0d0'), ('\U0001f0f6', '\U0001f0ff'), ('\U0001f10d', '\U0001f10f'), ('\U0001f12f', '\U0001f12f'), ('\U0001f16c', '\U0001f16f'), ('\U0001f19b', '\U0001f1e5'), ('\U0001f203', '\U0001f20f'), ('\U0001f23b', '\U0001f23f'), ('\U0001f249', '\U0001f24f'), ('\U0001f252', '\U0001f2ff'), ('\U0001f32d', '\U0001f32f'), ('\U0001f37e', '\U0001f37f'), ('\U0001f3cf', '\U0001f3d3'), ('\U0001f3f8', '\U0001f3ff'), ('\U0001f4ff', '\U0001f4ff'), ('\U0001f54b', '\U0001f54f'), ('\U0001f57a', '\U0001f57a'), ('\U0001f5a4', '\U0001f5a4'), ('\U0001f643', '\U0001f644'), ('\U0001f6d0', '\U0001f6df'), ('\U0001f6ed', '\U0001f6ef'), ('\U0001f6f4', '\U0001f6ff'), ('\U0001f774', '\U0001f77f'), ('\U0001f7d5', '\U0001f7ff'), ('\U0001f80c', '\U0001f80f'), ('\U0001f848', '\U0001f84f'), ('\U0001f85a', '\U0001f85f'), ('\U0001f888', '\U0001f88f'), ('\U0001f8ae', '\U0001ffff'), ('\U00020001', '\U0002a6d5'), ('\U0002a6d7', '\U0002a6ff'), ('\U0002a701', '\U0002b733'), ('\U0002b735', '\U0002b73f'), ('\U0002b741', '\U0002b81c'), ('\U0002b81e', '\U0002f7ff'), ('\U0002fa1e', '\U000e0000'), ('\U000e0002', '\U000e001f'), ('\U000e0080', '\U000e00ff'), ('\U000e01f0', '\U000effff'), ('\U000f0001', '\U000ffffc'), ('\U000ffffe', '\U000fffff'), ('\U00100001', '\U0010fffc'), ('\U0010fffe', '\U0010ffff') ]; pub static Co_table: &'static [(char, char)] = &[ ('\ue000', '\ue000'), ('\uf8ff', '\uf8ff'), ('\U000f0000', '\U000f0000'), ('\U000ffffd', '\U000ffffd'), ('\U00100000', '\U00100000'), ('\U0010fffd', '\U0010fffd') ]; pub static L_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0370', '\u0374'), ('\u0376', '\u0377'), ('\u037a', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u048a', '\u052f'), ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u0561', '\u0587'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0620', '\u064a'), ('\u066e', '\u066f'), ('\u0671', '\u06d3'), ('\u06d5', '\u06d5'), ('\u06e5', '\u06e6'), ('\u06ee', '\u06ef'), ('\u06fa', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u0710'), ('\u0712', '\u072f'), ('\u074d', '\u07a5'), ('\u07b1', '\u07b1'), ('\u07ca', '\u07ea'), ('\u07f4', '\u07f5'), ('\u07fa', '\u07fa'), ('\u0800', '\u0815'), ('\u081a', '\u081a'), ('\u0824', '\u0824'), ('\u0828', '\u0828'), ('\u0840', '\u0858'), ('\u08a0', '\u08b2'), ('\u0904', '\u0939'), ('\u093d', '\u093d'), ('\u0950', '\u0950'), ('\u0958', '\u0961'), ('\u0971', '\u0980'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bd', '\u09bd'), ('\u09ce', '\u09ce'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09f0', '\u09f1'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a72', '\u0a74'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abd', '\u0abd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3d', '\u0b3d'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b71', '\u0b71'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bd0', '\u0bd0'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbd', '\u0cbd'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0cf1', '\u0cf2'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d4e', '\u0d4e'), ('\u0d60', '\u0d61'), ('\u0d7a', '\u0d7f'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0e01', '\u0e30'), ('\u0e32', '\u0e33'), ('\u0e40', '\u0e46'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb2', '\u0eb3'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f88', '\u0f8c'), ('\u1000', '\u102a'), ('\u103f', '\u103f'), ('\u1050', '\u1055'), ('\u105a', '\u105d'), ('\u1061', '\u1061'), ('\u1065', '\u1066'), ('\u106e', '\u1070'), ('\u1075', '\u1081'), ('\u108e', '\u108e'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16f1', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1720', '\u1731'), ('\u1740', '\u1751'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1780', '\u17b3'), ('\u17d7', '\u17d7'), ('\u17dc', '\u17dc'), ('\u1820', '\u1877'), ('\u1880', '\u18a8'), ('\u18aa', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1950', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19c1', '\u19c7'), ('\u1a00', '\u1a16'), ('\u1a20', '\u1a54'), ('\u1aa7', '\u1aa7'), ('\u1b05', '\u1b33'), ('\u1b45', '\u1b4b'), ('\u1b83', '\u1ba0'), ('\u1bae', '\u1baf'), ('\u1bba', '\u1be5'), ('\u1c00', '\u1c23'), ('\u1c4d', '\u1c4f'), ('\u1c5a', '\u1c7d'), ('\u1ce9', '\u1cec'), ('\u1cee', '\u1cf1'), ('\u1cf5', '\u1cf6'), ('\u1d00', '\u1dbf'), ('\u1e00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212f', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2183', '\u2184'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2ce4'), ('\u2ceb', '\u2cee'), ('\u2cf2', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u2e2f', '\u2e2f'), ('\u3005', '\u3006'), ('\u3031', '\u3035'), ('\u303b', '\u303c'), ('\u3041', '\u3096'), ('\u309d', '\u309f'), ('\u30a1', '\u30fa'), ('\u30fc', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u3400'), ('\u4db5', '\u4db5'), ('\u4e00', '\u4e00'), ('\u9fcc', '\u9fcc'), ('\ua000', '\ua48c'), ('\ua4d0', '\ua4fd'), ('\ua500', '\ua60c'), ('\ua610', '\ua61f'), ('\ua62a', '\ua62b'), ('\ua640', '\ua66e'), ('\ua67f', '\ua69d'), ('\ua6a0', '\ua6e5'), ('\ua717', '\ua71f'), ('\ua722', '\ua788'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua801'), ('\ua803', '\ua805'), ('\ua807', '\ua80a'), ('\ua80c', '\ua822'), ('\ua840', '\ua873'), ('\ua882', '\ua8b3'), ('\ua8f2', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua90a', '\ua925'), ('\ua930', '\ua946'), ('\ua960', '\ua97c'), ('\ua984', '\ua9b2'), ('\ua9cf', '\ua9cf'), ('\ua9e0', '\ua9e4'), ('\ua9e6', '\ua9ef'), ('\ua9fa', '\ua9fe'), ('\uaa00', '\uaa28'), ('\uaa40', '\uaa42'), ('\uaa44', '\uaa4b'), ('\uaa60', '\uaa76'), ('\uaa7a', '\uaa7a'), ('\uaa7e', '\uaaaf'), ('\uaab1', '\uaab1'), ('\uaab5', '\uaab6'), ('\uaab9', '\uaabd'), ('\uaac0', '\uaac0'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadd'), ('\uaae0', '\uaaea'), ('\uaaf2', '\uaaf4'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\uabc0', '\uabe2'), ('\uac00', '\uac00'), ('\ud7a3', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\ufb1d', '\ufb1d'), ('\ufb1f', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdfb'), ('\ufe70', '\ufe74'), ('\ufe76', '\ufefc'), ('\uff21', '\uff3a'), ('\uff41', '\uff5a'), ('\uff66', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U00010340'), ('\U00010342', '\U00010349'), ('\U00010350', '\U00010375'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U00010400', '\U0001049d'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a00'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae4'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011003', '\U00011037'), ('\U00011083', '\U000110af'), ('\U000110d0', '\U000110e8'), ('\U00011103', '\U00011126'), ('\U00011150', '\U00011172'), ('\U00011176', '\U00011176'), ('\U00011183', '\U000111b2'), ('\U000111c1', '\U000111c4'), ('\U000111da', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U000112b0', '\U000112de'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133d', '\U0001133d'), ('\U0001135d', '\U00011361'), ('\U00011480', '\U000114af'), ('\U000114c4', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U00011580', '\U000115ae'), ('\U00011600', '\U0001162f'), ('\U00011644', '\U00011644'), ('\U00011680', '\U000116aa'), ('\U000118a0', '\U000118df'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016ad0', '\U00016aed'), ('\U00016b00', '\U00016b2f'), ('\U00016b40', '\U00016b43'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U00016f93', '\U00016f9f'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001e800', '\U0001e8c4'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U00020000', '\U00020000'), ('\U0002a6d6', '\U0002a6d6'), ('\U0002a700', '\U0002a700'), ('\U0002b734', '\U0002b734'), ('\U0002b740', '\U0002b740'), ('\U0002b81d', '\U0002b81d'), ('\U0002f800', '\U0002fa1d') ]; pub static LC_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\x61', '\x7a'), ('\u00b5', '\u00b5'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u01ba'), ('\u01bc', '\u01bf'), ('\u01c4', '\u0293'), ('\u0295', '\u02af'), ('\u0370', '\u0373'), ('\u0376', '\u0377'), ('\u037b', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u048a', '\u052f'), ('\u0531', '\u0556'), ('\u0561', '\u0587'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u1d00', '\u1d2b'), ('\u1d6b', '\u1d77'), ('\u1d79', '\u1d9a'), ('\u1e00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212f', '\u2134'), ('\u2139', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2183', '\u2184'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2c7b'), ('\u2c7e', '\u2ce4'), ('\u2ceb', '\u2cee'), ('\u2cf2', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\ua640', '\ua66d'), ('\ua680', '\ua69b'), ('\ua722', '\ua76f'), ('\ua771', '\ua787'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7fa', '\ua7fa'), ('\uab30', '\uab5a'), ('\uab64', '\uab65'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\uff21', '\uff3a'), ('\uff41', '\uff5a'), ('\U00010400', '\U0001044f'), ('\U000118a0', '\U000118df'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb') ]; pub static Ll_table: &'static [(char, char)] = &[ ('\x61', '\x7a'), ('\u00b5', '\u00b5'), ('\u00df', '\u00f6'), ('\u00f8', '\u00ff'), ('\u0101', '\u0101'), ('\u0103', '\u0103'), ('\u0105', '\u0105'), ('\u0107', '\u0107'), ('\u0109', '\u0109'), ('\u010b', '\u010b'), ('\u010d', '\u010d'), ('\u010f', '\u010f'), ('\u0111', '\u0111'), ('\u0113', '\u0113'), ('\u0115', '\u0115'), ('\u0117', '\u0117'), ('\u0119', '\u0119'), ('\u011b', '\u011b'), ('\u011d', '\u011d'), ('\u011f', '\u011f'), ('\u0121', '\u0121'), ('\u0123', '\u0123'), ('\u0125', '\u0125'), ('\u0127', '\u0127'), ('\u0129', '\u0129'), ('\u012b', '\u012b'), ('\u012d', '\u012d'), ('\u012f', '\u012f'), ('\u0131', '\u0131'), ('\u0133', '\u0133'), ('\u0135', '\u0135'), ('\u0137', '\u0138'), ('\u013a', '\u013a'), ('\u013c', '\u013c'), ('\u013e', '\u013e'), ('\u0140', '\u0140'), ('\u0142', '\u0142'), ('\u0144', '\u0144'), ('\u0146', '\u0146'), ('\u0148', '\u0149'), ('\u014b', '\u014b'), ('\u014d', '\u014d'), ('\u014f', '\u014f'), ('\u0151', '\u0151'), ('\u0153', '\u0153'), ('\u0155', '\u0155'), ('\u0157', '\u0157'), ('\u0159', '\u0159'), ('\u015b', '\u015b'), ('\u015d', '\u015d'), ('\u015f', '\u015f'), ('\u0161', '\u0161'), ('\u0163', '\u0163'), ('\u0165', '\u0165'), ('\u0167', '\u0167'), ('\u0169', '\u0169'), ('\u016b', '\u016b'), ('\u016d', '\u016d'), ('\u016f', '\u016f'), ('\u0171', '\u0171'), ('\u0173', '\u0173'), ('\u0175', '\u0175'), ('\u0177', '\u0177'), ('\u017a', '\u017a'), ('\u017c', '\u017c'), ('\u017e', '\u0180'), ('\u0183', '\u0183'), ('\u0185', '\u0185'), ('\u0188', '\u0188'), ('\u018c', '\u018d'), ('\u0192', '\u0192'), ('\u0195', '\u0195'), ('\u0199', '\u019b'), ('\u019e', '\u019e'), ('\u01a1', '\u01a1'), ('\u01a3', '\u01a3'), ('\u01a5', '\u01a5'), ('\u01a8', '\u01a8'), ('\u01aa', '\u01ab'), ('\u01ad', '\u01ad'), ('\u01b0', '\u01b0'), ('\u01b4', '\u01b4'), ('\u01b6', '\u01b6'), ('\u01b9', '\u01ba'), ('\u01bd', '\u01bf'), ('\u01c6', '\u01c6'), ('\u01c9', '\u01c9'), ('\u01cc', '\u01cc'), ('\u01ce', '\u01ce'), ('\u01d0', '\u01d0'), ('\u01d2', '\u01d2'), ('\u01d4', '\u01d4'), ('\u01d6', '\u01d6'), ('\u01d8', '\u01d8'), ('\u01da', '\u01da'), ('\u01dc', '\u01dd'), ('\u01df', '\u01df'), ('\u01e1', '\u01e1'), ('\u01e3', '\u01e3'), ('\u01e5', '\u01e5'), ('\u01e7', '\u01e7'), ('\u01e9', '\u01e9'), ('\u01eb', '\u01eb'), ('\u01ed', '\u01ed'), ('\u01ef', '\u01f0'), ('\u01f3', '\u01f3'), ('\u01f5', '\u01f5'), ('\u01f9', '\u01f9'), ('\u01fb', '\u01fb'), ('\u01fd', '\u01fd'), ('\u01ff', '\u01ff'), ('\u0201', '\u0201'), ('\u0203', '\u0203'), ('\u0205', '\u0205'), ('\u0207', '\u0207'), ('\u0209', '\u0209'), ('\u020b', '\u020b'), ('\u020d', '\u020d'), ('\u020f', '\u020f'), ('\u0211', '\u0211'), ('\u0213', '\u0213'), ('\u0215', '\u0215'), ('\u0217', '\u0217'), ('\u0219', '\u0219'), ('\u021b', '\u021b'), ('\u021d', '\u021d'), ('\u021f', '\u021f'), ('\u0221', '\u0221'), ('\u0223', '\u0223'), ('\u0225', '\u0225'), ('\u0227', '\u0227'), ('\u0229', '\u0229'), ('\u022b', '\u022b'), ('\u022d', '\u022d'), ('\u022f', '\u022f'), ('\u0231', '\u0231'), ('\u0233', '\u0239'), ('\u023c', '\u023c'), ('\u023f', '\u0240'), ('\u0242', '\u0242'), ('\u0247', '\u0247'), ('\u0249', '\u0249'), ('\u024b', '\u024b'), ('\u024d', '\u024d'), ('\u024f', '\u0293'), ('\u0295', '\u02af'), ('\u0371', '\u0371'), ('\u0373', '\u0373'), ('\u0377', '\u0377'), ('\u037b', '\u037d'), ('\u0390', '\u0390'), ('\u03ac', '\u03ce'), ('\u03d0', '\u03d1'), ('\u03d5', '\u03d7'), ('\u03d9', '\u03d9'), ('\u03db', '\u03db'), ('\u03dd', '\u03dd'), ('\u03df', '\u03df'), ('\u03e1', '\u03e1'), ('\u03e3', '\u03e3'), ('\u03e5', '\u03e5'), ('\u03e7', '\u03e7'), ('\u03e9', '\u03e9'), ('\u03eb', '\u03eb'), ('\u03ed', '\u03ed'), ('\u03ef', '\u03f3'), ('\u03f5', '\u03f5'), ('\u03f8', '\u03f8'), ('\u03fb', '\u03fc'), ('\u0430', '\u045f'), ('\u0461', '\u0461'), ('\u0463', '\u0463'), ('\u0465', '\u0465'), ('\u0467', '\u0467'), ('\u0469', '\u0469'), ('\u046b', '\u046b'), ('\u046d', '\u046d'), ('\u046f', '\u046f'), ('\u0471', '\u0471'), ('\u0473', '\u0473'), ('\u0475', '\u0475'), ('\u0477', '\u0477'), ('\u0479', '\u0479'), ('\u047b', '\u047b'), ('\u047d', '\u047d'), ('\u047f', '\u047f'), ('\u0481', '\u0481'), ('\u048b', '\u048b'), ('\u048d', '\u048d'), ('\u048f', '\u048f'), ('\u0491', '\u0491'), ('\u0493', '\u0493'), ('\u0495', '\u0495'), ('\u0497', '\u0497'), ('\u0499', '\u0499'), ('\u049b', '\u049b'), ('\u049d', '\u049d'), ('\u049f', '\u049f'), ('\u04a1', '\u04a1'), ('\u04a3', '\u04a3'), ('\u04a5', '\u04a5'), ('\u04a7', '\u04a7'), ('\u04a9', '\u04a9'), ('\u04ab', '\u04ab'), ('\u04ad', '\u04ad'), ('\u04af', '\u04af'), ('\u04b1', '\u04b1'), ('\u04b3', '\u04b3'), ('\u04b5', '\u04b5'), ('\u04b7', '\u04b7'), ('\u04b9', '\u04b9'), ('\u04bb', '\u04bb'), ('\u04bd', '\u04bd'), ('\u04bf', '\u04bf'), ('\u04c2', '\u04c2'), ('\u04c4', '\u04c4'), ('\u04c6', '\u04c6'), ('\u04c8', '\u04c8'), ('\u04ca', '\u04ca'), ('\u04cc', '\u04cc'), ('\u04ce', '\u04cf'), ('\u04d1', '\u04d1'), ('\u04d3', '\u04d3'), ('\u04d5', '\u04d5'), ('\u04d7', '\u04d7'), ('\u04d9', '\u04d9'), ('\u04db', '\u04db'), ('\u04dd', '\u04dd'), ('\u04df', '\u04df'), ('\u04e1', '\u04e1'), ('\u04e3', '\u04e3'), ('\u04e5', '\u04e5'), ('\u04e7', '\u04e7'), ('\u04e9', '\u04e9'), ('\u04eb', '\u04eb'), ('\u04ed', '\u04ed'), ('\u04ef', '\u04ef'), ('\u04f1', '\u04f1'), ('\u04f3', '\u04f3'), ('\u04f5', '\u04f5'), ('\u04f7', '\u04f7'), ('\u04f9', '\u04f9'), ('\u04fb', '\u04fb'), ('\u04fd', '\u04fd'), ('\u04ff', '\u04ff'), ('\u0501', '\u0501'), ('\u0503', '\u0503'), ('\u0505', '\u0505'), ('\u0507', '\u0507'), ('\u0509', '\u0509'), ('\u050b', '\u050b'), ('\u050d', '\u050d'), ('\u050f', '\u050f'), ('\u0511', '\u0511'), ('\u0513', '\u0513'), ('\u0515', '\u0515'), ('\u0517', '\u0517'), ('\u0519', '\u0519'), ('\u051b', '\u051b'), ('\u051d', '\u051d'), ('\u051f', '\u051f'), ('\u0521', '\u0521'), ('\u0523', '\u0523'), ('\u0525', '\u0525'), ('\u0527', '\u0527'), ('\u0529', '\u0529'), ('\u052b', '\u052b'), ('\u052d', '\u052d'), ('\u052f', '\u052f'), ('\u0561', '\u0587'), ('\u1d00', '\u1d2b'), ('\u1d6b', '\u1d77'), ('\u1d79', '\u1d9a'), ('\u1e01', '\u1e01'), ('\u1e03', '\u1e03'), ('\u1e05', '\u1e05'), ('\u1e07', '\u1e07'), ('\u1e09', '\u1e09'), ('\u1e0b', '\u1e0b'), ('\u1e0d', '\u1e0d'), ('\u1e0f', '\u1e0f'), ('\u1e11', '\u1e11'), ('\u1e13', '\u1e13'), ('\u1e15', '\u1e15'), ('\u1e17', '\u1e17'), ('\u1e19', '\u1e19'), ('\u1e1b', '\u1e1b'), ('\u1e1d', '\u1e1d'), ('\u1e1f', '\u1e1f'), ('\u1e21', '\u1e21'), ('\u1e23', '\u1e23'), ('\u1e25', '\u1e25'), ('\u1e27', '\u1e27'), ('\u1e29', '\u1e29'), ('\u1e2b', '\u1e2b'), ('\u1e2d', '\u1e2d'), ('\u1e2f', '\u1e2f'), ('\u1e31', '\u1e31'), ('\u1e33', '\u1e33'), ('\u1e35', '\u1e35'), ('\u1e37', '\u1e37'), ('\u1e39', '\u1e39'), ('\u1e3b', '\u1e3b'), ('\u1e3d', '\u1e3d'), ('\u1e3f', '\u1e3f'), ('\u1e41', '\u1e41'), ('\u1e43', '\u1e43'), ('\u1e45', '\u1e45'), ('\u1e47', '\u1e47'), ('\u1e49', '\u1e49'), ('\u1e4b', '\u1e4b'), ('\u1e4d', '\u1e4d'), ('\u1e4f', '\u1e4f'), ('\u1e51', '\u1e51'), ('\u1e53', '\u1e53'), ('\u1e55', '\u1e55'), ('\u1e57', '\u1e57'), ('\u1e59', '\u1e59'), ('\u1e5b', '\u1e5b'), ('\u1e5d', '\u1e5d'), ('\u1e5f', '\u1e5f'), ('\u1e61', '\u1e61'), ('\u1e63', '\u1e63'), ('\u1e65', '\u1e65'), ('\u1e67', '\u1e67'), ('\u1e69', '\u1e69'), ('\u1e6b', '\u1e6b'), ('\u1e6d', '\u1e6d'), ('\u1e6f', '\u1e6f'), ('\u1e71', '\u1e71'), ('\u1e73', '\u1e73'), ('\u1e75', '\u1e75'), ('\u1e77', '\u1e77'), ('\u1e79', '\u1e79'), ('\u1e7b', '\u1e7b'), ('\u1e7d', '\u1e7d'), ('\u1e7f', '\u1e7f'), ('\u1e81', '\u1e81'), ('\u1e83', '\u1e83'), ('\u1e85', '\u1e85'), ('\u1e87', '\u1e87'), ('\u1e89', '\u1e89'), ('\u1e8b', '\u1e8b'), ('\u1e8d', '\u1e8d'), ('\u1e8f', '\u1e8f'), ('\u1e91', '\u1e91'), ('\u1e93', '\u1e93'), ('\u1e95', '\u1e9d'), ('\u1e9f', '\u1e9f'), ('\u1ea1', '\u1ea1'), ('\u1ea3', '\u1ea3'), ('\u1ea5', '\u1ea5'), ('\u1ea7', '\u1ea7'), ('\u1ea9', '\u1ea9'), ('\u1eab', '\u1eab'), ('\u1ead', '\u1ead'), ('\u1eaf', '\u1eaf'), ('\u1eb1', '\u1eb1'), ('\u1eb3', '\u1eb3'), ('\u1eb5', '\u1eb5'), ('\u1eb7', '\u1eb7'), ('\u1eb9', '\u1eb9'), ('\u1ebb', '\u1ebb'), ('\u1ebd', '\u1ebd'), ('\u1ebf', '\u1ebf'), ('\u1ec1', '\u1ec1'), ('\u1ec3', '\u1ec3'), ('\u1ec5', '\u1ec5'), ('\u1ec7', '\u1ec7'), ('\u1ec9', '\u1ec9'), ('\u1ecb', '\u1ecb'), ('\u1ecd', '\u1ecd'), ('\u1ecf', '\u1ecf'), ('\u1ed1', '\u1ed1'), ('\u1ed3', '\u1ed3'), ('\u1ed5', '\u1ed5'), ('\u1ed7', '\u1ed7'), ('\u1ed9', '\u1ed9'), ('\u1edb', '\u1edb'), ('\u1edd', '\u1edd'), ('\u1edf', '\u1edf'), ('\u1ee1', '\u1ee1'), ('\u1ee3', '\u1ee3'), ('\u1ee5', '\u1ee5'), ('\u1ee7', '\u1ee7'), ('\u1ee9', '\u1ee9'), ('\u1eeb', '\u1eeb'), ('\u1eed', '\u1eed'), ('\u1eef', '\u1eef'), ('\u1ef1', '\u1ef1'), ('\u1ef3', '\u1ef3'), ('\u1ef5', '\u1ef5'), ('\u1ef7', '\u1ef7'), ('\u1ef9', '\u1ef9'), ('\u1efb', '\u1efb'), ('\u1efd', '\u1efd'), ('\u1eff', '\u1f07'), ('\u1f10', '\u1f15'), ('\u1f20', '\u1f27'), ('\u1f30', '\u1f37'), ('\u1f40', '\u1f45'), ('\u1f50', '\u1f57'), ('\u1f60', '\u1f67'), ('\u1f70', '\u1f7d'), ('\u1f80', '\u1f87'), ('\u1f90', '\u1f97'), ('\u1fa0', '\u1fa7'), ('\u1fb0', '\u1fb4'), ('\u1fb6', '\u1fb7'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fc7'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fd7'), ('\u1fe0', '\u1fe7'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ff7'), ('\u210a', '\u210a'), ('\u210e', '\u210f'), ('\u2113', '\u2113'), ('\u212f', '\u212f'), ('\u2134', '\u2134'), ('\u2139', '\u2139'), ('\u213c', '\u213d'), ('\u2146', '\u2149'), ('\u214e', '\u214e'), ('\u2184', '\u2184'), ('\u2c30', '\u2c5e'), ('\u2c61', '\u2c61'), ('\u2c65', '\u2c66'), ('\u2c68', '\u2c68'), ('\u2c6a', '\u2c6a'), ('\u2c6c', '\u2c6c'), ('\u2c71', '\u2c71'), ('\u2c73', '\u2c74'), ('\u2c76', '\u2c7b'), ('\u2c81', '\u2c81'), ('\u2c83', '\u2c83'), ('\u2c85', '\u2c85'), ('\u2c87', '\u2c87'), ('\u2c89', '\u2c89'), ('\u2c8b', '\u2c8b'), ('\u2c8d', '\u2c8d'), ('\u2c8f', '\u2c8f'), ('\u2c91', '\u2c91'), ('\u2c93', '\u2c93'), ('\u2c95', '\u2c95'), ('\u2c97', '\u2c97'), ('\u2c99', '\u2c99'), ('\u2c9b', '\u2c9b'), ('\u2c9d', '\u2c9d'), ('\u2c9f', '\u2c9f'), ('\u2ca1', '\u2ca1'), ('\u2ca3', '\u2ca3'), ('\u2ca5', '\u2ca5'), ('\u2ca7', '\u2ca7'), ('\u2ca9', '\u2ca9'), ('\u2cab', '\u2cab'), ('\u2cad', '\u2cad'), ('\u2caf', '\u2caf'), ('\u2cb1', '\u2cb1'), ('\u2cb3', '\u2cb3'), ('\u2cb5', '\u2cb5'), ('\u2cb7', '\u2cb7'), ('\u2cb9', '\u2cb9'), ('\u2cbb', '\u2cbb'), ('\u2cbd', '\u2cbd'), ('\u2cbf', '\u2cbf'), ('\u2cc1', '\u2cc1'), ('\u2cc3', '\u2cc3'), ('\u2cc5', '\u2cc5'), ('\u2cc7', '\u2cc7'), ('\u2cc9', '\u2cc9'), ('\u2ccb', '\u2ccb'), ('\u2ccd', '\u2ccd'), ('\u2ccf', '\u2ccf'), ('\u2cd1', '\u2cd1'), ('\u2cd3', '\u2cd3'), ('\u2cd5', '\u2cd5'), ('\u2cd7', '\u2cd7'), ('\u2cd9', '\u2cd9'), ('\u2cdb', '\u2cdb'), ('\u2cdd', '\u2cdd'), ('\u2cdf', '\u2cdf'), ('\u2ce1', '\u2ce1'), ('\u2ce3', '\u2ce4'), ('\u2cec', '\u2cec'), ('\u2cee', '\u2cee'), ('\u2cf3', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\ua641', '\ua641'), ('\ua643', '\ua643'), ('\ua645', '\ua645'), ('\ua647', '\ua647'), ('\ua649', '\ua649'), ('\ua64b', '\ua64b'), ('\ua64d', '\ua64d'), ('\ua64f', '\ua64f'), ('\ua651', '\ua651'), ('\ua653', '\ua653'), ('\ua655', '\ua655'), ('\ua657', '\ua657'), ('\ua659', '\ua659'), ('\ua65b', '\ua65b'), ('\ua65d', '\ua65d'), ('\ua65f', '\ua65f'), ('\ua661', '\ua661'), ('\ua663', '\ua663'), ('\ua665', '\ua665'), ('\ua667', '\ua667'), ('\ua669', '\ua669'), ('\ua66b', '\ua66b'), ('\ua66d', '\ua66d'), ('\ua681', '\ua681'), ('\ua683', '\ua683'), ('\ua685', '\ua685'), ('\ua687', '\ua687'), ('\ua689', '\ua689'), ('\ua68b', '\ua68b'), ('\ua68d', '\ua68d'), ('\ua68f', '\ua68f'), ('\ua691', '\ua691'), ('\ua693', '\ua693'), ('\ua695', '\ua695'), ('\ua697', '\ua697'), ('\ua699', '\ua699'), ('\ua69b', '\ua69b'), ('\ua723', '\ua723'), ('\ua725', '\ua725'), ('\ua727', '\ua727'), ('\ua729', '\ua729'), ('\ua72b', '\ua72b'), ('\ua72d', '\ua72d'), ('\ua72f', '\ua731'), ('\ua733', '\ua733'), ('\ua735', '\ua735'), ('\ua737', '\ua737'), ('\ua739', '\ua739'), ('\ua73b', '\ua73b'), ('\ua73d', '\ua73d'), ('\ua73f', '\ua73f'), ('\ua741', '\ua741'), ('\ua743', '\ua743'), ('\ua745', '\ua745'), ('\ua747', '\ua747'), ('\ua749', '\ua749'), ('\ua74b', '\ua74b'), ('\ua74d', '\ua74d'), ('\ua74f', '\ua74f'), ('\ua751', '\ua751'), ('\ua753', '\ua753'), ('\ua755', '\ua755'), ('\ua757', '\ua757'), ('\ua759', '\ua759'), ('\ua75b', '\ua75b'), ('\ua75d', '\ua75d'), ('\ua75f', '\ua75f'), ('\ua761', '\ua761'), ('\ua763', '\ua763'), ('\ua765', '\ua765'), ('\ua767', '\ua767'), ('\ua769', '\ua769'), ('\ua76b', '\ua76b'), ('\ua76d', '\ua76d'), ('\ua76f', '\ua76f'), ('\ua771', '\ua778'), ('\ua77a', '\ua77a'), ('\ua77c', '\ua77c'), ('\ua77f', '\ua77f'), ('\ua781', '\ua781'), ('\ua783', '\ua783'), ('\ua785', '\ua785'), ('\ua787', '\ua787'), ('\ua78c', '\ua78c'), ('\ua78e', '\ua78e'), ('\ua791', '\ua791'), ('\ua793', '\ua795'), ('\ua797', '\ua797'), ('\ua799', '\ua799'), ('\ua79b', '\ua79b'), ('\ua79d', '\ua79d'), ('\ua79f', '\ua79f'), ('\ua7a1', '\ua7a1'), ('\ua7a3', '\ua7a3'), ('\ua7a5', '\ua7a5'), ('\ua7a7', '\ua7a7'), ('\ua7a9', '\ua7a9'), ('\ua7fa', '\ua7fa'), ('\uab30', '\uab5a'), ('\uab64', '\uab65'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\uff41', '\uff5a'), ('\U00010428', '\U0001044f'), ('\U000118c0', '\U000118df'), ('\U0001d41a', '\U0001d433'), ('\U0001d44e', '\U0001d454'), ('\U0001d456', '\U0001d467'), ('\U0001d482', '\U0001d49b'), ('\U0001d4b6', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d4cf'), ('\U0001d4ea', '\U0001d503'), ('\U0001d51e', '\U0001d537'), ('\U0001d552', '\U0001d56b'), ('\U0001d586', '\U0001d59f'), ('\U0001d5ba', '\U0001d5d3'), ('\U0001d5ee', '\U0001d607'), ('\U0001d622', '\U0001d63b'), ('\U0001d656', '\U0001d66f'), ('\U0001d68a', '\U0001d6a5'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6e1'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d71b'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d755'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d78f'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7c9'), ('\U0001d7cb', '\U0001d7cb') ]; pub static Lm_table: &'static [(char, char)] = &[ ('\u02b0', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0374', '\u0374'), ('\u037a', '\u037a'), ('\u0559', '\u0559'), ('\u0640', '\u0640'), ('\u06e5', '\u06e6'), ('\u07f4', '\u07f5'), ('\u07fa', '\u07fa'), ('\u081a', '\u081a'), ('\u0824', '\u0824'), ('\u0828', '\u0828'), ('\u0971', '\u0971'), ('\u0e46', '\u0e46'), ('\u0ec6', '\u0ec6'), ('\u10fc', '\u10fc'), ('\u17d7', '\u17d7'), ('\u1843', '\u1843'), ('\u1aa7', '\u1aa7'), ('\u1c78', '\u1c7d'), ('\u1d2c', '\u1d6a'), ('\u1d78', '\u1d78'), ('\u1d9b', '\u1dbf'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u2c7c', '\u2c7d'), ('\u2d6f', '\u2d6f'), ('\u2e2f', '\u2e2f'), ('\u3005', '\u3005'), ('\u3031', '\u3035'), ('\u303b', '\u303b'), ('\u309d', '\u309e'), ('\u30fc', '\u30fe'), ('\ua015', '\ua015'), ('\ua4f8', '\ua4fd'), ('\ua60c', '\ua60c'), ('\ua67f', '\ua67f'), ('\ua69c', '\ua69d'), ('\ua717', '\ua71f'), ('\ua770', '\ua770'), ('\ua788', '\ua788'), ('\ua7f8', '\ua7f9'), ('\ua9cf', '\ua9cf'), ('\ua9e6', '\ua9e6'), ('\uaa70', '\uaa70'), ('\uaadd', '\uaadd'), ('\uaaf3', '\uaaf4'), ('\uab5c', '\uab5f'), ('\uff70', '\uff70'), ('\uff9e', '\uff9f'), ('\U00016b40', '\U00016b43'), ('\U00016f93', '\U00016f9f') ]; pub static Lo_table: &'static [(char, char)] = &[ ('\u00aa', '\u00aa'), ('\u00ba', '\u00ba'), ('\u01bb', '\u01bb'), ('\u01c0', '\u01c3'), ('\u0294', '\u0294'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0620', '\u063f'), ('\u0641', '\u064a'), ('\u066e', '\u066f'), ('\u0671', '\u06d3'), ('\u06d5', '\u06d5'), ('\u06ee', '\u06ef'), ('\u06fa', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u0710'), ('\u0712', '\u072f'), ('\u074d', '\u07a5'), ('\u07b1', '\u07b1'), ('\u07ca', '\u07ea'), ('\u0800', '\u0815'), ('\u0840', '\u0858'), ('\u08a0', '\u08b2'), ('\u0904', '\u0939'), ('\u093d', '\u093d'), ('\u0950', '\u0950'), ('\u0958', '\u0961'), ('\u0972', '\u0980'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bd', '\u09bd'), ('\u09ce', '\u09ce'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09f0', '\u09f1'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a72', '\u0a74'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abd', '\u0abd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3d', '\u0b3d'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b71', '\u0b71'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bd0', '\u0bd0'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbd', '\u0cbd'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0cf1', '\u0cf2'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d4e', '\u0d4e'), ('\u0d60', '\u0d61'), ('\u0d7a', '\u0d7f'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0e01', '\u0e30'), ('\u0e32', '\u0e33'), ('\u0e40', '\u0e45'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb2', '\u0eb3'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f88', '\u0f8c'), ('\u1000', '\u102a'), ('\u103f', '\u103f'), ('\u1050', '\u1055'), ('\u105a', '\u105d'), ('\u1061', '\u1061'), ('\u1065', '\u1066'), ('\u106e', '\u1070'), ('\u1075', '\u1081'), ('\u108e', '\u108e'), ('\u10d0', '\u10fa'), ('\u10fd', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16f1', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1720', '\u1731'), ('\u1740', '\u1751'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1780', '\u17b3'), ('\u17dc', '\u17dc'), ('\u1820', '\u1842'), ('\u1844', '\u1877'), ('\u1880', '\u18a8'), ('\u18aa', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1950', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19c1', '\u19c7'), ('\u1a00', '\u1a16'), ('\u1a20', '\u1a54'), ('\u1b05', '\u1b33'), ('\u1b45', '\u1b4b'), ('\u1b83', '\u1ba0'), ('\u1bae', '\u1baf'), ('\u1bba', '\u1be5'), ('\u1c00', '\u1c23'), ('\u1c4d', '\u1c4f'), ('\u1c5a', '\u1c77'), ('\u1ce9', '\u1cec'), ('\u1cee', '\u1cf1'), ('\u1cf5', '\u1cf6'), ('\u2135', '\u2138'), ('\u2d30', '\u2d67'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u3006', '\u3006'), ('\u303c', '\u303c'), ('\u3041', '\u3096'), ('\u309f', '\u309f'), ('\u30a1', '\u30fa'), ('\u30ff', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u3400'), ('\u4db5', '\u4db5'), ('\u4e00', '\u4e00'), ('\u9fcc', '\u9fcc'), ('\ua000', '\ua014'), ('\ua016', '\ua48c'), ('\ua4d0', '\ua4f7'), ('\ua500', '\ua60b'), ('\ua610', '\ua61f'), ('\ua62a', '\ua62b'), ('\ua66e', '\ua66e'), ('\ua6a0', '\ua6e5'), ('\ua7f7', '\ua7f7'), ('\ua7fb', '\ua801'), ('\ua803', '\ua805'), ('\ua807', '\ua80a'), ('\ua80c', '\ua822'), ('\ua840', '\ua873'), ('\ua882', '\ua8b3'), ('\ua8f2', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua90a', '\ua925'), ('\ua930', '\ua946'), ('\ua960', '\ua97c'), ('\ua984', '\ua9b2'), ('\ua9e0', '\ua9e4'), ('\ua9e7', '\ua9ef'), ('\ua9fa', '\ua9fe'), ('\uaa00', '\uaa28'), ('\uaa40', '\uaa42'), ('\uaa44', '\uaa4b'), ('\uaa60', '\uaa6f'), ('\uaa71', '\uaa76'), ('\uaa7a', '\uaa7a'), ('\uaa7e', '\uaaaf'), ('\uaab1', '\uaab1'), ('\uaab5', '\uaab6'), ('\uaab9', '\uaabd'), ('\uaac0', '\uaac0'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadc'), ('\uaae0', '\uaaea'), ('\uaaf2', '\uaaf2'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uabc0', '\uabe2'), ('\uac00', '\uac00'), ('\ud7a3', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb1d', '\ufb1d'), ('\ufb1f', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdfb'), ('\ufe70', '\ufe74'), ('\ufe76', '\ufefc'), ('\uff66', '\uff6f'), ('\uff71', '\uff9d'), ('\uffa0', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U00010340'), ('\U00010342', '\U00010349'), ('\U00010350', '\U00010375'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U00010450', '\U0001049d'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a00'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae4'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011003', '\U00011037'), ('\U00011083', '\U000110af'), ('\U000110d0', '\U000110e8'), ('\U00011103', '\U00011126'), ('\U00011150', '\U00011172'), ('\U00011176', '\U00011176'), ('\U00011183', '\U000111b2'), ('\U000111c1', '\U000111c4'), ('\U000111da', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U000112b0', '\U000112de'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133d', '\U0001133d'), ('\U0001135d', '\U00011361'), ('\U00011480', '\U000114af'), ('\U000114c4', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U00011580', '\U000115ae'), ('\U00011600', '\U0001162f'), ('\U00011644', '\U00011644'), ('\U00011680', '\U000116aa'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016ad0', '\U00016aed'), ('\U00016b00', '\U00016b2f'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001e800', '\U0001e8c4'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U00020000', '\U00020000'), ('\U0002a6d6', '\U0002a6d6'), ('\U0002a700', '\U0002a700'), ('\U0002b734', '\U0002b734'), ('\U0002b740', '\U0002b740'), ('\U0002b81d', '\U0002b81d'), ('\U0002f800', '\U0002fa1d') ]; pub static Lt_table: &'static [(char, char)] = &[ ('\u01c5', '\u01c5'), ('\u01c8', '\u01c8'), ('\u01cb', '\u01cb'), ('\u01f2', '\u01f2'), ('\u1f88', '\u1f8f'), ('\u1f98', '\u1f9f'), ('\u1fa8', '\u1faf'), ('\u1fbc', '\u1fbc'), ('\u1fcc', '\u1fcc'), ('\u1ffc', '\u1ffc') ]; pub static Lu_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00de'), ('\u0100', '\u0100'), ('\u0102', '\u0102'), ('\u0104', '\u0104'), ('\u0106', '\u0106'), ('\u0108', '\u0108'), ('\u010a', '\u010a'), ('\u010c', '\u010c'), ('\u010e', '\u010e'), ('\u0110', '\u0110'), ('\u0112', '\u0112'), ('\u0114', '\u0114'), ('\u0116', '\u0116'), ('\u0118', '\u0118'), ('\u011a', '\u011a'), ('\u011c', '\u011c'), ('\u011e', '\u011e'), ('\u0120', '\u0120'), ('\u0122', '\u0122'), ('\u0124', '\u0124'), ('\u0126', '\u0126'), ('\u0128', '\u0128'), ('\u012a', '\u012a'), ('\u012c', '\u012c'), ('\u012e', '\u012e'), ('\u0130', '\u0130'), ('\u0132', '\u0132'), ('\u0134', '\u0134'), ('\u0136', '\u0136'), ('\u0139', '\u0139'), ('\u013b', '\u013b'), ('\u013d', '\u013d'), ('\u013f', '\u013f'), ('\u0141', '\u0141'), ('\u0143', '\u0143'), ('\u0145', '\u0145'), ('\u0147', '\u0147'), ('\u014a', '\u014a'), ('\u014c', '\u014c'), ('\u014e', '\u014e'), ('\u0150', '\u0150'), ('\u0152', '\u0152'), ('\u0154', '\u0154'), ('\u0156', '\u0156'), ('\u0158', '\u0158'), ('\u015a', '\u015a'), ('\u015c', '\u015c'), ('\u015e', '\u015e'), ('\u0160', '\u0160'), ('\u0162', '\u0162'), ('\u0164', '\u0164'), ('\u0166', '\u0166'), ('\u0168', '\u0168'), ('\u016a', '\u016a'), ('\u016c', '\u016c'), ('\u016e', '\u016e'), ('\u0170', '\u0170'), ('\u0172', '\u0172'), ('\u0174', '\u0174'), ('\u0176', '\u0176'), ('\u0178', '\u0179'), ('\u017b', '\u017b'), ('\u017d', '\u017d'), ('\u0181', '\u0182'), ('\u0184', '\u0184'), ('\u0186', '\u0187'), ('\u0189', '\u018b'), ('\u018e', '\u0191'), ('\u0193', '\u0194'), ('\u0196', '\u0198'), ('\u019c', '\u019d'), ('\u019f', '\u01a0'), ('\u01a2', '\u01a2'), ('\u01a4', '\u01a4'), ('\u01a6', '\u01a7'), ('\u01a9', '\u01a9'), ('\u01ac', '\u01ac'), ('\u01ae', '\u01af'), ('\u01b1', '\u01b3'), ('\u01b5', '\u01b5'), ('\u01b7', '\u01b8'), ('\u01bc', '\u01bc'), ('\u01c4', '\u01c4'), ('\u01c7', '\u01c7'), ('\u01ca', '\u01ca'), ('\u01cd', '\u01cd'), ('\u01cf', '\u01cf'), ('\u01d1', '\u01d1'), ('\u01d3', '\u01d3'), ('\u01d5', '\u01d5'), ('\u01d7', '\u01d7'), ('\u01d9', '\u01d9'), ('\u01db', '\u01db'), ('\u01de', '\u01de'), ('\u01e0', '\u01e0'), ('\u01e2', '\u01e2'), ('\u01e4', '\u01e4'), ('\u01e6', '\u01e6'), ('\u01e8', '\u01e8'), ('\u01ea', '\u01ea'), ('\u01ec', '\u01ec'), ('\u01ee', '\u01ee'), ('\u01f1', '\u01f1'), ('\u01f4', '\u01f4'), ('\u01f6', '\u01f8'), ('\u01fa', '\u01fa'), ('\u01fc', '\u01fc'), ('\u01fe', '\u01fe'), ('\u0200', '\u0200'), ('\u0202', '\u0202'), ('\u0204', '\u0204'), ('\u0206', '\u0206'), ('\u0208', '\u0208'), ('\u020a', '\u020a'), ('\u020c', '\u020c'), ('\u020e', '\u020e'), ('\u0210', '\u0210'), ('\u0212', '\u0212'), ('\u0214', '\u0214'), ('\u0216', '\u0216'), ('\u0218', '\u0218'), ('\u021a', '\u021a'), ('\u021c', '\u021c'), ('\u021e', '\u021e'), ('\u0220', '\u0220'), ('\u0222', '\u0222'), ('\u0224', '\u0224'), ('\u0226', '\u0226'), ('\u0228', '\u0228'), ('\u022a', '\u022a'), ('\u022c', '\u022c'), ('\u022e', '\u022e'), ('\u0230', '\u0230'), ('\u0232', '\u0232'), ('\u023a', '\u023b'), ('\u023d', '\u023e'), ('\u0241', '\u0241'), ('\u0243', '\u0246'), ('\u0248', '\u0248'), ('\u024a', '\u024a'), ('\u024c', '\u024c'), ('\u024e', '\u024e'), ('\u0370', '\u0370'), ('\u0372', '\u0372'), ('\u0376', '\u0376'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u038f'), ('\u0391', '\u03a1'), ('\u03a3', '\u03ab'), ('\u03cf', '\u03cf'), ('\u03d2', '\u03d4'), ('\u03d8', '\u03d8'), ('\u03da', '\u03da'), ('\u03dc', '\u03dc'), ('\u03de', '\u03de'), ('\u03e0', '\u03e0'), ('\u03e2', '\u03e2'), ('\u03e4', '\u03e4'), ('\u03e6', '\u03e6'), ('\u03e8', '\u03e8'), ('\u03ea', '\u03ea'), ('\u03ec', '\u03ec'), ('\u03ee', '\u03ee'), ('\u03f4', '\u03f4'), ('\u03f7', '\u03f7'), ('\u03f9', '\u03fa'), ('\u03fd', '\u042f'), ('\u0460', '\u0460'), ('\u0462', '\u0462'), ('\u0464', '\u0464'), ('\u0466', '\u0466'), ('\u0468', '\u0468'), ('\u046a', '\u046a'), ('\u046c', '\u046c'), ('\u046e', '\u046e'), ('\u0470', '\u0470'), ('\u0472', '\u0472'), ('\u0474', '\u0474'), ('\u0476', '\u0476'), ('\u0478', '\u0478'), ('\u047a', '\u047a'), ('\u047c', '\u047c'), ('\u047e', '\u047e'), ('\u0480', '\u0480'), ('\u048a', '\u048a'), ('\u048c', '\u048c'), ('\u048e', '\u048e'), ('\u0490', '\u0490'), ('\u0492', '\u0492'), ('\u0494', '\u0494'), ('\u0496', '\u0496'), ('\u0498', '\u0498'), ('\u049a', '\u049a'), ('\u049c', '\u049c'), ('\u049e', '\u049e'), ('\u04a0', '\u04a0'), ('\u04a2', '\u04a2'), ('\u04a4', '\u04a4'), ('\u04a6', '\u04a6'), ('\u04a8', '\u04a8'), ('\u04aa', '\u04aa'), ('\u04ac', '\u04ac'), ('\u04ae', '\u04ae'), ('\u04b0', '\u04b0'), ('\u04b2', '\u04b2'), ('\u04b4', '\u04b4'), ('\u04b6', '\u04b6'), ('\u04b8', '\u04b8'), ('\u04ba', '\u04ba'), ('\u04bc', '\u04bc'), ('\u04be', '\u04be'), ('\u04c0', '\u04c1'), ('\u04c3', '\u04c3'), ('\u04c5', '\u04c5'), ('\u04c7', '\u04c7'), ('\u04c9', '\u04c9'), ('\u04cb', '\u04cb'), ('\u04cd', '\u04cd'), ('\u04d0', '\u04d0'), ('\u04d2', '\u04d2'), ('\u04d4', '\u04d4'), ('\u04d6', '\u04d6'), ('\u04d8', '\u04d8'), ('\u04da', '\u04da'), ('\u04dc', '\u04dc'), ('\u04de', '\u04de'), ('\u04e0', '\u04e0'), ('\u04e2', '\u04e2'), ('\u04e4', '\u04e4'), ('\u04e6', '\u04e6'), ('\u04e8', '\u04e8'), ('\u04ea', '\u04ea'), ('\u04ec', '\u04ec'), ('\u04ee', '\u04ee'), ('\u04f0', '\u04f0'), ('\u04f2', '\u04f2'), ('\u04f4', '\u04f4'), ('\u04f6', '\u04f6'), ('\u04f8', '\u04f8'), ('\u04fa', '\u04fa'), ('\u04fc', '\u04fc'), ('\u04fe', '\u04fe'), ('\u0500', '\u0500'), ('\u0502', '\u0502'), ('\u0504', '\u0504'), ('\u0506', '\u0506'), ('\u0508', '\u0508'), ('\u050a', '\u050a'), ('\u050c', '\u050c'), ('\u050e', '\u050e'), ('\u0510', '\u0510'), ('\u0512', '\u0512'), ('\u0514', '\u0514'), ('\u0516', '\u0516'), ('\u0518', '\u0518'), ('\u051a', '\u051a'), ('\u051c', '\u051c'), ('\u051e', '\u051e'), ('\u0520', '\u0520'), ('\u0522', '\u0522'), ('\u0524', '\u0524'), ('\u0526', '\u0526'), ('\u0528', '\u0528'), ('\u052a', '\u052a'), ('\u052c', '\u052c'), ('\u052e', '\u052e'), ('\u0531', '\u0556'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u1e00', '\u1e00'), ('\u1e02', '\u1e02'), ('\u1e04', '\u1e04'), ('\u1e06', '\u1e06'), ('\u1e08', '\u1e08'), ('\u1e0a', '\u1e0a'), ('\u1e0c', '\u1e0c'), ('\u1e0e', '\u1e0e'), ('\u1e10', '\u1e10'), ('\u1e12', '\u1e12'), ('\u1e14', '\u1e14'), ('\u1e16', '\u1e16'), ('\u1e18', '\u1e18'), ('\u1e1a', '\u1e1a'), ('\u1e1c', '\u1e1c'), ('\u1e1e', '\u1e1e'), ('\u1e20', '\u1e20'), ('\u1e22', '\u1e22'), ('\u1e24', '\u1e24'), ('\u1e26', '\u1e26'), ('\u1e28', '\u1e28'), ('\u1e2a', '\u1e2a'), ('\u1e2c', '\u1e2c'), ('\u1e2e', '\u1e2e'), ('\u1e30', '\u1e30'), ('\u1e32', '\u1e32'), ('\u1e34', '\u1e34'), ('\u1e36', '\u1e36'), ('\u1e38', '\u1e38'), ('\u1e3a', '\u1e3a'), ('\u1e3c', '\u1e3c'), ('\u1e3e', '\u1e3e'), ('\u1e40', '\u1e40'), ('\u1e42', '\u1e42'), ('\u1e44', '\u1e44'), ('\u1e46', '\u1e46'), ('\u1e48', '\u1e48'), ('\u1e4a', '\u1e4a'), ('\u1e4c', '\u1e4c'), ('\u1e4e', '\u1e4e'), ('\u1e50', '\u1e50'), ('\u1e52', '\u1e52'), ('\u1e54', '\u1e54'), ('\u1e56', '\u1e56'), ('\u1e58', '\u1e58'), ('\u1e5a', '\u1e5a'), ('\u1e5c', '\u1e5c'), ('\u1e5e', '\u1e5e'), ('\u1e60', '\u1e60'), ('\u1e62', '\u1e62'), ('\u1e64', '\u1e64'), ('\u1e66', '\u1e66'), ('\u1e68', '\u1e68'), ('\u1e6a', '\u1e6a'), ('\u1e6c', '\u1e6c'), ('\u1e6e', '\u1e6e'), ('\u1e70', '\u1e70'), ('\u1e72', '\u1e72'), ('\u1e74', '\u1e74'), ('\u1e76', '\u1e76'), ('\u1e78', '\u1e78'), ('\u1e7a', '\u1e7a'), ('\u1e7c', '\u1e7c'), ('\u1e7e', '\u1e7e'), ('\u1e80', '\u1e80'), ('\u1e82', '\u1e82'), ('\u1e84', '\u1e84'), ('\u1e86', '\u1e86'), ('\u1e88', '\u1e88'), ('\u1e8a', '\u1e8a'), ('\u1e8c', '\u1e8c'), ('\u1e8e', '\u1e8e'), ('\u1e90', '\u1e90'), ('\u1e92', '\u1e92'), ('\u1e94', '\u1e94'), ('\u1e9e', '\u1e9e'), ('\u1ea0', '\u1ea0'), ('\u1ea2', '\u1ea2'), ('\u1ea4', '\u1ea4'), ('\u1ea6', '\u1ea6'), ('\u1ea8', '\u1ea8'), ('\u1eaa', '\u1eaa'), ('\u1eac', '\u1eac'), ('\u1eae', '\u1eae'), ('\u1eb0', '\u1eb0'), ('\u1eb2', '\u1eb2'), ('\u1eb4', '\u1eb4'), ('\u1eb6', '\u1eb6'), ('\u1eb8', '\u1eb8'), ('\u1eba', '\u1eba'), ('\u1ebc', '\u1ebc'), ('\u1ebe', '\u1ebe'), ('\u1ec0', '\u1ec0'), ('\u1ec2', '\u1ec2'), ('\u1ec4', '\u1ec4'), ('\u1ec6', '\u1ec6'), ('\u1ec8', '\u1ec8'), ('\u1eca', '\u1eca'), ('\u1ecc', '\u1ecc'), ('\u1ece', '\u1ece'), ('\u1ed0', '\u1ed0'), ('\u1ed2', '\u1ed2'), ('\u1ed4', '\u1ed4'), ('\u1ed6', '\u1ed6'), ('\u1ed8', '\u1ed8'), ('\u1eda', '\u1eda'), ('\u1edc', '\u1edc'), ('\u1ede', '\u1ede'), ('\u1ee0', '\u1ee0'), ('\u1ee2', '\u1ee2'), ('\u1ee4', '\u1ee4'), ('\u1ee6', '\u1ee6'), ('\u1ee8', '\u1ee8'), ('\u1eea', '\u1eea'), ('\u1eec', '\u1eec'), ('\u1eee', '\u1eee'), ('\u1ef0', '\u1ef0'), ('\u1ef2', '\u1ef2'), ('\u1ef4', '\u1ef4'), ('\u1ef6', '\u1ef6'), ('\u1ef8', '\u1ef8'), ('\u1efa', '\u1efa'), ('\u1efc', '\u1efc'), ('\u1efe', '\u1efe'), ('\u1f08', '\u1f0f'), ('\u1f18', '\u1f1d'), ('\u1f28', '\u1f2f'), ('\u1f38', '\u1f3f'), ('\u1f48', '\u1f4d'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f5f'), ('\u1f68', '\u1f6f'), ('\u1fb8', '\u1fbb'), ('\u1fc8', '\u1fcb'), ('\u1fd8', '\u1fdb'), ('\u1fe8', '\u1fec'), ('\u1ff8', '\u1ffb'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210b', '\u210d'), ('\u2110', '\u2112'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u2130', '\u2133'), ('\u213e', '\u213f'), ('\u2145', '\u2145'), ('\u2183', '\u2183'), ('\u2c00', '\u2c2e'), ('\u2c60', '\u2c60'), ('\u2c62', '\u2c64'), ('\u2c67', '\u2c67'), ('\u2c69', '\u2c69'), ('\u2c6b', '\u2c6b'), ('\u2c6d', '\u2c70'), ('\u2c72', '\u2c72'), ('\u2c75', '\u2c75'), ('\u2c7e', '\u2c80'), ('\u2c82', '\u2c82'), ('\u2c84', '\u2c84'), ('\u2c86', '\u2c86'), ('\u2c88', '\u2c88'), ('\u2c8a', '\u2c8a'), ('\u2c8c', '\u2c8c'), ('\u2c8e', '\u2c8e'), ('\u2c90', '\u2c90'), ('\u2c92', '\u2c92'), ('\u2c94', '\u2c94'), ('\u2c96', '\u2c96'), ('\u2c98', '\u2c98'), ('\u2c9a', '\u2c9a'), ('\u2c9c', '\u2c9c'), ('\u2c9e', '\u2c9e'), ('\u2ca0', '\u2ca0'), ('\u2ca2', '\u2ca2'), ('\u2ca4', '\u2ca4'), ('\u2ca6', '\u2ca6'), ('\u2ca8', '\u2ca8'), ('\u2caa', '\u2caa'), ('\u2cac', '\u2cac'), ('\u2cae', '\u2cae'), ('\u2cb0', '\u2cb0'), ('\u2cb2', '\u2cb2'), ('\u2cb4', '\u2cb4'), ('\u2cb6', '\u2cb6'), ('\u2cb8', '\u2cb8'), ('\u2cba', '\u2cba'), ('\u2cbc', '\u2cbc'), ('\u2cbe', '\u2cbe'), ('\u2cc0', '\u2cc0'), ('\u2cc2', '\u2cc2'), ('\u2cc4', '\u2cc4'), ('\u2cc6', '\u2cc6'), ('\u2cc8', '\u2cc8'), ('\u2cca', '\u2cca'), ('\u2ccc', '\u2ccc'), ('\u2cce', '\u2cce'), ('\u2cd0', '\u2cd0'), ('\u2cd2', '\u2cd2'), ('\u2cd4', '\u2cd4'), ('\u2cd6', '\u2cd6'), ('\u2cd8', '\u2cd8'), ('\u2cda', '\u2cda'), ('\u2cdc', '\u2cdc'), ('\u2cde', '\u2cde'), ('\u2ce0', '\u2ce0'), ('\u2ce2', '\u2ce2'), ('\u2ceb', '\u2ceb'), ('\u2ced', '\u2ced'), ('\u2cf2', '\u2cf2'), ('\ua640', '\ua640'), ('\ua642', '\ua642'), ('\ua644', '\ua644'), ('\ua646', '\ua646'), ('\ua648', '\ua648'), ('\ua64a', '\ua64a'), ('\ua64c', '\ua64c'), ('\ua64e', '\ua64e'), ('\ua650', '\ua650'), ('\ua652', '\ua652'), ('\ua654', '\ua654'), ('\ua656', '\ua656'), ('\ua658', '\ua658'), ('\ua65a', '\ua65a'), ('\ua65c', '\ua65c'), ('\ua65e', '\ua65e'), ('\ua660', '\ua660'), ('\ua662', '\ua662'), ('\ua664', '\ua664'), ('\ua666', '\ua666'), ('\ua668', '\ua668'), ('\ua66a', '\ua66a'), ('\ua66c', '\ua66c'), ('\ua680', '\ua680'), ('\ua682', '\ua682'), ('\ua684', '\ua684'), ('\ua686', '\ua686'), ('\ua688', '\ua688'), ('\ua68a', '\ua68a'), ('\ua68c', '\ua68c'), ('\ua68e', '\ua68e'), ('\ua690', '\ua690'), ('\ua692', '\ua692'), ('\ua694', '\ua694'), ('\ua696', '\ua696'), ('\ua698', '\ua698'), ('\ua69a', '\ua69a'), ('\ua722', '\ua722'), ('\ua724', '\ua724'), ('\ua726', '\ua726'), ('\ua728', '\ua728'), ('\ua72a', '\ua72a'), ('\ua72c', '\ua72c'), ('\ua72e', '\ua72e'), ('\ua732', '\ua732'), ('\ua734', '\ua734'), ('\ua736', '\ua736'), ('\ua738', '\ua738'), ('\ua73a', '\ua73a'), ('\ua73c', '\ua73c'), ('\ua73e', '\ua73e'), ('\ua740', '\ua740'), ('\ua742', '\ua742'), ('\ua744', '\ua744'), ('\ua746', '\ua746'), ('\ua748', '\ua748'), ('\ua74a', '\ua74a'), ('\ua74c', '\ua74c'), ('\ua74e', '\ua74e'), ('\ua750', '\ua750'), ('\ua752', '\ua752'), ('\ua754', '\ua754'), ('\ua756', '\ua756'), ('\ua758', '\ua758'), ('\ua75a', '\ua75a'), ('\ua75c', '\ua75c'), ('\ua75e', '\ua75e'), ('\ua760', '\ua760'), ('\ua762', '\ua762'), ('\ua764', '\ua764'), ('\ua766', '\ua766'), ('\ua768', '\ua768'), ('\ua76a', '\ua76a'), ('\ua76c', '\ua76c'), ('\ua76e', '\ua76e'), ('\ua779', '\ua779'), ('\ua77b', '\ua77b'), ('\ua77d', '\ua77e'), ('\ua780', '\ua780'), ('\ua782', '\ua782'), ('\ua784', '\ua784'), ('\ua786', '\ua786'), ('\ua78b', '\ua78b'), ('\ua78d', '\ua78d'), ('\ua790', '\ua790'), ('\ua792', '\ua792'), ('\ua796', '\ua796'), ('\ua798', '\ua798'), ('\ua79a', '\ua79a'), ('\ua79c', '\ua79c'), ('\ua79e', '\ua79e'), ('\ua7a0', '\ua7a0'), ('\ua7a2', '\ua7a2'), ('\ua7a4', '\ua7a4'), ('\ua7a6', '\ua7a6'), ('\ua7a8', '\ua7a8'), ('\ua7aa', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\uff21', '\uff3a'), ('\U00010400', '\U00010427'), ('\U000118a0', '\U000118bf'), ('\U0001d400', '\U0001d419'), ('\U0001d434', '\U0001d44d'), ('\U0001d468', '\U0001d481'), ('\U0001d49c', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b5'), ('\U0001d4d0', '\U0001d4e9'), ('\U0001d504', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d538', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d56c', '\U0001d585'), ('\U0001d5a0', '\U0001d5b9'), ('\U0001d5d4', '\U0001d5ed'), ('\U0001d608', '\U0001d621'), ('\U0001d63c', '\U0001d655'), ('\U0001d670', '\U0001d689'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6e2', '\U0001d6fa'), ('\U0001d71c', '\U0001d734'), ('\U0001d756', '\U0001d76e'), ('\U0001d790', '\U0001d7a8'), ('\U0001d7ca', '\U0001d7ca') ]; pub static M_table: &'static [(char, char)] = &[ ('\u0300', '\u036f'), ('\u0483', '\u0489'), ('\u0591', '\u05bd'), ('\u05bf', '\u05bf'), ('\u05c1', '\u05c2'), ('\u05c4', '\u05c5'), ('\u05c7', '\u05c7'), ('\u0610', '\u061a'), ('\u064b', '\u065f'), ('\u0670', '\u0670'), ('\u06d6', '\u06dc'), ('\u06df', '\u06e4'), ('\u06e7', '\u06e8'), ('\u06ea', '\u06ed'), ('\u0711', '\u0711'), ('\u0730', '\u074a'), ('\u07a6', '\u07b0'), ('\u07eb', '\u07f3'), ('\u0816', '\u0819'), ('\u081b', '\u0823'), ('\u0825', '\u0827'), ('\u0829', '\u082d'), ('\u0859', '\u085b'), ('\u08e4', '\u0903'), ('\u093a', '\u093c'), ('\u093e', '\u094f'), ('\u0951', '\u0957'), ('\u0962', '\u0963'), ('\u0981', '\u0983'), ('\u09bc', '\u09bc'), ('\u09be', '\u09c4'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09cd'), ('\u09d7', '\u09d7'), ('\u09e2', '\u09e3'), ('\u0a01', '\u0a03'), ('\u0a3c', '\u0a3c'), ('\u0a3e', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4d'), ('\u0a51', '\u0a51'), ('\u0a70', '\u0a71'), ('\u0a75', '\u0a75'), ('\u0a81', '\u0a83'), ('\u0abc', '\u0abc'), ('\u0abe', '\u0ac5'), ('\u0ac7', '\u0ac9'), ('\u0acb', '\u0acd'), ('\u0ae2', '\u0ae3'), ('\u0b01', '\u0b03'), ('\u0b3c', '\u0b3c'), ('\u0b3e', '\u0b44'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4d'), ('\u0b56', '\u0b57'), ('\u0b62', '\u0b63'), ('\u0b82', '\u0b82'), ('\u0bbe', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcd'), ('\u0bd7', '\u0bd7'), ('\u0c00', '\u0c03'), ('\u0c3e', '\u0c44'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4d'), ('\u0c55', '\u0c56'), ('\u0c62', '\u0c63'), ('\u0c81', '\u0c83'), ('\u0cbc', '\u0cbc'), ('\u0cbe', '\u0cc4'), ('\u0cc6', '\u0cc8'), ('\u0cca', '\u0ccd'), ('\u0cd5', '\u0cd6'), ('\u0ce2', '\u0ce3'), ('\u0d01', '\u0d03'), ('\u0d3e', '\u0d44'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4d'), ('\u0d57', '\u0d57'), ('\u0d62', '\u0d63'), ('\u0d82', '\u0d83'), ('\u0dca', '\u0dca'), ('\u0dcf', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0dd8', '\u0ddf'), ('\u0df2', '\u0df3'), ('\u0e31', '\u0e31'), ('\u0e34', '\u0e3a'), ('\u0e47', '\u0e4e'), ('\u0eb1', '\u0eb1'), ('\u0eb4', '\u0eb9'), ('\u0ebb', '\u0ebc'), ('\u0ec8', '\u0ecd'), ('\u0f18', '\u0f19'), ('\u0f35', '\u0f35'), ('\u0f37', '\u0f37'), ('\u0f39', '\u0f39'), ('\u0f3e', '\u0f3f'), ('\u0f71', '\u0f84'), ('\u0f86', '\u0f87'), ('\u0f8d', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u0fc6', '\u0fc6'), ('\u102b', '\u103e'), ('\u1056', '\u1059'), ('\u105e', '\u1060'), ('\u1062', '\u1064'), ('\u1067', '\u106d'), ('\u1071', '\u1074'), ('\u1082', '\u108d'), ('\u108f', '\u108f'), ('\u109a', '\u109d'), ('\u135d', '\u135f'), ('\u1712', '\u1714'), ('\u1732', '\u1734'), ('\u1752', '\u1753'), ('\u1772', '\u1773'), ('\u17b4', '\u17d3'), ('\u17dd', '\u17dd'), ('\u180b', '\u180d'), ('\u18a9', '\u18a9'), ('\u1920', '\u192b'), ('\u1930', '\u193b'), ('\u19b0', '\u19c0'), ('\u19c8', '\u19c9'), ('\u1a17', '\u1a1b'), ('\u1a55', '\u1a5e'), ('\u1a60', '\u1a7c'), ('\u1a7f', '\u1a7f'), ('\u1ab0', '\u1abe'), ('\u1b00', '\u1b04'), ('\u1b34', '\u1b44'), ('\u1b6b', '\u1b73'), ('\u1b80', '\u1b82'), ('\u1ba1', '\u1bad'), ('\u1be6', '\u1bf3'), ('\u1c24', '\u1c37'), ('\u1cd0', '\u1cd2'), ('\u1cd4', '\u1ce8'), ('\u1ced', '\u1ced'), ('\u1cf2', '\u1cf4'), ('\u1cf8', '\u1cf9'), ('\u1dc0', '\u1df5'), ('\u1dfc', '\u1dff'), ('\u20d0', '\u20f0'), ('\u2cef', '\u2cf1'), ('\u2d7f', '\u2d7f'), ('\u2de0', '\u2dff'), ('\u302a', '\u302f'), ('\u3099', '\u309a'), ('\ua66f', '\ua672'), ('\ua674', '\ua67d'), ('\ua69f', '\ua69f'), ('\ua6f0', '\ua6f1'), ('\ua802', '\ua802'), ('\ua806', '\ua806'), ('\ua80b', '\ua80b'), ('\ua823', '\ua827'), ('\ua880', '\ua881'), ('\ua8b4', '\ua8c4'), ('\ua8e0', '\ua8f1'), ('\ua926', '\ua92d'), ('\ua947', '\ua953'), ('\ua980', '\ua983'), ('\ua9b3', '\ua9c0'), ('\ua9e5', '\ua9e5'), ('\uaa29', '\uaa36'), ('\uaa43', '\uaa43'), ('\uaa4c', '\uaa4d'), ('\uaa7b', '\uaa7d'), ('\uaab0', '\uaab0'), ('\uaab2', '\uaab4'), ('\uaab7', '\uaab8'), ('\uaabe', '\uaabf'), ('\uaac1', '\uaac1'), ('\uaaeb', '\uaaef'), ('\uaaf5', '\uaaf6'), ('\uabe3', '\uabea'), ('\uabec', '\uabed'), ('\ufb1e', '\ufb1e'), ('\ufe00', '\ufe0f'), ('\ufe20', '\ufe2d'), ('\U000101fd', '\U000101fd'), ('\U000102e0', '\U000102e0'), ('\U00010376', '\U0001037a'), ('\U00010a01', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a0f'), ('\U00010a38', '\U00010a3a'), ('\U00010a3f', '\U00010a3f'), ('\U00010ae5', '\U00010ae6'), ('\U00011000', '\U00011002'), ('\U00011038', '\U00011046'), ('\U0001107f', '\U00011082'), ('\U000110b0', '\U000110ba'), ('\U00011100', '\U00011102'), ('\U00011127', '\U00011134'), ('\U00011173', '\U00011173'), ('\U00011180', '\U00011182'), ('\U000111b3', '\U000111c0'), ('\U0001122c', '\U00011237'), ('\U000112df', '\U000112ea'), ('\U00011301', '\U00011303'), ('\U0001133c', '\U0001133c'), ('\U0001133e', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134d'), ('\U00011357', '\U00011357'), ('\U00011362', '\U00011363'), ('\U00011366', '\U0001136c'), ('\U00011370', '\U00011374'), ('\U000114b0', '\U000114c3'), ('\U000115af', '\U000115b5'), ('\U000115b8', '\U000115c0'), ('\U00011630', '\U00011640'), ('\U000116ab', '\U000116b7'), ('\U00016af0', '\U00016af4'), ('\U00016b30', '\U00016b36'), ('\U00016f51', '\U00016f7e'), ('\U00016f8f', '\U00016f92'), ('\U0001bc9d', '\U0001bc9e'), ('\U0001d165', '\U0001d169'), ('\U0001d16d', '\U0001d172'), ('\U0001d17b', '\U0001d182'), ('\U0001d185', '\U0001d18b'), ('\U0001d1aa', '\U0001d1ad'), ('\U0001d242', '\U0001d244'), ('\U0001e8d0', '\U0001e8d6'), ('\U000e0100', '\U000e01ef') ]; pub static Mc_table: &'static [(char, char)] = &[ ('\u0903', '\u0903'), ('\u093b', '\u093b'), ('\u093e', '\u0940'), ('\u0949', '\u094c'), ('\u094e', '\u094f'), ('\u0982', '\u0983'), ('\u09be', '\u09c0'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09cc'), ('\u09d7', '\u09d7'), ('\u0a03', '\u0a03'), ('\u0a3e', '\u0a40'), ('\u0a83', '\u0a83'), ('\u0abe', '\u0ac0'), ('\u0ac9', '\u0ac9'), ('\u0acb', '\u0acc'), ('\u0b02', '\u0b03'), ('\u0b3e', '\u0b3e'), ('\u0b40', '\u0b40'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4c'), ('\u0b57', '\u0b57'), ('\u0bbe', '\u0bbf'), ('\u0bc1', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcc'), ('\u0bd7', '\u0bd7'), ('\u0c01', '\u0c03'), ('\u0c41', '\u0c44'), ('\u0c82', '\u0c83'), ('\u0cbe', '\u0cbe'), ('\u0cc0', '\u0cc4'), ('\u0cc7', '\u0cc8'), ('\u0cca', '\u0ccb'), ('\u0cd5', '\u0cd6'), ('\u0d02', '\u0d03'), ('\u0d3e', '\u0d40'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4c'), ('\u0d57', '\u0d57'), ('\u0d82', '\u0d83'), ('\u0dcf', '\u0dd1'), ('\u0dd8', '\u0ddf'), ('\u0df2', '\u0df3'), ('\u0f3e', '\u0f3f'), ('\u0f7f', '\u0f7f'), ('\u102b', '\u102c'), ('\u1031', '\u1031'), ('\u1038', '\u1038'), ('\u103b', '\u103c'), ('\u1056', '\u1057'), ('\u1062', '\u1064'), ('\u1067', '\u106d'), ('\u1083', '\u1084'), ('\u1087', '\u108c'), ('\u108f', '\u108f'), ('\u109a', '\u109c'), ('\u17b6', '\u17b6'), ('\u17be', '\u17c5'), ('\u17c7', '\u17c8'), ('\u1923', '\u1926'), ('\u1929', '\u192b'), ('\u1930', '\u1931'), ('\u1933', '\u1938'), ('\u19b0', '\u19c0'), ('\u19c8', '\u19c9'), ('\u1a19', '\u1a1a'), ('\u1a55', '\u1a55'), ('\u1a57', '\u1a57'), ('\u1a61', '\u1a61'), ('\u1a63', '\u1a64'), ('\u1a6d', '\u1a72'), ('\u1b04', '\u1b04'), ('\u1b35', '\u1b35'), ('\u1b3b', '\u1b3b'), ('\u1b3d', '\u1b41'), ('\u1b43', '\u1b44'), ('\u1b82', '\u1b82'), ('\u1ba1', '\u1ba1'), ('\u1ba6', '\u1ba7'), ('\u1baa', '\u1baa'), ('\u1be7', '\u1be7'), ('\u1bea', '\u1bec'), ('\u1bee', '\u1bee'), ('\u1bf2', '\u1bf3'), ('\u1c24', '\u1c2b'), ('\u1c34', '\u1c35'), ('\u1ce1', '\u1ce1'), ('\u1cf2', '\u1cf3'), ('\u302e', '\u302f'), ('\ua823', '\ua824'), ('\ua827', '\ua827'), ('\ua880', '\ua881'), ('\ua8b4', '\ua8c3'), ('\ua952', '\ua953'), ('\ua983', '\ua983'), ('\ua9b4', '\ua9b5'), ('\ua9ba', '\ua9bb'), ('\ua9bd', '\ua9c0'), ('\uaa2f', '\uaa30'), ('\uaa33', '\uaa34'), ('\uaa4d', '\uaa4d'), ('\uaa7b', '\uaa7b'), ('\uaa7d', '\uaa7d'), ('\uaaeb', '\uaaeb'), ('\uaaee', '\uaaef'), ('\uaaf5', '\uaaf5'), ('\uabe3', '\uabe4'), ('\uabe6', '\uabe7'), ('\uabe9', '\uabea'), ('\uabec', '\uabec'), ('\U00011000', '\U00011000'), ('\U00011002', '\U00011002'), ('\U00011082', '\U00011082'), ('\U000110b0', '\U000110b2'), ('\U000110b7', '\U000110b8'), ('\U0001112c', '\U0001112c'), ('\U00011182', '\U00011182'), ('\U000111b3', '\U000111b5'), ('\U000111bf', '\U000111c0'), ('\U0001122c', '\U0001122e'), ('\U00011232', '\U00011233'), ('\U00011235', '\U00011235'), ('\U000112e0', '\U000112e2'), ('\U00011302', '\U00011303'), ('\U0001133e', '\U0001133f'), ('\U00011341', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134d'), ('\U00011357', '\U00011357'), ('\U00011362', '\U00011363'), ('\U000114b0', '\U000114b2'), ('\U000114b9', '\U000114b9'), ('\U000114bb', '\U000114be'), ('\U000114c1', '\U000114c1'), ('\U000115af', '\U000115b1'), ('\U000115b8', '\U000115bb'), ('\U000115be', '\U000115be'), ('\U00011630', '\U00011632'), ('\U0001163b', '\U0001163c'), ('\U0001163e', '\U0001163e'), ('\U000116ac', '\U000116ac'), ('\U000116ae', '\U000116af'), ('\U000116b6', '\U000116b6'), ('\U00016f51', '\U00016f7e'), ('\U0001d165', '\U0001d166'), ('\U0001d16d', '\U0001d172') ]; pub static Me_table: &'static [(char, char)] = &[ ('\u0488', '\u0489'), ('\u1abe', '\u1abe'), ('\u20dd', '\u20e0'), ('\u20e2', '\u20e4'), ('\ua670', '\ua672') ]; pub static Mn_table: &'static [(char, char)] = &[ ('\u0300', '\u036f'), ('\u0483', '\u0487'), ('\u0591', '\u05bd'), ('\u05bf', '\u05bf'), ('\u05c1', '\u05c2'), ('\u05c4', '\u05c5'), ('\u05c7', '\u05c7'), ('\u0610', '\u061a'), ('\u064b', '\u065f'), ('\u0670', '\u0670'), ('\u06d6', '\u06dc'), ('\u06df', '\u06e4'), ('\u06e7', '\u06e8'), ('\u06ea', '\u06ed'), ('\u0711', '\u0711'), ('\u0730', '\u074a'), ('\u07a6', '\u07b0'), ('\u07eb', '\u07f3'), ('\u0816', '\u0819'), ('\u081b', '\u0823'), ('\u0825', '\u0827'), ('\u0829', '\u082d'), ('\u0859', '\u085b'), ('\u08e4', '\u0902'), ('\u093a', '\u093a'), ('\u093c', '\u093c'), ('\u0941', '\u0948'), ('\u094d', '\u094d'), ('\u0951', '\u0957'), ('\u0962', '\u0963'), ('\u0981', '\u0981'), ('\u09bc', '\u09bc'), ('\u09c1', '\u09c4'), ('\u09cd', '\u09cd'), ('\u09e2', '\u09e3'), ('\u0a01', '\u0a02'), ('\u0a3c', '\u0a3c'), ('\u0a41', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4d'), ('\u0a51', '\u0a51'), ('\u0a70', '\u0a71'), ('\u0a75', '\u0a75'), ('\u0a81', '\u0a82'), ('\u0abc', '\u0abc'), ('\u0ac1', '\u0ac5'), ('\u0ac7', '\u0ac8'), ('\u0acd', '\u0acd'), ('\u0ae2', '\u0ae3'), ('\u0b01', '\u0b01'), ('\u0b3c', '\u0b3c'), ('\u0b3f', '\u0b3f'), ('\u0b41', '\u0b44'), ('\u0b4d', '\u0b4d'), ('\u0b56', '\u0b56'), ('\u0b62', '\u0b63'), ('\u0b82', '\u0b82'), ('\u0bc0', '\u0bc0'), ('\u0bcd', '\u0bcd'), ('\u0c00', '\u0c00'), ('\u0c3e', '\u0c40'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4d'), ('\u0c55', '\u0c56'), ('\u0c62', '\u0c63'), ('\u0c81', '\u0c81'), ('\u0cbc', '\u0cbc'), ('\u0cbf', '\u0cbf'), ('\u0cc6', '\u0cc6'), ('\u0ccc', '\u0ccd'), ('\u0ce2', '\u0ce3'), ('\u0d01', '\u0d01'), ('\u0d41', '\u0d44'), ('\u0d4d', '\u0d4d'), ('\u0d62', '\u0d63'), ('\u0dca', '\u0dca'), ('\u0dd2', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0e31', '\u0e31'), ('\u0e34', '\u0e3a'), ('\u0e47', '\u0e4e'), ('\u0eb1', '\u0eb1'), ('\u0eb4', '\u0eb9'), ('\u0ebb', '\u0ebc'), ('\u0ec8', '\u0ecd'), ('\u0f18', '\u0f19'), ('\u0f35', '\u0f35'), ('\u0f37', '\u0f37'), ('\u0f39', '\u0f39'), ('\u0f71', '\u0f7e'), ('\u0f80', '\u0f84'), ('\u0f86', '\u0f87'), ('\u0f8d', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u0fc6', '\u0fc6'), ('\u102d', '\u1030'), ('\u1032', '\u1037'), ('\u1039', '\u103a'), ('\u103d', '\u103e'), ('\u1058', '\u1059'), ('\u105e', '\u1060'), ('\u1071', '\u1074'), ('\u1082', '\u1082'), ('\u1085', '\u1086'), ('\u108d', '\u108d'), ('\u109d', '\u109d'), ('\u135d', '\u135f'), ('\u1712', '\u1714'), ('\u1732', '\u1734'), ('\u1752', '\u1753'), ('\u1772', '\u1773'), ('\u17b4', '\u17b5'), ('\u17b7', '\u17bd'), ('\u17c6', '\u17c6'), ('\u17c9', '\u17d3'), ('\u17dd', '\u17dd'), ('\u180b', '\u180d'), ('\u18a9', '\u18a9'), ('\u1920', '\u1922'), ('\u1927', '\u1928'), ('\u1932', '\u1932'), ('\u1939', '\u193b'), ('\u1a17', '\u1a18'), ('\u1a1b', '\u1a1b'), ('\u1a56', '\u1a56'), ('\u1a58', '\u1a5e'), ('\u1a60', '\u1a60'), ('\u1a62', '\u1a62'), ('\u1a65', '\u1a6c'), ('\u1a73', '\u1a7c'), ('\u1a7f', '\u1a7f'), ('\u1ab0', '\u1abd'), ('\u1b00', '\u1b03'), ('\u1b34', '\u1b34'), ('\u1b36', '\u1b3a'), ('\u1b3c', '\u1b3c'), ('\u1b42', '\u1b42'), ('\u1b6b', '\u1b73'), ('\u1b80', '\u1b81'), ('\u1ba2', '\u1ba5'), ('\u1ba8', '\u1ba9'), ('\u1bab', '\u1bad'), ('\u1be6', '\u1be6'), ('\u1be8', '\u1be9'), ('\u1bed', '\u1bed'), ('\u1bef', '\u1bf1'), ('\u1c2c', '\u1c33'), ('\u1c36', '\u1c37'), ('\u1cd0', '\u1cd2'), ('\u1cd4', '\u1ce0'), ('\u1ce2', '\u1ce8'), ('\u1ced', '\u1ced'), ('\u1cf4', '\u1cf4'), ('\u1cf8', '\u1cf9'), ('\u1dc0', '\u1df5'), ('\u1dfc', '\u1dff'), ('\u20d0', '\u20dc'), ('\u20e1', '\u20e1'), ('\u20e5', '\u20f0'), ('\u2cef', '\u2cf1'), ('\u2d7f', '\u2d7f'), ('\u2de0', '\u2dff'), ('\u302a', '\u302d'), ('\u3099', '\u309a'), ('\ua66f', '\ua66f'), ('\ua674', '\ua67d'), ('\ua69f', '\ua69f'), ('\ua6f0', '\ua6f1'), ('\ua802', '\ua802'), ('\ua806', '\ua806'), ('\ua80b', '\ua80b'), ('\ua825', '\ua826'), ('\ua8c4', '\ua8c4'), ('\ua8e0', '\ua8f1'), ('\ua926', '\ua92d'), ('\ua947', '\ua951'), ('\ua980', '\ua982'), ('\ua9b3', '\ua9b3'), ('\ua9b6', '\ua9b9'), ('\ua9bc', '\ua9bc'), ('\ua9e5', '\ua9e5'), ('\uaa29', '\uaa2e'), ('\uaa31', '\uaa32'), ('\uaa35', '\uaa36'), ('\uaa43', '\uaa43'), ('\uaa4c', '\uaa4c'), ('\uaa7c', '\uaa7c'), ('\uaab0', '\uaab0'), ('\uaab2', '\uaab4'), ('\uaab7', '\uaab8'), ('\uaabe', '\uaabf'), ('\uaac1', '\uaac1'), ('\uaaec', '\uaaed'), ('\uaaf6', '\uaaf6'), ('\uabe5', '\uabe5'), ('\uabe8', '\uabe8'), ('\uabed', '\uabed'), ('\ufb1e', '\ufb1e'), ('\ufe00', '\ufe0f'), ('\ufe20', '\ufe2d'), ('\U000101fd', '\U000101fd'), ('\U000102e0', '\U000102e0'), ('\U00010376', '\U0001037a'), ('\U00010a01', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a0f'), ('\U00010a38', '\U00010a3a'), ('\U00010a3f', '\U00010a3f'), ('\U00010ae5', '\U00010ae6'), ('\U00011001', '\U00011001'), ('\U00011038', '\U00011046'), ('\U0001107f', '\U00011081'), ('\U000110b3', '\U000110b6'), ('\U000110b9', '\U000110ba'), ('\U00011100', '\U00011102'), ('\U00011127', '\U0001112b'), ('\U0001112d', '\U00011134'), ('\U00011173', '\U00011173'), ('\U00011180', '\U00011181'), ('\U000111b6', '\U000111be'), ('\U0001122f', '\U00011231'), ('\U00011234', '\U00011234'), ('\U00011236', '\U00011237'), ('\U000112df', '\U000112df'), ('\U000112e3', '\U000112ea'), ('\U00011301', '\U00011301'), ('\U0001133c', '\U0001133c'), ('\U00011340', '\U00011340'), ('\U00011366', '\U0001136c'), ('\U00011370', '\U00011374'), ('\U000114b3', '\U000114b8'), ('\U000114ba', '\U000114ba'), ('\U000114bf', '\U000114c0'), ('\U000114c2', '\U000114c3'), ('\U000115b2', '\U000115b5'), ('\U000115bc', '\U000115bd'), ('\U000115bf', '\U000115c0'), ('\U00011633', '\U0001163a'), ('\U0001163d', '\U0001163d'), ('\U0001163f', '\U00011640'), ('\U000116ab', '\U000116ab'), ('\U000116ad', '\U000116ad'), ('\U000116b0', '\U000116b5'), ('\U000116b7', '\U000116b7'), ('\U00016af0', '\U00016af4'), ('\U00016b30', '\U00016b36'), ('\U00016f8f', '\U00016f92'), ('\U0001bc9d', '\U0001bc9e'), ('\U0001d167', '\U0001d169'), ('\U0001d17b', '\U0001d182'), ('\U0001d185', '\U0001d18b'), ('\U0001d1aa', '\U0001d1ad'), ('\U0001d242', '\U0001d244'), ('\U0001e8d0', '\U0001e8d6'), ('\U000e0100', '\U000e01ef') ]; pub static N_table: &'static [(char, char)] = &[ ('\x30', '\x39'), ('\u0660', '\u0669'), ('\u06f0', '\u06f9'), ('\u07c0', '\u07c9'), ('\u0966', '\u096f'), ('\u09e6', '\u09ef'), ('\u0a66', '\u0a6f'), ('\u0ae6', '\u0aef'), ('\u0b66', '\u0b6f'), ('\u0be6', '\u0bef'), ('\u0c66', '\u0c6f'), ('\u0ce6', '\u0cef'), ('\u0d66', '\u0d6f'), ('\u0de6', '\u0def'), ('\u0e50', '\u0e59'), ('\u0ed0', '\u0ed9'), ('\u0f20', '\u0f29'), ('\u1040', '\u1049'), ('\u1090', '\u1099'), ('\u16ee', '\u16f0'), ('\u17e0', '\u17e9'), ('\u1810', '\u1819'), ('\u1946', '\u194f'), ('\u19d0', '\u19d9'), ('\u1a80', '\u1a89'), ('\u1a90', '\u1a99'), ('\u1b50', '\u1b59'), ('\u1bb0', '\u1bb9'), ('\u1c40', '\u1c49'), ('\u1c50', '\u1c59'), ('\u2160', '\u2182'), ('\u2185', '\u2188'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u3038', '\u303a'), ('\ua620', '\ua629'), ('\ua6e6', '\ua6ef'), ('\ua8d0', '\ua8d9'), ('\ua900', '\ua909'), ('\ua9d0', '\ua9d9'), ('\ua9f0', '\ua9f9'), ('\uaa50', '\uaa59'), ('\uabf0', '\uabf9'), ('\uff10', '\uff19'), ('\U00010140', '\U00010174'), ('\U00010341', '\U00010341'), ('\U0001034a', '\U0001034a'), ('\U000103d1', '\U000103d5'), ('\U000104a0', '\U000104a9'), ('\U00011066', '\U0001106f'), ('\U000110f0', '\U000110f9'), ('\U00011136', '\U0001113f'), ('\U000111d0', '\U000111d9'), ('\U000112f0', '\U000112f9'), ('\U000114d0', '\U000114d9'), ('\U00011650', '\U00011659'), ('\U000116c0', '\U000116c9'), ('\U000118e0', '\U000118e9'), ('\U00012400', '\U0001246e'), ('\U00016a60', '\U00016a69'), ('\U00016b50', '\U00016b59'), ('\U0001d7ce', '\U0001d7ff') ]; pub fn N(c: char) -> bool { super::bsearch_range_table(c, N_table) } pub static Nd_table: &'static [(char, char)] = &[ ('\x30', '\x39'), ('\u0660', '\u0669'), ('\u06f0', '\u06f9'), ('\u07c0', '\u07c9'), ('\u0966', '\u096f'), ('\u09e6', '\u09ef'), ('\u0a66', '\u0a6f'), ('\u0ae6', '\u0aef'), ('\u0b66', '\u0b6f'), ('\u0be6', '\u0bef'), ('\u0c66', '\u0c6f'), ('\u0ce6', '\u0cef'), ('\u0d66', '\u0d6f'), ('\u0de6', '\u0def'), ('\u0e50', '\u0e59'), ('\u0ed0', '\u0ed9'), ('\u0f20', '\u0f29'), ('\u1040', '\u1049'), ('\u1090', '\u1099'), ('\u17e0', '\u17e9'), ('\u1810', '\u1819'), ('\u1946', '\u194f'), ('\u19d0', '\u19d9'), ('\u1a80', '\u1a89'), ('\u1a90', '\u1a99'), ('\u1b50', '\u1b59'), ('\u1bb0', '\u1bb9'), ('\u1c40', '\u1c49'), ('\u1c50', '\u1c59'), ('\ua620', '\ua629'), ('\ua8d0', '\ua8d9'), ('\ua900', '\ua909'), ('\ua9d0', '\ua9d9'), ('\ua9f0', '\ua9f9'), ('\uaa50', '\uaa59'), ('\uabf0', '\uabf9'), ('\uff10', '\uff19'), ('\U000104a0', '\U000104a9'), ('\U00011066', '\U0001106f'), ('\U000110f0', '\U000110f9'), ('\U00011136', '\U0001113f'), ('\U000111d0', '\U000111d9'), ('\U000112f0', '\U000112f9'), ('\U000114d0', '\U000114d9'), ('\U00011650', '\U00011659'), ('\U000116c0', '\U000116c9'), ('\U000118e0', '\U000118e9'), ('\U00016a60', '\U00016a69'), ('\U00016b50', '\U00016b59'), ('\U0001d7ce', '\U0001d7ff') ]; pub static Nl_table: &'static [(char, char)] = &[ ('\u16ee', '\u16f0'), ('\u2160', '\u2182'), ('\u2185', '\u2188'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u3038', '\u303a'), ('\ua6e6', '\ua6ef'), ('\U00010140', '\U00010174'), ('\U00010341', '\U00010341'), ('\U0001034a', '\U0001034a'), ('\U000103d1', '\U000103d5'), ('\U00012400', '\U0001246e') ]; pub static No_table: &'static [(char, char)] = &[ ('\u00b2', '\u00b3'), ('\u00b9', '\u00b9'), ('\u00bc', '\u00be'), ('\u09f4', '\u09f9'), ('\u0b72', '\u0b77'), ('\u0bf0', '\u0bf2'), ('\u0c78', '\u0c7e'), ('\u0d70', '\u0d75'), ('\u0f2a', '\u0f33'), ('\u1369', '\u137c'), ('\u17f0', '\u17f9'), ('\u19da', '\u19da'), ('\u2070', '\u2070'), ('\u2074', '\u2079'), ('\u2080', '\u2089'), ('\u2150', '\u215f'), ('\u2189', '\u2189'), ('\u2460', '\u249b'), ('\u24ea', '\u24ff'), ('\u2776', '\u2793'), ('\u2cfd', '\u2cfd'), ('\u3192', '\u3195'), ('\u3220', '\u3229'), ('\u3248', '\u324f'), ('\u3251', '\u325f'), ('\u3280', '\u3289'), ('\u32b1', '\u32bf'), ('\ua830', '\ua835'), ('\U00010107', '\U00010133'), ('\U00010175', '\U00010178'), ('\U0001018a', '\U0001018b'), ('\U000102e1', '\U000102fb'), ('\U00010320', '\U00010323'), ('\U00010858', '\U0001085f'), ('\U00010879', '\U0001087f'), ('\U000108a7', '\U000108af'), ('\U00010916', '\U0001091b'), ('\U00010a40', '\U00010a47'), ('\U00010a7d', '\U00010a7e'), ('\U00010a9d', '\U00010a9f'), ('\U00010aeb', '\U00010aef'), ('\U00010b58', '\U00010b5f'), ('\U00010b78', '\U00010b7f'), ('\U00010ba9', '\U00010baf'), ('\U00010e60', '\U00010e7e'), ('\U00011052', '\U00011065'), ('\U000111e1', '\U000111f4'), ('\U000118ea', '\U000118f2'), ('\U00016b5b', '\U00016b61'), ('\U0001d360', '\U0001d371'), ('\U0001e8c7', '\U0001e8cf'), ('\U0001f100', '\U0001f10c') ]; pub static P_table: &'static [(char, char)] = &[ ('\x21', '\x23'), ('\x25', '\x2a'), ('\x2c', '\x2f'), ('\x3a', '\x3b'), ('\x3f', '\x40'), ('\x5b', '\x5d'), ('\x5f', '\x5f'), ('\x7b', '\x7b'), ('\x7d', '\x7d'), ('\u00a1', '\u00a1'), ('\u00a7', '\u00a7'), ('\u00ab', '\u00ab'), ('\u00b6', '\u00b7'), ('\u00bb', '\u00bb'), ('\u00bf', '\u00bf'), ('\u037e', '\u037e'), ('\u0387', '\u0387'), ('\u055a', '\u055f'), ('\u0589', '\u058a'), ('\u05be', '\u05be'), ('\u05c0', '\u05c0'), ('\u05c3', '\u05c3'), ('\u05c6', '\u05c6'), ('\u05f3', '\u05f4'), ('\u0609', '\u060a'), ('\u060c', '\u060d'), ('\u061b', '\u061b'), ('\u061e', '\u061f'), ('\u066a', '\u066d'), ('\u06d4', '\u06d4'), ('\u0700', '\u070d'), ('\u07f7', '\u07f9'), ('\u0830', '\u083e'), ('\u085e', '\u085e'), ('\u0964', '\u0965'), ('\u0970', '\u0970'), ('\u0af0', '\u0af0'), ('\u0df4', '\u0df4'), ('\u0e4f', '\u0e4f'), ('\u0e5a', '\u0e5b'), ('\u0f04', '\u0f12'), ('\u0f14', '\u0f14'), ('\u0f3a', '\u0f3d'), ('\u0f85', '\u0f85'), ('\u0fd0', '\u0fd4'), ('\u0fd9', '\u0fda'), ('\u104a', '\u104f'), ('\u10fb', '\u10fb'), ('\u1360', '\u1368'), ('\u1400', '\u1400'), ('\u166d', '\u166e'), ('\u169b', '\u169c'), ('\u16eb', '\u16ed'), ('\u1735', '\u1736'), ('\u17d4', '\u17d6'), ('\u17d8', '\u17da'), ('\u1800', '\u180a'), ('\u1944', '\u1945'), ('\u1a1e', '\u1a1f'), ('\u1aa0', '\u1aa6'), ('\u1aa8', '\u1aad'), ('\u1b5a', '\u1b60'), ('\u1bfc', '\u1bff'), ('\u1c3b', '\u1c3f'), ('\u1c7e', '\u1c7f'), ('\u1cc0', '\u1cc7'), ('\u1cd3', '\u1cd3'), ('\u2010', '\u2027'), ('\u2030', '\u2043'), ('\u2045', '\u2051'), ('\u2053', '\u205e'), ('\u207d', '\u207e'), ('\u208d', '\u208e'), ('\u2308', '\u230b'), ('\u2329', '\u232a'), ('\u2768', '\u2775'), ('\u27c5', '\u27c6'), ('\u27e6', '\u27ef'), ('\u2983', '\u2998'), ('\u29d8', '\u29db'), ('\u29fc', '\u29fd'), ('\u2cf9', '\u2cfc'), ('\u2cfe', '\u2cff'), ('\u2d70', '\u2d70'), ('\u2e00', '\u2e2e'), ('\u2e30', '\u2e42'), ('\u3001', '\u3003'), ('\u3008', '\u3011'), ('\u3014', '\u301f'), ('\u3030', '\u3030'), ('\u303d', '\u303d'), ('\u30a0', '\u30a0'), ('\u30fb', '\u30fb'), ('\ua4fe', '\ua4ff'), ('\ua60d', '\ua60f'), ('\ua673', '\ua673'), ('\ua67e', '\ua67e'), ('\ua6f2', '\ua6f7'), ('\ua874', '\ua877'), ('\ua8ce', '\ua8cf'), ('\ua8f8', '\ua8fa'), ('\ua92e', '\ua92f'), ('\ua95f', '\ua95f'), ('\ua9c1', '\ua9cd'), ('\ua9de', '\ua9df'), ('\uaa5c', '\uaa5f'), ('\uaade', '\uaadf'), ('\uaaf0', '\uaaf1'), ('\uabeb', '\uabeb'), ('\ufd3e', '\ufd3f'), ('\ufe10', '\ufe19'), ('\ufe30', '\ufe52'), ('\ufe54', '\ufe61'), ('\ufe63', '\ufe63'), ('\ufe68', '\ufe68'), ('\ufe6a', '\ufe6b'), ('\uff01', '\uff03'), ('\uff05', '\uff0a'), ('\uff0c', '\uff0f'), ('\uff1a', '\uff1b'), ('\uff1f', '\uff20'), ('\uff3b', '\uff3d'), ('\uff3f', '\uff3f'), ('\uff5b', '\uff5b'), ('\uff5d', '\uff5d'), ('\uff5f', '\uff65'), ('\U00010100', '\U00010102'), ('\U0001039f', '\U0001039f'), ('\U000103d0', '\U000103d0'), ('\U0001056f', '\U0001056f'), ('\U00010857', '\U00010857'), ('\U0001091f', '\U0001091f'), ('\U0001093f', '\U0001093f'), ('\U00010a50', '\U00010a58'), ('\U00010a7f', '\U00010a7f'), ('\U00010af0', '\U00010af6'), ('\U00010b39', '\U00010b3f'), ('\U00010b99', '\U00010b9c'), ('\U00011047', '\U0001104d'), ('\U000110bb', '\U000110bc'), ('\U000110be', '\U000110c1'), ('\U00011140', '\U00011143'), ('\U00011174', '\U00011175'), ('\U000111c5', '\U000111c8'), ('\U000111cd', '\U000111cd'), ('\U00011238', '\U0001123d'), ('\U000114c6', '\U000114c6'), ('\U000115c1', '\U000115c9'), ('\U00011641', '\U00011643'), ('\U00012470', '\U00012474'), ('\U00016a6e', '\U00016a6f'), ('\U00016af5', '\U00016af5'), ('\U00016b37', '\U00016b3b'), ('\U00016b44', '\U00016b44'), ('\U0001bc9f', '\U0001bc9f') ]; pub static Pc_table: &'static [(char, char)] = &[ ('\x5f', '\x5f'), ('\u203f', '\u2040'), ('\u2054', '\u2054'), ('\ufe33', '\ufe34'), ('\ufe4d', '\ufe4f'), ('\uff3f', '\uff3f') ]; pub static Pd_table: &'static [(char, char)] = &[ ('\x2d', '\x2d'), ('\u058a', '\u058a'), ('\u05be', '\u05be'), ('\u1400', '\u1400'), ('\u1806', '\u1806'), ('\u2010', '\u2015'), ('\u2e17', '\u2e17'), ('\u2e1a', '\u2e1a'), ('\u2e3a', '\u2e3b'), ('\u2e40', '\u2e40'), ('\u301c', '\u301c'), ('\u3030', '\u3030'), ('\u30a0', '\u30a0'), ('\ufe31', '\ufe32'), ('\ufe58', '\ufe58'), ('\ufe63', '\ufe63'), ('\uff0d', '\uff0d') ]; pub static Pe_table: &'static [(char, char)] = &[ ('\x29', '\x29'), ('\x5d', '\x5d'), ('\x7d', '\x7d'), ('\u0f3b', '\u0f3b'), ('\u0f3d', '\u0f3d'), ('\u169c', '\u169c'), ('\u2046', '\u2046'), ('\u207e', '\u207e'), ('\u208e', '\u208e'), ('\u2309', '\u2309'), ('\u230b', '\u230b'), ('\u232a', '\u232a'), ('\u2769', '\u2769'), ('\u276b', '\u276b'), ('\u276d', '\u276d'), ('\u276f', '\u276f'), ('\u2771', '\u2771'), ('\u2773', '\u2773'), ('\u2775', '\u2775'), ('\u27c6', '\u27c6'), ('\u27e7', '\u27e7'), ('\u27e9', '\u27e9'), ('\u27eb', '\u27eb'), ('\u27ed', '\u27ed'), ('\u27ef', '\u27ef'), ('\u2984', '\u2984'), ('\u2986', '\u2986'), ('\u2988', '\u2988'), ('\u298a', '\u298a'), ('\u298c', '\u298c'), ('\u298e', '\u298e'), ('\u2990', '\u2990'), ('\u2992', '\u2992'), ('\u2994', '\u2994'), ('\u2996', '\u2996'), ('\u2998', '\u2998'), ('\u29d9', '\u29d9'), ('\u29db', '\u29db'), ('\u29fd', '\u29fd'), ('\u2e23', '\u2e23'), ('\u2e25', '\u2e25'), ('\u2e27', '\u2e27'), ('\u2e29', '\u2e29'), ('\u3009', '\u3009'), ('\u300b', '\u300b'), ('\u300d', '\u300d'), ('\u300f', '\u300f'), ('\u3011', '\u3011'), ('\u3015', '\u3015'), ('\u3017', '\u3017'), ('\u3019', '\u3019'), ('\u301b', '\u301b'), ('\u301e', '\u301f'), ('\ufd3e', '\ufd3e'), ('\ufe18', '\ufe18'), ('\ufe36', '\ufe36'), ('\ufe38', '\ufe38'), ('\ufe3a', '\ufe3a'), ('\ufe3c', '\ufe3c'), ('\ufe3e', '\ufe3e'), ('\ufe40', '\ufe40'), ('\ufe42', '\ufe42'), ('\ufe44', '\ufe44'), ('\ufe48', '\ufe48'), ('\ufe5a', '\ufe5a'), ('\ufe5c', '\ufe5c'), ('\ufe5e', '\ufe5e'), ('\uff09', '\uff09'), ('\uff3d', '\uff3d'), ('\uff5d', '\uff5d'), ('\uff60', '\uff60'), ('\uff63', '\uff63') ]; pub static Pf_table: &'static [(char, char)] = &[ ('\u00bb', '\u00bb'), ('\u2019', '\u2019'), ('\u201d', '\u201d'), ('\u203a', '\u203a'), ('\u2e03', '\u2e03'), ('\u2e05', '\u2e05'), ('\u2e0a', '\u2e0a'), ('\u2e0d', '\u2e0d'), ('\u2e1d', '\u2e1d'), ('\u2e21', '\u2e21') ]; pub static Pi_table: &'static [(char, char)] = &[ ('\u00ab', '\u00ab'), ('\u2018', '\u2018'), ('\u201b', '\u201c'), ('\u201f', '\u201f'), ('\u2039', '\u2039'), ('\u2e02', '\u2e02'), ('\u2e04', '\u2e04'), ('\u2e09', '\u2e09'), ('\u2e0c', '\u2e0c'), ('\u2e1c', '\u2e1c'), ('\u2e20', '\u2e20') ]; pub static Po_table: &'static [(char, char)] = &[ ('\x21', '\x23'), ('\x25', '\x27'), ('\x2a', '\x2a'), ('\x2c', '\x2c'), ('\x2e', '\x2f'), ('\x3a', '\x3b'), ('\x3f', '\x40'), ('\x5c', '\x5c'), ('\u00a1', '\u00a1'), ('\u00a7', '\u00a7'), ('\u00b6', '\u00b7'), ('\u00bf', '\u00bf'), ('\u037e', '\u037e'), ('\u0387', '\u0387'), ('\u055a', '\u055f'), ('\u0589', '\u0589'), ('\u05c0', '\u05c0'), ('\u05c3', '\u05c3'), ('\u05c6', '\u05c6'), ('\u05f3', '\u05f4'), ('\u0609', '\u060a'), ('\u060c', '\u060d'), ('\u061b', '\u061b'), ('\u061e', '\u061f'), ('\u066a', '\u066d'), ('\u06d4', '\u06d4'), ('\u0700', '\u070d'), ('\u07f7', '\u07f9'), ('\u0830', '\u083e'), ('\u085e', '\u085e'), ('\u0964', '\u0965'), ('\u0970', '\u0970'), ('\u0af0', '\u0af0'), ('\u0df4', '\u0df4'), ('\u0e4f', '\u0e4f'), ('\u0e5a', '\u0e5b'), ('\u0f04', '\u0f12'), ('\u0f14', '\u0f14'), ('\u0f85', '\u0f85'), ('\u0fd0', '\u0fd4'), ('\u0fd9', '\u0fda'), ('\u104a', '\u104f'), ('\u10fb', '\u10fb'), ('\u1360', '\u1368'), ('\u166d', '\u166e'), ('\u16eb', '\u16ed'), ('\u1735', '\u1736'), ('\u17d4', '\u17d6'), ('\u17d8', '\u17da'), ('\u1800', '\u1805'), ('\u1807', '\u180a'), ('\u1944', '\u1945'), ('\u1a1e', '\u1a1f'), ('\u1aa0', '\u1aa6'), ('\u1aa8', '\u1aad'), ('\u1b5a', '\u1b60'), ('\u1bfc', '\u1bff'), ('\u1c3b', '\u1c3f'), ('\u1c7e', '\u1c7f'), ('\u1cc0', '\u1cc7'), ('\u1cd3', '\u1cd3'), ('\u2016', '\u2017'), ('\u2020', '\u2027'), ('\u2030', '\u2038'), ('\u203b', '\u203e'), ('\u2041', '\u2043'), ('\u2047', '\u2051'), ('\u2053', '\u2053'), ('\u2055', '\u205e'), ('\u2cf9', '\u2cfc'), ('\u2cfe', '\u2cff'), ('\u2d70', '\u2d70'), ('\u2e00', '\u2e01'), ('\u2e06', '\u2e08'), ('\u2e0b', '\u2e0b'), ('\u2e0e', '\u2e16'), ('\u2e18', '\u2e19'), ('\u2e1b', '\u2e1b'), ('\u2e1e', '\u2e1f'), ('\u2e2a', '\u2e2e'), ('\u2e30', '\u2e39'), ('\u2e3c', '\u2e3f'), ('\u2e41', '\u2e41'), ('\u3001', '\u3003'), ('\u303d', '\u303d'), ('\u30fb', '\u30fb'), ('\ua4fe', '\ua4ff'), ('\ua60d', '\ua60f'), ('\ua673', '\ua673'), ('\ua67e', '\ua67e'), ('\ua6f2', '\ua6f7'), ('\ua874', '\ua877'), ('\ua8ce', '\ua8cf'), ('\ua8f8', '\ua8fa'), ('\ua92e', '\ua92f'), ('\ua95f', '\ua95f'), ('\ua9c1', '\ua9cd'), ('\ua9de', '\ua9df'), ('\uaa5c', '\uaa5f'), ('\uaade', '\uaadf'), ('\uaaf0', '\uaaf1'), ('\uabeb', '\uabeb'), ('\ufe10', '\ufe16'), ('\ufe19', '\ufe19'), ('\ufe30', '\ufe30'), ('\ufe45', '\ufe46'), ('\ufe49', '\ufe4c'), ('\ufe50', '\ufe52'), ('\ufe54', '\ufe57'), ('\ufe5f', '\ufe61'), ('\ufe68', '\ufe68'), ('\ufe6a', '\ufe6b'), ('\uff01', '\uff03'), ('\uff05', '\uff07'), ('\uff0a', '\uff0a'), ('\uff0c', '\uff0c'), ('\uff0e', '\uff0f'), ('\uff1a', '\uff1b'), ('\uff1f', '\uff20'), ('\uff3c', '\uff3c'), ('\uff61', '\uff61'), ('\uff64', '\uff65'), ('\U00010100', '\U00010102'), ('\U0001039f', '\U0001039f'), ('\U000103d0', '\U000103d0'), ('\U0001056f', '\U0001056f'), ('\U00010857', '\U00010857'), ('\U0001091f', '\U0001091f'), ('\U0001093f', '\U0001093f'), ('\U00010a50', '\U00010a58'), ('\U00010a7f', '\U00010a7f'), ('\U00010af0', '\U00010af6'), ('\U00010b39', '\U00010b3f'), ('\U00010b99', '\U00010b9c'), ('\U00011047', '\U0001104d'), ('\U000110bb', '\U000110bc'), ('\U000110be', '\U000110c1'), ('\U00011140', '\U00011143'), ('\U00011174', '\U00011175'), ('\U000111c5', '\U000111c8'), ('\U000111cd', '\U000111cd'), ('\U00011238', '\U0001123d'), ('\U000114c6', '\U000114c6'), ('\U000115c1', '\U000115c9'), ('\U00011641', '\U00011643'), ('\U00012470', '\U00012474'), ('\U00016a6e', '\U00016a6f'), ('\U00016af5', '\U00016af5'), ('\U00016b37', '\U00016b3b'), ('\U00016b44', '\U00016b44'), ('\U0001bc9f', '\U0001bc9f') ]; pub static Ps_table: &'static [(char, char)] = &[ ('\x28', '\x28'), ('\x5b', '\x5b'), ('\x7b', '\x7b'), ('\u0f3a', '\u0f3a'), ('\u0f3c', '\u0f3c'), ('\u169b', '\u169b'), ('\u201a', '\u201a'), ('\u201e', '\u201e'), ('\u2045', '\u2045'), ('\u207d', '\u207d'), ('\u208d', '\u208d'), ('\u2308', '\u2308'), ('\u230a', '\u230a'), ('\u2329', '\u2329'), ('\u2768', '\u2768'), ('\u276a', '\u276a'), ('\u276c', '\u276c'), ('\u276e', '\u276e'), ('\u2770', '\u2770'), ('\u2772', '\u2772'), ('\u2774', '\u2774'), ('\u27c5', '\u27c5'), ('\u27e6', '\u27e6'), ('\u27e8', '\u27e8'), ('\u27ea', '\u27ea'), ('\u27ec', '\u27ec'), ('\u27ee', '\u27ee'), ('\u2983', '\u2983'), ('\u2985', '\u2985'), ('\u2987', '\u2987'), ('\u2989', '\u2989'), ('\u298b', '\u298b'), ('\u298d', '\u298d'), ('\u298f', '\u298f'), ('\u2991', '\u2991'), ('\u2993', '\u2993'), ('\u2995', '\u2995'), ('\u2997', '\u2997'), ('\u29d8', '\u29d8'), ('\u29da', '\u29da'), ('\u29fc', '\u29fc'), ('\u2e22', '\u2e22'), ('\u2e24', '\u2e24'), ('\u2e26', '\u2e26'), ('\u2e28', '\u2e28'), ('\u2e42', '\u2e42'), ('\u3008', '\u3008'), ('\u300a', '\u300a'), ('\u300c', '\u300c'), ('\u300e', '\u300e'), ('\u3010', '\u3010'), ('\u3014', '\u3014'), ('\u3016', '\u3016'), ('\u3018', '\u3018'), ('\u301a', '\u301a'), ('\u301d', '\u301d'), ('\ufd3f', '\ufd3f'), ('\ufe17', '\ufe17'), ('\ufe35', '\ufe35'), ('\ufe37', '\ufe37'), ('\ufe39', '\ufe39'), ('\ufe3b', '\ufe3b'), ('\ufe3d', '\ufe3d'), ('\ufe3f', '\ufe3f'), ('\ufe41', '\ufe41'), ('\ufe43', '\ufe43'), ('\ufe47', '\ufe47'), ('\ufe59', '\ufe59'), ('\ufe5b', '\ufe5b'), ('\ufe5d', '\ufe5d'), ('\uff08', '\uff08'), ('\uff3b', '\uff3b'), ('\uff5b', '\uff5b'), ('\uff5f', '\uff5f'), ('\uff62', '\uff62') ]; pub static S_table: &'static [(char, char)] = &[ ('\x24', '\x24'), ('\x2b', '\x2b'), ('\x3c', '\x3e'), ('\x5e', '\x5e'), ('\x60', '\x60'), ('\x7c', '\x7c'), ('\x7e', '\x7e'), ('\u00a2', '\u00a6'), ('\u00a8', '\u00a9'), ('\u00ac', '\u00ac'), ('\u00ae', '\u00b1'), ('\u00b4', '\u00b4'), ('\u00b8', '\u00b8'), ('\u00d7', '\u00d7'), ('\u00f7', '\u00f7'), ('\u02c2', '\u02c5'), ('\u02d2', '\u02df'), ('\u02e5', '\u02eb'), ('\u02ed', '\u02ed'), ('\u02ef', '\u02ff'), ('\u0375', '\u0375'), ('\u0384', '\u0385'), ('\u03f6', '\u03f6'), ('\u0482', '\u0482'), ('\u058d', '\u058f'), ('\u0606', '\u0608'), ('\u060b', '\u060b'), ('\u060e', '\u060f'), ('\u06de', '\u06de'), ('\u06e9', '\u06e9'), ('\u06fd', '\u06fe'), ('\u07f6', '\u07f6'), ('\u09f2', '\u09f3'), ('\u09fa', '\u09fb'), ('\u0af1', '\u0af1'), ('\u0b70', '\u0b70'), ('\u0bf3', '\u0bfa'), ('\u0c7f', '\u0c7f'), ('\u0d79', '\u0d79'), ('\u0e3f', '\u0e3f'), ('\u0f01', '\u0f03'), ('\u0f13', '\u0f13'), ('\u0f15', '\u0f17'), ('\u0f1a', '\u0f1f'), ('\u0f34', '\u0f34'), ('\u0f36', '\u0f36'), ('\u0f38', '\u0f38'), ('\u0fbe', '\u0fc5'), ('\u0fc7', '\u0fcc'), ('\u0fce', '\u0fcf'), ('\u0fd5', '\u0fd8'), ('\u109e', '\u109f'), ('\u1390', '\u1399'), ('\u17db', '\u17db'), ('\u1940', '\u1940'), ('\u19de', '\u19ff'), ('\u1b61', '\u1b6a'), ('\u1b74', '\u1b7c'), ('\u1fbd', '\u1fbd'), ('\u1fbf', '\u1fc1'), ('\u1fcd', '\u1fcf'), ('\u1fdd', '\u1fdf'), ('\u1fed', '\u1fef'), ('\u1ffd', '\u1ffe'), ('\u2044', '\u2044'), ('\u2052', '\u2052'), ('\u207a', '\u207c'), ('\u208a', '\u208c'), ('\u20a0', '\u20bd'), ('\u2100', '\u2101'), ('\u2103', '\u2106'), ('\u2108', '\u2109'), ('\u2114', '\u2114'), ('\u2116', '\u2118'), ('\u211e', '\u2123'), ('\u2125', '\u2125'), ('\u2127', '\u2127'), ('\u2129', '\u2129'), ('\u212e', '\u212e'), ('\u213a', '\u213b'), ('\u2140', '\u2144'), ('\u214a', '\u214d'), ('\u214f', '\u214f'), ('\u2190', '\u2307'), ('\u230c', '\u2328'), ('\u232b', '\u23fa'), ('\u2400', '\u2426'), ('\u2440', '\u244a'), ('\u249c', '\u24e9'), ('\u2500', '\u2767'), ('\u2794', '\u27c4'), ('\u27c7', '\u27e5'), ('\u27f0', '\u2982'), ('\u2999', '\u29d7'), ('\u29dc', '\u29fb'), ('\u29fe', '\u2b73'), ('\u2b76', '\u2b95'), ('\u2b98', '\u2bb9'), ('\u2bbd', '\u2bc8'), ('\u2bca', '\u2bd1'), ('\u2ce5', '\u2cea'), ('\u2e80', '\u2e99'), ('\u2e9b', '\u2ef3'), ('\u2f00', '\u2fd5'), ('\u2ff0', '\u2ffb'), ('\u3004', '\u3004'), ('\u3012', '\u3013'), ('\u3020', '\u3020'), ('\u3036', '\u3037'), ('\u303e', '\u303f'), ('\u309b', '\u309c'), ('\u3190', '\u3191'), ('\u3196', '\u319f'), ('\u31c0', '\u31e3'), ('\u3200', '\u321e'), ('\u322a', '\u3247'), ('\u3250', '\u3250'), ('\u3260', '\u327f'), ('\u328a', '\u32b0'), ('\u32c0', '\u32fe'), ('\u3300', '\u33ff'), ('\u4dc0', '\u4dff'), ('\ua490', '\ua4c6'), ('\ua700', '\ua716'), ('\ua720', '\ua721'), ('\ua789', '\ua78a'), ('\ua828', '\ua82b'), ('\ua836', '\ua839'), ('\uaa77', '\uaa79'), ('\uab5b', '\uab5b'), ('\ufb29', '\ufb29'), ('\ufbb2', '\ufbc1'), ('\ufdfc', '\ufdfd'), ('\ufe62', '\ufe62'), ('\ufe64', '\ufe66'), ('\ufe69', '\ufe69'), ('\uff04', '\uff04'), ('\uff0b', '\uff0b'), ('\uff1c', '\uff1e'), ('\uff3e', '\uff3e'), ('\uff40', '\uff40'), ('\uff5c', '\uff5c'), ('\uff5e', '\uff5e'), ('\uffe0', '\uffe6'), ('\uffe8', '\uffee'), ('\ufffc', '\ufffd'), ('\U00010137', '\U0001013f'), ('\U00010179', '\U00010189'), ('\U0001018c', '\U0001018c'), ('\U00010190', '\U0001019b'), ('\U000101a0', '\U000101a0'), ('\U000101d0', '\U000101fc'), ('\U00010877', '\U00010878'), ('\U00010ac8', '\U00010ac8'), ('\U00016b3c', '\U00016b3f'), ('\U00016b45', '\U00016b45'), ('\U0001bc9c', '\U0001bc9c'), ('\U0001d000', '\U0001d0f5'), ('\U0001d100', '\U0001d126'), ('\U0001d129', '\U0001d164'), ('\U0001d16a', '\U0001d16c'), ('\U0001d183', '\U0001d184'), ('\U0001d18c', '\U0001d1a9'), ('\U0001d1ae', '\U0001d1dd'), ('\U0001d200', '\U0001d241'), ('\U0001d245', '\U0001d245'), ('\U0001d300', '\U0001d356'), ('\U0001d6c1', '\U0001d6c1'), ('\U0001d6db', '\U0001d6db'), ('\U0001d6fb', '\U0001d6fb'), ('\U0001d715', '\U0001d715'), ('\U0001d735', '\U0001d735'), ('\U0001d74f', '\U0001d74f'), ('\U0001d76f', '\U0001d76f'), ('\U0001d789', '\U0001d789'), ('\U0001d7a9', '\U0001d7a9'), ('\U0001d7c3', '\U0001d7c3'), ('\U0001eef0', '\U0001eef1'), ('\U0001f000', '\U0001f02b'), ('\U0001f030', '\U0001f093'), ('\U0001f0a0', '\U0001f0ae'), ('\U0001f0b1', '\U0001f0bf'), ('\U0001f0c1', '\U0001f0cf'), ('\U0001f0d1', '\U0001f0f5'), ('\U0001f110', '\U0001f12e'), ('\U0001f130', '\U0001f16b'), ('\U0001f170', '\U0001f19a'), ('\U0001f1e6', '\U0001f202'), ('\U0001f210', '\U0001f23a'), ('\U0001f240', '\U0001f248'), ('\U0001f250', '\U0001f251'), ('\U0001f300', '\U0001f32c'), ('\U0001f330', '\U0001f37d'), ('\U0001f380', '\U0001f3ce'), ('\U0001f3d4', '\U0001f3f7'), ('\U0001f400', '\U0001f4fe'), ('\U0001f500', '\U0001f54a'), ('\U0001f550', '\U0001f579'), ('\U0001f57b', '\U0001f5a3'), ('\U0001f5a5', '\U0001f642'), ('\U0001f645', '\U0001f6cf'), ('\U0001f6e0', '\U0001f6ec'), ('\U0001f6f0', '\U0001f6f3'), ('\U0001f700', '\U0001f773'), ('\U0001f780', '\U0001f7d4'), ('\U0001f800', '\U0001f80b'), ('\U0001f810', '\U0001f847'), ('\U0001f850', '\U0001f859'), ('\U0001f860', '\U0001f887'), ('\U0001f890', '\U0001f8ad') ]; pub static Sc_table: &'static [(char, char)] = &[ ('\x24', '\x24'), ('\u00a2', '\u00a5'), ('\u058f', '\u058f'), ('\u060b', '\u060b'), ('\u09f2', '\u09f3'), ('\u09fb', '\u09fb'), ('\u0af1', '\u0af1'), ('\u0bf9', '\u0bf9'), ('\u0e3f', '\u0e3f'), ('\u17db', '\u17db'), ('\u20a0', '\u20bd'), ('\ua838', '\ua838'), ('\ufdfc', '\ufdfc'), ('\ufe69', '\ufe69'), ('\uff04', '\uff04'), ('\uffe0', '\uffe1'), ('\uffe5', '\uffe6') ]; pub static Sk_table: &'static [(char, char)] = &[ ('\x5e', '\x5e'), ('\x60', '\x60'), ('\u00a8', '\u00a8'), ('\u00af', '\u00af'), ('\u00b4', '\u00b4'), ('\u00b8', '\u00b8'), ('\u02c2', '\u02c5'), ('\u02d2', '\u02df'), ('\u02e5', '\u02eb'), ('\u02ed', '\u02ed'), ('\u02ef', '\u02ff'), ('\u0375', '\u0375'), ('\u0384', '\u0385'), ('\u1fbd', '\u1fbd'), ('\u1fbf', '\u1fc1'), ('\u1fcd', '\u1fcf'), ('\u1fdd', '\u1fdf'), ('\u1fed', '\u1fef'), ('\u1ffd', '\u1ffe'), ('\u309b', '\u309c'), ('\ua700', '\ua716'), ('\ua720', '\ua721'), ('\ua789', '\ua78a'), ('\uab5b', '\uab5b'), ('\ufbb2', '\ufbc1'), ('\uff3e', '\uff3e'), ('\uff40', '\uff40'), ('\uffe3', '\uffe3') ]; pub static Sm_table: &'static [(char, char)] = &[ ('\x2b', '\x2b'), ('\x3c', '\x3e'), ('\x7c', '\x7c'), ('\x7e', '\x7e'), ('\u00ac', '\u00ac'), ('\u00b1', '\u00b1'), ('\u00d7', '\u00d7'), ('\u00f7', '\u00f7'), ('\u03f6', '\u03f6'), ('\u0606', '\u0608'), ('\u2044', '\u2044'), ('\u2052', '\u2052'), ('\u207a', '\u207c'), ('\u208a', '\u208c'), ('\u2118', '\u2118'), ('\u2140', '\u2144'), ('\u214b', '\u214b'), ('\u2190', '\u2194'), ('\u219a', '\u219b'), ('\u21a0', '\u21a0'), ('\u21a3', '\u21a3'), ('\u21a6', '\u21a6'), ('\u21ae', '\u21ae'), ('\u21ce', '\u21cf'), ('\u21d2', '\u21d2'), ('\u21d4', '\u21d4'), ('\u21f4', '\u22ff'), ('\u2320', '\u2321'), ('\u237c', '\u237c'), ('\u239b', '\u23b3'), ('\u23dc', '\u23e1'), ('\u25b7', '\u25b7'), ('\u25c1', '\u25c1'), ('\u25f8', '\u25ff'), ('\u266f', '\u266f'), ('\u27c0', '\u27c4'), ('\u27c7', '\u27e5'), ('\u27f0', '\u27ff'), ('\u2900', '\u2982'), ('\u2999', '\u29d7'), ('\u29dc', '\u29fb'), ('\u29fe', '\u2aff'), ('\u2b30', '\u2b44'), ('\u2b47', '\u2b4c'), ('\ufb29', '\ufb29'), ('\ufe62', '\ufe62'), ('\ufe64', '\ufe66'), ('\uff0b', '\uff0b'), ('\uff1c', '\uff1e'), ('\uff5c', '\uff5c'), ('\uff5e', '\uff5e'), ('\uffe2', '\uffe2'), ('\uffe9', '\uffec'), ('\U0001d6c1', '\U0001d6c1'), ('\U0001d6db', '\U0001d6db'), ('\U0001d6fb', '\U0001d6fb'), ('\U0001d715', '\U0001d715'), ('\U0001d735', '\U0001d735'), ('\U0001d74f', '\U0001d74f'), ('\U0001d76f', '\U0001d76f'), ('\U0001d789', '\U0001d789'), ('\U0001d7a9', '\U0001d7a9'), ('\U0001d7c3', '\U0001d7c3'), ('\U0001eef0', '\U0001eef1') ]; pub static So_table: &'static [(char, char)] = &[ ('\u00a6', '\u00a6'), ('\u00a9', '\u00a9'), ('\u00ae', '\u00ae'), ('\u00b0', '\u00b0'), ('\u0482', '\u0482'), ('\u058d', '\u058e'), ('\u060e', '\u060f'), ('\u06de', '\u06de'), ('\u06e9', '\u06e9'), ('\u06fd', '\u06fe'), ('\u07f6', '\u07f6'), ('\u09fa', '\u09fa'), ('\u0b70', '\u0b70'), ('\u0bf3', '\u0bf8'), ('\u0bfa', '\u0bfa'), ('\u0c7f', '\u0c7f'), ('\u0d79', '\u0d79'), ('\u0f01', '\u0f03'), ('\u0f13', '\u0f13'), ('\u0f15', '\u0f17'), ('\u0f1a', '\u0f1f'), ('\u0f34', '\u0f34'), ('\u0f36', '\u0f36'), ('\u0f38', '\u0f38'), ('\u0fbe', '\u0fc5'), ('\u0fc7', '\u0fcc'), ('\u0fce', '\u0fcf'), ('\u0fd5', '\u0fd8'), ('\u109e', '\u109f'), ('\u1390', '\u1399'), ('\u1940', '\u1940'), ('\u19de', '\u19ff'), ('\u1b61', '\u1b6a'), ('\u1b74', '\u1b7c'), ('\u2100', '\u2101'), ('\u2103', '\u2106'), ('\u2108', '\u2109'), ('\u2114', '\u2114'), ('\u2116', '\u2117'), ('\u211e', '\u2123'), ('\u2125', '\u2125'), ('\u2127', '\u2127'), ('\u2129', '\u2129'), ('\u212e', '\u212e'), ('\u213a', '\u213b'), ('\u214a', '\u214a'), ('\u214c', '\u214d'), ('\u214f', '\u214f'), ('\u2195', '\u2199'), ('\u219c', '\u219f'), ('\u21a1', '\u21a2'), ('\u21a4', '\u21a5'), ('\u21a7', '\u21ad'), ('\u21af', '\u21cd'), ('\u21d0', '\u21d1'), ('\u21d3', '\u21d3'), ('\u21d5', '\u21f3'), ('\u2300', '\u2307'), ('\u230c', '\u231f'), ('\u2322', '\u2328'), ('\u232b', '\u237b'), ('\u237d', '\u239a'), ('\u23b4', '\u23db'), ('\u23e2', '\u23fa'), ('\u2400', '\u2426'), ('\u2440', '\u244a'), ('\u249c', '\u24e9'), ('\u2500', '\u25b6'), ('\u25b8', '\u25c0'), ('\u25c2', '\u25f7'), ('\u2600', '\u266e'), ('\u2670', '\u2767'), ('\u2794', '\u27bf'), ('\u2800', '\u28ff'), ('\u2b00', '\u2b2f'), ('\u2b45', '\u2b46'), ('\u2b4d', '\u2b73'), ('\u2b76', '\u2b95'), ('\u2b98', '\u2bb9'), ('\u2bbd', '\u2bc8'), ('\u2bca', '\u2bd1'), ('\u2ce5', '\u2cea'), ('\u2e80', '\u2e99'), ('\u2e9b', '\u2ef3'), ('\u2f00', '\u2fd5'), ('\u2ff0', '\u2ffb'), ('\u3004', '\u3004'), ('\u3012', '\u3013'), ('\u3020', '\u3020'), ('\u3036', '\u3037'), ('\u303e', '\u303f'), ('\u3190', '\u3191'), ('\u3196', '\u319f'), ('\u31c0', '\u31e3'), ('\u3200', '\u321e'), ('\u322a', '\u3247'), ('\u3250', '\u3250'), ('\u3260', '\u327f'), ('\u328a', '\u32b0'), ('\u32c0', '\u32fe'), ('\u3300', '\u33ff'), ('\u4dc0', '\u4dff'), ('\ua490', '\ua4c6'), ('\ua828', '\ua82b'), ('\ua836', '\ua837'), ('\ua839', '\ua839'), ('\uaa77', '\uaa79'), ('\ufdfd', '\ufdfd'), ('\uffe4', '\uffe4'), ('\uffe8', '\uffe8'), ('\uffed', '\uffee'), ('\ufffc', '\ufffd'), ('\U00010137', '\U0001013f'), ('\U00010179', '\U00010189'), ('\U0001018c', '\U0001018c'), ('\U00010190', '\U0001019b'), ('\U000101a0', '\U000101a0'), ('\U000101d0', '\U000101fc'), ('\U00010877', '\U00010878'), ('\U00010ac8', '\U00010ac8'), ('\U00016b3c', '\U00016b3f'), ('\U00016b45', '\U00016b45'), ('\U0001bc9c', '\U0001bc9c'), ('\U0001d000', '\U0001d0f5'), ('\U0001d100', '\U0001d126'), ('\U0001d129', '\U0001d164'), ('\U0001d16a', '\U0001d16c'), ('\U0001d183', '\U0001d184'), ('\U0001d18c', '\U0001d1a9'), ('\U0001d1ae', '\U0001d1dd'), ('\U0001d200', '\U0001d241'), ('\U0001d245', '\U0001d245'), ('\U0001d300', '\U0001d356'), ('\U0001f000', '\U0001f02b'), ('\U0001f030', '\U0001f093'), ('\U0001f0a0', '\U0001f0ae'), ('\U0001f0b1', '\U0001f0bf'), ('\U0001f0c1', '\U0001f0cf'), ('\U0001f0d1', '\U0001f0f5'), ('\U0001f110', '\U0001f12e'), ('\U0001f130', '\U0001f16b'), ('\U0001f170', '\U0001f19a'), ('\U0001f1e6', '\U0001f202'), ('\U0001f210', '\U0001f23a'), ('\U0001f240', '\U0001f248'), ('\U0001f250', '\U0001f251'), ('\U0001f300', '\U0001f32c'), ('\U0001f330', '\U0001f37d'), ('\U0001f380', '\U0001f3ce'), ('\U0001f3d4', '\U0001f3f7'), ('\U0001f400', '\U0001f4fe'), ('\U0001f500', '\U0001f54a'), ('\U0001f550', '\U0001f579'), ('\U0001f57b', '\U0001f5a3'), ('\U0001f5a5', '\U0001f642'), ('\U0001f645', '\U0001f6cf'), ('\U0001f6e0', '\U0001f6ec'), ('\U0001f6f0', '\U0001f6f3'), ('\U0001f700', '\U0001f773'), ('\U0001f780', '\U0001f7d4'), ('\U0001f800', '\U0001f80b'), ('\U0001f810', '\U0001f847'), ('\U0001f850', '\U0001f859'), ('\U0001f860', '\U0001f887'), ('\U0001f890', '\U0001f8ad') ]; pub static Z_table: &'static [(char, char)] = &[ ('\x20', '\x20'), ('\u00a0', '\u00a0'), ('\u1680', '\u1680'), ('\u2000', '\u200a'), ('\u2028', '\u2029'), ('\u202f', '\u202f'), ('\u205f', '\u205f'), ('\u3000', '\u3000') ]; pub static Zl_table: &'static [(char, char)] = &[ ('\u2028', '\u2028') ]; pub static Zp_table: &'static [(char, char)] = &[ ('\u2029', '\u2029') ]; pub static Zs_table: &'static [(char, char)] = &[ ('\x20', '\x20'), ('\u00a0', '\u00a0'), ('\u1680', '\u1680'), ('\u2000', '\u200a'), ('\u202f', '\u202f'), ('\u205f', '\u205f'), ('\u3000', '\u3000') ]; } pub mod derived_property { pub static Alphabetic_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u01ba'), ('\u01bb', '\u01bb'), ('\u01bc', '\u01bf'), ('\u01c0', '\u01c3'), ('\u01c4', '\u0293'), ('\u0294', '\u0294'), ('\u0295', '\u02af'), ('\u02b0', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0345', '\u0345'), ('\u0370', '\u0373'), ('\u0374', '\u0374'), ('\u0376', '\u0377'), ('\u037a', '\u037a'), ('\u037b', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u048a', '\u052f'), ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u0561', '\u0587'), ('\u05b0', '\u05bd'), ('\u05bf', '\u05bf'), ('\u05c1', '\u05c2'), ('\u05c4', '\u05c5'), ('\u05c7', '\u05c7'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0610', '\u061a'), ('\u0620', '\u063f'), ('\u0640', '\u0640'), ('\u0641', '\u064a'), ('\u064b', '\u0657'), ('\u0659', '\u065f'), ('\u066e', '\u066f'), ('\u0670', '\u0670'), ('\u0671', '\u06d3'), ('\u06d5', '\u06d5'), ('\u06d6', '\u06dc'), ('\u06e1', '\u06e4'), ('\u06e5', '\u06e6'), ('\u06e7', '\u06e8'), ('\u06ed', '\u06ed'), ('\u06ee', '\u06ef'), ('\u06fa', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u0710'), ('\u0711', '\u0711'), ('\u0712', '\u072f'), ('\u0730', '\u073f'), ('\u074d', '\u07a5'), ('\u07a6', '\u07b0'), ('\u07b1', '\u07b1'), ('\u07ca', '\u07ea'), ('\u07f4', '\u07f5'), ('\u07fa', '\u07fa'), ('\u0800', '\u0815'), ('\u0816', '\u0817'), ('\u081a', '\u081a'), ('\u081b', '\u0823'), ('\u0824', '\u0824'), ('\u0825', '\u0827'), ('\u0828', '\u0828'), ('\u0829', '\u082c'), ('\u0840', '\u0858'), ('\u08a0', '\u08b2'), ('\u08e4', '\u08e9'), ('\u08f0', '\u0902'), ('\u0903', '\u0903'), ('\u0904', '\u0939'), ('\u093a', '\u093a'), ('\u093b', '\u093b'), ('\u093d', '\u093d'), ('\u093e', '\u0940'), ('\u0941', '\u0948'), ('\u0949', '\u094c'), ('\u094e', '\u094f'), ('\u0950', '\u0950'), ('\u0955', '\u0957'), ('\u0958', '\u0961'), ('\u0962', '\u0963'), ('\u0971', '\u0971'), ('\u0972', '\u0980'), ('\u0981', '\u0981'), ('\u0982', '\u0983'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bd', '\u09bd'), ('\u09be', '\u09c0'), ('\u09c1', '\u09c4'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09cc'), ('\u09ce', '\u09ce'), ('\u09d7', '\u09d7'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09e2', '\u09e3'), ('\u09f0', '\u09f1'), ('\u0a01', '\u0a02'), ('\u0a03', '\u0a03'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a3e', '\u0a40'), ('\u0a41', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4c'), ('\u0a51', '\u0a51'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a70', '\u0a71'), ('\u0a72', '\u0a74'), ('\u0a75', '\u0a75'), ('\u0a81', '\u0a82'), ('\u0a83', '\u0a83'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abd', '\u0abd'), ('\u0abe', '\u0ac0'), ('\u0ac1', '\u0ac5'), ('\u0ac7', '\u0ac8'), ('\u0ac9', '\u0ac9'), ('\u0acb', '\u0acc'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0ae2', '\u0ae3'), ('\u0b01', '\u0b01'), ('\u0b02', '\u0b03'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3d', '\u0b3d'), ('\u0b3e', '\u0b3e'), ('\u0b3f', '\u0b3f'), ('\u0b40', '\u0b40'), ('\u0b41', '\u0b44'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4c'), ('\u0b56', '\u0b56'), ('\u0b57', '\u0b57'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b62', '\u0b63'), ('\u0b71', '\u0b71'), ('\u0b82', '\u0b82'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bbe', '\u0bbf'), ('\u0bc0', '\u0bc0'), ('\u0bc1', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcc'), ('\u0bd0', '\u0bd0'), ('\u0bd7', '\u0bd7'), ('\u0c00', '\u0c00'), ('\u0c01', '\u0c03'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c3e', '\u0c40'), ('\u0c41', '\u0c44'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4c'), ('\u0c55', '\u0c56'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c62', '\u0c63'), ('\u0c81', '\u0c81'), ('\u0c82', '\u0c83'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbd', '\u0cbd'), ('\u0cbe', '\u0cbe'), ('\u0cbf', '\u0cbf'), ('\u0cc0', '\u0cc4'), ('\u0cc6', '\u0cc6'), ('\u0cc7', '\u0cc8'), ('\u0cca', '\u0ccb'), ('\u0ccc', '\u0ccc'), ('\u0cd5', '\u0cd6'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0ce2', '\u0ce3'), ('\u0cf1', '\u0cf2'), ('\u0d01', '\u0d01'), ('\u0d02', '\u0d03'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d3e', '\u0d40'), ('\u0d41', '\u0d44'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4c'), ('\u0d4e', '\u0d4e'), ('\u0d57', '\u0d57'), ('\u0d60', '\u0d61'), ('\u0d62', '\u0d63'), ('\u0d7a', '\u0d7f'), ('\u0d82', '\u0d83'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0dcf', '\u0dd1'), ('\u0dd2', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0dd8', '\u0ddf'), ('\u0df2', '\u0df3'), ('\u0e01', '\u0e30'), ('\u0e31', '\u0e31'), ('\u0e32', '\u0e33'), ('\u0e34', '\u0e3a'), ('\u0e40', '\u0e45'), ('\u0e46', '\u0e46'), ('\u0e4d', '\u0e4d'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb1', '\u0eb1'), ('\u0eb2', '\u0eb3'), ('\u0eb4', '\u0eb9'), ('\u0ebb', '\u0ebc'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0ecd', '\u0ecd'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f71', '\u0f7e'), ('\u0f7f', '\u0f7f'), ('\u0f80', '\u0f81'), ('\u0f88', '\u0f8c'), ('\u0f8d', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u1000', '\u102a'), ('\u102b', '\u102c'), ('\u102d', '\u1030'), ('\u1031', '\u1031'), ('\u1032', '\u1036'), ('\u1038', '\u1038'), ('\u103b', '\u103c'), ('\u103d', '\u103e'), ('\u103f', '\u103f'), ('\u1050', '\u1055'), ('\u1056', '\u1057'), ('\u1058', '\u1059'), ('\u105a', '\u105d'), ('\u105e', '\u1060'), ('\u1061', '\u1061'), ('\u1062', '\u1062'), ('\u1065', '\u1066'), ('\u1067', '\u1068'), ('\u106e', '\u1070'), ('\u1071', '\u1074'), ('\u1075', '\u1081'), ('\u1082', '\u1082'), ('\u1083', '\u1084'), ('\u1085', '\u1086'), ('\u108e', '\u108e'), ('\u109c', '\u109c'), ('\u109d', '\u109d'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u10fc'), ('\u10fd', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u135f', '\u135f'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16ee', '\u16f0'), ('\u16f1', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1712', '\u1713'), ('\u1720', '\u1731'), ('\u1732', '\u1733'), ('\u1740', '\u1751'), ('\u1752', '\u1753'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1772', '\u1773'), ('\u1780', '\u17b3'), ('\u17b6', '\u17b6'), ('\u17b7', '\u17bd'), ('\u17be', '\u17c5'), ('\u17c6', '\u17c6'), ('\u17c7', '\u17c8'), ('\u17d7', '\u17d7'), ('\u17dc', '\u17dc'), ('\u1820', '\u1842'), ('\u1843', '\u1843'), ('\u1844', '\u1877'), ('\u1880', '\u18a8'), ('\u18a9', '\u18a9'), ('\u18aa', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1920', '\u1922'), ('\u1923', '\u1926'), ('\u1927', '\u1928'), ('\u1929', '\u192b'), ('\u1930', '\u1931'), ('\u1932', '\u1932'), ('\u1933', '\u1938'), ('\u1950', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19b0', '\u19c0'), ('\u19c1', '\u19c7'), ('\u19c8', '\u19c9'), ('\u1a00', '\u1a16'), ('\u1a17', '\u1a18'), ('\u1a19', '\u1a1a'), ('\u1a1b', '\u1a1b'), ('\u1a20', '\u1a54'), ('\u1a55', '\u1a55'), ('\u1a56', '\u1a56'), ('\u1a57', '\u1a57'), ('\u1a58', '\u1a5e'), ('\u1a61', '\u1a61'), ('\u1a62', '\u1a62'), ('\u1a63', '\u1a64'), ('\u1a65', '\u1a6c'), ('\u1a6d', '\u1a72'), ('\u1a73', '\u1a74'), ('\u1aa7', '\u1aa7'), ('\u1b00', '\u1b03'), ('\u1b04', '\u1b04'), ('\u1b05', '\u1b33'), ('\u1b35', '\u1b35'), ('\u1b36', '\u1b3a'), ('\u1b3b', '\u1b3b'), ('\u1b3c', '\u1b3c'), ('\u1b3d', '\u1b41'), ('\u1b42', '\u1b42'), ('\u1b43', '\u1b43'), ('\u1b45', '\u1b4b'), ('\u1b80', '\u1b81'), ('\u1b82', '\u1b82'), ('\u1b83', '\u1ba0'), ('\u1ba1', '\u1ba1'), ('\u1ba2', '\u1ba5'), ('\u1ba6', '\u1ba7'), ('\u1ba8', '\u1ba9'), ('\u1bac', '\u1bad'), ('\u1bae', '\u1baf'), ('\u1bba', '\u1be5'), ('\u1be7', '\u1be7'), ('\u1be8', '\u1be9'), ('\u1bea', '\u1bec'), ('\u1bed', '\u1bed'), ('\u1bee', '\u1bee'), ('\u1bef', '\u1bf1'), ('\u1c00', '\u1c23'), ('\u1c24', '\u1c2b'), ('\u1c2c', '\u1c33'), ('\u1c34', '\u1c35'), ('\u1c4d', '\u1c4f'), ('\u1c5a', '\u1c77'), ('\u1c78', '\u1c7d'), ('\u1ce9', '\u1cec'), ('\u1cee', '\u1cf1'), ('\u1cf2', '\u1cf3'), ('\u1cf5', '\u1cf6'), ('\u1d00', '\u1d2b'), ('\u1d2c', '\u1d6a'), ('\u1d6b', '\u1d77'), ('\u1d78', '\u1d78'), ('\u1d79', '\u1d9a'), ('\u1d9b', '\u1dbf'), ('\u1de7', '\u1df4'), ('\u1e00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212f', '\u2134'), ('\u2135', '\u2138'), ('\u2139', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2160', '\u2182'), ('\u2183', '\u2184'), ('\u2185', '\u2188'), ('\u24b6', '\u24e9'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2c7b'), ('\u2c7c', '\u2c7d'), ('\u2c7e', '\u2ce4'), ('\u2ceb', '\u2cee'), ('\u2cf2', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u2de0', '\u2dff'), ('\u2e2f', '\u2e2f'), ('\u3005', '\u3005'), ('\u3006', '\u3006'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u3031', '\u3035'), ('\u3038', '\u303a'), ('\u303b', '\u303b'), ('\u303c', '\u303c'), ('\u3041', '\u3096'), ('\u309d', '\u309e'), ('\u309f', '\u309f'), ('\u30a1', '\u30fa'), ('\u30fc', '\u30fe'), ('\u30ff', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u4db5'), ('\u4e00', '\u9fcc'), ('\ua000', '\ua014'), ('\ua015', '\ua015'), ('\ua016', '\ua48c'), ('\ua4d0', '\ua4f7'), ('\ua4f8', '\ua4fd'), ('\ua500', '\ua60b'), ('\ua60c', '\ua60c'), ('\ua610', '\ua61f'), ('\ua62a', '\ua62b'), ('\ua640', '\ua66d'), ('\ua66e', '\ua66e'), ('\ua674', '\ua67b'), ('\ua67f', '\ua67f'), ('\ua680', '\ua69b'), ('\ua69c', '\ua69d'), ('\ua69f', '\ua69f'), ('\ua6a0', '\ua6e5'), ('\ua6e6', '\ua6ef'), ('\ua717', '\ua71f'), ('\ua722', '\ua76f'), ('\ua770', '\ua770'), ('\ua771', '\ua787'), ('\ua788', '\ua788'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua7f7'), ('\ua7f8', '\ua7f9'), ('\ua7fa', '\ua7fa'), ('\ua7fb', '\ua801'), ('\ua803', '\ua805'), ('\ua807', '\ua80a'), ('\ua80c', '\ua822'), ('\ua823', '\ua824'), ('\ua825', '\ua826'), ('\ua827', '\ua827'), ('\ua840', '\ua873'), ('\ua880', '\ua881'), ('\ua882', '\ua8b3'), ('\ua8b4', '\ua8c3'), ('\ua8f2', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua90a', '\ua925'), ('\ua926', '\ua92a'), ('\ua930', '\ua946'), ('\ua947', '\ua951'), ('\ua952', '\ua952'), ('\ua960', '\ua97c'), ('\ua980', '\ua982'), ('\ua983', '\ua983'), ('\ua984', '\ua9b2'), ('\ua9b4', '\ua9b5'), ('\ua9b6', '\ua9b9'), ('\ua9ba', '\ua9bb'), ('\ua9bc', '\ua9bc'), ('\ua9bd', '\ua9bf'), ('\ua9cf', '\ua9cf'), ('\ua9e0', '\ua9e4'), ('\ua9e6', '\ua9e6'), ('\ua9e7', '\ua9ef'), ('\ua9fa', '\ua9fe'), ('\uaa00', '\uaa28'), ('\uaa29', '\uaa2e'), ('\uaa2f', '\uaa30'), ('\uaa31', '\uaa32'), ('\uaa33', '\uaa34'), ('\uaa35', '\uaa36'), ('\uaa40', '\uaa42'), ('\uaa43', '\uaa43'), ('\uaa44', '\uaa4b'), ('\uaa4c', '\uaa4c'), ('\uaa4d', '\uaa4d'), ('\uaa60', '\uaa6f'), ('\uaa70', '\uaa70'), ('\uaa71', '\uaa76'), ('\uaa7a', '\uaa7a'), ('\uaa7e', '\uaaaf'), ('\uaab0', '\uaab0'), ('\uaab1', '\uaab1'), ('\uaab2', '\uaab4'), ('\uaab5', '\uaab6'), ('\uaab7', '\uaab8'), ('\uaab9', '\uaabd'), ('\uaabe', '\uaabe'), ('\uaac0', '\uaac0'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadc'), ('\uaadd', '\uaadd'), ('\uaae0', '\uaaea'), ('\uaaeb', '\uaaeb'), ('\uaaec', '\uaaed'), ('\uaaee', '\uaaef'), ('\uaaf2', '\uaaf2'), ('\uaaf3', '\uaaf4'), ('\uaaf5', '\uaaf5'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\uabc0', '\uabe2'), ('\uabe3', '\uabe4'), ('\uabe5', '\uabe5'), ('\uabe6', '\uabe7'), ('\uabe8', '\uabe8'), ('\uabe9', '\uabea'), ('\uac00', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\ufb1d', '\ufb1d'), ('\ufb1e', '\ufb1e'), ('\ufb1f', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdfb'), ('\ufe70', '\ufe74'), ('\ufe76', '\ufefc'), ('\uff21', '\uff3a'), ('\uff41', '\uff5a'), ('\uff66', '\uff6f'), ('\uff70', '\uff70'), ('\uff71', '\uff9d'), ('\uff9e', '\uff9f'), ('\uffa0', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010140', '\U00010174'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U00010340'), ('\U00010341', '\U00010341'), ('\U00010342', '\U00010349'), ('\U0001034a', '\U0001034a'), ('\U00010350', '\U00010375'), ('\U00010376', '\U0001037a'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U000103d1', '\U000103d5'), ('\U00010400', '\U0001044f'), ('\U00010450', '\U0001049d'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a00'), ('\U00010a01', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a0f'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae4'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011000', '\U00011000'), ('\U00011001', '\U00011001'), ('\U00011002', '\U00011002'), ('\U00011003', '\U00011037'), ('\U00011038', '\U00011045'), ('\U00011082', '\U00011082'), ('\U00011083', '\U000110af'), ('\U000110b0', '\U000110b2'), ('\U000110b3', '\U000110b6'), ('\U000110b7', '\U000110b8'), ('\U000110d0', '\U000110e8'), ('\U00011100', '\U00011102'), ('\U00011103', '\U00011126'), ('\U00011127', '\U0001112b'), ('\U0001112c', '\U0001112c'), ('\U0001112d', '\U00011132'), ('\U00011150', '\U00011172'), ('\U00011176', '\U00011176'), ('\U00011180', '\U00011181'), ('\U00011182', '\U00011182'), ('\U00011183', '\U000111b2'), ('\U000111b3', '\U000111b5'), ('\U000111b6', '\U000111be'), ('\U000111bf', '\U000111bf'), ('\U000111c1', '\U000111c4'), ('\U000111da', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U0001122c', '\U0001122e'), ('\U0001122f', '\U00011231'), ('\U00011232', '\U00011233'), ('\U00011234', '\U00011234'), ('\U00011237', '\U00011237'), ('\U000112b0', '\U000112de'), ('\U000112df', '\U000112df'), ('\U000112e0', '\U000112e2'), ('\U000112e3', '\U000112e8'), ('\U00011301', '\U00011301'), ('\U00011302', '\U00011303'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133d', '\U0001133d'), ('\U0001133e', '\U0001133f'), ('\U00011340', '\U00011340'), ('\U00011341', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134c'), ('\U00011357', '\U00011357'), ('\U0001135d', '\U00011361'), ('\U00011362', '\U00011363'), ('\U00011480', '\U000114af'), ('\U000114b0', '\U000114b2'), ('\U000114b3', '\U000114b8'), ('\U000114b9', '\U000114b9'), ('\U000114ba', '\U000114ba'), ('\U000114bb', '\U000114be'), ('\U000114bf', '\U000114c0'), ('\U000114c1', '\U000114c1'), ('\U000114c4', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U00011580', '\U000115ae'), ('\U000115af', '\U000115b1'), ('\U000115b2', '\U000115b5'), ('\U000115b8', '\U000115bb'), ('\U000115bc', '\U000115bd'), ('\U000115be', '\U000115be'), ('\U00011600', '\U0001162f'), ('\U00011630', '\U00011632'), ('\U00011633', '\U0001163a'), ('\U0001163b', '\U0001163c'), ('\U0001163d', '\U0001163d'), ('\U0001163e', '\U0001163e'), ('\U00011640', '\U00011640'), ('\U00011644', '\U00011644'), ('\U00011680', '\U000116aa'), ('\U000116ab', '\U000116ab'), ('\U000116ac', '\U000116ac'), ('\U000116ad', '\U000116ad'), ('\U000116ae', '\U000116af'), ('\U000116b0', '\U000116b5'), ('\U000118a0', '\U000118df'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00012400', '\U0001246e'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016ad0', '\U00016aed'), ('\U00016b00', '\U00016b2f'), ('\U00016b30', '\U00016b36'), ('\U00016b40', '\U00016b43'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U00016f51', '\U00016f7e'), ('\U00016f93', '\U00016f9f'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001bc9e', '\U0001bc9e'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001e800', '\U0001e8c4'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U0001f130', '\U0001f149'), ('\U0001f150', '\U0001f169'), ('\U0001f170', '\U0001f189'), ('\U00020000', '\U0002a6d6'), ('\U0002a700', '\U0002b734'), ('\U0002b740', '\U0002b81d'), ('\U0002f800', '\U0002fa1d') ]; pub fn Alphabetic(c: char) -> bool { super::bsearch_range_table(c, Alphabetic_table) } pub static Default_Ignorable_Code_Point_table: &'static [(char, char)] = &[ ('\u00ad', '\u00ad'), ('\u034f', '\u034f'), ('\u061c', '\u061c'), ('\u115f', '\u1160'), ('\u17b4', '\u17b5'), ('\u180b', '\u180d'), ('\u180e', '\u180e'), ('\u200b', '\u200f'), ('\u202a', '\u202e'), ('\u2060', '\u2064'), ('\u2065', '\u2065'), ('\u2066', '\u206f'), ('\u3164', '\u3164'), ('\ufe00', '\ufe0f'), ('\ufeff', '\ufeff'), ('\uffa0', '\uffa0'), ('\ufff0', '\ufff8'), ('\U0001bca0', '\U0001bca3'), ('\U0001d173', '\U0001d17a'), ('\U000e0000', '\U000e0000'), ('\U000e0001', '\U000e0001'), ('\U000e0002', '\U000e001f'), ('\U000e0020', '\U000e007f'), ('\U000e0080', '\U000e00ff'), ('\U000e0100', '\U000e01ef'), ('\U000e01f0', '\U000e0fff') ]; pub static Lowercase_table: &'static [(char, char)] = &[ ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00ba', '\u00ba'), ('\u00df', '\u00f6'), ('\u00f8', '\u00ff'), ('\u0101', '\u0101'), ('\u0103', '\u0103'), ('\u0105', '\u0105'), ('\u0107', '\u0107'), ('\u0109', '\u0109'), ('\u010b', '\u010b'), ('\u010d', '\u010d'), ('\u010f', '\u010f'), ('\u0111', '\u0111'), ('\u0113', '\u0113'), ('\u0115', '\u0115'), ('\u0117', '\u0117'), ('\u0119', '\u0119'), ('\u011b', '\u011b'), ('\u011d', '\u011d'), ('\u011f', '\u011f'), ('\u0121', '\u0121'), ('\u0123', '\u0123'), ('\u0125', '\u0125'), ('\u0127', '\u0127'), ('\u0129', '\u0129'), ('\u012b', '\u012b'), ('\u012d', '\u012d'), ('\u012f', '\u012f'), ('\u0131', '\u0131'), ('\u0133', '\u0133'), ('\u0135', '\u0135'), ('\u0137', '\u0138'), ('\u013a', '\u013a'), ('\u013c', '\u013c'), ('\u013e', '\u013e'), ('\u0140', '\u0140'), ('\u0142', '\u0142'), ('\u0144', '\u0144'), ('\u0146', '\u0146'), ('\u0148', '\u0149'), ('\u014b', '\u014b'), ('\u014d', '\u014d'), ('\u014f', '\u014f'), ('\u0151', '\u0151'), ('\u0153', '\u0153'), ('\u0155', '\u0155'), ('\u0157', '\u0157'), ('\u0159', '\u0159'), ('\u015b', '\u015b'), ('\u015d', '\u015d'), ('\u015f', '\u015f'), ('\u0161', '\u0161'), ('\u0163', '\u0163'), ('\u0165', '\u0165'), ('\u0167', '\u0167'), ('\u0169', '\u0169'), ('\u016b', '\u016b'), ('\u016d', '\u016d'), ('\u016f', '\u016f'), ('\u0171', '\u0171'), ('\u0173', '\u0173'), ('\u0175', '\u0175'), ('\u0177', '\u0177'), ('\u017a', '\u017a'), ('\u017c', '\u017c'), ('\u017e', '\u0180'), ('\u0183', '\u0183'), ('\u0185', '\u0185'), ('\u0188', '\u0188'), ('\u018c', '\u018d'), ('\u0192', '\u0192'), ('\u0195', '\u0195'), ('\u0199', '\u019b'), ('\u019e', '\u019e'), ('\u01a1', '\u01a1'), ('\u01a3', '\u01a3'), ('\u01a5', '\u01a5'), ('\u01a8', '\u01a8'), ('\u01aa', '\u01ab'), ('\u01ad', '\u01ad'), ('\u01b0', '\u01b0'), ('\u01b4', '\u01b4'), ('\u01b6', '\u01b6'), ('\u01b9', '\u01ba'), ('\u01bd', '\u01bf'), ('\u01c6', '\u01c6'), ('\u01c9', '\u01c9'), ('\u01cc', '\u01cc'), ('\u01ce', '\u01ce'), ('\u01d0', '\u01d0'), ('\u01d2', '\u01d2'), ('\u01d4', '\u01d4'), ('\u01d6', '\u01d6'), ('\u01d8', '\u01d8'), ('\u01da', '\u01da'), ('\u01dc', '\u01dd'), ('\u01df', '\u01df'), ('\u01e1', '\u01e1'), ('\u01e3', '\u01e3'), ('\u01e5', '\u01e5'), ('\u01e7', '\u01e7'), ('\u01e9', '\u01e9'), ('\u01eb', '\u01eb'), ('\u01ed', '\u01ed'), ('\u01ef', '\u01f0'), ('\u01f3', '\u01f3'), ('\u01f5', '\u01f5'), ('\u01f9', '\u01f9'), ('\u01fb', '\u01fb'), ('\u01fd', '\u01fd'), ('\u01ff', '\u01ff'), ('\u0201', '\u0201'), ('\u0203', '\u0203'), ('\u0205', '\u0205'), ('\u0207', '\u0207'), ('\u0209', '\u0209'), ('\u020b', '\u020b'), ('\u020d', '\u020d'), ('\u020f', '\u020f'), ('\u0211', '\u0211'), ('\u0213', '\u0213'), ('\u0215', '\u0215'), ('\u0217', '\u0217'), ('\u0219', '\u0219'), ('\u021b', '\u021b'), ('\u021d', '\u021d'), ('\u021f', '\u021f'), ('\u0221', '\u0221'), ('\u0223', '\u0223'), ('\u0225', '\u0225'), ('\u0227', '\u0227'), ('\u0229', '\u0229'), ('\u022b', '\u022b'), ('\u022d', '\u022d'), ('\u022f', '\u022f'), ('\u0231', '\u0231'), ('\u0233', '\u0239'), ('\u023c', '\u023c'), ('\u023f', '\u0240'), ('\u0242', '\u0242'), ('\u0247', '\u0247'), ('\u0249', '\u0249'), ('\u024b', '\u024b'), ('\u024d', '\u024d'), ('\u024f', '\u0293'), ('\u0295', '\u02af'), ('\u02b0', '\u02b8'), ('\u02c0', '\u02c1'), ('\u02e0', '\u02e4'), ('\u0345', '\u0345'), ('\u0371', '\u0371'), ('\u0373', '\u0373'), ('\u0377', '\u0377'), ('\u037a', '\u037a'), ('\u037b', '\u037d'), ('\u0390', '\u0390'), ('\u03ac', '\u03ce'), ('\u03d0', '\u03d1'), ('\u03d5', '\u03d7'), ('\u03d9', '\u03d9'), ('\u03db', '\u03db'), ('\u03dd', '\u03dd'), ('\u03df', '\u03df'), ('\u03e1', '\u03e1'), ('\u03e3', '\u03e3'), ('\u03e5', '\u03e5'), ('\u03e7', '\u03e7'), ('\u03e9', '\u03e9'), ('\u03eb', '\u03eb'), ('\u03ed', '\u03ed'), ('\u03ef', '\u03f3'), ('\u03f5', '\u03f5'), ('\u03f8', '\u03f8'), ('\u03fb', '\u03fc'), ('\u0430', '\u045f'), ('\u0461', '\u0461'), ('\u0463', '\u0463'), ('\u0465', '\u0465'), ('\u0467', '\u0467'), ('\u0469', '\u0469'), ('\u046b', '\u046b'), ('\u046d', '\u046d'), ('\u046f', '\u046f'), ('\u0471', '\u0471'), ('\u0473', '\u0473'), ('\u0475', '\u0475'), ('\u0477', '\u0477'), ('\u0479', '\u0479'), ('\u047b', '\u047b'), ('\u047d', '\u047d'), ('\u047f', '\u047f'), ('\u0481', '\u0481'), ('\u048b', '\u048b'), ('\u048d', '\u048d'), ('\u048f', '\u048f'), ('\u0491', '\u0491'), ('\u0493', '\u0493'), ('\u0495', '\u0495'), ('\u0497', '\u0497'), ('\u0499', '\u0499'), ('\u049b', '\u049b'), ('\u049d', '\u049d'), ('\u049f', '\u049f'), ('\u04a1', '\u04a1'), ('\u04a3', '\u04a3'), ('\u04a5', '\u04a5'), ('\u04a7', '\u04a7'), ('\u04a9', '\u04a9'), ('\u04ab', '\u04ab'), ('\u04ad', '\u04ad'), ('\u04af', '\u04af'), ('\u04b1', '\u04b1'), ('\u04b3', '\u04b3'), ('\u04b5', '\u04b5'), ('\u04b7', '\u04b7'), ('\u04b9', '\u04b9'), ('\u04bb', '\u04bb'), ('\u04bd', '\u04bd'), ('\u04bf', '\u04bf'), ('\u04c2', '\u04c2'), ('\u04c4', '\u04c4'), ('\u04c6', '\u04c6'), ('\u04c8', '\u04c8'), ('\u04ca', '\u04ca'), ('\u04cc', '\u04cc'), ('\u04ce', '\u04cf'), ('\u04d1', '\u04d1'), ('\u04d3', '\u04d3'), ('\u04d5', '\u04d5'), ('\u04d7', '\u04d7'), ('\u04d9', '\u04d9'), ('\u04db', '\u04db'), ('\u04dd', '\u04dd'), ('\u04df', '\u04df'), ('\u04e1', '\u04e1'), ('\u04e3', '\u04e3'), ('\u04e5', '\u04e5'), ('\u04e7', '\u04e7'), ('\u04e9', '\u04e9'), ('\u04eb', '\u04eb'), ('\u04ed', '\u04ed'), ('\u04ef', '\u04ef'), ('\u04f1', '\u04f1'), ('\u04f3', '\u04f3'), ('\u04f5', '\u04f5'), ('\u04f7', '\u04f7'), ('\u04f9', '\u04f9'), ('\u04fb', '\u04fb'), ('\u04fd', '\u04fd'), ('\u04ff', '\u04ff'), ('\u0501', '\u0501'), ('\u0503', '\u0503'), ('\u0505', '\u0505'), ('\u0507', '\u0507'), ('\u0509', '\u0509'), ('\u050b', '\u050b'), ('\u050d', '\u050d'), ('\u050f', '\u050f'), ('\u0511', '\u0511'), ('\u0513', '\u0513'), ('\u0515', '\u0515'), ('\u0517', '\u0517'), ('\u0519', '\u0519'), ('\u051b', '\u051b'), ('\u051d', '\u051d'), ('\u051f', '\u051f'), ('\u0521', '\u0521'), ('\u0523', '\u0523'), ('\u0525', '\u0525'), ('\u0527', '\u0527'), ('\u0529', '\u0529'), ('\u052b', '\u052b'), ('\u052d', '\u052d'), ('\u052f', '\u052f'), ('\u0561', '\u0587'), ('\u1d00', '\u1d2b'), ('\u1d2c', '\u1d6a'), ('\u1d6b', '\u1d77'), ('\u1d78', '\u1d78'), ('\u1d79', '\u1d9a'), ('\u1d9b', '\u1dbf'), ('\u1e01', '\u1e01'), ('\u1e03', '\u1e03'), ('\u1e05', '\u1e05'), ('\u1e07', '\u1e07'), ('\u1e09', '\u1e09'), ('\u1e0b', '\u1e0b'), ('\u1e0d', '\u1e0d'), ('\u1e0f', '\u1e0f'), ('\u1e11', '\u1e11'), ('\u1e13', '\u1e13'), ('\u1e15', '\u1e15'), ('\u1e17', '\u1e17'), ('\u1e19', '\u1e19'), ('\u1e1b', '\u1e1b'), ('\u1e1d', '\u1e1d'), ('\u1e1f', '\u1e1f'), ('\u1e21', '\u1e21'), ('\u1e23', '\u1e23'), ('\u1e25', '\u1e25'), ('\u1e27', '\u1e27'), ('\u1e29', '\u1e29'), ('\u1e2b', '\u1e2b'), ('\u1e2d', '\u1e2d'), ('\u1e2f', '\u1e2f'), ('\u1e31', '\u1e31'), ('\u1e33', '\u1e33'), ('\u1e35', '\u1e35'), ('\u1e37', '\u1e37'), ('\u1e39', '\u1e39'), ('\u1e3b', '\u1e3b'), ('\u1e3d', '\u1e3d'), ('\u1e3f', '\u1e3f'), ('\u1e41', '\u1e41'), ('\u1e43', '\u1e43'), ('\u1e45', '\u1e45'), ('\u1e47', '\u1e47'), ('\u1e49', '\u1e49'), ('\u1e4b', '\u1e4b'), ('\u1e4d', '\u1e4d'), ('\u1e4f', '\u1e4f'), ('\u1e51', '\u1e51'), ('\u1e53', '\u1e53'), ('\u1e55', '\u1e55'), ('\u1e57', '\u1e57'), ('\u1e59', '\u1e59'), ('\u1e5b', '\u1e5b'), ('\u1e5d', '\u1e5d'), ('\u1e5f', '\u1e5f'), ('\u1e61', '\u1e61'), ('\u1e63', '\u1e63'), ('\u1e65', '\u1e65'), ('\u1e67', '\u1e67'), ('\u1e69', '\u1e69'), ('\u1e6b', '\u1e6b'), ('\u1e6d', '\u1e6d'), ('\u1e6f', '\u1e6f'), ('\u1e71', '\u1e71'), ('\u1e73', '\u1e73'), ('\u1e75', '\u1e75'), ('\u1e77', '\u1e77'), ('\u1e79', '\u1e79'), ('\u1e7b', '\u1e7b'), ('\u1e7d', '\u1e7d'), ('\u1e7f', '\u1e7f'), ('\u1e81', '\u1e81'), ('\u1e83', '\u1e83'), ('\u1e85', '\u1e85'), ('\u1e87', '\u1e87'), ('\u1e89', '\u1e89'), ('\u1e8b', '\u1e8b'), ('\u1e8d', '\u1e8d'), ('\u1e8f', '\u1e8f'), ('\u1e91', '\u1e91'), ('\u1e93', '\u1e93'), ('\u1e95', '\u1e9d'), ('\u1e9f', '\u1e9f'), ('\u1ea1', '\u1ea1'), ('\u1ea3', '\u1ea3'), ('\u1ea5', '\u1ea5'), ('\u1ea7', '\u1ea7'), ('\u1ea9', '\u1ea9'), ('\u1eab', '\u1eab'), ('\u1ead', '\u1ead'), ('\u1eaf', '\u1eaf'), ('\u1eb1', '\u1eb1'), ('\u1eb3', '\u1eb3'), ('\u1eb5', '\u1eb5'), ('\u1eb7', '\u1eb7'), ('\u1eb9', '\u1eb9'), ('\u1ebb', '\u1ebb'), ('\u1ebd', '\u1ebd'), ('\u1ebf', '\u1ebf'), ('\u1ec1', '\u1ec1'), ('\u1ec3', '\u1ec3'), ('\u1ec5', '\u1ec5'), ('\u1ec7', '\u1ec7'), ('\u1ec9', '\u1ec9'), ('\u1ecb', '\u1ecb'), ('\u1ecd', '\u1ecd'), ('\u1ecf', '\u1ecf'), ('\u1ed1', '\u1ed1'), ('\u1ed3', '\u1ed3'), ('\u1ed5', '\u1ed5'), ('\u1ed7', '\u1ed7'), ('\u1ed9', '\u1ed9'), ('\u1edb', '\u1edb'), ('\u1edd', '\u1edd'), ('\u1edf', '\u1edf'), ('\u1ee1', '\u1ee1'), ('\u1ee3', '\u1ee3'), ('\u1ee5', '\u1ee5'), ('\u1ee7', '\u1ee7'), ('\u1ee9', '\u1ee9'), ('\u1eeb', '\u1eeb'), ('\u1eed', '\u1eed'), ('\u1eef', '\u1eef'), ('\u1ef1', '\u1ef1'), ('\u1ef3', '\u1ef3'), ('\u1ef5', '\u1ef5'), ('\u1ef7', '\u1ef7'), ('\u1ef9', '\u1ef9'), ('\u1efb', '\u1efb'), ('\u1efd', '\u1efd'), ('\u1eff', '\u1f07'), ('\u1f10', '\u1f15'), ('\u1f20', '\u1f27'), ('\u1f30', '\u1f37'), ('\u1f40', '\u1f45'), ('\u1f50', '\u1f57'), ('\u1f60', '\u1f67'), ('\u1f70', '\u1f7d'), ('\u1f80', '\u1f87'), ('\u1f90', '\u1f97'), ('\u1fa0', '\u1fa7'), ('\u1fb0', '\u1fb4'), ('\u1fb6', '\u1fb7'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fc7'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fd7'), ('\u1fe0', '\u1fe7'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ff7'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u210a', '\u210a'), ('\u210e', '\u210f'), ('\u2113', '\u2113'), ('\u212f', '\u212f'), ('\u2134', '\u2134'), ('\u2139', '\u2139'), ('\u213c', '\u213d'), ('\u2146', '\u2149'), ('\u214e', '\u214e'), ('\u2170', '\u217f'), ('\u2184', '\u2184'), ('\u24d0', '\u24e9'), ('\u2c30', '\u2c5e'), ('\u2c61', '\u2c61'), ('\u2c65', '\u2c66'), ('\u2c68', '\u2c68'), ('\u2c6a', '\u2c6a'), ('\u2c6c', '\u2c6c'), ('\u2c71', '\u2c71'), ('\u2c73', '\u2c74'), ('\u2c76', '\u2c7b'), ('\u2c7c', '\u2c7d'), ('\u2c81', '\u2c81'), ('\u2c83', '\u2c83'), ('\u2c85', '\u2c85'), ('\u2c87', '\u2c87'), ('\u2c89', '\u2c89'), ('\u2c8b', '\u2c8b'), ('\u2c8d', '\u2c8d'), ('\u2c8f', '\u2c8f'), ('\u2c91', '\u2c91'), ('\u2c93', '\u2c93'), ('\u2c95', '\u2c95'), ('\u2c97', '\u2c97'), ('\u2c99', '\u2c99'), ('\u2c9b', '\u2c9b'), ('\u2c9d', '\u2c9d'), ('\u2c9f', '\u2c9f'), ('\u2ca1', '\u2ca1'), ('\u2ca3', '\u2ca3'), ('\u2ca5', '\u2ca5'), ('\u2ca7', '\u2ca7'), ('\u2ca9', '\u2ca9'), ('\u2cab', '\u2cab'), ('\u2cad', '\u2cad'), ('\u2caf', '\u2caf'), ('\u2cb1', '\u2cb1'), ('\u2cb3', '\u2cb3'), ('\u2cb5', '\u2cb5'), ('\u2cb7', '\u2cb7'), ('\u2cb9', '\u2cb9'), ('\u2cbb', '\u2cbb'), ('\u2cbd', '\u2cbd'), ('\u2cbf', '\u2cbf'), ('\u2cc1', '\u2cc1'), ('\u2cc3', '\u2cc3'), ('\u2cc5', '\u2cc5'), ('\u2cc7', '\u2cc7'), ('\u2cc9', '\u2cc9'), ('\u2ccb', '\u2ccb'), ('\u2ccd', '\u2ccd'), ('\u2ccf', '\u2ccf'), ('\u2cd1', '\u2cd1'), ('\u2cd3', '\u2cd3'), ('\u2cd5', '\u2cd5'), ('\u2cd7', '\u2cd7'), ('\u2cd9', '\u2cd9'), ('\u2cdb', '\u2cdb'), ('\u2cdd', '\u2cdd'), ('\u2cdf', '\u2cdf'), ('\u2ce1', '\u2ce1'), ('\u2ce3', '\u2ce4'), ('\u2cec', '\u2cec'), ('\u2cee', '\u2cee'), ('\u2cf3', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\ua641', '\ua641'), ('\ua643', '\ua643'), ('\ua645', '\ua645'), ('\ua647', '\ua647'), ('\ua649', '\ua649'), ('\ua64b', '\ua64b'), ('\ua64d', '\ua64d'), ('\ua64f', '\ua64f'), ('\ua651', '\ua651'), ('\ua653', '\ua653'), ('\ua655', '\ua655'), ('\ua657', '\ua657'), ('\ua659', '\ua659'), ('\ua65b', '\ua65b'), ('\ua65d', '\ua65d'), ('\ua65f', '\ua65f'), ('\ua661', '\ua661'), ('\ua663', '\ua663'), ('\ua665', '\ua665'), ('\ua667', '\ua667'), ('\ua669', '\ua669'), ('\ua66b', '\ua66b'), ('\ua66d', '\ua66d'), ('\ua681', '\ua681'), ('\ua683', '\ua683'), ('\ua685', '\ua685'), ('\ua687', '\ua687'), ('\ua689', '\ua689'), ('\ua68b', '\ua68b'), ('\ua68d', '\ua68d'), ('\ua68f', '\ua68f'), ('\ua691', '\ua691'), ('\ua693', '\ua693'), ('\ua695', '\ua695'), ('\ua697', '\ua697'), ('\ua699', '\ua699'), ('\ua69b', '\ua69b'), ('\ua69c', '\ua69d'), ('\ua723', '\ua723'), ('\ua725', '\ua725'), ('\ua727', '\ua727'), ('\ua729', '\ua729'), ('\ua72b', '\ua72b'), ('\ua72d', '\ua72d'), ('\ua72f', '\ua731'), ('\ua733', '\ua733'), ('\ua735', '\ua735'), ('\ua737', '\ua737'), ('\ua739', '\ua739'), ('\ua73b', '\ua73b'), ('\ua73d', '\ua73d'), ('\ua73f', '\ua73f'), ('\ua741', '\ua741'), ('\ua743', '\ua743'), ('\ua745', '\ua745'), ('\ua747', '\ua747'), ('\ua749', '\ua749'), ('\ua74b', '\ua74b'), ('\ua74d', '\ua74d'), ('\ua74f', '\ua74f'), ('\ua751', '\ua751'), ('\ua753', '\ua753'), ('\ua755', '\ua755'), ('\ua757', '\ua757'), ('\ua759', '\ua759'), ('\ua75b', '\ua75b'), ('\ua75d', '\ua75d'), ('\ua75f', '\ua75f'), ('\ua761', '\ua761'), ('\ua763', '\ua763'), ('\ua765', '\ua765'), ('\ua767', '\ua767'), ('\ua769', '\ua769'), ('\ua76b', '\ua76b'), ('\ua76d', '\ua76d'), ('\ua76f', '\ua76f'), ('\ua770', '\ua770'), ('\ua771', '\ua778'), ('\ua77a', '\ua77a'), ('\ua77c', '\ua77c'), ('\ua77f', '\ua77f'), ('\ua781', '\ua781'), ('\ua783', '\ua783'), ('\ua785', '\ua785'), ('\ua787', '\ua787'), ('\ua78c', '\ua78c'), ('\ua78e', '\ua78e'), ('\ua791', '\ua791'), ('\ua793', '\ua795'), ('\ua797', '\ua797'), ('\ua799', '\ua799'), ('\ua79b', '\ua79b'), ('\ua79d', '\ua79d'), ('\ua79f', '\ua79f'), ('\ua7a1', '\ua7a1'), ('\ua7a3', '\ua7a3'), ('\ua7a5', '\ua7a5'), ('\ua7a7', '\ua7a7'), ('\ua7a9', '\ua7a9'), ('\ua7f8', '\ua7f9'), ('\ua7fa', '\ua7fa'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\uff41', '\uff5a'), ('\U00010428', '\U0001044f'), ('\U000118c0', '\U000118df'), ('\U0001d41a', '\U0001d433'), ('\U0001d44e', '\U0001d454'), ('\U0001d456', '\U0001d467'), ('\U0001d482', '\U0001d49b'), ('\U0001d4b6', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d4cf'), ('\U0001d4ea', '\U0001d503'), ('\U0001d51e', '\U0001d537'), ('\U0001d552', '\U0001d56b'), ('\U0001d586', '\U0001d59f'), ('\U0001d5ba', '\U0001d5d3'), ('\U0001d5ee', '\U0001d607'), ('\U0001d622', '\U0001d63b'), ('\U0001d656', '\U0001d66f'), ('\U0001d68a', '\U0001d6a5'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6e1'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d71b'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d755'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d78f'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7c9'), ('\U0001d7cb', '\U0001d7cb') ]; pub fn Lowercase(c: char) -> bool { super::bsearch_range_table(c, Lowercase_table) } pub static Uppercase_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00de'), ('\u0100', '\u0100'), ('\u0102', '\u0102'), ('\u0104', '\u0104'), ('\u0106', '\u0106'), ('\u0108', '\u0108'), ('\u010a', '\u010a'), ('\u010c', '\u010c'), ('\u010e', '\u010e'), ('\u0110', '\u0110'), ('\u0112', '\u0112'), ('\u0114', '\u0114'), ('\u0116', '\u0116'), ('\u0118', '\u0118'), ('\u011a', '\u011a'), ('\u011c', '\u011c'), ('\u011e', '\u011e'), ('\u0120', '\u0120'), ('\u0122', '\u0122'), ('\u0124', '\u0124'), ('\u0126', '\u0126'), ('\u0128', '\u0128'), ('\u012a', '\u012a'), ('\u012c', '\u012c'), ('\u012e', '\u012e'), ('\u0130', '\u0130'), ('\u0132', '\u0132'), ('\u0134', '\u0134'), ('\u0136', '\u0136'), ('\u0139', '\u0139'), ('\u013b', '\u013b'), ('\u013d', '\u013d'), ('\u013f', '\u013f'), ('\u0141', '\u0141'), ('\u0143', '\u0143'), ('\u0145', '\u0145'), ('\u0147', '\u0147'), ('\u014a', '\u014a'), ('\u014c', '\u014c'), ('\u014e', '\u014e'), ('\u0150', '\u0150'), ('\u0152', '\u0152'), ('\u0154', '\u0154'), ('\u0156', '\u0156'), ('\u0158', '\u0158'), ('\u015a', '\u015a'), ('\u015c', '\u015c'), ('\u015e', '\u015e'), ('\u0160', '\u0160'), ('\u0162', '\u0162'), ('\u0164', '\u0164'), ('\u0166', '\u0166'), ('\u0168', '\u0168'), ('\u016a', '\u016a'), ('\u016c', '\u016c'), ('\u016e', '\u016e'), ('\u0170', '\u0170'), ('\u0172', '\u0172'), ('\u0174', '\u0174'), ('\u0176', '\u0176'), ('\u0178', '\u0179'), ('\u017b', '\u017b'), ('\u017d', '\u017d'), ('\u0181', '\u0182'), ('\u0184', '\u0184'), ('\u0186', '\u0187'), ('\u0189', '\u018b'), ('\u018e', '\u0191'), ('\u0193', '\u0194'), ('\u0196', '\u0198'), ('\u019c', '\u019d'), ('\u019f', '\u01a0'), ('\u01a2', '\u01a2'), ('\u01a4', '\u01a4'), ('\u01a6', '\u01a7'), ('\u01a9', '\u01a9'), ('\u01ac', '\u01ac'), ('\u01ae', '\u01af'), ('\u01b1', '\u01b3'), ('\u01b5', '\u01b5'), ('\u01b7', '\u01b8'), ('\u01bc', '\u01bc'), ('\u01c4', '\u01c4'), ('\u01c7', '\u01c7'), ('\u01ca', '\u01ca'), ('\u01cd', '\u01cd'), ('\u01cf', '\u01cf'), ('\u01d1', '\u01d1'), ('\u01d3', '\u01d3'), ('\u01d5', '\u01d5'), ('\u01d7', '\u01d7'), ('\u01d9', '\u01d9'), ('\u01db', '\u01db'), ('\u01de', '\u01de'), ('\u01e0', '\u01e0'), ('\u01e2', '\u01e2'), ('\u01e4', '\u01e4'), ('\u01e6', '\u01e6'), ('\u01e8', '\u01e8'), ('\u01ea', '\u01ea'), ('\u01ec', '\u01ec'), ('\u01ee', '\u01ee'), ('\u01f1', '\u01f1'), ('\u01f4', '\u01f4'), ('\u01f6', '\u01f8'), ('\u01fa', '\u01fa'), ('\u01fc', '\u01fc'), ('\u01fe', '\u01fe'), ('\u0200', '\u0200'), ('\u0202', '\u0202'), ('\u0204', '\u0204'), ('\u0206', '\u0206'), ('\u0208', '\u0208'), ('\u020a', '\u020a'), ('\u020c', '\u020c'), ('\u020e', '\u020e'), ('\u0210', '\u0210'), ('\u0212', '\u0212'), ('\u0214', '\u0214'), ('\u0216', '\u0216'), ('\u0218', '\u0218'), ('\u021a', '\u021a'), ('\u021c', '\u021c'), ('\u021e', '\u021e'), ('\u0220', '\u0220'), ('\u0222', '\u0222'), ('\u0224', '\u0224'), ('\u0226', '\u0226'), ('\u0228', '\u0228'), ('\u022a', '\u022a'), ('\u022c', '\u022c'), ('\u022e', '\u022e'), ('\u0230', '\u0230'), ('\u0232', '\u0232'), ('\u023a', '\u023b'), ('\u023d', '\u023e'), ('\u0241', '\u0241'), ('\u0243', '\u0246'), ('\u0248', '\u0248'), ('\u024a', '\u024a'), ('\u024c', '\u024c'), ('\u024e', '\u024e'), ('\u0370', '\u0370'), ('\u0372', '\u0372'), ('\u0376', '\u0376'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u038f'), ('\u0391', '\u03a1'), ('\u03a3', '\u03ab'), ('\u03cf', '\u03cf'), ('\u03d2', '\u03d4'), ('\u03d8', '\u03d8'), ('\u03da', '\u03da'), ('\u03dc', '\u03dc'), ('\u03de', '\u03de'), ('\u03e0', '\u03e0'), ('\u03e2', '\u03e2'), ('\u03e4', '\u03e4'), ('\u03e6', '\u03e6'), ('\u03e8', '\u03e8'), ('\u03ea', '\u03ea'), ('\u03ec', '\u03ec'), ('\u03ee', '\u03ee'), ('\u03f4', '\u03f4'), ('\u03f7', '\u03f7'), ('\u03f9', '\u03fa'), ('\u03fd', '\u042f'), ('\u0460', '\u0460'), ('\u0462', '\u0462'), ('\u0464', '\u0464'), ('\u0466', '\u0466'), ('\u0468', '\u0468'), ('\u046a', '\u046a'), ('\u046c', '\u046c'), ('\u046e', '\u046e'), ('\u0470', '\u0470'), ('\u0472', '\u0472'), ('\u0474', '\u0474'), ('\u0476', '\u0476'), ('\u0478', '\u0478'), ('\u047a', '\u047a'), ('\u047c', '\u047c'), ('\u047e', '\u047e'), ('\u0480', '\u0480'), ('\u048a', '\u048a'), ('\u048c', '\u048c'), ('\u048e', '\u048e'), ('\u0490', '\u0490'), ('\u0492', '\u0492'), ('\u0494', '\u0494'), ('\u0496', '\u0496'), ('\u0498', '\u0498'), ('\u049a', '\u049a'), ('\u049c', '\u049c'), ('\u049e', '\u049e'), ('\u04a0', '\u04a0'), ('\u04a2', '\u04a2'), ('\u04a4', '\u04a4'), ('\u04a6', '\u04a6'), ('\u04a8', '\u04a8'), ('\u04aa', '\u04aa'), ('\u04ac', '\u04ac'), ('\u04ae', '\u04ae'), ('\u04b0', '\u04b0'), ('\u04b2', '\u04b2'), ('\u04b4', '\u04b4'), ('\u04b6', '\u04b6'), ('\u04b8', '\u04b8'), ('\u04ba', '\u04ba'), ('\u04bc', '\u04bc'), ('\u04be', '\u04be'), ('\u04c0', '\u04c1'), ('\u04c3', '\u04c3'), ('\u04c5', '\u04c5'), ('\u04c7', '\u04c7'), ('\u04c9', '\u04c9'), ('\u04cb', '\u04cb'), ('\u04cd', '\u04cd'), ('\u04d0', '\u04d0'), ('\u04d2', '\u04d2'), ('\u04d4', '\u04d4'), ('\u04d6', '\u04d6'), ('\u04d8', '\u04d8'), ('\u04da', '\u04da'), ('\u04dc', '\u04dc'), ('\u04de', '\u04de'), ('\u04e0', '\u04e0'), ('\u04e2', '\u04e2'), ('\u04e4', '\u04e4'), ('\u04e6', '\u04e6'), ('\u04e8', '\u04e8'), ('\u04ea', '\u04ea'), ('\u04ec', '\u04ec'), ('\u04ee', '\u04ee'), ('\u04f0', '\u04f0'), ('\u04f2', '\u04f2'), ('\u04f4', '\u04f4'), ('\u04f6', '\u04f6'), ('\u04f8', '\u04f8'), ('\u04fa', '\u04fa'), ('\u04fc', '\u04fc'), ('\u04fe', '\u04fe'), ('\u0500', '\u0500'), ('\u0502', '\u0502'), ('\u0504', '\u0504'), ('\u0506', '\u0506'), ('\u0508', '\u0508'), ('\u050a', '\u050a'), ('\u050c', '\u050c'), ('\u050e', '\u050e'), ('\u0510', '\u0510'), ('\u0512', '\u0512'), ('\u0514', '\u0514'), ('\u0516', '\u0516'), ('\u0518', '\u0518'), ('\u051a', '\u051a'), ('\u051c', '\u051c'), ('\u051e', '\u051e'), ('\u0520', '\u0520'), ('\u0522', '\u0522'), ('\u0524', '\u0524'), ('\u0526', '\u0526'), ('\u0528', '\u0528'), ('\u052a', '\u052a'), ('\u052c', '\u052c'), ('\u052e', '\u052e'), ('\u0531', '\u0556'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u1e00', '\u1e00'), ('\u1e02', '\u1e02'), ('\u1e04', '\u1e04'), ('\u1e06', '\u1e06'), ('\u1e08', '\u1e08'), ('\u1e0a', '\u1e0a'), ('\u1e0c', '\u1e0c'), ('\u1e0e', '\u1e0e'), ('\u1e10', '\u1e10'), ('\u1e12', '\u1e12'), ('\u1e14', '\u1e14'), ('\u1e16', '\u1e16'), ('\u1e18', '\u1e18'), ('\u1e1a', '\u1e1a'), ('\u1e1c', '\u1e1c'), ('\u1e1e', '\u1e1e'), ('\u1e20', '\u1e20'), ('\u1e22', '\u1e22'), ('\u1e24', '\u1e24'), ('\u1e26', '\u1e26'), ('\u1e28', '\u1e28'), ('\u1e2a', '\u1e2a'), ('\u1e2c', '\u1e2c'), ('\u1e2e', '\u1e2e'), ('\u1e30', '\u1e30'), ('\u1e32', '\u1e32'), ('\u1e34', '\u1e34'), ('\u1e36', '\u1e36'), ('\u1e38', '\u1e38'), ('\u1e3a', '\u1e3a'), ('\u1e3c', '\u1e3c'), ('\u1e3e', '\u1e3e'), ('\u1e40', '\u1e40'), ('\u1e42', '\u1e42'), ('\u1e44', '\u1e44'), ('\u1e46', '\u1e46'), ('\u1e48', '\u1e48'), ('\u1e4a', '\u1e4a'), ('\u1e4c', '\u1e4c'), ('\u1e4e', '\u1e4e'), ('\u1e50', '\u1e50'), ('\u1e52', '\u1e52'), ('\u1e54', '\u1e54'), ('\u1e56', '\u1e56'), ('\u1e58', '\u1e58'), ('\u1e5a', '\u1e5a'), ('\u1e5c', '\u1e5c'), ('\u1e5e', '\u1e5e'), ('\u1e60', '\u1e60'), ('\u1e62', '\u1e62'), ('\u1e64', '\u1e64'), ('\u1e66', '\u1e66'), ('\u1e68', '\u1e68'), ('\u1e6a', '\u1e6a'), ('\u1e6c', '\u1e6c'), ('\u1e6e', '\u1e6e'), ('\u1e70', '\u1e70'), ('\u1e72', '\u1e72'), ('\u1e74', '\u1e74'), ('\u1e76', '\u1e76'), ('\u1e78', '\u1e78'), ('\u1e7a', '\u1e7a'), ('\u1e7c', '\u1e7c'), ('\u1e7e', '\u1e7e'), ('\u1e80', '\u1e80'), ('\u1e82', '\u1e82'), ('\u1e84', '\u1e84'), ('\u1e86', '\u1e86'), ('\u1e88', '\u1e88'), ('\u1e8a', '\u1e8a'), ('\u1e8c', '\u1e8c'), ('\u1e8e', '\u1e8e'), ('\u1e90', '\u1e90'), ('\u1e92', '\u1e92'), ('\u1e94', '\u1e94'), ('\u1e9e', '\u1e9e'), ('\u1ea0', '\u1ea0'), ('\u1ea2', '\u1ea2'), ('\u1ea4', '\u1ea4'), ('\u1ea6', '\u1ea6'), ('\u1ea8', '\u1ea8'), ('\u1eaa', '\u1eaa'), ('\u1eac', '\u1eac'), ('\u1eae', '\u1eae'), ('\u1eb0', '\u1eb0'), ('\u1eb2', '\u1eb2'), ('\u1eb4', '\u1eb4'), ('\u1eb6', '\u1eb6'), ('\u1eb8', '\u1eb8'), ('\u1eba', '\u1eba'), ('\u1ebc', '\u1ebc'), ('\u1ebe', '\u1ebe'), ('\u1ec0', '\u1ec0'), ('\u1ec2', '\u1ec2'), ('\u1ec4', '\u1ec4'), ('\u1ec6', '\u1ec6'), ('\u1ec8', '\u1ec8'), ('\u1eca', '\u1eca'), ('\u1ecc', '\u1ecc'), ('\u1ece', '\u1ece'), ('\u1ed0', '\u1ed0'), ('\u1ed2', '\u1ed2'), ('\u1ed4', '\u1ed4'), ('\u1ed6', '\u1ed6'), ('\u1ed8', '\u1ed8'), ('\u1eda', '\u1eda'), ('\u1edc', '\u1edc'), ('\u1ede', '\u1ede'), ('\u1ee0', '\u1ee0'), ('\u1ee2', '\u1ee2'), ('\u1ee4', '\u1ee4'), ('\u1ee6', '\u1ee6'), ('\u1ee8', '\u1ee8'), ('\u1eea', '\u1eea'), ('\u1eec', '\u1eec'), ('\u1eee', '\u1eee'), ('\u1ef0', '\u1ef0'), ('\u1ef2', '\u1ef2'), ('\u1ef4', '\u1ef4'), ('\u1ef6', '\u1ef6'), ('\u1ef8', '\u1ef8'), ('\u1efa', '\u1efa'), ('\u1efc', '\u1efc'), ('\u1efe', '\u1efe'), ('\u1f08', '\u1f0f'), ('\u1f18', '\u1f1d'), ('\u1f28', '\u1f2f'), ('\u1f38', '\u1f3f'), ('\u1f48', '\u1f4d'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f5f'), ('\u1f68', '\u1f6f'), ('\u1fb8', '\u1fbb'), ('\u1fc8', '\u1fcb'), ('\u1fd8', '\u1fdb'), ('\u1fe8', '\u1fec'), ('\u1ff8', '\u1ffb'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210b', '\u210d'), ('\u2110', '\u2112'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u2130', '\u2133'), ('\u213e', '\u213f'), ('\u2145', '\u2145'), ('\u2160', '\u216f'), ('\u2183', '\u2183'), ('\u24b6', '\u24cf'), ('\u2c00', '\u2c2e'), ('\u2c60', '\u2c60'), ('\u2c62', '\u2c64'), ('\u2c67', '\u2c67'), ('\u2c69', '\u2c69'), ('\u2c6b', '\u2c6b'), ('\u2c6d', '\u2c70'), ('\u2c72', '\u2c72'), ('\u2c75', '\u2c75'), ('\u2c7e', '\u2c80'), ('\u2c82', '\u2c82'), ('\u2c84', '\u2c84'), ('\u2c86', '\u2c86'), ('\u2c88', '\u2c88'), ('\u2c8a', '\u2c8a'), ('\u2c8c', '\u2c8c'), ('\u2c8e', '\u2c8e'), ('\u2c90', '\u2c90'), ('\u2c92', '\u2c92'), ('\u2c94', '\u2c94'), ('\u2c96', '\u2c96'), ('\u2c98', '\u2c98'), ('\u2c9a', '\u2c9a'), ('\u2c9c', '\u2c9c'), ('\u2c9e', '\u2c9e'), ('\u2ca0', '\u2ca0'), ('\u2ca2', '\u2ca2'), ('\u2ca4', '\u2ca4'), ('\u2ca6', '\u2ca6'), ('\u2ca8', '\u2ca8'), ('\u2caa', '\u2caa'), ('\u2cac', '\u2cac'), ('\u2cae', '\u2cae'), ('\u2cb0', '\u2cb0'), ('\u2cb2', '\u2cb2'), ('\u2cb4', '\u2cb4'), ('\u2cb6', '\u2cb6'), ('\u2cb8', '\u2cb8'), ('\u2cba', '\u2cba'), ('\u2cbc', '\u2cbc'), ('\u2cbe', '\u2cbe'), ('\u2cc0', '\u2cc0'), ('\u2cc2', '\u2cc2'), ('\u2cc4', '\u2cc4'), ('\u2cc6', '\u2cc6'), ('\u2cc8', '\u2cc8'), ('\u2cca', '\u2cca'), ('\u2ccc', '\u2ccc'), ('\u2cce', '\u2cce'), ('\u2cd0', '\u2cd0'), ('\u2cd2', '\u2cd2'), ('\u2cd4', '\u2cd4'), ('\u2cd6', '\u2cd6'), ('\u2cd8', '\u2cd8'), ('\u2cda', '\u2cda'), ('\u2cdc', '\u2cdc'), ('\u2cde', '\u2cde'), ('\u2ce0', '\u2ce0'), ('\u2ce2', '\u2ce2'), ('\u2ceb', '\u2ceb'), ('\u2ced', '\u2ced'), ('\u2cf2', '\u2cf2'), ('\ua640', '\ua640'), ('\ua642', '\ua642'), ('\ua644', '\ua644'), ('\ua646', '\ua646'), ('\ua648', '\ua648'), ('\ua64a', '\ua64a'), ('\ua64c', '\ua64c'), ('\ua64e', '\ua64e'), ('\ua650', '\ua650'), ('\ua652', '\ua652'), ('\ua654', '\ua654'), ('\ua656', '\ua656'), ('\ua658', '\ua658'), ('\ua65a', '\ua65a'), ('\ua65c', '\ua65c'), ('\ua65e', '\ua65e'), ('\ua660', '\ua660'), ('\ua662', '\ua662'), ('\ua664', '\ua664'), ('\ua666', '\ua666'), ('\ua668', '\ua668'), ('\ua66a', '\ua66a'), ('\ua66c', '\ua66c'), ('\ua680', '\ua680'), ('\ua682', '\ua682'), ('\ua684', '\ua684'), ('\ua686', '\ua686'), ('\ua688', '\ua688'), ('\ua68a', '\ua68a'), ('\ua68c', '\ua68c'), ('\ua68e', '\ua68e'), ('\ua690', '\ua690'), ('\ua692', '\ua692'), ('\ua694', '\ua694'), ('\ua696', '\ua696'), ('\ua698', '\ua698'), ('\ua69a', '\ua69a'), ('\ua722', '\ua722'), ('\ua724', '\ua724'), ('\ua726', '\ua726'), ('\ua728', '\ua728'), ('\ua72a', '\ua72a'), ('\ua72c', '\ua72c'), ('\ua72e', '\ua72e'), ('\ua732', '\ua732'), ('\ua734', '\ua734'), ('\ua736', '\ua736'), ('\ua738', '\ua738'), ('\ua73a', '\ua73a'), ('\ua73c', '\ua73c'), ('\ua73e', '\ua73e'), ('\ua740', '\ua740'), ('\ua742', '\ua742'), ('\ua744', '\ua744'), ('\ua746', '\ua746'), ('\ua748', '\ua748'), ('\ua74a', '\ua74a'), ('\ua74c', '\ua74c'), ('\ua74e', '\ua74e'), ('\ua750', '\ua750'), ('\ua752', '\ua752'), ('\ua754', '\ua754'), ('\ua756', '\ua756'), ('\ua758', '\ua758'), ('\ua75a', '\ua75a'), ('\ua75c', '\ua75c'), ('\ua75e', '\ua75e'), ('\ua760', '\ua760'), ('\ua762', '\ua762'), ('\ua764', '\ua764'), ('\ua766', '\ua766'), ('\ua768', '\ua768'), ('\ua76a', '\ua76a'), ('\ua76c', '\ua76c'), ('\ua76e', '\ua76e'), ('\ua779', '\ua779'), ('\ua77b', '\ua77b'), ('\ua77d', '\ua77e'), ('\ua780', '\ua780'), ('\ua782', '\ua782'), ('\ua784', '\ua784'), ('\ua786', '\ua786'), ('\ua78b', '\ua78b'), ('\ua78d', '\ua78d'), ('\ua790', '\ua790'), ('\ua792', '\ua792'), ('\ua796', '\ua796'), ('\ua798', '\ua798'), ('\ua79a', '\ua79a'), ('\ua79c', '\ua79c'), ('\ua79e', '\ua79e'), ('\ua7a0', '\ua7a0'), ('\ua7a2', '\ua7a2'), ('\ua7a4', '\ua7a4'), ('\ua7a6', '\ua7a6'), ('\ua7a8', '\ua7a8'), ('\ua7aa', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\uff21', '\uff3a'), ('\U00010400', '\U00010427'), ('\U000118a0', '\U000118bf'), ('\U0001d400', '\U0001d419'), ('\U0001d434', '\U0001d44d'), ('\U0001d468', '\U0001d481'), ('\U0001d49c', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b5'), ('\U0001d4d0', '\U0001d4e9'), ('\U0001d504', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d538', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d56c', '\U0001d585'), ('\U0001d5a0', '\U0001d5b9'), ('\U0001d5d4', '\U0001d5ed'), ('\U0001d608', '\U0001d621'), ('\U0001d63c', '\U0001d655'), ('\U0001d670', '\U0001d689'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6e2', '\U0001d6fa'), ('\U0001d71c', '\U0001d734'), ('\U0001d756', '\U0001d76e'), ('\U0001d790', '\U0001d7a8'), ('\U0001d7ca', '\U0001d7ca'), ('\U0001f130', '\U0001f149'), ('\U0001f150', '\U0001f169'), ('\U0001f170', '\U0001f189') ]; pub fn Uppercase(c: char) -> bool { super::bsearch_range_table(c, Uppercase_table) } pub static XID_Continue_table: &'static [(char, char)] = &[ ('\x30', '\x39'), ('\x41', '\x5a'), ('\x5f', '\x5f'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00b7', '\u00b7'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u01ba'), ('\u01bb', '\u01bb'), ('\u01bc', '\u01bf'), ('\u01c0', '\u01c3'), ('\u01c4', '\u0293'), ('\u0294', '\u0294'), ('\u0295', '\u02af'), ('\u02b0', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0300', '\u036f'), ('\u0370', '\u0373'), ('\u0374', '\u0374'), ('\u0376', '\u0377'), ('\u037b', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0387', '\u0387'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u0483', '\u0487'), ('\u048a', '\u052f'), ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u0561', '\u0587'), ('\u0591', '\u05bd'), ('\u05bf', '\u05bf'), ('\u05c1', '\u05c2'), ('\u05c4', '\u05c5'), ('\u05c7', '\u05c7'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0610', '\u061a'), ('\u0620', '\u063f'), ('\u0640', '\u0640'), ('\u0641', '\u064a'), ('\u064b', '\u065f'), ('\u0660', '\u0669'), ('\u066e', '\u066f'), ('\u0670', '\u0670'), ('\u0671', '\u06d3'), ('\u06d5', '\u06d5'), ('\u06d6', '\u06dc'), ('\u06df', '\u06e4'), ('\u06e5', '\u06e6'), ('\u06e7', '\u06e8'), ('\u06ea', '\u06ed'), ('\u06ee', '\u06ef'), ('\u06f0', '\u06f9'), ('\u06fa', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u0710'), ('\u0711', '\u0711'), ('\u0712', '\u072f'), ('\u0730', '\u074a'), ('\u074d', '\u07a5'), ('\u07a6', '\u07b0'), ('\u07b1', '\u07b1'), ('\u07c0', '\u07c9'), ('\u07ca', '\u07ea'), ('\u07eb', '\u07f3'), ('\u07f4', '\u07f5'), ('\u07fa', '\u07fa'), ('\u0800', '\u0815'), ('\u0816', '\u0819'), ('\u081a', '\u081a'), ('\u081b', '\u0823'), ('\u0824', '\u0824'), ('\u0825', '\u0827'), ('\u0828', '\u0828'), ('\u0829', '\u082d'), ('\u0840', '\u0858'), ('\u0859', '\u085b'), ('\u08a0', '\u08b2'), ('\u08e4', '\u0902'), ('\u0903', '\u0903'), ('\u0904', '\u0939'), ('\u093a', '\u093a'), ('\u093b', '\u093b'), ('\u093c', '\u093c'), ('\u093d', '\u093d'), ('\u093e', '\u0940'), ('\u0941', '\u0948'), ('\u0949', '\u094c'), ('\u094d', '\u094d'), ('\u094e', '\u094f'), ('\u0950', '\u0950'), ('\u0951', '\u0957'), ('\u0958', '\u0961'), ('\u0962', '\u0963'), ('\u0966', '\u096f'), ('\u0971', '\u0971'), ('\u0972', '\u0980'), ('\u0981', '\u0981'), ('\u0982', '\u0983'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bc', '\u09bc'), ('\u09bd', '\u09bd'), ('\u09be', '\u09c0'), ('\u09c1', '\u09c4'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09cc'), ('\u09cd', '\u09cd'), ('\u09ce', '\u09ce'), ('\u09d7', '\u09d7'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09e2', '\u09e3'), ('\u09e6', '\u09ef'), ('\u09f0', '\u09f1'), ('\u0a01', '\u0a02'), ('\u0a03', '\u0a03'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a3c', '\u0a3c'), ('\u0a3e', '\u0a40'), ('\u0a41', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4d'), ('\u0a51', '\u0a51'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a66', '\u0a6f'), ('\u0a70', '\u0a71'), ('\u0a72', '\u0a74'), ('\u0a75', '\u0a75'), ('\u0a81', '\u0a82'), ('\u0a83', '\u0a83'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abc', '\u0abc'), ('\u0abd', '\u0abd'), ('\u0abe', '\u0ac0'), ('\u0ac1', '\u0ac5'), ('\u0ac7', '\u0ac8'), ('\u0ac9', '\u0ac9'), ('\u0acb', '\u0acc'), ('\u0acd', '\u0acd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0ae2', '\u0ae3'), ('\u0ae6', '\u0aef'), ('\u0b01', '\u0b01'), ('\u0b02', '\u0b03'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3c', '\u0b3c'), ('\u0b3d', '\u0b3d'), ('\u0b3e', '\u0b3e'), ('\u0b3f', '\u0b3f'), ('\u0b40', '\u0b40'), ('\u0b41', '\u0b44'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4c'), ('\u0b4d', '\u0b4d'), ('\u0b56', '\u0b56'), ('\u0b57', '\u0b57'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b62', '\u0b63'), ('\u0b66', '\u0b6f'), ('\u0b71', '\u0b71'), ('\u0b82', '\u0b82'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bbe', '\u0bbf'), ('\u0bc0', '\u0bc0'), ('\u0bc1', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcc'), ('\u0bcd', '\u0bcd'), ('\u0bd0', '\u0bd0'), ('\u0bd7', '\u0bd7'), ('\u0be6', '\u0bef'), ('\u0c00', '\u0c00'), ('\u0c01', '\u0c03'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c3e', '\u0c40'), ('\u0c41', '\u0c44'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4d'), ('\u0c55', '\u0c56'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c62', '\u0c63'), ('\u0c66', '\u0c6f'), ('\u0c81', '\u0c81'), ('\u0c82', '\u0c83'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbc', '\u0cbc'), ('\u0cbd', '\u0cbd'), ('\u0cbe', '\u0cbe'), ('\u0cbf', '\u0cbf'), ('\u0cc0', '\u0cc4'), ('\u0cc6', '\u0cc6'), ('\u0cc7', '\u0cc8'), ('\u0cca', '\u0ccb'), ('\u0ccc', '\u0ccd'), ('\u0cd5', '\u0cd6'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0ce2', '\u0ce3'), ('\u0ce6', '\u0cef'), ('\u0cf1', '\u0cf2'), ('\u0d01', '\u0d01'), ('\u0d02', '\u0d03'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d3e', '\u0d40'), ('\u0d41', '\u0d44'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4c'), ('\u0d4d', '\u0d4d'), ('\u0d4e', '\u0d4e'), ('\u0d57', '\u0d57'), ('\u0d60', '\u0d61'), ('\u0d62', '\u0d63'), ('\u0d66', '\u0d6f'), ('\u0d7a', '\u0d7f'), ('\u0d82', '\u0d83'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0dca', '\u0dca'), ('\u0dcf', '\u0dd1'), ('\u0dd2', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0dd8', '\u0ddf'), ('\u0de6', '\u0def'), ('\u0df2', '\u0df3'), ('\u0e01', '\u0e30'), ('\u0e31', '\u0e31'), ('\u0e32', '\u0e33'), ('\u0e34', '\u0e3a'), ('\u0e40', '\u0e45'), ('\u0e46', '\u0e46'), ('\u0e47', '\u0e4e'), ('\u0e50', '\u0e59'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb1', '\u0eb1'), ('\u0eb2', '\u0eb3'), ('\u0eb4', '\u0eb9'), ('\u0ebb', '\u0ebc'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0ec8', '\u0ecd'), ('\u0ed0', '\u0ed9'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f18', '\u0f19'), ('\u0f20', '\u0f29'), ('\u0f35', '\u0f35'), ('\u0f37', '\u0f37'), ('\u0f39', '\u0f39'), ('\u0f3e', '\u0f3f'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f71', '\u0f7e'), ('\u0f7f', '\u0f7f'), ('\u0f80', '\u0f84'), ('\u0f86', '\u0f87'), ('\u0f88', '\u0f8c'), ('\u0f8d', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u0fc6', '\u0fc6'), ('\u1000', '\u102a'), ('\u102b', '\u102c'), ('\u102d', '\u1030'), ('\u1031', '\u1031'), ('\u1032', '\u1037'), ('\u1038', '\u1038'), ('\u1039', '\u103a'), ('\u103b', '\u103c'), ('\u103d', '\u103e'), ('\u103f', '\u103f'), ('\u1040', '\u1049'), ('\u1050', '\u1055'), ('\u1056', '\u1057'), ('\u1058', '\u1059'), ('\u105a', '\u105d'), ('\u105e', '\u1060'), ('\u1061', '\u1061'), ('\u1062', '\u1064'), ('\u1065', '\u1066'), ('\u1067', '\u106d'), ('\u106e', '\u1070'), ('\u1071', '\u1074'), ('\u1075', '\u1081'), ('\u1082', '\u1082'), ('\u1083', '\u1084'), ('\u1085', '\u1086'), ('\u1087', '\u108c'), ('\u108d', '\u108d'), ('\u108e', '\u108e'), ('\u108f', '\u108f'), ('\u1090', '\u1099'), ('\u109a', '\u109c'), ('\u109d', '\u109d'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u10fc'), ('\u10fd', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u135d', '\u135f'), ('\u1369', '\u1371'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16ee', '\u16f0'), ('\u16f1', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1712', '\u1714'), ('\u1720', '\u1731'), ('\u1732', '\u1734'), ('\u1740', '\u1751'), ('\u1752', '\u1753'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1772', '\u1773'), ('\u1780', '\u17b3'), ('\u17b4', '\u17b5'), ('\u17b6', '\u17b6'), ('\u17b7', '\u17bd'), ('\u17be', '\u17c5'), ('\u17c6', '\u17c6'), ('\u17c7', '\u17c8'), ('\u17c9', '\u17d3'), ('\u17d7', '\u17d7'), ('\u17dc', '\u17dc'), ('\u17dd', '\u17dd'), ('\u17e0', '\u17e9'), ('\u180b', '\u180d'), ('\u1810', '\u1819'), ('\u1820', '\u1842'), ('\u1843', '\u1843'), ('\u1844', '\u1877'), ('\u1880', '\u18a8'), ('\u18a9', '\u18a9'), ('\u18aa', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1920', '\u1922'), ('\u1923', '\u1926'), ('\u1927', '\u1928'), ('\u1929', '\u192b'), ('\u1930', '\u1931'), ('\u1932', '\u1932'), ('\u1933', '\u1938'), ('\u1939', '\u193b'), ('\u1946', '\u194f'), ('\u1950', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19b0', '\u19c0'), ('\u19c1', '\u19c7'), ('\u19c8', '\u19c9'), ('\u19d0', '\u19d9'), ('\u19da', '\u19da'), ('\u1a00', '\u1a16'), ('\u1a17', '\u1a18'), ('\u1a19', '\u1a1a'), ('\u1a1b', '\u1a1b'), ('\u1a20', '\u1a54'), ('\u1a55', '\u1a55'), ('\u1a56', '\u1a56'), ('\u1a57', '\u1a57'), ('\u1a58', '\u1a5e'), ('\u1a60', '\u1a60'), ('\u1a61', '\u1a61'), ('\u1a62', '\u1a62'), ('\u1a63', '\u1a64'), ('\u1a65', '\u1a6c'), ('\u1a6d', '\u1a72'), ('\u1a73', '\u1a7c'), ('\u1a7f', '\u1a7f'), ('\u1a80', '\u1a89'), ('\u1a90', '\u1a99'), ('\u1aa7', '\u1aa7'), ('\u1ab0', '\u1abd'), ('\u1b00', '\u1b03'), ('\u1b04', '\u1b04'), ('\u1b05', '\u1b33'), ('\u1b34', '\u1b34'), ('\u1b35', '\u1b35'), ('\u1b36', '\u1b3a'), ('\u1b3b', '\u1b3b'), ('\u1b3c', '\u1b3c'), ('\u1b3d', '\u1b41'), ('\u1b42', '\u1b42'), ('\u1b43', '\u1b44'), ('\u1b45', '\u1b4b'), ('\u1b50', '\u1b59'), ('\u1b6b', '\u1b73'), ('\u1b80', '\u1b81'), ('\u1b82', '\u1b82'), ('\u1b83', '\u1ba0'), ('\u1ba1', '\u1ba1'), ('\u1ba2', '\u1ba5'), ('\u1ba6', '\u1ba7'), ('\u1ba8', '\u1ba9'), ('\u1baa', '\u1baa'), ('\u1bab', '\u1bad'), ('\u1bae', '\u1baf'), ('\u1bb0', '\u1bb9'), ('\u1bba', '\u1be5'), ('\u1be6', '\u1be6'), ('\u1be7', '\u1be7'), ('\u1be8', '\u1be9'), ('\u1bea', '\u1bec'), ('\u1bed', '\u1bed'), ('\u1bee', '\u1bee'), ('\u1bef', '\u1bf1'), ('\u1bf2', '\u1bf3'), ('\u1c00', '\u1c23'), ('\u1c24', '\u1c2b'), ('\u1c2c', '\u1c33'), ('\u1c34', '\u1c35'), ('\u1c36', '\u1c37'), ('\u1c40', '\u1c49'), ('\u1c4d', '\u1c4f'), ('\u1c50', '\u1c59'), ('\u1c5a', '\u1c77'), ('\u1c78', '\u1c7d'), ('\u1cd0', '\u1cd2'), ('\u1cd4', '\u1ce0'), ('\u1ce1', '\u1ce1'), ('\u1ce2', '\u1ce8'), ('\u1ce9', '\u1cec'), ('\u1ced', '\u1ced'), ('\u1cee', '\u1cf1'), ('\u1cf2', '\u1cf3'), ('\u1cf4', '\u1cf4'), ('\u1cf5', '\u1cf6'), ('\u1cf8', '\u1cf9'), ('\u1d00', '\u1d2b'), ('\u1d2c', '\u1d6a'), ('\u1d6b', '\u1d77'), ('\u1d78', '\u1d78'), ('\u1d79', '\u1d9a'), ('\u1d9b', '\u1dbf'), ('\u1dc0', '\u1df5'), ('\u1dfc', '\u1dff'), ('\u1e00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u203f', '\u2040'), ('\u2054', '\u2054'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u20d0', '\u20dc'), ('\u20e1', '\u20e1'), ('\u20e5', '\u20f0'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2118', '\u2118'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212e', '\u212e'), ('\u212f', '\u2134'), ('\u2135', '\u2138'), ('\u2139', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2160', '\u2182'), ('\u2183', '\u2184'), ('\u2185', '\u2188'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2c7b'), ('\u2c7c', '\u2c7d'), ('\u2c7e', '\u2ce4'), ('\u2ceb', '\u2cee'), ('\u2cef', '\u2cf1'), ('\u2cf2', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d7f', '\u2d7f'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u2de0', '\u2dff'), ('\u3005', '\u3005'), ('\u3006', '\u3006'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u302a', '\u302d'), ('\u302e', '\u302f'), ('\u3031', '\u3035'), ('\u3038', '\u303a'), ('\u303b', '\u303b'), ('\u303c', '\u303c'), ('\u3041', '\u3096'), ('\u3099', '\u309a'), ('\u309d', '\u309e'), ('\u309f', '\u309f'), ('\u30a1', '\u30fa'), ('\u30fc', '\u30fe'), ('\u30ff', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u4db5'), ('\u4e00', '\u9fcc'), ('\ua000', '\ua014'), ('\ua015', '\ua015'), ('\ua016', '\ua48c'), ('\ua4d0', '\ua4f7'), ('\ua4f8', '\ua4fd'), ('\ua500', '\ua60b'), ('\ua60c', '\ua60c'), ('\ua610', '\ua61f'), ('\ua620', '\ua629'), ('\ua62a', '\ua62b'), ('\ua640', '\ua66d'), ('\ua66e', '\ua66e'), ('\ua66f', '\ua66f'), ('\ua674', '\ua67d'), ('\ua67f', '\ua67f'), ('\ua680', '\ua69b'), ('\ua69c', '\ua69d'), ('\ua69f', '\ua69f'), ('\ua6a0', '\ua6e5'), ('\ua6e6', '\ua6ef'), ('\ua6f0', '\ua6f1'), ('\ua717', '\ua71f'), ('\ua722', '\ua76f'), ('\ua770', '\ua770'), ('\ua771', '\ua787'), ('\ua788', '\ua788'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua7f7'), ('\ua7f8', '\ua7f9'), ('\ua7fa', '\ua7fa'), ('\ua7fb', '\ua801'), ('\ua802', '\ua802'), ('\ua803', '\ua805'), ('\ua806', '\ua806'), ('\ua807', '\ua80a'), ('\ua80b', '\ua80b'), ('\ua80c', '\ua822'), ('\ua823', '\ua824'), ('\ua825', '\ua826'), ('\ua827', '\ua827'), ('\ua840', '\ua873'), ('\ua880', '\ua881'), ('\ua882', '\ua8b3'), ('\ua8b4', '\ua8c3'), ('\ua8c4', '\ua8c4'), ('\ua8d0', '\ua8d9'), ('\ua8e0', '\ua8f1'), ('\ua8f2', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua900', '\ua909'), ('\ua90a', '\ua925'), ('\ua926', '\ua92d'), ('\ua930', '\ua946'), ('\ua947', '\ua951'), ('\ua952', '\ua953'), ('\ua960', '\ua97c'), ('\ua980', '\ua982'), ('\ua983', '\ua983'), ('\ua984', '\ua9b2'), ('\ua9b3', '\ua9b3'), ('\ua9b4', '\ua9b5'), ('\ua9b6', '\ua9b9'), ('\ua9ba', '\ua9bb'), ('\ua9bc', '\ua9bc'), ('\ua9bd', '\ua9c0'), ('\ua9cf', '\ua9cf'), ('\ua9d0', '\ua9d9'), ('\ua9e0', '\ua9e4'), ('\ua9e5', '\ua9e5'), ('\ua9e6', '\ua9e6'), ('\ua9e7', '\ua9ef'), ('\ua9f0', '\ua9f9'), ('\ua9fa', '\ua9fe'), ('\uaa00', '\uaa28'), ('\uaa29', '\uaa2e'), ('\uaa2f', '\uaa30'), ('\uaa31', '\uaa32'), ('\uaa33', '\uaa34'), ('\uaa35', '\uaa36'), ('\uaa40', '\uaa42'), ('\uaa43', '\uaa43'), ('\uaa44', '\uaa4b'), ('\uaa4c', '\uaa4c'), ('\uaa4d', '\uaa4d'), ('\uaa50', '\uaa59'), ('\uaa60', '\uaa6f'), ('\uaa70', '\uaa70'), ('\uaa71', '\uaa76'), ('\uaa7a', '\uaa7a'), ('\uaa7b', '\uaa7b'), ('\uaa7c', '\uaa7c'), ('\uaa7d', '\uaa7d'), ('\uaa7e', '\uaaaf'), ('\uaab0', '\uaab0'), ('\uaab1', '\uaab1'), ('\uaab2', '\uaab4'), ('\uaab5', '\uaab6'), ('\uaab7', '\uaab8'), ('\uaab9', '\uaabd'), ('\uaabe', '\uaabf'), ('\uaac0', '\uaac0'), ('\uaac1', '\uaac1'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadc'), ('\uaadd', '\uaadd'), ('\uaae0', '\uaaea'), ('\uaaeb', '\uaaeb'), ('\uaaec', '\uaaed'), ('\uaaee', '\uaaef'), ('\uaaf2', '\uaaf2'), ('\uaaf3', '\uaaf4'), ('\uaaf5', '\uaaf5'), ('\uaaf6', '\uaaf6'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\uabc0', '\uabe2'), ('\uabe3', '\uabe4'), ('\uabe5', '\uabe5'), ('\uabe6', '\uabe7'), ('\uabe8', '\uabe8'), ('\uabe9', '\uabea'), ('\uabec', '\uabec'), ('\uabed', '\uabed'), ('\uabf0', '\uabf9'), ('\uac00', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\ufb1d', '\ufb1d'), ('\ufb1e', '\ufb1e'), ('\ufb1f', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufc5d'), ('\ufc64', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdf9'), ('\ufe00', '\ufe0f'), ('\ufe20', '\ufe2d'), ('\ufe33', '\ufe34'), ('\ufe4d', '\ufe4f'), ('\ufe71', '\ufe71'), ('\ufe73', '\ufe73'), ('\ufe77', '\ufe77'), ('\ufe79', '\ufe79'), ('\ufe7b', '\ufe7b'), ('\ufe7d', '\ufe7d'), ('\ufe7f', '\ufefc'), ('\uff10', '\uff19'), ('\uff21', '\uff3a'), ('\uff3f', '\uff3f'), ('\uff41', '\uff5a'), ('\uff66', '\uff6f'), ('\uff70', '\uff70'), ('\uff71', '\uff9d'), ('\uff9e', '\uff9f'), ('\uffa0', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010140', '\U00010174'), ('\U000101fd', '\U000101fd'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U000102e0', '\U000102e0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U00010340'), ('\U00010341', '\U00010341'), ('\U00010342', '\U00010349'), ('\U0001034a', '\U0001034a'), ('\U00010350', '\U00010375'), ('\U00010376', '\U0001037a'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U000103d1', '\U000103d5'), ('\U00010400', '\U0001044f'), ('\U00010450', '\U0001049d'), ('\U000104a0', '\U000104a9'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a00'), ('\U00010a01', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a0f'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a38', '\U00010a3a'), ('\U00010a3f', '\U00010a3f'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae4'), ('\U00010ae5', '\U00010ae6'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011000', '\U00011000'), ('\U00011001', '\U00011001'), ('\U00011002', '\U00011002'), ('\U00011003', '\U00011037'), ('\U00011038', '\U00011046'), ('\U00011066', '\U0001106f'), ('\U0001107f', '\U00011081'), ('\U00011082', '\U00011082'), ('\U00011083', '\U000110af'), ('\U000110b0', '\U000110b2'), ('\U000110b3', '\U000110b6'), ('\U000110b7', '\U000110b8'), ('\U000110b9', '\U000110ba'), ('\U000110d0', '\U000110e8'), ('\U000110f0', '\U000110f9'), ('\U00011100', '\U00011102'), ('\U00011103', '\U00011126'), ('\U00011127', '\U0001112b'), ('\U0001112c', '\U0001112c'), ('\U0001112d', '\U00011134'), ('\U00011136', '\U0001113f'), ('\U00011150', '\U00011172'), ('\U00011173', '\U00011173'), ('\U00011176', '\U00011176'), ('\U00011180', '\U00011181'), ('\U00011182', '\U00011182'), ('\U00011183', '\U000111b2'), ('\U000111b3', '\U000111b5'), ('\U000111b6', '\U000111be'), ('\U000111bf', '\U000111c0'), ('\U000111c1', '\U000111c4'), ('\U000111d0', '\U000111d9'), ('\U000111da', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U0001122c', '\U0001122e'), ('\U0001122f', '\U00011231'), ('\U00011232', '\U00011233'), ('\U00011234', '\U00011234'), ('\U00011235', '\U00011235'), ('\U00011236', '\U00011237'), ('\U000112b0', '\U000112de'), ('\U000112df', '\U000112df'), ('\U000112e0', '\U000112e2'), ('\U000112e3', '\U000112ea'), ('\U000112f0', '\U000112f9'), ('\U00011301', '\U00011301'), ('\U00011302', '\U00011303'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133c', '\U0001133c'), ('\U0001133d', '\U0001133d'), ('\U0001133e', '\U0001133f'), ('\U00011340', '\U00011340'), ('\U00011341', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134d'), ('\U00011357', '\U00011357'), ('\U0001135d', '\U00011361'), ('\U00011362', '\U00011363'), ('\U00011366', '\U0001136c'), ('\U00011370', '\U00011374'), ('\U00011480', '\U000114af'), ('\U000114b0', '\U000114b2'), ('\U000114b3', '\U000114b8'), ('\U000114b9', '\U000114b9'), ('\U000114ba', '\U000114ba'), ('\U000114bb', '\U000114be'), ('\U000114bf', '\U000114c0'), ('\U000114c1', '\U000114c1'), ('\U000114c2', '\U000114c3'), ('\U000114c4', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U000114d0', '\U000114d9'), ('\U00011580', '\U000115ae'), ('\U000115af', '\U000115b1'), ('\U000115b2', '\U000115b5'), ('\U000115b8', '\U000115bb'), ('\U000115bc', '\U000115bd'), ('\U000115be', '\U000115be'), ('\U000115bf', '\U000115c0'), ('\U00011600', '\U0001162f'), ('\U00011630', '\U00011632'), ('\U00011633', '\U0001163a'), ('\U0001163b', '\U0001163c'), ('\U0001163d', '\U0001163d'), ('\U0001163e', '\U0001163e'), ('\U0001163f', '\U00011640'), ('\U00011644', '\U00011644'), ('\U00011650', '\U00011659'), ('\U00011680', '\U000116aa'), ('\U000116ab', '\U000116ab'), ('\U000116ac', '\U000116ac'), ('\U000116ad', '\U000116ad'), ('\U000116ae', '\U000116af'), ('\U000116b0', '\U000116b5'), ('\U000116b6', '\U000116b6'), ('\U000116b7', '\U000116b7'), ('\U000116c0', '\U000116c9'), ('\U000118a0', '\U000118df'), ('\U000118e0', '\U000118e9'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00012400', '\U0001246e'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016a60', '\U00016a69'), ('\U00016ad0', '\U00016aed'), ('\U00016af0', '\U00016af4'), ('\U00016b00', '\U00016b2f'), ('\U00016b30', '\U00016b36'), ('\U00016b40', '\U00016b43'), ('\U00016b50', '\U00016b59'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U00016f51', '\U00016f7e'), ('\U00016f8f', '\U00016f92'), ('\U00016f93', '\U00016f9f'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001bc9d', '\U0001bc9e'), ('\U0001d165', '\U0001d166'), ('\U0001d167', '\U0001d169'), ('\U0001d16d', '\U0001d172'), ('\U0001d17b', '\U0001d182'), ('\U0001d185', '\U0001d18b'), ('\U0001d1aa', '\U0001d1ad'), ('\U0001d242', '\U0001d244'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001d7ce', '\U0001d7ff'), ('\U0001e800', '\U0001e8c4'), ('\U0001e8d0', '\U0001e8d6'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U00020000', '\U0002a6d6'), ('\U0002a700', '\U0002b734'), ('\U0002b740', '\U0002b81d'), ('\U0002f800', '\U0002fa1d'), ('\U000e0100', '\U000e01ef') ]; pub fn XID_Continue(c: char) -> bool { super::bsearch_range_table(c, XID_Continue_table) } pub static XID_Start_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u01ba'), ('\u01bb', '\u01bb'), ('\u01bc', '\u01bf'), ('\u01c0', '\u01c3'), ('\u01c4', '\u0293'), ('\u0294', '\u0294'), ('\u0295', '\u02af'), ('\u02b0', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0370', '\u0373'), ('\u0374', '\u0374'), ('\u0376', '\u0377'), ('\u037b', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u048a', '\u052f'), ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u0561', '\u0587'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0620', '\u063f'), ('\u0640', '\u0640'), ('\u0641', '\u064a'), ('\u066e', '\u066f'), ('\u0671', '\u06d3'), ('\u06d5', '\u06d5'), ('\u06e5', '\u06e6'), ('\u06ee', '\u06ef'), ('\u06fa', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u0710'), ('\u0712', '\u072f'), ('\u074d', '\u07a5'), ('\u07b1', '\u07b1'), ('\u07ca', '\u07ea'), ('\u07f4', '\u07f5'), ('\u07fa', '\u07fa'), ('\u0800', '\u0815'), ('\u081a', '\u081a'), ('\u0824', '\u0824'), ('\u0828', '\u0828'), ('\u0840', '\u0858'), ('\u08a0', '\u08b2'), ('\u0904', '\u0939'), ('\u093d', '\u093d'), ('\u0950', '\u0950'), ('\u0958', '\u0961'), ('\u0971', '\u0971'), ('\u0972', '\u0980'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bd', '\u09bd'), ('\u09ce', '\u09ce'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09f0', '\u09f1'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a72', '\u0a74'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abd', '\u0abd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3d', '\u0b3d'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b71', '\u0b71'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bd0', '\u0bd0'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbd', '\u0cbd'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0cf1', '\u0cf2'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d4e', '\u0d4e'), ('\u0d60', '\u0d61'), ('\u0d7a', '\u0d7f'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0e01', '\u0e30'), ('\u0e32', '\u0e32'), ('\u0e40', '\u0e45'), ('\u0e46', '\u0e46'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb2', '\u0eb2'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f88', '\u0f8c'), ('\u1000', '\u102a'), ('\u103f', '\u103f'), ('\u1050', '\u1055'), ('\u105a', '\u105d'), ('\u1061', '\u1061'), ('\u1065', '\u1066'), ('\u106e', '\u1070'), ('\u1075', '\u1081'), ('\u108e', '\u108e'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u10fc'), ('\u10fd', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16ee', '\u16f0'), ('\u16f1', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1720', '\u1731'), ('\u1740', '\u1751'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1780', '\u17b3'), ('\u17d7', '\u17d7'), ('\u17dc', '\u17dc'), ('\u1820', '\u1842'), ('\u1843', '\u1843'), ('\u1844', '\u1877'), ('\u1880', '\u18a8'), ('\u18aa', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1950', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19c1', '\u19c7'), ('\u1a00', '\u1a16'), ('\u1a20', '\u1a54'), ('\u1aa7', '\u1aa7'), ('\u1b05', '\u1b33'), ('\u1b45', '\u1b4b'), ('\u1b83', '\u1ba0'), ('\u1bae', '\u1baf'), ('\u1bba', '\u1be5'), ('\u1c00', '\u1c23'), ('\u1c4d', '\u1c4f'), ('\u1c5a', '\u1c77'), ('\u1c78', '\u1c7d'), ('\u1ce9', '\u1cec'), ('\u1cee', '\u1cf1'), ('\u1cf5', '\u1cf6'), ('\u1d00', '\u1d2b'), ('\u1d2c', '\u1d6a'), ('\u1d6b', '\u1d77'), ('\u1d78', '\u1d78'), ('\u1d79', '\u1d9a'), ('\u1d9b', '\u1dbf'), ('\u1e00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2118', '\u2118'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212e', '\u212e'), ('\u212f', '\u2134'), ('\u2135', '\u2138'), ('\u2139', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2160', '\u2182'), ('\u2183', '\u2184'), ('\u2185', '\u2188'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2c7b'), ('\u2c7c', '\u2c7d'), ('\u2c7e', '\u2ce4'), ('\u2ceb', '\u2cee'), ('\u2cf2', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u3005', '\u3005'), ('\u3006', '\u3006'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u3031', '\u3035'), ('\u3038', '\u303a'), ('\u303b', '\u303b'), ('\u303c', '\u303c'), ('\u3041', '\u3096'), ('\u309d', '\u309e'), ('\u309f', '\u309f'), ('\u30a1', '\u30fa'), ('\u30fc', '\u30fe'), ('\u30ff', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u4db5'), ('\u4e00', '\u9fcc'), ('\ua000', '\ua014'), ('\ua015', '\ua015'), ('\ua016', '\ua48c'), ('\ua4d0', '\ua4f7'), ('\ua4f8', '\ua4fd'), ('\ua500', '\ua60b'), ('\ua60c', '\ua60c'), ('\ua610', '\ua61f'), ('\ua62a', '\ua62b'), ('\ua640', '\ua66d'), ('\ua66e', '\ua66e'), ('\ua67f', '\ua67f'), ('\ua680', '\ua69b'), ('\ua69c', '\ua69d'), ('\ua6a0', '\ua6e5'), ('\ua6e6', '\ua6ef'), ('\ua717', '\ua71f'), ('\ua722', '\ua76f'), ('\ua770', '\ua770'), ('\ua771', '\ua787'), ('\ua788', '\ua788'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua7f7'), ('\ua7f8', '\ua7f9'), ('\ua7fa', '\ua7fa'), ('\ua7fb', '\ua801'), ('\ua803', '\ua805'), ('\ua807', '\ua80a'), ('\ua80c', '\ua822'), ('\ua840', '\ua873'), ('\ua882', '\ua8b3'), ('\ua8f2', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua90a', '\ua925'), ('\ua930', '\ua946'), ('\ua960', '\ua97c'), ('\ua984', '\ua9b2'), ('\ua9cf', '\ua9cf'), ('\ua9e0', '\ua9e4'), ('\ua9e6', '\ua9e6'), ('\ua9e7', '\ua9ef'), ('\ua9fa', '\ua9fe'), ('\uaa00', '\uaa28'), ('\uaa40', '\uaa42'), ('\uaa44', '\uaa4b'), ('\uaa60', '\uaa6f'), ('\uaa70', '\uaa70'), ('\uaa71', '\uaa76'), ('\uaa7a', '\uaa7a'), ('\uaa7e', '\uaaaf'), ('\uaab1', '\uaab1'), ('\uaab5', '\uaab6'), ('\uaab9', '\uaabd'), ('\uaac0', '\uaac0'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadc'), ('\uaadd', '\uaadd'), ('\uaae0', '\uaaea'), ('\uaaf2', '\uaaf2'), ('\uaaf3', '\uaaf4'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\uabc0', '\uabe2'), ('\uac00', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\ufb1d', '\ufb1d'), ('\ufb1f', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufc5d'), ('\ufc64', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdf9'), ('\ufe71', '\ufe71'), ('\ufe73', '\ufe73'), ('\ufe77', '\ufe77'), ('\ufe79', '\ufe79'), ('\ufe7b', '\ufe7b'), ('\ufe7d', '\ufe7d'), ('\ufe7f', '\ufefc'), ('\uff21', '\uff3a'), ('\uff41', '\uff5a'), ('\uff66', '\uff6f'), ('\uff70', '\uff70'), ('\uff71', '\uff9d'), ('\uffa0', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010140', '\U00010174'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U00010340'), ('\U00010341', '\U00010341'), ('\U00010342', '\U00010349'), ('\U0001034a', '\U0001034a'), ('\U00010350', '\U00010375'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U000103d1', '\U000103d5'), ('\U00010400', '\U0001044f'), ('\U00010450', '\U0001049d'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a00'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae4'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011003', '\U00011037'), ('\U00011083', '\U000110af'), ('\U000110d0', '\U000110e8'), ('\U00011103', '\U00011126'), ('\U00011150', '\U00011172'), ('\U00011176', '\U00011176'), ('\U00011183', '\U000111b2'), ('\U000111c1', '\U000111c4'), ('\U000111da', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U000112b0', '\U000112de'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133d', '\U0001133d'), ('\U0001135d', '\U00011361'), ('\U00011480', '\U000114af'), ('\U000114c4', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U00011580', '\U000115ae'), ('\U00011600', '\U0001162f'), ('\U00011644', '\U00011644'), ('\U00011680', '\U000116aa'), ('\U000118a0', '\U000118df'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00012400', '\U0001246e'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016ad0', '\U00016aed'), ('\U00016b00', '\U00016b2f'), ('\U00016b40', '\U00016b43'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U00016f93', '\U00016f9f'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001e800', '\U0001e8c4'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U00020000', '\U0002a6d6'), ('\U0002a700', '\U0002b734'), ('\U0002b740', '\U0002b81d'), ('\U0002f800', '\U0002fa1d') ]; pub fn XID_Start(c: char) -> bool { super::bsearch_range_table(c, XID_Start_table) } } pub mod script { pub static Arabic_table: &'static [(char, char)] = &[ ('\u0600', '\u0604'), ('\u0606', '\u0608'), ('\u0609', '\u060a'), ('\u060b', '\u060b'), ('\u060d', '\u060d'), ('\u060e', '\u060f'), ('\u0610', '\u061a'), ('\u061e', '\u061e'), ('\u0620', '\u063f'), ('\u0641', '\u064a'), ('\u0656', '\u065f'), ('\u066a', '\u066d'), ('\u066e', '\u066f'), ('\u0671', '\u06d3'), ('\u06d4', '\u06d4'), ('\u06d5', '\u06d5'), ('\u06d6', '\u06dc'), ('\u06de', '\u06de'), ('\u06df', '\u06e4'), ('\u06e5', '\u06e6'), ('\u06e7', '\u06e8'), ('\u06e9', '\u06e9'), ('\u06ea', '\u06ed'), ('\u06ee', '\u06ef'), ('\u06f0', '\u06f9'), ('\u06fa', '\u06fc'), ('\u06fd', '\u06fe'), ('\u06ff', '\u06ff'), ('\u0750', '\u077f'), ('\u08a0', '\u08b2'), ('\u08e4', '\u08ff'), ('\ufb50', '\ufbb1'), ('\ufbb2', '\ufbc1'), ('\ufbd3', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdfb'), ('\ufdfc', '\ufdfc'), ('\ufdfd', '\ufdfd'), ('\ufe70', '\ufe74'), ('\ufe76', '\ufefc'), ('\U00010e60', '\U00010e7e'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U0001eef0', '\U0001eef1') ]; pub static Armenian_table: &'static [(char, char)] = &[ ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u055a', '\u055f'), ('\u0561', '\u0587'), ('\u058a', '\u058a'), ('\u058d', '\u058e'), ('\u058f', '\u058f'), ('\ufb13', '\ufb17') ]; pub static Avestan_table: &'static [(char, char)] = &[ ('\U00010b00', '\U00010b35'), ('\U00010b39', '\U00010b3f') ]; pub static Balinese_table: &'static [(char, char)] = &[ ('\u1b00', '\u1b03'), ('\u1b04', '\u1b04'), ('\u1b05', '\u1b33'), ('\u1b34', '\u1b34'), ('\u1b35', '\u1b35'), ('\u1b36', '\u1b3a'), ('\u1b3b', '\u1b3b'), ('\u1b3c', '\u1b3c'), ('\u1b3d', '\u1b41'), ('\u1b42', '\u1b42'), ('\u1b43', '\u1b44'), ('\u1b45', '\u1b4b'), ('\u1b50', '\u1b59'), ('\u1b5a', '\u1b60'), ('\u1b61', '\u1b6a'), ('\u1b6b', '\u1b73'), ('\u1b74', '\u1b7c') ]; pub static Bamum_table: &'static [(char, char)] = &[ ('\ua6a0', '\ua6e5'), ('\ua6e6', '\ua6ef'), ('\ua6f0', '\ua6f1'), ('\ua6f2', '\ua6f7'), ('\U00016800', '\U00016a38') ]; pub static Bassa_Vah_table: &'static [(char, char)] = &[ ('\U00016ad0', '\U00016aed'), ('\U00016af0', '\U00016af4'), ('\U00016af5', '\U00016af5') ]; pub static Batak_table: &'static [(char, char)] = &[ ('\u1bc0', '\u1be5'), ('\u1be6', '\u1be6'), ('\u1be7', '\u1be7'), ('\u1be8', '\u1be9'), ('\u1bea', '\u1bec'), ('\u1bed', '\u1bed'), ('\u1bee', '\u1bee'), ('\u1bef', '\u1bf1'), ('\u1bf2', '\u1bf3'), ('\u1bfc', '\u1bff') ]; pub static Bengali_table: &'static [(char, char)] = &[ ('\u0980', '\u0980'), ('\u0981', '\u0981'), ('\u0982', '\u0983'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bc', '\u09bc'), ('\u09bd', '\u09bd'), ('\u09be', '\u09c0'), ('\u09c1', '\u09c4'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09cc'), ('\u09cd', '\u09cd'), ('\u09ce', '\u09ce'), ('\u09d7', '\u09d7'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e1'), ('\u09e2', '\u09e3'), ('\u09e6', '\u09ef'), ('\u09f0', '\u09f1'), ('\u09f2', '\u09f3'), ('\u09f4', '\u09f9'), ('\u09fa', '\u09fa'), ('\u09fb', '\u09fb') ]; pub static Bopomofo_table: &'static [(char, char)] = &[ ('\u02ea', '\u02eb'), ('\u3105', '\u312d'), ('\u31a0', '\u31ba') ]; pub static Brahmi_table: &'static [(char, char)] = &[ ('\U00011000', '\U00011000'), ('\U00011001', '\U00011001'), ('\U00011002', '\U00011002'), ('\U00011003', '\U00011037'), ('\U00011038', '\U00011046'), ('\U00011047', '\U0001104d'), ('\U00011052', '\U00011065'), ('\U00011066', '\U0001106f'), ('\U0001107f', '\U0001107f') ]; pub static Braille_table: &'static [(char, char)] = &[ ('\u2800', '\u28ff') ]; pub static Buginese_table: &'static [(char, char)] = &[ ('\u1a00', '\u1a16'), ('\u1a17', '\u1a18'), ('\u1a19', '\u1a1a'), ('\u1a1b', '\u1a1b'), ('\u1a1e', '\u1a1f') ]; pub static Buhid_table: &'static [(char, char)] = &[ ('\u1740', '\u1751'), ('\u1752', '\u1753') ]; pub static Canadian_Aboriginal_table: &'static [(char, char)] = &[ ('\u1400', '\u1400'), ('\u1401', '\u166c'), ('\u166d', '\u166e'), ('\u166f', '\u167f'), ('\u18b0', '\u18f5') ]; pub static Carian_table: &'static [(char, char)] = &[ ('\U000102a0', '\U000102d0') ]; pub static Caucasian_Albanian_table: &'static [(char, char)] = &[ ('\U00010530', '\U00010563'), ('\U0001056f', '\U0001056f') ]; pub static Chakma_table: &'static [(char, char)] = &[ ('\U00011100', '\U00011102'), ('\U00011103', '\U00011126'), ('\U00011127', '\U0001112b'), ('\U0001112c', '\U0001112c'), ('\U0001112d', '\U00011134'), ('\U00011136', '\U0001113f'), ('\U00011140', '\U00011143') ]; pub static Cham_table: &'static [(char, char)] = &[ ('\uaa00', '\uaa28'), ('\uaa29', '\uaa2e'), ('\uaa2f', '\uaa30'), ('\uaa31', '\uaa32'), ('\uaa33', '\uaa34'), ('\uaa35', '\uaa36'), ('\uaa40', '\uaa42'), ('\uaa43', '\uaa43'), ('\uaa44', '\uaa4b'), ('\uaa4c', '\uaa4c'), ('\uaa4d', '\uaa4d'), ('\uaa50', '\uaa59'), ('\uaa5c', '\uaa5f') ]; pub static Cherokee_table: &'static [(char, char)] = &[ ('\u13a0', '\u13f4') ]; pub static Common_table: &'static [(char, char)] = &[ ('\x00', '\x1f'), ('\x20', '\x20'), ('\x21', '\x23'), ('\x24', '\x24'), ('\x25', '\x27'), ('\x28', '\x28'), ('\x29', '\x29'), ('\x2a', '\x2a'), ('\x2b', '\x2b'), ('\x2c', '\x2c'), ('\x2d', '\x2d'), ('\x2e', '\x2f'), ('\x30', '\x39'), ('\x3a', '\x3b'), ('\x3c', '\x3e'), ('\x3f', '\x40'), ('\x5b', '\x5b'), ('\x5c', '\x5c'), ('\x5d', '\x5d'), ('\x5e', '\x5e'), ('\x5f', '\x5f'), ('\x60', '\x60'), ('\x7b', '\x7b'), ('\x7c', '\x7c'), ('\x7d', '\x7d'), ('\x7e', '\x7e'), ('\x7f', '\u009f'), ('\u00a0', '\u00a0'), ('\u00a1', '\u00a1'), ('\u00a2', '\u00a5'), ('\u00a6', '\u00a6'), ('\u00a7', '\u00a7'), ('\u00a8', '\u00a8'), ('\u00a9', '\u00a9'), ('\u00ab', '\u00ab'), ('\u00ac', '\u00ac'), ('\u00ad', '\u00ad'), ('\u00ae', '\u00ae'), ('\u00af', '\u00af'), ('\u00b0', '\u00b0'), ('\u00b1', '\u00b1'), ('\u00b2', '\u00b3'), ('\u00b4', '\u00b4'), ('\u00b5', '\u00b5'), ('\u00b6', '\u00b7'), ('\u00b8', '\u00b8'), ('\u00b9', '\u00b9'), ('\u00bb', '\u00bb'), ('\u00bc', '\u00be'), ('\u00bf', '\u00bf'), ('\u00d7', '\u00d7'), ('\u00f7', '\u00f7'), ('\u02b9', '\u02c1'), ('\u02c2', '\u02c5'), ('\u02c6', '\u02d1'), ('\u02d2', '\u02df'), ('\u02e5', '\u02e9'), ('\u02ec', '\u02ec'), ('\u02ed', '\u02ed'), ('\u02ee', '\u02ee'), ('\u02ef', '\u02ff'), ('\u0374', '\u0374'), ('\u037e', '\u037e'), ('\u0385', '\u0385'), ('\u0387', '\u0387'), ('\u0589', '\u0589'), ('\u0605', '\u0605'), ('\u060c', '\u060c'), ('\u061b', '\u061b'), ('\u061c', '\u061c'), ('\u061f', '\u061f'), ('\u0640', '\u0640'), ('\u0660', '\u0669'), ('\u06dd', '\u06dd'), ('\u0964', '\u0965'), ('\u0e3f', '\u0e3f'), ('\u0fd5', '\u0fd8'), ('\u10fb', '\u10fb'), ('\u16eb', '\u16ed'), ('\u1735', '\u1736'), ('\u1802', '\u1803'), ('\u1805', '\u1805'), ('\u1cd3', '\u1cd3'), ('\u1ce1', '\u1ce1'), ('\u1ce9', '\u1cec'), ('\u1cee', '\u1cf1'), ('\u1cf2', '\u1cf3'), ('\u1cf5', '\u1cf6'), ('\u2000', '\u200a'), ('\u200b', '\u200b'), ('\u200e', '\u200f'), ('\u2010', '\u2015'), ('\u2016', '\u2017'), ('\u2018', '\u2018'), ('\u2019', '\u2019'), ('\u201a', '\u201a'), ('\u201b', '\u201c'), ('\u201d', '\u201d'), ('\u201e', '\u201e'), ('\u201f', '\u201f'), ('\u2020', '\u2027'), ('\u2028', '\u2028'), ('\u2029', '\u2029'), ('\u202a', '\u202e'), ('\u202f', '\u202f'), ('\u2030', '\u2038'), ('\u2039', '\u2039'), ('\u203a', '\u203a'), ('\u203b', '\u203e'), ('\u203f', '\u2040'), ('\u2041', '\u2043'), ('\u2044', '\u2044'), ('\u2045', '\u2045'), ('\u2046', '\u2046'), ('\u2047', '\u2051'), ('\u2052', '\u2052'), ('\u2053', '\u2053'), ('\u2054', '\u2054'), ('\u2055', '\u205e'), ('\u205f', '\u205f'), ('\u2060', '\u2064'), ('\u2066', '\u206f'), ('\u2070', '\u2070'), ('\u2074', '\u2079'), ('\u207a', '\u207c'), ('\u207d', '\u207d'), ('\u207e', '\u207e'), ('\u2080', '\u2089'), ('\u208a', '\u208c'), ('\u208d', '\u208d'), ('\u208e', '\u208e'), ('\u20a0', '\u20bd'), ('\u2100', '\u2101'), ('\u2102', '\u2102'), ('\u2103', '\u2106'), ('\u2107', '\u2107'), ('\u2108', '\u2109'), ('\u210a', '\u2113'), ('\u2114', '\u2114'), ('\u2115', '\u2115'), ('\u2116', '\u2117'), ('\u2118', '\u2118'), ('\u2119', '\u211d'), ('\u211e', '\u2123'), ('\u2124', '\u2124'), ('\u2125', '\u2125'), ('\u2127', '\u2127'), ('\u2128', '\u2128'), ('\u2129', '\u2129'), ('\u212c', '\u212d'), ('\u212e', '\u212e'), ('\u212f', '\u2131'), ('\u2133', '\u2134'), ('\u2135', '\u2138'), ('\u2139', '\u2139'), ('\u213a', '\u213b'), ('\u213c', '\u213f'), ('\u2140', '\u2144'), ('\u2145', '\u2149'), ('\u214a', '\u214a'), ('\u214b', '\u214b'), ('\u214c', '\u214d'), ('\u214f', '\u214f'), ('\u2150', '\u215f'), ('\u2189', '\u2189'), ('\u2190', '\u2194'), ('\u2195', '\u2199'), ('\u219a', '\u219b'), ('\u219c', '\u219f'), ('\u21a0', '\u21a0'), ('\u21a1', '\u21a2'), ('\u21a3', '\u21a3'), ('\u21a4', '\u21a5'), ('\u21a6', '\u21a6'), ('\u21a7', '\u21ad'), ('\u21ae', '\u21ae'), ('\u21af', '\u21cd'), ('\u21ce', '\u21cf'), ('\u21d0', '\u21d1'), ('\u21d2', '\u21d2'), ('\u21d3', '\u21d3'), ('\u21d4', '\u21d4'), ('\u21d5', '\u21f3'), ('\u21f4', '\u22ff'), ('\u2300', '\u2307'), ('\u2308', '\u2308'), ('\u2309', '\u2309'), ('\u230a', '\u230a'), ('\u230b', '\u230b'), ('\u230c', '\u231f'), ('\u2320', '\u2321'), ('\u2322', '\u2328'), ('\u2329', '\u2329'), ('\u232a', '\u232a'), ('\u232b', '\u237b'), ('\u237c', '\u237c'), ('\u237d', '\u239a'), ('\u239b', '\u23b3'), ('\u23b4', '\u23db'), ('\u23dc', '\u23e1'), ('\u23e2', '\u23fa'), ('\u2400', '\u2426'), ('\u2440', '\u244a'), ('\u2460', '\u249b'), ('\u249c', '\u24e9'), ('\u24ea', '\u24ff'), ('\u2500', '\u25b6'), ('\u25b7', '\u25b7'), ('\u25b8', '\u25c0'), ('\u25c1', '\u25c1'), ('\u25c2', '\u25f7'), ('\u25f8', '\u25ff'), ('\u2600', '\u266e'), ('\u266f', '\u266f'), ('\u2670', '\u2767'), ('\u2768', '\u2768'), ('\u2769', '\u2769'), ('\u276a', '\u276a'), ('\u276b', '\u276b'), ('\u276c', '\u276c'), ('\u276d', '\u276d'), ('\u276e', '\u276e'), ('\u276f', '\u276f'), ('\u2770', '\u2770'), ('\u2771', '\u2771'), ('\u2772', '\u2772'), ('\u2773', '\u2773'), ('\u2774', '\u2774'), ('\u2775', '\u2775'), ('\u2776', '\u2793'), ('\u2794', '\u27bf'), ('\u27c0', '\u27c4'), ('\u27c5', '\u27c5'), ('\u27c6', '\u27c6'), ('\u27c7', '\u27e5'), ('\u27e6', '\u27e6'), ('\u27e7', '\u27e7'), ('\u27e8', '\u27e8'), ('\u27e9', '\u27e9'), ('\u27ea', '\u27ea'), ('\u27eb', '\u27eb'), ('\u27ec', '\u27ec'), ('\u27ed', '\u27ed'), ('\u27ee', '\u27ee'), ('\u27ef', '\u27ef'), ('\u27f0', '\u27ff'), ('\u2900', '\u2982'), ('\u2983', '\u2983'), ('\u2984', '\u2984'), ('\u2985', '\u2985'), ('\u2986', '\u2986'), ('\u2987', '\u2987'), ('\u2988', '\u2988'), ('\u2989', '\u2989'), ('\u298a', '\u298a'), ('\u298b', '\u298b'), ('\u298c', '\u298c'), ('\u298d', '\u298d'), ('\u298e', '\u298e'), ('\u298f', '\u298f'), ('\u2990', '\u2990'), ('\u2991', '\u2991'), ('\u2992', '\u2992'), ('\u2993', '\u2993'), ('\u2994', '\u2994'), ('\u2995', '\u2995'), ('\u2996', '\u2996'), ('\u2997', '\u2997'), ('\u2998', '\u2998'), ('\u2999', '\u29d7'), ('\u29d8', '\u29d8'), ('\u29d9', '\u29d9'), ('\u29da', '\u29da'), ('\u29db', '\u29db'), ('\u29dc', '\u29fb'), ('\u29fc', '\u29fc'), ('\u29fd', '\u29fd'), ('\u29fe', '\u2aff'), ('\u2b00', '\u2b2f'), ('\u2b30', '\u2b44'), ('\u2b45', '\u2b46'), ('\u2b47', '\u2b4c'), ('\u2b4d', '\u2b73'), ('\u2b76', '\u2b95'), ('\u2b98', '\u2bb9'), ('\u2bbd', '\u2bc8'), ('\u2bca', '\u2bd1'), ('\u2e00', '\u2e01'), ('\u2e02', '\u2e02'), ('\u2e03', '\u2e03'), ('\u2e04', '\u2e04'), ('\u2e05', '\u2e05'), ('\u2e06', '\u2e08'), ('\u2e09', '\u2e09'), ('\u2e0a', '\u2e0a'), ('\u2e0b', '\u2e0b'), ('\u2e0c', '\u2e0c'), ('\u2e0d', '\u2e0d'), ('\u2e0e', '\u2e16'), ('\u2e17', '\u2e17'), ('\u2e18', '\u2e19'), ('\u2e1a', '\u2e1a'), ('\u2e1b', '\u2e1b'), ('\u2e1c', '\u2e1c'), ('\u2e1d', '\u2e1d'), ('\u2e1e', '\u2e1f'), ('\u2e20', '\u2e20'), ('\u2e21', '\u2e21'), ('\u2e22', '\u2e22'), ('\u2e23', '\u2e23'), ('\u2e24', '\u2e24'), ('\u2e25', '\u2e25'), ('\u2e26', '\u2e26'), ('\u2e27', '\u2e27'), ('\u2e28', '\u2e28'), ('\u2e29', '\u2e29'), ('\u2e2a', '\u2e2e'), ('\u2e2f', '\u2e2f'), ('\u2e30', '\u2e39'), ('\u2e3a', '\u2e3b'), ('\u2e3c', '\u2e3f'), ('\u2e40', '\u2e40'), ('\u2e41', '\u2e41'), ('\u2e42', '\u2e42'), ('\u2ff0', '\u2ffb'), ('\u3000', '\u3000'), ('\u3001', '\u3003'), ('\u3004', '\u3004'), ('\u3006', '\u3006'), ('\u3008', '\u3008'), ('\u3009', '\u3009'), ('\u300a', '\u300a'), ('\u300b', '\u300b'), ('\u300c', '\u300c'), ('\u300d', '\u300d'), ('\u300e', '\u300e'), ('\u300f', '\u300f'), ('\u3010', '\u3010'), ('\u3011', '\u3011'), ('\u3012', '\u3013'), ('\u3014', '\u3014'), ('\u3015', '\u3015'), ('\u3016', '\u3016'), ('\u3017', '\u3017'), ('\u3018', '\u3018'), ('\u3019', '\u3019'), ('\u301a', '\u301a'), ('\u301b', '\u301b'), ('\u301c', '\u301c'), ('\u301d', '\u301d'), ('\u301e', '\u301f'), ('\u3020', '\u3020'), ('\u3030', '\u3030'), ('\u3031', '\u3035'), ('\u3036', '\u3037'), ('\u303c', '\u303c'), ('\u303d', '\u303d'), ('\u303e', '\u303f'), ('\u309b', '\u309c'), ('\u30a0', '\u30a0'), ('\u30fb', '\u30fb'), ('\u30fc', '\u30fc'), ('\u3190', '\u3191'), ('\u3192', '\u3195'), ('\u3196', '\u319f'), ('\u31c0', '\u31e3'), ('\u3220', '\u3229'), ('\u322a', '\u3247'), ('\u3248', '\u324f'), ('\u3250', '\u3250'), ('\u3251', '\u325f'), ('\u327f', '\u327f'), ('\u3280', '\u3289'), ('\u328a', '\u32b0'), ('\u32b1', '\u32bf'), ('\u32c0', '\u32cf'), ('\u3358', '\u33ff'), ('\u4dc0', '\u4dff'), ('\ua700', '\ua716'), ('\ua717', '\ua71f'), ('\ua720', '\ua721'), ('\ua788', '\ua788'), ('\ua789', '\ua78a'), ('\ua830', '\ua835'), ('\ua836', '\ua837'), ('\ua838', '\ua838'), ('\ua839', '\ua839'), ('\ua92e', '\ua92e'), ('\ua9cf', '\ua9cf'), ('\uab5b', '\uab5b'), ('\ufd3e', '\ufd3e'), ('\ufd3f', '\ufd3f'), ('\ufe10', '\ufe16'), ('\ufe17', '\ufe17'), ('\ufe18', '\ufe18'), ('\ufe19', '\ufe19'), ('\ufe30', '\ufe30'), ('\ufe31', '\ufe32'), ('\ufe33', '\ufe34'), ('\ufe35', '\ufe35'), ('\ufe36', '\ufe36'), ('\ufe37', '\ufe37'), ('\ufe38', '\ufe38'), ('\ufe39', '\ufe39'), ('\ufe3a', '\ufe3a'), ('\ufe3b', '\ufe3b'), ('\ufe3c', '\ufe3c'), ('\ufe3d', '\ufe3d'), ('\ufe3e', '\ufe3e'), ('\ufe3f', '\ufe3f'), ('\ufe40', '\ufe40'), ('\ufe41', '\ufe41'), ('\ufe42', '\ufe42'), ('\ufe43', '\ufe43'), ('\ufe44', '\ufe44'), ('\ufe45', '\ufe46'), ('\ufe47', '\ufe47'), ('\ufe48', '\ufe48'), ('\ufe49', '\ufe4c'), ('\ufe4d', '\ufe4f'), ('\ufe50', '\ufe52'), ('\ufe54', '\ufe57'), ('\ufe58', '\ufe58'), ('\ufe59', '\ufe59'), ('\ufe5a', '\ufe5a'), ('\ufe5b', '\ufe5b'), ('\ufe5c', '\ufe5c'), ('\ufe5d', '\ufe5d'), ('\ufe5e', '\ufe5e'), ('\ufe5f', '\ufe61'), ('\ufe62', '\ufe62'), ('\ufe63', '\ufe63'), ('\ufe64', '\ufe66'), ('\ufe68', '\ufe68'), ('\ufe69', '\ufe69'), ('\ufe6a', '\ufe6b'), ('\ufeff', '\ufeff'), ('\uff01', '\uff03'), ('\uff04', '\uff04'), ('\uff05', '\uff07'), ('\uff08', '\uff08'), ('\uff09', '\uff09'), ('\uff0a', '\uff0a'), ('\uff0b', '\uff0b'), ('\uff0c', '\uff0c'), ('\uff0d', '\uff0d'), ('\uff0e', '\uff0f'), ('\uff10', '\uff19'), ('\uff1a', '\uff1b'), ('\uff1c', '\uff1e'), ('\uff1f', '\uff20'), ('\uff3b', '\uff3b'), ('\uff3c', '\uff3c'), ('\uff3d', '\uff3d'), ('\uff3e', '\uff3e'), ('\uff3f', '\uff3f'), ('\uff40', '\uff40'), ('\uff5b', '\uff5b'), ('\uff5c', '\uff5c'), ('\uff5d', '\uff5d'), ('\uff5e', '\uff5e'), ('\uff5f', '\uff5f'), ('\uff60', '\uff60'), ('\uff61', '\uff61'), ('\uff62', '\uff62'), ('\uff63', '\uff63'), ('\uff64', '\uff65'), ('\uff70', '\uff70'), ('\uff9e', '\uff9f'), ('\uffe0', '\uffe1'), ('\uffe2', '\uffe2'), ('\uffe3', '\uffe3'), ('\uffe4', '\uffe4'), ('\uffe5', '\uffe6'), ('\uffe8', '\uffe8'), ('\uffe9', '\uffec'), ('\uffed', '\uffee'), ('\ufff9', '\ufffb'), ('\ufffc', '\ufffd'), ('\U00010100', '\U00010102'), ('\U00010107', '\U00010133'), ('\U00010137', '\U0001013f'), ('\U00010190', '\U0001019b'), ('\U000101d0', '\U000101fc'), ('\U000102e1', '\U000102fb'), ('\U0001bca0', '\U0001bca3'), ('\U0001d000', '\U0001d0f5'), ('\U0001d100', '\U0001d126'), ('\U0001d129', '\U0001d164'), ('\U0001d165', '\U0001d166'), ('\U0001d16a', '\U0001d16c'), ('\U0001d16d', '\U0001d172'), ('\U0001d173', '\U0001d17a'), ('\U0001d183', '\U0001d184'), ('\U0001d18c', '\U0001d1a9'), ('\U0001d1ae', '\U0001d1dd'), ('\U0001d300', '\U0001d356'), ('\U0001d360', '\U0001d371'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c1', '\U0001d6c1'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6db', '\U0001d6db'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fb', '\U0001d6fb'), ('\U0001d6fc', '\U0001d714'), ('\U0001d715', '\U0001d715'), ('\U0001d716', '\U0001d734'), ('\U0001d735', '\U0001d735'), ('\U0001d736', '\U0001d74e'), ('\U0001d74f', '\U0001d74f'), ('\U0001d750', '\U0001d76e'), ('\U0001d76f', '\U0001d76f'), ('\U0001d770', '\U0001d788'), ('\U0001d789', '\U0001d789'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7a9', '\U0001d7a9'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c3', '\U0001d7c3'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001d7ce', '\U0001d7ff'), ('\U0001f000', '\U0001f02b'), ('\U0001f030', '\U0001f093'), ('\U0001f0a0', '\U0001f0ae'), ('\U0001f0b1', '\U0001f0bf'), ('\U0001f0c1', '\U0001f0cf'), ('\U0001f0d1', '\U0001f0f5'), ('\U0001f100', '\U0001f10c'), ('\U0001f110', '\U0001f12e'), ('\U0001f130', '\U0001f16b'), ('\U0001f170', '\U0001f19a'), ('\U0001f1e6', '\U0001f1ff'), ('\U0001f201', '\U0001f202'), ('\U0001f210', '\U0001f23a'), ('\U0001f240', '\U0001f248'), ('\U0001f250', '\U0001f251'), ('\U0001f300', '\U0001f32c'), ('\U0001f330', '\U0001f37d'), ('\U0001f380', '\U0001f3ce'), ('\U0001f3d4', '\U0001f3f7'), ('\U0001f400', '\U0001f4fe'), ('\U0001f500', '\U0001f54a'), ('\U0001f550', '\U0001f579'), ('\U0001f57b', '\U0001f5a3'), ('\U0001f5a5', '\U0001f642'), ('\U0001f645', '\U0001f6cf'), ('\U0001f6e0', '\U0001f6ec'), ('\U0001f6f0', '\U0001f6f3'), ('\U0001f700', '\U0001f773'), ('\U0001f780', '\U0001f7d4'), ('\U0001f800', '\U0001f80b'), ('\U0001f810', '\U0001f847'), ('\U0001f850', '\U0001f859'), ('\U0001f860', '\U0001f887'), ('\U0001f890', '\U0001f8ad'), ('\U000e0001', '\U000e0001'), ('\U000e0020', '\U000e007f') ]; pub static Coptic_table: &'static [(char, char)] = &[ ('\u03e2', '\u03ef'), ('\u2c80', '\u2ce4'), ('\u2ce5', '\u2cea'), ('\u2ceb', '\u2cee'), ('\u2cef', '\u2cf1'), ('\u2cf2', '\u2cf3'), ('\u2cf9', '\u2cfc'), ('\u2cfd', '\u2cfd'), ('\u2cfe', '\u2cff') ]; pub static Cuneiform_table: &'static [(char, char)] = &[ ('\U00012000', '\U00012398'), ('\U00012400', '\U0001246e'), ('\U00012470', '\U00012474') ]; pub static Cypriot_table: &'static [(char, char)] = &[ ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U0001083f') ]; pub static Cyrillic_table: &'static [(char, char)] = &[ ('\u0400', '\u0481'), ('\u0482', '\u0482'), ('\u0483', '\u0484'), ('\u0487', '\u0487'), ('\u0488', '\u0489'), ('\u048a', '\u052f'), ('\u1d2b', '\u1d2b'), ('\u1d78', '\u1d78'), ('\u2de0', '\u2dff'), ('\ua640', '\ua66d'), ('\ua66e', '\ua66e'), ('\ua66f', '\ua66f'), ('\ua670', '\ua672'), ('\ua673', '\ua673'), ('\ua674', '\ua67d'), ('\ua67e', '\ua67e'), ('\ua67f', '\ua67f'), ('\ua680', '\ua69b'), ('\ua69c', '\ua69d'), ('\ua69f', '\ua69f') ]; pub static Deseret_table: &'static [(char, char)] = &[ ('\U00010400', '\U0001044f') ]; pub static Devanagari_table: &'static [(char, char)] = &[ ('\u0900', '\u0902'), ('\u0903', '\u0903'), ('\u0904', '\u0939'), ('\u093a', '\u093a'), ('\u093b', '\u093b'), ('\u093c', '\u093c'), ('\u093d', '\u093d'), ('\u093e', '\u0940'), ('\u0941', '\u0948'), ('\u0949', '\u094c'), ('\u094d', '\u094d'), ('\u094e', '\u094f'), ('\u0950', '\u0950'), ('\u0953', '\u0957'), ('\u0958', '\u0961'), ('\u0962', '\u0963'), ('\u0966', '\u096f'), ('\u0970', '\u0970'), ('\u0971', '\u0971'), ('\u0972', '\u097f'), ('\ua8e0', '\ua8f1'), ('\ua8f2', '\ua8f7'), ('\ua8f8', '\ua8fa'), ('\ua8fb', '\ua8fb') ]; pub static Duployan_table: &'static [(char, char)] = &[ ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001bc9c', '\U0001bc9c'), ('\U0001bc9d', '\U0001bc9e'), ('\U0001bc9f', '\U0001bc9f') ]; pub static Egyptian_Hieroglyphs_table: &'static [(char, char)] = &[ ('\U00013000', '\U0001342e') ]; pub static Elbasan_table: &'static [(char, char)] = &[ ('\U00010500', '\U00010527') ]; pub static Ethiopic_table: &'static [(char, char)] = &[ ('\u1200', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u135d', '\u135f'), ('\u1360', '\u1368'), ('\u1369', '\u137c'), ('\u1380', '\u138f'), ('\u1390', '\u1399'), ('\u2d80', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e') ]; pub static Georgian_table: &'static [(char, char)] = &[ ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u10fc'), ('\u10fd', '\u10ff'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d') ]; pub static Glagolitic_table: &'static [(char, char)] = &[ ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e') ]; pub static Gothic_table: &'static [(char, char)] = &[ ('\U00010330', '\U00010340'), ('\U00010341', '\U00010341'), ('\U00010342', '\U00010349'), ('\U0001034a', '\U0001034a') ]; pub static Grantha_table: &'static [(char, char)] = &[ ('\U00011301', '\U00011301'), ('\U00011302', '\U00011303'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133c', '\U0001133c'), ('\U0001133d', '\U0001133d'), ('\U0001133e', '\U0001133f'), ('\U00011340', '\U00011340'), ('\U00011341', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134d'), ('\U00011357', '\U00011357'), ('\U0001135d', '\U00011361'), ('\U00011362', '\U00011363'), ('\U00011366', '\U0001136c'), ('\U00011370', '\U00011374') ]; pub static Greek_table: &'static [(char, char)] = &[ ('\u0370', '\u0373'), ('\u0375', '\u0375'), ('\u0376', '\u0377'), ('\u037a', '\u037a'), ('\u037b', '\u037d'), ('\u037f', '\u037f'), ('\u0384', '\u0384'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03e1'), ('\u03f0', '\u03f5'), ('\u03f6', '\u03f6'), ('\u03f7', '\u03ff'), ('\u1d26', '\u1d2a'), ('\u1d5d', '\u1d61'), ('\u1d66', '\u1d6a'), ('\u1dbf', '\u1dbf'), ('\u1f00', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbd', '\u1fbd'), ('\u1fbe', '\u1fbe'), ('\u1fbf', '\u1fc1'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fcd', '\u1fcf'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fdd', '\u1fdf'), ('\u1fe0', '\u1fec'), ('\u1fed', '\u1fef'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u1ffd', '\u1ffe'), ('\u2126', '\u2126'), ('\uab65', '\uab65'), ('\U00010140', '\U00010174'), ('\U00010175', '\U00010178'), ('\U00010179', '\U00010189'), ('\U0001018a', '\U0001018b'), ('\U0001018c', '\U0001018c'), ('\U000101a0', '\U000101a0'), ('\U0001d200', '\U0001d241'), ('\U0001d242', '\U0001d244'), ('\U0001d245', '\U0001d245') ]; pub static Gujarati_table: &'static [(char, char)] = &[ ('\u0a81', '\u0a82'), ('\u0a83', '\u0a83'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abc', '\u0abc'), ('\u0abd', '\u0abd'), ('\u0abe', '\u0ac0'), ('\u0ac1', '\u0ac5'), ('\u0ac7', '\u0ac8'), ('\u0ac9', '\u0ac9'), ('\u0acb', '\u0acc'), ('\u0acd', '\u0acd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae1'), ('\u0ae2', '\u0ae3'), ('\u0ae6', '\u0aef'), ('\u0af0', '\u0af0'), ('\u0af1', '\u0af1') ]; pub static Gurmukhi_table: &'static [(char, char)] = &[ ('\u0a01', '\u0a02'), ('\u0a03', '\u0a03'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a3c', '\u0a3c'), ('\u0a3e', '\u0a40'), ('\u0a41', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4d'), ('\u0a51', '\u0a51'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a66', '\u0a6f'), ('\u0a70', '\u0a71'), ('\u0a72', '\u0a74'), ('\u0a75', '\u0a75') ]; pub static Han_table: &'static [(char, char)] = &[ ('\u2e80', '\u2e99'), ('\u2e9b', '\u2ef3'), ('\u2f00', '\u2fd5'), ('\u3005', '\u3005'), ('\u3007', '\u3007'), ('\u3021', '\u3029'), ('\u3038', '\u303a'), ('\u303b', '\u303b'), ('\u3400', '\u4db5'), ('\u4e00', '\u9fcc'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\U00020000', '\U0002a6d6'), ('\U0002a700', '\U0002b734'), ('\U0002b740', '\U0002b81d'), ('\U0002f800', '\U0002fa1d') ]; pub static Hangul_table: &'static [(char, char)] = &[ ('\u1100', '\u11ff'), ('\u302e', '\u302f'), ('\u3131', '\u318e'), ('\u3200', '\u321e'), ('\u3260', '\u327e'), ('\ua960', '\ua97c'), ('\uac00', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uffa0', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc') ]; pub static Hanunoo_table: &'static [(char, char)] = &[ ('\u1720', '\u1731'), ('\u1732', '\u1734') ]; pub static Hebrew_table: &'static [(char, char)] = &[ ('\u0591', '\u05bd'), ('\u05be', '\u05be'), ('\u05bf', '\u05bf'), ('\u05c0', '\u05c0'), ('\u05c1', '\u05c2'), ('\u05c3', '\u05c3'), ('\u05c4', '\u05c5'), ('\u05c6', '\u05c6'), ('\u05c7', '\u05c7'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u05f3', '\u05f4'), ('\ufb1d', '\ufb1d'), ('\ufb1e', '\ufb1e'), ('\ufb1f', '\ufb28'), ('\ufb29', '\ufb29'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufb4f') ]; pub static Hiragana_table: &'static [(char, char)] = &[ ('\u3041', '\u3096'), ('\u309d', '\u309e'), ('\u309f', '\u309f'), ('\U0001b001', '\U0001b001'), ('\U0001f200', '\U0001f200') ]; pub static Imperial_Aramaic_table: &'static [(char, char)] = &[ ('\U00010840', '\U00010855'), ('\U00010857', '\U00010857'), ('\U00010858', '\U0001085f') ]; pub static Inherited_table: &'static [(char, char)] = &[ ('\u0300', '\u036f'), ('\u0485', '\u0486'), ('\u064b', '\u0655'), ('\u0670', '\u0670'), ('\u0951', '\u0952'), ('\u1ab0', '\u1abd'), ('\u1abe', '\u1abe'), ('\u1cd0', '\u1cd2'), ('\u1cd4', '\u1ce0'), ('\u1ce2', '\u1ce8'), ('\u1ced', '\u1ced'), ('\u1cf4', '\u1cf4'), ('\u1cf8', '\u1cf9'), ('\u1dc0', '\u1df5'), ('\u1dfc', '\u1dff'), ('\u200c', '\u200d'), ('\u20d0', '\u20dc'), ('\u20dd', '\u20e0'), ('\u20e1', '\u20e1'), ('\u20e2', '\u20e4'), ('\u20e5', '\u20f0'), ('\u302a', '\u302d'), ('\u3099', '\u309a'), ('\ufe00', '\ufe0f'), ('\ufe20', '\ufe2d'), ('\U000101fd', '\U000101fd'), ('\U000102e0', '\U000102e0'), ('\U0001d167', '\U0001d169'), ('\U0001d17b', '\U0001d182'), ('\U0001d185', '\U0001d18b'), ('\U0001d1aa', '\U0001d1ad'), ('\U000e0100', '\U000e01ef') ]; pub static Inscriptional_Pahlavi_table: &'static [(char, char)] = &[ ('\U00010b60', '\U00010b72'), ('\U00010b78', '\U00010b7f') ]; pub static Inscriptional_Parthian_table: &'static [(char, char)] = &[ ('\U00010b40', '\U00010b55'), ('\U00010b58', '\U00010b5f') ]; pub static Javanese_table: &'static [(char, char)] = &[ ('\ua980', '\ua982'), ('\ua983', '\ua983'), ('\ua984', '\ua9b2'), ('\ua9b3', '\ua9b3'), ('\ua9b4', '\ua9b5'), ('\ua9b6', '\ua9b9'), ('\ua9ba', '\ua9bb'), ('\ua9bc', '\ua9bc'), ('\ua9bd', '\ua9c0'), ('\ua9c1', '\ua9cd'), ('\ua9d0', '\ua9d9'), ('\ua9de', '\ua9df') ]; pub static Kaithi_table: &'static [(char, char)] = &[ ('\U00011080', '\U00011081'), ('\U00011082', '\U00011082'), ('\U00011083', '\U000110af'), ('\U000110b0', '\U000110b2'), ('\U000110b3', '\U000110b6'), ('\U000110b7', '\U000110b8'), ('\U000110b9', '\U000110ba'), ('\U000110bb', '\U000110bc'), ('\U000110bd', '\U000110bd'), ('\U000110be', '\U000110c1') ]; pub static Kannada_table: &'static [(char, char)] = &[ ('\u0c81', '\u0c81'), ('\u0c82', '\u0c83'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbc', '\u0cbc'), ('\u0cbd', '\u0cbd'), ('\u0cbe', '\u0cbe'), ('\u0cbf', '\u0cbf'), ('\u0cc0', '\u0cc4'), ('\u0cc6', '\u0cc6'), ('\u0cc7', '\u0cc8'), ('\u0cca', '\u0ccb'), ('\u0ccc', '\u0ccd'), ('\u0cd5', '\u0cd6'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce1'), ('\u0ce2', '\u0ce3'), ('\u0ce6', '\u0cef'), ('\u0cf1', '\u0cf2') ]; pub static Katakana_table: &'static [(char, char)] = &[ ('\u30a1', '\u30fa'), ('\u30fd', '\u30fe'), ('\u30ff', '\u30ff'), ('\u31f0', '\u31ff'), ('\u32d0', '\u32fe'), ('\u3300', '\u3357'), ('\uff66', '\uff6f'), ('\uff71', '\uff9d'), ('\U0001b000', '\U0001b000') ]; pub static Kayah_Li_table: &'static [(char, char)] = &[ ('\ua900', '\ua909'), ('\ua90a', '\ua925'), ('\ua926', '\ua92d'), ('\ua92f', '\ua92f') ]; pub static Kharoshthi_table: &'static [(char, char)] = &[ ('\U00010a00', '\U00010a00'), ('\U00010a01', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a0f'), ('\U00010a10', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a38', '\U00010a3a'), ('\U00010a3f', '\U00010a3f'), ('\U00010a40', '\U00010a47'), ('\U00010a50', '\U00010a58') ]; pub static Khmer_table: &'static [(char, char)] = &[ ('\u1780', '\u17b3'), ('\u17b4', '\u17b5'), ('\u17b6', '\u17b6'), ('\u17b7', '\u17bd'), ('\u17be', '\u17c5'), ('\u17c6', '\u17c6'), ('\u17c7', '\u17c8'), ('\u17c9', '\u17d3'), ('\u17d4', '\u17d6'), ('\u17d7', '\u17d7'), ('\u17d8', '\u17da'), ('\u17db', '\u17db'), ('\u17dc', '\u17dc'), ('\u17dd', '\u17dd'), ('\u17e0', '\u17e9'), ('\u17f0', '\u17f9'), ('\u19e0', '\u19ff') ]; pub static Khojki_table: &'static [(char, char)] = &[ ('\U00011200', '\U00011211'), ('\U00011213', '\U0001122b'), ('\U0001122c', '\U0001122e'), ('\U0001122f', '\U00011231'), ('\U00011232', '\U00011233'), ('\U00011234', '\U00011234'), ('\U00011235', '\U00011235'), ('\U00011236', '\U00011237'), ('\U00011238', '\U0001123d') ]; pub static Khudawadi_table: &'static [(char, char)] = &[ ('\U000112b0', '\U000112de'), ('\U000112df', '\U000112df'), ('\U000112e0', '\U000112e2'), ('\U000112e3', '\U000112ea'), ('\U000112f0', '\U000112f9') ]; pub static Lao_table: &'static [(char, char)] = &[ ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb0'), ('\u0eb1', '\u0eb1'), ('\u0eb2', '\u0eb3'), ('\u0eb4', '\u0eb9'), ('\u0ebb', '\u0ebc'), ('\u0ebd', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0ec8', '\u0ecd'), ('\u0ed0', '\u0ed9'), ('\u0edc', '\u0edf') ]; pub static Latin_table: &'static [(char, char)] = &[ ('\x41', '\x5a'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u01ba'), ('\u01bb', '\u01bb'), ('\u01bc', '\u01bf'), ('\u01c0', '\u01c3'), ('\u01c4', '\u0293'), ('\u0294', '\u0294'), ('\u0295', '\u02af'), ('\u02b0', '\u02b8'), ('\u02e0', '\u02e4'), ('\u1d00', '\u1d25'), ('\u1d2c', '\u1d5c'), ('\u1d62', '\u1d65'), ('\u1d6b', '\u1d77'), ('\u1d79', '\u1d9a'), ('\u1d9b', '\u1dbe'), ('\u1e00', '\u1eff'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u212a', '\u212b'), ('\u2132', '\u2132'), ('\u214e', '\u214e'), ('\u2160', '\u2182'), ('\u2183', '\u2184'), ('\u2185', '\u2188'), ('\u2c60', '\u2c7b'), ('\u2c7c', '\u2c7d'), ('\u2c7e', '\u2c7f'), ('\ua722', '\ua76f'), ('\ua770', '\ua770'), ('\ua771', '\ua787'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua7f7'), ('\ua7f8', '\ua7f9'), ('\ua7fa', '\ua7fa'), ('\ua7fb', '\ua7ff'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab64'), ('\ufb00', '\ufb06'), ('\uff21', '\uff3a'), ('\uff41', '\uff5a') ]; pub static Lepcha_table: &'static [(char, char)] = &[ ('\u1c00', '\u1c23'), ('\u1c24', '\u1c2b'), ('\u1c2c', '\u1c33'), ('\u1c34', '\u1c35'), ('\u1c36', '\u1c37'), ('\u1c3b', '\u1c3f'), ('\u1c40', '\u1c49'), ('\u1c4d', '\u1c4f') ]; pub static Limbu_table: &'static [(char, char)] = &[ ('\u1900', '\u191e'), ('\u1920', '\u1922'), ('\u1923', '\u1926'), ('\u1927', '\u1928'), ('\u1929', '\u192b'), ('\u1930', '\u1931'), ('\u1932', '\u1932'), ('\u1933', '\u1938'), ('\u1939', '\u193b'), ('\u1940', '\u1940'), ('\u1944', '\u1945'), ('\u1946', '\u194f') ]; pub static Linear_A_table: &'static [(char, char)] = &[ ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767') ]; pub static Linear_B_table: &'static [(char, char)] = &[ ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa') ]; pub static Lisu_table: &'static [(char, char)] = &[ ('\ua4d0', '\ua4f7'), ('\ua4f8', '\ua4fd'), ('\ua4fe', '\ua4ff') ]; pub static Lycian_table: &'static [(char, char)] = &[ ('\U00010280', '\U0001029c') ]; pub static Lydian_table: &'static [(char, char)] = &[ ('\U00010920', '\U00010939'), ('\U0001093f', '\U0001093f') ]; pub static Mahajani_table: &'static [(char, char)] = &[ ('\U00011150', '\U00011172'), ('\U00011173', '\U00011173'), ('\U00011174', '\U00011175'), ('\U00011176', '\U00011176') ]; pub static Malayalam_table: &'static [(char, char)] = &[ ('\u0d01', '\u0d01'), ('\u0d02', '\u0d03'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d3d'), ('\u0d3e', '\u0d40'), ('\u0d41', '\u0d44'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4c'), ('\u0d4d', '\u0d4d'), ('\u0d4e', '\u0d4e'), ('\u0d57', '\u0d57'), ('\u0d60', '\u0d61'), ('\u0d62', '\u0d63'), ('\u0d66', '\u0d6f'), ('\u0d70', '\u0d75'), ('\u0d79', '\u0d79'), ('\u0d7a', '\u0d7f') ]; pub static Mandaic_table: &'static [(char, char)] = &[ ('\u0840', '\u0858'), ('\u0859', '\u085b'), ('\u085e', '\u085e') ]; pub static Manichaean_table: &'static [(char, char)] = &[ ('\U00010ac0', '\U00010ac7'), ('\U00010ac8', '\U00010ac8'), ('\U00010ac9', '\U00010ae4'), ('\U00010ae5', '\U00010ae6'), ('\U00010aeb', '\U00010aef'), ('\U00010af0', '\U00010af6') ]; pub static Meetei_Mayek_table: &'static [(char, char)] = &[ ('\uaae0', '\uaaea'), ('\uaaeb', '\uaaeb'), ('\uaaec', '\uaaed'), ('\uaaee', '\uaaef'), ('\uaaf0', '\uaaf1'), ('\uaaf2', '\uaaf2'), ('\uaaf3', '\uaaf4'), ('\uaaf5', '\uaaf5'), ('\uaaf6', '\uaaf6'), ('\uabc0', '\uabe2'), ('\uabe3', '\uabe4'), ('\uabe5', '\uabe5'), ('\uabe6', '\uabe7'), ('\uabe8', '\uabe8'), ('\uabe9', '\uabea'), ('\uabeb', '\uabeb'), ('\uabec', '\uabec'), ('\uabed', '\uabed'), ('\uabf0', '\uabf9') ]; pub static Mende_Kikakui_table: &'static [(char, char)] = &[ ('\U0001e800', '\U0001e8c4'), ('\U0001e8c7', '\U0001e8cf'), ('\U0001e8d0', '\U0001e8d6') ]; pub static Meroitic_Cursive_table: &'static [(char, char)] = &[ ('\U000109a0', '\U000109b7'), ('\U000109be', '\U000109bf') ]; pub static Meroitic_Hieroglyphs_table: &'static [(char, char)] = &[ ('\U00010980', '\U0001099f') ]; pub static Miao_table: &'static [(char, char)] = &[ ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f50'), ('\U00016f51', '\U00016f7e'), ('\U00016f8f', '\U00016f92'), ('\U00016f93', '\U00016f9f') ]; pub static Modi_table: &'static [(char, char)] = &[ ('\U00011600', '\U0001162f'), ('\U00011630', '\U00011632'), ('\U00011633', '\U0001163a'), ('\U0001163b', '\U0001163c'), ('\U0001163d', '\U0001163d'), ('\U0001163e', '\U0001163e'), ('\U0001163f', '\U00011640'), ('\U00011641', '\U00011643'), ('\U00011644', '\U00011644'), ('\U00011650', '\U00011659') ]; pub static Mongolian_table: &'static [(char, char)] = &[ ('\u1800', '\u1801'), ('\u1804', '\u1804'), ('\u1806', '\u1806'), ('\u1807', '\u180a'), ('\u180b', '\u180d'), ('\u180e', '\u180e'), ('\u1810', '\u1819'), ('\u1820', '\u1842'), ('\u1843', '\u1843'), ('\u1844', '\u1877'), ('\u1880', '\u18a8'), ('\u18a9', '\u18a9'), ('\u18aa', '\u18aa') ]; pub static Mro_table: &'static [(char, char)] = &[ ('\U00016a40', '\U00016a5e'), ('\U00016a60', '\U00016a69'), ('\U00016a6e', '\U00016a6f') ]; pub static Myanmar_table: &'static [(char, char)] = &[ ('\u1000', '\u102a'), ('\u102b', '\u102c'), ('\u102d', '\u1030'), ('\u1031', '\u1031'), ('\u1032', '\u1037'), ('\u1038', '\u1038'), ('\u1039', '\u103a'), ('\u103b', '\u103c'), ('\u103d', '\u103e'), ('\u103f', '\u103f'), ('\u1040', '\u1049'), ('\u104a', '\u104f'), ('\u1050', '\u1055'), ('\u1056', '\u1057'), ('\u1058', '\u1059'), ('\u105a', '\u105d'), ('\u105e', '\u1060'), ('\u1061', '\u1061'), ('\u1062', '\u1064'), ('\u1065', '\u1066'), ('\u1067', '\u106d'), ('\u106e', '\u1070'), ('\u1071', '\u1074'), ('\u1075', '\u1081'), ('\u1082', '\u1082'), ('\u1083', '\u1084'), ('\u1085', '\u1086'), ('\u1087', '\u108c'), ('\u108d', '\u108d'), ('\u108e', '\u108e'), ('\u108f', '\u108f'), ('\u1090', '\u1099'), ('\u109a', '\u109c'), ('\u109d', '\u109d'), ('\u109e', '\u109f'), ('\ua9e0', '\ua9e4'), ('\ua9e5', '\ua9e5'), ('\ua9e6', '\ua9e6'), ('\ua9e7', '\ua9ef'), ('\ua9f0', '\ua9f9'), ('\ua9fa', '\ua9fe'), ('\uaa60', '\uaa6f'), ('\uaa70', '\uaa70'), ('\uaa71', '\uaa76'), ('\uaa77', '\uaa79'), ('\uaa7a', '\uaa7a'), ('\uaa7b', '\uaa7b'), ('\uaa7c', '\uaa7c'), ('\uaa7d', '\uaa7d'), ('\uaa7e', '\uaa7f') ]; pub static Nabataean_table: &'static [(char, char)] = &[ ('\U00010880', '\U0001089e'), ('\U000108a7', '\U000108af') ]; pub static New_Tai_Lue_table: &'static [(char, char)] = &[ ('\u1980', '\u19ab'), ('\u19b0', '\u19c0'), ('\u19c1', '\u19c7'), ('\u19c8', '\u19c9'), ('\u19d0', '\u19d9'), ('\u19da', '\u19da'), ('\u19de', '\u19df') ]; pub static Nko_table: &'static [(char, char)] = &[ ('\u07c0', '\u07c9'), ('\u07ca', '\u07ea'), ('\u07eb', '\u07f3'), ('\u07f4', '\u07f5'), ('\u07f6', '\u07f6'), ('\u07f7', '\u07f9'), ('\u07fa', '\u07fa') ]; pub static Ogham_table: &'static [(char, char)] = &[ ('\u1680', '\u1680'), ('\u1681', '\u169a'), ('\u169b', '\u169b'), ('\u169c', '\u169c') ]; pub static Ol_Chiki_table: &'static [(char, char)] = &[ ('\u1c50', '\u1c59'), ('\u1c5a', '\u1c77'), ('\u1c78', '\u1c7d'), ('\u1c7e', '\u1c7f') ]; pub static Old_Italic_table: &'static [(char, char)] = &[ ('\U00010300', '\U0001031f'), ('\U00010320', '\U00010323') ]; pub static Old_North_Arabian_table: &'static [(char, char)] = &[ ('\U00010a80', '\U00010a9c'), ('\U00010a9d', '\U00010a9f') ]; pub static Old_Permic_table: &'static [(char, char)] = &[ ('\U00010350', '\U00010375'), ('\U00010376', '\U0001037a') ]; pub static Old_Persian_table: &'static [(char, char)] = &[ ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U000103d0', '\U000103d0'), ('\U000103d1', '\U000103d5') ]; pub static Old_South_Arabian_table: &'static [(char, char)] = &[ ('\U00010a60', '\U00010a7c'), ('\U00010a7d', '\U00010a7e'), ('\U00010a7f', '\U00010a7f') ]; pub static Old_Turkic_table: &'static [(char, char)] = &[ ('\U00010c00', '\U00010c48') ]; pub static Oriya_table: &'static [(char, char)] = &[ ('\u0b01', '\u0b01'), ('\u0b02', '\u0b03'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3c', '\u0b3c'), ('\u0b3d', '\u0b3d'), ('\u0b3e', '\u0b3e'), ('\u0b3f', '\u0b3f'), ('\u0b40', '\u0b40'), ('\u0b41', '\u0b44'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4c'), ('\u0b4d', '\u0b4d'), ('\u0b56', '\u0b56'), ('\u0b57', '\u0b57'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b61'), ('\u0b62', '\u0b63'), ('\u0b66', '\u0b6f'), ('\u0b70', '\u0b70'), ('\u0b71', '\u0b71'), ('\u0b72', '\u0b77') ]; pub static Osmanya_table: &'static [(char, char)] = &[ ('\U00010480', '\U0001049d'), ('\U000104a0', '\U000104a9') ]; pub static Pahawh_Hmong_table: &'static [(char, char)] = &[ ('\U00016b00', '\U00016b2f'), ('\U00016b30', '\U00016b36'), ('\U00016b37', '\U00016b3b'), ('\U00016b3c', '\U00016b3f'), ('\U00016b40', '\U00016b43'), ('\U00016b44', '\U00016b44'), ('\U00016b45', '\U00016b45'), ('\U00016b50', '\U00016b59'), ('\U00016b5b', '\U00016b61'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f') ]; pub static Palmyrene_table: &'static [(char, char)] = &[ ('\U00010860', '\U00010876'), ('\U00010877', '\U00010878'), ('\U00010879', '\U0001087f') ]; pub static Pau_Cin_Hau_table: &'static [(char, char)] = &[ ('\U00011ac0', '\U00011af8') ]; pub static Phags_Pa_table: &'static [(char, char)] = &[ ('\ua840', '\ua873'), ('\ua874', '\ua877') ]; pub static Phoenician_table: &'static [(char, char)] = &[ ('\U00010900', '\U00010915'), ('\U00010916', '\U0001091b'), ('\U0001091f', '\U0001091f') ]; pub static Psalter_Pahlavi_table: &'static [(char, char)] = &[ ('\U00010b80', '\U00010b91'), ('\U00010b99', '\U00010b9c'), ('\U00010ba9', '\U00010baf') ]; pub static Rejang_table: &'static [(char, char)] = &[ ('\ua930', '\ua946'), ('\ua947', '\ua951'), ('\ua952', '\ua953'), ('\ua95f', '\ua95f') ]; pub static Runic_table: &'static [(char, char)] = &[ ('\u16a0', '\u16ea'), ('\u16ee', '\u16f0'), ('\u16f1', '\u16f8') ]; pub static Samaritan_table: &'static [(char, char)] = &[ ('\u0800', '\u0815'), ('\u0816', '\u0819'), ('\u081a', '\u081a'), ('\u081b', '\u0823'), ('\u0824', '\u0824'), ('\u0825', '\u0827'), ('\u0828', '\u0828'), ('\u0829', '\u082d'), ('\u0830', '\u083e') ]; pub static Saurashtra_table: &'static [(char, char)] = &[ ('\ua880', '\ua881'), ('\ua882', '\ua8b3'), ('\ua8b4', '\ua8c3'), ('\ua8c4', '\ua8c4'), ('\ua8ce', '\ua8cf'), ('\ua8d0', '\ua8d9') ]; pub static Sharada_table: &'static [(char, char)] = &[ ('\U00011180', '\U00011181'), ('\U00011182', '\U00011182'), ('\U00011183', '\U000111b2'), ('\U000111b3', '\U000111b5'), ('\U000111b6', '\U000111be'), ('\U000111bf', '\U000111c0'), ('\U000111c1', '\U000111c4'), ('\U000111c5', '\U000111c8'), ('\U000111cd', '\U000111cd'), ('\U000111d0', '\U000111d9'), ('\U000111da', '\U000111da') ]; pub static Shavian_table: &'static [(char, char)] = &[ ('\U00010450', '\U0001047f') ]; pub static Siddham_table: &'static [(char, char)] = &[ ('\U00011580', '\U000115ae'), ('\U000115af', '\U000115b1'), ('\U000115b2', '\U000115b5'), ('\U000115b8', '\U000115bb'), ('\U000115bc', '\U000115bd'), ('\U000115be', '\U000115be'), ('\U000115bf', '\U000115c0'), ('\U000115c1', '\U000115c9') ]; pub static Sinhala_table: &'static [(char, char)] = &[ ('\u0d82', '\u0d83'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0dca', '\u0dca'), ('\u0dcf', '\u0dd1'), ('\u0dd2', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0dd8', '\u0ddf'), ('\u0de6', '\u0def'), ('\u0df2', '\u0df3'), ('\u0df4', '\u0df4'), ('\U000111e1', '\U000111f4') ]; pub static Sora_Sompeng_table: &'static [(char, char)] = &[ ('\U000110d0', '\U000110e8'), ('\U000110f0', '\U000110f9') ]; pub static Sundanese_table: &'static [(char, char)] = &[ ('\u1b80', '\u1b81'), ('\u1b82', '\u1b82'), ('\u1b83', '\u1ba0'), ('\u1ba1', '\u1ba1'), ('\u1ba2', '\u1ba5'), ('\u1ba6', '\u1ba7'), ('\u1ba8', '\u1ba9'), ('\u1baa', '\u1baa'), ('\u1bab', '\u1bad'), ('\u1bae', '\u1baf'), ('\u1bb0', '\u1bb9'), ('\u1bba', '\u1bbf'), ('\u1cc0', '\u1cc7') ]; pub static Syloti_Nagri_table: &'static [(char, char)] = &[ ('\ua800', '\ua801'), ('\ua802', '\ua802'), ('\ua803', '\ua805'), ('\ua806', '\ua806'), ('\ua807', '\ua80a'), ('\ua80b', '\ua80b'), ('\ua80c', '\ua822'), ('\ua823', '\ua824'), ('\ua825', '\ua826'), ('\ua827', '\ua827'), ('\ua828', '\ua82b') ]; pub static Syriac_table: &'static [(char, char)] = &[ ('\u0700', '\u070d'), ('\u070f', '\u070f'), ('\u0710', '\u0710'), ('\u0711', '\u0711'), ('\u0712', '\u072f'), ('\u0730', '\u074a'), ('\u074d', '\u074f') ]; pub static Tagalog_table: &'static [(char, char)] = &[ ('\u1700', '\u170c'), ('\u170e', '\u1711'), ('\u1712', '\u1714') ]; pub static Tagbanwa_table: &'static [(char, char)] = &[ ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1772', '\u1773') ]; pub static Tai_Le_table: &'static [(char, char)] = &[ ('\u1950', '\u196d'), ('\u1970', '\u1974') ]; pub static Tai_Tham_table: &'static [(char, char)] = &[ ('\u1a20', '\u1a54'), ('\u1a55', '\u1a55'), ('\u1a56', '\u1a56'), ('\u1a57', '\u1a57'), ('\u1a58', '\u1a5e'), ('\u1a60', '\u1a60'), ('\u1a61', '\u1a61'), ('\u1a62', '\u1a62'), ('\u1a63', '\u1a64'), ('\u1a65', '\u1a6c'), ('\u1a6d', '\u1a72'), ('\u1a73', '\u1a7c'), ('\u1a7f', '\u1a7f'), ('\u1a80', '\u1a89'), ('\u1a90', '\u1a99'), ('\u1aa0', '\u1aa6'), ('\u1aa7', '\u1aa7'), ('\u1aa8', '\u1aad') ]; pub static Tai_Viet_table: &'static [(char, char)] = &[ ('\uaa80', '\uaaaf'), ('\uaab0', '\uaab0'), ('\uaab1', '\uaab1'), ('\uaab2', '\uaab4'), ('\uaab5', '\uaab6'), ('\uaab7', '\uaab8'), ('\uaab9', '\uaabd'), ('\uaabe', '\uaabf'), ('\uaac0', '\uaac0'), ('\uaac1', '\uaac1'), ('\uaac2', '\uaac2'), ('\uaadb', '\uaadc'), ('\uaadd', '\uaadd'), ('\uaade', '\uaadf') ]; pub static Takri_table: &'static [(char, char)] = &[ ('\U00011680', '\U000116aa'), ('\U000116ab', '\U000116ab'), ('\U000116ac', '\U000116ac'), ('\U000116ad', '\U000116ad'), ('\U000116ae', '\U000116af'), ('\U000116b0', '\U000116b5'), ('\U000116b6', '\U000116b6'), ('\U000116b7', '\U000116b7'), ('\U000116c0', '\U000116c9') ]; pub static Tamil_table: &'static [(char, char)] = &[ ('\u0b82', '\u0b82'), ('\u0b83', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bbe', '\u0bbf'), ('\u0bc0', '\u0bc0'), ('\u0bc1', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcc'), ('\u0bcd', '\u0bcd'), ('\u0bd0', '\u0bd0'), ('\u0bd7', '\u0bd7'), ('\u0be6', '\u0bef'), ('\u0bf0', '\u0bf2'), ('\u0bf3', '\u0bf8'), ('\u0bf9', '\u0bf9'), ('\u0bfa', '\u0bfa') ]; pub static Telugu_table: &'static [(char, char)] = &[ ('\u0c00', '\u0c00'), ('\u0c01', '\u0c03'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c3d'), ('\u0c3e', '\u0c40'), ('\u0c41', '\u0c44'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4d'), ('\u0c55', '\u0c56'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c61'), ('\u0c62', '\u0c63'), ('\u0c66', '\u0c6f'), ('\u0c78', '\u0c7e'), ('\u0c7f', '\u0c7f') ]; pub static Thaana_table: &'static [(char, char)] = &[ ('\u0780', '\u07a5'), ('\u07a6', '\u07b0'), ('\u07b1', '\u07b1') ]; pub static Thai_table: &'static [(char, char)] = &[ ('\u0e01', '\u0e30'), ('\u0e31', '\u0e31'), ('\u0e32', '\u0e33'), ('\u0e34', '\u0e3a'), ('\u0e40', '\u0e45'), ('\u0e46', '\u0e46'), ('\u0e47', '\u0e4e'), ('\u0e4f', '\u0e4f'), ('\u0e50', '\u0e59'), ('\u0e5a', '\u0e5b') ]; pub static Tibetan_table: &'static [(char, char)] = &[ ('\u0f00', '\u0f00'), ('\u0f01', '\u0f03'), ('\u0f04', '\u0f12'), ('\u0f13', '\u0f13'), ('\u0f14', '\u0f14'), ('\u0f15', '\u0f17'), ('\u0f18', '\u0f19'), ('\u0f1a', '\u0f1f'), ('\u0f20', '\u0f29'), ('\u0f2a', '\u0f33'), ('\u0f34', '\u0f34'), ('\u0f35', '\u0f35'), ('\u0f36', '\u0f36'), ('\u0f37', '\u0f37'), ('\u0f38', '\u0f38'), ('\u0f39', '\u0f39'), ('\u0f3a', '\u0f3a'), ('\u0f3b', '\u0f3b'), ('\u0f3c', '\u0f3c'), ('\u0f3d', '\u0f3d'), ('\u0f3e', '\u0f3f'), ('\u0f40', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f71', '\u0f7e'), ('\u0f7f', '\u0f7f'), ('\u0f80', '\u0f84'), ('\u0f85', '\u0f85'), ('\u0f86', '\u0f87'), ('\u0f88', '\u0f8c'), ('\u0f8d', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u0fbe', '\u0fc5'), ('\u0fc6', '\u0fc6'), ('\u0fc7', '\u0fcc'), ('\u0fce', '\u0fcf'), ('\u0fd0', '\u0fd4'), ('\u0fd9', '\u0fda') ]; pub static Tifinagh_table: &'static [(char, char)] = &[ ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d70', '\u2d70'), ('\u2d7f', '\u2d7f') ]; pub static Tirhuta_table: &'static [(char, char)] = &[ ('\U00011480', '\U000114af'), ('\U000114b0', '\U000114b2'), ('\U000114b3', '\U000114b8'), ('\U000114b9', '\U000114b9'), ('\U000114ba', '\U000114ba'), ('\U000114bb', '\U000114be'), ('\U000114bf', '\U000114c0'), ('\U000114c1', '\U000114c1'), ('\U000114c2', '\U000114c3'), ('\U000114c4', '\U000114c5'), ('\U000114c6', '\U000114c6'), ('\U000114c7', '\U000114c7'), ('\U000114d0', '\U000114d9') ]; pub static Ugaritic_table: &'static [(char, char)] = &[ ('\U00010380', '\U0001039d'), ('\U0001039f', '\U0001039f') ]; pub static Vai_table: &'static [(char, char)] = &[ ('\ua500', '\ua60b'), ('\ua60c', '\ua60c'), ('\ua60d', '\ua60f'), ('\ua610', '\ua61f'), ('\ua620', '\ua629'), ('\ua62a', '\ua62b') ]; pub static Warang_Citi_table: &'static [(char, char)] = &[ ('\U000118a0', '\U000118df'), ('\U000118e0', '\U000118e9'), ('\U000118ea', '\U000118f2'), ('\U000118ff', '\U000118ff') ]; pub static Yi_table: &'static [(char, char)] = &[ ('\ua000', '\ua014'), ('\ua015', '\ua015'), ('\ua016', '\ua48c'), ('\ua490', '\ua4c6') ]; } pub mod property { pub static Join_Control_table: &'static [(char, char)] = &[ ('\u200c', '\u200d') ]; pub static Noncharacter_Code_Point_table: &'static [(char, char)] = &[ ('\ufdd0', '\ufdef'), ('\ufffe', '\uffff'), ('\U0001fffe', '\U0001ffff'), ('\U0002fffe', '\U0002ffff'), ('\U0003fffe', '\U0003ffff'), ('\U0004fffe', '\U0004ffff'), ('\U0005fffe', '\U0005ffff'), ('\U0006fffe', '\U0006ffff'), ('\U0007fffe', '\U0007ffff'), ('\U0008fffe', '\U0008ffff'), ('\U0009fffe', '\U0009ffff'), ('\U000afffe', '\U000affff'), ('\U000bfffe', '\U000bffff'), ('\U000cfffe', '\U000cffff'), ('\U000dfffe', '\U000dffff'), ('\U000efffe', '\U000effff'), ('\U000ffffe', '\U000fffff') ]; pub static White_Space_table: &'static [(char, char)] = &[ ('\x09', '\x0d'), ('\x20', '\x20'), ('\u0085', '\u0085'), ('\u00a0', '\u00a0'), ('\u1680', '\u1680'), ('\u2000', '\u200a'), ('\u2028', '\u2028'), ('\u2029', '\u2029'), ('\u202f', '\u202f'), ('\u205f', '\u205f'), ('\u3000', '\u3000') ]; pub fn White_Space(c: char) -> bool { super::bsearch_range_table(c, White_Space_table) } } pub mod regex { pub static UNICODE_CLASSES: &'static [(&'static str, &'static &'static [(char, char)])] = &[ ("Alphabetic", &super::derived_property::Alphabetic_table), ("Arabic", &super::script::Arabic_table), ("Armenian", &super::script::Armenian_table), ("Avestan", &super::script::Avestan_table), ("Balinese", &super::script::Balinese_table), ("Bamum", &super::script::Bamum_table), ("Bassa_Vah", &super::script::Bassa_Vah_table), ("Batak", &super::script::Batak_table), ("Bengali", &super::script::Bengali_table), ("Bopomofo", &super::script::Bopomofo_table), ("Brahmi", &super::script::Brahmi_table), ("Braille", &super::script::Braille_table), ("Buginese", &super::script::Buginese_table), ("Buhid", &super::script::Buhid_table), ("C", &super::general_category::C_table), ("Canadian_Aboriginal", &super::script::Canadian_Aboriginal_table), ("Carian", &super::script::Carian_table), ("Caucasian_Albanian", &super::script::Caucasian_Albanian_table), ("Cc", &super::general_category::Cc_table), ("Cf", &super::general_category::Cf_table), ("Chakma", &super::script::Chakma_table), ("Cham", &super::script::Cham_table), ("Cherokee", &super::script::Cherokee_table), ("Cn", &super::general_category::Cn_table), ("Co", &super::general_category::Co_table), ("Common", &super::script::Common_table), ("Coptic", &super::script::Coptic_table), ("Cuneiform", &super::script::Cuneiform_table), ("Cypriot", &super::script::Cypriot_table), ("Cyrillic", &super::script::Cyrillic_table), ("Default_Ignorable_Code_Point", &super::derived_property::Default_Ignorable_Code_Point_table), ("Deseret", &super::script::Deseret_table), ("Devanagari", &super::script::Devanagari_table), ("Duployan", &super::script::Duployan_table), ("Egyptian_Hieroglyphs", &super::script::Egyptian_Hieroglyphs_table), ("Elbasan", &super::script::Elbasan_table), ("Ethiopic", &super::script::Ethiopic_table), ("Georgian", &super::script::Georgian_table), ("Glagolitic", &super::script::Glagolitic_table), ("Gothic", &super::script::Gothic_table), ("Grantha", &super::script::Grantha_table), ("Greek", &super::script::Greek_table), ("Gujarati", &super::script::Gujarati_table), ("Gurmukhi", &super::script::Gurmukhi_table), ("Han", &super::script::Han_table), ("Hangul", &super::script::Hangul_table), ("Hanunoo", &super::script::Hanunoo_table), ("Hebrew", &super::script::Hebrew_table), ("Hiragana", &super::script::Hiragana_table), ("Imperial_Aramaic", &super::script::Imperial_Aramaic_table), ("Inherited", &super::script::Inherited_table), ("Inscriptional_Pahlavi", &super::script::Inscriptional_Pahlavi_table), ("Inscriptional_Parthian", &super::script::Inscriptional_Parthian_table), ("Javanese", &super::script::Javanese_table), ("Join_Control", &super::property::Join_Control_table), ("Kaithi", &super::script::Kaithi_table), ("Kannada", &super::script::Kannada_table), ("Katakana", &super::script::Katakana_table), ("Kayah_Li", &super::script::Kayah_Li_table), ("Kharoshthi", &super::script::Kharoshthi_table), ("Khmer", &super::script::Khmer_table), ("Khojki", &super::script::Khojki_table), ("Khudawadi", &super::script::Khudawadi_table), ("L", &super::general_category::L_table), ("LC", &super::general_category::LC_table), ("Lao", &super::script::Lao_table), ("Latin", &super::script::Latin_table), ("Lepcha", &super::script::Lepcha_table), ("Limbu", &super::script::Limbu_table), ("Linear_A", &super::script::Linear_A_table), ("Linear_B", &super::script::Linear_B_table), ("Lisu", &super::script::Lisu_table), ("Ll", &super::general_category::Ll_table), ("Lm", &super::general_category::Lm_table), ("Lo", &super::general_category::Lo_table), ("Lowercase", &super::derived_property::Lowercase_table), ("Lt", &super::general_category::Lt_table), ("Lu", &super::general_category::Lu_table), ("Lycian", &super::script::Lycian_table), ("Lydian", &super::script::Lydian_table), ("M", &super::general_category::M_table), ("Mahajani", &super::script::Mahajani_table), ("Malayalam", &super::script::Malayalam_table), ("Mandaic", &super::script::Mandaic_table), ("Manichaean", &super::script::Manichaean_table), ("Mc", &super::general_category::Mc_table), ("Me", &super::general_category::Me_table), ("Meetei_Mayek", &super::script::Meetei_Mayek_table), ("Mende_Kikakui", &super::script::Mende_Kikakui_table), ("Meroitic_Cursive", &super::script::Meroitic_Cursive_table), ("Meroitic_Hieroglyphs", &super::script::Meroitic_Hieroglyphs_table), ("Miao", &super::script::Miao_table), ("Mn", &super::general_category::Mn_table), ("Modi", &super::script::Modi_table), ("Mongolian", &super::script::Mongolian_table), ("Mro", &super::script::Mro_table), ("Myanmar", &super::script::Myanmar_table), ("N", &super::general_category::N_table), ("Nabataean", &super::script::Nabataean_table), ("Nd", &super::general_category::Nd_table), ("New_Tai_Lue", &super::script::New_Tai_Lue_table), ("Nko", &super::script::Nko_table), ("Nl", &super::general_category::Nl_table), ("No", &super::general_category::No_table), ("Noncharacter_Code_Point", &super::property::Noncharacter_Code_Point_table), ("Ogham", &super::script::Ogham_table), ("Ol_Chiki", &super::script::Ol_Chiki_table), ("Old_Italic", &super::script::Old_Italic_table), ("Old_North_Arabian", &super::script::Old_North_Arabian_table), ("Old_Permic", &super::script::Old_Permic_table), ("Old_Persian", &super::script::Old_Persian_table), ("Old_South_Arabian", &super::script::Old_South_Arabian_table), ("Old_Turkic", &super::script::Old_Turkic_table), ("Oriya", &super::script::Oriya_table), ("Osmanya", &super::script::Osmanya_table), ("P", &super::general_category::P_table), ("Pahawh_Hmong", &super::script::Pahawh_Hmong_table), ("Palmyrene", &super::script::Palmyrene_table), ("Pau_Cin_Hau", &super::script::Pau_Cin_Hau_table), ("Pc", &super::general_category::Pc_table), ("Pd", &super::general_category::Pd_table), ("Pe", &super::general_category::Pe_table), ("Pf", &super::general_category::Pf_table), ("Phags_Pa", &super::script::Phags_Pa_table), ("Phoenician", &super::script::Phoenician_table), ("Pi", &super::general_category::Pi_table), ("Po", &super::general_category::Po_table), ("Ps", &super::general_category::Ps_table), ("Psalter_Pahlavi", &super::script::Psalter_Pahlavi_table), ("Rejang", &super::script::Rejang_table), ("Runic", &super::script::Runic_table), ("S", &super::general_category::S_table), ("Samaritan", &super::script::Samaritan_table), ("Saurashtra", &super::script::Saurashtra_table), ("Sc", &super::general_category::Sc_table), ("Sharada", &super::script::Sharada_table), ("Shavian", &super::script::Shavian_table), ("Siddham", &super::script::Siddham_table), ("Sinhala", &super::script::Sinhala_table), ("Sk", &super::general_category::Sk_table), ("Sm", &super::general_category::Sm_table), ("So", &super::general_category::So_table), ("Sora_Sompeng", &super::script::Sora_Sompeng_table), ("Sundanese", &super::script::Sundanese_table), ("Syloti_Nagri", &super::script::Syloti_Nagri_table), ("Syriac", &super::script::Syriac_table), ("Tagalog", &super::script::Tagalog_table), ("Tagbanwa", &super::script::Tagbanwa_table), ("Tai_Le", &super::script::Tai_Le_table), ("Tai_Tham", &super::script::Tai_Tham_table), ("Tai_Viet", &super::script::Tai_Viet_table), ("Takri", &super::script::Takri_table), ("Tamil", &super::script::Tamil_table), ("Telugu", &super::script::Telugu_table), ("Thaana", &super::script::Thaana_table), ("Thai", &super::script::Thai_table), ("Tibetan", &super::script::Tibetan_table), ("Tifinagh", &super::script::Tifinagh_table), ("Tirhuta", &super::script::Tirhuta_table), ("Ugaritic", &super::script::Ugaritic_table), ("Uppercase", &super::derived_property::Uppercase_table), ("Vai", &super::script::Vai_table), ("Warang_Citi", &super::script::Warang_Citi_table), ("White_Space", &super::property::White_Space_table), ("XID_Continue", &super::derived_property::XID_Continue_table), ("XID_Start", &super::derived_property::XID_Start_table), ("Yi", &super::script::Yi_table), ("Z", &super::general_category::Z_table), ("Zl", &super::general_category::Zl_table), ("Zp", &super::general_category::Zp_table), ("Zs", &super::general_category::Zs_table) ]; pub static PERLD: &'static &'static [(char, char)] = &super::general_category::Nd_table; pub static PERLS: &'static &'static [(char, char)] = &super::property::White_Space_table; pub static PERLW: &'static [(char, char)] = &[ ('\x30', '\x39'), ('\x41', '\x5a'), ('\x5f', '\x5f'), ('\x61', '\x7a'), ('\u00aa', '\u00aa'), ('\u00b5', '\u00b5'), ('\u00ba', '\u00ba'), ('\u00c0', '\u00d6'), ('\u00d8', '\u00f6'), ('\u00f8', '\u02c1'), ('\u02c6', '\u02d1'), ('\u02e0', '\u02e4'), ('\u02ec', '\u02ec'), ('\u02ee', '\u02ee'), ('\u0300', '\u0374'), ('\u0376', '\u0377'), ('\u037a', '\u037d'), ('\u037f', '\u037f'), ('\u0386', '\u0386'), ('\u0388', '\u038a'), ('\u038c', '\u038c'), ('\u038e', '\u03a1'), ('\u03a3', '\u03f5'), ('\u03f7', '\u0481'), ('\u0483', '\u052f'), ('\u0531', '\u0556'), ('\u0559', '\u0559'), ('\u0561', '\u0587'), ('\u0591', '\u05bd'), ('\u05bf', '\u05bf'), ('\u05c1', '\u05c2'), ('\u05c4', '\u05c5'), ('\u05c7', '\u05c7'), ('\u05d0', '\u05ea'), ('\u05f0', '\u05f2'), ('\u0610', '\u061a'), ('\u0620', '\u0669'), ('\u066e', '\u06d3'), ('\u06d5', '\u06dc'), ('\u06df', '\u06e8'), ('\u06ea', '\u06fc'), ('\u06ff', '\u06ff'), ('\u0710', '\u074a'), ('\u074d', '\u07b1'), ('\u07c0', '\u07f5'), ('\u07fa', '\u07fa'), ('\u0800', '\u082d'), ('\u0840', '\u085b'), ('\u08a0', '\u08b2'), ('\u08e4', '\u0963'), ('\u0966', '\u096f'), ('\u0971', '\u0983'), ('\u0985', '\u098c'), ('\u098f', '\u0990'), ('\u0993', '\u09a8'), ('\u09aa', '\u09b0'), ('\u09b2', '\u09b2'), ('\u09b6', '\u09b9'), ('\u09bc', '\u09c4'), ('\u09c7', '\u09c8'), ('\u09cb', '\u09ce'), ('\u09d7', '\u09d7'), ('\u09dc', '\u09dd'), ('\u09df', '\u09e3'), ('\u09e6', '\u09f1'), ('\u0a01', '\u0a03'), ('\u0a05', '\u0a0a'), ('\u0a0f', '\u0a10'), ('\u0a13', '\u0a28'), ('\u0a2a', '\u0a30'), ('\u0a32', '\u0a33'), ('\u0a35', '\u0a36'), ('\u0a38', '\u0a39'), ('\u0a3c', '\u0a3c'), ('\u0a3e', '\u0a42'), ('\u0a47', '\u0a48'), ('\u0a4b', '\u0a4d'), ('\u0a51', '\u0a51'), ('\u0a59', '\u0a5c'), ('\u0a5e', '\u0a5e'), ('\u0a66', '\u0a75'), ('\u0a81', '\u0a83'), ('\u0a85', '\u0a8d'), ('\u0a8f', '\u0a91'), ('\u0a93', '\u0aa8'), ('\u0aaa', '\u0ab0'), ('\u0ab2', '\u0ab3'), ('\u0ab5', '\u0ab9'), ('\u0abc', '\u0ac5'), ('\u0ac7', '\u0ac9'), ('\u0acb', '\u0acd'), ('\u0ad0', '\u0ad0'), ('\u0ae0', '\u0ae3'), ('\u0ae6', '\u0aef'), ('\u0b01', '\u0b03'), ('\u0b05', '\u0b0c'), ('\u0b0f', '\u0b10'), ('\u0b13', '\u0b28'), ('\u0b2a', '\u0b30'), ('\u0b32', '\u0b33'), ('\u0b35', '\u0b39'), ('\u0b3c', '\u0b44'), ('\u0b47', '\u0b48'), ('\u0b4b', '\u0b4d'), ('\u0b56', '\u0b57'), ('\u0b5c', '\u0b5d'), ('\u0b5f', '\u0b63'), ('\u0b66', '\u0b6f'), ('\u0b71', '\u0b71'), ('\u0b82', '\u0b83'), ('\u0b85', '\u0b8a'), ('\u0b8e', '\u0b90'), ('\u0b92', '\u0b95'), ('\u0b99', '\u0b9a'), ('\u0b9c', '\u0b9c'), ('\u0b9e', '\u0b9f'), ('\u0ba3', '\u0ba4'), ('\u0ba8', '\u0baa'), ('\u0bae', '\u0bb9'), ('\u0bbe', '\u0bc2'), ('\u0bc6', '\u0bc8'), ('\u0bca', '\u0bcd'), ('\u0bd0', '\u0bd0'), ('\u0bd7', '\u0bd7'), ('\u0be6', '\u0bef'), ('\u0c00', '\u0c03'), ('\u0c05', '\u0c0c'), ('\u0c0e', '\u0c10'), ('\u0c12', '\u0c28'), ('\u0c2a', '\u0c39'), ('\u0c3d', '\u0c44'), ('\u0c46', '\u0c48'), ('\u0c4a', '\u0c4d'), ('\u0c55', '\u0c56'), ('\u0c58', '\u0c59'), ('\u0c60', '\u0c63'), ('\u0c66', '\u0c6f'), ('\u0c81', '\u0c83'), ('\u0c85', '\u0c8c'), ('\u0c8e', '\u0c90'), ('\u0c92', '\u0ca8'), ('\u0caa', '\u0cb3'), ('\u0cb5', '\u0cb9'), ('\u0cbc', '\u0cc4'), ('\u0cc6', '\u0cc8'), ('\u0cca', '\u0ccd'), ('\u0cd5', '\u0cd6'), ('\u0cde', '\u0cde'), ('\u0ce0', '\u0ce3'), ('\u0ce6', '\u0cef'), ('\u0cf1', '\u0cf2'), ('\u0d01', '\u0d03'), ('\u0d05', '\u0d0c'), ('\u0d0e', '\u0d10'), ('\u0d12', '\u0d3a'), ('\u0d3d', '\u0d44'), ('\u0d46', '\u0d48'), ('\u0d4a', '\u0d4e'), ('\u0d57', '\u0d57'), ('\u0d60', '\u0d63'), ('\u0d66', '\u0d6f'), ('\u0d7a', '\u0d7f'), ('\u0d82', '\u0d83'), ('\u0d85', '\u0d96'), ('\u0d9a', '\u0db1'), ('\u0db3', '\u0dbb'), ('\u0dbd', '\u0dbd'), ('\u0dc0', '\u0dc6'), ('\u0dca', '\u0dca'), ('\u0dcf', '\u0dd4'), ('\u0dd6', '\u0dd6'), ('\u0dd8', '\u0ddf'), ('\u0de6', '\u0def'), ('\u0df2', '\u0df3'), ('\u0e01', '\u0e3a'), ('\u0e40', '\u0e4e'), ('\u0e50', '\u0e59'), ('\u0e81', '\u0e82'), ('\u0e84', '\u0e84'), ('\u0e87', '\u0e88'), ('\u0e8a', '\u0e8a'), ('\u0e8d', '\u0e8d'), ('\u0e94', '\u0e97'), ('\u0e99', '\u0e9f'), ('\u0ea1', '\u0ea3'), ('\u0ea5', '\u0ea5'), ('\u0ea7', '\u0ea7'), ('\u0eaa', '\u0eab'), ('\u0ead', '\u0eb9'), ('\u0ebb', '\u0ebd'), ('\u0ec0', '\u0ec4'), ('\u0ec6', '\u0ec6'), ('\u0ec8', '\u0ecd'), ('\u0ed0', '\u0ed9'), ('\u0edc', '\u0edf'), ('\u0f00', '\u0f00'), ('\u0f18', '\u0f19'), ('\u0f20', '\u0f29'), ('\u0f35', '\u0f35'), ('\u0f37', '\u0f37'), ('\u0f39', '\u0f39'), ('\u0f3e', '\u0f47'), ('\u0f49', '\u0f6c'), ('\u0f71', '\u0f84'), ('\u0f86', '\u0f97'), ('\u0f99', '\u0fbc'), ('\u0fc6', '\u0fc6'), ('\u1000', '\u1049'), ('\u1050', '\u109d'), ('\u10a0', '\u10c5'), ('\u10c7', '\u10c7'), ('\u10cd', '\u10cd'), ('\u10d0', '\u10fa'), ('\u10fc', '\u1248'), ('\u124a', '\u124d'), ('\u1250', '\u1256'), ('\u1258', '\u1258'), ('\u125a', '\u125d'), ('\u1260', '\u1288'), ('\u128a', '\u128d'), ('\u1290', '\u12b0'), ('\u12b2', '\u12b5'), ('\u12b8', '\u12be'), ('\u12c0', '\u12c0'), ('\u12c2', '\u12c5'), ('\u12c8', '\u12d6'), ('\u12d8', '\u1310'), ('\u1312', '\u1315'), ('\u1318', '\u135a'), ('\u135d', '\u135f'), ('\u1380', '\u138f'), ('\u13a0', '\u13f4'), ('\u1401', '\u166c'), ('\u166f', '\u167f'), ('\u1681', '\u169a'), ('\u16a0', '\u16ea'), ('\u16ee', '\u16f8'), ('\u1700', '\u170c'), ('\u170e', '\u1714'), ('\u1720', '\u1734'), ('\u1740', '\u1753'), ('\u1760', '\u176c'), ('\u176e', '\u1770'), ('\u1772', '\u1773'), ('\u1780', '\u17d3'), ('\u17d7', '\u17d7'), ('\u17dc', '\u17dd'), ('\u17e0', '\u17e9'), ('\u180b', '\u180d'), ('\u1810', '\u1819'), ('\u1820', '\u1877'), ('\u1880', '\u18aa'), ('\u18b0', '\u18f5'), ('\u1900', '\u191e'), ('\u1920', '\u192b'), ('\u1930', '\u193b'), ('\u1946', '\u196d'), ('\u1970', '\u1974'), ('\u1980', '\u19ab'), ('\u19b0', '\u19c9'), ('\u19d0', '\u19d9'), ('\u1a00', '\u1a1b'), ('\u1a20', '\u1a5e'), ('\u1a60', '\u1a7c'), ('\u1a7f', '\u1a89'), ('\u1a90', '\u1a99'), ('\u1aa7', '\u1aa7'), ('\u1ab0', '\u1abe'), ('\u1b00', '\u1b4b'), ('\u1b50', '\u1b59'), ('\u1b6b', '\u1b73'), ('\u1b80', '\u1bf3'), ('\u1c00', '\u1c37'), ('\u1c40', '\u1c49'), ('\u1c4d', '\u1c7d'), ('\u1cd0', '\u1cd2'), ('\u1cd4', '\u1cf6'), ('\u1cf8', '\u1cf9'), ('\u1d00', '\u1df5'), ('\u1dfc', '\u1f15'), ('\u1f18', '\u1f1d'), ('\u1f20', '\u1f45'), ('\u1f48', '\u1f4d'), ('\u1f50', '\u1f57'), ('\u1f59', '\u1f59'), ('\u1f5b', '\u1f5b'), ('\u1f5d', '\u1f5d'), ('\u1f5f', '\u1f7d'), ('\u1f80', '\u1fb4'), ('\u1fb6', '\u1fbc'), ('\u1fbe', '\u1fbe'), ('\u1fc2', '\u1fc4'), ('\u1fc6', '\u1fcc'), ('\u1fd0', '\u1fd3'), ('\u1fd6', '\u1fdb'), ('\u1fe0', '\u1fec'), ('\u1ff2', '\u1ff4'), ('\u1ff6', '\u1ffc'), ('\u200c', '\u200d'), ('\u203f', '\u2040'), ('\u2054', '\u2054'), ('\u2071', '\u2071'), ('\u207f', '\u207f'), ('\u2090', '\u209c'), ('\u20d0', '\u20f0'), ('\u2102', '\u2102'), ('\u2107', '\u2107'), ('\u210a', '\u2113'), ('\u2115', '\u2115'), ('\u2119', '\u211d'), ('\u2124', '\u2124'), ('\u2126', '\u2126'), ('\u2128', '\u2128'), ('\u212a', '\u212d'), ('\u212f', '\u2139'), ('\u213c', '\u213f'), ('\u2145', '\u2149'), ('\u214e', '\u214e'), ('\u2160', '\u2188'), ('\u24b6', '\u24e9'), ('\u2c00', '\u2c2e'), ('\u2c30', '\u2c5e'), ('\u2c60', '\u2ce4'), ('\u2ceb', '\u2cf3'), ('\u2d00', '\u2d25'), ('\u2d27', '\u2d27'), ('\u2d2d', '\u2d2d'), ('\u2d30', '\u2d67'), ('\u2d6f', '\u2d6f'), ('\u2d7f', '\u2d96'), ('\u2da0', '\u2da6'), ('\u2da8', '\u2dae'), ('\u2db0', '\u2db6'), ('\u2db8', '\u2dbe'), ('\u2dc0', '\u2dc6'), ('\u2dc8', '\u2dce'), ('\u2dd0', '\u2dd6'), ('\u2dd8', '\u2dde'), ('\u2de0', '\u2dff'), ('\u2e2f', '\u2e2f'), ('\u3005', '\u3007'), ('\u3021', '\u302f'), ('\u3031', '\u3035'), ('\u3038', '\u303c'), ('\u3041', '\u3096'), ('\u3099', '\u309a'), ('\u309d', '\u309f'), ('\u30a1', '\u30fa'), ('\u30fc', '\u30ff'), ('\u3105', '\u312d'), ('\u3131', '\u318e'), ('\u31a0', '\u31ba'), ('\u31f0', '\u31ff'), ('\u3400', '\u4db5'), ('\u4e00', '\u9fcc'), ('\ua000', '\ua48c'), ('\ua4d0', '\ua4fd'), ('\ua500', '\ua60c'), ('\ua610', '\ua62b'), ('\ua640', '\ua672'), ('\ua674', '\ua67d'), ('\ua67f', '\ua69d'), ('\ua69f', '\ua6f1'), ('\ua717', '\ua71f'), ('\ua722', '\ua788'), ('\ua78b', '\ua78e'), ('\ua790', '\ua7ad'), ('\ua7b0', '\ua7b1'), ('\ua7f7', '\ua827'), ('\ua840', '\ua873'), ('\ua880', '\ua8c4'), ('\ua8d0', '\ua8d9'), ('\ua8e0', '\ua8f7'), ('\ua8fb', '\ua8fb'), ('\ua900', '\ua92d'), ('\ua930', '\ua953'), ('\ua960', '\ua97c'), ('\ua980', '\ua9c0'), ('\ua9cf', '\ua9d9'), ('\ua9e0', '\ua9fe'), ('\uaa00', '\uaa36'), ('\uaa40', '\uaa4d'), ('\uaa50', '\uaa59'), ('\uaa60', '\uaa76'), ('\uaa7a', '\uaac2'), ('\uaadb', '\uaadd'), ('\uaae0', '\uaaef'), ('\uaaf2', '\uaaf6'), ('\uab01', '\uab06'), ('\uab09', '\uab0e'), ('\uab11', '\uab16'), ('\uab20', '\uab26'), ('\uab28', '\uab2e'), ('\uab30', '\uab5a'), ('\uab5c', '\uab5f'), ('\uab64', '\uab65'), ('\uabc0', '\uabea'), ('\uabec', '\uabed'), ('\uabf0', '\uabf9'), ('\uac00', '\ud7a3'), ('\ud7b0', '\ud7c6'), ('\ud7cb', '\ud7fb'), ('\uf900', '\ufa6d'), ('\ufa70', '\ufad9'), ('\ufb00', '\ufb06'), ('\ufb13', '\ufb17'), ('\ufb1d', '\ufb28'), ('\ufb2a', '\ufb36'), ('\ufb38', '\ufb3c'), ('\ufb3e', '\ufb3e'), ('\ufb40', '\ufb41'), ('\ufb43', '\ufb44'), ('\ufb46', '\ufbb1'), ('\ufbd3', '\ufd3d'), ('\ufd50', '\ufd8f'), ('\ufd92', '\ufdc7'), ('\ufdf0', '\ufdfb'), ('\ufe00', '\ufe0f'), ('\ufe20', '\ufe2d'), ('\ufe33', '\ufe34'), ('\ufe4d', '\ufe4f'), ('\ufe70', '\ufe74'), ('\ufe76', '\ufefc'), ('\uff10', '\uff19'), ('\uff21', '\uff3a'), ('\uff3f', '\uff3f'), ('\uff41', '\uff5a'), ('\uff66', '\uffbe'), ('\uffc2', '\uffc7'), ('\uffca', '\uffcf'), ('\uffd2', '\uffd7'), ('\uffda', '\uffdc'), ('\U00010000', '\U0001000b'), ('\U0001000d', '\U00010026'), ('\U00010028', '\U0001003a'), ('\U0001003c', '\U0001003d'), ('\U0001003f', '\U0001004d'), ('\U00010050', '\U0001005d'), ('\U00010080', '\U000100fa'), ('\U00010140', '\U00010174'), ('\U000101fd', '\U000101fd'), ('\U00010280', '\U0001029c'), ('\U000102a0', '\U000102d0'), ('\U000102e0', '\U000102e0'), ('\U00010300', '\U0001031f'), ('\U00010330', '\U0001034a'), ('\U00010350', '\U0001037a'), ('\U00010380', '\U0001039d'), ('\U000103a0', '\U000103c3'), ('\U000103c8', '\U000103cf'), ('\U000103d1', '\U000103d5'), ('\U00010400', '\U0001049d'), ('\U000104a0', '\U000104a9'), ('\U00010500', '\U00010527'), ('\U00010530', '\U00010563'), ('\U00010600', '\U00010736'), ('\U00010740', '\U00010755'), ('\U00010760', '\U00010767'), ('\U00010800', '\U00010805'), ('\U00010808', '\U00010808'), ('\U0001080a', '\U00010835'), ('\U00010837', '\U00010838'), ('\U0001083c', '\U0001083c'), ('\U0001083f', '\U00010855'), ('\U00010860', '\U00010876'), ('\U00010880', '\U0001089e'), ('\U00010900', '\U00010915'), ('\U00010920', '\U00010939'), ('\U00010980', '\U000109b7'), ('\U000109be', '\U000109bf'), ('\U00010a00', '\U00010a03'), ('\U00010a05', '\U00010a06'), ('\U00010a0c', '\U00010a13'), ('\U00010a15', '\U00010a17'), ('\U00010a19', '\U00010a33'), ('\U00010a38', '\U00010a3a'), ('\U00010a3f', '\U00010a3f'), ('\U00010a60', '\U00010a7c'), ('\U00010a80', '\U00010a9c'), ('\U00010ac0', '\U00010ac7'), ('\U00010ac9', '\U00010ae6'), ('\U00010b00', '\U00010b35'), ('\U00010b40', '\U00010b55'), ('\U00010b60', '\U00010b72'), ('\U00010b80', '\U00010b91'), ('\U00010c00', '\U00010c48'), ('\U00011000', '\U00011046'), ('\U00011066', '\U0001106f'), ('\U0001107f', '\U000110ba'), ('\U000110d0', '\U000110e8'), ('\U000110f0', '\U000110f9'), ('\U00011100', '\U00011134'), ('\U00011136', '\U0001113f'), ('\U00011150', '\U00011173'), ('\U00011176', '\U00011176'), ('\U00011180', '\U000111c4'), ('\U000111d0', '\U000111da'), ('\U00011200', '\U00011211'), ('\U00011213', '\U00011237'), ('\U000112b0', '\U000112ea'), ('\U000112f0', '\U000112f9'), ('\U00011301', '\U00011303'), ('\U00011305', '\U0001130c'), ('\U0001130f', '\U00011310'), ('\U00011313', '\U00011328'), ('\U0001132a', '\U00011330'), ('\U00011332', '\U00011333'), ('\U00011335', '\U00011339'), ('\U0001133c', '\U00011344'), ('\U00011347', '\U00011348'), ('\U0001134b', '\U0001134d'), ('\U00011357', '\U00011357'), ('\U0001135d', '\U00011363'), ('\U00011366', '\U0001136c'), ('\U00011370', '\U00011374'), ('\U00011480', '\U000114c5'), ('\U000114c7', '\U000114c7'), ('\U000114d0', '\U000114d9'), ('\U00011580', '\U000115b5'), ('\U000115b8', '\U000115c0'), ('\U00011600', '\U00011640'), ('\U00011644', '\U00011644'), ('\U00011650', '\U00011659'), ('\U00011680', '\U000116b7'), ('\U000116c0', '\U000116c9'), ('\U000118a0', '\U000118e9'), ('\U000118ff', '\U000118ff'), ('\U00011ac0', '\U00011af8'), ('\U00012000', '\U00012398'), ('\U00012400', '\U0001246e'), ('\U00013000', '\U0001342e'), ('\U00016800', '\U00016a38'), ('\U00016a40', '\U00016a5e'), ('\U00016a60', '\U00016a69'), ('\U00016ad0', '\U00016aed'), ('\U00016af0', '\U00016af4'), ('\U00016b00', '\U00016b36'), ('\U00016b40', '\U00016b43'), ('\U00016b50', '\U00016b59'), ('\U00016b63', '\U00016b77'), ('\U00016b7d', '\U00016b8f'), ('\U00016f00', '\U00016f44'), ('\U00016f50', '\U00016f7e'), ('\U00016f8f', '\U00016f9f'), ('\U0001b000', '\U0001b001'), ('\U0001bc00', '\U0001bc6a'), ('\U0001bc70', '\U0001bc7c'), ('\U0001bc80', '\U0001bc88'), ('\U0001bc90', '\U0001bc99'), ('\U0001bc9d', '\U0001bc9e'), ('\U0001d165', '\U0001d169'), ('\U0001d16d', '\U0001d172'), ('\U0001d17b', '\U0001d182'), ('\U0001d185', '\U0001d18b'), ('\U0001d1aa', '\U0001d1ad'), ('\U0001d242', '\U0001d244'), ('\U0001d400', '\U0001d454'), ('\U0001d456', '\U0001d49c'), ('\U0001d49e', '\U0001d49f'), ('\U0001d4a2', '\U0001d4a2'), ('\U0001d4a5', '\U0001d4a6'), ('\U0001d4a9', '\U0001d4ac'), ('\U0001d4ae', '\U0001d4b9'), ('\U0001d4bb', '\U0001d4bb'), ('\U0001d4bd', '\U0001d4c3'), ('\U0001d4c5', '\U0001d505'), ('\U0001d507', '\U0001d50a'), ('\U0001d50d', '\U0001d514'), ('\U0001d516', '\U0001d51c'), ('\U0001d51e', '\U0001d539'), ('\U0001d53b', '\U0001d53e'), ('\U0001d540', '\U0001d544'), ('\U0001d546', '\U0001d546'), ('\U0001d54a', '\U0001d550'), ('\U0001d552', '\U0001d6a5'), ('\U0001d6a8', '\U0001d6c0'), ('\U0001d6c2', '\U0001d6da'), ('\U0001d6dc', '\U0001d6fa'), ('\U0001d6fc', '\U0001d714'), ('\U0001d716', '\U0001d734'), ('\U0001d736', '\U0001d74e'), ('\U0001d750', '\U0001d76e'), ('\U0001d770', '\U0001d788'), ('\U0001d78a', '\U0001d7a8'), ('\U0001d7aa', '\U0001d7c2'), ('\U0001d7c4', '\U0001d7cb'), ('\U0001d7ce', '\U0001d7ff'), ('\U0001e800', '\U0001e8c4'), ('\U0001e8d0', '\U0001e8d6'), ('\U0001ee00', '\U0001ee03'), ('\U0001ee05', '\U0001ee1f'), ('\U0001ee21', '\U0001ee22'), ('\U0001ee24', '\U0001ee24'), ('\U0001ee27', '\U0001ee27'), ('\U0001ee29', '\U0001ee32'), ('\U0001ee34', '\U0001ee37'), ('\U0001ee39', '\U0001ee39'), ('\U0001ee3b', '\U0001ee3b'), ('\U0001ee42', '\U0001ee42'), ('\U0001ee47', '\U0001ee47'), ('\U0001ee49', '\U0001ee49'), ('\U0001ee4b', '\U0001ee4b'), ('\U0001ee4d', '\U0001ee4f'), ('\U0001ee51', '\U0001ee52'), ('\U0001ee54', '\U0001ee54'), ('\U0001ee57', '\U0001ee57'), ('\U0001ee59', '\U0001ee59'), ('\U0001ee5b', '\U0001ee5b'), ('\U0001ee5d', '\U0001ee5d'), ('\U0001ee5f', '\U0001ee5f'), ('\U0001ee61', '\U0001ee62'), ('\U0001ee64', '\U0001ee64'), ('\U0001ee67', '\U0001ee6a'), ('\U0001ee6c', '\U0001ee72'), ('\U0001ee74', '\U0001ee77'), ('\U0001ee79', '\U0001ee7c'), ('\U0001ee7e', '\U0001ee7e'), ('\U0001ee80', '\U0001ee89'), ('\U0001ee8b', '\U0001ee9b'), ('\U0001eea1', '\U0001eea3'), ('\U0001eea5', '\U0001eea9'), ('\U0001eeab', '\U0001eebb'), ('\U0001f130', '\U0001f149'), ('\U0001f150', '\U0001f169'), ('\U0001f170', '\U0001f189'), ('\U00020000', '\U0002a6d6'), ('\U0002a700', '\U0002b734'), ('\U0002b740', '\U0002b81d'), ('\U0002f800', '\U0002fa1d'), ('\U000e0100', '\U000e01ef') ]; } pub mod normalization { // Canonical decompositions pub static canonical_table: &'static [(char, &'static [char])] = &[ ('\u00c0', &['\x41', '\u0300']), ('\u00c1', &['\x41', '\u0301']), ('\u00c2', &['\x41', '\u0302']), ('\u00c3', &['\x41', '\u0303']), ('\u00c4', &['\x41', '\u0308']), ('\u00c5', &['\x41', '\u030a']), ('\u00c7', &['\x43', '\u0327']), ('\u00c8', &['\x45', '\u0300']), ('\u00c9', &['\x45', '\u0301']), ('\u00ca', &['\x45', '\u0302']), ('\u00cb', &['\x45', '\u0308']), ('\u00cc', &['\x49', '\u0300']), ('\u00cd', &['\x49', '\u0301']), ('\u00ce', &['\x49', '\u0302']), ('\u00cf', &['\x49', '\u0308']), ('\u00d1', &['\x4e', '\u0303']), ('\u00d2', &['\x4f', '\u0300']), ('\u00d3', &['\x4f', '\u0301']), ('\u00d4', &['\x4f', '\u0302']), ('\u00d5', &['\x4f', '\u0303']), ('\u00d6', &['\x4f', '\u0308']), ('\u00d9', &['\x55', '\u0300']), ('\u00da', &['\x55', '\u0301']), ('\u00db', &['\x55', '\u0302']), ('\u00dc', &['\x55', '\u0308']), ('\u00dd', &['\x59', '\u0301']), ('\u00e0', &['\x61', '\u0300']), ('\u00e1', &['\x61', '\u0301']), ('\u00e2', &['\x61', '\u0302']), ('\u00e3', &['\x61', '\u0303']), ('\u00e4', &['\x61', '\u0308']), ('\u00e5', &['\x61', '\u030a']), ('\u00e7', &['\x63', '\u0327']), ('\u00e8', &['\x65', '\u0300']), ('\u00e9', &['\x65', '\u0301']), ('\u00ea', &['\x65', '\u0302']), ('\u00eb', &['\x65', '\u0308']), ('\u00ec', &['\x69', '\u0300']), ('\u00ed', &['\x69', '\u0301']), ('\u00ee', &['\x69', '\u0302']), ('\u00ef', &['\x69', '\u0308']), ('\u00f1', &['\x6e', '\u0303']), ('\u00f2', &['\x6f', '\u0300']), ('\u00f3', &['\x6f', '\u0301']), ('\u00f4', &['\x6f', '\u0302']), ('\u00f5', &['\x6f', '\u0303']), ('\u00f6', &['\x6f', '\u0308']), ('\u00f9', &['\x75', '\u0300']), ('\u00fa', &['\x75', '\u0301']), ('\u00fb', &['\x75', '\u0302']), ('\u00fc', &['\x75', '\u0308']), ('\u00fd', &['\x79', '\u0301']), ('\u00ff', &['\x79', '\u0308']), ('\u0100', &['\x41', '\u0304']), ('\u0101', &['\x61', '\u0304']), ('\u0102', &['\x41', '\u0306']), ('\u0103', &['\x61', '\u0306']), ('\u0104', &['\x41', '\u0328']), ('\u0105', &['\x61', '\u0328']), ('\u0106', &['\x43', '\u0301']), ('\u0107', &['\x63', '\u0301']), ('\u0108', &['\x43', '\u0302']), ('\u0109', &['\x63', '\u0302']), ('\u010a', &['\x43', '\u0307']), ('\u010b', &['\x63', '\u0307']), ('\u010c', &['\x43', '\u030c']), ('\u010d', &['\x63', '\u030c']), ('\u010e', &['\x44', '\u030c']), ('\u010f', &['\x64', '\u030c']), ('\u0112', &['\x45', '\u0304']), ('\u0113', &['\x65', '\u0304']), ('\u0114', &['\x45', '\u0306']), ('\u0115', &['\x65', '\u0306']), ('\u0116', &['\x45', '\u0307']), ('\u0117', &['\x65', '\u0307']), ('\u0118', &['\x45', '\u0328']), ('\u0119', &['\x65', '\u0328']), ('\u011a', &['\x45', '\u030c']), ('\u011b', &['\x65', '\u030c']), ('\u011c', &['\x47', '\u0302']), ('\u011d', &['\x67', '\u0302']), ('\u011e', &['\x47', '\u0306']), ('\u011f', &['\x67', '\u0306']), ('\u0120', &['\x47', '\u0307']), ('\u0121', &['\x67', '\u0307']), ('\u0122', &['\x47', '\u0327']), ('\u0123', &['\x67', '\u0327']), ('\u0124', &['\x48', '\u0302']), ('\u0125', &['\x68', '\u0302']), ('\u0128', &['\x49', '\u0303']), ('\u0129', &['\x69', '\u0303']), ('\u012a', &['\x49', '\u0304']), ('\u012b', &['\x69', '\u0304']), ('\u012c', &['\x49', '\u0306']), ('\u012d', &['\x69', '\u0306']), ('\u012e', &['\x49', '\u0328']), ('\u012f', &['\x69', '\u0328']), ('\u0130', &['\x49', '\u0307']), ('\u0134', &['\x4a', '\u0302']), ('\u0135', &['\x6a', '\u0302']), ('\u0136', &['\x4b', '\u0327']), ('\u0137', &['\x6b', '\u0327']), ('\u0139', &['\x4c', '\u0301']), ('\u013a', &['\x6c', '\u0301']), ('\u013b', &['\x4c', '\u0327']), ('\u013c', &['\x6c', '\u0327']), ('\u013d', &['\x4c', '\u030c']), ('\u013e', &['\x6c', '\u030c']), ('\u0143', &['\x4e', '\u0301']), ('\u0144', &['\x6e', '\u0301']), ('\u0145', &['\x4e', '\u0327']), ('\u0146', &['\x6e', '\u0327']), ('\u0147', &['\x4e', '\u030c']), ('\u0148', &['\x6e', '\u030c']), ('\u014c', &['\x4f', '\u0304']), ('\u014d', &['\x6f', '\u0304']), ('\u014e', &['\x4f', '\u0306']), ('\u014f', &['\x6f', '\u0306']), ('\u0150', &['\x4f', '\u030b']), ('\u0151', &['\x6f', '\u030b']), ('\u0154', &['\x52', '\u0301']), ('\u0155', &['\x72', '\u0301']), ('\u0156', &['\x52', '\u0327']), ('\u0157', &['\x72', '\u0327']), ('\u0158', &['\x52', '\u030c']), ('\u0159', &['\x72', '\u030c']), ('\u015a', &['\x53', '\u0301']), ('\u015b', &['\x73', '\u0301']), ('\u015c', &['\x53', '\u0302']), ('\u015d', &['\x73', '\u0302']), ('\u015e', &['\x53', '\u0327']), ('\u015f', &['\x73', '\u0327']), ('\u0160', &['\x53', '\u030c']), ('\u0161', &['\x73', '\u030c']), ('\u0162', &['\x54', '\u0327']), ('\u0163', &['\x74', '\u0327']), ('\u0164', &['\x54', '\u030c']), ('\u0165', &['\x74', '\u030c']), ('\u0168', &['\x55', '\u0303']), ('\u0169', &['\x75', '\u0303']), ('\u016a', &['\x55', '\u0304']), ('\u016b', &['\x75', '\u0304']), ('\u016c', &['\x55', '\u0306']), ('\u016d', &['\x75', '\u0306']), ('\u016e', &['\x55', '\u030a']), ('\u016f', &['\x75', '\u030a']), ('\u0170', &['\x55', '\u030b']), ('\u0171', &['\x75', '\u030b']), ('\u0172', &['\x55', '\u0328']), ('\u0173', &['\x75', '\u0328']), ('\u0174', &['\x57', '\u0302']), ('\u0175', &['\x77', '\u0302']), ('\u0176', &['\x59', '\u0302']), ('\u0177', &['\x79', '\u0302']), ('\u0178', &['\x59', '\u0308']), ('\u0179', &['\x5a', '\u0301']), ('\u017a', &['\x7a', '\u0301']), ('\u017b', &['\x5a', '\u0307']), ('\u017c', &['\x7a', '\u0307']), ('\u017d', &['\x5a', '\u030c']), ('\u017e', &['\x7a', '\u030c']), ('\u01a0', &['\x4f', '\u031b']), ('\u01a1', &['\x6f', '\u031b']), ('\u01af', &['\x55', '\u031b']), ('\u01b0', &['\x75', '\u031b']), ('\u01cd', &['\x41', '\u030c']), ('\u01ce', &['\x61', '\u030c']), ('\u01cf', &['\x49', '\u030c']), ('\u01d0', &['\x69', '\u030c']), ('\u01d1', &['\x4f', '\u030c']), ('\u01d2', &['\x6f', '\u030c']), ('\u01d3', &['\x55', '\u030c']), ('\u01d4', &['\x75', '\u030c']), ('\u01d5', &['\u00dc', '\u0304']), ('\u01d6', &['\u00fc', '\u0304']), ('\u01d7', &['\u00dc', '\u0301']), ('\u01d8', &['\u00fc', '\u0301']), ('\u01d9', &['\u00dc', '\u030c']), ('\u01da', &['\u00fc', '\u030c']), ('\u01db', &['\u00dc', '\u0300']), ('\u01dc', &['\u00fc', '\u0300']), ('\u01de', &['\u00c4', '\u0304']), ('\u01df', &['\u00e4', '\u0304']), ('\u01e0', &['\u0226', '\u0304']), ('\u01e1', &['\u0227', '\u0304']), ('\u01e2', &['\u00c6', '\u0304']), ('\u01e3', &['\u00e6', '\u0304']), ('\u01e6', &['\x47', '\u030c']), ('\u01e7', &['\x67', '\u030c']), ('\u01e8', &['\x4b', '\u030c']), ('\u01e9', &['\x6b', '\u030c']), ('\u01ea', &['\x4f', '\u0328']), ('\u01eb', &['\x6f', '\u0328']), ('\u01ec', &['\u01ea', '\u0304']), ('\u01ed', &['\u01eb', '\u0304']), ('\u01ee', &['\u01b7', '\u030c']), ('\u01ef', &['\u0292', '\u030c']), ('\u01f0', &['\x6a', '\u030c']), ('\u01f4', &['\x47', '\u0301']), ('\u01f5', &['\x67', '\u0301']), ('\u01f8', &['\x4e', '\u0300']), ('\u01f9', &['\x6e', '\u0300']), ('\u01fa', &['\u00c5', '\u0301']), ('\u01fb', &['\u00e5', '\u0301']), ('\u01fc', &['\u00c6', '\u0301']), ('\u01fd', &['\u00e6', '\u0301']), ('\u01fe', &['\u00d8', '\u0301']), ('\u01ff', &['\u00f8', '\u0301']), ('\u0200', &['\x41', '\u030f']), ('\u0201', &['\x61', '\u030f']), ('\u0202', &['\x41', '\u0311']), ('\u0203', &['\x61', '\u0311']), ('\u0204', &['\x45', '\u030f']), ('\u0205', &['\x65', '\u030f']), ('\u0206', &['\x45', '\u0311']), ('\u0207', &['\x65', '\u0311']), ('\u0208', &['\x49', '\u030f']), ('\u0209', &['\x69', '\u030f']), ('\u020a', &['\x49', '\u0311']), ('\u020b', &['\x69', '\u0311']), ('\u020c', &['\x4f', '\u030f']), ('\u020d', &['\x6f', '\u030f']), ('\u020e', &['\x4f', '\u0311']), ('\u020f', &['\x6f', '\u0311']), ('\u0210', &['\x52', '\u030f']), ('\u0211', &['\x72', '\u030f']), ('\u0212', &['\x52', '\u0311']), ('\u0213', &['\x72', '\u0311']), ('\u0214', &['\x55', '\u030f']), ('\u0215', &['\x75', '\u030f']), ('\u0216', &['\x55', '\u0311']), ('\u0217', &['\x75', '\u0311']), ('\u0218', &['\x53', '\u0326']), ('\u0219', &['\x73', '\u0326']), ('\u021a', &['\x54', '\u0326']), ('\u021b', &['\x74', '\u0326']), ('\u021e', &['\x48', '\u030c']), ('\u021f', &['\x68', '\u030c']), ('\u0226', &['\x41', '\u0307']), ('\u0227', &['\x61', '\u0307']), ('\u0228', &['\x45', '\u0327']), ('\u0229', &['\x65', '\u0327']), ('\u022a', &['\u00d6', '\u0304']), ('\u022b', &['\u00f6', '\u0304']), ('\u022c', &['\u00d5', '\u0304']), ('\u022d', &['\u00f5', '\u0304']), ('\u022e', &['\x4f', '\u0307']), ('\u022f', &['\x6f', '\u0307']), ('\u0230', &['\u022e', '\u0304']), ('\u0231', &['\u022f', '\u0304']), ('\u0232', &['\x59', '\u0304']), ('\u0233', &['\x79', '\u0304']), ('\u0340', &['\u0300']), ('\u0341', &['\u0301']), ('\u0343', &['\u0313']), ('\u0344', &['\u0308', '\u0301']), ('\u0374', &['\u02b9']), ('\u037e', &['\x3b']), ('\u0385', &['\u00a8', '\u0301']), ('\u0386', &['\u0391', '\u0301']), ('\u0387', &['\u00b7']), ('\u0388', &['\u0395', '\u0301']), ('\u0389', &['\u0397', '\u0301']), ('\u038a', &['\u0399', '\u0301']), ('\u038c', &['\u039f', '\u0301']), ('\u038e', &['\u03a5', '\u0301']), ('\u038f', &['\u03a9', '\u0301']), ('\u0390', &['\u03ca', '\u0301']), ('\u03aa', &['\u0399', '\u0308']), ('\u03ab', &['\u03a5', '\u0308']), ('\u03ac', &['\u03b1', '\u0301']), ('\u03ad', &['\u03b5', '\u0301']), ('\u03ae', &['\u03b7', '\u0301']), ('\u03af', &['\u03b9', '\u0301']), ('\u03b0', &['\u03cb', '\u0301']), ('\u03ca', &['\u03b9', '\u0308']), ('\u03cb', &['\u03c5', '\u0308']), ('\u03cc', &['\u03bf', '\u0301']), ('\u03cd', &['\u03c5', '\u0301']), ('\u03ce', &['\u03c9', '\u0301']), ('\u03d3', &['\u03d2', '\u0301']), ('\u03d4', &['\u03d2', '\u0308']), ('\u0400', &['\u0415', '\u0300']), ('\u0401', &['\u0415', '\u0308']), ('\u0403', &['\u0413', '\u0301']), ('\u0407', &['\u0406', '\u0308']), ('\u040c', &['\u041a', '\u0301']), ('\u040d', &['\u0418', '\u0300']), ('\u040e', &['\u0423', '\u0306']), ('\u0419', &['\u0418', '\u0306']), ('\u0439', &['\u0438', '\u0306']), ('\u0450', &['\u0435', '\u0300']), ('\u0451', &['\u0435', '\u0308']), ('\u0453', &['\u0433', '\u0301']), ('\u0457', &['\u0456', '\u0308']), ('\u045c', &['\u043a', '\u0301']), ('\u045d', &['\u0438', '\u0300']), ('\u045e', &['\u0443', '\u0306']), ('\u0476', &['\u0474', '\u030f']), ('\u0477', &['\u0475', '\u030f']), ('\u04c1', &['\u0416', '\u0306']), ('\u04c2', &['\u0436', '\u0306']), ('\u04d0', &['\u0410', '\u0306']), ('\u04d1', &['\u0430', '\u0306']), ('\u04d2', &['\u0410', '\u0308']), ('\u04d3', &['\u0430', '\u0308']), ('\u04d6', &['\u0415', '\u0306']), ('\u04d7', &['\u0435', '\u0306']), ('\u04da', &['\u04d8', '\u0308']), ('\u04db', &['\u04d9', '\u0308']), ('\u04dc', &['\u0416', '\u0308']), ('\u04dd', &['\u0436', '\u0308']), ('\u04de', &['\u0417', '\u0308']), ('\u04df', &['\u0437', '\u0308']), ('\u04e2', &['\u0418', '\u0304']), ('\u04e3', &['\u0438', '\u0304']), ('\u04e4', &['\u0418', '\u0308']), ('\u04e5', &['\u0438', '\u0308']), ('\u04e6', &['\u041e', '\u0308']), ('\u04e7', &['\u043e', '\u0308']), ('\u04ea', &['\u04e8', '\u0308']), ('\u04eb', &['\u04e9', '\u0308']), ('\u04ec', &['\u042d', '\u0308']), ('\u04ed', &['\u044d', '\u0308']), ('\u04ee', &['\u0423', '\u0304']), ('\u04ef', &['\u0443', '\u0304']), ('\u04f0', &['\u0423', '\u0308']), ('\u04f1', &['\u0443', '\u0308']), ('\u04f2', &['\u0423', '\u030b']), ('\u04f3', &['\u0443', '\u030b']), ('\u04f4', &['\u0427', '\u0308']), ('\u04f5', &['\u0447', '\u0308']), ('\u04f8', &['\u042b', '\u0308']), ('\u04f9', &['\u044b', '\u0308']), ('\u0622', &['\u0627', '\u0653']), ('\u0623', &['\u0627', '\u0654']), ('\u0624', &['\u0648', '\u0654']), ('\u0625', &['\u0627', '\u0655']), ('\u0626', &['\u064a', '\u0654']), ('\u06c0', &['\u06d5', '\u0654']), ('\u06c2', &['\u06c1', '\u0654']), ('\u06d3', &['\u06d2', '\u0654']), ('\u0929', &['\u0928', '\u093c']), ('\u0931', &['\u0930', '\u093c']), ('\u0934', &['\u0933', '\u093c']), ('\u0958', &['\u0915', '\u093c']), ('\u0959', &['\u0916', '\u093c']), ('\u095a', &['\u0917', '\u093c']), ('\u095b', &['\u091c', '\u093c']), ('\u095c', &['\u0921', '\u093c']), ('\u095d', &['\u0922', '\u093c']), ('\u095e', &['\u092b', '\u093c']), ('\u095f', &['\u092f', '\u093c']), ('\u09cb', &['\u09c7', '\u09be']), ('\u09cc', &['\u09c7', '\u09d7']), ('\u09dc', &['\u09a1', '\u09bc']), ('\u09dd', &['\u09a2', '\u09bc']), ('\u09df', &['\u09af', '\u09bc']), ('\u0a33', &['\u0a32', '\u0a3c']), ('\u0a36', &['\u0a38', '\u0a3c']), ('\u0a59', &['\u0a16', '\u0a3c']), ('\u0a5a', &['\u0a17', '\u0a3c']), ('\u0a5b', &['\u0a1c', '\u0a3c']), ('\u0a5e', &['\u0a2b', '\u0a3c']), ('\u0b48', &['\u0b47', '\u0b56']), ('\u0b4b', &['\u0b47', '\u0b3e']), ('\u0b4c', &['\u0b47', '\u0b57']), ('\u0b5c', &['\u0b21', '\u0b3c']), ('\u0b5d', &['\u0b22', '\u0b3c']), ('\u0b94', &['\u0b92', '\u0bd7']), ('\u0bca', &['\u0bc6', '\u0bbe']), ('\u0bcb', &['\u0bc7', '\u0bbe']), ('\u0bcc', &['\u0bc6', '\u0bd7']), ('\u0c48', &['\u0c46', '\u0c56']), ('\u0cc0', &['\u0cbf', '\u0cd5']), ('\u0cc7', &['\u0cc6', '\u0cd5']), ('\u0cc8', &['\u0cc6', '\u0cd6']), ('\u0cca', &['\u0cc6', '\u0cc2']), ('\u0ccb', &['\u0cca', '\u0cd5']), ('\u0d4a', &['\u0d46', '\u0d3e']), ('\u0d4b', &['\u0d47', '\u0d3e']), ('\u0d4c', &['\u0d46', '\u0d57']), ('\u0dda', &['\u0dd9', '\u0dca']), ('\u0ddc', &['\u0dd9', '\u0dcf']), ('\u0ddd', &['\u0ddc', '\u0dca']), ('\u0dde', &['\u0dd9', '\u0ddf']), ('\u0f43', &['\u0f42', '\u0fb7']), ('\u0f4d', &['\u0f4c', '\u0fb7']), ('\u0f52', &['\u0f51', '\u0fb7']), ('\u0f57', &['\u0f56', '\u0fb7']), ('\u0f5c', &['\u0f5b', '\u0fb7']), ('\u0f69', &['\u0f40', '\u0fb5']), ('\u0f73', &['\u0f71', '\u0f72']), ('\u0f75', &['\u0f71', '\u0f74']), ('\u0f76', &['\u0fb2', '\u0f80']), ('\u0f78', &['\u0fb3', '\u0f80']), ('\u0f81', &['\u0f71', '\u0f80']), ('\u0f93', &['\u0f92', '\u0fb7']), ('\u0f9d', &['\u0f9c', '\u0fb7']), ('\u0fa2', &['\u0fa1', '\u0fb7']), ('\u0fa7', &['\u0fa6', '\u0fb7']), ('\u0fac', &['\u0fab', '\u0fb7']), ('\u0fb9', &['\u0f90', '\u0fb5']), ('\u1026', &['\u1025', '\u102e']), ('\u1b06', &['\u1b05', '\u1b35']), ('\u1b08', &['\u1b07', '\u1b35']), ('\u1b0a', &['\u1b09', '\u1b35']), ('\u1b0c', &['\u1b0b', '\u1b35']), ('\u1b0e', &['\u1b0d', '\u1b35']), ('\u1b12', &['\u1b11', '\u1b35']), ('\u1b3b', &['\u1b3a', '\u1b35']), ('\u1b3d', &['\u1b3c', '\u1b35']), ('\u1b40', &['\u1b3e', '\u1b35']), ('\u1b41', &['\u1b3f', '\u1b35']), ('\u1b43', &['\u1b42', '\u1b35']), ('\u1e00', &['\x41', '\u0325']), ('\u1e01', &['\x61', '\u0325']), ('\u1e02', &['\x42', '\u0307']), ('\u1e03', &['\x62', '\u0307']), ('\u1e04', &['\x42', '\u0323']), ('\u1e05', &['\x62', '\u0323']), ('\u1e06', &['\x42', '\u0331']), ('\u1e07', &['\x62', '\u0331']), ('\u1e08', &['\u00c7', '\u0301']), ('\u1e09', &['\u00e7', '\u0301']), ('\u1e0a', &['\x44', '\u0307']), ('\u1e0b', &['\x64', '\u0307']), ('\u1e0c', &['\x44', '\u0323']), ('\u1e0d', &['\x64', '\u0323']), ('\u1e0e', &['\x44', '\u0331']), ('\u1e0f', &['\x64', '\u0331']), ('\u1e10', &['\x44', '\u0327']), ('\u1e11', &['\x64', '\u0327']), ('\u1e12', &['\x44', '\u032d']), ('\u1e13', &['\x64', '\u032d']), ('\u1e14', &['\u0112', '\u0300']), ('\u1e15', &['\u0113', '\u0300']), ('\u1e16', &['\u0112', '\u0301']), ('\u1e17', &['\u0113', '\u0301']), ('\u1e18', &['\x45', '\u032d']), ('\u1e19', &['\x65', '\u032d']), ('\u1e1a', &['\x45', '\u0330']), ('\u1e1b', &['\x65', '\u0330']), ('\u1e1c', &['\u0228', '\u0306']), ('\u1e1d', &['\u0229', '\u0306']), ('\u1e1e', &['\x46', '\u0307']), ('\u1e1f', &['\x66', '\u0307']), ('\u1e20', &['\x47', '\u0304']), ('\u1e21', &['\x67', '\u0304']), ('\u1e22', &['\x48', '\u0307']), ('\u1e23', &['\x68', '\u0307']), ('\u1e24', &['\x48', '\u0323']), ('\u1e25', &['\x68', '\u0323']), ('\u1e26', &['\x48', '\u0308']), ('\u1e27', &['\x68', '\u0308']), ('\u1e28', &['\x48', '\u0327']), ('\u1e29', &['\x68', '\u0327']), ('\u1e2a', &['\x48', '\u032e']), ('\u1e2b', &['\x68', '\u032e']), ('\u1e2c', &['\x49', '\u0330']), ('\u1e2d', &['\x69', '\u0330']), ('\u1e2e', &['\u00cf', '\u0301']), ('\u1e2f', &['\u00ef', '\u0301']), ('\u1e30', &['\x4b', '\u0301']), ('\u1e31', &['\x6b', '\u0301']), ('\u1e32', &['\x4b', '\u0323']), ('\u1e33', &['\x6b', '\u0323']), ('\u1e34', &['\x4b', '\u0331']), ('\u1e35', &['\x6b', '\u0331']), ('\u1e36', &['\x4c', '\u0323']), ('\u1e37', &['\x6c', '\u0323']), ('\u1e38', &['\u1e36', '\u0304']), ('\u1e39', &['\u1e37', '\u0304']), ('\u1e3a', &['\x4c', '\u0331']), ('\u1e3b', &['\x6c', '\u0331']), ('\u1e3c', &['\x4c', '\u032d']), ('\u1e3d', &['\x6c', '\u032d']), ('\u1e3e', &['\x4d', '\u0301']), ('\u1e3f', &['\x6d', '\u0301']), ('\u1e40', &['\x4d', '\u0307']), ('\u1e41', &['\x6d', '\u0307']), ('\u1e42', &['\x4d', '\u0323']), ('\u1e43', &['\x6d', '\u0323']), ('\u1e44', &['\x4e', '\u0307']), ('\u1e45', &['\x6e', '\u0307']), ('\u1e46', &['\x4e', '\u0323']), ('\u1e47', &['\x6e', '\u0323']), ('\u1e48', &['\x4e', '\u0331']), ('\u1e49', &['\x6e', '\u0331']), ('\u1e4a', &['\x4e', '\u032d']), ('\u1e4b', &['\x6e', '\u032d']), ('\u1e4c', &['\u00d5', '\u0301']), ('\u1e4d', &['\u00f5', '\u0301']), ('\u1e4e', &['\u00d5', '\u0308']), ('\u1e4f', &['\u00f5', '\u0308']), ('\u1e50', &['\u014c', '\u0300']), ('\u1e51', &['\u014d', '\u0300']), ('\u1e52', &['\u014c', '\u0301']), ('\u1e53', &['\u014d', '\u0301']), ('\u1e54', &['\x50', '\u0301']), ('\u1e55', &['\x70', '\u0301']), ('\u1e56', &['\x50', '\u0307']), ('\u1e57', &['\x70', '\u0307']), ('\u1e58', &['\x52', '\u0307']), ('\u1e59', &['\x72', '\u0307']), ('\u1e5a', &['\x52', '\u0323']), ('\u1e5b', &['\x72', '\u0323']), ('\u1e5c', &['\u1e5a', '\u0304']), ('\u1e5d', &['\u1e5b', '\u0304']), ('\u1e5e', &['\x52', '\u0331']), ('\u1e5f', &['\x72', '\u0331']), ('\u1e60', &['\x53', '\u0307']), ('\u1e61', &['\x73', '\u0307']), ('\u1e62', &['\x53', '\u0323']), ('\u1e63', &['\x73', '\u0323']), ('\u1e64', &['\u015a', '\u0307']), ('\u1e65', &['\u015b', '\u0307']), ('\u1e66', &['\u0160', '\u0307']), ('\u1e67', &['\u0161', '\u0307']), ('\u1e68', &['\u1e62', '\u0307']), ('\u1e69', &['\u1e63', '\u0307']), ('\u1e6a', &['\x54', '\u0307']), ('\u1e6b', &['\x74', '\u0307']), ('\u1e6c', &['\x54', '\u0323']), ('\u1e6d', &['\x74', '\u0323']), ('\u1e6e', &['\x54', '\u0331']), ('\u1e6f', &['\x74', '\u0331']), ('\u1e70', &['\x54', '\u032d']), ('\u1e71', &['\x74', '\u032d']), ('\u1e72', &['\x55', '\u0324']), ('\u1e73', &['\x75', '\u0324']), ('\u1e74', &['\x55', '\u0330']), ('\u1e75', &['\x75', '\u0330']), ('\u1e76', &['\x55', '\u032d']), ('\u1e77', &['\x75', '\u032d']), ('\u1e78', &['\u0168', '\u0301']), ('\u1e79', &['\u0169', '\u0301']), ('\u1e7a', &['\u016a', '\u0308']), ('\u1e7b', &['\u016b', '\u0308']), ('\u1e7c', &['\x56', '\u0303']), ('\u1e7d', &['\x76', '\u0303']), ('\u1e7e', &['\x56', '\u0323']), ('\u1e7f', &['\x76', '\u0323']), ('\u1e80', &['\x57', '\u0300']), ('\u1e81', &['\x77', '\u0300']), ('\u1e82', &['\x57', '\u0301']), ('\u1e83', &['\x77', '\u0301']), ('\u1e84', &['\x57', '\u0308']), ('\u1e85', &['\x77', '\u0308']), ('\u1e86', &['\x57', '\u0307']), ('\u1e87', &['\x77', '\u0307']), ('\u1e88', &['\x57', '\u0323']), ('\u1e89', &['\x77', '\u0323']), ('\u1e8a', &['\x58', '\u0307']), ('\u1e8b', &['\x78', '\u0307']), ('\u1e8c', &['\x58', '\u0308']), ('\u1e8d', &['\x78', '\u0308']), ('\u1e8e', &['\x59', '\u0307']), ('\u1e8f', &['\x79', '\u0307']), ('\u1e90', &['\x5a', '\u0302']), ('\u1e91', &['\x7a', '\u0302']), ('\u1e92', &['\x5a', '\u0323']), ('\u1e93', &['\x7a', '\u0323']), ('\u1e94', &['\x5a', '\u0331']), ('\u1e95', &['\x7a', '\u0331']), ('\u1e96', &['\x68', '\u0331']), ('\u1e97', &['\x74', '\u0308']), ('\u1e98', &['\x77', '\u030a']), ('\u1e99', &['\x79', '\u030a']), ('\u1e9b', &['\u017f', '\u0307']), ('\u1ea0', &['\x41', '\u0323']), ('\u1ea1', &['\x61', '\u0323']), ('\u1ea2', &['\x41', '\u0309']), ('\u1ea3', &['\x61', '\u0309']), ('\u1ea4', &['\u00c2', '\u0301']), ('\u1ea5', &['\u00e2', '\u0301']), ('\u1ea6', &['\u00c2', '\u0300']), ('\u1ea7', &['\u00e2', '\u0300']), ('\u1ea8', &['\u00c2', '\u0309']), ('\u1ea9', &['\u00e2', '\u0309']), ('\u1eaa', &['\u00c2', '\u0303']), ('\u1eab', &['\u00e2', '\u0303']), ('\u1eac', &['\u1ea0', '\u0302']), ('\u1ead', &['\u1ea1', '\u0302']), ('\u1eae', &['\u0102', '\u0301']), ('\u1eaf', &['\u0103', '\u0301']), ('\u1eb0', &['\u0102', '\u0300']), ('\u1eb1', &['\u0103', '\u0300']), ('\u1eb2', &['\u0102', '\u0309']), ('\u1eb3', &['\u0103', '\u0309']), ('\u1eb4', &['\u0102', '\u0303']), ('\u1eb5', &['\u0103', '\u0303']), ('\u1eb6', &['\u1ea0', '\u0306']), ('\u1eb7', &['\u1ea1', '\u0306']), ('\u1eb8', &['\x45', '\u0323']), ('\u1eb9', &['\x65', '\u0323']), ('\u1eba', &['\x45', '\u0309']), ('\u1ebb', &['\x65', '\u0309']), ('\u1ebc', &['\x45', '\u0303']), ('\u1ebd', &['\x65', '\u0303']), ('\u1ebe', &['\u00ca', '\u0301']), ('\u1ebf', &['\u00ea', '\u0301']), ('\u1ec0', &['\u00ca', '\u0300']), ('\u1ec1', &['\u00ea', '\u0300']), ('\u1ec2', &['\u00ca', '\u0309']), ('\u1ec3', &['\u00ea', '\u0309']), ('\u1ec4', &['\u00ca', '\u0303']), ('\u1ec5', &['\u00ea', '\u0303']), ('\u1ec6', &['\u1eb8', '\u0302']), ('\u1ec7', &['\u1eb9', '\u0302']), ('\u1ec8', &['\x49', '\u0309']), ('\u1ec9', &['\x69', '\u0309']), ('\u1eca', &['\x49', '\u0323']), ('\u1ecb', &['\x69', '\u0323']), ('\u1ecc', &['\x4f', '\u0323']), ('\u1ecd', &['\x6f', '\u0323']), ('\u1ece', &['\x4f', '\u0309']), ('\u1ecf', &['\x6f', '\u0309']), ('\u1ed0', &['\u00d4', '\u0301']), ('\u1ed1', &['\u00f4', '\u0301']), ('\u1ed2', &['\u00d4', '\u0300']), ('\u1ed3', &['\u00f4', '\u0300']), ('\u1ed4', &['\u00d4', '\u0309']), ('\u1ed5', &['\u00f4', '\u0309']), ('\u1ed6', &['\u00d4', '\u0303']), ('\u1ed7', &['\u00f4', '\u0303']), ('\u1ed8', &['\u1ecc', '\u0302']), ('\u1ed9', &['\u1ecd', '\u0302']), ('\u1eda', &['\u01a0', '\u0301']), ('\u1edb', &['\u01a1', '\u0301']), ('\u1edc', &['\u01a0', '\u0300']), ('\u1edd', &['\u01a1', '\u0300']), ('\u1ede', &['\u01a0', '\u0309']), ('\u1edf', &['\u01a1', '\u0309']), ('\u1ee0', &['\u01a0', '\u0303']), ('\u1ee1', &['\u01a1', '\u0303']), ('\u1ee2', &['\u01a0', '\u0323']), ('\u1ee3', &['\u01a1', '\u0323']), ('\u1ee4', &['\x55', '\u0323']), ('\u1ee5', &['\x75', '\u0323']), ('\u1ee6', &['\x55', '\u0309']), ('\u1ee7', &['\x75', '\u0309']), ('\u1ee8', &['\u01af', '\u0301']), ('\u1ee9', &['\u01b0', '\u0301']), ('\u1eea', &['\u01af', '\u0300']), ('\u1eeb', &['\u01b0', '\u0300']), ('\u1eec', &['\u01af', '\u0309']), ('\u1eed', &['\u01b0', '\u0309']), ('\u1eee', &['\u01af', '\u0303']), ('\u1eef', &['\u01b0', '\u0303']), ('\u1ef0', &['\u01af', '\u0323']), ('\u1ef1', &['\u01b0', '\u0323']), ('\u1ef2', &['\x59', '\u0300']), ('\u1ef3', &['\x79', '\u0300']), ('\u1ef4', &['\x59', '\u0323']), ('\u1ef5', &['\x79', '\u0323']), ('\u1ef6', &['\x59', '\u0309']), ('\u1ef7', &['\x79', '\u0309']), ('\u1ef8', &['\x59', '\u0303']), ('\u1ef9', &['\x79', '\u0303']), ('\u1f00', &['\u03b1', '\u0313']), ('\u1f01', &['\u03b1', '\u0314']), ('\u1f02', &['\u1f00', '\u0300']), ('\u1f03', &['\u1f01', '\u0300']), ('\u1f04', &['\u1f00', '\u0301']), ('\u1f05', &['\u1f01', '\u0301']), ('\u1f06', &['\u1f00', '\u0342']), ('\u1f07', &['\u1f01', '\u0342']), ('\u1f08', &['\u0391', '\u0313']), ('\u1f09', &['\u0391', '\u0314']), ('\u1f0a', &['\u1f08', '\u0300']), ('\u1f0b', &['\u1f09', '\u0300']), ('\u1f0c', &['\u1f08', '\u0301']), ('\u1f0d', &['\u1f09', '\u0301']), ('\u1f0e', &['\u1f08', '\u0342']), ('\u1f0f', &['\u1f09', '\u0342']), ('\u1f10', &['\u03b5', '\u0313']), ('\u1f11', &['\u03b5', '\u0314']), ('\u1f12', &['\u1f10', '\u0300']), ('\u1f13', &['\u1f11', '\u0300']), ('\u1f14', &['\u1f10', '\u0301']), ('\u1f15', &['\u1f11', '\u0301']), ('\u1f18', &['\u0395', '\u0313']), ('\u1f19', &['\u0395', '\u0314']), ('\u1f1a', &['\u1f18', '\u0300']), ('\u1f1b', &['\u1f19', '\u0300']), ('\u1f1c', &['\u1f18', '\u0301']), ('\u1f1d', &['\u1f19', '\u0301']), ('\u1f20', &['\u03b7', '\u0313']), ('\u1f21', &['\u03b7', '\u0314']), ('\u1f22', &['\u1f20', '\u0300']), ('\u1f23', &['\u1f21', '\u0300']), ('\u1f24', &['\u1f20', '\u0301']), ('\u1f25', &['\u1f21', '\u0301']), ('\u1f26', &['\u1f20', '\u0342']), ('\u1f27', &['\u1f21', '\u0342']), ('\u1f28', &['\u0397', '\u0313']), ('\u1f29', &['\u0397', '\u0314']), ('\u1f2a', &['\u1f28', '\u0300']), ('\u1f2b', &['\u1f29', '\u0300']), ('\u1f2c', &['\u1f28', '\u0301']), ('\u1f2d', &['\u1f29', '\u0301']), ('\u1f2e', &['\u1f28', '\u0342']), ('\u1f2f', &['\u1f29', '\u0342']), ('\u1f30', &['\u03b9', '\u0313']), ('\u1f31', &['\u03b9', '\u0314']), ('\u1f32', &['\u1f30', '\u0300']), ('\u1f33', &['\u1f31', '\u0300']), ('\u1f34', &['\u1f30', '\u0301']), ('\u1f35', &['\u1f31', '\u0301']), ('\u1f36', &['\u1f30', '\u0342']), ('\u1f37', &['\u1f31', '\u0342']), ('\u1f38', &['\u0399', '\u0313']), ('\u1f39', &['\u0399', '\u0314']), ('\u1f3a', &['\u1f38', '\u0300']), ('\u1f3b', &['\u1f39', '\u0300']), ('\u1f3c', &['\u1f38', '\u0301']), ('\u1f3d', &['\u1f39', '\u0301']), ('\u1f3e', &['\u1f38', '\u0342']), ('\u1f3f', &['\u1f39', '\u0342']), ('\u1f40', &['\u03bf', '\u0313']), ('\u1f41', &['\u03bf', '\u0314']), ('\u1f42', &['\u1f40', '\u0300']), ('\u1f43', &['\u1f41', '\u0300']), ('\u1f44', &['\u1f40', '\u0301']), ('\u1f45', &['\u1f41', '\u0301']), ('\u1f48', &['\u039f', '\u0313']), ('\u1f49', &['\u039f', '\u0314']), ('\u1f4a', &['\u1f48', '\u0300']), ('\u1f4b', &['\u1f49', '\u0300']), ('\u1f4c', &['\u1f48', '\u0301']), ('\u1f4d', &['\u1f49', '\u0301']), ('\u1f50', &['\u03c5', '\u0313']), ('\u1f51', &['\u03c5', '\u0314']), ('\u1f52', &['\u1f50', '\u0300']), ('\u1f53', &['\u1f51', '\u0300']), ('\u1f54', &['\u1f50', '\u0301']), ('\u1f55', &['\u1f51', '\u0301']), ('\u1f56', &['\u1f50', '\u0342']), ('\u1f57', &['\u1f51', '\u0342']), ('\u1f59', &['\u03a5', '\u0314']), ('\u1f5b', &['\u1f59', '\u0300']), ('\u1f5d', &['\u1f59', '\u0301']), ('\u1f5f', &['\u1f59', '\u0342']), ('\u1f60', &['\u03c9', '\u0313']), ('\u1f61', &['\u03c9', '\u0314']), ('\u1f62', &['\u1f60', '\u0300']), ('\u1f63', &['\u1f61', '\u0300']), ('\u1f64', &['\u1f60', '\u0301']), ('\u1f65', &['\u1f61', '\u0301']), ('\u1f66', &['\u1f60', '\u0342']), ('\u1f67', &['\u1f61', '\u0342']), ('\u1f68', &['\u03a9', '\u0313']), ('\u1f69', &['\u03a9', '\u0314']), ('\u1f6a', &['\u1f68', '\u0300']), ('\u1f6b', &['\u1f69', '\u0300']), ('\u1f6c', &['\u1f68', '\u0301']), ('\u1f6d', &['\u1f69', '\u0301']), ('\u1f6e', &['\u1f68', '\u0342']), ('\u1f6f', &['\u1f69', '\u0342']), ('\u1f70', &['\u03b1', '\u0300']), ('\u1f71', &['\u03ac']), ('\u1f72', &['\u03b5', '\u0300']), ('\u1f73', &['\u03ad']), ('\u1f74', &['\u03b7', '\u0300']), ('\u1f75', &['\u03ae']), ('\u1f76', &['\u03b9', '\u0300']), ('\u1f77', &['\u03af']), ('\u1f78', &['\u03bf', '\u0300']), ('\u1f79', &['\u03cc']), ('\u1f7a', &['\u03c5', '\u0300']), ('\u1f7b', &['\u03cd']), ('\u1f7c', &['\u03c9', '\u0300']), ('\u1f7d', &['\u03ce']), ('\u1f80', &['\u1f00', '\u0345']), ('\u1f81', &['\u1f01', '\u0345']), ('\u1f82', &['\u1f02', '\u0345']), ('\u1f83', &['\u1f03', '\u0345']), ('\u1f84', &['\u1f04', '\u0345']), ('\u1f85', &['\u1f05', '\u0345']), ('\u1f86', &['\u1f06', '\u0345']), ('\u1f87', &['\u1f07', '\u0345']), ('\u1f88', &['\u1f08', '\u0345']), ('\u1f89', &['\u1f09', '\u0345']), ('\u1f8a', &['\u1f0a', '\u0345']), ('\u1f8b', &['\u1f0b', '\u0345']), ('\u1f8c', &['\u1f0c', '\u0345']), ('\u1f8d', &['\u1f0d', '\u0345']), ('\u1f8e', &['\u1f0e', '\u0345']), ('\u1f8f', &['\u1f0f', '\u0345']), ('\u1f90', &['\u1f20', '\u0345']), ('\u1f91', &['\u1f21', '\u0345']), ('\u1f92', &['\u1f22', '\u0345']), ('\u1f93', &['\u1f23', '\u0345']), ('\u1f94', &['\u1f24', '\u0345']), ('\u1f95', &['\u1f25', '\u0345']), ('\u1f96', &['\u1f26', '\u0345']), ('\u1f97', &['\u1f27', '\u0345']), ('\u1f98', &['\u1f28', '\u0345']), ('\u1f99', &['\u1f29', '\u0345']), ('\u1f9a', &['\u1f2a', '\u0345']), ('\u1f9b', &['\u1f2b', '\u0345']), ('\u1f9c', &['\u1f2c', '\u0345']), ('\u1f9d', &['\u1f2d', '\u0345']), ('\u1f9e', &['\u1f2e', '\u0345']), ('\u1f9f', &['\u1f2f', '\u0345']), ('\u1fa0', &['\u1f60', '\u0345']), ('\u1fa1', &['\u1f61', '\u0345']), ('\u1fa2', &['\u1f62', '\u0345']), ('\u1fa3', &['\u1f63', '\u0345']), ('\u1fa4', &['\u1f64', '\u0345']), ('\u1fa5', &['\u1f65', '\u0345']), ('\u1fa6', &['\u1f66', '\u0345']), ('\u1fa7', &['\u1f67', '\u0345']), ('\u1fa8', &['\u1f68', '\u0345']), ('\u1fa9', &['\u1f69', '\u0345']), ('\u1faa', &['\u1f6a', '\u0345']), ('\u1fab', &['\u1f6b', '\u0345']), ('\u1fac', &['\u1f6c', '\u0345']), ('\u1fad', &['\u1f6d', '\u0345']), ('\u1fae', &['\u1f6e', '\u0345']), ('\u1faf', &['\u1f6f', '\u0345']), ('\u1fb0', &['\u03b1', '\u0306']), ('\u1fb1', &['\u03b1', '\u0304']), ('\u1fb2', &['\u1f70', '\u0345']), ('\u1fb3', &['\u03b1', '\u0345']), ('\u1fb4', &['\u03ac', '\u0345']), ('\u1fb6', &['\u03b1', '\u0342']), ('\u1fb7', &['\u1fb6', '\u0345']), ('\u1fb8', &['\u0391', '\u0306']), ('\u1fb9', &['\u0391', '\u0304']), ('\u1fba', &['\u0391', '\u0300']), ('\u1fbb', &['\u0386']), ('\u1fbc', &['\u0391', '\u0345']), ('\u1fbe', &['\u03b9']), ('\u1fc1', &['\u00a8', '\u0342']), ('\u1fc2', &['\u1f74', '\u0345']), ('\u1fc3', &['\u03b7', '\u0345']), ('\u1fc4', &['\u03ae', '\u0345']), ('\u1fc6', &['\u03b7', '\u0342']), ('\u1fc7', &['\u1fc6', '\u0345']), ('\u1fc8', &['\u0395', '\u0300']), ('\u1fc9', &['\u0388']), ('\u1fca', &['\u0397', '\u0300']), ('\u1fcb', &['\u0389']), ('\u1fcc', &['\u0397', '\u0345']), ('\u1fcd', &['\u1fbf', '\u0300']), ('\u1fce', &['\u1fbf', '\u0301']), ('\u1fcf', &['\u1fbf', '\u0342']), ('\u1fd0', &['\u03b9', '\u0306']), ('\u1fd1', &['\u03b9', '\u0304']), ('\u1fd2', &['\u03ca', '\u0300']), ('\u1fd3', &['\u0390']), ('\u1fd6', &['\u03b9', '\u0342']), ('\u1fd7', &['\u03ca', '\u0342']), ('\u1fd8', &['\u0399', '\u0306']), ('\u1fd9', &['\u0399', '\u0304']), ('\u1fda', &['\u0399', '\u0300']), ('\u1fdb', &['\u038a']), ('\u1fdd', &['\u1ffe', '\u0300']), ('\u1fde', &['\u1ffe', '\u0301']), ('\u1fdf', &['\u1ffe', '\u0342']), ('\u1fe0', &['\u03c5', '\u0306']), ('\u1fe1', &['\u03c5', '\u0304']), ('\u1fe2', &['\u03cb', '\u0300']), ('\u1fe3', &['\u03b0']), ('\u1fe4', &['\u03c1', '\u0313']), ('\u1fe5', &['\u03c1', '\u0314']), ('\u1fe6', &['\u03c5', '\u0342']), ('\u1fe7', &['\u03cb', '\u0342']), ('\u1fe8', &['\u03a5', '\u0306']), ('\u1fe9', &['\u03a5', '\u0304']), ('\u1fea', &['\u03a5', '\u0300']), ('\u1feb', &['\u038e']), ('\u1fec', &['\u03a1', '\u0314']), ('\u1fed', &['\u00a8', '\u0300']), ('\u1fee', &['\u0385']), ('\u1fef', &['\x60']), ('\u1ff2', &['\u1f7c', '\u0345']), ('\u1ff3', &['\u03c9', '\u0345']), ('\u1ff4', &['\u03ce', '\u0345']), ('\u1ff6', &['\u03c9', '\u0342']), ('\u1ff7', &['\u1ff6', '\u0345']), ('\u1ff8', &['\u039f', '\u0300']), ('\u1ff9', &['\u038c']), ('\u1ffa', &['\u03a9', '\u0300']), ('\u1ffb', &['\u038f']), ('\u1ffc', &['\u03a9', '\u0345']), ('\u1ffd', &['\u00b4']), ('\u2000', &['\u2002']), ('\u2001', &['\u2003']), ('\u2126', &['\u03a9']), ('\u212a', &['\x4b']), ('\u212b', &['\u00c5']), ('\u219a', &['\u2190', '\u0338']), ('\u219b', &['\u2192', '\u0338']), ('\u21ae', &['\u2194', '\u0338']), ('\u21cd', &['\u21d0', '\u0338']), ('\u21ce', &['\u21d4', '\u0338']), ('\u21cf', &['\u21d2', '\u0338']), ('\u2204', &['\u2203', '\u0338']), ('\u2209', &['\u2208', '\u0338']), ('\u220c', &['\u220b', '\u0338']), ('\u2224', &['\u2223', '\u0338']), ('\u2226', &['\u2225', '\u0338']), ('\u2241', &['\u223c', '\u0338']), ('\u2244', &['\u2243', '\u0338']), ('\u2247', &['\u2245', '\u0338']), ('\u2249', &['\u2248', '\u0338']), ('\u2260', &['\x3d', '\u0338']), ('\u2262', &['\u2261', '\u0338']), ('\u226d', &['\u224d', '\u0338']), ('\u226e', &['\x3c', '\u0338']), ('\u226f', &['\x3e', '\u0338']), ('\u2270', &['\u2264', '\u0338']), ('\u2271', &['\u2265', '\u0338']), ('\u2274', &['\u2272', '\u0338']), ('\u2275', &['\u2273', '\u0338']), ('\u2278', &['\u2276', '\u0338']), ('\u2279', &['\u2277', '\u0338']), ('\u2280', &['\u227a', '\u0338']), ('\u2281', &['\u227b', '\u0338']), ('\u2284', &['\u2282', '\u0338']), ('\u2285', &['\u2283', '\u0338']), ('\u2288', &['\u2286', '\u0338']), ('\u2289', &['\u2287', '\u0338']), ('\u22ac', &['\u22a2', '\u0338']), ('\u22ad', &['\u22a8', '\u0338']), ('\u22ae', &['\u22a9', '\u0338']), ('\u22af', &['\u22ab', '\u0338']), ('\u22e0', &['\u227c', '\u0338']), ('\u22e1', &['\u227d', '\u0338']), ('\u22e2', &['\u2291', '\u0338']), ('\u22e3', &['\u2292', '\u0338']), ('\u22ea', &['\u22b2', '\u0338']), ('\u22eb', &['\u22b3', '\u0338']), ('\u22ec', &['\u22b4', '\u0338']), ('\u22ed', &['\u22b5', '\u0338']), ('\u2329', &['\u3008']), ('\u232a', &['\u3009']), ('\u2adc', &['\u2add', '\u0338']), ('\u304c', &['\u304b', '\u3099']), ('\u304e', &['\u304d', '\u3099']), ('\u3050', &['\u304f', '\u3099']), ('\u3052', &['\u3051', '\u3099']), ('\u3054', &['\u3053', '\u3099']), ('\u3056', &['\u3055', '\u3099']), ('\u3058', &['\u3057', '\u3099']), ('\u305a', &['\u3059', '\u3099']), ('\u305c', &['\u305b', '\u3099']), ('\u305e', &['\u305d', '\u3099']), ('\u3060', &['\u305f', '\u3099']), ('\u3062', &['\u3061', '\u3099']), ('\u3065', &['\u3064', '\u3099']), ('\u3067', &['\u3066', '\u3099']), ('\u3069', &['\u3068', '\u3099']), ('\u3070', &['\u306f', '\u3099']), ('\u3071', &['\u306f', '\u309a']), ('\u3073', &['\u3072', '\u3099']), ('\u3074', &['\u3072', '\u309a']), ('\u3076', &['\u3075', '\u3099']), ('\u3077', &['\u3075', '\u309a']), ('\u3079', &['\u3078', '\u3099']), ('\u307a', &['\u3078', '\u309a']), ('\u307c', &['\u307b', '\u3099']), ('\u307d', &['\u307b', '\u309a']), ('\u3094', &['\u3046', '\u3099']), ('\u309e', &['\u309d', '\u3099']), ('\u30ac', &['\u30ab', '\u3099']), ('\u30ae', &['\u30ad', '\u3099']), ('\u30b0', &['\u30af', '\u3099']), ('\u30b2', &['\u30b1', '\u3099']), ('\u30b4', &['\u30b3', '\u3099']), ('\u30b6', &['\u30b5', '\u3099']), ('\u30b8', &['\u30b7', '\u3099']), ('\u30ba', &['\u30b9', '\u3099']), ('\u30bc', &['\u30bb', '\u3099']), ('\u30be', &['\u30bd', '\u3099']), ('\u30c0', &['\u30bf', '\u3099']), ('\u30c2', &['\u30c1', '\u3099']), ('\u30c5', &['\u30c4', '\u3099']), ('\u30c7', &['\u30c6', '\u3099']), ('\u30c9', &['\u30c8', '\u3099']), ('\u30d0', &['\u30cf', '\u3099']), ('\u30d1', &['\u30cf', '\u309a']), ('\u30d3', &['\u30d2', '\u3099']), ('\u30d4', &['\u30d2', '\u309a']), ('\u30d6', &['\u30d5', '\u3099']), ('\u30d7', &['\u30d5', '\u309a']), ('\u30d9', &['\u30d8', '\u3099']), ('\u30da', &['\u30d8', '\u309a']), ('\u30dc', &['\u30db', '\u3099']), ('\u30dd', &['\u30db', '\u309a']), ('\u30f4', &['\u30a6', '\u3099']), ('\u30f7', &['\u30ef', '\u3099']), ('\u30f8', &['\u30f0', '\u3099']), ('\u30f9', &['\u30f1', '\u3099']), ('\u30fa', &['\u30f2', '\u3099']), ('\u30fe', &['\u30fd', '\u3099']), ('\uf900', &['\u8c48']), ('\uf901', &['\u66f4']), ('\uf902', &['\u8eca']), ('\uf903', &['\u8cc8']), ('\uf904', &['\u6ed1']), ('\uf905', &['\u4e32']), ('\uf906', &['\u53e5']), ('\uf907', &['\u9f9c']), ('\uf908', &['\u9f9c']), ('\uf909', &['\u5951']), ('\uf90a', &['\u91d1']), ('\uf90b', &['\u5587']), ('\uf90c', &['\u5948']), ('\uf90d', &['\u61f6']), ('\uf90e', &['\u7669']), ('\uf90f', &['\u7f85']), ('\uf910', &['\u863f']), ('\uf911', &['\u87ba']), ('\uf912', &['\u88f8']), ('\uf913', &['\u908f']), ('\uf914', &['\u6a02']), ('\uf915', &['\u6d1b']), ('\uf916', &['\u70d9']), ('\uf917', &['\u73de']), ('\uf918', &['\u843d']), ('\uf919', &['\u916a']), ('\uf91a', &['\u99f1']), ('\uf91b', &['\u4e82']), ('\uf91c', &['\u5375']), ('\uf91d', &['\u6b04']), ('\uf91e', &['\u721b']), ('\uf91f', &['\u862d']), ('\uf920', &['\u9e1e']), ('\uf921', &['\u5d50']), ('\uf922', &['\u6feb']), ('\uf923', &['\u85cd']), ('\uf924', &['\u8964']), ('\uf925', &['\u62c9']), ('\uf926', &['\u81d8']), ('\uf927', &['\u881f']), ('\uf928', &['\u5eca']), ('\uf929', &['\u6717']), ('\uf92a', &['\u6d6a']), ('\uf92b', &['\u72fc']), ('\uf92c', &['\u90ce']), ('\uf92d', &['\u4f86']), ('\uf92e', &['\u51b7']), ('\uf92f', &['\u52de']), ('\uf930', &['\u64c4']), ('\uf931', &['\u6ad3']), ('\uf932', &['\u7210']), ('\uf933', &['\u76e7']), ('\uf934', &['\u8001']), ('\uf935', &['\u8606']), ('\uf936', &['\u865c']), ('\uf937', &['\u8def']), ('\uf938', &['\u9732']), ('\uf939', &['\u9b6f']), ('\uf93a', &['\u9dfa']), ('\uf93b', &['\u788c']), ('\uf93c', &['\u797f']), ('\uf93d', &['\u7da0']), ('\uf93e', &['\u83c9']), ('\uf93f', &['\u9304']), ('\uf940', &['\u9e7f']), ('\uf941', &['\u8ad6']), ('\uf942', &['\u58df']), ('\uf943', &['\u5f04']), ('\uf944', &['\u7c60']), ('\uf945', &['\u807e']), ('\uf946', &['\u7262']), ('\uf947', &['\u78ca']), ('\uf948', &['\u8cc2']), ('\uf949', &['\u96f7']), ('\uf94a', &['\u58d8']), ('\uf94b', &['\u5c62']), ('\uf94c', &['\u6a13']), ('\uf94d', &['\u6dda']), ('\uf94e', &['\u6f0f']), ('\uf94f', &['\u7d2f']), ('\uf950', &['\u7e37']), ('\uf951', &['\u964b']), ('\uf952', &['\u52d2']), ('\uf953', &['\u808b']), ('\uf954', &['\u51dc']), ('\uf955', &['\u51cc']), ('\uf956', &['\u7a1c']), ('\uf957', &['\u7dbe']), ('\uf958', &['\u83f1']), ('\uf959', &['\u9675']), ('\uf95a', &['\u8b80']), ('\uf95b', &['\u62cf']), ('\uf95c', &['\u6a02']), ('\uf95d', &['\u8afe']), ('\uf95e', &['\u4e39']), ('\uf95f', &['\u5be7']), ('\uf960', &['\u6012']), ('\uf961', &['\u7387']), ('\uf962', &['\u7570']), ('\uf963', &['\u5317']), ('\uf964', &['\u78fb']), ('\uf965', &['\u4fbf']), ('\uf966', &['\u5fa9']), ('\uf967', &['\u4e0d']), ('\uf968', &['\u6ccc']), ('\uf969', &['\u6578']), ('\uf96a', &['\u7d22']), ('\uf96b', &['\u53c3']), ('\uf96c', &['\u585e']), ('\uf96d', &['\u7701']), ('\uf96e', &['\u8449']), ('\uf96f', &['\u8aaa']), ('\uf970', &['\u6bba']), ('\uf971', &['\u8fb0']), ('\uf972', &['\u6c88']), ('\uf973', &['\u62fe']), ('\uf974', &['\u82e5']), ('\uf975', &['\u63a0']), ('\uf976', &['\u7565']), ('\uf977', &['\u4eae']), ('\uf978', &['\u5169']), ('\uf979', &['\u51c9']), ('\uf97a', &['\u6881']), ('\uf97b', &['\u7ce7']), ('\uf97c', &['\u826f']), ('\uf97d', &['\u8ad2']), ('\uf97e', &['\u91cf']), ('\uf97f', &['\u52f5']), ('\uf980', &['\u5442']), ('\uf981', &['\u5973']), ('\uf982', &['\u5eec']), ('\uf983', &['\u65c5']), ('\uf984', &['\u6ffe']), ('\uf985', &['\u792a']), ('\uf986', &['\u95ad']), ('\uf987', &['\u9a6a']), ('\uf988', &['\u9e97']), ('\uf989', &['\u9ece']), ('\uf98a', &['\u529b']), ('\uf98b', &['\u66c6']), ('\uf98c', &['\u6b77']), ('\uf98d', &['\u8f62']), ('\uf98e', &['\u5e74']), ('\uf98f', &['\u6190']), ('\uf990', &['\u6200']), ('\uf991', &['\u649a']), ('\uf992', &['\u6f23']), ('\uf993', &['\u7149']), ('\uf994', &['\u7489']), ('\uf995', &['\u79ca']), ('\uf996', &['\u7df4']), ('\uf997', &['\u806f']), ('\uf998', &['\u8f26']), ('\uf999', &['\u84ee']), ('\uf99a', &['\u9023']), ('\uf99b', &['\u934a']), ('\uf99c', &['\u5217']), ('\uf99d', &['\u52a3']), ('\uf99e', &['\u54bd']), ('\uf99f', &['\u70c8']), ('\uf9a0', &['\u88c2']), ('\uf9a1', &['\u8aaa']), ('\uf9a2', &['\u5ec9']), ('\uf9a3', &['\u5ff5']), ('\uf9a4', &['\u637b']), ('\uf9a5', &['\u6bae']), ('\uf9a6', &['\u7c3e']), ('\uf9a7', &['\u7375']), ('\uf9a8', &['\u4ee4']), ('\uf9a9', &['\u56f9']), ('\uf9aa', &['\u5be7']), ('\uf9ab', &['\u5dba']), ('\uf9ac', &['\u601c']), ('\uf9ad', &['\u73b2']), ('\uf9ae', &['\u7469']), ('\uf9af', &['\u7f9a']), ('\uf9b0', &['\u8046']), ('\uf9b1', &['\u9234']), ('\uf9b2', &['\u96f6']), ('\uf9b3', &['\u9748']), ('\uf9b4', &['\u9818']), ('\uf9b5', &['\u4f8b']), ('\uf9b6', &['\u79ae']), ('\uf9b7', &['\u91b4']), ('\uf9b8', &['\u96b8']), ('\uf9b9', &['\u60e1']), ('\uf9ba', &['\u4e86']), ('\uf9bb', &['\u50da']), ('\uf9bc', &['\u5bee']), ('\uf9bd', &['\u5c3f']), ('\uf9be', &['\u6599']), ('\uf9bf', &['\u6a02']), ('\uf9c0', &['\u71ce']), ('\uf9c1', &['\u7642']), ('\uf9c2', &['\u84fc']), ('\uf9c3', &['\u907c']), ('\uf9c4', &['\u9f8d']), ('\uf9c5', &['\u6688']), ('\uf9c6', &['\u962e']), ('\uf9c7', &['\u5289']), ('\uf9c8', &['\u677b']), ('\uf9c9', &['\u67f3']), ('\uf9ca', &['\u6d41']), ('\uf9cb', &['\u6e9c']), ('\uf9cc', &['\u7409']), ('\uf9cd', &['\u7559']), ('\uf9ce', &['\u786b']), ('\uf9cf', &['\u7d10']), ('\uf9d0', &['\u985e']), ('\uf9d1', &['\u516d']), ('\uf9d2', &['\u622e']), ('\uf9d3', &['\u9678']), ('\uf9d4', &['\u502b']), ('\uf9d5', &['\u5d19']), ('\uf9d6', &['\u6dea']), ('\uf9d7', &['\u8f2a']), ('\uf9d8', &['\u5f8b']), ('\uf9d9', &['\u6144']), ('\uf9da', &['\u6817']), ('\uf9db', &['\u7387']), ('\uf9dc', &['\u9686']), ('\uf9dd', &['\u5229']), ('\uf9de', &['\u540f']), ('\uf9df', &['\u5c65']), ('\uf9e0', &['\u6613']), ('\uf9e1', &['\u674e']), ('\uf9e2', &['\u68a8']), ('\uf9e3', &['\u6ce5']), ('\uf9e4', &['\u7406']), ('\uf9e5', &['\u75e2']), ('\uf9e6', &['\u7f79']), ('\uf9e7', &['\u88cf']), ('\uf9e8', &['\u88e1']), ('\uf9e9', &['\u91cc']), ('\uf9ea', &['\u96e2']), ('\uf9eb', &['\u533f']), ('\uf9ec', &['\u6eba']), ('\uf9ed', &['\u541d']), ('\uf9ee', &['\u71d0']), ('\uf9ef', &['\u7498']), ('\uf9f0', &['\u85fa']), ('\uf9f1', &['\u96a3']), ('\uf9f2', &['\u9c57']), ('\uf9f3', &['\u9e9f']), ('\uf9f4', &['\u6797']), ('\uf9f5', &['\u6dcb']), ('\uf9f6', &['\u81e8']), ('\uf9f7', &['\u7acb']), ('\uf9f8', &['\u7b20']), ('\uf9f9', &['\u7c92']), ('\uf9fa', &['\u72c0']), ('\uf9fb', &['\u7099']), ('\uf9fc', &['\u8b58']), ('\uf9fd', &['\u4ec0']), ('\uf9fe', &['\u8336']), ('\uf9ff', &['\u523a']), ('\ufa00', &['\u5207']), ('\ufa01', &['\u5ea6']), ('\ufa02', &['\u62d3']), ('\ufa03', &['\u7cd6']), ('\ufa04', &['\u5b85']), ('\ufa05', &['\u6d1e']), ('\ufa06', &['\u66b4']), ('\ufa07', &['\u8f3b']), ('\ufa08', &['\u884c']), ('\ufa09', &['\u964d']), ('\ufa0a', &['\u898b']), ('\ufa0b', &['\u5ed3']), ('\ufa0c', &['\u5140']), ('\ufa0d', &['\u55c0']), ('\ufa10', &['\u585a']), ('\ufa12', &['\u6674']), ('\ufa15', &['\u51de']), ('\ufa16', &['\u732a']), ('\ufa17', &['\u76ca']), ('\ufa18', &['\u793c']), ('\ufa19', &['\u795e']), ('\ufa1a', &['\u7965']), ('\ufa1b', &['\u798f']), ('\ufa1c', &['\u9756']), ('\ufa1d', &['\u7cbe']), ('\ufa1e', &['\u7fbd']), ('\ufa20', &['\u8612']), ('\ufa22', &['\u8af8']), ('\ufa25', &['\u9038']), ('\ufa26', &['\u90fd']), ('\ufa2a', &['\u98ef']), ('\ufa2b', &['\u98fc']), ('\ufa2c', &['\u9928']), ('\ufa2d', &['\u9db4']), ('\ufa2e', &['\u90de']), ('\ufa2f', &['\u96b7']), ('\ufa30', &['\u4fae']), ('\ufa31', &['\u50e7']), ('\ufa32', &['\u514d']), ('\ufa33', &['\u52c9']), ('\ufa34', &['\u52e4']), ('\ufa35', &['\u5351']), ('\ufa36', &['\u559d']), ('\ufa37', &['\u5606']), ('\ufa38', &['\u5668']), ('\ufa39', &['\u5840']), ('\ufa3a', &['\u58a8']), ('\ufa3b', &['\u5c64']), ('\ufa3c', &['\u5c6e']), ('\ufa3d', &['\u6094']), ('\ufa3e', &['\u6168']), ('\ufa3f', &['\u618e']), ('\ufa40', &['\u61f2']), ('\ufa41', &['\u654f']), ('\ufa42', &['\u65e2']), ('\ufa43', &['\u6691']), ('\ufa44', &['\u6885']), ('\ufa45', &['\u6d77']), ('\ufa46', &['\u6e1a']), ('\ufa47', &['\u6f22']), ('\ufa48', &['\u716e']), ('\ufa49', &['\u722b']), ('\ufa4a', &['\u7422']), ('\ufa4b', &['\u7891']), ('\ufa4c', &['\u793e']), ('\ufa4d', &['\u7949']), ('\ufa4e', &['\u7948']), ('\ufa4f', &['\u7950']), ('\ufa50', &['\u7956']), ('\ufa51', &['\u795d']), ('\ufa52', &['\u798d']), ('\ufa53', &['\u798e']), ('\ufa54', &['\u7a40']), ('\ufa55', &['\u7a81']), ('\ufa56', &['\u7bc0']), ('\ufa57', &['\u7df4']), ('\ufa58', &['\u7e09']), ('\ufa59', &['\u7e41']), ('\ufa5a', &['\u7f72']), ('\ufa5b', &['\u8005']), ('\ufa5c', &['\u81ed']), ('\ufa5d', &['\u8279']), ('\ufa5e', &['\u8279']), ('\ufa5f', &['\u8457']), ('\ufa60', &['\u8910']), ('\ufa61', &['\u8996']), ('\ufa62', &['\u8b01']), ('\ufa63', &['\u8b39']), ('\ufa64', &['\u8cd3']), ('\ufa65', &['\u8d08']), ('\ufa66', &['\u8fb6']), ('\ufa67', &['\u9038']), ('\ufa68', &['\u96e3']), ('\ufa69', &['\u97ff']), ('\ufa6a', &['\u983b']), ('\ufa6b', &['\u6075']), ('\ufa6c', &['\U000242ee']), ('\ufa6d', &['\u8218']), ('\ufa70', &['\u4e26']), ('\ufa71', &['\u51b5']), ('\ufa72', &['\u5168']), ('\ufa73', &['\u4f80']), ('\ufa74', &['\u5145']), ('\ufa75', &['\u5180']), ('\ufa76', &['\u52c7']), ('\ufa77', &['\u52fa']), ('\ufa78', &['\u559d']), ('\ufa79', &['\u5555']), ('\ufa7a', &['\u5599']), ('\ufa7b', &['\u55e2']), ('\ufa7c', &['\u585a']), ('\ufa7d', &['\u58b3']), ('\ufa7e', &['\u5944']), ('\ufa7f', &['\u5954']), ('\ufa80', &['\u5a62']), ('\ufa81', &['\u5b28']), ('\ufa82', &['\u5ed2']), ('\ufa83', &['\u5ed9']), ('\ufa84', &['\u5f69']), ('\ufa85', &['\u5fad']), ('\ufa86', &['\u60d8']), ('\ufa87', &['\u614e']), ('\ufa88', &['\u6108']), ('\ufa89', &['\u618e']), ('\ufa8a', &['\u6160']), ('\ufa8b', &['\u61f2']), ('\ufa8c', &['\u6234']), ('\ufa8d', &['\u63c4']), ('\ufa8e', &['\u641c']), ('\ufa8f', &['\u6452']), ('\ufa90', &['\u6556']), ('\ufa91', &['\u6674']), ('\ufa92', &['\u6717']), ('\ufa93', &['\u671b']), ('\ufa94', &['\u6756']), ('\ufa95', &['\u6b79']), ('\ufa96', &['\u6bba']), ('\ufa97', &['\u6d41']), ('\ufa98', &['\u6edb']), ('\ufa99', &['\u6ecb']), ('\ufa9a', &['\u6f22']), ('\ufa9b', &['\u701e']), ('\ufa9c', &['\u716e']), ('\ufa9d', &['\u77a7']), ('\ufa9e', &['\u7235']), ('\ufa9f', &['\u72af']), ('\ufaa0', &['\u732a']), ('\ufaa1', &['\u7471']), ('\ufaa2', &['\u7506']), ('\ufaa3', &['\u753b']), ('\ufaa4', &['\u761d']), ('\ufaa5', &['\u761f']), ('\ufaa6', &['\u76ca']), ('\ufaa7', &['\u76db']), ('\ufaa8', &['\u76f4']), ('\ufaa9', &['\u774a']), ('\ufaaa', &['\u7740']), ('\ufaab', &['\u78cc']), ('\ufaac', &['\u7ab1']), ('\ufaad', &['\u7bc0']), ('\ufaae', &['\u7c7b']), ('\ufaaf', &['\u7d5b']), ('\ufab0', &['\u7df4']), ('\ufab1', &['\u7f3e']), ('\ufab2', &['\u8005']), ('\ufab3', &['\u8352']), ('\ufab4', &['\u83ef']), ('\ufab5', &['\u8779']), ('\ufab6', &['\u8941']), ('\ufab7', &['\u8986']), ('\ufab8', &['\u8996']), ('\ufab9', &['\u8abf']), ('\ufaba', &['\u8af8']), ('\ufabb', &['\u8acb']), ('\ufabc', &['\u8b01']), ('\ufabd', &['\u8afe']), ('\ufabe', &['\u8aed']), ('\ufabf', &['\u8b39']), ('\ufac0', &['\u8b8a']), ('\ufac1', &['\u8d08']), ('\ufac2', &['\u8f38']), ('\ufac3', &['\u9072']), ('\ufac4', &['\u9199']), ('\ufac5', &['\u9276']), ('\ufac6', &['\u967c']), ('\ufac7', &['\u96e3']), ('\ufac8', &['\u9756']), ('\ufac9', &['\u97db']), ('\ufaca', &['\u97ff']), ('\ufacb', &['\u980b']), ('\ufacc', &['\u983b']), ('\ufacd', &['\u9b12']), ('\uface', &['\u9f9c']), ('\ufacf', &['\U0002284a']), ('\ufad0', &['\U00022844']), ('\ufad1', &['\U000233d5']), ('\ufad2', &['\u3b9d']), ('\ufad3', &['\u4018']), ('\ufad4', &['\u4039']), ('\ufad5', &['\U00025249']), ('\ufad6', &['\U00025cd0']), ('\ufad7', &['\U00027ed3']), ('\ufad8', &['\u9f43']), ('\ufad9', &['\u9f8e']), ('\ufb1d', &['\u05d9', '\u05b4']), ('\ufb1f', &['\u05f2', '\u05b7']), ('\ufb2a', &['\u05e9', '\u05c1']), ('\ufb2b', &['\u05e9', '\u05c2']), ('\ufb2c', &['\ufb49', '\u05c1']), ('\ufb2d', &['\ufb49', '\u05c2']), ('\ufb2e', &['\u05d0', '\u05b7']), ('\ufb2f', &['\u05d0', '\u05b8']), ('\ufb30', &['\u05d0', '\u05bc']), ('\ufb31', &['\u05d1', '\u05bc']), ('\ufb32', &['\u05d2', '\u05bc']), ('\ufb33', &['\u05d3', '\u05bc']), ('\ufb34', &['\u05d4', '\u05bc']), ('\ufb35', &['\u05d5', '\u05bc']), ('\ufb36', &['\u05d6', '\u05bc']), ('\ufb38', &['\u05d8', '\u05bc']), ('\ufb39', &['\u05d9', '\u05bc']), ('\ufb3a', &['\u05da', '\u05bc']), ('\ufb3b', &['\u05db', '\u05bc']), ('\ufb3c', &['\u05dc', '\u05bc']), ('\ufb3e', &['\u05de', '\u05bc']), ('\ufb40', &['\u05e0', '\u05bc']), ('\ufb41', &['\u05e1', '\u05bc']), ('\ufb43', &['\u05e3', '\u05bc']), ('\ufb44', &['\u05e4', '\u05bc']), ('\ufb46', &['\u05e6', '\u05bc']), ('\ufb47', &['\u05e7', '\u05bc']), ('\ufb48', &['\u05e8', '\u05bc']), ('\ufb49', &['\u05e9', '\u05bc']), ('\ufb4a', &['\u05ea', '\u05bc']), ('\ufb4b', &['\u05d5', '\u05b9']), ('\ufb4c', &['\u05d1', '\u05bf']), ('\ufb4d', &['\u05db', '\u05bf']), ('\ufb4e', &['\u05e4', '\u05bf']), ('\U0001109a', &['\U00011099', '\U000110ba']), ('\U0001109c', &['\U0001109b', '\U000110ba']), ('\U000110ab', &['\U000110a5', '\U000110ba']), ('\U0001112e', &['\U00011131', '\U00011127']), ('\U0001112f', &['\U00011132', '\U00011127']), ('\U0001134b', &['\U00011347', '\U0001133e']), ('\U0001134c', &['\U00011347', '\U00011357']), ('\U000114bb', &['\U000114b9', '\U000114ba']), ('\U000114bc', &['\U000114b9', '\U000114b0']), ('\U000114be', &['\U000114b9', '\U000114bd']), ('\U000115ba', &['\U000115b8', '\U000115af']), ('\U000115bb', &['\U000115b9', '\U000115af']), ('\U0001d15e', &['\U0001d157', '\U0001d165']), ('\U0001d15f', &['\U0001d158', '\U0001d165']), ('\U0001d160', &['\U0001d15f', '\U0001d16e']), ('\U0001d161', &['\U0001d15f', '\U0001d16f']), ('\U0001d162', &['\U0001d15f', '\U0001d170']), ('\U0001d163', &['\U0001d15f', '\U0001d171']), ('\U0001d164', &['\U0001d15f', '\U0001d172']), ('\U0001d1bb', &['\U0001d1b9', '\U0001d165']), ('\U0001d1bc', &['\U0001d1ba', '\U0001d165']), ('\U0001d1bd', &['\U0001d1bb', '\U0001d16e']), ('\U0001d1be', &['\U0001d1bc', '\U0001d16e']), ('\U0001d1bf', &['\U0001d1bb', '\U0001d16f']), ('\U0001d1c0', &['\U0001d1bc', '\U0001d16f']), ('\U0002f800', &['\u4e3d']), ('\U0002f801', &['\u4e38']), ('\U0002f802', &['\u4e41']), ('\U0002f803', &['\U00020122']), ('\U0002f804', &['\u4f60']), ('\U0002f805', &['\u4fae']), ('\U0002f806', &['\u4fbb']), ('\U0002f807', &['\u5002']), ('\U0002f808', &['\u507a']), ('\U0002f809', &['\u5099']), ('\U0002f80a', &['\u50e7']), ('\U0002f80b', &['\u50cf']), ('\U0002f80c', &['\u349e']), ('\U0002f80d', &['\U0002063a']), ('\U0002f80e', &['\u514d']), ('\U0002f80f', &['\u5154']), ('\U0002f810', &['\u5164']), ('\U0002f811', &['\u5177']), ('\U0002f812', &['\U0002051c']), ('\U0002f813', &['\u34b9']), ('\U0002f814', &['\u5167']), ('\U0002f815', &['\u518d']), ('\U0002f816', &['\U0002054b']), ('\U0002f817', &['\u5197']), ('\U0002f818', &['\u51a4']), ('\U0002f819', &['\u4ecc']), ('\U0002f81a', &['\u51ac']), ('\U0002f81b', &['\u51b5']), ('\U0002f81c', &['\U000291df']), ('\U0002f81d', &['\u51f5']), ('\U0002f81e', &['\u5203']), ('\U0002f81f', &['\u34df']), ('\U0002f820', &['\u523b']), ('\U0002f821', &['\u5246']), ('\U0002f822', &['\u5272']), ('\U0002f823', &['\u5277']), ('\U0002f824', &['\u3515']), ('\U0002f825', &['\u52c7']), ('\U0002f826', &['\u52c9']), ('\U0002f827', &['\u52e4']), ('\U0002f828', &['\u52fa']), ('\U0002f829', &['\u5305']), ('\U0002f82a', &['\u5306']), ('\U0002f82b', &['\u5317']), ('\U0002f82c', &['\u5349']), ('\U0002f82d', &['\u5351']), ('\U0002f82e', &['\u535a']), ('\U0002f82f', &['\u5373']), ('\U0002f830', &['\u537d']), ('\U0002f831', &['\u537f']), ('\U0002f832', &['\u537f']), ('\U0002f833', &['\u537f']), ('\U0002f834', &['\U00020a2c']), ('\U0002f835', &['\u7070']), ('\U0002f836', &['\u53ca']), ('\U0002f837', &['\u53df']), ('\U0002f838', &['\U00020b63']), ('\U0002f839', &['\u53eb']), ('\U0002f83a', &['\u53f1']), ('\U0002f83b', &['\u5406']), ('\U0002f83c', &['\u549e']), ('\U0002f83d', &['\u5438']), ('\U0002f83e', &['\u5448']), ('\U0002f83f', &['\u5468']), ('\U0002f840', &['\u54a2']), ('\U0002f841', &['\u54f6']), ('\U0002f842', &['\u5510']), ('\U0002f843', &['\u5553']), ('\U0002f844', &['\u5563']), ('\U0002f845', &['\u5584']), ('\U0002f846', &['\u5584']), ('\U0002f847', &['\u5599']), ('\U0002f848', &['\u55ab']), ('\U0002f849', &['\u55b3']), ('\U0002f84a', &['\u55c2']), ('\U0002f84b', &['\u5716']), ('\U0002f84c', &['\u5606']), ('\U0002f84d', &['\u5717']), ('\U0002f84e', &['\u5651']), ('\U0002f84f', &['\u5674']), ('\U0002f850', &['\u5207']), ('\U0002f851', &['\u58ee']), ('\U0002f852', &['\u57ce']), ('\U0002f853', &['\u57f4']), ('\U0002f854', &['\u580d']), ('\U0002f855', &['\u578b']), ('\U0002f856', &['\u5832']), ('\U0002f857', &['\u5831']), ('\U0002f858', &['\u58ac']), ('\U0002f859', &['\U000214e4']), ('\U0002f85a', &['\u58f2']), ('\U0002f85b', &['\u58f7']), ('\U0002f85c', &['\u5906']), ('\U0002f85d', &['\u591a']), ('\U0002f85e', &['\u5922']), ('\U0002f85f', &['\u5962']), ('\U0002f860', &['\U000216a8']), ('\U0002f861', &['\U000216ea']), ('\U0002f862', &['\u59ec']), ('\U0002f863', &['\u5a1b']), ('\U0002f864', &['\u5a27']), ('\U0002f865', &['\u59d8']), ('\U0002f866', &['\u5a66']), ('\U0002f867', &['\u36ee']), ('\U0002f868', &['\u36fc']), ('\U0002f869', &['\u5b08']), ('\U0002f86a', &['\u5b3e']), ('\U0002f86b', &['\u5b3e']), ('\U0002f86c', &['\U000219c8']), ('\U0002f86d', &['\u5bc3']), ('\U0002f86e', &['\u5bd8']), ('\U0002f86f', &['\u5be7']), ('\U0002f870', &['\u5bf3']), ('\U0002f871', &['\U00021b18']), ('\U0002f872', &['\u5bff']), ('\U0002f873', &['\u5c06']), ('\U0002f874', &['\u5f53']), ('\U0002f875', &['\u5c22']), ('\U0002f876', &['\u3781']), ('\U0002f877', &['\u5c60']), ('\U0002f878', &['\u5c6e']), ('\U0002f879', &['\u5cc0']), ('\U0002f87a', &['\u5c8d']), ('\U0002f87b', &['\U00021de4']), ('\U0002f87c', &['\u5d43']), ('\U0002f87d', &['\U00021de6']), ('\U0002f87e', &['\u5d6e']), ('\U0002f87f', &['\u5d6b']), ('\U0002f880', &['\u5d7c']), ('\U0002f881', &['\u5de1']), ('\U0002f882', &['\u5de2']), ('\U0002f883', &['\u382f']), ('\U0002f884', &['\u5dfd']), ('\U0002f885', &['\u5e28']), ('\U0002f886', &['\u5e3d']), ('\U0002f887', &['\u5e69']), ('\U0002f888', &['\u3862']), ('\U0002f889', &['\U00022183']), ('\U0002f88a', &['\u387c']), ('\U0002f88b', &['\u5eb0']), ('\U0002f88c', &['\u5eb3']), ('\U0002f88d', &['\u5eb6']), ('\U0002f88e', &['\u5eca']), ('\U0002f88f', &['\U0002a392']), ('\U0002f890', &['\u5efe']), ('\U0002f891', &['\U00022331']), ('\U0002f892', &['\U00022331']), ('\U0002f893', &['\u8201']), ('\U0002f894', &['\u5f22']), ('\U0002f895', &['\u5f22']), ('\U0002f896', &['\u38c7']), ('\U0002f897', &['\U000232b8']), ('\U0002f898', &['\U000261da']), ('\U0002f899', &['\u5f62']), ('\U0002f89a', &['\u5f6b']), ('\U0002f89b', &['\u38e3']), ('\U0002f89c', &['\u5f9a']), ('\U0002f89d', &['\u5fcd']), ('\U0002f89e', &['\u5fd7']), ('\U0002f89f', &['\u5ff9']), ('\U0002f8a0', &['\u6081']), ('\U0002f8a1', &['\u393a']), ('\U0002f8a2', &['\u391c']), ('\U0002f8a3', &['\u6094']), ('\U0002f8a4', &['\U000226d4']), ('\U0002f8a5', &['\u60c7']), ('\U0002f8a6', &['\u6148']), ('\U0002f8a7', &['\u614c']), ('\U0002f8a8', &['\u614e']), ('\U0002f8a9', &['\u614c']), ('\U0002f8aa', &['\u617a']), ('\U0002f8ab', &['\u618e']), ('\U0002f8ac', &['\u61b2']), ('\U0002f8ad', &['\u61a4']), ('\U0002f8ae', &['\u61af']), ('\U0002f8af', &['\u61de']), ('\U0002f8b0', &['\u61f2']), ('\U0002f8b1', &['\u61f6']), ('\U0002f8b2', &['\u6210']), ('\U0002f8b3', &['\u621b']), ('\U0002f8b4', &['\u625d']), ('\U0002f8b5', &['\u62b1']), ('\U0002f8b6', &['\u62d4']), ('\U0002f8b7', &['\u6350']), ('\U0002f8b8', &['\U00022b0c']), ('\U0002f8b9', &['\u633d']), ('\U0002f8ba', &['\u62fc']), ('\U0002f8bb', &['\u6368']), ('\U0002f8bc', &['\u6383']), ('\U0002f8bd', &['\u63e4']), ('\U0002f8be', &['\U00022bf1']), ('\U0002f8bf', &['\u6422']), ('\U0002f8c0', &['\u63c5']), ('\U0002f8c1', &['\u63a9']), ('\U0002f8c2', &['\u3a2e']), ('\U0002f8c3', &['\u6469']), ('\U0002f8c4', &['\u647e']), ('\U0002f8c5', &['\u649d']), ('\U0002f8c6', &['\u6477']), ('\U0002f8c7', &['\u3a6c']), ('\U0002f8c8', &['\u654f']), ('\U0002f8c9', &['\u656c']), ('\U0002f8ca', &['\U0002300a']), ('\U0002f8cb', &['\u65e3']), ('\U0002f8cc', &['\u66f8']), ('\U0002f8cd', &['\u6649']), ('\U0002f8ce', &['\u3b19']), ('\U0002f8cf', &['\u6691']), ('\U0002f8d0', &['\u3b08']), ('\U0002f8d1', &['\u3ae4']), ('\U0002f8d2', &['\u5192']), ('\U0002f8d3', &['\u5195']), ('\U0002f8d4', &['\u6700']), ('\U0002f8d5', &['\u669c']), ('\U0002f8d6', &['\u80ad']), ('\U0002f8d7', &['\u43d9']), ('\U0002f8d8', &['\u6717']), ('\U0002f8d9', &['\u671b']), ('\U0002f8da', &['\u6721']), ('\U0002f8db', &['\u675e']), ('\U0002f8dc', &['\u6753']), ('\U0002f8dd', &['\U000233c3']), ('\U0002f8de', &['\u3b49']), ('\U0002f8df', &['\u67fa']), ('\U0002f8e0', &['\u6785']), ('\U0002f8e1', &['\u6852']), ('\U0002f8e2', &['\u6885']), ('\U0002f8e3', &['\U0002346d']), ('\U0002f8e4', &['\u688e']), ('\U0002f8e5', &['\u681f']), ('\U0002f8e6', &['\u6914']), ('\U0002f8e7', &['\u3b9d']), ('\U0002f8e8', &['\u6942']), ('\U0002f8e9', &['\u69a3']), ('\U0002f8ea', &['\u69ea']), ('\U0002f8eb', &['\u6aa8']), ('\U0002f8ec', &['\U000236a3']), ('\U0002f8ed', &['\u6adb']), ('\U0002f8ee', &['\u3c18']), ('\U0002f8ef', &['\u6b21']), ('\U0002f8f0', &['\U000238a7']), ('\U0002f8f1', &['\u6b54']), ('\U0002f8f2', &['\u3c4e']), ('\U0002f8f3', &['\u6b72']), ('\U0002f8f4', &['\u6b9f']), ('\U0002f8f5', &['\u6bba']), ('\U0002f8f6', &['\u6bbb']), ('\U0002f8f7', &['\U00023a8d']), ('\U0002f8f8', &['\U00021d0b']), ('\U0002f8f9', &['\U00023afa']), ('\U0002f8fa', &['\u6c4e']), ('\U0002f8fb', &['\U00023cbc']), ('\U0002f8fc', &['\u6cbf']), ('\U0002f8fd', &['\u6ccd']), ('\U0002f8fe', &['\u6c67']), ('\U0002f8ff', &['\u6d16']), ('\U0002f900', &['\u6d3e']), ('\U0002f901', &['\u6d77']), ('\U0002f902', &['\u6d41']), ('\U0002f903', &['\u6d69']), ('\U0002f904', &['\u6d78']), ('\U0002f905', &['\u6d85']), ('\U0002f906', &['\U00023d1e']), ('\U0002f907', &['\u6d34']), ('\U0002f908', &['\u6e2f']), ('\U0002f909', &['\u6e6e']), ('\U0002f90a', &['\u3d33']), ('\U0002f90b', &['\u6ecb']), ('\U0002f90c', &['\u6ec7']), ('\U0002f90d', &['\U00023ed1']), ('\U0002f90e', &['\u6df9']), ('\U0002f90f', &['\u6f6e']), ('\U0002f910', &['\U00023f5e']), ('\U0002f911', &['\U00023f8e']), ('\U0002f912', &['\u6fc6']), ('\U0002f913', &['\u7039']), ('\U0002f914', &['\u701e']), ('\U0002f915', &['\u701b']), ('\U0002f916', &['\u3d96']), ('\U0002f917', &['\u704a']), ('\U0002f918', &['\u707d']), ('\U0002f919', &['\u7077']), ('\U0002f91a', &['\u70ad']), ('\U0002f91b', &['\U00020525']), ('\U0002f91c', &['\u7145']), ('\U0002f91d', &['\U00024263']), ('\U0002f91e', &['\u719c']), ('\U0002f91f', &['\U000243ab']), ('\U0002f920', &['\u7228']), ('\U0002f921', &['\u7235']), ('\U0002f922', &['\u7250']), ('\U0002f923', &['\U00024608']), ('\U0002f924', &['\u7280']), ('\U0002f925', &['\u7295']), ('\U0002f926', &['\U00024735']), ('\U0002f927', &['\U00024814']), ('\U0002f928', &['\u737a']), ('\U0002f929', &['\u738b']), ('\U0002f92a', &['\u3eac']), ('\U0002f92b', &['\u73a5']), ('\U0002f92c', &['\u3eb8']), ('\U0002f92d', &['\u3eb8']), ('\U0002f92e', &['\u7447']), ('\U0002f92f', &['\u745c']), ('\U0002f930', &['\u7471']), ('\U0002f931', &['\u7485']), ('\U0002f932', &['\u74ca']), ('\U0002f933', &['\u3f1b']), ('\U0002f934', &['\u7524']), ('\U0002f935', &['\U00024c36']), ('\U0002f936', &['\u753e']), ('\U0002f937', &['\U00024c92']), ('\U0002f938', &['\u7570']), ('\U0002f939', &['\U0002219f']), ('\U0002f93a', &['\u7610']), ('\U0002f93b', &['\U00024fa1']), ('\U0002f93c', &['\U00024fb8']), ('\U0002f93d', &['\U00025044']), ('\U0002f93e', &['\u3ffc']), ('\U0002f93f', &['\u4008']), ('\U0002f940', &['\u76f4']), ('\U0002f941', &['\U000250f3']), ('\U0002f942', &['\U000250f2']), ('\U0002f943', &['\U00025119']), ('\U0002f944', &['\U00025133']), ('\U0002f945', &['\u771e']), ('\U0002f946', &['\u771f']), ('\U0002f947', &['\u771f']), ('\U0002f948', &['\u774a']), ('\U0002f949', &['\u4039']), ('\U0002f94a', &['\u778b']), ('\U0002f94b', &['\u4046']), ('\U0002f94c', &['\u4096']), ('\U0002f94d', &['\U0002541d']), ('\U0002f94e', &['\u784e']), ('\U0002f94f', &['\u788c']), ('\U0002f950', &['\u78cc']), ('\U0002f951', &['\u40e3']), ('\U0002f952', &['\U00025626']), ('\U0002f953', &['\u7956']), ('\U0002f954', &['\U0002569a']), ('\U0002f955', &['\U000256c5']), ('\U0002f956', &['\u798f']), ('\U0002f957', &['\u79eb']), ('\U0002f958', &['\u412f']), ('\U0002f959', &['\u7a40']), ('\U0002f95a', &['\u7a4a']), ('\U0002f95b', &['\u7a4f']), ('\U0002f95c', &['\U0002597c']), ('\U0002f95d', &['\U00025aa7']), ('\U0002f95e', &['\U00025aa7']), ('\U0002f95f', &['\u7aee']), ('\U0002f960', &['\u4202']), ('\U0002f961', &['\U00025bab']), ('\U0002f962', &['\u7bc6']), ('\U0002f963', &['\u7bc9']), ('\U0002f964', &['\u4227']), ('\U0002f965', &['\U00025c80']), ('\U0002f966', &['\u7cd2']), ('\U0002f967', &['\u42a0']), ('\U0002f968', &['\u7ce8']), ('\U0002f969', &['\u7ce3']), ('\U0002f96a', &['\u7d00']), ('\U0002f96b', &['\U00025f86']), ('\U0002f96c', &['\u7d63']), ('\U0002f96d', &['\u4301']), ('\U0002f96e', &['\u7dc7']), ('\U0002f96f', &['\u7e02']), ('\U0002f970', &['\u7e45']), ('\U0002f971', &['\u4334']), ('\U0002f972', &['\U00026228']), ('\U0002f973', &['\U00026247']), ('\U0002f974', &['\u4359']), ('\U0002f975', &['\U000262d9']), ('\U0002f976', &['\u7f7a']), ('\U0002f977', &['\U0002633e']), ('\U0002f978', &['\u7f95']), ('\U0002f979', &['\u7ffa']), ('\U0002f97a', &['\u8005']), ('\U0002f97b', &['\U000264da']), ('\U0002f97c', &['\U00026523']), ('\U0002f97d', &['\u8060']), ('\U0002f97e', &['\U000265a8']), ('\U0002f97f', &['\u8070']), ('\U0002f980', &['\U0002335f']), ('\U0002f981', &['\u43d5']), ('\U0002f982', &['\u80b2']), ('\U0002f983', &['\u8103']), ('\U0002f984', &['\u440b']), ('\U0002f985', &['\u813e']), ('\U0002f986', &['\u5ab5']), ('\U0002f987', &['\U000267a7']), ('\U0002f988', &['\U000267b5']), ('\U0002f989', &['\U00023393']), ('\U0002f98a', &['\U0002339c']), ('\U0002f98b', &['\u8201']), ('\U0002f98c', &['\u8204']), ('\U0002f98d', &['\u8f9e']), ('\U0002f98e', &['\u446b']), ('\U0002f98f', &['\u8291']), ('\U0002f990', &['\u828b']), ('\U0002f991', &['\u829d']), ('\U0002f992', &['\u52b3']), ('\U0002f993', &['\u82b1']), ('\U0002f994', &['\u82b3']), ('\U0002f995', &['\u82bd']), ('\U0002f996', &['\u82e6']), ('\U0002f997', &['\U00026b3c']), ('\U0002f998', &['\u82e5']), ('\U0002f999', &['\u831d']), ('\U0002f99a', &['\u8363']), ('\U0002f99b', &['\u83ad']), ('\U0002f99c', &['\u8323']), ('\U0002f99d', &['\u83bd']), ('\U0002f99e', &['\u83e7']), ('\U0002f99f', &['\u8457']), ('\U0002f9a0', &['\u8353']), ('\U0002f9a1', &['\u83ca']), ('\U0002f9a2', &['\u83cc']), ('\U0002f9a3', &['\u83dc']), ('\U0002f9a4', &['\U00026c36']), ('\U0002f9a5', &['\U00026d6b']), ('\U0002f9a6', &['\U00026cd5']), ('\U0002f9a7', &['\u452b']), ('\U0002f9a8', &['\u84f1']), ('\U0002f9a9', &['\u84f3']), ('\U0002f9aa', &['\u8516']), ('\U0002f9ab', &['\U000273ca']), ('\U0002f9ac', &['\u8564']), ('\U0002f9ad', &['\U00026f2c']), ('\U0002f9ae', &['\u455d']), ('\U0002f9af', &['\u4561']), ('\U0002f9b0', &['\U00026fb1']), ('\U0002f9b1', &['\U000270d2']), ('\U0002f9b2', &['\u456b']), ('\U0002f9b3', &['\u8650']), ('\U0002f9b4', &['\u865c']), ('\U0002f9b5', &['\u8667']), ('\U0002f9b6', &['\u8669']), ('\U0002f9b7', &['\u86a9']), ('\U0002f9b8', &['\u8688']), ('\U0002f9b9', &['\u870e']), ('\U0002f9ba', &['\u86e2']), ('\U0002f9bb', &['\u8779']), ('\U0002f9bc', &['\u8728']), ('\U0002f9bd', &['\u876b']), ('\U0002f9be', &['\u8786']), ('\U0002f9bf', &['\u45d7']), ('\U0002f9c0', &['\u87e1']), ('\U0002f9c1', &['\u8801']), ('\U0002f9c2', &['\u45f9']), ('\U0002f9c3', &['\u8860']), ('\U0002f9c4', &['\u8863']), ('\U0002f9c5', &['\U00027667']), ('\U0002f9c6', &['\u88d7']), ('\U0002f9c7', &['\u88de']), ('\U0002f9c8', &['\u4635']), ('\U0002f9c9', &['\u88fa']), ('\U0002f9ca', &['\u34bb']), ('\U0002f9cb', &['\U000278ae']), ('\U0002f9cc', &['\U00027966']), ('\U0002f9cd', &['\u46be']), ('\U0002f9ce', &['\u46c7']), ('\U0002f9cf', &['\u8aa0']), ('\U0002f9d0', &['\u8aed']), ('\U0002f9d1', &['\u8b8a']), ('\U0002f9d2', &['\u8c55']), ('\U0002f9d3', &['\U00027ca8']), ('\U0002f9d4', &['\u8cab']), ('\U0002f9d5', &['\u8cc1']), ('\U0002f9d6', &['\u8d1b']), ('\U0002f9d7', &['\u8d77']), ('\U0002f9d8', &['\U00027f2f']), ('\U0002f9d9', &['\U00020804']), ('\U0002f9da', &['\u8dcb']), ('\U0002f9db', &['\u8dbc']), ('\U0002f9dc', &['\u8df0']), ('\U0002f9dd', &['\U000208de']), ('\U0002f9de', &['\u8ed4']), ('\U0002f9df', &['\u8f38']), ('\U0002f9e0', &['\U000285d2']), ('\U0002f9e1', &['\U000285ed']), ('\U0002f9e2', &['\u9094']), ('\U0002f9e3', &['\u90f1']), ('\U0002f9e4', &['\u9111']), ('\U0002f9e5', &['\U0002872e']), ('\U0002f9e6', &['\u911b']), ('\U0002f9e7', &['\u9238']), ('\U0002f9e8', &['\u92d7']), ('\U0002f9e9', &['\u92d8']), ('\U0002f9ea', &['\u927c']), ('\U0002f9eb', &['\u93f9']), ('\U0002f9ec', &['\u9415']), ('\U0002f9ed', &['\U00028bfa']), ('\U0002f9ee', &['\u958b']), ('\U0002f9ef', &['\u4995']), ('\U0002f9f0', &['\u95b7']), ('\U0002f9f1', &['\U00028d77']), ('\U0002f9f2', &['\u49e6']), ('\U0002f9f3', &['\u96c3']), ('\U0002f9f4', &['\u5db2']), ('\U0002f9f5', &['\u9723']), ('\U0002f9f6', &['\U00029145']), ('\U0002f9f7', &['\U0002921a']), ('\U0002f9f8', &['\u4a6e']), ('\U0002f9f9', &['\u4a76']), ('\U0002f9fa', &['\u97e0']), ('\U0002f9fb', &['\U0002940a']), ('\U0002f9fc', &['\u4ab2']), ('\U0002f9fd', &['\U00029496']), ('\U0002f9fe', &['\u980b']), ('\U0002f9ff', &['\u980b']), ('\U0002fa00', &['\u9829']), ('\U0002fa01', &['\U000295b6']), ('\U0002fa02', &['\u98e2']), ('\U0002fa03', &['\u4b33']), ('\U0002fa04', &['\u9929']), ('\U0002fa05', &['\u99a7']), ('\U0002fa06', &['\u99c2']), ('\U0002fa07', &['\u99fe']), ('\U0002fa08', &['\u4bce']), ('\U0002fa09', &['\U00029b30']), ('\U0002fa0a', &['\u9b12']), ('\U0002fa0b', &['\u9c40']), ('\U0002fa0c', &['\u9cfd']), ('\U0002fa0d', &['\u4cce']), ('\U0002fa0e', &['\u4ced']), ('\U0002fa0f', &['\u9d67']), ('\U0002fa10', &['\U0002a0ce']), ('\U0002fa11', &['\u4cf8']), ('\U0002fa12', &['\U0002a105']), ('\U0002fa13', &['\U0002a20e']), ('\U0002fa14', &['\U0002a291']), ('\U0002fa15', &['\u9ebb']), ('\U0002fa16', &['\u4d56']), ('\U0002fa17', &['\u9ef9']), ('\U0002fa18', &['\u9efe']), ('\U0002fa19', &['\u9f05']), ('\U0002fa1a', &['\u9f0f']), ('\U0002fa1b', &['\u9f16']), ('\U0002fa1c', &['\u9f3b']), ('\U0002fa1d', &['\U0002a600']) ]; // Compatibility decompositions pub static compatibility_table: &'static [(char, &'static [char])] = &[ ('\u00a0', &['\x20']), ('\u00a8', &['\x20', '\u0308']), ('\u00aa', &['\x61']), ('\u00af', &['\x20', '\u0304']), ('\u00b2', &['\x32']), ('\u00b3', &['\x33']), ('\u00b4', &['\x20', '\u0301']), ('\u00b5', &['\u03bc']), ('\u00b8', &['\x20', '\u0327']), ('\u00b9', &['\x31']), ('\u00ba', &['\x6f']), ('\u00bc', &['\x31', '\u2044', '\x34']), ('\u00bd', &['\x31', '\u2044', '\x32']), ('\u00be', &['\x33', '\u2044', '\x34']), ('\u0132', &['\x49', '\x4a']), ('\u0133', &['\x69', '\x6a']), ('\u013f', &['\x4c', '\u00b7']), ('\u0140', &['\x6c', '\u00b7']), ('\u0149', &['\u02bc', '\x6e']), ('\u017f', &['\x73']), ('\u01c4', &['\x44', '\u017d']), ('\u01c5', &['\x44', '\u017e']), ('\u01c6', &['\x64', '\u017e']), ('\u01c7', &['\x4c', '\x4a']), ('\u01c8', &['\x4c', '\x6a']), ('\u01c9', &['\x6c', '\x6a']), ('\u01ca', &['\x4e', '\x4a']), ('\u01cb', &['\x4e', '\x6a']), ('\u01cc', &['\x6e', '\x6a']), ('\u01f1', &['\x44', '\x5a']), ('\u01f2', &['\x44', '\x7a']), ('\u01f3', &['\x64', '\x7a']), ('\u02b0', &['\x68']), ('\u02b1', &['\u0266']), ('\u02b2', &['\x6a']), ('\u02b3', &['\x72']), ('\u02b4', &['\u0279']), ('\u02b5', &['\u027b']), ('\u02b6', &['\u0281']), ('\u02b7', &['\x77']), ('\u02b8', &['\x79']), ('\u02d8', &['\x20', '\u0306']), ('\u02d9', &['\x20', '\u0307']), ('\u02da', &['\x20', '\u030a']), ('\u02db', &['\x20', '\u0328']), ('\u02dc', &['\x20', '\u0303']), ('\u02dd', &['\x20', '\u030b']), ('\u02e0', &['\u0263']), ('\u02e1', &['\x6c']), ('\u02e2', &['\x73']), ('\u02e3', &['\x78']), ('\u02e4', &['\u0295']), ('\u037a', &['\x20', '\u0345']), ('\u0384', &['\x20', '\u0301']), ('\u03d0', &['\u03b2']), ('\u03d1', &['\u03b8']), ('\u03d2', &['\u03a5']), ('\u03d5', &['\u03c6']), ('\u03d6', &['\u03c0']), ('\u03f0', &['\u03ba']), ('\u03f1', &['\u03c1']), ('\u03f2', &['\u03c2']), ('\u03f4', &['\u0398']), ('\u03f5', &['\u03b5']), ('\u03f9', &['\u03a3']), ('\u0587', &['\u0565', '\u0582']), ('\u0675', &['\u0627', '\u0674']), ('\u0676', &['\u0648', '\u0674']), ('\u0677', &['\u06c7', '\u0674']), ('\u0678', &['\u064a', '\u0674']), ('\u0e33', &['\u0e4d', '\u0e32']), ('\u0eb3', &['\u0ecd', '\u0eb2']), ('\u0edc', &['\u0eab', '\u0e99']), ('\u0edd', &['\u0eab', '\u0ea1']), ('\u0f0c', &['\u0f0b']), ('\u0f77', &['\u0fb2', '\u0f81']), ('\u0f79', &['\u0fb3', '\u0f81']), ('\u10fc', &['\u10dc']), ('\u1d2c', &['\x41']), ('\u1d2d', &['\u00c6']), ('\u1d2e', &['\x42']), ('\u1d30', &['\x44']), ('\u1d31', &['\x45']), ('\u1d32', &['\u018e']), ('\u1d33', &['\x47']), ('\u1d34', &['\x48']), ('\u1d35', &['\x49']), ('\u1d36', &['\x4a']), ('\u1d37', &['\x4b']), ('\u1d38', &['\x4c']), ('\u1d39', &['\x4d']), ('\u1d3a', &['\x4e']), ('\u1d3c', &['\x4f']), ('\u1d3d', &['\u0222']), ('\u1d3e', &['\x50']), ('\u1d3f', &['\x52']), ('\u1d40', &['\x54']), ('\u1d41', &['\x55']), ('\u1d42', &['\x57']), ('\u1d43', &['\x61']), ('\u1d44', &['\u0250']), ('\u1d45', &['\u0251']), ('\u1d46', &['\u1d02']), ('\u1d47', &['\x62']), ('\u1d48', &['\x64']), ('\u1d49', &['\x65']), ('\u1d4a', &['\u0259']), ('\u1d4b', &['\u025b']), ('\u1d4c', &['\u025c']), ('\u1d4d', &['\x67']), ('\u1d4f', &['\x6b']), ('\u1d50', &['\x6d']), ('\u1d51', &['\u014b']), ('\u1d52', &['\x6f']), ('\u1d53', &['\u0254']), ('\u1d54', &['\u1d16']), ('\u1d55', &['\u1d17']), ('\u1d56', &['\x70']), ('\u1d57', &['\x74']), ('\u1d58', &['\x75']), ('\u1d59', &['\u1d1d']), ('\u1d5a', &['\u026f']), ('\u1d5b', &['\x76']), ('\u1d5c', &['\u1d25']), ('\u1d5d', &['\u03b2']), ('\u1d5e', &['\u03b3']), ('\u1d5f', &['\u03b4']), ('\u1d60', &['\u03c6']), ('\u1d61', &['\u03c7']), ('\u1d62', &['\x69']), ('\u1d63', &['\x72']), ('\u1d64', &['\x75']), ('\u1d65', &['\x76']), ('\u1d66', &['\u03b2']), ('\u1d67', &['\u03b3']), ('\u1d68', &['\u03c1']), ('\u1d69', &['\u03c6']), ('\u1d6a', &['\u03c7']), ('\u1d78', &['\u043d']), ('\u1d9b', &['\u0252']), ('\u1d9c', &['\x63']), ('\u1d9d', &['\u0255']), ('\u1d9e', &['\u00f0']), ('\u1d9f', &['\u025c']), ('\u1da0', &['\x66']), ('\u1da1', &['\u025f']), ('\u1da2', &['\u0261']), ('\u1da3', &['\u0265']), ('\u1da4', &['\u0268']), ('\u1da5', &['\u0269']), ('\u1da6', &['\u026a']), ('\u1da7', &['\u1d7b']), ('\u1da8', &['\u029d']), ('\u1da9', &['\u026d']), ('\u1daa', &['\u1d85']), ('\u1dab', &['\u029f']), ('\u1dac', &['\u0271']), ('\u1dad', &['\u0270']), ('\u1dae', &['\u0272']), ('\u1daf', &['\u0273']), ('\u1db0', &['\u0274']), ('\u1db1', &['\u0275']), ('\u1db2', &['\u0278']), ('\u1db3', &['\u0282']), ('\u1db4', &['\u0283']), ('\u1db5', &['\u01ab']), ('\u1db6', &['\u0289']), ('\u1db7', &['\u028a']), ('\u1db8', &['\u1d1c']), ('\u1db9', &['\u028b']), ('\u1dba', &['\u028c']), ('\u1dbb', &['\x7a']), ('\u1dbc', &['\u0290']), ('\u1dbd', &['\u0291']), ('\u1dbe', &['\u0292']), ('\u1dbf', &['\u03b8']), ('\u1e9a', &['\x61', '\u02be']), ('\u1fbd', &['\x20', '\u0313']), ('\u1fbf', &['\x20', '\u0313']), ('\u1fc0', &['\x20', '\u0342']), ('\u1ffe', &['\x20', '\u0314']), ('\u2002', &['\x20']), ('\u2003', &['\x20']), ('\u2004', &['\x20']), ('\u2005', &['\x20']), ('\u2006', &['\x20']), ('\u2007', &['\x20']), ('\u2008', &['\x20']), ('\u2009', &['\x20']), ('\u200a', &['\x20']), ('\u2011', &['\u2010']), ('\u2017', &['\x20', '\u0333']), ('\u2024', &['\x2e']), ('\u2025', &['\x2e', '\x2e']), ('\u2026', &['\x2e', '\x2e', '\x2e']), ('\u202f', &['\x20']), ('\u2033', &['\u2032', '\u2032']), ('\u2034', &['\u2032', '\u2032', '\u2032']), ('\u2036', &['\u2035', '\u2035']), ('\u2037', &['\u2035', '\u2035', '\u2035']), ('\u203c', &['\x21', '\x21']), ('\u203e', &['\x20', '\u0305']), ('\u2047', &['\x3f', '\x3f']), ('\u2048', &['\x3f', '\x21']), ('\u2049', &['\x21', '\x3f']), ('\u2057', &['\u2032', '\u2032', '\u2032', '\u2032']), ('\u205f', &['\x20']), ('\u2070', &['\x30']), ('\u2071', &['\x69']), ('\u2074', &['\x34']), ('\u2075', &['\x35']), ('\u2076', &['\x36']), ('\u2077', &['\x37']), ('\u2078', &['\x38']), ('\u2079', &['\x39']), ('\u207a', &['\x2b']), ('\u207b', &['\u2212']), ('\u207c', &['\x3d']), ('\u207d', &['\x28']), ('\u207e', &['\x29']), ('\u207f', &['\x6e']), ('\u2080', &['\x30']), ('\u2081', &['\x31']), ('\u2082', &['\x32']), ('\u2083', &['\x33']), ('\u2084', &['\x34']), ('\u2085', &['\x35']), ('\u2086', &['\x36']), ('\u2087', &['\x37']), ('\u2088', &['\x38']), ('\u2089', &['\x39']), ('\u208a', &['\x2b']), ('\u208b', &['\u2212']), ('\u208c', &['\x3d']), ('\u208d', &['\x28']), ('\u208e', &['\x29']), ('\u2090', &['\x61']), ('\u2091', &['\x65']), ('\u2092', &['\x6f']), ('\u2093', &['\x78']), ('\u2094', &['\u0259']), ('\u2095', &['\x68']), ('\u2096', &['\x6b']), ('\u2097', &['\x6c']), ('\u2098', &['\x6d']), ('\u2099', &['\x6e']), ('\u209a', &['\x70']), ('\u209b', &['\x73']), ('\u209c', &['\x74']), ('\u20a8', &['\x52', '\x73']), ('\u2100', &['\x61', '\x2f', '\x63']), ('\u2101', &['\x61', '\x2f', '\x73']), ('\u2102', &['\x43']), ('\u2103', &['\u00b0', '\x43']), ('\u2105', &['\x63', '\x2f', '\x6f']), ('\u2106', &['\x63', '\x2f', '\x75']), ('\u2107', &['\u0190']), ('\u2109', &['\u00b0', '\x46']), ('\u210a', &['\x67']), ('\u210b', &['\x48']), ('\u210c', &['\x48']), ('\u210d', &['\x48']), ('\u210e', &['\x68']), ('\u210f', &['\u0127']), ('\u2110', &['\x49']), ('\u2111', &['\x49']), ('\u2112', &['\x4c']), ('\u2113', &['\x6c']), ('\u2115', &['\x4e']), ('\u2116', &['\x4e', '\x6f']), ('\u2119', &['\x50']), ('\u211a', &['\x51']), ('\u211b', &['\x52']), ('\u211c', &['\x52']), ('\u211d', &['\x52']), ('\u2120', &['\x53', '\x4d']), ('\u2121', &['\x54', '\x45', '\x4c']), ('\u2122', &['\x54', '\x4d']), ('\u2124', &['\x5a']), ('\u2128', &['\x5a']), ('\u212c', &['\x42']), ('\u212d', &['\x43']), ('\u212f', &['\x65']), ('\u2130', &['\x45']), ('\u2131', &['\x46']), ('\u2133', &['\x4d']), ('\u2134', &['\x6f']), ('\u2135', &['\u05d0']), ('\u2136', &['\u05d1']), ('\u2137', &['\u05d2']), ('\u2138', &['\u05d3']), ('\u2139', &['\x69']), ('\u213b', &['\x46', '\x41', '\x58']), ('\u213c', &['\u03c0']), ('\u213d', &['\u03b3']), ('\u213e', &['\u0393']), ('\u213f', &['\u03a0']), ('\u2140', &['\u2211']), ('\u2145', &['\x44']), ('\u2146', &['\x64']), ('\u2147', &['\x65']), ('\u2148', &['\x69']), ('\u2149', &['\x6a']), ('\u2150', &['\x31', '\u2044', '\x37']), ('\u2151', &['\x31', '\u2044', '\x39']), ('\u2152', &['\x31', '\u2044', '\x31', '\x30']), ('\u2153', &['\x31', '\u2044', '\x33']), ('\u2154', &['\x32', '\u2044', '\x33']), ('\u2155', &['\x31', '\u2044', '\x35']), ('\u2156', &['\x32', '\u2044', '\x35']), ('\u2157', &['\x33', '\u2044', '\x35']), ('\u2158', &['\x34', '\u2044', '\x35']), ('\u2159', &['\x31', '\u2044', '\x36']), ('\u215a', &['\x35', '\u2044', '\x36']), ('\u215b', &['\x31', '\u2044', '\x38']), ('\u215c', &['\x33', '\u2044', '\x38']), ('\u215d', &['\x35', '\u2044', '\x38']), ('\u215e', &['\x37', '\u2044', '\x38']), ('\u215f', &['\x31', '\u2044']), ('\u2160', &['\x49']), ('\u2161', &['\x49', '\x49']), ('\u2162', &['\x49', '\x49', '\x49']), ('\u2163', &['\x49', '\x56']), ('\u2164', &['\x56']), ('\u2165', &['\x56', '\x49']), ('\u2166', &['\x56', '\x49', '\x49']), ('\u2167', &['\x56', '\x49', '\x49', '\x49']), ('\u2168', &['\x49', '\x58']), ('\u2169', &['\x58']), ('\u216a', &['\x58', '\x49']), ('\u216b', &['\x58', '\x49', '\x49']), ('\u216c', &['\x4c']), ('\u216d', &['\x43']), ('\u216e', &['\x44']), ('\u216f', &['\x4d']), ('\u2170', &['\x69']), ('\u2171', &['\x69', '\x69']), ('\u2172', &['\x69', '\x69', '\x69']), ('\u2173', &['\x69', '\x76']), ('\u2174', &['\x76']), ('\u2175', &['\x76', '\x69']), ('\u2176', &['\x76', '\x69', '\x69']), ('\u2177', &['\x76', '\x69', '\x69', '\x69']), ('\u2178', &['\x69', '\x78']), ('\u2179', &['\x78']), ('\u217a', &['\x78', '\x69']), ('\u217b', &['\x78', '\x69', '\x69']), ('\u217c', &['\x6c']), ('\u217d', &['\x63']), ('\u217e', &['\x64']), ('\u217f', &['\x6d']), ('\u2189', &['\x30', '\u2044', '\x33']), ('\u222c', &['\u222b', '\u222b']), ('\u222d', &['\u222b', '\u222b', '\u222b']), ('\u222f', &['\u222e', '\u222e']), ('\u2230', &['\u222e', '\u222e', '\u222e']), ('\u2460', &['\x31']), ('\u2461', &['\x32']), ('\u2462', &['\x33']), ('\u2463', &['\x34']), ('\u2464', &['\x35']), ('\u2465', &['\x36']), ('\u2466', &['\x37']), ('\u2467', &['\x38']), ('\u2468', &['\x39']), ('\u2469', &['\x31', '\x30']), ('\u246a', &['\x31', '\x31']), ('\u246b', &['\x31', '\x32']), ('\u246c', &['\x31', '\x33']), ('\u246d', &['\x31', '\x34']), ('\u246e', &['\x31', '\x35']), ('\u246f', &['\x31', '\x36']), ('\u2470', &['\x31', '\x37']), ('\u2471', &['\x31', '\x38']), ('\u2472', &['\x31', '\x39']), ('\u2473', &['\x32', '\x30']), ('\u2474', &['\x28', '\x31', '\x29']), ('\u2475', &['\x28', '\x32', '\x29']), ('\u2476', &['\x28', '\x33', '\x29']), ('\u2477', &['\x28', '\x34', '\x29']), ('\u2478', &['\x28', '\x35', '\x29']), ('\u2479', &['\x28', '\x36', '\x29']), ('\u247a', &['\x28', '\x37', '\x29']), ('\u247b', &['\x28', '\x38', '\x29']), ('\u247c', &['\x28', '\x39', '\x29']), ('\u247d', &['\x28', '\x31', '\x30', '\x29']), ('\u247e', &['\x28', '\x31', '\x31', '\x29']), ('\u247f', &['\x28', '\x31', '\x32', '\x29']), ('\u2480', &['\x28', '\x31', '\x33', '\x29']), ('\u2481', &['\x28', '\x31', '\x34', '\x29']), ('\u2482', &['\x28', '\x31', '\x35', '\x29']), ('\u2483', &['\x28', '\x31', '\x36', '\x29']), ('\u2484', &['\x28', '\x31', '\x37', '\x29']), ('\u2485', &['\x28', '\x31', '\x38', '\x29']), ('\u2486', &['\x28', '\x31', '\x39', '\x29']), ('\u2487', &['\x28', '\x32', '\x30', '\x29']), ('\u2488', &['\x31', '\x2e']), ('\u2489', &['\x32', '\x2e']), ('\u248a', &['\x33', '\x2e']), ('\u248b', &['\x34', '\x2e']), ('\u248c', &['\x35', '\x2e']), ('\u248d', &['\x36', '\x2e']), ('\u248e', &['\x37', '\x2e']), ('\u248f', &['\x38', '\x2e']), ('\u2490', &['\x39', '\x2e']), ('\u2491', &['\x31', '\x30', '\x2e']), ('\u2492', &['\x31', '\x31', '\x2e']), ('\u2493', &['\x31', '\x32', '\x2e']), ('\u2494', &['\x31', '\x33', '\x2e']), ('\u2495', &['\x31', '\x34', '\x2e']), ('\u2496', &['\x31', '\x35', '\x2e']), ('\u2497', &['\x31', '\x36', '\x2e']), ('\u2498', &['\x31', '\x37', '\x2e']), ('\u2499', &['\x31', '\x38', '\x2e']), ('\u249a', &['\x31', '\x39', '\x2e']), ('\u249b', &['\x32', '\x30', '\x2e']), ('\u249c', &['\x28', '\x61', '\x29']), ('\u249d', &['\x28', '\x62', '\x29']), ('\u249e', &['\x28', '\x63', '\x29']), ('\u249f', &['\x28', '\x64', '\x29']), ('\u24a0', &['\x28', '\x65', '\x29']), ('\u24a1', &['\x28', '\x66', '\x29']), ('\u24a2', &['\x28', '\x67', '\x29']), ('\u24a3', &['\x28', '\x68', '\x29']), ('\u24a4', &['\x28', '\x69', '\x29']), ('\u24a5', &['\x28', '\x6a', '\x29']), ('\u24a6', &['\x28', '\x6b', '\x29']), ('\u24a7', &['\x28', '\x6c', '\x29']), ('\u24a8', &['\x28', '\x6d', '\x29']), ('\u24a9', &['\x28', '\x6e', '\x29']), ('\u24aa', &['\x28', '\x6f', '\x29']), ('\u24ab', &['\x28', '\x70', '\x29']), ('\u24ac', &['\x28', '\x71', '\x29']), ('\u24ad', &['\x28', '\x72', '\x29']), ('\u24ae', &['\x28', '\x73', '\x29']), ('\u24af', &['\x28', '\x74', '\x29']), ('\u24b0', &['\x28', '\x75', '\x29']), ('\u24b1', &['\x28', '\x76', '\x29']), ('\u24b2', &['\x28', '\x77', '\x29']), ('\u24b3', &['\x28', '\x78', '\x29']), ('\u24b4', &['\x28', '\x79', '\x29']), ('\u24b5', &['\x28', '\x7a', '\x29']), ('\u24b6', &['\x41']), ('\u24b7', &['\x42']), ('\u24b8', &['\x43']), ('\u24b9', &['\x44']), ('\u24ba', &['\x45']), ('\u24bb', &['\x46']), ('\u24bc', &['\x47']), ('\u24bd', &['\x48']), ('\u24be', &['\x49']), ('\u24bf', &['\x4a']), ('\u24c0', &['\x4b']), ('\u24c1', &['\x4c']), ('\u24c2', &['\x4d']), ('\u24c3', &['\x4e']), ('\u24c4', &['\x4f']), ('\u24c5', &['\x50']), ('\u24c6', &['\x51']), ('\u24c7', &['\x52']), ('\u24c8', &['\x53']), ('\u24c9', &['\x54']), ('\u24ca', &['\x55']), ('\u24cb', &['\x56']), ('\u24cc', &['\x57']), ('\u24cd', &['\x58']), ('\u24ce', &['\x59']), ('\u24cf', &['\x5a']), ('\u24d0', &['\x61']), ('\u24d1', &['\x62']), ('\u24d2', &['\x63']), ('\u24d3', &['\x64']), ('\u24d4', &['\x65']), ('\u24d5', &['\x66']), ('\u24d6', &['\x67']), ('\u24d7', &['\x68']), ('\u24d8', &['\x69']), ('\u24d9', &['\x6a']), ('\u24da', &['\x6b']), ('\u24db', &['\x6c']), ('\u24dc', &['\x6d']), ('\u24dd', &['\x6e']), ('\u24de', &['\x6f']), ('\u24df', &['\x70']), ('\u24e0', &['\x71']), ('\u24e1', &['\x72']), ('\u24e2', &['\x73']), ('\u24e3', &['\x74']), ('\u24e4', &['\x75']), ('\u24e5', &['\x76']), ('\u24e6', &['\x77']), ('\u24e7', &['\x78']), ('\u24e8', &['\x79']), ('\u24e9', &['\x7a']), ('\u24ea', &['\x30']), ('\u2a0c', &['\u222b', '\u222b', '\u222b', '\u222b']), ('\u2a74', &['\x3a', '\x3a', '\x3d']), ('\u2a75', &['\x3d', '\x3d']), ('\u2a76', &['\x3d', '\x3d', '\x3d']), ('\u2c7c', &['\x6a']), ('\u2c7d', &['\x56']), ('\u2d6f', &['\u2d61']), ('\u2e9f', &['\u6bcd']), ('\u2ef3', &['\u9f9f']), ('\u2f00', &['\u4e00']), ('\u2f01', &['\u4e28']), ('\u2f02', &['\u4e36']), ('\u2f03', &['\u4e3f']), ('\u2f04', &['\u4e59']), ('\u2f05', &['\u4e85']), ('\u2f06', &['\u4e8c']), ('\u2f07', &['\u4ea0']), ('\u2f08', &['\u4eba']), ('\u2f09', &['\u513f']), ('\u2f0a', &['\u5165']), ('\u2f0b', &['\u516b']), ('\u2f0c', &['\u5182']), ('\u2f0d', &['\u5196']), ('\u2f0e', &['\u51ab']), ('\u2f0f', &['\u51e0']), ('\u2f10', &['\u51f5']), ('\u2f11', &['\u5200']), ('\u2f12', &['\u529b']), ('\u2f13', &['\u52f9']), ('\u2f14', &['\u5315']), ('\u2f15', &['\u531a']), ('\u2f16', &['\u5338']), ('\u2f17', &['\u5341']), ('\u2f18', &['\u535c']), ('\u2f19', &['\u5369']), ('\u2f1a', &['\u5382']), ('\u2f1b', &['\u53b6']), ('\u2f1c', &['\u53c8']), ('\u2f1d', &['\u53e3']), ('\u2f1e', &['\u56d7']), ('\u2f1f', &['\u571f']), ('\u2f20', &['\u58eb']), ('\u2f21', &['\u5902']), ('\u2f22', &['\u590a']), ('\u2f23', &['\u5915']), ('\u2f24', &['\u5927']), ('\u2f25', &['\u5973']), ('\u2f26', &['\u5b50']), ('\u2f27', &['\u5b80']), ('\u2f28', &['\u5bf8']), ('\u2f29', &['\u5c0f']), ('\u2f2a', &['\u5c22']), ('\u2f2b', &['\u5c38']), ('\u2f2c', &['\u5c6e']), ('\u2f2d', &['\u5c71']), ('\u2f2e', &['\u5ddb']), ('\u2f2f', &['\u5de5']), ('\u2f30', &['\u5df1']), ('\u2f31', &['\u5dfe']), ('\u2f32', &['\u5e72']), ('\u2f33', &['\u5e7a']), ('\u2f34', &['\u5e7f']), ('\u2f35', &['\u5ef4']), ('\u2f36', &['\u5efe']), ('\u2f37', &['\u5f0b']), ('\u2f38', &['\u5f13']), ('\u2f39', &['\u5f50']), ('\u2f3a', &['\u5f61']), ('\u2f3b', &['\u5f73']), ('\u2f3c', &['\u5fc3']), ('\u2f3d', &['\u6208']), ('\u2f3e', &['\u6236']), ('\u2f3f', &['\u624b']), ('\u2f40', &['\u652f']), ('\u2f41', &['\u6534']), ('\u2f42', &['\u6587']), ('\u2f43', &['\u6597']), ('\u2f44', &['\u65a4']), ('\u2f45', &['\u65b9']), ('\u2f46', &['\u65e0']), ('\u2f47', &['\u65e5']), ('\u2f48', &['\u66f0']), ('\u2f49', &['\u6708']), ('\u2f4a', &['\u6728']), ('\u2f4b', &['\u6b20']), ('\u2f4c', &['\u6b62']), ('\u2f4d', &['\u6b79']), ('\u2f4e', &['\u6bb3']), ('\u2f4f', &['\u6bcb']), ('\u2f50', &['\u6bd4']), ('\u2f51', &['\u6bdb']), ('\u2f52', &['\u6c0f']), ('\u2f53', &['\u6c14']), ('\u2f54', &['\u6c34']), ('\u2f55', &['\u706b']), ('\u2f56', &['\u722a']), ('\u2f57', &['\u7236']), ('\u2f58', &['\u723b']), ('\u2f59', &['\u723f']), ('\u2f5a', &['\u7247']), ('\u2f5b', &['\u7259']), ('\u2f5c', &['\u725b']), ('\u2f5d', &['\u72ac']), ('\u2f5e', &['\u7384']), ('\u2f5f', &['\u7389']), ('\u2f60', &['\u74dc']), ('\u2f61', &['\u74e6']), ('\u2f62', &['\u7518']), ('\u2f63', &['\u751f']), ('\u2f64', &['\u7528']), ('\u2f65', &['\u7530']), ('\u2f66', &['\u758b']), ('\u2f67', &['\u7592']), ('\u2f68', &['\u7676']), ('\u2f69', &['\u767d']), ('\u2f6a', &['\u76ae']), ('\u2f6b', &['\u76bf']), ('\u2f6c', &['\u76ee']), ('\u2f6d', &['\u77db']), ('\u2f6e', &['\u77e2']), ('\u2f6f', &['\u77f3']), ('\u2f70', &['\u793a']), ('\u2f71', &['\u79b8']), ('\u2f72', &['\u79be']), ('\u2f73', &['\u7a74']), ('\u2f74', &['\u7acb']), ('\u2f75', &['\u7af9']), ('\u2f76', &['\u7c73']), ('\u2f77', &['\u7cf8']), ('\u2f78', &['\u7f36']), ('\u2f79', &['\u7f51']), ('\u2f7a', &['\u7f8a']), ('\u2f7b', &['\u7fbd']), ('\u2f7c', &['\u8001']), ('\u2f7d', &['\u800c']), ('\u2f7e', &['\u8012']), ('\u2f7f', &['\u8033']), ('\u2f80', &['\u807f']), ('\u2f81', &['\u8089']), ('\u2f82', &['\u81e3']), ('\u2f83', &['\u81ea']), ('\u2f84', &['\u81f3']), ('\u2f85', &['\u81fc']), ('\u2f86', &['\u820c']), ('\u2f87', &['\u821b']), ('\u2f88', &['\u821f']), ('\u2f89', &['\u826e']), ('\u2f8a', &['\u8272']), ('\u2f8b', &['\u8278']), ('\u2f8c', &['\u864d']), ('\u2f8d', &['\u866b']), ('\u2f8e', &['\u8840']), ('\u2f8f', &['\u884c']), ('\u2f90', &['\u8863']), ('\u2f91', &['\u897e']), ('\u2f92', &['\u898b']), ('\u2f93', &['\u89d2']), ('\u2f94', &['\u8a00']), ('\u2f95', &['\u8c37']), ('\u2f96', &['\u8c46']), ('\u2f97', &['\u8c55']), ('\u2f98', &['\u8c78']), ('\u2f99', &['\u8c9d']), ('\u2f9a', &['\u8d64']), ('\u2f9b', &['\u8d70']), ('\u2f9c', &['\u8db3']), ('\u2f9d', &['\u8eab']), ('\u2f9e', &['\u8eca']), ('\u2f9f', &['\u8f9b']), ('\u2fa0', &['\u8fb0']), ('\u2fa1', &['\u8fb5']), ('\u2fa2', &['\u9091']), ('\u2fa3', &['\u9149']), ('\u2fa4', &['\u91c6']), ('\u2fa5', &['\u91cc']), ('\u2fa6', &['\u91d1']), ('\u2fa7', &['\u9577']), ('\u2fa8', &['\u9580']), ('\u2fa9', &['\u961c']), ('\u2faa', &['\u96b6']), ('\u2fab', &['\u96b9']), ('\u2fac', &['\u96e8']), ('\u2fad', &['\u9751']), ('\u2fae', &['\u975e']), ('\u2faf', &['\u9762']), ('\u2fb0', &['\u9769']), ('\u2fb1', &['\u97cb']), ('\u2fb2', &['\u97ed']), ('\u2fb3', &['\u97f3']), ('\u2fb4', &['\u9801']), ('\u2fb5', &['\u98a8']), ('\u2fb6', &['\u98db']), ('\u2fb7', &['\u98df']), ('\u2fb8', &['\u9996']), ('\u2fb9', &['\u9999']), ('\u2fba', &['\u99ac']), ('\u2fbb', &['\u9aa8']), ('\u2fbc', &['\u9ad8']), ('\u2fbd', &['\u9adf']), ('\u2fbe', &['\u9b25']), ('\u2fbf', &['\u9b2f']), ('\u2fc0', &['\u9b32']), ('\u2fc1', &['\u9b3c']), ('\u2fc2', &['\u9b5a']), ('\u2fc3', &['\u9ce5']), ('\u2fc4', &['\u9e75']), ('\u2fc5', &['\u9e7f']), ('\u2fc6', &['\u9ea5']), ('\u2fc7', &['\u9ebb']), ('\u2fc8', &['\u9ec3']), ('\u2fc9', &['\u9ecd']), ('\u2fca', &['\u9ed1']), ('\u2fcb', &['\u9ef9']), ('\u2fcc', &['\u9efd']), ('\u2fcd', &['\u9f0e']), ('\u2fce', &['\u9f13']), ('\u2fcf', &['\u9f20']), ('\u2fd0', &['\u9f3b']), ('\u2fd1', &['\u9f4a']), ('\u2fd2', &['\u9f52']), ('\u2fd3', &['\u9f8d']), ('\u2fd4', &['\u9f9c']), ('\u2fd5', &['\u9fa0']), ('\u3000', &['\x20']), ('\u3036', &['\u3012']), ('\u3038', &['\u5341']), ('\u3039', &['\u5344']), ('\u303a', &['\u5345']), ('\u309b', &['\x20', '\u3099']), ('\u309c', &['\x20', '\u309a']), ('\u309f', &['\u3088', '\u308a']), ('\u30ff', &['\u30b3', '\u30c8']), ('\u3131', &['\u1100']), ('\u3132', &['\u1101']), ('\u3133', &['\u11aa']), ('\u3134', &['\u1102']), ('\u3135', &['\u11ac']), ('\u3136', &['\u11ad']), ('\u3137', &['\u1103']), ('\u3138', &['\u1104']), ('\u3139', &['\u1105']), ('\u313a', &['\u11b0']), ('\u313b', &['\u11b1']), ('\u313c', &['\u11b2']), ('\u313d', &['\u11b3']), ('\u313e', &['\u11b4']), ('\u313f', &['\u11b5']), ('\u3140', &['\u111a']), ('\u3141', &['\u1106']), ('\u3142', &['\u1107']), ('\u3143', &['\u1108']), ('\u3144', &['\u1121']), ('\u3145', &['\u1109']), ('\u3146', &['\u110a']), ('\u3147', &['\u110b']), ('\u3148', &['\u110c']), ('\u3149', &['\u110d']), ('\u314a', &['\u110e']), ('\u314b', &['\u110f']), ('\u314c', &['\u1110']), ('\u314d', &['\u1111']), ('\u314e', &['\u1112']), ('\u314f', &['\u1161']), ('\u3150', &['\u1162']), ('\u3151', &['\u1163']), ('\u3152', &['\u1164']), ('\u3153', &['\u1165']), ('\u3154', &['\u1166']), ('\u3155', &['\u1167']), ('\u3156', &['\u1168']), ('\u3157', &['\u1169']), ('\u3158', &['\u116a']), ('\u3159', &['\u116b']), ('\u315a', &['\u116c']), ('\u315b', &['\u116d']), ('\u315c', &['\u116e']), ('\u315d', &['\u116f']), ('\u315e', &['\u1170']), ('\u315f', &['\u1171']), ('\u3160', &['\u1172']), ('\u3161', &['\u1173']), ('\u3162', &['\u1174']), ('\u3163', &['\u1175']), ('\u3164', &['\u1160']), ('\u3165', &['\u1114']), ('\u3166', &['\u1115']), ('\u3167', &['\u11c7']), ('\u3168', &['\u11c8']), ('\u3169', &['\u11cc']), ('\u316a', &['\u11ce']), ('\u316b', &['\u11d3']), ('\u316c', &['\u11d7']), ('\u316d', &['\u11d9']), ('\u316e', &['\u111c']), ('\u316f', &['\u11dd']), ('\u3170', &['\u11df']), ('\u3171', &['\u111d']), ('\u3172', &['\u111e']), ('\u3173', &['\u1120']), ('\u3174', &['\u1122']), ('\u3175', &['\u1123']), ('\u3176', &['\u1127']), ('\u3177', &['\u1129']), ('\u3178', &['\u112b']), ('\u3179', &['\u112c']), ('\u317a', &['\u112d']), ('\u317b', &['\u112e']), ('\u317c', &['\u112f']), ('\u317d', &['\u1132']), ('\u317e', &['\u1136']), ('\u317f', &['\u1140']), ('\u3180', &['\u1147']), ('\u3181', &['\u114c']), ('\u3182', &['\u11f1']), ('\u3183', &['\u11f2']), ('\u3184', &['\u1157']), ('\u3185', &['\u1158']), ('\u3186', &['\u1159']), ('\u3187', &['\u1184']), ('\u3188', &['\u1185']), ('\u3189', &['\u1188']), ('\u318a', &['\u1191']), ('\u318b', &['\u1192']), ('\u318c', &['\u1194']), ('\u318d', &['\u119e']), ('\u318e', &['\u11a1']), ('\u3192', &['\u4e00']), ('\u3193', &['\u4e8c']), ('\u3194', &['\u4e09']), ('\u3195', &['\u56db']), ('\u3196', &['\u4e0a']), ('\u3197', &['\u4e2d']), ('\u3198', &['\u4e0b']), ('\u3199', &['\u7532']), ('\u319a', &['\u4e59']), ('\u319b', &['\u4e19']), ('\u319c', &['\u4e01']), ('\u319d', &['\u5929']), ('\u319e', &['\u5730']), ('\u319f', &['\u4eba']), ('\u3200', &['\x28', '\u1100', '\x29']), ('\u3201', &['\x28', '\u1102', '\x29']), ('\u3202', &['\x28', '\u1103', '\x29']), ('\u3203', &['\x28', '\u1105', '\x29']), ('\u3204', &['\x28', '\u1106', '\x29']), ('\u3205', &['\x28', '\u1107', '\x29']), ('\u3206', &['\x28', '\u1109', '\x29']), ('\u3207', &['\x28', '\u110b', '\x29']), ('\u3208', &['\x28', '\u110c', '\x29']), ('\u3209', &['\x28', '\u110e', '\x29']), ('\u320a', &['\x28', '\u110f', '\x29']), ('\u320b', &['\x28', '\u1110', '\x29']), ('\u320c', &['\x28', '\u1111', '\x29']), ('\u320d', &['\x28', '\u1112', '\x29']), ('\u320e', &['\x28', '\u1100', '\u1161', '\x29']), ('\u320f', &['\x28', '\u1102', '\u1161', '\x29']), ('\u3210', &['\x28', '\u1103', '\u1161', '\x29']), ('\u3211', &['\x28', '\u1105', '\u1161', '\x29']), ('\u3212', &['\x28', '\u1106', '\u1161', '\x29']), ('\u3213', &['\x28', '\u1107', '\u1161', '\x29']), ('\u3214', &['\x28', '\u1109', '\u1161', '\x29']), ('\u3215', &['\x28', '\u110b', '\u1161', '\x29']), ('\u3216', &['\x28', '\u110c', '\u1161', '\x29']), ('\u3217', &['\x28', '\u110e', '\u1161', '\x29']), ('\u3218', &['\x28', '\u110f', '\u1161', '\x29']), ('\u3219', &['\x28', '\u1110', '\u1161', '\x29']), ('\u321a', &['\x28', '\u1111', '\u1161', '\x29']), ('\u321b', &['\x28', '\u1112', '\u1161', '\x29']), ('\u321c', &['\x28', '\u110c', '\u116e', '\x29']), ('\u321d', &['\x28', '\u110b', '\u1169', '\u110c', '\u1165', '\u11ab', '\x29']), ('\u321e', &['\x28', '\u110b', '\u1169', '\u1112', '\u116e', '\x29']), ('\u3220', &['\x28', '\u4e00', '\x29']), ('\u3221', &['\x28', '\u4e8c', '\x29']), ('\u3222', &['\x28', '\u4e09', '\x29']), ('\u3223', &['\x28', '\u56db', '\x29']), ('\u3224', &['\x28', '\u4e94', '\x29']), ('\u3225', &['\x28', '\u516d', '\x29']), ('\u3226', &['\x28', '\u4e03', '\x29']), ('\u3227', &['\x28', '\u516b', '\x29']), ('\u3228', &['\x28', '\u4e5d', '\x29']), ('\u3229', &['\x28', '\u5341', '\x29']), ('\u322a', &['\x28', '\u6708', '\x29']), ('\u322b', &['\x28', '\u706b', '\x29']), ('\u322c', &['\x28', '\u6c34', '\x29']), ('\u322d', &['\x28', '\u6728', '\x29']), ('\u322e', &['\x28', '\u91d1', '\x29']), ('\u322f', &['\x28', '\u571f', '\x29']), ('\u3230', &['\x28', '\u65e5', '\x29']), ('\u3231', &['\x28', '\u682a', '\x29']), ('\u3232', &['\x28', '\u6709', '\x29']), ('\u3233', &['\x28', '\u793e', '\x29']), ('\u3234', &['\x28', '\u540d', '\x29']), ('\u3235', &['\x28', '\u7279', '\x29']), ('\u3236', &['\x28', '\u8ca1', '\x29']), ('\u3237', &['\x28', '\u795d', '\x29']), ('\u3238', &['\x28', '\u52b4', '\x29']), ('\u3239', &['\x28', '\u4ee3', '\x29']), ('\u323a', &['\x28', '\u547c', '\x29']), ('\u323b', &['\x28', '\u5b66', '\x29']), ('\u323c', &['\x28', '\u76e3', '\x29']), ('\u323d', &['\x28', '\u4f01', '\x29']), ('\u323e', &['\x28', '\u8cc7', '\x29']), ('\u323f', &['\x28', '\u5354', '\x29']), ('\u3240', &['\x28', '\u796d', '\x29']), ('\u3241', &['\x28', '\u4f11', '\x29']), ('\u3242', &['\x28', '\u81ea', '\x29']), ('\u3243', &['\x28', '\u81f3', '\x29']), ('\u3244', &['\u554f']), ('\u3245', &['\u5e7c']), ('\u3246', &['\u6587']), ('\u3247', &['\u7b8f']), ('\u3250', &['\x50', '\x54', '\x45']), ('\u3251', &['\x32', '\x31']), ('\u3252', &['\x32', '\x32']), ('\u3253', &['\x32', '\x33']), ('\u3254', &['\x32', '\x34']), ('\u3255', &['\x32', '\x35']), ('\u3256', &['\x32', '\x36']), ('\u3257', &['\x32', '\x37']), ('\u3258', &['\x32', '\x38']), ('\u3259', &['\x32', '\x39']), ('\u325a', &['\x33', '\x30']), ('\u325b', &['\x33', '\x31']), ('\u325c', &['\x33', '\x32']), ('\u325d', &['\x33', '\x33']), ('\u325e', &['\x33', '\x34']), ('\u325f', &['\x33', '\x35']), ('\u3260', &['\u1100']), ('\u3261', &['\u1102']), ('\u3262', &['\u1103']), ('\u3263', &['\u1105']), ('\u3264', &['\u1106']), ('\u3265', &['\u1107']), ('\u3266', &['\u1109']), ('\u3267', &['\u110b']), ('\u3268', &['\u110c']), ('\u3269', &['\u110e']), ('\u326a', &['\u110f']), ('\u326b', &['\u1110']), ('\u326c', &['\u1111']), ('\u326d', &['\u1112']), ('\u326e', &['\u1100', '\u1161']), ('\u326f', &['\u1102', '\u1161']), ('\u3270', &['\u1103', '\u1161']), ('\u3271', &['\u1105', '\u1161']), ('\u3272', &['\u1106', '\u1161']), ('\u3273', &['\u1107', '\u1161']), ('\u3274', &['\u1109', '\u1161']), ('\u3275', &['\u110b', '\u1161']), ('\u3276', &['\u110c', '\u1161']), ('\u3277', &['\u110e', '\u1161']), ('\u3278', &['\u110f', '\u1161']), ('\u3279', &['\u1110', '\u1161']), ('\u327a', &['\u1111', '\u1161']), ('\u327b', &['\u1112', '\u1161']), ('\u327c', &['\u110e', '\u1161', '\u11b7', '\u1100', '\u1169']), ('\u327d', &['\u110c', '\u116e', '\u110b', '\u1174']), ('\u327e', &['\u110b', '\u116e']), ('\u3280', &['\u4e00']), ('\u3281', &['\u4e8c']), ('\u3282', &['\u4e09']), ('\u3283', &['\u56db']), ('\u3284', &['\u4e94']), ('\u3285', &['\u516d']), ('\u3286', &['\u4e03']), ('\u3287', &['\u516b']), ('\u3288', &['\u4e5d']), ('\u3289', &['\u5341']), ('\u328a', &['\u6708']), ('\u328b', &['\u706b']), ('\u328c', &['\u6c34']), ('\u328d', &['\u6728']), ('\u328e', &['\u91d1']), ('\u328f', &['\u571f']), ('\u3290', &['\u65e5']), ('\u3291', &['\u682a']), ('\u3292', &['\u6709']), ('\u3293', &['\u793e']), ('\u3294', &['\u540d']), ('\u3295', &['\u7279']), ('\u3296', &['\u8ca1']), ('\u3297', &['\u795d']), ('\u3298', &['\u52b4']), ('\u3299', &['\u79d8']), ('\u329a', &['\u7537']), ('\u329b', &['\u5973']), ('\u329c', &['\u9069']), ('\u329d', &['\u512a']), ('\u329e', &['\u5370']), ('\u329f', &['\u6ce8']), ('\u32a0', &['\u9805']), ('\u32a1', &['\u4f11']), ('\u32a2', &['\u5199']), ('\u32a3', &['\u6b63']), ('\u32a4', &['\u4e0a']), ('\u32a5', &['\u4e2d']), ('\u32a6', &['\u4e0b']), ('\u32a7', &['\u5de6']), ('\u32a8', &['\u53f3']), ('\u32a9', &['\u533b']), ('\u32aa', &['\u5b97']), ('\u32ab', &['\u5b66']), ('\u32ac', &['\u76e3']), ('\u32ad', &['\u4f01']), ('\u32ae', &['\u8cc7']), ('\u32af', &['\u5354']), ('\u32b0', &['\u591c']), ('\u32b1', &['\x33', '\x36']), ('\u32b2', &['\x33', '\x37']), ('\u32b3', &['\x33', '\x38']), ('\u32b4', &['\x33', '\x39']), ('\u32b5', &['\x34', '\x30']), ('\u32b6', &['\x34', '\x31']), ('\u32b7', &['\x34', '\x32']), ('\u32b8', &['\x34', '\x33']), ('\u32b9', &['\x34', '\x34']), ('\u32ba', &['\x34', '\x35']), ('\u32bb', &['\x34', '\x36']), ('\u32bc', &['\x34', '\x37']), ('\u32bd', &['\x34', '\x38']), ('\u32be', &['\x34', '\x39']), ('\u32bf', &['\x35', '\x30']), ('\u32c0', &['\x31', '\u6708']), ('\u32c1', &['\x32', '\u6708']), ('\u32c2', &['\x33', '\u6708']), ('\u32c3', &['\x34', '\u6708']), ('\u32c4', &['\x35', '\u6708']), ('\u32c5', &['\x36', '\u6708']), ('\u32c6', &['\x37', '\u6708']), ('\u32c7', &['\x38', '\u6708']), ('\u32c8', &['\x39', '\u6708']), ('\u32c9', &['\x31', '\x30', '\u6708']), ('\u32ca', &['\x31', '\x31', '\u6708']), ('\u32cb', &['\x31', '\x32', '\u6708']), ('\u32cc', &['\x48', '\x67']), ('\u32cd', &['\x65', '\x72', '\x67']), ('\u32ce', &['\x65', '\x56']), ('\u32cf', &['\x4c', '\x54', '\x44']), ('\u32d0', &['\u30a2']), ('\u32d1', &['\u30a4']), ('\u32d2', &['\u30a6']), ('\u32d3', &['\u30a8']), ('\u32d4', &['\u30aa']), ('\u32d5', &['\u30ab']), ('\u32d6', &['\u30ad']), ('\u32d7', &['\u30af']), ('\u32d8', &['\u30b1']), ('\u32d9', &['\u30b3']), ('\u32da', &['\u30b5']), ('\u32db', &['\u30b7']), ('\u32dc', &['\u30b9']), ('\u32dd', &['\u30bb']), ('\u32de', &['\u30bd']), ('\u32df', &['\u30bf']), ('\u32e0', &['\u30c1']), ('\u32e1', &['\u30c4']), ('\u32e2', &['\u30c6']), ('\u32e3', &['\u30c8']), ('\u32e4', &['\u30ca']), ('\u32e5', &['\u30cb']), ('\u32e6', &['\u30cc']), ('\u32e7', &['\u30cd']), ('\u32e8', &['\u30ce']), ('\u32e9', &['\u30cf']), ('\u32ea', &['\u30d2']), ('\u32eb', &['\u30d5']), ('\u32ec', &['\u30d8']), ('\u32ed', &['\u30db']), ('\u32ee', &['\u30de']), ('\u32ef', &['\u30df']), ('\u32f0', &['\u30e0']), ('\u32f1', &['\u30e1']), ('\u32f2', &['\u30e2']), ('\u32f3', &['\u30e4']), ('\u32f4', &['\u30e6']), ('\u32f5', &['\u30e8']), ('\u32f6', &['\u30e9']), ('\u32f7', &['\u30ea']), ('\u32f8', &['\u30eb']), ('\u32f9', &['\u30ec']), ('\u32fa', &['\u30ed']), ('\u32fb', &['\u30ef']), ('\u32fc', &['\u30f0']), ('\u32fd', &['\u30f1']), ('\u32fe', &['\u30f2']), ('\u3300', &['\u30a2', '\u30d1', '\u30fc', '\u30c8']), ('\u3301', &['\u30a2', '\u30eb', '\u30d5', '\u30a1']), ('\u3302', &['\u30a2', '\u30f3', '\u30da', '\u30a2']), ('\u3303', &['\u30a2', '\u30fc', '\u30eb']), ('\u3304', &['\u30a4', '\u30cb', '\u30f3', '\u30b0']), ('\u3305', &['\u30a4', '\u30f3', '\u30c1']), ('\u3306', &['\u30a6', '\u30a9', '\u30f3']), ('\u3307', &['\u30a8', '\u30b9', '\u30af', '\u30fc', '\u30c9']), ('\u3308', &['\u30a8', '\u30fc', '\u30ab', '\u30fc']), ('\u3309', &['\u30aa', '\u30f3', '\u30b9']), ('\u330a', &['\u30aa', '\u30fc', '\u30e0']), ('\u330b', &['\u30ab', '\u30a4', '\u30ea']), ('\u330c', &['\u30ab', '\u30e9', '\u30c3', '\u30c8']), ('\u330d', &['\u30ab', '\u30ed', '\u30ea', '\u30fc']), ('\u330e', &['\u30ac', '\u30ed', '\u30f3']), ('\u330f', &['\u30ac', '\u30f3', '\u30de']), ('\u3310', &['\u30ae', '\u30ac']), ('\u3311', &['\u30ae', '\u30cb', '\u30fc']), ('\u3312', &['\u30ad', '\u30e5', '\u30ea', '\u30fc']), ('\u3313', &['\u30ae', '\u30eb', '\u30c0', '\u30fc']), ('\u3314', &['\u30ad', '\u30ed']), ('\u3315', &['\u30ad', '\u30ed', '\u30b0', '\u30e9', '\u30e0']), ('\u3316', &['\u30ad', '\u30ed', '\u30e1', '\u30fc', '\u30c8', '\u30eb']), ('\u3317', &['\u30ad', '\u30ed', '\u30ef', '\u30c3', '\u30c8']), ('\u3318', &['\u30b0', '\u30e9', '\u30e0']), ('\u3319', &['\u30b0', '\u30e9', '\u30e0', '\u30c8', '\u30f3']), ('\u331a', &['\u30af', '\u30eb', '\u30bc', '\u30a4', '\u30ed']), ('\u331b', &['\u30af', '\u30ed', '\u30fc', '\u30cd']), ('\u331c', &['\u30b1', '\u30fc', '\u30b9']), ('\u331d', &['\u30b3', '\u30eb', '\u30ca']), ('\u331e', &['\u30b3', '\u30fc', '\u30dd']), ('\u331f', &['\u30b5', '\u30a4', '\u30af', '\u30eb']), ('\u3320', &['\u30b5', '\u30f3', '\u30c1', '\u30fc', '\u30e0']), ('\u3321', &['\u30b7', '\u30ea', '\u30f3', '\u30b0']), ('\u3322', &['\u30bb', '\u30f3', '\u30c1']), ('\u3323', &['\u30bb', '\u30f3', '\u30c8']), ('\u3324', &['\u30c0', '\u30fc', '\u30b9']), ('\u3325', &['\u30c7', '\u30b7']), ('\u3326', &['\u30c9', '\u30eb']), ('\u3327', &['\u30c8', '\u30f3']), ('\u3328', &['\u30ca', '\u30ce']), ('\u3329', &['\u30ce', '\u30c3', '\u30c8']), ('\u332a', &['\u30cf', '\u30a4', '\u30c4']), ('\u332b', &['\u30d1', '\u30fc', '\u30bb', '\u30f3', '\u30c8']), ('\u332c', &['\u30d1', '\u30fc', '\u30c4']), ('\u332d', &['\u30d0', '\u30fc', '\u30ec', '\u30eb']), ('\u332e', &['\u30d4', '\u30a2', '\u30b9', '\u30c8', '\u30eb']), ('\u332f', &['\u30d4', '\u30af', '\u30eb']), ('\u3330', &['\u30d4', '\u30b3']), ('\u3331', &['\u30d3', '\u30eb']), ('\u3332', &['\u30d5', '\u30a1', '\u30e9', '\u30c3', '\u30c9']), ('\u3333', &['\u30d5', '\u30a3', '\u30fc', '\u30c8']), ('\u3334', &['\u30d6', '\u30c3', '\u30b7', '\u30a7', '\u30eb']), ('\u3335', &['\u30d5', '\u30e9', '\u30f3']), ('\u3336', &['\u30d8', '\u30af', '\u30bf', '\u30fc', '\u30eb']), ('\u3337', &['\u30da', '\u30bd']), ('\u3338', &['\u30da', '\u30cb', '\u30d2']), ('\u3339', &['\u30d8', '\u30eb', '\u30c4']), ('\u333a', &['\u30da', '\u30f3', '\u30b9']), ('\u333b', &['\u30da', '\u30fc', '\u30b8']), ('\u333c', &['\u30d9', '\u30fc', '\u30bf']), ('\u333d', &['\u30dd', '\u30a4', '\u30f3', '\u30c8']), ('\u333e', &['\u30dc', '\u30eb', '\u30c8']), ('\u333f', &['\u30db', '\u30f3']), ('\u3340', &['\u30dd', '\u30f3', '\u30c9']), ('\u3341', &['\u30db', '\u30fc', '\u30eb']), ('\u3342', &['\u30db', '\u30fc', '\u30f3']), ('\u3343', &['\u30de', '\u30a4', '\u30af', '\u30ed']), ('\u3344', &['\u30de', '\u30a4', '\u30eb']), ('\u3345', &['\u30de', '\u30c3', '\u30cf']), ('\u3346', &['\u30de', '\u30eb', '\u30af']), ('\u3347', &['\u30de', '\u30f3', '\u30b7', '\u30e7', '\u30f3']), ('\u3348', &['\u30df', '\u30af', '\u30ed', '\u30f3']), ('\u3349', &['\u30df', '\u30ea']), ('\u334a', &['\u30df', '\u30ea', '\u30d0', '\u30fc', '\u30eb']), ('\u334b', &['\u30e1', '\u30ac']), ('\u334c', &['\u30e1', '\u30ac', '\u30c8', '\u30f3']), ('\u334d', &['\u30e1', '\u30fc', '\u30c8', '\u30eb']), ('\u334e', &['\u30e4', '\u30fc', '\u30c9']), ('\u334f', &['\u30e4', '\u30fc', '\u30eb']), ('\u3350', &['\u30e6', '\u30a2', '\u30f3']), ('\u3351', &['\u30ea', '\u30c3', '\u30c8', '\u30eb']), ('\u3352', &['\u30ea', '\u30e9']), ('\u3353', &['\u30eb', '\u30d4', '\u30fc']), ('\u3354', &['\u30eb', '\u30fc', '\u30d6', '\u30eb']), ('\u3355', &['\u30ec', '\u30e0']), ('\u3356', &['\u30ec', '\u30f3', '\u30c8', '\u30b2', '\u30f3']), ('\u3357', &['\u30ef', '\u30c3', '\u30c8']), ('\u3358', &['\x30', '\u70b9']), ('\u3359', &['\x31', '\u70b9']), ('\u335a', &['\x32', '\u70b9']), ('\u335b', &['\x33', '\u70b9']), ('\u335c', &['\x34', '\u70b9']), ('\u335d', &['\x35', '\u70b9']), ('\u335e', &['\x36', '\u70b9']), ('\u335f', &['\x37', '\u70b9']), ('\u3360', &['\x38', '\u70b9']), ('\u3361', &['\x39', '\u70b9']), ('\u3362', &['\x31', '\x30', '\u70b9']), ('\u3363', &['\x31', '\x31', '\u70b9']), ('\u3364', &['\x31', '\x32', '\u70b9']), ('\u3365', &['\x31', '\x33', '\u70b9']), ('\u3366', &['\x31', '\x34', '\u70b9']), ('\u3367', &['\x31', '\x35', '\u70b9']), ('\u3368', &['\x31', '\x36', '\u70b9']), ('\u3369', &['\x31', '\x37', '\u70b9']), ('\u336a', &['\x31', '\x38', '\u70b9']), ('\u336b', &['\x31', '\x39', '\u70b9']), ('\u336c', &['\x32', '\x30', '\u70b9']), ('\u336d', &['\x32', '\x31', '\u70b9']), ('\u336e', &['\x32', '\x32', '\u70b9']), ('\u336f', &['\x32', '\x33', '\u70b9']), ('\u3370', &['\x32', '\x34', '\u70b9']), ('\u3371', &['\x68', '\x50', '\x61']), ('\u3372', &['\x64', '\x61']), ('\u3373', &['\x41', '\x55']), ('\u3374', &['\x62', '\x61', '\x72']), ('\u3375', &['\x6f', '\x56']), ('\u3376', &['\x70', '\x63']), ('\u3377', &['\x64', '\x6d']), ('\u3378', &['\x64', '\x6d', '\u00b2']), ('\u3379', &['\x64', '\x6d', '\u00b3']), ('\u337a', &['\x49', '\x55']), ('\u337b', &['\u5e73', '\u6210']), ('\u337c', &['\u662d', '\u548c']), ('\u337d', &['\u5927', '\u6b63']), ('\u337e', &['\u660e', '\u6cbb']), ('\u337f', &['\u682a', '\u5f0f', '\u4f1a', '\u793e']), ('\u3380', &['\x70', '\x41']), ('\u3381', &['\x6e', '\x41']), ('\u3382', &['\u03bc', '\x41']), ('\u3383', &['\x6d', '\x41']), ('\u3384', &['\x6b', '\x41']), ('\u3385', &['\x4b', '\x42']), ('\u3386', &['\x4d', '\x42']), ('\u3387', &['\x47', '\x42']), ('\u3388', &['\x63', '\x61', '\x6c']), ('\u3389', &['\x6b', '\x63', '\x61', '\x6c']), ('\u338a', &['\x70', '\x46']), ('\u338b', &['\x6e', '\x46']), ('\u338c', &['\u03bc', '\x46']), ('\u338d', &['\u03bc', '\x67']), ('\u338e', &['\x6d', '\x67']), ('\u338f', &['\x6b', '\x67']), ('\u3390', &['\x48', '\x7a']), ('\u3391', &['\x6b', '\x48', '\x7a']), ('\u3392', &['\x4d', '\x48', '\x7a']), ('\u3393', &['\x47', '\x48', '\x7a']), ('\u3394', &['\x54', '\x48', '\x7a']), ('\u3395', &['\u03bc', '\u2113']), ('\u3396', &['\x6d', '\u2113']), ('\u3397', &['\x64', '\u2113']), ('\u3398', &['\x6b', '\u2113']), ('\u3399', &['\x66', '\x6d']), ('\u339a', &['\x6e', '\x6d']), ('\u339b', &['\u03bc', '\x6d']), ('\u339c', &['\x6d', '\x6d']), ('\u339d', &['\x63', '\x6d']), ('\u339e', &['\x6b', '\x6d']), ('\u339f', &['\x6d', '\x6d', '\u00b2']), ('\u33a0', &['\x63', '\x6d', '\u00b2']), ('\u33a1', &['\x6d', '\u00b2']), ('\u33a2', &['\x6b', '\x6d', '\u00b2']), ('\u33a3', &['\x6d', '\x6d', '\u00b3']), ('\u33a4', &['\x63', '\x6d', '\u00b3']), ('\u33a5', &['\x6d', '\u00b3']), ('\u33a6', &['\x6b', '\x6d', '\u00b3']), ('\u33a7', &['\x6d', '\u2215', '\x73']), ('\u33a8', &['\x6d', '\u2215', '\x73', '\u00b2']), ('\u33a9', &['\x50', '\x61']), ('\u33aa', &['\x6b', '\x50', '\x61']), ('\u33ab', &['\x4d', '\x50', '\x61']), ('\u33ac', &['\x47', '\x50', '\x61']), ('\u33ad', &['\x72', '\x61', '\x64']), ('\u33ae', &['\x72', '\x61', '\x64', '\u2215', '\x73']), ('\u33af', &['\x72', '\x61', '\x64', '\u2215', '\x73', '\u00b2']), ('\u33b0', &['\x70', '\x73']), ('\u33b1', &['\x6e', '\x73']), ('\u33b2', &['\u03bc', '\x73']), ('\u33b3', &['\x6d', '\x73']), ('\u33b4', &['\x70', '\x56']), ('\u33b5', &['\x6e', '\x56']), ('\u33b6', &['\u03bc', '\x56']), ('\u33b7', &['\x6d', '\x56']), ('\u33b8', &['\x6b', '\x56']), ('\u33b9', &['\x4d', '\x56']), ('\u33ba', &['\x70', '\x57']), ('\u33bb', &['\x6e', '\x57']), ('\u33bc', &['\u03bc', '\x57']), ('\u33bd', &['\x6d', '\x57']), ('\u33be', &['\x6b', '\x57']), ('\u33bf', &['\x4d', '\x57']), ('\u33c0', &['\x6b', '\u03a9']), ('\u33c1', &['\x4d', '\u03a9']), ('\u33c2', &['\x61', '\x2e', '\x6d', '\x2e']), ('\u33c3', &['\x42', '\x71']), ('\u33c4', &['\x63', '\x63']), ('\u33c5', &['\x63', '\x64']), ('\u33c6', &['\x43', '\u2215', '\x6b', '\x67']), ('\u33c7', &['\x43', '\x6f', '\x2e']), ('\u33c8', &['\x64', '\x42']), ('\u33c9', &['\x47', '\x79']), ('\u33ca', &['\x68', '\x61']), ('\u33cb', &['\x48', '\x50']), ('\u33cc', &['\x69', '\x6e']), ('\u33cd', &['\x4b', '\x4b']), ('\u33ce', &['\x4b', '\x4d']), ('\u33cf', &['\x6b', '\x74']), ('\u33d0', &['\x6c', '\x6d']), ('\u33d1', &['\x6c', '\x6e']), ('\u33d2', &['\x6c', '\x6f', '\x67']), ('\u33d3', &['\x6c', '\x78']), ('\u33d4', &['\x6d', '\x62']), ('\u33d5', &['\x6d', '\x69', '\x6c']), ('\u33d6', &['\x6d', '\x6f', '\x6c']), ('\u33d7', &['\x50', '\x48']), ('\u33d8', &['\x70', '\x2e', '\x6d', '\x2e']), ('\u33d9', &['\x50', '\x50', '\x4d']), ('\u33da', &['\x50', '\x52']), ('\u33db', &['\x73', '\x72']), ('\u33dc', &['\x53', '\x76']), ('\u33dd', &['\x57', '\x62']), ('\u33de', &['\x56', '\u2215', '\x6d']), ('\u33df', &['\x41', '\u2215', '\x6d']), ('\u33e0', &['\x31', '\u65e5']), ('\u33e1', &['\x32', '\u65e5']), ('\u33e2', &['\x33', '\u65e5']), ('\u33e3', &['\x34', '\u65e5']), ('\u33e4', &['\x35', '\u65e5']), ('\u33e5', &['\x36', '\u65e5']), ('\u33e6', &['\x37', '\u65e5']), ('\u33e7', &['\x38', '\u65e5']), ('\u33e8', &['\x39', '\u65e5']), ('\u33e9', &['\x31', '\x30', '\u65e5']), ('\u33ea', &['\x31', '\x31', '\u65e5']), ('\u33eb', &['\x31', '\x32', '\u65e5']), ('\u33ec', &['\x31', '\x33', '\u65e5']), ('\u33ed', &['\x31', '\x34', '\u65e5']), ('\u33ee', &['\x31', '\x35', '\u65e5']), ('\u33ef', &['\x31', '\x36', '\u65e5']), ('\u33f0', &['\x31', '\x37', '\u65e5']), ('\u33f1', &['\x31', '\x38', '\u65e5']), ('\u33f2', &['\x31', '\x39', '\u65e5']), ('\u33f3', &['\x32', '\x30', '\u65e5']), ('\u33f4', &['\x32', '\x31', '\u65e5']), ('\u33f5', &['\x32', '\x32', '\u65e5']), ('\u33f6', &['\x32', '\x33', '\u65e5']), ('\u33f7', &['\x32', '\x34', '\u65e5']), ('\u33f8', &['\x32', '\x35', '\u65e5']), ('\u33f9', &['\x32', '\x36', '\u65e5']), ('\u33fa', &['\x32', '\x37', '\u65e5']), ('\u33fb', &['\x32', '\x38', '\u65e5']), ('\u33fc', &['\x32', '\x39', '\u65e5']), ('\u33fd', &['\x33', '\x30', '\u65e5']), ('\u33fe', &['\x33', '\x31', '\u65e5']), ('\u33ff', &['\x67', '\x61', '\x6c']), ('\ua69c', &['\u044a']), ('\ua69d', &['\u044c']), ('\ua770', &['\ua76f']), ('\ua7f8', &['\u0126']), ('\ua7f9', &['\u0153']), ('\uab5c', &['\ua727']), ('\uab5d', &['\uab37']), ('\uab5e', &['\u026b']), ('\uab5f', &['\uab52']), ('\ufb00', &['\x66', '\x66']), ('\ufb01', &['\x66', '\x69']), ('\ufb02', &['\x66', '\x6c']), ('\ufb03', &['\x66', '\x66', '\x69']), ('\ufb04', &['\x66', '\x66', '\x6c']), ('\ufb05', &['\u017f', '\x74']), ('\ufb06', &['\x73', '\x74']), ('\ufb13', &['\u0574', '\u0576']), ('\ufb14', &['\u0574', '\u0565']), ('\ufb15', &['\u0574', '\u056b']), ('\ufb16', &['\u057e', '\u0576']), ('\ufb17', &['\u0574', '\u056d']), ('\ufb20', &['\u05e2']), ('\ufb21', &['\u05d0']), ('\ufb22', &['\u05d3']), ('\ufb23', &['\u05d4']), ('\ufb24', &['\u05db']), ('\ufb25', &['\u05dc']), ('\ufb26', &['\u05dd']), ('\ufb27', &['\u05e8']), ('\ufb28', &['\u05ea']), ('\ufb29', &['\x2b']), ('\ufb4f', &['\u05d0', '\u05dc']), ('\ufb50', &['\u0671']), ('\ufb51', &['\u0671']), ('\ufb52', &['\u067b']), ('\ufb53', &['\u067b']), ('\ufb54', &['\u067b']), ('\ufb55', &['\u067b']), ('\ufb56', &['\u067e']), ('\ufb57', &['\u067e']), ('\ufb58', &['\u067e']), ('\ufb59', &['\u067e']), ('\ufb5a', &['\u0680']), ('\ufb5b', &['\u0680']), ('\ufb5c', &['\u0680']), ('\ufb5d', &['\u0680']), ('\ufb5e', &['\u067a']), ('\ufb5f', &['\u067a']), ('\ufb60', &['\u067a']), ('\ufb61', &['\u067a']), ('\ufb62', &['\u067f']), ('\ufb63', &['\u067f']), ('\ufb64', &['\u067f']), ('\ufb65', &['\u067f']), ('\ufb66', &['\u0679']), ('\ufb67', &['\u0679']), ('\ufb68', &['\u0679']), ('\ufb69', &['\u0679']), ('\ufb6a', &['\u06a4']), ('\ufb6b', &['\u06a4']), ('\ufb6c', &['\u06a4']), ('\ufb6d', &['\u06a4']), ('\ufb6e', &['\u06a6']), ('\ufb6f', &['\u06a6']), ('\ufb70', &['\u06a6']), ('\ufb71', &['\u06a6']), ('\ufb72', &['\u0684']), ('\ufb73', &['\u0684']), ('\ufb74', &['\u0684']), ('\ufb75', &['\u0684']), ('\ufb76', &['\u0683']), ('\ufb77', &['\u0683']), ('\ufb78', &['\u0683']), ('\ufb79', &['\u0683']), ('\ufb7a', &['\u0686']), ('\ufb7b', &['\u0686']), ('\ufb7c', &['\u0686']), ('\ufb7d', &['\u0686']), ('\ufb7e', &['\u0687']), ('\ufb7f', &['\u0687']), ('\ufb80', &['\u0687']), ('\ufb81', &['\u0687']), ('\ufb82', &['\u068d']), ('\ufb83', &['\u068d']), ('\ufb84', &['\u068c']), ('\ufb85', &['\u068c']), ('\ufb86', &['\u068e']), ('\ufb87', &['\u068e']), ('\ufb88', &['\u0688']), ('\ufb89', &['\u0688']), ('\ufb8a', &['\u0698']), ('\ufb8b', &['\u0698']), ('\ufb8c', &['\u0691']), ('\ufb8d', &['\u0691']), ('\ufb8e', &['\u06a9']), ('\ufb8f', &['\u06a9']), ('\ufb90', &['\u06a9']), ('\ufb91', &['\u06a9']), ('\ufb92', &['\u06af']), ('\ufb93', &['\u06af']), ('\ufb94', &['\u06af']), ('\ufb95', &['\u06af']), ('\ufb96', &['\u06b3']), ('\ufb97', &['\u06b3']), ('\ufb98', &['\u06b3']), ('\ufb99', &['\u06b3']), ('\ufb9a', &['\u06b1']), ('\ufb9b', &['\u06b1']), ('\ufb9c', &['\u06b1']), ('\ufb9d', &['\u06b1']), ('\ufb9e', &['\u06ba']), ('\ufb9f', &['\u06ba']), ('\ufba0', &['\u06bb']), ('\ufba1', &['\u06bb']), ('\ufba2', &['\u06bb']), ('\ufba3', &['\u06bb']), ('\ufba4', &['\u06c0']), ('\ufba5', &['\u06c0']), ('\ufba6', &['\u06c1']), ('\ufba7', &['\u06c1']), ('\ufba8', &['\u06c1']), ('\ufba9', &['\u06c1']), ('\ufbaa', &['\u06be']), ('\ufbab', &['\u06be']), ('\ufbac', &['\u06be']), ('\ufbad', &['\u06be']), ('\ufbae', &['\u06d2']), ('\ufbaf', &['\u06d2']), ('\ufbb0', &['\u06d3']), ('\ufbb1', &['\u06d3']), ('\ufbd3', &['\u06ad']), ('\ufbd4', &['\u06ad']), ('\ufbd5', &['\u06ad']), ('\ufbd6', &['\u06ad']), ('\ufbd7', &['\u06c7']), ('\ufbd8', &['\u06c7']), ('\ufbd9', &['\u06c6']), ('\ufbda', &['\u06c6']), ('\ufbdb', &['\u06c8']), ('\ufbdc', &['\u06c8']), ('\ufbdd', &['\u0677']), ('\ufbde', &['\u06cb']), ('\ufbdf', &['\u06cb']), ('\ufbe0', &['\u06c5']), ('\ufbe1', &['\u06c5']), ('\ufbe2', &['\u06c9']), ('\ufbe3', &['\u06c9']), ('\ufbe4', &['\u06d0']), ('\ufbe5', &['\u06d0']), ('\ufbe6', &['\u06d0']), ('\ufbe7', &['\u06d0']), ('\ufbe8', &['\u0649']), ('\ufbe9', &['\u0649']), ('\ufbea', &['\u0626', '\u0627']), ('\ufbeb', &['\u0626', '\u0627']), ('\ufbec', &['\u0626', '\u06d5']), ('\ufbed', &['\u0626', '\u06d5']), ('\ufbee', &['\u0626', '\u0648']), ('\ufbef', &['\u0626', '\u0648']), ('\ufbf0', &['\u0626', '\u06c7']), ('\ufbf1', &['\u0626', '\u06c7']), ('\ufbf2', &['\u0626', '\u06c6']), ('\ufbf3', &['\u0626', '\u06c6']), ('\ufbf4', &['\u0626', '\u06c8']), ('\ufbf5', &['\u0626', '\u06c8']), ('\ufbf6', &['\u0626', '\u06d0']), ('\ufbf7', &['\u0626', '\u06d0']), ('\ufbf8', &['\u0626', '\u06d0']), ('\ufbf9', &['\u0626', '\u0649']), ('\ufbfa', &['\u0626', '\u0649']), ('\ufbfb', &['\u0626', '\u0649']), ('\ufbfc', &['\u06cc']), ('\ufbfd', &['\u06cc']), ('\ufbfe', &['\u06cc']), ('\ufbff', &['\u06cc']), ('\ufc00', &['\u0626', '\u062c']), ('\ufc01', &['\u0626', '\u062d']), ('\ufc02', &['\u0626', '\u0645']), ('\ufc03', &['\u0626', '\u0649']), ('\ufc04', &['\u0626', '\u064a']), ('\ufc05', &['\u0628', '\u062c']), ('\ufc06', &['\u0628', '\u062d']), ('\ufc07', &['\u0628', '\u062e']), ('\ufc08', &['\u0628', '\u0645']), ('\ufc09', &['\u0628', '\u0649']), ('\ufc0a', &['\u0628', '\u064a']), ('\ufc0b', &['\u062a', '\u062c']), ('\ufc0c', &['\u062a', '\u062d']), ('\ufc0d', &['\u062a', '\u062e']), ('\ufc0e', &['\u062a', '\u0645']), ('\ufc0f', &['\u062a', '\u0649']), ('\ufc10', &['\u062a', '\u064a']), ('\ufc11', &['\u062b', '\u062c']), ('\ufc12', &['\u062b', '\u0645']), ('\ufc13', &['\u062b', '\u0649']), ('\ufc14', &['\u062b', '\u064a']), ('\ufc15', &['\u062c', '\u062d']), ('\ufc16', &['\u062c', '\u0645']), ('\ufc17', &['\u062d', '\u062c']), ('\ufc18', &['\u062d', '\u0645']), ('\ufc19', &['\u062e', '\u062c']), ('\ufc1a', &['\u062e', '\u062d']), ('\ufc1b', &['\u062e', '\u0645']), ('\ufc1c', &['\u0633', '\u062c']), ('\ufc1d', &['\u0633', '\u062d']), ('\ufc1e', &['\u0633', '\u062e']), ('\ufc1f', &['\u0633', '\u0645']), ('\ufc20', &['\u0635', '\u062d']), ('\ufc21', &['\u0635', '\u0645']), ('\ufc22', &['\u0636', '\u062c']), ('\ufc23', &['\u0636', '\u062d']), ('\ufc24', &['\u0636', '\u062e']), ('\ufc25', &['\u0636', '\u0645']), ('\ufc26', &['\u0637', '\u062d']), ('\ufc27', &['\u0637', '\u0645']), ('\ufc28', &['\u0638', '\u0645']), ('\ufc29', &['\u0639', '\u062c']), ('\ufc2a', &['\u0639', '\u0645']), ('\ufc2b', &['\u063a', '\u062c']), ('\ufc2c', &['\u063a', '\u0645']), ('\ufc2d', &['\u0641', '\u062c']), ('\ufc2e', &['\u0641', '\u062d']), ('\ufc2f', &['\u0641', '\u062e']), ('\ufc30', &['\u0641', '\u0645']), ('\ufc31', &['\u0641', '\u0649']), ('\ufc32', &['\u0641', '\u064a']), ('\ufc33', &['\u0642', '\u062d']), ('\ufc34', &['\u0642', '\u0645']), ('\ufc35', &['\u0642', '\u0649']), ('\ufc36', &['\u0642', '\u064a']), ('\ufc37', &['\u0643', '\u0627']), ('\ufc38', &['\u0643', '\u062c']), ('\ufc39', &['\u0643', '\u062d']), ('\ufc3a', &['\u0643', '\u062e']), ('\ufc3b', &['\u0643', '\u0644']), ('\ufc3c', &['\u0643', '\u0645']), ('\ufc3d', &['\u0643', '\u0649']), ('\ufc3e', &['\u0643', '\u064a']), ('\ufc3f', &['\u0644', '\u062c']), ('\ufc40', &['\u0644', '\u062d']), ('\ufc41', &['\u0644', '\u062e']), ('\ufc42', &['\u0644', '\u0645']), ('\ufc43', &['\u0644', '\u0649']), ('\ufc44', &['\u0644', '\u064a']), ('\ufc45', &['\u0645', '\u062c']), ('\ufc46', &['\u0645', '\u062d']), ('\ufc47', &['\u0645', '\u062e']), ('\ufc48', &['\u0645', '\u0645']), ('\ufc49', &['\u0645', '\u0649']), ('\ufc4a', &['\u0645', '\u064a']), ('\ufc4b', &['\u0646', '\u062c']), ('\ufc4c', &['\u0646', '\u062d']), ('\ufc4d', &['\u0646', '\u062e']), ('\ufc4e', &['\u0646', '\u0645']), ('\ufc4f', &['\u0646', '\u0649']), ('\ufc50', &['\u0646', '\u064a']), ('\ufc51', &['\u0647', '\u062c']), ('\ufc52', &['\u0647', '\u0645']), ('\ufc53', &['\u0647', '\u0649']), ('\ufc54', &['\u0647', '\u064a']), ('\ufc55', &['\u064a', '\u062c']), ('\ufc56', &['\u064a', '\u062d']), ('\ufc57', &['\u064a', '\u062e']), ('\ufc58', &['\u064a', '\u0645']), ('\ufc59', &['\u064a', '\u0649']), ('\ufc5a', &['\u064a', '\u064a']), ('\ufc5b', &['\u0630', '\u0670']), ('\ufc5c', &['\u0631', '\u0670']), ('\ufc5d', &['\u0649', '\u0670']), ('\ufc5e', &['\x20', '\u064c', '\u0651']), ('\ufc5f', &['\x20', '\u064d', '\u0651']), ('\ufc60', &['\x20', '\u064e', '\u0651']), ('\ufc61', &['\x20', '\u064f', '\u0651']), ('\ufc62', &['\x20', '\u0650', '\u0651']), ('\ufc63', &['\x20', '\u0651', '\u0670']), ('\ufc64', &['\u0626', '\u0631']), ('\ufc65', &['\u0626', '\u0632']), ('\ufc66', &['\u0626', '\u0645']), ('\ufc67', &['\u0626', '\u0646']), ('\ufc68', &['\u0626', '\u0649']), ('\ufc69', &['\u0626', '\u064a']), ('\ufc6a', &['\u0628', '\u0631']), ('\ufc6b', &['\u0628', '\u0632']), ('\ufc6c', &['\u0628', '\u0645']), ('\ufc6d', &['\u0628', '\u0646']), ('\ufc6e', &['\u0628', '\u0649']), ('\ufc6f', &['\u0628', '\u064a']), ('\ufc70', &['\u062a', '\u0631']), ('\ufc71', &['\u062a', '\u0632']), ('\ufc72', &['\u062a', '\u0645']), ('\ufc73', &['\u062a', '\u0646']), ('\ufc74', &['\u062a', '\u0649']), ('\ufc75', &['\u062a', '\u064a']), ('\ufc76', &['\u062b', '\u0631']), ('\ufc77', &['\u062b', '\u0632']), ('\ufc78', &['\u062b', '\u0645']), ('\ufc79', &['\u062b', '\u0646']), ('\ufc7a', &['\u062b', '\u0649']), ('\ufc7b', &['\u062b', '\u064a']), ('\ufc7c', &['\u0641', '\u0649']), ('\ufc7d', &['\u0641', '\u064a']), ('\ufc7e', &['\u0642', '\u0649']), ('\ufc7f', &['\u0642', '\u064a']), ('\ufc80', &['\u0643', '\u0627']), ('\ufc81', &['\u0643', '\u0644']), ('\ufc82', &['\u0643', '\u0645']), ('\ufc83', &['\u0643', '\u0649']), ('\ufc84', &['\u0643', '\u064a']), ('\ufc85', &['\u0644', '\u0645']), ('\ufc86', &['\u0644', '\u0649']), ('\ufc87', &['\u0644', '\u064a']), ('\ufc88', &['\u0645', '\u0627']), ('\ufc89', &['\u0645', '\u0645']), ('\ufc8a', &['\u0646', '\u0631']), ('\ufc8b', &['\u0646', '\u0632']), ('\ufc8c', &['\u0646', '\u0645']), ('\ufc8d', &['\u0646', '\u0646']), ('\ufc8e', &['\u0646', '\u0649']), ('\ufc8f', &['\u0646', '\u064a']), ('\ufc90', &['\u0649', '\u0670']), ('\ufc91', &['\u064a', '\u0631']), ('\ufc92', &['\u064a', '\u0632']), ('\ufc93', &['\u064a', '\u0645']), ('\ufc94', &['\u064a', '\u0646']), ('\ufc95', &['\u064a', '\u0649']), ('\ufc96', &['\u064a', '\u064a']), ('\ufc97', &['\u0626', '\u062c']), ('\ufc98', &['\u0626', '\u062d']), ('\ufc99', &['\u0626', '\u062e']), ('\ufc9a', &['\u0626', '\u0645']), ('\ufc9b', &['\u0626', '\u0647']), ('\ufc9c', &['\u0628', '\u062c']), ('\ufc9d', &['\u0628', '\u062d']), ('\ufc9e', &['\u0628', '\u062e']), ('\ufc9f', &['\u0628', '\u0645']), ('\ufca0', &['\u0628', '\u0647']), ('\ufca1', &['\u062a', '\u062c']), ('\ufca2', &['\u062a', '\u062d']), ('\ufca3', &['\u062a', '\u062e']), ('\ufca4', &['\u062a', '\u0645']), ('\ufca5', &['\u062a', '\u0647']), ('\ufca6', &['\u062b', '\u0645']), ('\ufca7', &['\u062c', '\u062d']), ('\ufca8', &['\u062c', '\u0645']), ('\ufca9', &['\u062d', '\u062c']), ('\ufcaa', &['\u062d', '\u0645']), ('\ufcab', &['\u062e', '\u062c']), ('\ufcac', &['\u062e', '\u0645']), ('\ufcad', &['\u0633', '\u062c']), ('\ufcae', &['\u0633', '\u062d']), ('\ufcaf', &['\u0633', '\u062e']), ('\ufcb0', &['\u0633', '\u0645']), ('\ufcb1', &['\u0635', '\u062d']), ('\ufcb2', &['\u0635', '\u062e']), ('\ufcb3', &['\u0635', '\u0645']), ('\ufcb4', &['\u0636', '\u062c']), ('\ufcb5', &['\u0636', '\u062d']), ('\ufcb6', &['\u0636', '\u062e']), ('\ufcb7', &['\u0636', '\u0645']), ('\ufcb8', &['\u0637', '\u062d']), ('\ufcb9', &['\u0638', '\u0645']), ('\ufcba', &['\u0639', '\u062c']), ('\ufcbb', &['\u0639', '\u0645']), ('\ufcbc', &['\u063a', '\u062c']), ('\ufcbd', &['\u063a', '\u0645']), ('\ufcbe', &['\u0641', '\u062c']), ('\ufcbf', &['\u0641', '\u062d']), ('\ufcc0', &['\u0641', '\u062e']), ('\ufcc1', &['\u0641', '\u0645']), ('\ufcc2', &['\u0642', '\u062d']), ('\ufcc3', &['\u0642', '\u0645']), ('\ufcc4', &['\u0643', '\u062c']), ('\ufcc5', &['\u0643', '\u062d']), ('\ufcc6', &['\u0643', '\u062e']), ('\ufcc7', &['\u0643', '\u0644']), ('\ufcc8', &['\u0643', '\u0645']), ('\ufcc9', &['\u0644', '\u062c']), ('\ufcca', &['\u0644', '\u062d']), ('\ufccb', &['\u0644', '\u062e']), ('\ufccc', &['\u0644', '\u0645']), ('\ufccd', &['\u0644', '\u0647']), ('\ufcce', &['\u0645', '\u062c']), ('\ufccf', &['\u0645', '\u062d']), ('\ufcd0', &['\u0645', '\u062e']), ('\ufcd1', &['\u0645', '\u0645']), ('\ufcd2', &['\u0646', '\u062c']), ('\ufcd3', &['\u0646', '\u062d']), ('\ufcd4', &['\u0646', '\u062e']), ('\ufcd5', &['\u0646', '\u0645']), ('\ufcd6', &['\u0646', '\u0647']), ('\ufcd7', &['\u0647', '\u062c']), ('\ufcd8', &['\u0647', '\u0645']), ('\ufcd9', &['\u0647', '\u0670']), ('\ufcda', &['\u064a', '\u062c']), ('\ufcdb', &['\u064a', '\u062d']), ('\ufcdc', &['\u064a', '\u062e']), ('\ufcdd', &['\u064a', '\u0645']), ('\ufcde', &['\u064a', '\u0647']), ('\ufcdf', &['\u0626', '\u0645']), ('\ufce0', &['\u0626', '\u0647']), ('\ufce1', &['\u0628', '\u0645']), ('\ufce2', &['\u0628', '\u0647']), ('\ufce3', &['\u062a', '\u0645']), ('\ufce4', &['\u062a', '\u0647']), ('\ufce5', &['\u062b', '\u0645']), ('\ufce6', &['\u062b', '\u0647']), ('\ufce7', &['\u0633', '\u0645']), ('\ufce8', &['\u0633', '\u0647']), ('\ufce9', &['\u0634', '\u0645']), ('\ufcea', &['\u0634', '\u0647']), ('\ufceb', &['\u0643', '\u0644']), ('\ufcec', &['\u0643', '\u0645']), ('\ufced', &['\u0644', '\u0645']), ('\ufcee', &['\u0646', '\u0645']), ('\ufcef', &['\u0646', '\u0647']), ('\ufcf0', &['\u064a', '\u0645']), ('\ufcf1', &['\u064a', '\u0647']), ('\ufcf2', &['\u0640', '\u064e', '\u0651']), ('\ufcf3', &['\u0640', '\u064f', '\u0651']), ('\ufcf4', &['\u0640', '\u0650', '\u0651']), ('\ufcf5', &['\u0637', '\u0649']), ('\ufcf6', &['\u0637', '\u064a']), ('\ufcf7', &['\u0639', '\u0649']), ('\ufcf8', &['\u0639', '\u064a']), ('\ufcf9', &['\u063a', '\u0649']), ('\ufcfa', &['\u063a', '\u064a']), ('\ufcfb', &['\u0633', '\u0649']), ('\ufcfc', &['\u0633', '\u064a']), ('\ufcfd', &['\u0634', '\u0649']), ('\ufcfe', &['\u0634', '\u064a']), ('\ufcff', &['\u062d', '\u0649']), ('\ufd00', &['\u062d', '\u064a']), ('\ufd01', &['\u062c', '\u0649']), ('\ufd02', &['\u062c', '\u064a']), ('\ufd03', &['\u062e', '\u0649']), ('\ufd04', &['\u062e', '\u064a']), ('\ufd05', &['\u0635', '\u0649']), ('\ufd06', &['\u0635', '\u064a']), ('\ufd07', &['\u0636', '\u0649']), ('\ufd08', &['\u0636', '\u064a']), ('\ufd09', &['\u0634', '\u062c']), ('\ufd0a', &['\u0634', '\u062d']), ('\ufd0b', &['\u0634', '\u062e']), ('\ufd0c', &['\u0634', '\u0645']), ('\ufd0d', &['\u0634', '\u0631']), ('\ufd0e', &['\u0633', '\u0631']), ('\ufd0f', &['\u0635', '\u0631']), ('\ufd10', &['\u0636', '\u0631']), ('\ufd11', &['\u0637', '\u0649']), ('\ufd12', &['\u0637', '\u064a']), ('\ufd13', &['\u0639', '\u0649']), ('\ufd14', &['\u0639', '\u064a']), ('\ufd15', &['\u063a', '\u0649']), ('\ufd16', &['\u063a', '\u064a']), ('\ufd17', &['\u0633', '\u0649']), ('\ufd18', &['\u0633', '\u064a']), ('\ufd19', &['\u0634', '\u0649']), ('\ufd1a', &['\u0634', '\u064a']), ('\ufd1b', &['\u062d', '\u0649']), ('\ufd1c', &['\u062d', '\u064a']), ('\ufd1d', &['\u062c', '\u0649']), ('\ufd1e', &['\u062c', '\u064a']), ('\ufd1f', &['\u062e', '\u0649']), ('\ufd20', &['\u062e', '\u064a']), ('\ufd21', &['\u0635', '\u0649']), ('\ufd22', &['\u0635', '\u064a']), ('\ufd23', &['\u0636', '\u0649']), ('\ufd24', &['\u0636', '\u064a']), ('\ufd25', &['\u0634', '\u062c']), ('\ufd26', &['\u0634', '\u062d']), ('\ufd27', &['\u0634', '\u062e']), ('\ufd28', &['\u0634', '\u0645']), ('\ufd29', &['\u0634', '\u0631']), ('\ufd2a', &['\u0633', '\u0631']), ('\ufd2b', &['\u0635', '\u0631']), ('\ufd2c', &['\u0636', '\u0631']), ('\ufd2d', &['\u0634', '\u062c']), ('\ufd2e', &['\u0634', '\u062d']), ('\ufd2f', &['\u0634', '\u062e']), ('\ufd30', &['\u0634', '\u0645']), ('\ufd31', &['\u0633', '\u0647']), ('\ufd32', &['\u0634', '\u0647']), ('\ufd33', &['\u0637', '\u0645']), ('\ufd34', &['\u0633', '\u062c']), ('\ufd35', &['\u0633', '\u062d']), ('\ufd36', &['\u0633', '\u062e']), ('\ufd37', &['\u0634', '\u062c']), ('\ufd38', &['\u0634', '\u062d']), ('\ufd39', &['\u0634', '\u062e']), ('\ufd3a', &['\u0637', '\u0645']), ('\ufd3b', &['\u0638', '\u0645']), ('\ufd3c', &['\u0627', '\u064b']), ('\ufd3d', &['\u0627', '\u064b']), ('\ufd50', &['\u062a', '\u062c', '\u0645']), ('\ufd51', &['\u062a', '\u062d', '\u062c']), ('\ufd52', &['\u062a', '\u062d', '\u062c']), ('\ufd53', &['\u062a', '\u062d', '\u0645']), ('\ufd54', &['\u062a', '\u062e', '\u0645']), ('\ufd55', &['\u062a', '\u0645', '\u062c']), ('\ufd56', &['\u062a', '\u0645', '\u062d']), ('\ufd57', &['\u062a', '\u0645', '\u062e']), ('\ufd58', &['\u062c', '\u0645', '\u062d']), ('\ufd59', &['\u062c', '\u0645', '\u062d']), ('\ufd5a', &['\u062d', '\u0645', '\u064a']), ('\ufd5b', &['\u062d', '\u0645', '\u0649']), ('\ufd5c', &['\u0633', '\u062d', '\u062c']), ('\ufd5d', &['\u0633', '\u062c', '\u062d']), ('\ufd5e', &['\u0633', '\u062c', '\u0649']), ('\ufd5f', &['\u0633', '\u0645', '\u062d']), ('\ufd60', &['\u0633', '\u0645', '\u062d']), ('\ufd61', &['\u0633', '\u0645', '\u062c']), ('\ufd62', &['\u0633', '\u0645', '\u0645']), ('\ufd63', &['\u0633', '\u0645', '\u0645']), ('\ufd64', &['\u0635', '\u062d', '\u062d']), ('\ufd65', &['\u0635', '\u062d', '\u062d']), ('\ufd66', &['\u0635', '\u0645', '\u0645']), ('\ufd67', &['\u0634', '\u062d', '\u0645']), ('\ufd68', &['\u0634', '\u062d', '\u0645']), ('\ufd69', &['\u0634', '\u062c', '\u064a']), ('\ufd6a', &['\u0634', '\u0645', '\u062e']), ('\ufd6b', &['\u0634', '\u0645', '\u062e']), ('\ufd6c', &['\u0634', '\u0645', '\u0645']), ('\ufd6d', &['\u0634', '\u0645', '\u0645']), ('\ufd6e', &['\u0636', '\u062d', '\u0649']), ('\ufd6f', &['\u0636', '\u062e', '\u0645']), ('\ufd70', &['\u0636', '\u062e', '\u0645']), ('\ufd71', &['\u0637', '\u0645', '\u062d']), ('\ufd72', &['\u0637', '\u0645', '\u062d']), ('\ufd73', &['\u0637', '\u0645', '\u0645']), ('\ufd74', &['\u0637', '\u0645', '\u064a']), ('\ufd75', &['\u0639', '\u062c', '\u0645']), ('\ufd76', &['\u0639', '\u0645', '\u0645']), ('\ufd77', &['\u0639', '\u0645', '\u0645']), ('\ufd78', &['\u0639', '\u0645', '\u0649']), ('\ufd79', &['\u063a', '\u0645', '\u0645']), ('\ufd7a', &['\u063a', '\u0645', '\u064a']), ('\ufd7b', &['\u063a', '\u0645', '\u0649']), ('\ufd7c', &['\u0641', '\u062e', '\u0645']), ('\ufd7d', &['\u0641', '\u062e', '\u0645']), ('\ufd7e', &['\u0642', '\u0645', '\u062d']), ('\ufd7f', &['\u0642', '\u0645', '\u0645']), ('\ufd80', &['\u0644', '\u062d', '\u0645']), ('\ufd81', &['\u0644', '\u062d', '\u064a']), ('\ufd82', &['\u0644', '\u062d', '\u0649']), ('\ufd83', &['\u0644', '\u062c', '\u062c']), ('\ufd84', &['\u0644', '\u062c', '\u062c']), ('\ufd85', &['\u0644', '\u062e', '\u0645']), ('\ufd86', &['\u0644', '\u062e', '\u0645']), ('\ufd87', &['\u0644', '\u0645', '\u062d']), ('\ufd88', &['\u0644', '\u0645', '\u062d']), ('\ufd89', &['\u0645', '\u062d', '\u062c']), ('\ufd8a', &['\u0645', '\u062d', '\u0645']), ('\ufd8b', &['\u0645', '\u062d', '\u064a']), ('\ufd8c', &['\u0645', '\u062c', '\u062d']), ('\ufd8d', &['\u0645', '\u062c', '\u0645']), ('\ufd8e', &['\u0645', '\u062e', '\u062c']), ('\ufd8f', &['\u0645', '\u062e', '\u0645']), ('\ufd92', &['\u0645', '\u062c', '\u062e']), ('\ufd93', &['\u0647', '\u0645', '\u062c']), ('\ufd94', &['\u0647', '\u0645', '\u0645']), ('\ufd95', &['\u0646', '\u062d', '\u0645']), ('\ufd96', &['\u0646', '\u062d', '\u0649']), ('\ufd97', &['\u0646', '\u062c', '\u0645']), ('\ufd98', &['\u0646', '\u062c', '\u0645']), ('\ufd99', &['\u0646', '\u062c', '\u0649']), ('\ufd9a', &['\u0646', '\u0645', '\u064a']), ('\ufd9b', &['\u0646', '\u0645', '\u0649']), ('\ufd9c', &['\u064a', '\u0645', '\u0645']), ('\ufd9d', &['\u064a', '\u0645', '\u0645']), ('\ufd9e', &['\u0628', '\u062e', '\u064a']), ('\ufd9f', &['\u062a', '\u062c', '\u064a']), ('\ufda0', &['\u062a', '\u062c', '\u0649']), ('\ufda1', &['\u062a', '\u062e', '\u064a']), ('\ufda2', &['\u062a', '\u062e', '\u0649']), ('\ufda3', &['\u062a', '\u0645', '\u064a']), ('\ufda4', &['\u062a', '\u0645', '\u0649']), ('\ufda5', &['\u062c', '\u0645', '\u064a']), ('\ufda6', &['\u062c', '\u062d', '\u0649']), ('\ufda7', &['\u062c', '\u0645', '\u0649']), ('\ufda8', &['\u0633', '\u062e', '\u0649']), ('\ufda9', &['\u0635', '\u062d', '\u064a']), ('\ufdaa', &['\u0634', '\u062d', '\u064a']), ('\ufdab', &['\u0636', '\u062d', '\u064a']), ('\ufdac', &['\u0644', '\u062c', '\u064a']), ('\ufdad', &['\u0644', '\u0645', '\u064a']), ('\ufdae', &['\u064a', '\u062d', '\u064a']), ('\ufdaf', &['\u064a', '\u062c', '\u064a']), ('\ufdb0', &['\u064a', '\u0645', '\u064a']), ('\ufdb1', &['\u0645', '\u0645', '\u064a']), ('\ufdb2', &['\u0642', '\u0645', '\u064a']), ('\ufdb3', &['\u0646', '\u062d', '\u064a']), ('\ufdb4', &['\u0642', '\u0645', '\u062d']), ('\ufdb5', &['\u0644', '\u062d', '\u0645']), ('\ufdb6', &['\u0639', '\u0645', '\u064a']), ('\ufdb7', &['\u0643', '\u0645', '\u064a']), ('\ufdb8', &['\u0646', '\u062c', '\u062d']), ('\ufdb9', &['\u0645', '\u062e', '\u064a']), ('\ufdba', &['\u0644', '\u062c', '\u0645']), ('\ufdbb', &['\u0643', '\u0645', '\u0645']), ('\ufdbc', &['\u0644', '\u062c', '\u0645']), ('\ufdbd', &['\u0646', '\u062c', '\u062d']), ('\ufdbe', &['\u062c', '\u062d', '\u064a']), ('\ufdbf', &['\u062d', '\u062c', '\u064a']), ('\ufdc0', &['\u0645', '\u062c', '\u064a']), ('\ufdc1', &['\u0641', '\u0645', '\u064a']), ('\ufdc2', &['\u0628', '\u062d', '\u064a']), ('\ufdc3', &['\u0643', '\u0645', '\u0645']), ('\ufdc4', &['\u0639', '\u062c', '\u0645']), ('\ufdc5', &['\u0635', '\u0645', '\u0645']), ('\ufdc6', &['\u0633', '\u062e', '\u064a']), ('\ufdc7', &['\u0646', '\u062c', '\u064a']), ('\ufdf0', &['\u0635', '\u0644', '\u06d2']), ('\ufdf1', &['\u0642', '\u0644', '\u06d2']), ('\ufdf2', &['\u0627', '\u0644', '\u0644', '\u0647']), ('\ufdf3', &['\u0627', '\u0643', '\u0628', '\u0631']), ('\ufdf4', &['\u0645', '\u062d', '\u0645', '\u062f']), ('\ufdf5', &['\u0635', '\u0644', '\u0639', '\u0645']), ('\ufdf6', &['\u0631', '\u0633', '\u0648', '\u0644']), ('\ufdf7', &['\u0639', '\u0644', '\u064a', '\u0647']), ('\ufdf8', &['\u0648', '\u0633', '\u0644', '\u0645']), ('\ufdf9', &['\u0635', '\u0644', '\u0649']), ('\ufdfa', &['\u0635', '\u0644', '\u0649', '\x20', '\u0627', '\u0644', '\u0644', '\u0647', '\x20', '\u0639', '\u0644', '\u064a', '\u0647', '\x20', '\u0648', '\u0633', '\u0644', '\u0645']), ('\ufdfb', &['\u062c', '\u0644', '\x20', '\u062c', '\u0644', '\u0627', '\u0644', '\u0647']), ('\ufdfc', &['\u0631', '\u06cc', '\u0627', '\u0644']), ('\ufe10', &['\x2c']), ('\ufe11', &['\u3001']), ('\ufe12', &['\u3002']), ('\ufe13', &['\x3a']), ('\ufe14', &['\x3b']), ('\ufe15', &['\x21']), ('\ufe16', &['\x3f']), ('\ufe17', &['\u3016']), ('\ufe18', &['\u3017']), ('\ufe19', &['\u2026']), ('\ufe30', &['\u2025']), ('\ufe31', &['\u2014']), ('\ufe32', &['\u2013']), ('\ufe33', &['\x5f']), ('\ufe34', &['\x5f']), ('\ufe35', &['\x28']), ('\ufe36', &['\x29']), ('\ufe37', &['\x7b']), ('\ufe38', &['\x7d']), ('\ufe39', &['\u3014']), ('\ufe3a', &['\u3015']), ('\ufe3b', &['\u3010']), ('\ufe3c', &['\u3011']), ('\ufe3d', &['\u300a']), ('\ufe3e', &['\u300b']), ('\ufe3f', &['\u3008']), ('\ufe40', &['\u3009']), ('\ufe41', &['\u300c']), ('\ufe42', &['\u300d']), ('\ufe43', &['\u300e']), ('\ufe44', &['\u300f']), ('\ufe47', &['\x5b']), ('\ufe48', &['\x5d']), ('\ufe49', &['\u203e']), ('\ufe4a', &['\u203e']), ('\ufe4b', &['\u203e']), ('\ufe4c', &['\u203e']), ('\ufe4d', &['\x5f']), ('\ufe4e', &['\x5f']), ('\ufe4f', &['\x5f']), ('\ufe50', &['\x2c']), ('\ufe51', &['\u3001']), ('\ufe52', &['\x2e']), ('\ufe54', &['\x3b']), ('\ufe55', &['\x3a']), ('\ufe56', &['\x3f']), ('\ufe57', &['\x21']), ('\ufe58', &['\u2014']), ('\ufe59', &['\x28']), ('\ufe5a', &['\x29']), ('\ufe5b', &['\x7b']), ('\ufe5c', &['\x7d']), ('\ufe5d', &['\u3014']), ('\ufe5e', &['\u3015']), ('\ufe5f', &['\x23']), ('\ufe60', &['\x26']), ('\ufe61', &['\x2a']), ('\ufe62', &['\x2b']), ('\ufe63', &['\x2d']), ('\ufe64', &['\x3c']), ('\ufe65', &['\x3e']), ('\ufe66', &['\x3d']), ('\ufe68', &['\x5c']), ('\ufe69', &['\x24']), ('\ufe6a', &['\x25']), ('\ufe6b', &['\x40']), ('\ufe70', &['\x20', '\u064b']), ('\ufe71', &['\u0640', '\u064b']), ('\ufe72', &['\x20', '\u064c']), ('\ufe74', &['\x20', '\u064d']), ('\ufe76', &['\x20', '\u064e']), ('\ufe77', &['\u0640', '\u064e']), ('\ufe78', &['\x20', '\u064f']), ('\ufe79', &['\u0640', '\u064f']), ('\ufe7a', &['\x20', '\u0650']), ('\ufe7b', &['\u0640', '\u0650']), ('\ufe7c', &['\x20', '\u0651']), ('\ufe7d', &['\u0640', '\u0651']), ('\ufe7e', &['\x20', '\u0652']), ('\ufe7f', &['\u0640', '\u0652']), ('\ufe80', &['\u0621']), ('\ufe81', &['\u0622']), ('\ufe82', &['\u0622']), ('\ufe83', &['\u0623']), ('\ufe84', &['\u0623']), ('\ufe85', &['\u0624']), ('\ufe86', &['\u0624']), ('\ufe87', &['\u0625']), ('\ufe88', &['\u0625']), ('\ufe89', &['\u0626']), ('\ufe8a', &['\u0626']), ('\ufe8b', &['\u0626']), ('\ufe8c', &['\u0626']), ('\ufe8d', &['\u0627']), ('\ufe8e', &['\u0627']), ('\ufe8f', &['\u0628']), ('\ufe90', &['\u0628']), ('\ufe91', &['\u0628']), ('\ufe92', &['\u0628']), ('\ufe93', &['\u0629']), ('\ufe94', &['\u0629']), ('\ufe95', &['\u062a']), ('\ufe96', &['\u062a']), ('\ufe97', &['\u062a']), ('\ufe98', &['\u062a']), ('\ufe99', &['\u062b']), ('\ufe9a', &['\u062b']), ('\ufe9b', &['\u062b']), ('\ufe9c', &['\u062b']), ('\ufe9d', &['\u062c']), ('\ufe9e', &['\u062c']), ('\ufe9f', &['\u062c']), ('\ufea0', &['\u062c']), ('\ufea1', &['\u062d']), ('\ufea2', &['\u062d']), ('\ufea3', &['\u062d']), ('\ufea4', &['\u062d']), ('\ufea5', &['\u062e']), ('\ufea6', &['\u062e']), ('\ufea7', &['\u062e']), ('\ufea8', &['\u062e']), ('\ufea9', &['\u062f']), ('\ufeaa', &['\u062f']), ('\ufeab', &['\u0630']), ('\ufeac', &['\u0630']), ('\ufead', &['\u0631']), ('\ufeae', &['\u0631']), ('\ufeaf', &['\u0632']), ('\ufeb0', &['\u0632']), ('\ufeb1', &['\u0633']), ('\ufeb2', &['\u0633']), ('\ufeb3', &['\u0633']), ('\ufeb4', &['\u0633']), ('\ufeb5', &['\u0634']), ('\ufeb6', &['\u0634']), ('\ufeb7', &['\u0634']), ('\ufeb8', &['\u0634']), ('\ufeb9', &['\u0635']), ('\ufeba', &['\u0635']), ('\ufebb', &['\u0635']), ('\ufebc', &['\u0635']), ('\ufebd', &['\u0636']), ('\ufebe', &['\u0636']), ('\ufebf', &['\u0636']), ('\ufec0', &['\u0636']), ('\ufec1', &['\u0637']), ('\ufec2', &['\u0637']), ('\ufec3', &['\u0637']), ('\ufec4', &['\u0637']), ('\ufec5', &['\u0638']), ('\ufec6', &['\u0638']), ('\ufec7', &['\u0638']), ('\ufec8', &['\u0638']), ('\ufec9', &['\u0639']), ('\ufeca', &['\u0639']), ('\ufecb', &['\u0639']), ('\ufecc', &['\u0639']), ('\ufecd', &['\u063a']), ('\ufece', &['\u063a']), ('\ufecf', &['\u063a']), ('\ufed0', &['\u063a']), ('\ufed1', &['\u0641']), ('\ufed2', &['\u0641']), ('\ufed3', &['\u0641']), ('\ufed4', &['\u0641']), ('\ufed5', &['\u0642']), ('\ufed6', &['\u0642']), ('\ufed7', &['\u0642']), ('\ufed8', &['\u0642']), ('\ufed9', &['\u0643']), ('\ufeda', &['\u0643']), ('\ufedb', &['\u0643']), ('\ufedc', &['\u0643']), ('\ufedd', &['\u0644']), ('\ufede', &['\u0644']), ('\ufedf', &['\u0644']), ('\ufee0', &['\u0644']), ('\ufee1', &['\u0645']), ('\ufee2', &['\u0645']), ('\ufee3', &['\u0645']), ('\ufee4', &['\u0645']), ('\ufee5', &['\u0646']), ('\ufee6', &['\u0646']), ('\ufee7', &['\u0646']), ('\ufee8', &['\u0646']), ('\ufee9', &['\u0647']), ('\ufeea', &['\u0647']), ('\ufeeb', &['\u0647']), ('\ufeec', &['\u0647']), ('\ufeed', &['\u0648']), ('\ufeee', &['\u0648']), ('\ufeef', &['\u0649']), ('\ufef0', &['\u0649']), ('\ufef1', &['\u064a']), ('\ufef2', &['\u064a']), ('\ufef3', &['\u064a']), ('\ufef4', &['\u064a']), ('\ufef5', &['\u0644', '\u0622']), ('\ufef6', &['\u0644', '\u0622']), ('\ufef7', &['\u0644', '\u0623']), ('\ufef8', &['\u0644', '\u0623']), ('\ufef9', &['\u0644', '\u0625']), ('\ufefa', &['\u0644', '\u0625']), ('\ufefb', &['\u0644', '\u0627']), ('\ufefc', &['\u0644', '\u0627']), ('\uff01', &['\x21']), ('\uff02', &['\x22']), ('\uff03', &['\x23']), ('\uff04', &['\x24']), ('\uff05', &['\x25']), ('\uff06', &['\x26']), ('\uff07', &['\x27']), ('\uff08', &['\x28']), ('\uff09', &['\x29']), ('\uff0a', &['\x2a']), ('\uff0b', &['\x2b']), ('\uff0c', &['\x2c']), ('\uff0d', &['\x2d']), ('\uff0e', &['\x2e']), ('\uff0f', &['\x2f']), ('\uff10', &['\x30']), ('\uff11', &['\x31']), ('\uff12', &['\x32']), ('\uff13', &['\x33']), ('\uff14', &['\x34']), ('\uff15', &['\x35']), ('\uff16', &['\x36']), ('\uff17', &['\x37']), ('\uff18', &['\x38']), ('\uff19', &['\x39']), ('\uff1a', &['\x3a']), ('\uff1b', &['\x3b']), ('\uff1c', &['\x3c']), ('\uff1d', &['\x3d']), ('\uff1e', &['\x3e']), ('\uff1f', &['\x3f']), ('\uff20', &['\x40']), ('\uff21', &['\x41']), ('\uff22', &['\x42']), ('\uff23', &['\x43']), ('\uff24', &['\x44']), ('\uff25', &['\x45']), ('\uff26', &['\x46']), ('\uff27', &['\x47']), ('\uff28', &['\x48']), ('\uff29', &['\x49']), ('\uff2a', &['\x4a']), ('\uff2b', &['\x4b']), ('\uff2c', &['\x4c']), ('\uff2d', &['\x4d']), ('\uff2e', &['\x4e']), ('\uff2f', &['\x4f']), ('\uff30', &['\x50']), ('\uff31', &['\x51']), ('\uff32', &['\x52']), ('\uff33', &['\x53']), ('\uff34', &['\x54']), ('\uff35', &['\x55']), ('\uff36', &['\x56']), ('\uff37', &['\x57']), ('\uff38', &['\x58']), ('\uff39', &['\x59']), ('\uff3a', &['\x5a']), ('\uff3b', &['\x5b']), ('\uff3c', &['\x5c']), ('\uff3d', &['\x5d']), ('\uff3e', &['\x5e']), ('\uff3f', &['\x5f']), ('\uff40', &['\x60']), ('\uff41', &['\x61']), ('\uff42', &['\x62']), ('\uff43', &['\x63']), ('\uff44', &['\x64']), ('\uff45', &['\x65']), ('\uff46', &['\x66']), ('\uff47', &['\x67']), ('\uff48', &['\x68']), ('\uff49', &['\x69']), ('\uff4a', &['\x6a']), ('\uff4b', &['\x6b']), ('\uff4c', &['\x6c']), ('\uff4d', &['\x6d']), ('\uff4e', &['\x6e']), ('\uff4f', &['\x6f']), ('\uff50', &['\x70']), ('\uff51', &['\x71']), ('\uff52', &['\x72']), ('\uff53', &['\x73']), ('\uff54', &['\x74']), ('\uff55', &['\x75']), ('\uff56', &['\x76']), ('\uff57', &['\x77']), ('\uff58', &['\x78']), ('\uff59', &['\x79']), ('\uff5a', &['\x7a']), ('\uff5b', &['\x7b']), ('\uff5c', &['\x7c']), ('\uff5d', &['\x7d']), ('\uff5e', &['\x7e']), ('\uff5f', &['\u2985']), ('\uff60', &['\u2986']), ('\uff61', &['\u3002']), ('\uff62', &['\u300c']), ('\uff63', &['\u300d']), ('\uff64', &['\u3001']), ('\uff65', &['\u30fb']), ('\uff66', &['\u30f2']), ('\uff67', &['\u30a1']), ('\uff68', &['\u30a3']), ('\uff69', &['\u30a5']), ('\uff6a', &['\u30a7']), ('\uff6b', &['\u30a9']), ('\uff6c', &['\u30e3']), ('\uff6d', &['\u30e5']), ('\uff6e', &['\u30e7']), ('\uff6f', &['\u30c3']), ('\uff70', &['\u30fc']), ('\uff71', &['\u30a2']), ('\uff72', &['\u30a4']), ('\uff73', &['\u30a6']), ('\uff74', &['\u30a8']), ('\uff75', &['\u30aa']), ('\uff76', &['\u30ab']), ('\uff77', &['\u30ad']), ('\uff78', &['\u30af']), ('\uff79', &['\u30b1']), ('\uff7a', &['\u30b3']), ('\uff7b', &['\u30b5']), ('\uff7c', &['\u30b7']), ('\uff7d', &['\u30b9']), ('\uff7e', &['\u30bb']), ('\uff7f', &['\u30bd']), ('\uff80', &['\u30bf']), ('\uff81', &['\u30c1']), ('\uff82', &['\u30c4']), ('\uff83', &['\u30c6']), ('\uff84', &['\u30c8']), ('\uff85', &['\u30ca']), ('\uff86', &['\u30cb']), ('\uff87', &['\u30cc']), ('\uff88', &['\u30cd']), ('\uff89', &['\u30ce']), ('\uff8a', &['\u30cf']), ('\uff8b', &['\u30d2']), ('\uff8c', &['\u30d5']), ('\uff8d', &['\u30d8']), ('\uff8e', &['\u30db']), ('\uff8f', &['\u30de']), ('\uff90', &['\u30df']), ('\uff91', &['\u30e0']), ('\uff92', &['\u30e1']), ('\uff93', &['\u30e2']), ('\uff94', &['\u30e4']), ('\uff95', &['\u30e6']), ('\uff96', &['\u30e8']), ('\uff97', &['\u30e9']), ('\uff98', &['\u30ea']), ('\uff99', &['\u30eb']), ('\uff9a', &['\u30ec']), ('\uff9b', &['\u30ed']), ('\uff9c', &['\u30ef']), ('\uff9d', &['\u30f3']), ('\uff9e', &['\u3099']), ('\uff9f', &['\u309a']), ('\uffa0', &['\u3164']), ('\uffa1', &['\u3131']), ('\uffa2', &['\u3132']), ('\uffa3', &['\u3133']), ('\uffa4', &['\u3134']), ('\uffa5', &['\u3135']), ('\uffa6', &['\u3136']), ('\uffa7', &['\u3137']), ('\uffa8', &['\u3138']), ('\uffa9', &['\u3139']), ('\uffaa', &['\u313a']), ('\uffab', &['\u313b']), ('\uffac', &['\u313c']), ('\uffad', &['\u313d']), ('\uffae', &['\u313e']), ('\uffaf', &['\u313f']), ('\uffb0', &['\u3140']), ('\uffb1', &['\u3141']), ('\uffb2', &['\u3142']), ('\uffb3', &['\u3143']), ('\uffb4', &['\u3144']), ('\uffb5', &['\u3145']), ('\uffb6', &['\u3146']), ('\uffb7', &['\u3147']), ('\uffb8', &['\u3148']), ('\uffb9', &['\u3149']), ('\uffba', &['\u314a']), ('\uffbb', &['\u314b']), ('\uffbc', &['\u314c']), ('\uffbd', &['\u314d']), ('\uffbe', &['\u314e']), ('\uffc2', &['\u314f']), ('\uffc3', &['\u3150']), ('\uffc4', &['\u3151']), ('\uffc5', &['\u3152']), ('\uffc6', &['\u3153']), ('\uffc7', &['\u3154']), ('\uffca', &['\u3155']), ('\uffcb', &['\u3156']), ('\uffcc', &['\u3157']), ('\uffcd', &['\u3158']), ('\uffce', &['\u3159']), ('\uffcf', &['\u315a']), ('\uffd2', &['\u315b']), ('\uffd3', &['\u315c']), ('\uffd4', &['\u315d']), ('\uffd5', &['\u315e']), ('\uffd6', &['\u315f']), ('\uffd7', &['\u3160']), ('\uffda', &['\u3161']), ('\uffdb', &['\u3162']), ('\uffdc', &['\u3163']), ('\uffe0', &['\u00a2']), ('\uffe1', &['\u00a3']), ('\uffe2', &['\u00ac']), ('\uffe3', &['\u00af']), ('\uffe4', &['\u00a6']), ('\uffe5', &['\u00a5']), ('\uffe6', &['\u20a9']), ('\uffe8', &['\u2502']), ('\uffe9', &['\u2190']), ('\uffea', &['\u2191']), ('\uffeb', &['\u2192']), ('\uffec', &['\u2193']), ('\uffed', &['\u25a0']), ('\uffee', &['\u25cb']), ('\U0001d400', &['\x41']), ('\U0001d401', &['\x42']), ('\U0001d402', &['\x43']), ('\U0001d403', &['\x44']), ('\U0001d404', &['\x45']), ('\U0001d405', &['\x46']), ('\U0001d406', &['\x47']), ('\U0001d407', &['\x48']), ('\U0001d408', &['\x49']), ('\U0001d409', &['\x4a']), ('\U0001d40a', &['\x4b']), ('\U0001d40b', &['\x4c']), ('\U0001d40c', &['\x4d']), ('\U0001d40d', &['\x4e']), ('\U0001d40e', &['\x4f']), ('\U0001d40f', &['\x50']), ('\U0001d410', &['\x51']), ('\U0001d411', &['\x52']), ('\U0001d412', &['\x53']), ('\U0001d413', &['\x54']), ('\U0001d414', &['\x55']), ('\U0001d415', &['\x56']), ('\U0001d416', &['\x57']), ('\U0001d417', &['\x58']), ('\U0001d418', &['\x59']), ('\U0001d419', &['\x5a']), ('\U0001d41a', &['\x61']), ('\U0001d41b', &['\x62']), ('\U0001d41c', &['\x63']), ('\U0001d41d', &['\x64']), ('\U0001d41e', &['\x65']), ('\U0001d41f', &['\x66']), ('\U0001d420', &['\x67']), ('\U0001d421', &['\x68']), ('\U0001d422', &['\x69']), ('\U0001d423', &['\x6a']), ('\U0001d424', &['\x6b']), ('\U0001d425', &['\x6c']), ('\U0001d426', &['\x6d']), ('\U0001d427', &['\x6e']), ('\U0001d428', &['\x6f']), ('\U0001d429', &['\x70']), ('\U0001d42a', &['\x71']), ('\U0001d42b', &['\x72']), ('\U0001d42c', &['\x73']), ('\U0001d42d', &['\x74']), ('\U0001d42e', &['\x75']), ('\U0001d42f', &['\x76']), ('\U0001d430', &['\x77']), ('\U0001d431', &['\x78']), ('\U0001d432', &['\x79']), ('\U0001d433', &['\x7a']), ('\U0001d434', &['\x41']), ('\U0001d435', &['\x42']), ('\U0001d436', &['\x43']), ('\U0001d437', &['\x44']), ('\U0001d438', &['\x45']), ('\U0001d439', &['\x46']), ('\U0001d43a', &['\x47']), ('\U0001d43b', &['\x48']), ('\U0001d43c', &['\x49']), ('\U0001d43d', &['\x4a']), ('\U0001d43e', &['\x4b']), ('\U0001d43f', &['\x4c']), ('\U0001d440', &['\x4d']), ('\U0001d441', &['\x4e']), ('\U0001d442', &['\x4f']), ('\U0001d443', &['\x50']), ('\U0001d444', &['\x51']), ('\U0001d445', &['\x52']), ('\U0001d446', &['\x53']), ('\U0001d447', &['\x54']), ('\U0001d448', &['\x55']), ('\U0001d449', &['\x56']), ('\U0001d44a', &['\x57']), ('\U0001d44b', &['\x58']), ('\U0001d44c', &['\x59']), ('\U0001d44d', &['\x5a']), ('\U0001d44e', &['\x61']), ('\U0001d44f', &['\x62']), ('\U0001d450', &['\x63']), ('\U0001d451', &['\x64']), ('\U0001d452', &['\x65']), ('\U0001d453', &['\x66']), ('\U0001d454', &['\x67']), ('\U0001d456', &['\x69']), ('\U0001d457', &['\x6a']), ('\U0001d458', &['\x6b']), ('\U0001d459', &['\x6c']), ('\U0001d45a', &['\x6d']), ('\U0001d45b', &['\x6e']), ('\U0001d45c', &['\x6f']), ('\U0001d45d', &['\x70']), ('\U0001d45e', &['\x71']), ('\U0001d45f', &['\x72']), ('\U0001d460', &['\x73']), ('\U0001d461', &['\x74']), ('\U0001d462', &['\x75']), ('\U0001d463', &['\x76']), ('\U0001d464', &['\x77']), ('\U0001d465', &['\x78']), ('\U0001d466', &['\x79']), ('\U0001d467', &['\x7a']), ('\U0001d468', &['\x41']), ('\U0001d469', &['\x42']), ('\U0001d46a', &['\x43']), ('\U0001d46b', &['\x44']), ('\U0001d46c', &['\x45']), ('\U0001d46d', &['\x46']), ('\U0001d46e', &['\x47']), ('\U0001d46f', &['\x48']), ('\U0001d470', &['\x49']), ('\U0001d471', &['\x4a']), ('\U0001d472', &['\x4b']), ('\U0001d473', &['\x4c']), ('\U0001d474', &['\x4d']), ('\U0001d475', &['\x4e']), ('\U0001d476', &['\x4f']), ('\U0001d477', &['\x50']), ('\U0001d478', &['\x51']), ('\U0001d479', &['\x52']), ('\U0001d47a', &['\x53']), ('\U0001d47b', &['\x54']), ('\U0001d47c', &['\x55']), ('\U0001d47d', &['\x56']), ('\U0001d47e', &['\x57']), ('\U0001d47f', &['\x58']), ('\U0001d480', &['\x59']), ('\U0001d481', &['\x5a']), ('\U0001d482', &['\x61']), ('\U0001d483', &['\x62']), ('\U0001d484', &['\x63']), ('\U0001d485', &['\x64']), ('\U0001d486', &['\x65']), ('\U0001d487', &['\x66']), ('\U0001d488', &['\x67']), ('\U0001d489', &['\x68']), ('\U0001d48a', &['\x69']), ('\U0001d48b', &['\x6a']), ('\U0001d48c', &['\x6b']), ('\U0001d48d', &['\x6c']), ('\U0001d48e', &['\x6d']), ('\U0001d48f', &['\x6e']), ('\U0001d490', &['\x6f']), ('\U0001d491', &['\x70']), ('\U0001d492', &['\x71']), ('\U0001d493', &['\x72']), ('\U0001d494', &['\x73']), ('\U0001d495', &['\x74']), ('\U0001d496', &['\x75']), ('\U0001d497', &['\x76']), ('\U0001d498', &['\x77']), ('\U0001d499', &['\x78']), ('\U0001d49a', &['\x79']), ('\U0001d49b', &['\x7a']), ('\U0001d49c', &['\x41']), ('\U0001d49e', &['\x43']), ('\U0001d49f', &['\x44']), ('\U0001d4a2', &['\x47']), ('\U0001d4a5', &['\x4a']), ('\U0001d4a6', &['\x4b']), ('\U0001d4a9', &['\x4e']), ('\U0001d4aa', &['\x4f']), ('\U0001d4ab', &['\x50']), ('\U0001d4ac', &['\x51']), ('\U0001d4ae', &['\x53']), ('\U0001d4af', &['\x54']), ('\U0001d4b0', &['\x55']), ('\U0001d4b1', &['\x56']), ('\U0001d4b2', &['\x57']), ('\U0001d4b3', &['\x58']), ('\U0001d4b4', &['\x59']), ('\U0001d4b5', &['\x5a']), ('\U0001d4b6', &['\x61']), ('\U0001d4b7', &['\x62']), ('\U0001d4b8', &['\x63']), ('\U0001d4b9', &['\x64']), ('\U0001d4bb', &['\x66']), ('\U0001d4bd', &['\x68']), ('\U0001d4be', &['\x69']), ('\U0001d4bf', &['\x6a']), ('\U0001d4c0', &['\x6b']), ('\U0001d4c1', &['\x6c']), ('\U0001d4c2', &['\x6d']), ('\U0001d4c3', &['\x6e']), ('\U0001d4c5', &['\x70']), ('\U0001d4c6', &['\x71']), ('\U0001d4c7', &['\x72']), ('\U0001d4c8', &['\x73']), ('\U0001d4c9', &['\x74']), ('\U0001d4ca', &['\x75']), ('\U0001d4cb', &['\x76']), ('\U0001d4cc', &['\x77']), ('\U0001d4cd', &['\x78']), ('\U0001d4ce', &['\x79']), ('\U0001d4cf', &['\x7a']), ('\U0001d4d0', &['\x41']), ('\U0001d4d1', &['\x42']), ('\U0001d4d2', &['\x43']), ('\U0001d4d3', &['\x44']), ('\U0001d4d4', &['\x45']), ('\U0001d4d5', &['\x46']), ('\U0001d4d6', &['\x47']), ('\U0001d4d7', &['\x48']), ('\U0001d4d8', &['\x49']), ('\U0001d4d9', &['\x4a']), ('\U0001d4da', &['\x4b']), ('\U0001d4db', &['\x4c']), ('\U0001d4dc', &['\x4d']), ('\U0001d4dd', &['\x4e']), ('\U0001d4de', &['\x4f']), ('\U0001d4df', &['\x50']), ('\U0001d4e0', &['\x51']), ('\U0001d4e1', &['\x52']), ('\U0001d4e2', &['\x53']), ('\U0001d4e3', &['\x54']), ('\U0001d4e4', &['\x55']), ('\U0001d4e5', &['\x56']), ('\U0001d4e6', &['\x57']), ('\U0001d4e7', &['\x58']), ('\U0001d4e8', &['\x59']), ('\U0001d4e9', &['\x5a']), ('\U0001d4ea', &['\x61']), ('\U0001d4eb', &['\x62']), ('\U0001d4ec', &['\x63']), ('\U0001d4ed', &['\x64']), ('\U0001d4ee', &['\x65']), ('\U0001d4ef', &['\x66']), ('\U0001d4f0', &['\x67']), ('\U0001d4f1', &['\x68']), ('\U0001d4f2', &['\x69']), ('\U0001d4f3', &['\x6a']), ('\U0001d4f4', &['\x6b']), ('\U0001d4f5', &['\x6c']), ('\U0001d4f6', &['\x6d']), ('\U0001d4f7', &['\x6e']), ('\U0001d4f8', &['\x6f']), ('\U0001d4f9', &['\x70']), ('\U0001d4fa', &['\x71']), ('\U0001d4fb', &['\x72']), ('\U0001d4fc', &['\x73']), ('\U0001d4fd', &['\x74']), ('\U0001d4fe', &['\x75']), ('\U0001d4ff', &['\x76']), ('\U0001d500', &['\x77']), ('\U0001d501', &['\x78']), ('\U0001d502', &['\x79']), ('\U0001d503', &['\x7a']), ('\U0001d504', &['\x41']), ('\U0001d505', &['\x42']), ('\U0001d507', &['\x44']), ('\U0001d508', &['\x45']), ('\U0001d509', &['\x46']), ('\U0001d50a', &['\x47']), ('\U0001d50d', &['\x4a']), ('\U0001d50e', &['\x4b']), ('\U0001d50f', &['\x4c']), ('\U0001d510', &['\x4d']), ('\U0001d511', &['\x4e']), ('\U0001d512', &['\x4f']), ('\U0001d513', &['\x50']), ('\U0001d514', &['\x51']), ('\U0001d516', &['\x53']), ('\U0001d517', &['\x54']), ('\U0001d518', &['\x55']), ('\U0001d519', &['\x56']), ('\U0001d51a', &['\x57']), ('\U0001d51b', &['\x58']), ('\U0001d51c', &['\x59']), ('\U0001d51e', &['\x61']), ('\U0001d51f', &['\x62']), ('\U0001d520', &['\x63']), ('\U0001d521', &['\x64']), ('\U0001d522', &['\x65']), ('\U0001d523', &['\x66']), ('\U0001d524', &['\x67']), ('\U0001d525', &['\x68']), ('\U0001d526', &['\x69']), ('\U0001d527', &['\x6a']), ('\U0001d528', &['\x6b']), ('\U0001d529', &['\x6c']), ('\U0001d52a', &['\x6d']), ('\U0001d52b', &['\x6e']), ('\U0001d52c', &['\x6f']), ('\U0001d52d', &['\x70']), ('\U0001d52e', &['\x71']), ('\U0001d52f', &['\x72']), ('\U0001d530', &['\x73']), ('\U0001d531', &['\x74']), ('\U0001d532', &['\x75']), ('\U0001d533', &['\x76']), ('\U0001d534', &['\x77']), ('\U0001d535', &['\x78']), ('\U0001d536', &['\x79']), ('\U0001d537', &['\x7a']), ('\U0001d538', &['\x41']), ('\U0001d539', &['\x42']), ('\U0001d53b', &['\x44']), ('\U0001d53c', &['\x45']), ('\U0001d53d', &['\x46']), ('\U0001d53e', &['\x47']), ('\U0001d540', &['\x49']), ('\U0001d541', &['\x4a']), ('\U0001d542', &['\x4b']), ('\U0001d543', &['\x4c']), ('\U0001d544', &['\x4d']), ('\U0001d546', &['\x4f']), ('\U0001d54a', &['\x53']), ('\U0001d54b', &['\x54']), ('\U0001d54c', &['\x55']), ('\U0001d54d', &['\x56']), ('\U0001d54e', &['\x57']), ('\U0001d54f', &['\x58']), ('\U0001d550', &['\x59']), ('\U0001d552', &['\x61']), ('\U0001d553', &['\x62']), ('\U0001d554', &['\x63']), ('\U0001d555', &['\x64']), ('\U0001d556', &['\x65']), ('\U0001d557', &['\x66']), ('\U0001d558', &['\x67']), ('\U0001d559', &['\x68']), ('\U0001d55a', &['\x69']), ('\U0001d55b', &['\x6a']), ('\U0001d55c', &['\x6b']), ('\U0001d55d', &['\x6c']), ('\U0001d55e', &['\x6d']), ('\U0001d55f', &['\x6e']), ('\U0001d560', &['\x6f']), ('\U0001d561', &['\x70']), ('\U0001d562', &['\x71']), ('\U0001d563', &['\x72']), ('\U0001d564', &['\x73']), ('\U0001d565', &['\x74']), ('\U0001d566', &['\x75']), ('\U0001d567', &['\x76']), ('\U0001d568', &['\x77']), ('\U0001d569', &['\x78']), ('\U0001d56a', &['\x79']), ('\U0001d56b', &['\x7a']), ('\U0001d56c', &['\x41']), ('\U0001d56d', &['\x42']), ('\U0001d56e', &['\x43']), ('\U0001d56f', &['\x44']), ('\U0001d570', &['\x45']), ('\U0001d571', &['\x46']), ('\U0001d572', &['\x47']), ('\U0001d573', &['\x48']), ('\U0001d574', &['\x49']), ('\U0001d575', &['\x4a']), ('\U0001d576', &['\x4b']), ('\U0001d577', &['\x4c']), ('\U0001d578', &['\x4d']), ('\U0001d579', &['\x4e']), ('\U0001d57a', &['\x4f']), ('\U0001d57b', &['\x50']), ('\U0001d57c', &['\x51']), ('\U0001d57d', &['\x52']), ('\U0001d57e', &['\x53']), ('\U0001d57f', &['\x54']), ('\U0001d580', &['\x55']), ('\U0001d581', &['\x56']), ('\U0001d582', &['\x57']), ('\U0001d583', &['\x58']), ('\U0001d584', &['\x59']), ('\U0001d585', &['\x5a']), ('\U0001d586', &['\x61']), ('\U0001d587', &['\x62']), ('\U0001d588', &['\x63']), ('\U0001d589', &['\x64']), ('\U0001d58a', &['\x65']), ('\U0001d58b', &['\x66']), ('\U0001d58c', &['\x67']), ('\U0001d58d', &['\x68']), ('\U0001d58e', &['\x69']), ('\U0001d58f', &['\x6a']), ('\U0001d590', &['\x6b']), ('\U0001d591', &['\x6c']), ('\U0001d592', &['\x6d']), ('\U0001d593', &['\x6e']), ('\U0001d594', &['\x6f']), ('\U0001d595', &['\x70']), ('\U0001d596', &['\x71']), ('\U0001d597', &['\x72']), ('\U0001d598', &['\x73']), ('\U0001d599', &['\x74']), ('\U0001d59a', &['\x75']), ('\U0001d59b', &['\x76']), ('\U0001d59c', &['\x77']), ('\U0001d59d', &['\x78']), ('\U0001d59e', &['\x79']), ('\U0001d59f', &['\x7a']), ('\U0001d5a0', &['\x41']), ('\U0001d5a1', &['\x42']), ('\U0001d5a2', &['\x43']), ('\U0001d5a3', &['\x44']), ('\U0001d5a4', &['\x45']), ('\U0001d5a5', &['\x46']), ('\U0001d5a6', &['\x47']), ('\U0001d5a7', &['\x48']), ('\U0001d5a8', &['\x49']), ('\U0001d5a9', &['\x4a']), ('\U0001d5aa', &['\x4b']), ('\U0001d5ab', &['\x4c']), ('\U0001d5ac', &['\x4d']), ('\U0001d5ad', &['\x4e']), ('\U0001d5ae', &['\x4f']), ('\U0001d5af', &['\x50']), ('\U0001d5b0', &['\x51']), ('\U0001d5b1', &['\x52']), ('\U0001d5b2', &['\x53']), ('\U0001d5b3', &['\x54']), ('\U0001d5b4', &['\x55']), ('\U0001d5b5', &['\x56']), ('\U0001d5b6', &['\x57']), ('\U0001d5b7', &['\x58']), ('\U0001d5b8', &['\x59']), ('\U0001d5b9', &['\x5a']), ('\U0001d5ba', &['\x61']), ('\U0001d5bb', &['\x62']), ('\U0001d5bc', &['\x63']), ('\U0001d5bd', &['\x64']), ('\U0001d5be', &['\x65']), ('\U0001d5bf', &['\x66']), ('\U0001d5c0', &['\x67']), ('\U0001d5c1', &['\x68']), ('\U0001d5c2', &['\x69']), ('\U0001d5c3', &['\x6a']), ('\U0001d5c4', &['\x6b']), ('\U0001d5c5', &['\x6c']), ('\U0001d5c6', &['\x6d']), ('\U0001d5c7', &['\x6e']), ('\U0001d5c8', &['\x6f']), ('\U0001d5c9', &['\x70']), ('\U0001d5ca', &['\x71']), ('\U0001d5cb', &['\x72']), ('\U0001d5cc', &['\x73']), ('\U0001d5cd', &['\x74']), ('\U0001d5ce', &['\x75']), ('\U0001d5cf', &['\x76']), ('\U0001d5d0', &['\x77']), ('\U0001d5d1', &['\x78']), ('\U0001d5d2', &['\x79']), ('\U0001d5d3', &['\x7a']), ('\U0001d5d4', &['\x41']), ('\U0001d5d5', &['\x42']), ('\U0001d5d6', &['\x43']), ('\U0001d5d7', &['\x44']), ('\U0001d5d8', &['\x45']), ('\U0001d5d9', &['\x46']), ('\U0001d5da', &['\x47']), ('\U0001d5db', &['\x48']), ('\U0001d5dc', &['\x49']), ('\U0001d5dd', &['\x4a']), ('\U0001d5de', &['\x4b']), ('\U0001d5df', &['\x4c']), ('\U0001d5e0', &['\x4d']), ('\U0001d5e1', &['\x4e']), ('\U0001d5e2', &['\x4f']), ('\U0001d5e3', &['\x50']), ('\U0001d5e4', &['\x51']), ('\U0001d5e5', &['\x52']), ('\U0001d5e6', &['\x53']), ('\U0001d5e7', &['\x54']), ('\U0001d5e8', &['\x55']), ('\U0001d5e9', &['\x56']), ('\U0001d5ea', &['\x57']), ('\U0001d5eb', &['\x58']), ('\U0001d5ec', &['\x59']), ('\U0001d5ed', &['\x5a']), ('\U0001d5ee', &['\x61']), ('\U0001d5ef', &['\x62']), ('\U0001d5f0', &['\x63']), ('\U0001d5f1', &['\x64']), ('\U0001d5f2', &['\x65']), ('\U0001d5f3', &['\x66']), ('\U0001d5f4', &['\x67']), ('\U0001d5f5', &['\x68']), ('\U0001d5f6', &['\x69']), ('\U0001d5f7', &['\x6a']), ('\U0001d5f8', &['\x6b']), ('\U0001d5f9', &['\x6c']), ('\U0001d5fa', &['\x6d']), ('\U0001d5fb', &['\x6e']), ('\U0001d5fc', &['\x6f']), ('\U0001d5fd', &['\x70']), ('\U0001d5fe', &['\x71']), ('\U0001d5ff', &['\x72']), ('\U0001d600', &['\x73']), ('\U0001d601', &['\x74']), ('\U0001d602', &['\x75']), ('\U0001d603', &['\x76']), ('\U0001d604', &['\x77']), ('\U0001d605', &['\x78']), ('\U0001d606', &['\x79']), ('\U0001d607', &['\x7a']), ('\U0001d608', &['\x41']), ('\U0001d609', &['\x42']), ('\U0001d60a', &['\x43']), ('\U0001d60b', &['\x44']), ('\U0001d60c', &['\x45']), ('\U0001d60d', &['\x46']), ('\U0001d60e', &['\x47']), ('\U0001d60f', &['\x48']), ('\U0001d610', &['\x49']), ('\U0001d611', &['\x4a']), ('\U0001d612', &['\x4b']), ('\U0001d613', &['\x4c']), ('\U0001d614', &['\x4d']), ('\U0001d615', &['\x4e']), ('\U0001d616', &['\x4f']), ('\U0001d617', &['\x50']), ('\U0001d618', &['\x51']), ('\U0001d619', &['\x52']), ('\U0001d61a', &['\x53']), ('\U0001d61b', &['\x54']), ('\U0001d61c', &['\x55']), ('\U0001d61d', &['\x56']), ('\U0001d61e', &['\x57']), ('\U0001d61f', &['\x58']), ('\U0001d620', &['\x59']), ('\U0001d621', &['\x5a']), ('\U0001d622', &['\x61']), ('\U0001d623', &['\x62']), ('\U0001d624', &['\x63']), ('\U0001d625', &['\x64']), ('\U0001d626', &['\x65']), ('\U0001d627', &['\x66']), ('\U0001d628', &['\x67']), ('\U0001d629', &['\x68']), ('\U0001d62a', &['\x69']), ('\U0001d62b', &['\x6a']), ('\U0001d62c', &['\x6b']), ('\U0001d62d', &['\x6c']), ('\U0001d62e', &['\x6d']), ('\U0001d62f', &['\x6e']), ('\U0001d630', &['\x6f']), ('\U0001d631', &['\x70']), ('\U0001d632', &['\x71']), ('\U0001d633', &['\x72']), ('\U0001d634', &['\x73']), ('\U0001d635', &['\x74']), ('\U0001d636', &['\x75']), ('\U0001d637', &['\x76']), ('\U0001d638', &['\x77']), ('\U0001d639', &['\x78']), ('\U0001d63a', &['\x79']), ('\U0001d63b', &['\x7a']), ('\U0001d63c', &['\x41']), ('\U0001d63d', &['\x42']), ('\U0001d63e', &['\x43']), ('\U0001d63f', &['\x44']), ('\U0001d640', &['\x45']), ('\U0001d641', &['\x46']), ('\U0001d642', &['\x47']), ('\U0001d643', &['\x48']), ('\U0001d644', &['\x49']), ('\U0001d645', &['\x4a']), ('\U0001d646', &['\x4b']), ('\U0001d647', &['\x4c']), ('\U0001d648', &['\x4d']), ('\U0001d649', &['\x4e']), ('\U0001d64a', &['\x4f']), ('\U0001d64b', &['\x50']), ('\U0001d64c', &['\x51']), ('\U0001d64d', &['\x52']), ('\U0001d64e', &['\x53']), ('\U0001d64f', &['\x54']), ('\U0001d650', &['\x55']), ('\U0001d651', &['\x56']), ('\U0001d652', &['\x57']), ('\U0001d653', &['\x58']), ('\U0001d654', &['\x59']), ('\U0001d655', &['\x5a']), ('\U0001d656', &['\x61']), ('\U0001d657', &['\x62']), ('\U0001d658', &['\x63']), ('\U0001d659', &['\x64']), ('\U0001d65a', &['\x65']), ('\U0001d65b', &['\x66']), ('\U0001d65c', &['\x67']), ('\U0001d65d', &['\x68']), ('\U0001d65e', &['\x69']), ('\U0001d65f', &['\x6a']), ('\U0001d660', &['\x6b']), ('\U0001d661', &['\x6c']), ('\U0001d662', &['\x6d']), ('\U0001d663', &['\x6e']), ('\U0001d664', &['\x6f']), ('\U0001d665', &['\x70']), ('\U0001d666', &['\x71']), ('\U0001d667', &['\x72']), ('\U0001d668', &['\x73']), ('\U0001d669', &['\x74']), ('\U0001d66a', &['\x75']), ('\U0001d66b', &['\x76']), ('\U0001d66c', &['\x77']), ('\U0001d66d', &['\x78']), ('\U0001d66e', &['\x79']), ('\U0001d66f', &['\x7a']), ('\U0001d670', &['\x41']), ('\U0001d671', &['\x42']), ('\U0001d672', &['\x43']), ('\U0001d673', &['\x44']), ('\U0001d674', &['\x45']), ('\U0001d675', &['\x46']), ('\U0001d676', &['\x47']), ('\U0001d677', &['\x48']), ('\U0001d678', &['\x49']), ('\U0001d679', &['\x4a']), ('\U0001d67a', &['\x4b']), ('\U0001d67b', &['\x4c']), ('\U0001d67c', &['\x4d']), ('\U0001d67d', &['\x4e']), ('\U0001d67e', &['\x4f']), ('\U0001d67f', &['\x50']), ('\U0001d680', &['\x51']), ('\U0001d681', &['\x52']), ('\U0001d682', &['\x53']), ('\U0001d683', &['\x54']), ('\U0001d684', &['\x55']), ('\U0001d685', &['\x56']), ('\U0001d686', &['\x57']), ('\U0001d687', &['\x58']), ('\U0001d688', &['\x59']), ('\U0001d689', &['\x5a']), ('\U0001d68a', &['\x61']), ('\U0001d68b', &['\x62']), ('\U0001d68c', &['\x63']), ('\U0001d68d', &['\x64']), ('\U0001d68e', &['\x65']), ('\U0001d68f', &['\x66']), ('\U0001d690', &['\x67']), ('\U0001d691', &['\x68']), ('\U0001d692', &['\x69']), ('\U0001d693', &['\x6a']), ('\U0001d694', &['\x6b']), ('\U0001d695', &['\x6c']), ('\U0001d696', &['\x6d']), ('\U0001d697', &['\x6e']), ('\U0001d698', &['\x6f']), ('\U0001d699', &['\x70']), ('\U0001d69a', &['\x71']), ('\U0001d69b', &['\x72']), ('\U0001d69c', &['\x73']), ('\U0001d69d', &['\x74']), ('\U0001d69e', &['\x75']), ('\U0001d69f', &['\x76']), ('\U0001d6a0', &['\x77']), ('\U0001d6a1', &['\x78']), ('\U0001d6a2', &['\x79']), ('\U0001d6a3', &['\x7a']), ('\U0001d6a4', &['\u0131']), ('\U0001d6a5', &['\u0237']), ('\U0001d6a8', &['\u0391']), ('\U0001d6a9', &['\u0392']), ('\U0001d6aa', &['\u0393']), ('\U0001d6ab', &['\u0394']), ('\U0001d6ac', &['\u0395']), ('\U0001d6ad', &['\u0396']), ('\U0001d6ae', &['\u0397']), ('\U0001d6af', &['\u0398']), ('\U0001d6b0', &['\u0399']), ('\U0001d6b1', &['\u039a']), ('\U0001d6b2', &['\u039b']), ('\U0001d6b3', &['\u039c']), ('\U0001d6b4', &['\u039d']), ('\U0001d6b5', &['\u039e']), ('\U0001d6b6', &['\u039f']), ('\U0001d6b7', &['\u03a0']), ('\U0001d6b8', &['\u03a1']), ('\U0001d6b9', &['\u03f4']), ('\U0001d6ba', &['\u03a3']), ('\U0001d6bb', &['\u03a4']), ('\U0001d6bc', &['\u03a5']), ('\U0001d6bd', &['\u03a6']), ('\U0001d6be', &['\u03a7']), ('\U0001d6bf', &['\u03a8']), ('\U0001d6c0', &['\u03a9']), ('\U0001d6c1', &['\u2207']), ('\U0001d6c2', &['\u03b1']), ('\U0001d6c3', &['\u03b2']), ('\U0001d6c4', &['\u03b3']), ('\U0001d6c5', &['\u03b4']), ('\U0001d6c6', &['\u03b5']), ('\U0001d6c7', &['\u03b6']), ('\U0001d6c8', &['\u03b7']), ('\U0001d6c9', &['\u03b8']), ('\U0001d6ca', &['\u03b9']), ('\U0001d6cb', &['\u03ba']), ('\U0001d6cc', &['\u03bb']), ('\U0001d6cd', &['\u03bc']), ('\U0001d6ce', &['\u03bd']), ('\U0001d6cf', &['\u03be']), ('\U0001d6d0', &['\u03bf']), ('\U0001d6d1', &['\u03c0']), ('\U0001d6d2', &['\u03c1']), ('\U0001d6d3', &['\u03c2']), ('\U0001d6d4', &['\u03c3']), ('\U0001d6d5', &['\u03c4']), ('\U0001d6d6', &['\u03c5']), ('\U0001d6d7', &['\u03c6']), ('\U0001d6d8', &['\u03c7']), ('\U0001d6d9', &['\u03c8']), ('\U0001d6da', &['\u03c9']), ('\U0001d6db', &['\u2202']), ('\U0001d6dc', &['\u03f5']), ('\U0001d6dd', &['\u03d1']), ('\U0001d6de', &['\u03f0']), ('\U0001d6df', &['\u03d5']), ('\U0001d6e0', &['\u03f1']), ('\U0001d6e1', &['\u03d6']), ('\U0001d6e2', &['\u0391']), ('\U0001d6e3', &['\u0392']), ('\U0001d6e4', &['\u0393']), ('\U0001d6e5', &['\u0394']), ('\U0001d6e6', &['\u0395']), ('\U0001d6e7', &['\u0396']), ('\U0001d6e8', &['\u0397']), ('\U0001d6e9', &['\u0398']), ('\U0001d6ea', &['\u0399']), ('\U0001d6eb', &['\u039a']), ('\U0001d6ec', &['\u039b']), ('\U0001d6ed', &['\u039c']), ('\U0001d6ee', &['\u039d']), ('\U0001d6ef', &['\u039e']), ('\U0001d6f0', &['\u039f']), ('\U0001d6f1', &['\u03a0']), ('\U0001d6f2', &['\u03a1']), ('\U0001d6f3', &['\u03f4']), ('\U0001d6f4', &['\u03a3']), ('\U0001d6f5', &['\u03a4']), ('\U0001d6f6', &['\u03a5']), ('\U0001d6f7', &['\u03a6']), ('\U0001d6f8', &['\u03a7']), ('\U0001d6f9', &['\u03a8']), ('\U0001d6fa', &['\u03a9']), ('\U0001d6fb', &['\u2207']), ('\U0001d6fc', &['\u03b1']), ('\U0001d6fd', &['\u03b2']), ('\U0001d6fe', &['\u03b3']), ('\U0001d6ff', &['\u03b4']), ('\U0001d700', &['\u03b5']), ('\U0001d701', &['\u03b6']), ('\U0001d702', &['\u03b7']), ('\U0001d703', &['\u03b8']), ('\U0001d704', &['\u03b9']), ('\U0001d705', &['\u03ba']), ('\U0001d706', &['\u03bb']), ('\U0001d707', &['\u03bc']), ('\U0001d708', &['\u03bd']), ('\U0001d709', &['\u03be']), ('\U0001d70a', &['\u03bf']), ('\U0001d70b', &['\u03c0']), ('\U0001d70c', &['\u03c1']), ('\U0001d70d', &['\u03c2']), ('\U0001d70e', &['\u03c3']), ('\U0001d70f', &['\u03c4']), ('\U0001d710', &['\u03c5']), ('\U0001d711', &['\u03c6']), ('\U0001d712', &['\u03c7']), ('\U0001d713', &['\u03c8']), ('\U0001d714', &['\u03c9']), ('\U0001d715', &['\u2202']), ('\U0001d716', &['\u03f5']), ('\U0001d717', &['\u03d1']), ('\U0001d718', &['\u03f0']), ('\U0001d719', &['\u03d5']), ('\U0001d71a', &['\u03f1']), ('\U0001d71b', &['\u03d6']), ('\U0001d71c', &['\u0391']), ('\U0001d71d', &['\u0392']), ('\U0001d71e', &['\u0393']), ('\U0001d71f', &['\u0394']), ('\U0001d720', &['\u0395']), ('\U0001d721', &['\u0396']), ('\U0001d722', &['\u0397']), ('\U0001d723', &['\u0398']), ('\U0001d724', &['\u0399']), ('\U0001d725', &['\u039a']), ('\U0001d726', &['\u039b']), ('\U0001d727', &['\u039c']), ('\U0001d728', &['\u039d']), ('\U0001d729', &['\u039e']), ('\U0001d72a', &['\u039f']), ('\U0001d72b', &['\u03a0']), ('\U0001d72c', &['\u03a1']), ('\U0001d72d', &['\u03f4']), ('\U0001d72e', &['\u03a3']), ('\U0001d72f', &['\u03a4']), ('\U0001d730', &['\u03a5']), ('\U0001d731', &['\u03a6']), ('\U0001d732', &['\u03a7']), ('\U0001d733', &['\u03a8']), ('\U0001d734', &['\u03a9']), ('\U0001d735', &['\u2207']), ('\U0001d736', &['\u03b1']), ('\U0001d737', &['\u03b2']), ('\U0001d738', &['\u03b3']), ('\U0001d739', &['\u03b4']), ('\U0001d73a', &['\u03b5']), ('\U0001d73b', &['\u03b6']), ('\U0001d73c', &['\u03b7']), ('\U0001d73d', &['\u03b8']), ('\U0001d73e', &['\u03b9']), ('\U0001d73f', &['\u03ba']), ('\U0001d740', &['\u03bb']), ('\U0001d741', &['\u03bc']), ('\U0001d742', &['\u03bd']), ('\U0001d743', &['\u03be']), ('\U0001d744', &['\u03bf']), ('\U0001d745', &['\u03c0']), ('\U0001d746', &['\u03c1']), ('\U0001d747', &['\u03c2']), ('\U0001d748', &['\u03c3']), ('\U0001d749', &['\u03c4']), ('\U0001d74a', &['\u03c5']), ('\U0001d74b', &['\u03c6']), ('\U0001d74c', &['\u03c7']), ('\U0001d74d', &['\u03c8']), ('\U0001d74e', &['\u03c9']), ('\U0001d74f', &['\u2202']), ('\U0001d750', &['\u03f5']), ('\U0001d751', &['\u03d1']), ('\U0001d752', &['\u03f0']), ('\U0001d753', &['\u03d5']), ('\U0001d754', &['\u03f1']), ('\U0001d755', &['\u03d6']), ('\U0001d756', &['\u0391']), ('\U0001d757', &['\u0392']), ('\U0001d758', &['\u0393']), ('\U0001d759', &['\u0394']), ('\U0001d75a', &['\u0395']), ('\U0001d75b', &['\u0396']), ('\U0001d75c', &['\u0397']), ('\U0001d75d', &['\u0398']), ('\U0001d75e', &['\u0399']), ('\U0001d75f', &['\u039a']), ('\U0001d760', &['\u039b']), ('\U0001d761', &['\u039c']), ('\U0001d762', &['\u039d']), ('\U0001d763', &['\u039e']), ('\U0001d764', &['\u039f']), ('\U0001d765', &['\u03a0']), ('\U0001d766', &['\u03a1']), ('\U0001d767', &['\u03f4']), ('\U0001d768', &['\u03a3']), ('\U0001d769', &['\u03a4']), ('\U0001d76a', &['\u03a5']), ('\U0001d76b', &['\u03a6']), ('\U0001d76c', &['\u03a7']), ('\U0001d76d', &['\u03a8']), ('\U0001d76e', &['\u03a9']), ('\U0001d76f', &['\u2207']), ('\U0001d770', &['\u03b1']), ('\U0001d771', &['\u03b2']), ('\U0001d772', &['\u03b3']), ('\U0001d773', &['\u03b4']), ('\U0001d774', &['\u03b5']), ('\U0001d775', &['\u03b6']), ('\U0001d776', &['\u03b7']), ('\U0001d777', &['\u03b8']), ('\U0001d778', &['\u03b9']), ('\U0001d779', &['\u03ba']), ('\U0001d77a', &['\u03bb']), ('\U0001d77b', &['\u03bc']), ('\U0001d77c', &['\u03bd']), ('\U0001d77d', &['\u03be']), ('\U0001d77e', &['\u03bf']), ('\U0001d77f', &['\u03c0']), ('\U0001d780', &['\u03c1']), ('\U0001d781', &['\u03c2']), ('\U0001d782', &['\u03c3']), ('\U0001d783', &['\u03c4']), ('\U0001d784', &['\u03c5']), ('\U0001d785', &['\u03c6']), ('\U0001d786', &['\u03c7']), ('\U0001d787', &['\u03c8']), ('\U0001d788', &['\u03c9']), ('\U0001d789', &['\u2202']), ('\U0001d78a', &['\u03f5']), ('\U0001d78b', &['\u03d1']), ('\U0001d78c', &['\u03f0']), ('\U0001d78d', &['\u03d5']), ('\U0001d78e', &['\u03f1']), ('\U0001d78f', &['\u03d6']), ('\U0001d790', &['\u0391']), ('\U0001d791', &['\u0392']), ('\U0001d792', &['\u0393']), ('\U0001d793', &['\u0394']), ('\U0001d794', &['\u0395']), ('\U0001d795', &['\u0396']), ('\U0001d796', &['\u0397']), ('\U0001d797', &['\u0398']), ('\U0001d798', &['\u0399']), ('\U0001d799', &['\u039a']), ('\U0001d79a', &['\u039b']), ('\U0001d79b', &['\u039c']), ('\U0001d79c', &['\u039d']), ('\U0001d79d', &['\u039e']), ('\U0001d79e', &['\u039f']), ('\U0001d79f', &['\u03a0']), ('\U0001d7a0', &['\u03a1']), ('\U0001d7a1', &['\u03f4']), ('\U0001d7a2', &['\u03a3']), ('\U0001d7a3', &['\u03a4']), ('\U0001d7a4', &['\u03a5']), ('\U0001d7a5', &['\u03a6']), ('\U0001d7a6', &['\u03a7']), ('\U0001d7a7', &['\u03a8']), ('\U0001d7a8', &['\u03a9']), ('\U0001d7a9', &['\u2207']), ('\U0001d7aa', &['\u03b1']), ('\U0001d7ab', &['\u03b2']), ('\U0001d7ac', &['\u03b3']), ('\U0001d7ad', &['\u03b4']), ('\U0001d7ae', &['\u03b5']), ('\U0001d7af', &['\u03b6']), ('\U0001d7b0', &['\u03b7']), ('\U0001d7b1', &['\u03b8']), ('\U0001d7b2', &['\u03b9']), ('\U0001d7b3', &['\u03ba']), ('\U0001d7b4', &['\u03bb']), ('\U0001d7b5', &['\u03bc']), ('\U0001d7b6', &['\u03bd']), ('\U0001d7b7', &['\u03be']), ('\U0001d7b8', &['\u03bf']), ('\U0001d7b9', &['\u03c0']), ('\U0001d7ba', &['\u03c1']), ('\U0001d7bb', &['\u03c2']), ('\U0001d7bc', &['\u03c3']), ('\U0001d7bd', &['\u03c4']), ('\U0001d7be', &['\u03c5']), ('\U0001d7bf', &['\u03c6']), ('\U0001d7c0', &['\u03c7']), ('\U0001d7c1', &['\u03c8']), ('\U0001d7c2', &['\u03c9']), ('\U0001d7c3', &['\u2202']), ('\U0001d7c4', &['\u03f5']), ('\U0001d7c5', &['\u03d1']), ('\U0001d7c6', &['\u03f0']), ('\U0001d7c7', &['\u03d5']), ('\U0001d7c8', &['\u03f1']), ('\U0001d7c9', &['\u03d6']), ('\U0001d7ca', &['\u03dc']), ('\U0001d7cb', &['\u03dd']), ('\U0001d7ce', &['\x30']), ('\U0001d7cf', &['\x31']), ('\U0001d7d0', &['\x32']), ('\U0001d7d1', &['\x33']), ('\U0001d7d2', &['\x34']), ('\U0001d7d3', &['\x35']), ('\U0001d7d4', &['\x36']), ('\U0001d7d5', &['\x37']), ('\U0001d7d6', &['\x38']), ('\U0001d7d7', &['\x39']), ('\U0001d7d8', &['\x30']), ('\U0001d7d9', &['\x31']), ('\U0001d7da', &['\x32']), ('\U0001d7db', &['\x33']), ('\U0001d7dc', &['\x34']), ('\U0001d7dd', &['\x35']), ('\U0001d7de', &['\x36']), ('\U0001d7df', &['\x37']), ('\U0001d7e0', &['\x38']), ('\U0001d7e1', &['\x39']), ('\U0001d7e2', &['\x30']), ('\U0001d7e3', &['\x31']), ('\U0001d7e4', &['\x32']), ('\U0001d7e5', &['\x33']), ('\U0001d7e6', &['\x34']), ('\U0001d7e7', &['\x35']), ('\U0001d7e8', &['\x36']), ('\U0001d7e9', &['\x37']), ('\U0001d7ea', &['\x38']), ('\U0001d7eb', &['\x39']), ('\U0001d7ec', &['\x30']), ('\U0001d7ed', &['\x31']), ('\U0001d7ee', &['\x32']), ('\U0001d7ef', &['\x33']), ('\U0001d7f0', &['\x34']), ('\U0001d7f1', &['\x35']), ('\U0001d7f2', &['\x36']), ('\U0001d7f3', &['\x37']), ('\U0001d7f4', &['\x38']), ('\U0001d7f5', &['\x39']), ('\U0001d7f6', &['\x30']), ('\U0001d7f7', &['\x31']), ('\U0001d7f8', &['\x32']), ('\U0001d7f9', &['\x33']), ('\U0001d7fa', &['\x34']), ('\U0001d7fb', &['\x35']), ('\U0001d7fc', &['\x36']), ('\U0001d7fd', &['\x37']), ('\U0001d7fe', &['\x38']), ('\U0001d7ff', &['\x39']), ('\U0001ee00', &['\u0627']), ('\U0001ee01', &['\u0628']), ('\U0001ee02', &['\u062c']), ('\U0001ee03', &['\u062f']), ('\U0001ee05', &['\u0648']), ('\U0001ee06', &['\u0632']), ('\U0001ee07', &['\u062d']), ('\U0001ee08', &['\u0637']), ('\U0001ee09', &['\u064a']), ('\U0001ee0a', &['\u0643']), ('\U0001ee0b', &['\u0644']), ('\U0001ee0c', &['\u0645']), ('\U0001ee0d', &['\u0646']), ('\U0001ee0e', &['\u0633']), ('\U0001ee0f', &['\u0639']), ('\U0001ee10', &['\u0641']), ('\U0001ee11', &['\u0635']), ('\U0001ee12', &['\u0642']), ('\U0001ee13', &['\u0631']), ('\U0001ee14', &['\u0634']), ('\U0001ee15', &['\u062a']), ('\U0001ee16', &['\u062b']), ('\U0001ee17', &['\u062e']), ('\U0001ee18', &['\u0630']), ('\U0001ee19', &['\u0636']), ('\U0001ee1a', &['\u0638']), ('\U0001ee1b', &['\u063a']), ('\U0001ee1c', &['\u066e']), ('\U0001ee1d', &['\u06ba']), ('\U0001ee1e', &['\u06a1']), ('\U0001ee1f', &['\u066f']), ('\U0001ee21', &['\u0628']), ('\U0001ee22', &['\u062c']), ('\U0001ee24', &['\u0647']), ('\U0001ee27', &['\u062d']), ('\U0001ee29', &['\u064a']), ('\U0001ee2a', &['\u0643']), ('\U0001ee2b', &['\u0644']), ('\U0001ee2c', &['\u0645']), ('\U0001ee2d', &['\u0646']), ('\U0001ee2e', &['\u0633']), ('\U0001ee2f', &['\u0639']), ('\U0001ee30', &['\u0641']), ('\U0001ee31', &['\u0635']), ('\U0001ee32', &['\u0642']), ('\U0001ee34', &['\u0634']), ('\U0001ee35', &['\u062a']), ('\U0001ee36', &['\u062b']), ('\U0001ee37', &['\u062e']), ('\U0001ee39', &['\u0636']), ('\U0001ee3b', &['\u063a']), ('\U0001ee42', &['\u062c']), ('\U0001ee47', &['\u062d']), ('\U0001ee49', &['\u064a']), ('\U0001ee4b', &['\u0644']), ('\U0001ee4d', &['\u0646']), ('\U0001ee4e', &['\u0633']), ('\U0001ee4f', &['\u0639']), ('\U0001ee51', &['\u0635']), ('\U0001ee52', &['\u0642']), ('\U0001ee54', &['\u0634']), ('\U0001ee57', &['\u062e']), ('\U0001ee59', &['\u0636']), ('\U0001ee5b', &['\u063a']), ('\U0001ee5d', &['\u06ba']), ('\U0001ee5f', &['\u066f']), ('\U0001ee61', &['\u0628']), ('\U0001ee62', &['\u062c']), ('\U0001ee64', &['\u0647']), ('\U0001ee67', &['\u062d']), ('\U0001ee68', &['\u0637']), ('\U0001ee69', &['\u064a']), ('\U0001ee6a', &['\u0643']), ('\U0001ee6c', &['\u0645']), ('\U0001ee6d', &['\u0646']), ('\U0001ee6e', &['\u0633']), ('\U0001ee6f', &['\u0639']), ('\U0001ee70', &['\u0641']), ('\U0001ee71', &['\u0635']), ('\U0001ee72', &['\u0642']), ('\U0001ee74', &['\u0634']), ('\U0001ee75', &['\u062a']), ('\U0001ee76', &['\u062b']), ('\U0001ee77', &['\u062e']), ('\U0001ee79', &['\u0636']), ('\U0001ee7a', &['\u0638']), ('\U0001ee7b', &['\u063a']), ('\U0001ee7c', &['\u066e']), ('\U0001ee7e', &['\u06a1']), ('\U0001ee80', &['\u0627']), ('\U0001ee81', &['\u0628']), ('\U0001ee82', &['\u062c']), ('\U0001ee83', &['\u062f']), ('\U0001ee84', &['\u0647']), ('\U0001ee85', &['\u0648']), ('\U0001ee86', &['\u0632']), ('\U0001ee87', &['\u062d']), ('\U0001ee88', &['\u0637']), ('\U0001ee89', &['\u064a']), ('\U0001ee8b', &['\u0644']), ('\U0001ee8c', &['\u0645']), ('\U0001ee8d', &['\u0646']), ('\U0001ee8e', &['\u0633']), ('\U0001ee8f', &['\u0639']), ('\U0001ee90', &['\u0641']), ('\U0001ee91', &['\u0635']), ('\U0001ee92', &['\u0642']), ('\U0001ee93', &['\u0631']), ('\U0001ee94', &['\u0634']), ('\U0001ee95', &['\u062a']), ('\U0001ee96', &['\u062b']), ('\U0001ee97', &['\u062e']), ('\U0001ee98', &['\u0630']), ('\U0001ee99', &['\u0636']), ('\U0001ee9a', &['\u0638']), ('\U0001ee9b', &['\u063a']), ('\U0001eea1', &['\u0628']), ('\U0001eea2', &['\u062c']), ('\U0001eea3', &['\u062f']), ('\U0001eea5', &['\u0648']), ('\U0001eea6', &['\u0632']), ('\U0001eea7', &['\u062d']), ('\U0001eea8', &['\u0637']), ('\U0001eea9', &['\u064a']), ('\U0001eeab', &['\u0644']), ('\U0001eeac', &['\u0645']), ('\U0001eead', &['\u0646']), ('\U0001eeae', &['\u0633']), ('\U0001eeaf', &['\u0639']), ('\U0001eeb0', &['\u0641']), ('\U0001eeb1', &['\u0635']), ('\U0001eeb2', &['\u0642']), ('\U0001eeb3', &['\u0631']), ('\U0001eeb4', &['\u0634']), ('\U0001eeb5', &['\u062a']), ('\U0001eeb6', &['\u062b']), ('\U0001eeb7', &['\u062e']), ('\U0001eeb8', &['\u0630']), ('\U0001eeb9', &['\u0636']), ('\U0001eeba', &['\u0638']), ('\U0001eebb', &['\u063a']), ('\U0001f100', &['\x30', '\x2e']), ('\U0001f101', &['\x30', '\x2c']), ('\U0001f102', &['\x31', '\x2c']), ('\U0001f103', &['\x32', '\x2c']), ('\U0001f104', &['\x33', '\x2c']), ('\U0001f105', &['\x34', '\x2c']), ('\U0001f106', &['\x35', '\x2c']), ('\U0001f107', &['\x36', '\x2c']), ('\U0001f108', &['\x37', '\x2c']), ('\U0001f109', &['\x38', '\x2c']), ('\U0001f10a', &['\x39', '\x2c']), ('\U0001f110', &['\x28', '\x41', '\x29']), ('\U0001f111', &['\x28', '\x42', '\x29']), ('\U0001f112', &['\x28', '\x43', '\x29']), ('\U0001f113', &['\x28', '\x44', '\x29']), ('\U0001f114', &['\x28', '\x45', '\x29']), ('\U0001f115', &['\x28', '\x46', '\x29']), ('\U0001f116', &['\x28', '\x47', '\x29']), ('\U0001f117', &['\x28', '\x48', '\x29']), ('\U0001f118', &['\x28', '\x49', '\x29']), ('\U0001f119', &['\x28', '\x4a', '\x29']), ('\U0001f11a', &['\x28', '\x4b', '\x29']), ('\U0001f11b', &['\x28', '\x4c', '\x29']), ('\U0001f11c', &['\x28', '\x4d', '\x29']), ('\U0001f11d', &['\x28', '\x4e', '\x29']), ('\U0001f11e', &['\x28', '\x4f', '\x29']), ('\U0001f11f', &['\x28', '\x50', '\x29']), ('\U0001f120', &['\x28', '\x51', '\x29']), ('\U0001f121', &['\x28', '\x52', '\x29']), ('\U0001f122', &['\x28', '\x53', '\x29']), ('\U0001f123', &['\x28', '\x54', '\x29']), ('\U0001f124', &['\x28', '\x55', '\x29']), ('\U0001f125', &['\x28', '\x56', '\x29']), ('\U0001f126', &['\x28', '\x57', '\x29']), ('\U0001f127', &['\x28', '\x58', '\x29']), ('\U0001f128', &['\x28', '\x59', '\x29']), ('\U0001f129', &['\x28', '\x5a', '\x29']), ('\U0001f12a', &['\u3014', '\x53', '\u3015']), ('\U0001f12b', &['\x43']), ('\U0001f12c', &['\x52']), ('\U0001f12d', &['\x43', '\x44']), ('\U0001f12e', &['\x57', '\x5a']), ('\U0001f130', &['\x41']), ('\U0001f131', &['\x42']), ('\U0001f132', &['\x43']), ('\U0001f133', &['\x44']), ('\U0001f134', &['\x45']), ('\U0001f135', &['\x46']), ('\U0001f136', &['\x47']), ('\U0001f137', &['\x48']), ('\U0001f138', &['\x49']), ('\U0001f139', &['\x4a']), ('\U0001f13a', &['\x4b']), ('\U0001f13b', &['\x4c']), ('\U0001f13c', &['\x4d']), ('\U0001f13d', &['\x4e']), ('\U0001f13e', &['\x4f']), ('\U0001f13f', &['\x50']), ('\U0001f140', &['\x51']), ('\U0001f141', &['\x52']), ('\U0001f142', &['\x53']), ('\U0001f143', &['\x54']), ('\U0001f144', &['\x55']), ('\U0001f145', &['\x56']), ('\U0001f146', &['\x57']), ('\U0001f147', &['\x58']), ('\U0001f148', &['\x59']), ('\U0001f149', &['\x5a']), ('\U0001f14a', &['\x48', '\x56']), ('\U0001f14b', &['\x4d', '\x56']), ('\U0001f14c', &['\x53', '\x44']), ('\U0001f14d', &['\x53', '\x53']), ('\U0001f14e', &['\x50', '\x50', '\x56']), ('\U0001f14f', &['\x57', '\x43']), ('\U0001f16a', &['\x4d', '\x43']), ('\U0001f16b', &['\x4d', '\x44']), ('\U0001f190', &['\x44', '\x4a']), ('\U0001f200', &['\u307b', '\u304b']), ('\U0001f201', &['\u30b3', '\u30b3']), ('\U0001f202', &['\u30b5']), ('\U0001f210', &['\u624b']), ('\U0001f211', &['\u5b57']), ('\U0001f212', &['\u53cc']), ('\U0001f213', &['\u30c7']), ('\U0001f214', &['\u4e8c']), ('\U0001f215', &['\u591a']), ('\U0001f216', &['\u89e3']), ('\U0001f217', &['\u5929']), ('\U0001f218', &['\u4ea4']), ('\U0001f219', &['\u6620']), ('\U0001f21a', &['\u7121']), ('\U0001f21b', &['\u6599']), ('\U0001f21c', &['\u524d']), ('\U0001f21d', &['\u5f8c']), ('\U0001f21e', &['\u518d']), ('\U0001f21f', &['\u65b0']), ('\U0001f220', &['\u521d']), ('\U0001f221', &['\u7d42']), ('\U0001f222', &['\u751f']), ('\U0001f223', &['\u8ca9']), ('\U0001f224', &['\u58f0']), ('\U0001f225', &['\u5439']), ('\U0001f226', &['\u6f14']), ('\U0001f227', &['\u6295']), ('\U0001f228', &['\u6355']), ('\U0001f229', &['\u4e00']), ('\U0001f22a', &['\u4e09']), ('\U0001f22b', &['\u904a']), ('\U0001f22c', &['\u5de6']), ('\U0001f22d', &['\u4e2d']), ('\U0001f22e', &['\u53f3']), ('\U0001f22f', &['\u6307']), ('\U0001f230', &['\u8d70']), ('\U0001f231', &['\u6253']), ('\U0001f232', &['\u7981']), ('\U0001f233', &['\u7a7a']), ('\U0001f234', &['\u5408']), ('\U0001f235', &['\u6e80']), ('\U0001f236', &['\u6709']), ('\U0001f237', &['\u6708']), ('\U0001f238', &['\u7533']), ('\U0001f239', &['\u5272']), ('\U0001f23a', &['\u55b6']), ('\U0001f240', &['\u3014', '\u672c', '\u3015']), ('\U0001f241', &['\u3014', '\u4e09', '\u3015']), ('\U0001f242', &['\u3014', '\u4e8c', '\u3015']), ('\U0001f243', &['\u3014', '\u5b89', '\u3015']), ('\U0001f244', &['\u3014', '\u70b9', '\u3015']), ('\U0001f245', &['\u3014', '\u6253', '\u3015']), ('\U0001f246', &['\u3014', '\u76d7', '\u3015']), ('\U0001f247', &['\u3014', '\u52dd', '\u3015']), ('\U0001f248', &['\u3014', '\u6557', '\u3015']), ('\U0001f250', &['\u5f97']), ('\U0001f251', &['\u53ef']) ]; // Canonical compositions pub static composition_table: &'static [(char, &'static [(char, char)])] = &[ ('\x3c', &[('\u0338', '\u226e')]), ('\x3d', &[('\u0338', '\u2260')]), ('\x3e', &[('\u0338', '\u226f')]), ('\x41', &[('\u0300', '\u00c0'), ('\u0301', '\u00c1'), ('\u0302', '\u00c2'), ('\u0303', '\u00c3'), ('\u0304', '\u0100'), ('\u0306', '\u0102'), ('\u0307', '\u0226'), ('\u0308', '\u00c4'), ('\u0309', '\u1ea2'), ('\u030a', '\u00c5'), ('\u030c', '\u01cd'), ('\u030f', '\u0200'), ('\u0311', '\u0202'), ('\u0323', '\u1ea0'), ('\u0325', '\u1e00'), ('\u0328', '\u0104')]), ('\x42', &[('\u0307', '\u1e02'), ('\u0323', '\u1e04'), ('\u0331', '\u1e06')]), ('\x43', &[('\u0301', '\u0106'), ('\u0302', '\u0108'), ('\u0307', '\u010a'), ('\u030c', '\u010c'), ('\u0327', '\u00c7')]), ('\x44', &[('\u0307', '\u1e0a'), ('\u030c', '\u010e'), ('\u0323', '\u1e0c'), ('\u0327', '\u1e10'), ('\u032d', '\u1e12'), ('\u0331', '\u1e0e')]), ('\x45', &[('\u0300', '\u00c8'), ('\u0301', '\u00c9'), ('\u0302', '\u00ca'), ('\u0303', '\u1ebc'), ('\u0304', '\u0112'), ('\u0306', '\u0114'), ('\u0307', '\u0116'), ('\u0308', '\u00cb'), ('\u0309', '\u1eba'), ('\u030c', '\u011a'), ('\u030f', '\u0204'), ('\u0311', '\u0206'), ('\u0323', '\u1eb8'), ('\u0327', '\u0228'), ('\u0328', '\u0118'), ('\u032d', '\u1e18'), ('\u0330', '\u1e1a')]), ('\x46', &[('\u0307', '\u1e1e')]), ('\x47', &[('\u0301', '\u01f4'), ('\u0302', '\u011c'), ('\u0304', '\u1e20'), ('\u0306', '\u011e'), ('\u0307', '\u0120'), ('\u030c', '\u01e6'), ('\u0327', '\u0122')]), ('\x48', &[('\u0302', '\u0124'), ('\u0307', '\u1e22'), ('\u0308', '\u1e26'), ('\u030c', '\u021e'), ('\u0323', '\u1e24'), ('\u0327', '\u1e28'), ('\u032e', '\u1e2a')]), ('\x49', &[('\u0300', '\u00cc'), ('\u0301', '\u00cd'), ('\u0302', '\u00ce'), ('\u0303', '\u0128'), ('\u0304', '\u012a'), ('\u0306', '\u012c'), ('\u0307', '\u0130'), ('\u0308', '\u00cf'), ('\u0309', '\u1ec8'), ('\u030c', '\u01cf'), ('\u030f', '\u0208'), ('\u0311', '\u020a'), ('\u0323', '\u1eca'), ('\u0328', '\u012e'), ('\u0330', '\u1e2c')]), ('\x4a', &[('\u0302', '\u0134')]), ('\x4b', &[('\u0301', '\u1e30'), ('\u030c', '\u01e8'), ('\u0323', '\u1e32'), ('\u0327', '\u0136'), ('\u0331', '\u1e34')]), ('\x4c', &[('\u0301', '\u0139'), ('\u030c', '\u013d'), ('\u0323', '\u1e36'), ('\u0327', '\u013b'), ('\u032d', '\u1e3c'), ('\u0331', '\u1e3a')]), ('\x4d', &[('\u0301', '\u1e3e'), ('\u0307', '\u1e40'), ('\u0323', '\u1e42')]), ('\x4e', &[('\u0300', '\u01f8'), ('\u0301', '\u0143'), ('\u0303', '\u00d1'), ('\u0307', '\u1e44'), ('\u030c', '\u0147'), ('\u0323', '\u1e46'), ('\u0327', '\u0145'), ('\u032d', '\u1e4a'), ('\u0331', '\u1e48')]), ('\x4f', &[('\u0300', '\u00d2'), ('\u0301', '\u00d3'), ('\u0302', '\u00d4'), ('\u0303', '\u00d5'), ('\u0304', '\u014c'), ('\u0306', '\u014e'), ('\u0307', '\u022e'), ('\u0308', '\u00d6'), ('\u0309', '\u1ece'), ('\u030b', '\u0150'), ('\u030c', '\u01d1'), ('\u030f', '\u020c'), ('\u0311', '\u020e'), ('\u031b', '\u01a0'), ('\u0323', '\u1ecc'), ('\u0328', '\u01ea')]), ('\x50', &[('\u0301', '\u1e54'), ('\u0307', '\u1e56')]), ('\x52', &[('\u0301', '\u0154'), ('\u0307', '\u1e58'), ('\u030c', '\u0158'), ('\u030f', '\u0210'), ('\u0311', '\u0212'), ('\u0323', '\u1e5a'), ('\u0327', '\u0156'), ('\u0331', '\u1e5e')]), ('\x53', &[('\u0301', '\u015a'), ('\u0302', '\u015c'), ('\u0307', '\u1e60'), ('\u030c', '\u0160'), ('\u0323', '\u1e62'), ('\u0326', '\u0218'), ('\u0327', '\u015e')]), ('\x54', &[('\u0307', '\u1e6a'), ('\u030c', '\u0164'), ('\u0323', '\u1e6c'), ('\u0326', '\u021a'), ('\u0327', '\u0162'), ('\u032d', '\u1e70'), ('\u0331', '\u1e6e')]), ('\x55', &[('\u0300', '\u00d9'), ('\u0301', '\u00da'), ('\u0302', '\u00db'), ('\u0303', '\u0168'), ('\u0304', '\u016a'), ('\u0306', '\u016c'), ('\u0308', '\u00dc'), ('\u0309', '\u1ee6'), ('\u030a', '\u016e'), ('\u030b', '\u0170'), ('\u030c', '\u01d3'), ('\u030f', '\u0214'), ('\u0311', '\u0216'), ('\u031b', '\u01af'), ('\u0323', '\u1ee4'), ('\u0324', '\u1e72'), ('\u0328', '\u0172'), ('\u032d', '\u1e76'), ('\u0330', '\u1e74')]), ('\x56', &[('\u0303', '\u1e7c'), ('\u0323', '\u1e7e')]), ('\x57', &[('\u0300', '\u1e80'), ('\u0301', '\u1e82'), ('\u0302', '\u0174'), ('\u0307', '\u1e86'), ('\u0308', '\u1e84'), ('\u0323', '\u1e88')]), ('\x58', &[('\u0307', '\u1e8a'), ('\u0308', '\u1e8c')]), ('\x59', &[('\u0300', '\u1ef2'), ('\u0301', '\u00dd'), ('\u0302', '\u0176'), ('\u0303', '\u1ef8'), ('\u0304', '\u0232'), ('\u0307', '\u1e8e'), ('\u0308', '\u0178'), ('\u0309', '\u1ef6'), ('\u0323', '\u1ef4')]), ('\x5a', &[('\u0301', '\u0179'), ('\u0302', '\u1e90'), ('\u0307', '\u017b'), ('\u030c', '\u017d'), ('\u0323', '\u1e92'), ('\u0331', '\u1e94')]), ('\x61', &[('\u0300', '\u00e0'), ('\u0301', '\u00e1'), ('\u0302', '\u00e2'), ('\u0303', '\u00e3'), ('\u0304', '\u0101'), ('\u0306', '\u0103'), ('\u0307', '\u0227'), ('\u0308', '\u00e4'), ('\u0309', '\u1ea3'), ('\u030a', '\u00e5'), ('\u030c', '\u01ce'), ('\u030f', '\u0201'), ('\u0311', '\u0203'), ('\u0323', '\u1ea1'), ('\u0325', '\u1e01'), ('\u0328', '\u0105')]), ('\x62', &[('\u0307', '\u1e03'), ('\u0323', '\u1e05'), ('\u0331', '\u1e07')]), ('\x63', &[('\u0301', '\u0107'), ('\u0302', '\u0109'), ('\u0307', '\u010b'), ('\u030c', '\u010d'), ('\u0327', '\u00e7')]), ('\x64', &[('\u0307', '\u1e0b'), ('\u030c', '\u010f'), ('\u0323', '\u1e0d'), ('\u0327', '\u1e11'), ('\u032d', '\u1e13'), ('\u0331', '\u1e0f')]), ('\x65', &[('\u0300', '\u00e8'), ('\u0301', '\u00e9'), ('\u0302', '\u00ea'), ('\u0303', '\u1ebd'), ('\u0304', '\u0113'), ('\u0306', '\u0115'), ('\u0307', '\u0117'), ('\u0308', '\u00eb'), ('\u0309', '\u1ebb'), ('\u030c', '\u011b'), ('\u030f', '\u0205'), ('\u0311', '\u0207'), ('\u0323', '\u1eb9'), ('\u0327', '\u0229'), ('\u0328', '\u0119'), ('\u032d', '\u1e19'), ('\u0330', '\u1e1b')]), ('\x66', &[('\u0307', '\u1e1f')]), ('\x67', &[('\u0301', '\u01f5'), ('\u0302', '\u011d'), ('\u0304', '\u1e21'), ('\u0306', '\u011f'), ('\u0307', '\u0121'), ('\u030c', '\u01e7'), ('\u0327', '\u0123')]), ('\x68', &[('\u0302', '\u0125'), ('\u0307', '\u1e23'), ('\u0308', '\u1e27'), ('\u030c', '\u021f'), ('\u0323', '\u1e25'), ('\u0327', '\u1e29'), ('\u032e', '\u1e2b'), ('\u0331', '\u1e96')]), ('\x69', &[('\u0300', '\u00ec'), ('\u0301', '\u00ed'), ('\u0302', '\u00ee'), ('\u0303', '\u0129'), ('\u0304', '\u012b'), ('\u0306', '\u012d'), ('\u0308', '\u00ef'), ('\u0309', '\u1ec9'), ('\u030c', '\u01d0'), ('\u030f', '\u0209'), ('\u0311', '\u020b'), ('\u0323', '\u1ecb'), ('\u0328', '\u012f'), ('\u0330', '\u1e2d')]), ('\x6a', &[('\u0302', '\u0135'), ('\u030c', '\u01f0')]), ('\x6b', &[('\u0301', '\u1e31'), ('\u030c', '\u01e9'), ('\u0323', '\u1e33'), ('\u0327', '\u0137'), ('\u0331', '\u1e35')]), ('\x6c', &[('\u0301', '\u013a'), ('\u030c', '\u013e'), ('\u0323', '\u1e37'), ('\u0327', '\u013c'), ('\u032d', '\u1e3d'), ('\u0331', '\u1e3b')]), ('\x6d', &[('\u0301', '\u1e3f'), ('\u0307', '\u1e41'), ('\u0323', '\u1e43')]), ('\x6e', &[('\u0300', '\u01f9'), ('\u0301', '\u0144'), ('\u0303', '\u00f1'), ('\u0307', '\u1e45'), ('\u030c', '\u0148'), ('\u0323', '\u1e47'), ('\u0327', '\u0146'), ('\u032d', '\u1e4b'), ('\u0331', '\u1e49')]), ('\x6f', &[('\u0300', '\u00f2'), ('\u0301', '\u00f3'), ('\u0302', '\u00f4'), ('\u0303', '\u00f5'), ('\u0304', '\u014d'), ('\u0306', '\u014f'), ('\u0307', '\u022f'), ('\u0308', '\u00f6'), ('\u0309', '\u1ecf'), ('\u030b', '\u0151'), ('\u030c', '\u01d2'), ('\u030f', '\u020d'), ('\u0311', '\u020f'), ('\u031b', '\u01a1'), ('\u0323', '\u1ecd'), ('\u0328', '\u01eb')]), ('\x70', &[('\u0301', '\u1e55'), ('\u0307', '\u1e57')]), ('\x72', &[('\u0301', '\u0155'), ('\u0307', '\u1e59'), ('\u030c', '\u0159'), ('\u030f', '\u0211'), ('\u0311', '\u0213'), ('\u0323', '\u1e5b'), ('\u0327', '\u0157'), ('\u0331', '\u1e5f')]), ('\x73', &[('\u0301', '\u015b'), ('\u0302', '\u015d'), ('\u0307', '\u1e61'), ('\u030c', '\u0161'), ('\u0323', '\u1e63'), ('\u0326', '\u0219'), ('\u0327', '\u015f')]), ('\x74', &[('\u0307', '\u1e6b'), ('\u0308', '\u1e97'), ('\u030c', '\u0165'), ('\u0323', '\u1e6d'), ('\u0326', '\u021b'), ('\u0327', '\u0163'), ('\u032d', '\u1e71'), ('\u0331', '\u1e6f')]), ('\x75', &[('\u0300', '\u00f9'), ('\u0301', '\u00fa'), ('\u0302', '\u00fb'), ('\u0303', '\u0169'), ('\u0304', '\u016b'), ('\u0306', '\u016d'), ('\u0308', '\u00fc'), ('\u0309', '\u1ee7'), ('\u030a', '\u016f'), ('\u030b', '\u0171'), ('\u030c', '\u01d4'), ('\u030f', '\u0215'), ('\u0311', '\u0217'), ('\u031b', '\u01b0'), ('\u0323', '\u1ee5'), ('\u0324', '\u1e73'), ('\u0328', '\u0173'), ('\u032d', '\u1e77'), ('\u0330', '\u1e75')]), ('\x76', &[('\u0303', '\u1e7d'), ('\u0323', '\u1e7f')]), ('\x77', &[('\u0300', '\u1e81'), ('\u0301', '\u1e83'), ('\u0302', '\u0175'), ('\u0307', '\u1e87'), ('\u0308', '\u1e85'), ('\u030a', '\u1e98'), ('\u0323', '\u1e89')]), ('\x78', &[('\u0307', '\u1e8b'), ('\u0308', '\u1e8d')]), ('\x79', &[('\u0300', '\u1ef3'), ('\u0301', '\u00fd'), ('\u0302', '\u0177'), ('\u0303', '\u1ef9'), ('\u0304', '\u0233'), ('\u0307', '\u1e8f'), ('\u0308', '\u00ff'), ('\u0309', '\u1ef7'), ('\u030a', '\u1e99'), ('\u0323', '\u1ef5')]), ('\x7a', &[('\u0301', '\u017a'), ('\u0302', '\u1e91'), ('\u0307', '\u017c'), ('\u030c', '\u017e'), ('\u0323', '\u1e93'), ('\u0331', '\u1e95')]), ('\u00a8', &[('\u0300', '\u1fed'), ('\u0301', '\u0385'), ('\u0342', '\u1fc1')]), ('\u00c2', &[('\u0300', '\u1ea6'), ('\u0301', '\u1ea4'), ('\u0303', '\u1eaa'), ('\u0309', '\u1ea8')]), ('\u00c4', &[('\u0304', '\u01de')]), ('\u00c5', &[('\u0301', '\u01fa')]), ('\u00c6', &[('\u0301', '\u01fc'), ('\u0304', '\u01e2')]), ('\u00c7', &[('\u0301', '\u1e08')]), ('\u00ca', &[('\u0300', '\u1ec0'), ('\u0301', '\u1ebe'), ('\u0303', '\u1ec4'), ('\u0309', '\u1ec2')]), ('\u00cf', &[('\u0301', '\u1e2e')]), ('\u00d4', &[('\u0300', '\u1ed2'), ('\u0301', '\u1ed0'), ('\u0303', '\u1ed6'), ('\u0309', '\u1ed4')]), ('\u00d5', &[('\u0301', '\u1e4c'), ('\u0304', '\u022c'), ('\u0308', '\u1e4e')]), ('\u00d6', &[('\u0304', '\u022a')]), ('\u00d8', &[('\u0301', '\u01fe')]), ('\u00dc', &[('\u0300', '\u01db'), ('\u0301', '\u01d7'), ('\u0304', '\u01d5'), ('\u030c', '\u01d9')]), ('\u00e2', &[('\u0300', '\u1ea7'), ('\u0301', '\u1ea5'), ('\u0303', '\u1eab'), ('\u0309', '\u1ea9')]), ('\u00e4', &[('\u0304', '\u01df')]), ('\u00e5', &[('\u0301', '\u01fb')]), ('\u00e6', &[('\u0301', '\u01fd'), ('\u0304', '\u01e3')]), ('\u00e7', &[('\u0301', '\u1e09')]), ('\u00ea', &[('\u0300', '\u1ec1'), ('\u0301', '\u1ebf'), ('\u0303', '\u1ec5'), ('\u0309', '\u1ec3')]), ('\u00ef', &[('\u0301', '\u1e2f')]), ('\u00f4', &[('\u0300', '\u1ed3'), ('\u0301', '\u1ed1'), ('\u0303', '\u1ed7'), ('\u0309', '\u1ed5')]), ('\u00f5', &[('\u0301', '\u1e4d'), ('\u0304', '\u022d'), ('\u0308', '\u1e4f')]), ('\u00f6', &[('\u0304', '\u022b')]), ('\u00f8', &[('\u0301', '\u01ff')]), ('\u00fc', &[('\u0300', '\u01dc'), ('\u0301', '\u01d8'), ('\u0304', '\u01d6'), ('\u030c', '\u01da')]), ('\u0102', &[('\u0300', '\u1eb0'), ('\u0301', '\u1eae'), ('\u0303', '\u1eb4'), ('\u0309', '\u1eb2')]), ('\u0103', &[('\u0300', '\u1eb1'), ('\u0301', '\u1eaf'), ('\u0303', '\u1eb5'), ('\u0309', '\u1eb3')]), ('\u0112', &[('\u0300', '\u1e14'), ('\u0301', '\u1e16')]), ('\u0113', &[('\u0300', '\u1e15'), ('\u0301', '\u1e17')]), ('\u014c', &[('\u0300', '\u1e50'), ('\u0301', '\u1e52')]), ('\u014d', &[('\u0300', '\u1e51'), ('\u0301', '\u1e53')]), ('\u015a', &[('\u0307', '\u1e64')]), ('\u015b', &[('\u0307', '\u1e65')]), ('\u0160', &[('\u0307', '\u1e66')]), ('\u0161', &[('\u0307', '\u1e67')]), ('\u0168', &[('\u0301', '\u1e78')]), ('\u0169', &[('\u0301', '\u1e79')]), ('\u016a', &[('\u0308', '\u1e7a')]), ('\u016b', &[('\u0308', '\u1e7b')]), ('\u017f', &[('\u0307', '\u1e9b')]), ('\u01a0', &[('\u0300', '\u1edc'), ('\u0301', '\u1eda'), ('\u0303', '\u1ee0'), ('\u0309', '\u1ede'), ('\u0323', '\u1ee2')]), ('\u01a1', &[('\u0300', '\u1edd'), ('\u0301', '\u1edb'), ('\u0303', '\u1ee1'), ('\u0309', '\u1edf'), ('\u0323', '\u1ee3')]), ('\u01af', &[('\u0300', '\u1eea'), ('\u0301', '\u1ee8'), ('\u0303', '\u1eee'), ('\u0309', '\u1eec'), ('\u0323', '\u1ef0')]), ('\u01b0', &[('\u0300', '\u1eeb'), ('\u0301', '\u1ee9'), ('\u0303', '\u1eef'), ('\u0309', '\u1eed'), ('\u0323', '\u1ef1')]), ('\u01b7', &[('\u030c', '\u01ee')]), ('\u01ea', &[('\u0304', '\u01ec')]), ('\u01eb', &[('\u0304', '\u01ed')]), ('\u0226', &[('\u0304', '\u01e0')]), ('\u0227', &[('\u0304', '\u01e1')]), ('\u0228', &[('\u0306', '\u1e1c')]), ('\u0229', &[('\u0306', '\u1e1d')]), ('\u022e', &[('\u0304', '\u0230')]), ('\u022f', &[('\u0304', '\u0231')]), ('\u0292', &[('\u030c', '\u01ef')]), ('\u0391', &[('\u0300', '\u1fba'), ('\u0301', '\u0386'), ('\u0304', '\u1fb9'), ('\u0306', '\u1fb8'), ('\u0313', '\u1f08'), ('\u0314', '\u1f09'), ('\u0345', '\u1fbc')]), ('\u0395', &[('\u0300', '\u1fc8'), ('\u0301', '\u0388'), ('\u0313', '\u1f18'), ('\u0314', '\u1f19')]), ('\u0397', &[('\u0300', '\u1fca'), ('\u0301', '\u0389'), ('\u0313', '\u1f28'), ('\u0314', '\u1f29'), ('\u0345', '\u1fcc')]), ('\u0399', &[('\u0300', '\u1fda'), ('\u0301', '\u038a'), ('\u0304', '\u1fd9'), ('\u0306', '\u1fd8'), ('\u0308', '\u03aa'), ('\u0313', '\u1f38'), ('\u0314', '\u1f39')]), ('\u039f', &[('\u0300', '\u1ff8'), ('\u0301', '\u038c'), ('\u0313', '\u1f48'), ('\u0314', '\u1f49')]), ('\u03a1', &[('\u0314', '\u1fec')]), ('\u03a5', &[('\u0300', '\u1fea'), ('\u0301', '\u038e'), ('\u0304', '\u1fe9'), ('\u0306', '\u1fe8'), ('\u0308', '\u03ab'), ('\u0314', '\u1f59')]), ('\u03a9', &[('\u0300', '\u1ffa'), ('\u0301', '\u038f'), ('\u0313', '\u1f68'), ('\u0314', '\u1f69'), ('\u0345', '\u1ffc')]), ('\u03ac', &[('\u0345', '\u1fb4')]), ('\u03ae', &[('\u0345', '\u1fc4')]), ('\u03b1', &[('\u0300', '\u1f70'), ('\u0301', '\u03ac'), ('\u0304', '\u1fb1'), ('\u0306', '\u1fb0'), ('\u0313', '\u1f00'), ('\u0314', '\u1f01'), ('\u0342', '\u1fb6'), ('\u0345', '\u1fb3')]), ('\u03b5', &[('\u0300', '\u1f72'), ('\u0301', '\u03ad'), ('\u0313', '\u1f10'), ('\u0314', '\u1f11')]), ('\u03b7', &[('\u0300', '\u1f74'), ('\u0301', '\u03ae'), ('\u0313', '\u1f20'), ('\u0314', '\u1f21'), ('\u0342', '\u1fc6'), ('\u0345', '\u1fc3')]), ('\u03b9', &[('\u0300', '\u1f76'), ('\u0301', '\u03af'), ('\u0304', '\u1fd1'), ('\u0306', '\u1fd0'), ('\u0308', '\u03ca'), ('\u0313', '\u1f30'), ('\u0314', '\u1f31'), ('\u0342', '\u1fd6')]), ('\u03bf', &[('\u0300', '\u1f78'), ('\u0301', '\u03cc'), ('\u0313', '\u1f40'), ('\u0314', '\u1f41')]), ('\u03c1', &[('\u0313', '\u1fe4'), ('\u0314', '\u1fe5')]), ('\u03c5', &[('\u0300', '\u1f7a'), ('\u0301', '\u03cd'), ('\u0304', '\u1fe1'), ('\u0306', '\u1fe0'), ('\u0308', '\u03cb'), ('\u0313', '\u1f50'), ('\u0314', '\u1f51'), ('\u0342', '\u1fe6')]), ('\u03c9', &[('\u0300', '\u1f7c'), ('\u0301', '\u03ce'), ('\u0313', '\u1f60'), ('\u0314', '\u1f61'), ('\u0342', '\u1ff6'), ('\u0345', '\u1ff3')]), ('\u03ca', &[('\u0300', '\u1fd2'), ('\u0301', '\u0390'), ('\u0342', '\u1fd7')]), ('\u03cb', &[('\u0300', '\u1fe2'), ('\u0301', '\u03b0'), ('\u0342', '\u1fe7')]), ('\u03ce', &[('\u0345', '\u1ff4')]), ('\u03d2', &[('\u0301', '\u03d3'), ('\u0308', '\u03d4')]), ('\u0406', &[('\u0308', '\u0407')]), ('\u0410', &[('\u0306', '\u04d0'), ('\u0308', '\u04d2')]), ('\u0413', &[('\u0301', '\u0403')]), ('\u0415', &[('\u0300', '\u0400'), ('\u0306', '\u04d6'), ('\u0308', '\u0401')]), ('\u0416', &[('\u0306', '\u04c1'), ('\u0308', '\u04dc')]), ('\u0417', &[('\u0308', '\u04de')]), ('\u0418', &[('\u0300', '\u040d'), ('\u0304', '\u04e2'), ('\u0306', '\u0419'), ('\u0308', '\u04e4')]), ('\u041a', &[('\u0301', '\u040c')]), ('\u041e', &[('\u0308', '\u04e6')]), ('\u0423', &[('\u0304', '\u04ee'), ('\u0306', '\u040e'), ('\u0308', '\u04f0'), ('\u030b', '\u04f2')]), ('\u0427', &[('\u0308', '\u04f4')]), ('\u042b', &[('\u0308', '\u04f8')]), ('\u042d', &[('\u0308', '\u04ec')]), ('\u0430', &[('\u0306', '\u04d1'), ('\u0308', '\u04d3')]), ('\u0433', &[('\u0301', '\u0453')]), ('\u0435', &[('\u0300', '\u0450'), ('\u0306', '\u04d7'), ('\u0308', '\u0451')]), ('\u0436', &[('\u0306', '\u04c2'), ('\u0308', '\u04dd')]), ('\u0437', &[('\u0308', '\u04df')]), ('\u0438', &[('\u0300', '\u045d'), ('\u0304', '\u04e3'), ('\u0306', '\u0439'), ('\u0308', '\u04e5')]), ('\u043a', &[('\u0301', '\u045c')]), ('\u043e', &[('\u0308', '\u04e7')]), ('\u0443', &[('\u0304', '\u04ef'), ('\u0306', '\u045e'), ('\u0308', '\u04f1'), ('\u030b', '\u04f3')]), ('\u0447', &[('\u0308', '\u04f5')]), ('\u044b', &[('\u0308', '\u04f9')]), ('\u044d', &[('\u0308', '\u04ed')]), ('\u0456', &[('\u0308', '\u0457')]), ('\u0474', &[('\u030f', '\u0476')]), ('\u0475', &[('\u030f', '\u0477')]), ('\u04d8', &[('\u0308', '\u04da')]), ('\u04d9', &[('\u0308', '\u04db')]), ('\u04e8', &[('\u0308', '\u04ea')]), ('\u04e9', &[('\u0308', '\u04eb')]), ('\u0627', &[('\u0653', '\u0622'), ('\u0654', '\u0623'), ('\u0655', '\u0625')]), ('\u0648', &[('\u0654', '\u0624')]), ('\u064a', &[('\u0654', '\u0626')]), ('\u06c1', &[('\u0654', '\u06c2')]), ('\u06d2', &[('\u0654', '\u06d3')]), ('\u06d5', &[('\u0654', '\u06c0')]), ('\u0928', &[('\u093c', '\u0929')]), ('\u0930', &[('\u093c', '\u0931')]), ('\u0933', &[('\u093c', '\u0934')]), ('\u09c7', &[('\u09be', '\u09cb'), ('\u09d7', '\u09cc')]), ('\u0b47', &[('\u0b3e', '\u0b4b'), ('\u0b56', '\u0b48'), ('\u0b57', '\u0b4c')]), ('\u0b92', &[('\u0bd7', '\u0b94')]), ('\u0bc6', &[('\u0bbe', '\u0bca'), ('\u0bd7', '\u0bcc')]), ('\u0bc7', &[('\u0bbe', '\u0bcb')]), ('\u0c46', &[('\u0c56', '\u0c48')]), ('\u0cbf', &[('\u0cd5', '\u0cc0')]), ('\u0cc6', &[('\u0cc2', '\u0cca'), ('\u0cd5', '\u0cc7'), ('\u0cd6', '\u0cc8')]), ('\u0cca', &[('\u0cd5', '\u0ccb')]), ('\u0d46', &[('\u0d3e', '\u0d4a'), ('\u0d57', '\u0d4c')]), ('\u0d47', &[('\u0d3e', '\u0d4b')]), ('\u0dd9', &[('\u0dca', '\u0dda'), ('\u0dcf', '\u0ddc'), ('\u0ddf', '\u0dde')]), ('\u0ddc', &[('\u0dca', '\u0ddd')]), ('\u1025', &[('\u102e', '\u1026')]), ('\u1b05', &[('\u1b35', '\u1b06')]), ('\u1b07', &[('\u1b35', '\u1b08')]), ('\u1b09', &[('\u1b35', '\u1b0a')]), ('\u1b0b', &[('\u1b35', '\u1b0c')]), ('\u1b0d', &[('\u1b35', '\u1b0e')]), ('\u1b11', &[('\u1b35', '\u1b12')]), ('\u1b3a', &[('\u1b35', '\u1b3b')]), ('\u1b3c', &[('\u1b35', '\u1b3d')]), ('\u1b3e', &[('\u1b35', '\u1b40')]), ('\u1b3f', &[('\u1b35', '\u1b41')]), ('\u1b42', &[('\u1b35', '\u1b43')]), ('\u1e36', &[('\u0304', '\u1e38')]), ('\u1e37', &[('\u0304', '\u1e39')]), ('\u1e5a', &[('\u0304', '\u1e5c')]), ('\u1e5b', &[('\u0304', '\u1e5d')]), ('\u1e62', &[('\u0307', '\u1e68')]), ('\u1e63', &[('\u0307', '\u1e69')]), ('\u1ea0', &[('\u0302', '\u1eac'), ('\u0306', '\u1eb6')]), ('\u1ea1', &[('\u0302', '\u1ead'), ('\u0306', '\u1eb7')]), ('\u1eb8', &[('\u0302', '\u1ec6')]), ('\u1eb9', &[('\u0302', '\u1ec7')]), ('\u1ecc', &[('\u0302', '\u1ed8')]), ('\u1ecd', &[('\u0302', '\u1ed9')]), ('\u1f00', &[('\u0300', '\u1f02'), ('\u0301', '\u1f04'), ('\u0342', '\u1f06'), ('\u0345', '\u1f80')]), ('\u1f01', &[('\u0300', '\u1f03'), ('\u0301', '\u1f05'), ('\u0342', '\u1f07'), ('\u0345', '\u1f81')]), ('\u1f02', &[('\u0345', '\u1f82')]), ('\u1f03', &[('\u0345', '\u1f83')]), ('\u1f04', &[('\u0345', '\u1f84')]), ('\u1f05', &[('\u0345', '\u1f85')]), ('\u1f06', &[('\u0345', '\u1f86')]), ('\u1f07', &[('\u0345', '\u1f87')]), ('\u1f08', &[('\u0300', '\u1f0a'), ('\u0301', '\u1f0c'), ('\u0342', '\u1f0e'), ('\u0345', '\u1f88')]), ('\u1f09', &[('\u0300', '\u1f0b'), ('\u0301', '\u1f0d'), ('\u0342', '\u1f0f'), ('\u0345', '\u1f89')]), ('\u1f0a', &[('\u0345', '\u1f8a')]), ('\u1f0b', &[('\u0345', '\u1f8b')]), ('\u1f0c', &[('\u0345', '\u1f8c')]), ('\u1f0d', &[('\u0345', '\u1f8d')]), ('\u1f0e', &[('\u0345', '\u1f8e')]), ('\u1f0f', &[('\u0345', '\u1f8f')]), ('\u1f10', &[('\u0300', '\u1f12'), ('\u0301', '\u1f14')]), ('\u1f11', &[('\u0300', '\u1f13'), ('\u0301', '\u1f15')]), ('\u1f18', &[('\u0300', '\u1f1a'), ('\u0301', '\u1f1c')]), ('\u1f19', &[('\u0300', '\u1f1b'), ('\u0301', '\u1f1d')]), ('\u1f20', &[('\u0300', '\u1f22'), ('\u0301', '\u1f24'), ('\u0342', '\u1f26'), ('\u0345', '\u1f90')]), ('\u1f21', &[('\u0300', '\u1f23'), ('\u0301', '\u1f25'), ('\u0342', '\u1f27'), ('\u0345', '\u1f91')]), ('\u1f22', &[('\u0345', '\u1f92')]), ('\u1f23', &[('\u0345', '\u1f93')]), ('\u1f24', &[('\u0345', '\u1f94')]), ('\u1f25', &[('\u0345', '\u1f95')]), ('\u1f26', &[('\u0345', '\u1f96')]), ('\u1f27', &[('\u0345', '\u1f97')]), ('\u1f28', &[('\u0300', '\u1f2a'), ('\u0301', '\u1f2c'), ('\u0342', '\u1f2e'), ('\u0345', '\u1f98')]), ('\u1f29', &[('\u0300', '\u1f2b'), ('\u0301', '\u1f2d'), ('\u0342', '\u1f2f'), ('\u0345', '\u1f99')]), ('\u1f2a', &[('\u0345', '\u1f9a')]), ('\u1f2b', &[('\u0345', '\u1f9b')]), ('\u1f2c', &[('\u0345', '\u1f9c')]), ('\u1f2d', &[('\u0345', '\u1f9d')]), ('\u1f2e', &[('\u0345', '\u1f9e')]), ('\u1f2f', &[('\u0345', '\u1f9f')]), ('\u1f30', &[('\u0300', '\u1f32'), ('\u0301', '\u1f34'), ('\u0342', '\u1f36')]), ('\u1f31', &[('\u0300', '\u1f33'), ('\u0301', '\u1f35'), ('\u0342', '\u1f37')]), ('\u1f38', &[('\u0300', '\u1f3a'), ('\u0301', '\u1f3c'), ('\u0342', '\u1f3e')]), ('\u1f39', &[('\u0300', '\u1f3b'), ('\u0301', '\u1f3d'), ('\u0342', '\u1f3f')]), ('\u1f40', &[('\u0300', '\u1f42'), ('\u0301', '\u1f44')]), ('\u1f41', &[('\u0300', '\u1f43'), ('\u0301', '\u1f45')]), ('\u1f48', &[('\u0300', '\u1f4a'), ('\u0301', '\u1f4c')]), ('\u1f49', &[('\u0300', '\u1f4b'), ('\u0301', '\u1f4d')]), ('\u1f50', &[('\u0300', '\u1f52'), ('\u0301', '\u1f54'), ('\u0342', '\u1f56')]), ('\u1f51', &[('\u0300', '\u1f53'), ('\u0301', '\u1f55'), ('\u0342', '\u1f57')]), ('\u1f59', &[('\u0300', '\u1f5b'), ('\u0301', '\u1f5d'), ('\u0342', '\u1f5f')]), ('\u1f60', &[('\u0300', '\u1f62'), ('\u0301', '\u1f64'), ('\u0342', '\u1f66'), ('\u0345', '\u1fa0')]), ('\u1f61', &[('\u0300', '\u1f63'), ('\u0301', '\u1f65'), ('\u0342', '\u1f67'), ('\u0345', '\u1fa1')]), ('\u1f62', &[('\u0345', '\u1fa2')]), ('\u1f63', &[('\u0345', '\u1fa3')]), ('\u1f64', &[('\u0345', '\u1fa4')]), ('\u1f65', &[('\u0345', '\u1fa5')]), ('\u1f66', &[('\u0345', '\u1fa6')]), ('\u1f67', &[('\u0345', '\u1fa7')]), ('\u1f68', &[('\u0300', '\u1f6a'), ('\u0301', '\u1f6c'), ('\u0342', '\u1f6e'), ('\u0345', '\u1fa8')]), ('\u1f69', &[('\u0300', '\u1f6b'), ('\u0301', '\u1f6d'), ('\u0342', '\u1f6f'), ('\u0345', '\u1fa9')]), ('\u1f6a', &[('\u0345', '\u1faa')]), ('\u1f6b', &[('\u0345', '\u1fab')]), ('\u1f6c', &[('\u0345', '\u1fac')]), ('\u1f6d', &[('\u0345', '\u1fad')]), ('\u1f6e', &[('\u0345', '\u1fae')]), ('\u1f6f', &[('\u0345', '\u1faf')]), ('\u1f70', &[('\u0345', '\u1fb2')]), ('\u1f74', &[('\u0345', '\u1fc2')]), ('\u1f7c', &[('\u0345', '\u1ff2')]), ('\u1fb6', &[('\u0345', '\u1fb7')]), ('\u1fbf', &[('\u0300', '\u1fcd'), ('\u0301', '\u1fce'), ('\u0342', '\u1fcf')]), ('\u1fc6', &[('\u0345', '\u1fc7')]), ('\u1ff6', &[('\u0345', '\u1ff7')]), ('\u1ffe', &[('\u0300', '\u1fdd'), ('\u0301', '\u1fde'), ('\u0342', '\u1fdf')]), ('\u2190', &[('\u0338', '\u219a')]), ('\u2192', &[('\u0338', '\u219b')]), ('\u2194', &[('\u0338', '\u21ae')]), ('\u21d0', &[('\u0338', '\u21cd')]), ('\u21d2', &[('\u0338', '\u21cf')]), ('\u21d4', &[('\u0338', '\u21ce')]), ('\u2203', &[('\u0338', '\u2204')]), ('\u2208', &[('\u0338', '\u2209')]), ('\u220b', &[('\u0338', '\u220c')]), ('\u2223', &[('\u0338', '\u2224')]), ('\u2225', &[('\u0338', '\u2226')]), ('\u223c', &[('\u0338', '\u2241')]), ('\u2243', &[('\u0338', '\u2244')]), ('\u2245', &[('\u0338', '\u2247')]), ('\u2248', &[('\u0338', '\u2249')]), ('\u224d', &[('\u0338', '\u226d')]), ('\u2261', &[('\u0338', '\u2262')]), ('\u2264', &[('\u0338', '\u2270')]), ('\u2265', &[('\u0338', '\u2271')]), ('\u2272', &[('\u0338', '\u2274')]), ('\u2273', &[('\u0338', '\u2275')]), ('\u2276', &[('\u0338', '\u2278')]), ('\u2277', &[('\u0338', '\u2279')]), ('\u227a', &[('\u0338', '\u2280')]), ('\u227b', &[('\u0338', '\u2281')]), ('\u227c', &[('\u0338', '\u22e0')]), ('\u227d', &[('\u0338', '\u22e1')]), ('\u2282', &[('\u0338', '\u2284')]), ('\u2283', &[('\u0338', '\u2285')]), ('\u2286', &[('\u0338', '\u2288')]), ('\u2287', &[('\u0338', '\u2289')]), ('\u2291', &[('\u0338', '\u22e2')]), ('\u2292', &[('\u0338', '\u22e3')]), ('\u22a2', &[('\u0338', '\u22ac')]), ('\u22a8', &[('\u0338', '\u22ad')]), ('\u22a9', &[('\u0338', '\u22ae')]), ('\u22ab', &[('\u0338', '\u22af')]), ('\u22b2', &[('\u0338', '\u22ea')]), ('\u22b3', &[('\u0338', '\u22eb')]), ('\u22b4', &[('\u0338', '\u22ec')]), ('\u22b5', &[('\u0338', '\u22ed')]), ('\u3046', &[('\u3099', '\u3094')]), ('\u304b', &[('\u3099', '\u304c')]), ('\u304d', &[('\u3099', '\u304e')]), ('\u304f', &[('\u3099', '\u3050')]), ('\u3051', &[('\u3099', '\u3052')]), ('\u3053', &[('\u3099', '\u3054')]), ('\u3055', &[('\u3099', '\u3056')]), ('\u3057', &[('\u3099', '\u3058')]), ('\u3059', &[('\u3099', '\u305a')]), ('\u305b', &[('\u3099', '\u305c')]), ('\u305d', &[('\u3099', '\u305e')]), ('\u305f', &[('\u3099', '\u3060')]), ('\u3061', &[('\u3099', '\u3062')]), ('\u3064', &[('\u3099', '\u3065')]), ('\u3066', &[('\u3099', '\u3067')]), ('\u3068', &[('\u3099', '\u3069')]), ('\u306f', &[('\u3099', '\u3070'), ('\u309a', '\u3071')]), ('\u3072', &[('\u3099', '\u3073'), ('\u309a', '\u3074')]), ('\u3075', &[('\u3099', '\u3076'), ('\u309a', '\u3077')]), ('\u3078', &[('\u3099', '\u3079'), ('\u309a', '\u307a')]), ('\u307b', &[('\u3099', '\u307c'), ('\u309a', '\u307d')]), ('\u309d', &[('\u3099', '\u309e')]), ('\u30a6', &[('\u3099', '\u30f4')]), ('\u30ab', &[('\u3099', '\u30ac')]), ('\u30ad', &[('\u3099', '\u30ae')]), ('\u30af', &[('\u3099', '\u30b0')]), ('\u30b1', &[('\u3099', '\u30b2')]), ('\u30b3', &[('\u3099', '\u30b4')]), ('\u30b5', &[('\u3099', '\u30b6')]), ('\u30b7', &[('\u3099', '\u30b8')]), ('\u30b9', &[('\u3099', '\u30ba')]), ('\u30bb', &[('\u3099', '\u30bc')]), ('\u30bd', &[('\u3099', '\u30be')]), ('\u30bf', &[('\u3099', '\u30c0')]), ('\u30c1', &[('\u3099', '\u30c2')]), ('\u30c4', &[('\u3099', '\u30c5')]), ('\u30c6', &[('\u3099', '\u30c7')]), ('\u30c8', &[('\u3099', '\u30c9')]), ('\u30cf', &[('\u3099', '\u30d0'), ('\u309a', '\u30d1')]), ('\u30d2', &[('\u3099', '\u30d3'), ('\u309a', '\u30d4')]), ('\u30d5', &[('\u3099', '\u30d6'), ('\u309a', '\u30d7')]), ('\u30d8', &[('\u3099', '\u30d9'), ('\u309a', '\u30da')]), ('\u30db', &[('\u3099', '\u30dc'), ('\u309a', '\u30dd')]), ('\u30ef', &[('\u3099', '\u30f7')]), ('\u30f0', &[('\u3099', '\u30f8')]), ('\u30f1', &[('\u3099', '\u30f9')]), ('\u30f2', &[('\u3099', '\u30fa')]), ('\u30fd', &[('\u3099', '\u30fe')]), ('\U00011099', &[('\U000110ba', '\U0001109a')]), ('\U0001109b', &[('\U000110ba', '\U0001109c')]), ('\U000110a5', &[('\U000110ba', '\U000110ab')]), ('\U00011131', &[('\U00011127', '\U0001112e')]), ('\U00011132', &[('\U00011127', '\U0001112f')]), ('\U00011347', &[('\U0001133e', '\U0001134b'), ('\U00011357', '\U0001134c')]), ('\U000114b9', &[('\U000114b0', '\U000114bc'), ('\U000114ba', '\U000114bb'), ('\U000114bd', '\U000114be')]), ('\U000115b8', &[('\U000115af', '\U000115ba')]), ('\U000115b9', &[('\U000115af', '\U000115bb')]) ]; fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 { use core::cmp::{Equal, Less, Greater}; use core::slice::SlicePrelude; use core::slice; match r.binary_search(|&(lo, hi, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { slice::Found(idx) => { let (_, _, result) = r[idx]; result } slice::NotFound(_) => 0 } } static combining_class_table: &'static [(char, char, u8)] = &[ ('\u0300', '\u0314', 230), ('\u0315', '\u0315', 232), ('\u0316', '\u0319', 220), ('\u031a', '\u031a', 232), ('\u031b', '\u031b', 216), ('\u031c', '\u0320', 220), ('\u0321', '\u0322', 202), ('\u0323', '\u0326', 220), ('\u0327', '\u0328', 202), ('\u0329', '\u0333', 220), ('\u0334', '\u0338', 1), ('\u0339', '\u033c', 220), ('\u033d', '\u0344', 230), ('\u0345', '\u0345', 240), ('\u0346', '\u0346', 230), ('\u0347', '\u0349', 220), ('\u034a', '\u034c', 230), ('\u034d', '\u034e', 220), ('\u0350', '\u0352', 230), ('\u0353', '\u0356', 220), ('\u0357', '\u0357', 230), ('\u0358', '\u0358', 232), ('\u0359', '\u035a', 220), ('\u035b', '\u035b', 230), ('\u035c', '\u035c', 233), ('\u035d', '\u035e', 234), ('\u035f', '\u035f', 233), ('\u0360', '\u0361', 234), ('\u0362', '\u0362', 233), ('\u0363', '\u036f', 230), ('\u0483', '\u0487', 230), ('\u0591', '\u0591', 220), ('\u0592', '\u0595', 230), ('\u0596', '\u0596', 220), ('\u0597', '\u0599', 230), ('\u059a', '\u059a', 222), ('\u059b', '\u059b', 220), ('\u059c', '\u05a1', 230), ('\u05a2', '\u05a7', 220), ('\u05a8', '\u05a9', 230), ('\u05aa', '\u05aa', 220), ('\u05ab', '\u05ac', 230), ('\u05ad', '\u05ad', 222), ('\u05ae', '\u05ae', 228), ('\u05af', '\u05af', 230), ('\u05b0', '\u05b0', 10), ('\u05b1', '\u05b1', 11), ('\u05b2', '\u05b2', 12), ('\u05b3', '\u05b3', 13), ('\u05b4', '\u05b4', 14), ('\u05b5', '\u05b5', 15), ('\u05b6', '\u05b6', 16), ('\u05b7', '\u05b7', 17), ('\u05b8', '\u05b8', 18), ('\u05b9', '\u05ba', 19), ('\u05bb', '\u05bb', 20), ('\u05bc', '\u05bc', 21), ('\u05bd', '\u05bd', 22), ('\u05bf', '\u05bf', 23), ('\u05c1', '\u05c1', 24), ('\u05c2', '\u05c2', 25), ('\u05c4', '\u05c4', 230), ('\u05c5', '\u05c5', 220), ('\u05c7', '\u05c7', 18), ('\u0610', '\u0617', 230), ('\u0618', '\u0618', 30), ('\u0619', '\u0619', 31), ('\u061a', '\u061a', 32), ('\u064b', '\u064b', 27), ('\u064c', '\u064c', 28), ('\u064d', '\u064d', 29), ('\u064e', '\u064e', 30), ('\u064f', '\u064f', 31), ('\u0650', '\u0650', 32), ('\u0651', '\u0651', 33), ('\u0652', '\u0652', 34), ('\u0653', '\u0654', 230), ('\u0655', '\u0656', 220), ('\u0657', '\u065b', 230), ('\u065c', '\u065c', 220), ('\u065d', '\u065e', 230), ('\u065f', '\u065f', 220), ('\u0670', '\u0670', 35), ('\u06d6', '\u06dc', 230), ('\u06df', '\u06e2', 230), ('\u06e3', '\u06e3', 220), ('\u06e4', '\u06e4', 230), ('\u06e7', '\u06e8', 230), ('\u06ea', '\u06ea', 220), ('\u06eb', '\u06ec', 230), ('\u06ed', '\u06ed', 220), ('\u0711', '\u0711', 36), ('\u0730', '\u0730', 230), ('\u0731', '\u0731', 220), ('\u0732', '\u0733', 230), ('\u0734', '\u0734', 220), ('\u0735', '\u0736', 230), ('\u0737', '\u0739', 220), ('\u073a', '\u073a', 230), ('\u073b', '\u073c', 220), ('\u073d', '\u073d', 230), ('\u073e', '\u073e', 220), ('\u073f', '\u0741', 230), ('\u0742', '\u0742', 220), ('\u0743', '\u0743', 230), ('\u0744', '\u0744', 220), ('\u0745', '\u0745', 230), ('\u0746', '\u0746', 220), ('\u0747', '\u0747', 230), ('\u0748', '\u0748', 220), ('\u0749', '\u074a', 230), ('\u07eb', '\u07f1', 230), ('\u07f2', '\u07f2', 220), ('\u07f3', '\u07f3', 230), ('\u0816', '\u0819', 230), ('\u081b', '\u0823', 230), ('\u0825', '\u0827', 230), ('\u0829', '\u082d', 230), ('\u0859', '\u085b', 220), ('\u08e4', '\u08e5', 230), ('\u08e6', '\u08e6', 220), ('\u08e7', '\u08e8', 230), ('\u08e9', '\u08e9', 220), ('\u08ea', '\u08ec', 230), ('\u08ed', '\u08ef', 220), ('\u08f0', '\u08f0', 27), ('\u08f1', '\u08f1', 28), ('\u08f2', '\u08f2', 29), ('\u08f3', '\u08f5', 230), ('\u08f6', '\u08f6', 220), ('\u08f7', '\u08f8', 230), ('\u08f9', '\u08fa', 220), ('\u08fb', '\u08ff', 230), ('\u093c', '\u093c', 7), ('\u094d', '\u094d', 9), ('\u0951', '\u0951', 230), ('\u0952', '\u0952', 220), ('\u0953', '\u0954', 230), ('\u09bc', '\u09bc', 7), ('\u09cd', '\u09cd', 9), ('\u0a3c', '\u0a3c', 7), ('\u0a4d', '\u0a4d', 9), ('\u0abc', '\u0abc', 7), ('\u0acd', '\u0acd', 9), ('\u0b3c', '\u0b3c', 7), ('\u0b4d', '\u0b4d', 9), ('\u0bcd', '\u0bcd', 9), ('\u0c4d', '\u0c4d', 9), ('\u0c55', '\u0c55', 84), ('\u0c56', '\u0c56', 91), ('\u0cbc', '\u0cbc', 7), ('\u0ccd', '\u0ccd', 9), ('\u0d4d', '\u0d4d', 9), ('\u0dca', '\u0dca', 9), ('\u0e38', '\u0e39', 103), ('\u0e3a', '\u0e3a', 9), ('\u0e48', '\u0e4b', 107), ('\u0eb8', '\u0eb9', 118), ('\u0ec8', '\u0ecb', 122), ('\u0f18', '\u0f19', 220), ('\u0f35', '\u0f35', 220), ('\u0f37', '\u0f37', 220), ('\u0f39', '\u0f39', 216), ('\u0f71', '\u0f71', 129), ('\u0f72', '\u0f72', 130), ('\u0f74', '\u0f74', 132), ('\u0f7a', '\u0f7d', 130), ('\u0f80', '\u0f80', 130), ('\u0f82', '\u0f83', 230), ('\u0f84', '\u0f84', 9), ('\u0f86', '\u0f87', 230), ('\u0fc6', '\u0fc6', 220), ('\u1037', '\u1037', 7), ('\u1039', '\u103a', 9), ('\u108d', '\u108d', 220), ('\u135d', '\u135f', 230), ('\u1714', '\u1714', 9), ('\u1734', '\u1734', 9), ('\u17d2', '\u17d2', 9), ('\u17dd', '\u17dd', 230), ('\u18a9', '\u18a9', 228), ('\u1939', '\u1939', 222), ('\u193a', '\u193a', 230), ('\u193b', '\u193b', 220), ('\u1a17', '\u1a17', 230), ('\u1a18', '\u1a18', 220), ('\u1a60', '\u1a60', 9), ('\u1a75', '\u1a7c', 230), ('\u1a7f', '\u1a7f', 220), ('\u1ab0', '\u1ab4', 230), ('\u1ab5', '\u1aba', 220), ('\u1abb', '\u1abc', 230), ('\u1abd', '\u1abd', 220), ('\u1b34', '\u1b34', 7), ('\u1b44', '\u1b44', 9), ('\u1b6b', '\u1b6b', 230), ('\u1b6c', '\u1b6c', 220), ('\u1b6d', '\u1b73', 230), ('\u1baa', '\u1bab', 9), ('\u1be6', '\u1be6', 7), ('\u1bf2', '\u1bf3', 9), ('\u1c37', '\u1c37', 7), ('\u1cd0', '\u1cd2', 230), ('\u1cd4', '\u1cd4', 1), ('\u1cd5', '\u1cd9', 220), ('\u1cda', '\u1cdb', 230), ('\u1cdc', '\u1cdf', 220), ('\u1ce0', '\u1ce0', 230), ('\u1ce2', '\u1ce8', 1), ('\u1ced', '\u1ced', 220), ('\u1cf4', '\u1cf4', 230), ('\u1cf8', '\u1cf9', 230), ('\u1dc0', '\u1dc1', 230), ('\u1dc2', '\u1dc2', 220), ('\u1dc3', '\u1dc9', 230), ('\u1dca', '\u1dca', 220), ('\u1dcb', '\u1dcc', 230), ('\u1dcd', '\u1dcd', 234), ('\u1dce', '\u1dce', 214), ('\u1dcf', '\u1dcf', 220), ('\u1dd0', '\u1dd0', 202), ('\u1dd1', '\u1df5', 230), ('\u1dfc', '\u1dfc', 233), ('\u1dfd', '\u1dfd', 220), ('\u1dfe', '\u1dfe', 230), ('\u1dff', '\u1dff', 220), ('\u20d0', '\u20d1', 230), ('\u20d2', '\u20d3', 1), ('\u20d4', '\u20d7', 230), ('\u20d8', '\u20da', 1), ('\u20db', '\u20dc', 230), ('\u20e1', '\u20e1', 230), ('\u20e5', '\u20e6', 1), ('\u20e7', '\u20e7', 230), ('\u20e8', '\u20e8', 220), ('\u20e9', '\u20e9', 230), ('\u20ea', '\u20eb', 1), ('\u20ec', '\u20ef', 220), ('\u20f0', '\u20f0', 230), ('\u2cef', '\u2cf1', 230), ('\u2d7f', '\u2d7f', 9), ('\u2de0', '\u2dff', 230), ('\u302a', '\u302a', 218), ('\u302b', '\u302b', 228), ('\u302c', '\u302c', 232), ('\u302d', '\u302d', 222), ('\u302e', '\u302f', 224), ('\u3099', '\u309a', 8), ('\ua66f', '\ua66f', 230), ('\ua674', '\ua67d', 230), ('\ua69f', '\ua69f', 230), ('\ua6f0', '\ua6f1', 230), ('\ua806', '\ua806', 9), ('\ua8c4', '\ua8c4', 9), ('\ua8e0', '\ua8f1', 230), ('\ua92b', '\ua92d', 220), ('\ua953', '\ua953', 9), ('\ua9b3', '\ua9b3', 7), ('\ua9c0', '\ua9c0', 9), ('\uaab0', '\uaab0', 230), ('\uaab2', '\uaab3', 230), ('\uaab4', '\uaab4', 220), ('\uaab7', '\uaab8', 230), ('\uaabe', '\uaabf', 230), ('\uaac1', '\uaac1', 230), ('\uaaf6', '\uaaf6', 9), ('\uabed', '\uabed', 9), ('\ufb1e', '\ufb1e', 26), ('\ufe20', '\ufe26', 230), ('\ufe27', '\ufe2d', 220), ('\U000101fd', '\U000101fd', 220), ('\U000102e0', '\U000102e0', 220), ('\U00010376', '\U0001037a', 230), ('\U00010a0d', '\U00010a0d', 220), ('\U00010a0f', '\U00010a0f', 230), ('\U00010a38', '\U00010a38', 230), ('\U00010a39', '\U00010a39', 1), ('\U00010a3a', '\U00010a3a', 220), ('\U00010a3f', '\U00010a3f', 9), ('\U00010ae5', '\U00010ae5', 230), ('\U00010ae6', '\U00010ae6', 220), ('\U00011046', '\U00011046', 9), ('\U0001107f', '\U0001107f', 9), ('\U000110b9', '\U000110b9', 9), ('\U000110ba', '\U000110ba', 7), ('\U00011100', '\U00011102', 230), ('\U00011133', '\U00011134', 9), ('\U00011173', '\U00011173', 7), ('\U000111c0', '\U000111c0', 9), ('\U00011235', '\U00011235', 9), ('\U00011236', '\U00011236', 7), ('\U000112e9', '\U000112e9', 7), ('\U000112ea', '\U000112ea', 9), ('\U0001133c', '\U0001133c', 7), ('\U0001134d', '\U0001134d', 9), ('\U00011366', '\U0001136c', 230), ('\U00011370', '\U00011374', 230), ('\U000114c2', '\U000114c2', 9), ('\U000114c3', '\U000114c3', 7), ('\U000115bf', '\U000115bf', 9), ('\U000115c0', '\U000115c0', 7), ('\U0001163f', '\U0001163f', 9), ('\U000116b6', '\U000116b6', 9), ('\U000116b7', '\U000116b7', 7), ('\U00016af0', '\U00016af4', 1), ('\U00016b30', '\U00016b36', 230), ('\U0001bc9e', '\U0001bc9e', 1), ('\U0001d165', '\U0001d166', 216), ('\U0001d167', '\U0001d169', 1), ('\U0001d16d', '\U0001d16d', 226), ('\U0001d16e', '\U0001d172', 216), ('\U0001d17b', '\U0001d182', 220), ('\U0001d185', '\U0001d189', 230), ('\U0001d18a', '\U0001d18b', 220), ('\U0001d1aa', '\U0001d1ad', 230), ('\U0001d242', '\U0001d244', 230), ('\U0001e8d0', '\U0001e8d6', 220) ]; pub fn canonical_combining_class(c: char) -> u8 { bsearch_range_value_table(c, combining_class_table) } } pub mod conversions { use core::cmp::{Equal, Less, Greater}; use core::slice::SlicePrelude; use core::tuple::Tuple2; use core::option::{Option, Some, None}; use core::slice; pub fn to_lower(c: char) -> char { match bsearch_case_table(c, LuLl_table) { None => c, Some(index) => LuLl_table[index].val1() } } pub fn to_upper(c: char) -> char { match bsearch_case_table(c, LlLu_table) { None => c, Some(index) => LlLu_table[index].val1() } } fn bsearch_case_table(c: char, table: &'static [(char, char)]) -> Option<uint> { match table.binary_search(|&(key, _)| { if c == key { Equal } else if key < c { Less } else { Greater } }) { slice::Found(i) => Some(i), slice::NotFound(_) => None, } } static LuLl_table: &'static [(char, char)] = &[ ('\x41', '\x61'), ('\x42', '\x62'), ('\x43', '\x63'), ('\x44', '\x64'), ('\x45', '\x65'), ('\x46', '\x66'), ('\x47', '\x67'), ('\x48', '\x68'), ('\x49', '\x69'), ('\x4a', '\x6a'), ('\x4b', '\x6b'), ('\x4c', '\x6c'), ('\x4d', '\x6d'), ('\x4e', '\x6e'), ('\x4f', '\x6f'), ('\x50', '\x70'), ('\x51', '\x71'), ('\x52', '\x72'), ('\x53', '\x73'), ('\x54', '\x74'), ('\x55', '\x75'), ('\x56', '\x76'), ('\x57', '\x77'), ('\x58', '\x78'), ('\x59', '\x79'), ('\x5a', '\x7a'), ('\u00c0', '\u00e0'), ('\u00c1', '\u00e1'), ('\u00c2', '\u00e2'), ('\u00c3', '\u00e3'), ('\u00c4', '\u00e4'), ('\u00c5', '\u00e5'), ('\u00c6', '\u00e6'), ('\u00c7', '\u00e7'), ('\u00c8', '\u00e8'), ('\u00c9', '\u00e9'), ('\u00ca', '\u00ea'), ('\u00cb', '\u00eb'), ('\u00cc', '\u00ec'), ('\u00cd', '\u00ed'), ('\u00ce', '\u00ee'), ('\u00cf', '\u00ef'), ('\u00d0', '\u00f0'), ('\u00d1', '\u00f1'), ('\u00d2', '\u00f2'), ('\u00d3', '\u00f3'), ('\u00d4', '\u00f4'), ('\u00d5', '\u00f5'), ('\u00d6', '\u00f6'), ('\u00d8', '\u00f8'), ('\u00d9', '\u00f9'), ('\u00da', '\u00fa'), ('\u00db', '\u00fb'), ('\u00dc', '\u00fc'), ('\u00dd', '\u00fd'), ('\u00de', '\u00fe'), ('\u0100', '\u0101'), ('\u0102', '\u0103'), ('\u0104', '\u0105'), ('\u0106', '\u0107'), ('\u0108', '\u0109'), ('\u010a', '\u010b'), ('\u010c', '\u010d'), ('\u010e', '\u010f'), ('\u0110', '\u0111'), ('\u0112', '\u0113'), ('\u0114', '\u0115'), ('\u0116', '\u0117'), ('\u0118', '\u0119'), ('\u011a', '\u011b'), ('\u011c', '\u011d'), ('\u011e', '\u011f'), ('\u0120', '\u0121'), ('\u0122', '\u0123'), ('\u0124', '\u0125'), ('\u0126', '\u0127'), ('\u0128', '\u0129'), ('\u012a', '\u012b'), ('\u012c', '\u012d'), ('\u012e', '\u012f'), ('\u0130', '\x69'), ('\u0132', '\u0133'), ('\u0134', '\u0135'), ('\u0136', '\u0137'), ('\u0139', '\u013a'), ('\u013b', '\u013c'), ('\u013d', '\u013e'), ('\u013f', '\u0140'), ('\u0141', '\u0142'), ('\u0143', '\u0144'), ('\u0145', '\u0146'), ('\u0147', '\u0148'), ('\u014a', '\u014b'), ('\u014c', '\u014d'), ('\u014e', '\u014f'), ('\u0150', '\u0151'), ('\u0152', '\u0153'), ('\u0154', '\u0155'), ('\u0156', '\u0157'), ('\u0158', '\u0159'), ('\u015a', '\u015b'), ('\u015c', '\u015d'), ('\u015e', '\u015f'), ('\u0160', '\u0161'), ('\u0162', '\u0163'), ('\u0164', '\u0165'), ('\u0166', '\u0167'), ('\u0168', '\u0169'), ('\u016a', '\u016b'), ('\u016c', '\u016d'), ('\u016e', '\u016f'), ('\u0170', '\u0171'), ('\u0172', '\u0173'), ('\u0174', '\u0175'), ('\u0176', '\u0177'), ('\u0178', '\u00ff'), ('\u0179', '\u017a'), ('\u017b', '\u017c'), ('\u017d', '\u017e'), ('\u0181', '\u0253'), ('\u0182', '\u0183'), ('\u0184', '\u0185'), ('\u0186', '\u0254'), ('\u0187', '\u0188'), ('\u0189', '\u0256'), ('\u018a', '\u0257'), ('\u018b', '\u018c'), ('\u018e', '\u01dd'), ('\u018f', '\u0259'), ('\u0190', '\u025b'), ('\u0191', '\u0192'), ('\u0193', '\u0260'), ('\u0194', '\u0263'), ('\u0196', '\u0269'), ('\u0197', '\u0268'), ('\u0198', '\u0199'), ('\u019c', '\u026f'), ('\u019d', '\u0272'), ('\u019f', '\u0275'), ('\u01a0', '\u01a1'), ('\u01a2', '\u01a3'), ('\u01a4', '\u01a5'), ('\u01a6', '\u0280'), ('\u01a7', '\u01a8'), ('\u01a9', '\u0283'), ('\u01ac', '\u01ad'), ('\u01ae', '\u0288'), ('\u01af', '\u01b0'), ('\u01b1', '\u028a'), ('\u01b2', '\u028b'), ('\u01b3', '\u01b4'), ('\u01b5', '\u01b6'), ('\u01b7', '\u0292'), ('\u01b8', '\u01b9'), ('\u01bc', '\u01bd'), ('\u01c4', '\u01c6'), ('\u01c7', '\u01c9'), ('\u01ca', '\u01cc'), ('\u01cd', '\u01ce'), ('\u01cf', '\u01d0'), ('\u01d1', '\u01d2'), ('\u01d3', '\u01d4'), ('\u01d5', '\u01d6'), ('\u01d7', '\u01d8'), ('\u01d9', '\u01da'), ('\u01db', '\u01dc'), ('\u01de', '\u01df'), ('\u01e0', '\u01e1'), ('\u01e2', '\u01e3'), ('\u01e4', '\u01e5'), ('\u01e6', '\u01e7'), ('\u01e8', '\u01e9'), ('\u01ea', '\u01eb'), ('\u01ec', '\u01ed'), ('\u01ee', '\u01ef'), ('\u01f1', '\u01f3'), ('\u01f4', '\u01f5'), ('\u01f6', '\u0195'), ('\u01f7', '\u01bf'), ('\u01f8', '\u01f9'), ('\u01fa', '\u01fb'), ('\u01fc', '\u01fd'), ('\u01fe', '\u01ff'), ('\u0200', '\u0201'), ('\u0202', '\u0203'), ('\u0204', '\u0205'), ('\u0206', '\u0207'), ('\u0208', '\u0209'), ('\u020a', '\u020b'), ('\u020c', '\u020d'), ('\u020e', '\u020f'), ('\u0210', '\u0211'), ('\u0212', '\u0213'), ('\u0214', '\u0215'), ('\u0216', '\u0217'), ('\u0218', '\u0219'), ('\u021a', '\u021b'), ('\u021c', '\u021d'), ('\u021e', '\u021f'), ('\u0220', '\u019e'), ('\u0222', '\u0223'), ('\u0224', '\u0225'), ('\u0226', '\u0227'), ('\u0228', '\u0229'), ('\u022a', '\u022b'), ('\u022c', '\u022d'), ('\u022e', '\u022f'), ('\u0230', '\u0231'), ('\u0232', '\u0233'), ('\u023a', '\u2c65'), ('\u023b', '\u023c'), ('\u023d', '\u019a'), ('\u023e', '\u2c66'), ('\u0241', '\u0242'), ('\u0243', '\u0180'), ('\u0244', '\u0289'), ('\u0245', '\u028c'), ('\u0246', '\u0247'), ('\u0248', '\u0249'), ('\u024a', '\u024b'), ('\u024c', '\u024d'), ('\u024e', '\u024f'), ('\u0370', '\u0371'), ('\u0372', '\u0373'), ('\u0376', '\u0377'), ('\u037f', '\u03f3'), ('\u0386', '\u03ac'), ('\u0388', '\u03ad'), ('\u0389', '\u03ae'), ('\u038a', '\u03af'), ('\u038c', '\u03cc'), ('\u038e', '\u03cd'), ('\u038f', '\u03ce'), ('\u0391', '\u03b1'), ('\u0392', '\u03b2'), ('\u0393', '\u03b3'), ('\u0394', '\u03b4'), ('\u0395', '\u03b5'), ('\u0396', '\u03b6'), ('\u0397', '\u03b7'), ('\u0398', '\u03b8'), ('\u0399', '\u03b9'), ('\u039a', '\u03ba'), ('\u039b', '\u03bb'), ('\u039c', '\u03bc'), ('\u039d', '\u03bd'), ('\u039e', '\u03be'), ('\u039f', '\u03bf'), ('\u03a0', '\u03c0'), ('\u03a1', '\u03c1'), ('\u03a3', '\u03c3'), ('\u03a4', '\u03c4'), ('\u03a5', '\u03c5'), ('\u03a6', '\u03c6'), ('\u03a7', '\u03c7'), ('\u03a8', '\u03c8'), ('\u03a9', '\u03c9'), ('\u03aa', '\u03ca'), ('\u03ab', '\u03cb'), ('\u03cf', '\u03d7'), ('\u03d8', '\u03d9'), ('\u03da', '\u03db'), ('\u03dc', '\u03dd'), ('\u03de', '\u03df'), ('\u03e0', '\u03e1'), ('\u03e2', '\u03e3'), ('\u03e4', '\u03e5'), ('\u03e6', '\u03e7'), ('\u03e8', '\u03e9'), ('\u03ea', '\u03eb'), ('\u03ec', '\u03ed'), ('\u03ee', '\u03ef'), ('\u03f4', '\u03b8'), ('\u03f7', '\u03f8'), ('\u03f9', '\u03f2'), ('\u03fa', '\u03fb'), ('\u03fd', '\u037b'), ('\u03fe', '\u037c'), ('\u03ff', '\u037d'), ('\u0400', '\u0450'), ('\u0401', '\u0451'), ('\u0402', '\u0452'), ('\u0403', '\u0453'), ('\u0404', '\u0454'), ('\u0405', '\u0455'), ('\u0406', '\u0456'), ('\u0407', '\u0457'), ('\u0408', '\u0458'), ('\u0409', '\u0459'), ('\u040a', '\u045a'), ('\u040b', '\u045b'), ('\u040c', '\u045c'), ('\u040d', '\u045d'), ('\u040e', '\u045e'), ('\u040f', '\u045f'), ('\u0410', '\u0430'), ('\u0411', '\u0431'), ('\u0412', '\u0432'), ('\u0413', '\u0433'), ('\u0414', '\u0434'), ('\u0415', '\u0435'), ('\u0416', '\u0436'), ('\u0417', '\u0437'), ('\u0418', '\u0438'), ('\u0419', '\u0439'), ('\u041a', '\u043a'), ('\u041b', '\u043b'), ('\u041c', '\u043c'), ('\u041d', '\u043d'), ('\u041e', '\u043e'), ('\u041f', '\u043f'), ('\u0420', '\u0440'), ('\u0421', '\u0441'), ('\u0422', '\u0442'), ('\u0423', '\u0443'), ('\u0424', '\u0444'), ('\u0425', '\u0445'), ('\u0426', '\u0446'), ('\u0427', '\u0447'), ('\u0428', '\u0448'), ('\u0429', '\u0449'), ('\u042a', '\u044a'), ('\u042b', '\u044b'), ('\u042c', '\u044c'), ('\u042d', '\u044d'), ('\u042e', '\u044e'), ('\u042f', '\u044f'), ('\u0460', '\u0461'), ('\u0462', '\u0463'), ('\u0464', '\u0465'), ('\u0466', '\u0467'), ('\u0468', '\u0469'), ('\u046a', '\u046b'), ('\u046c', '\u046d'), ('\u046e', '\u046f'), ('\u0470', '\u0471'), ('\u0472', '\u0473'), ('\u0474', '\u0475'), ('\u0476', '\u0477'), ('\u0478', '\u0479'), ('\u047a', '\u047b'), ('\u047c', '\u047d'), ('\u047e', '\u047f'), ('\u0480', '\u0481'), ('\u048a', '\u048b'), ('\u048c', '\u048d'), ('\u048e', '\u048f'), ('\u0490', '\u0491'), ('\u0492', '\u0493'), ('\u0494', '\u0495'), ('\u0496', '\u0497'), ('\u0498', '\u0499'), ('\u049a', '\u049b'), ('\u049c', '\u049d'), ('\u049e', '\u049f'), ('\u04a0', '\u04a1'), ('\u04a2', '\u04a3'), ('\u04a4', '\u04a5'), ('\u04a6', '\u04a7'), ('\u04a8', '\u04a9'), ('\u04aa', '\u04ab'), ('\u04ac', '\u04ad'), ('\u04ae', '\u04af'), ('\u04b0', '\u04b1'), ('\u04b2', '\u04b3'), ('\u04b4', '\u04b5'), ('\u04b6', '\u04b7'), ('\u04b8', '\u04b9'), ('\u04ba', '\u04bb'), ('\u04bc', '\u04bd'), ('\u04be', '\u04bf'), ('\u04c0', '\u04cf'), ('\u04c1', '\u04c2'), ('\u04c3', '\u04c4'), ('\u04c5', '\u04c6'), ('\u04c7', '\u04c8'), ('\u04c9', '\u04ca'), ('\u04cb', '\u04cc'), ('\u04cd', '\u04ce'), ('\u04d0', '\u04d1'), ('\u04d2', '\u04d3'), ('\u04d4', '\u04d5'), ('\u04d6', '\u04d7'), ('\u04d8', '\u04d9'), ('\u04da', '\u04db'), ('\u04dc', '\u04dd'), ('\u04de', '\u04df'), ('\u04e0', '\u04e1'), ('\u04e2', '\u04e3'), ('\u04e4', '\u04e5'), ('\u04e6', '\u04e7'), ('\u04e8', '\u04e9'), ('\u04ea', '\u04eb'), ('\u04ec', '\u04ed'), ('\u04ee', '\u04ef'), ('\u04f0', '\u04f1'), ('\u04f2', '\u04f3'), ('\u04f4', '\u04f5'), ('\u04f6', '\u04f7'), ('\u04f8', '\u04f9'), ('\u04fa', '\u04fb'), ('\u04fc', '\u04fd'), ('\u04fe', '\u04ff'), ('\u0500', '\u0501'), ('\u0502', '\u0503'), ('\u0504', '\u0505'), ('\u0506', '\u0507'), ('\u0508', '\u0509'), ('\u050a', '\u050b'), ('\u050c', '\u050d'), ('\u050e', '\u050f'), ('\u0510', '\u0511'), ('\u0512', '\u0513'), ('\u0514', '\u0515'), ('\u0516', '\u0517'), ('\u0518', '\u0519'), ('\u051a', '\u051b'), ('\u051c', '\u051d'), ('\u051e', '\u051f'), ('\u0520', '\u0521'), ('\u0522', '\u0523'), ('\u0524', '\u0525'), ('\u0526', '\u0527'), ('\u0528', '\u0529'), ('\u052a', '\u052b'), ('\u052c', '\u052d'), ('\u052e', '\u052f'), ('\u0531', '\u0561'), ('\u0532', '\u0562'), ('\u0533', '\u0563'), ('\u0534', '\u0564'), ('\u0535', '\u0565'), ('\u0536', '\u0566'), ('\u0537', '\u0567'), ('\u0538', '\u0568'), ('\u0539', '\u0569'), ('\u053a', '\u056a'), ('\u053b', '\u056b'), ('\u053c', '\u056c'), ('\u053d', '\u056d'), ('\u053e', '\u056e'), ('\u053f', '\u056f'), ('\u0540', '\u0570'), ('\u0541', '\u0571'), ('\u0542', '\u0572'), ('\u0543', '\u0573'), ('\u0544', '\u0574'), ('\u0545', '\u0575'), ('\u0546', '\u0576'), ('\u0547', '\u0577'), ('\u0548', '\u0578'), ('\u0549', '\u0579'), ('\u054a', '\u057a'), ('\u054b', '\u057b'), ('\u054c', '\u057c'), ('\u054d', '\u057d'), ('\u054e', '\u057e'), ('\u054f', '\u057f'), ('\u0550', '\u0580'), ('\u0551', '\u0581'), ('\u0552', '\u0582'), ('\u0553', '\u0583'), ('\u0554', '\u0584'), ('\u0555', '\u0585'), ('\u0556', '\u0586'), ('\u10a0', '\u2d00'), ('\u10a1', '\u2d01'), ('\u10a2', '\u2d02'), ('\u10a3', '\u2d03'), ('\u10a4', '\u2d04'), ('\u10a5', '\u2d05'), ('\u10a6', '\u2d06'), ('\u10a7', '\u2d07'), ('\u10a8', '\u2d08'), ('\u10a9', '\u2d09'), ('\u10aa', '\u2d0a'), ('\u10ab', '\u2d0b'), ('\u10ac', '\u2d0c'), ('\u10ad', '\u2d0d'), ('\u10ae', '\u2d0e'), ('\u10af', '\u2d0f'), ('\u10b0', '\u2d10'), ('\u10b1', '\u2d11'), ('\u10b2', '\u2d12'), ('\u10b3', '\u2d13'), ('\u10b4', '\u2d14'), ('\u10b5', '\u2d15'), ('\u10b6', '\u2d16'), ('\u10b7', '\u2d17'), ('\u10b8', '\u2d18'), ('\u10b9', '\u2d19'), ('\u10ba', '\u2d1a'), ('\u10bb', '\u2d1b'), ('\u10bc', '\u2d1c'), ('\u10bd', '\u2d1d'), ('\u10be', '\u2d1e'), ('\u10bf', '\u2d1f'), ('\u10c0', '\u2d20'), ('\u10c1', '\u2d21'), ('\u10c2', '\u2d22'), ('\u10c3', '\u2d23'), ('\u10c4', '\u2d24'), ('\u10c5', '\u2d25'), ('\u10c7', '\u2d27'), ('\u10cd', '\u2d2d'), ('\u1e00', '\u1e01'), ('\u1e02', '\u1e03'), ('\u1e04', '\u1e05'), ('\u1e06', '\u1e07'), ('\u1e08', '\u1e09'), ('\u1e0a', '\u1e0b'), ('\u1e0c', '\u1e0d'), ('\u1e0e', '\u1e0f'), ('\u1e10', '\u1e11'), ('\u1e12', '\u1e13'), ('\u1e14', '\u1e15'), ('\u1e16', '\u1e17'), ('\u1e18', '\u1e19'), ('\u1e1a', '\u1e1b'), ('\u1e1c', '\u1e1d'), ('\u1e1e', '\u1e1f'), ('\u1e20', '\u1e21'), ('\u1e22', '\u1e23'), ('\u1e24', '\u1e25'), ('\u1e26', '\u1e27'), ('\u1e28', '\u1e29'), ('\u1e2a', '\u1e2b'), ('\u1e2c', '\u1e2d'), ('\u1e2e', '\u1e2f'), ('\u1e30', '\u1e31'), ('\u1e32', '\u1e33'), ('\u1e34', '\u1e35'), ('\u1e36', '\u1e37'), ('\u1e38', '\u1e39'), ('\u1e3a', '\u1e3b'), ('\u1e3c', '\u1e3d'), ('\u1e3e', '\u1e3f'), ('\u1e40', '\u1e41'), ('\u1e42', '\u1e43'), ('\u1e44', '\u1e45'), ('\u1e46', '\u1e47'), ('\u1e48', '\u1e49'), ('\u1e4a', '\u1e4b'), ('\u1e4c', '\u1e4d'), ('\u1e4e', '\u1e4f'), ('\u1e50', '\u1e51'), ('\u1e52', '\u1e53'), ('\u1e54', '\u1e55'), ('\u1e56', '\u1e57'), ('\u1e58', '\u1e59'), ('\u1e5a', '\u1e5b'), ('\u1e5c', '\u1e5d'), ('\u1e5e', '\u1e5f'), ('\u1e60', '\u1e61'), ('\u1e62', '\u1e63'), ('\u1e64', '\u1e65'), ('\u1e66', '\u1e67'), ('\u1e68', '\u1e69'), ('\u1e6a', '\u1e6b'), ('\u1e6c', '\u1e6d'), ('\u1e6e', '\u1e6f'), ('\u1e70', '\u1e71'), ('\u1e72', '\u1e73'), ('\u1e74', '\u1e75'), ('\u1e76', '\u1e77'), ('\u1e78', '\u1e79'), ('\u1e7a', '\u1e7b'), ('\u1e7c', '\u1e7d'), ('\u1e7e', '\u1e7f'), ('\u1e80', '\u1e81'), ('\u1e82', '\u1e83'), ('\u1e84', '\u1e85'), ('\u1e86', '\u1e87'), ('\u1e88', '\u1e89'), ('\u1e8a', '\u1e8b'), ('\u1e8c', '\u1e8d'), ('\u1e8e', '\u1e8f'), ('\u1e90', '\u1e91'), ('\u1e92', '\u1e93'), ('\u1e94', '\u1e95'), ('\u1e9e', '\u00df'), ('\u1ea0', '\u1ea1'), ('\u1ea2', '\u1ea3'), ('\u1ea4', '\u1ea5'), ('\u1ea6', '\u1ea7'), ('\u1ea8', '\u1ea9'), ('\u1eaa', '\u1eab'), ('\u1eac', '\u1ead'), ('\u1eae', '\u1eaf'), ('\u1eb0', '\u1eb1'), ('\u1eb2', '\u1eb3'), ('\u1eb4', '\u1eb5'), ('\u1eb6', '\u1eb7'), ('\u1eb8', '\u1eb9'), ('\u1eba', '\u1ebb'), ('\u1ebc', '\u1ebd'), ('\u1ebe', '\u1ebf'), ('\u1ec0', '\u1ec1'), ('\u1ec2', '\u1ec3'), ('\u1ec4', '\u1ec5'), ('\u1ec6', '\u1ec7'), ('\u1ec8', '\u1ec9'), ('\u1eca', '\u1ecb'), ('\u1ecc', '\u1ecd'), ('\u1ece', '\u1ecf'), ('\u1ed0', '\u1ed1'), ('\u1ed2', '\u1ed3'), ('\u1ed4', '\u1ed5'), ('\u1ed6', '\u1ed7'), ('\u1ed8', '\u1ed9'), ('\u1eda', '\u1edb'), ('\u1edc', '\u1edd'), ('\u1ede', '\u1edf'), ('\u1ee0', '\u1ee1'), ('\u1ee2', '\u1ee3'), ('\u1ee4', '\u1ee5'), ('\u1ee6', '\u1ee7'), ('\u1ee8', '\u1ee9'), ('\u1eea', '\u1eeb'), ('\u1eec', '\u1eed'), ('\u1eee', '\u1eef'), ('\u1ef0', '\u1ef1'), ('\u1ef2', '\u1ef3'), ('\u1ef4', '\u1ef5'), ('\u1ef6', '\u1ef7'), ('\u1ef8', '\u1ef9'), ('\u1efa', '\u1efb'), ('\u1efc', '\u1efd'), ('\u1efe', '\u1eff'), ('\u1f08', '\u1f00'), ('\u1f09', '\u1f01'), ('\u1f0a', '\u1f02'), ('\u1f0b', '\u1f03'), ('\u1f0c', '\u1f04'), ('\u1f0d', '\u1f05'), ('\u1f0e', '\u1f06'), ('\u1f0f', '\u1f07'), ('\u1f18', '\u1f10'), ('\u1f19', '\u1f11'), ('\u1f1a', '\u1f12'), ('\u1f1b', '\u1f13'), ('\u1f1c', '\u1f14'), ('\u1f1d', '\u1f15'), ('\u1f28', '\u1f20'), ('\u1f29', '\u1f21'), ('\u1f2a', '\u1f22'), ('\u1f2b', '\u1f23'), ('\u1f2c', '\u1f24'), ('\u1f2d', '\u1f25'), ('\u1f2e', '\u1f26'), ('\u1f2f', '\u1f27'), ('\u1f38', '\u1f30'), ('\u1f39', '\u1f31'), ('\u1f3a', '\u1f32'), ('\u1f3b', '\u1f33'), ('\u1f3c', '\u1f34'), ('\u1f3d', '\u1f35'), ('\u1f3e', '\u1f36'), ('\u1f3f', '\u1f37'), ('\u1f48', '\u1f40'), ('\u1f49', '\u1f41'), ('\u1f4a', '\u1f42'), ('\u1f4b', '\u1f43'), ('\u1f4c', '\u1f44'), ('\u1f4d', '\u1f45'), ('\u1f59', '\u1f51'), ('\u1f5b', '\u1f53'), ('\u1f5d', '\u1f55'), ('\u1f5f', '\u1f57'), ('\u1f68', '\u1f60'), ('\u1f69', '\u1f61'), ('\u1f6a', '\u1f62'), ('\u1f6b', '\u1f63'), ('\u1f6c', '\u1f64'), ('\u1f6d', '\u1f65'), ('\u1f6e', '\u1f66'), ('\u1f6f', '\u1f67'), ('\u1fb8', '\u1fb0'), ('\u1fb9', '\u1fb1'), ('\u1fba', '\u1f70'), ('\u1fbb', '\u1f71'), ('\u1fc8', '\u1f72'), ('\u1fc9', '\u1f73'), ('\u1fca', '\u1f74'), ('\u1fcb', '\u1f75'), ('\u1fd8', '\u1fd0'), ('\u1fd9', '\u1fd1'), ('\u1fda', '\u1f76'), ('\u1fdb', '\u1f77'), ('\u1fe8', '\u1fe0'), ('\u1fe9', '\u1fe1'), ('\u1fea', '\u1f7a'), ('\u1feb', '\u1f7b'), ('\u1fec', '\u1fe5'), ('\u1ff8', '\u1f78'), ('\u1ff9', '\u1f79'), ('\u1ffa', '\u1f7c'), ('\u1ffb', '\u1f7d'), ('\u2126', '\u03c9'), ('\u212a', '\x6b'), ('\u212b', '\u00e5'), ('\u2132', '\u214e'), ('\u2183', '\u2184'), ('\u2c00', '\u2c30'), ('\u2c01', '\u2c31'), ('\u2c02', '\u2c32'), ('\u2c03', '\u2c33'), ('\u2c04', '\u2c34'), ('\u2c05', '\u2c35'), ('\u2c06', '\u2c36'), ('\u2c07', '\u2c37'), ('\u2c08', '\u2c38'), ('\u2c09', '\u2c39'), ('\u2c0a', '\u2c3a'), ('\u2c0b', '\u2c3b'), ('\u2c0c', '\u2c3c'), ('\u2c0d', '\u2c3d'), ('\u2c0e', '\u2c3e'), ('\u2c0f', '\u2c3f'), ('\u2c10', '\u2c40'), ('\u2c11', '\u2c41'), ('\u2c12', '\u2c42'), ('\u2c13', '\u2c43'), ('\u2c14', '\u2c44'), ('\u2c15', '\u2c45'), ('\u2c16', '\u2c46'), ('\u2c17', '\u2c47'), ('\u2c18', '\u2c48'), ('\u2c19', '\u2c49'), ('\u2c1a', '\u2c4a'), ('\u2c1b', '\u2c4b'), ('\u2c1c', '\u2c4c'), ('\u2c1d', '\u2c4d'), ('\u2c1e', '\u2c4e'), ('\u2c1f', '\u2c4f'), ('\u2c20', '\u2c50'), ('\u2c21', '\u2c51'), ('\u2c22', '\u2c52'), ('\u2c23', '\u2c53'), ('\u2c24', '\u2c54'), ('\u2c25', '\u2c55'), ('\u2c26', '\u2c56'), ('\u2c27', '\u2c57'), ('\u2c28', '\u2c58'), ('\u2c29', '\u2c59'), ('\u2c2a', '\u2c5a'), ('\u2c2b', '\u2c5b'), ('\u2c2c', '\u2c5c'), ('\u2c2d', '\u2c5d'), ('\u2c2e', '\u2c5e'), ('\u2c60', '\u2c61'), ('\u2c62', '\u026b'), ('\u2c63', '\u1d7d'), ('\u2c64', '\u027d'), ('\u2c67', '\u2c68'), ('\u2c69', '\u2c6a'), ('\u2c6b', '\u2c6c'), ('\u2c6d', '\u0251'), ('\u2c6e', '\u0271'), ('\u2c6f', '\u0250'), ('\u2c70', '\u0252'), ('\u2c72', '\u2c73'), ('\u2c75', '\u2c76'), ('\u2c7e', '\u023f'), ('\u2c7f', '\u0240'), ('\u2c80', '\u2c81'), ('\u2c82', '\u2c83'), ('\u2c84', '\u2c85'), ('\u2c86', '\u2c87'), ('\u2c88', '\u2c89'), ('\u2c8a', '\u2c8b'), ('\u2c8c', '\u2c8d'), ('\u2c8e', '\u2c8f'), ('\u2c90', '\u2c91'), ('\u2c92', '\u2c93'), ('\u2c94', '\u2c95'), ('\u2c96', '\u2c97'), ('\u2c98', '\u2c99'), ('\u2c9a', '\u2c9b'), ('\u2c9c', '\u2c9d'), ('\u2c9e', '\u2c9f'), ('\u2ca0', '\u2ca1'), ('\u2ca2', '\u2ca3'), ('\u2ca4', '\u2ca5'), ('\u2ca6', '\u2ca7'), ('\u2ca8', '\u2ca9'), ('\u2caa', '\u2cab'), ('\u2cac', '\u2cad'), ('\u2cae', '\u2caf'), ('\u2cb0', '\u2cb1'), ('\u2cb2', '\u2cb3'), ('\u2cb4', '\u2cb5'), ('\u2cb6', '\u2cb7'), ('\u2cb8', '\u2cb9'), ('\u2cba', '\u2cbb'), ('\u2cbc', '\u2cbd'), ('\u2cbe', '\u2cbf'), ('\u2cc0', '\u2cc1'), ('\u2cc2', '\u2cc3'), ('\u2cc4', '\u2cc5'), ('\u2cc6', '\u2cc7'), ('\u2cc8', '\u2cc9'), ('\u2cca', '\u2ccb'), ('\u2ccc', '\u2ccd'), ('\u2cce', '\u2ccf'), ('\u2cd0', '\u2cd1'), ('\u2cd2', '\u2cd3'), ('\u2cd4', '\u2cd5'), ('\u2cd6', '\u2cd7'), ('\u2cd8', '\u2cd9'), ('\u2cda', '\u2cdb'), ('\u2cdc', '\u2cdd'), ('\u2cde', '\u2cdf'), ('\u2ce0', '\u2ce1'), ('\u2ce2', '\u2ce3'), ('\u2ceb', '\u2cec'), ('\u2ced', '\u2cee'), ('\u2cf2', '\u2cf3'), ('\ua640', '\ua641'), ('\ua642', '\ua643'), ('\ua644', '\ua645'), ('\ua646', '\ua647'), ('\ua648', '\ua649'), ('\ua64a', '\ua64b'), ('\ua64c', '\ua64d'), ('\ua64e', '\ua64f'), ('\ua650', '\ua651'), ('\ua652', '\ua653'), ('\ua654', '\ua655'), ('\ua656', '\ua657'), ('\ua658', '\ua659'), ('\ua65a', '\ua65b'), ('\ua65c', '\ua65d'), ('\ua65e', '\ua65f'), ('\ua660', '\ua661'), ('\ua662', '\ua663'), ('\ua664', '\ua665'), ('\ua666', '\ua667'), ('\ua668', '\ua669'), ('\ua66a', '\ua66b'), ('\ua66c', '\ua66d'), ('\ua680', '\ua681'), ('\ua682', '\ua683'), ('\ua684', '\ua685'), ('\ua686', '\ua687'), ('\ua688', '\ua689'), ('\ua68a', '\ua68b'), ('\ua68c', '\ua68d'), ('\ua68e', '\ua68f'), ('\ua690', '\ua691'), ('\ua692', '\ua693'), ('\ua694', '\ua695'), ('\ua696', '\ua697'), ('\ua698', '\ua699'), ('\ua69a', '\ua69b'), ('\ua722', '\ua723'), ('\ua724', '\ua725'), ('\ua726', '\ua727'), ('\ua728', '\ua729'), ('\ua72a', '\ua72b'), ('\ua72c', '\ua72d'), ('\ua72e', '\ua72f'), ('\ua732', '\ua733'), ('\ua734', '\ua735'), ('\ua736', '\ua737'), ('\ua738', '\ua739'), ('\ua73a', '\ua73b'), ('\ua73c', '\ua73d'), ('\ua73e', '\ua73f'), ('\ua740', '\ua741'), ('\ua742', '\ua743'), ('\ua744', '\ua745'), ('\ua746', '\ua747'), ('\ua748', '\ua749'), ('\ua74a', '\ua74b'), ('\ua74c', '\ua74d'), ('\ua74e', '\ua74f'), ('\ua750', '\ua751'), ('\ua752', '\ua753'), ('\ua754', '\ua755'), ('\ua756', '\ua757'), ('\ua758', '\ua759'), ('\ua75a', '\ua75b'), ('\ua75c', '\ua75d'), ('\ua75e', '\ua75f'), ('\ua760', '\ua761'), ('\ua762', '\ua763'), ('\ua764', '\ua765'), ('\ua766', '\ua767'), ('\ua768', '\ua769'), ('\ua76a', '\ua76b'), ('\ua76c', '\ua76d'), ('\ua76e', '\ua76f'), ('\ua779', '\ua77a'), ('\ua77b', '\ua77c'), ('\ua77d', '\u1d79'), ('\ua77e', '\ua77f'), ('\ua780', '\ua781'), ('\ua782', '\ua783'), ('\ua784', '\ua785'), ('\ua786', '\ua787'), ('\ua78b', '\ua78c'), ('\ua78d', '\u0265'), ('\ua790', '\ua791'), ('\ua792', '\ua793'), ('\ua796', '\ua797'), ('\ua798', '\ua799'), ('\ua79a', '\ua79b'), ('\ua79c', '\ua79d'), ('\ua79e', '\ua79f'), ('\ua7a0', '\ua7a1'), ('\ua7a2', '\ua7a3'), ('\ua7a4', '\ua7a5'), ('\ua7a6', '\ua7a7'), ('\ua7a8', '\ua7a9'), ('\ua7aa', '\u0266'), ('\ua7ab', '\u025c'), ('\ua7ac', '\u0261'), ('\ua7ad', '\u026c'), ('\ua7b0', '\u029e'), ('\ua7b1', '\u0287'), ('\uff21', '\uff41'), ('\uff22', '\uff42'), ('\uff23', '\uff43'), ('\uff24', '\uff44'), ('\uff25', '\uff45'), ('\uff26', '\uff46'), ('\uff27', '\uff47'), ('\uff28', '\uff48'), ('\uff29', '\uff49'), ('\uff2a', '\uff4a'), ('\uff2b', '\uff4b'), ('\uff2c', '\uff4c'), ('\uff2d', '\uff4d'), ('\uff2e', '\uff4e'), ('\uff2f', '\uff4f'), ('\uff30', '\uff50'), ('\uff31', '\uff51'), ('\uff32', '\uff52'), ('\uff33', '\uff53'), ('\uff34', '\uff54'), ('\uff35', '\uff55'), ('\uff36', '\uff56'), ('\uff37', '\uff57'), ('\uff38', '\uff58'), ('\uff39', '\uff59'), ('\uff3a', '\uff5a'), ('\U00010400', '\U00010428'), ('\U00010401', '\U00010429'), ('\U00010402', '\U0001042a'), ('\U00010403', '\U0001042b'), ('\U00010404', '\U0001042c'), ('\U00010405', '\U0001042d'), ('\U00010406', '\U0001042e'), ('\U00010407', '\U0001042f'), ('\U00010408', '\U00010430'), ('\U00010409', '\U00010431'), ('\U0001040a', '\U00010432'), ('\U0001040b', '\U00010433'), ('\U0001040c', '\U00010434'), ('\U0001040d', '\U00010435'), ('\U0001040e', '\U00010436'), ('\U0001040f', '\U00010437'), ('\U00010410', '\U00010438'), ('\U00010411', '\U00010439'), ('\U00010412', '\U0001043a'), ('\U00010413', '\U0001043b'), ('\U00010414', '\U0001043c'), ('\U00010415', '\U0001043d'), ('\U00010416', '\U0001043e'), ('\U00010417', '\U0001043f'), ('\U00010418', '\U00010440'), ('\U00010419', '\U00010441'), ('\U0001041a', '\U00010442'), ('\U0001041b', '\U00010443'), ('\U0001041c', '\U00010444'), ('\U0001041d', '\U00010445'), ('\U0001041e', '\U00010446'), ('\U0001041f', '\U00010447'), ('\U00010420', '\U00010448'), ('\U00010421', '\U00010449'), ('\U00010422', '\U0001044a'), ('\U00010423', '\U0001044b'), ('\U00010424', '\U0001044c'), ('\U00010425', '\U0001044d'), ('\U00010426', '\U0001044e'), ('\U00010427', '\U0001044f'), ('\U000118a0', '\U000118c0'), ('\U000118a1', '\U000118c1'), ('\U000118a2', '\U000118c2'), ('\U000118a3', '\U000118c3'), ('\U000118a4', '\U000118c4'), ('\U000118a5', '\U000118c5'), ('\U000118a6', '\U000118c6'), ('\U000118a7', '\U000118c7'), ('\U000118a8', '\U000118c8'), ('\U000118a9', '\U000118c9'), ('\U000118aa', '\U000118ca'), ('\U000118ab', '\U000118cb'), ('\U000118ac', '\U000118cc'), ('\U000118ad', '\U000118cd'), ('\U000118ae', '\U000118ce'), ('\U000118af', '\U000118cf'), ('\U000118b0', '\U000118d0'), ('\U000118b1', '\U000118d1'), ('\U000118b2', '\U000118d2'), ('\U000118b3', '\U000118d3'), ('\U000118b4', '\U000118d4'), ('\U000118b5', '\U000118d5'), ('\U000118b6', '\U000118d6'), ('\U000118b7', '\U000118d7'), ('\U000118b8', '\U000118d8'), ('\U000118b9', '\U000118d9'), ('\U000118ba', '\U000118da'), ('\U000118bb', '\U000118db'), ('\U000118bc', '\U000118dc'), ('\U000118bd', '\U000118dd'), ('\U000118be', '\U000118de'), ('\U000118bf', '\U000118df') ]; static LlLu_table: &'static [(char, char)] = &[ ('\x61', '\x41'), ('\x62', '\x42'), ('\x63', '\x43'), ('\x64', '\x44'), ('\x65', '\x45'), ('\x66', '\x46'), ('\x67', '\x47'), ('\x68', '\x48'), ('\x69', '\x49'), ('\x6a', '\x4a'), ('\x6b', '\x4b'), ('\x6c', '\x4c'), ('\x6d', '\x4d'), ('\x6e', '\x4e'), ('\x6f', '\x4f'), ('\x70', '\x50'), ('\x71', '\x51'), ('\x72', '\x52'), ('\x73', '\x53'), ('\x74', '\x54'), ('\x75', '\x55'), ('\x76', '\x56'), ('\x77', '\x57'), ('\x78', '\x58'), ('\x79', '\x59'), ('\x7a', '\x5a'), ('\u00b5', '\u039c'), ('\u00e0', '\u00c0'), ('\u00e1', '\u00c1'), ('\u00e2', '\u00c2'), ('\u00e3', '\u00c3'), ('\u00e4', '\u00c4'), ('\u00e5', '\u00c5'), ('\u00e6', '\u00c6'), ('\u00e7', '\u00c7'), ('\u00e8', '\u00c8'), ('\u00e9', '\u00c9'), ('\u00ea', '\u00ca'), ('\u00eb', '\u00cb'), ('\u00ec', '\u00cc'), ('\u00ed', '\u00cd'), ('\u00ee', '\u00ce'), ('\u00ef', '\u00cf'), ('\u00f0', '\u00d0'), ('\u00f1', '\u00d1'), ('\u00f2', '\u00d2'), ('\u00f3', '\u00d3'), ('\u00f4', '\u00d4'), ('\u00f5', '\u00d5'), ('\u00f6', '\u00d6'), ('\u00f8', '\u00d8'), ('\u00f9', '\u00d9'), ('\u00fa', '\u00da'), ('\u00fb', '\u00db'), ('\u00fc', '\u00dc'), ('\u00fd', '\u00dd'), ('\u00fe', '\u00de'), ('\u00ff', '\u0178'), ('\u0101', '\u0100'), ('\u0103', '\u0102'), ('\u0105', '\u0104'), ('\u0107', '\u0106'), ('\u0109', '\u0108'), ('\u010b', '\u010a'), ('\u010d', '\u010c'), ('\u010f', '\u010e'), ('\u0111', '\u0110'), ('\u0113', '\u0112'), ('\u0115', '\u0114'), ('\u0117', '\u0116'), ('\u0119', '\u0118'), ('\u011b', '\u011a'), ('\u011d', '\u011c'), ('\u011f', '\u011e'), ('\u0121', '\u0120'), ('\u0123', '\u0122'), ('\u0125', '\u0124'), ('\u0127', '\u0126'), ('\u0129', '\u0128'), ('\u012b', '\u012a'), ('\u012d', '\u012c'), ('\u012f', '\u012e'), ('\u0131', '\x49'), ('\u0133', '\u0132'), ('\u0135', '\u0134'), ('\u0137', '\u0136'), ('\u013a', '\u0139'), ('\u013c', '\u013b'), ('\u013e', '\u013d'), ('\u0140', '\u013f'), ('\u0142', '\u0141'), ('\u0144', '\u0143'), ('\u0146', '\u0145'), ('\u0148', '\u0147'), ('\u014b', '\u014a'), ('\u014d', '\u014c'), ('\u014f', '\u014e'), ('\u0151', '\u0150'), ('\u0153', '\u0152'), ('\u0155', '\u0154'), ('\u0157', '\u0156'), ('\u0159', '\u0158'), ('\u015b', '\u015a'), ('\u015d', '\u015c'), ('\u015f', '\u015e'), ('\u0161', '\u0160'), ('\u0163', '\u0162'), ('\u0165', '\u0164'), ('\u0167', '\u0166'), ('\u0169', '\u0168'), ('\u016b', '\u016a'), ('\u016d', '\u016c'), ('\u016f', '\u016e'), ('\u0171', '\u0170'), ('\u0173', '\u0172'), ('\u0175', '\u0174'), ('\u0177', '\u0176'), ('\u017a', '\u0179'), ('\u017c', '\u017b'), ('\u017e', '\u017d'), ('\u017f', '\x53'), ('\u0180', '\u0243'), ('\u0183', '\u0182'), ('\u0185', '\u0184'), ('\u0188', '\u0187'), ('\u018c', '\u018b'), ('\u0192', '\u0191'), ('\u0195', '\u01f6'), ('\u0199', '\u0198'), ('\u019a', '\u023d'), ('\u019e', '\u0220'), ('\u01a1', '\u01a0'), ('\u01a3', '\u01a2'), ('\u01a5', '\u01a4'), ('\u01a8', '\u01a7'), ('\u01ad', '\u01ac'), ('\u01b0', '\u01af'), ('\u01b4', '\u01b3'), ('\u01b6', '\u01b5'), ('\u01b9', '\u01b8'), ('\u01bd', '\u01bc'), ('\u01bf', '\u01f7'), ('\u01c6', '\u01c4'), ('\u01c9', '\u01c7'), ('\u01cc', '\u01ca'), ('\u01ce', '\u01cd'), ('\u01d0', '\u01cf'), ('\u01d2', '\u01d1'), ('\u01d4', '\u01d3'), ('\u01d6', '\u01d5'), ('\u01d8', '\u01d7'), ('\u01da', '\u01d9'), ('\u01dc', '\u01db'), ('\u01dd', '\u018e'), ('\u01df', '\u01de'), ('\u01e1', '\u01e0'), ('\u01e3', '\u01e2'), ('\u01e5', '\u01e4'), ('\u01e7', '\u01e6'), ('\u01e9', '\u01e8'), ('\u01eb', '\u01ea'), ('\u01ed', '\u01ec'), ('\u01ef', '\u01ee'), ('\u01f3', '\u01f1'), ('\u01f5', '\u01f4'), ('\u01f9', '\u01f8'), ('\u01fb', '\u01fa'), ('\u01fd', '\u01fc'), ('\u01ff', '\u01fe'), ('\u0201', '\u0200'), ('\u0203', '\u0202'), ('\u0205', '\u0204'), ('\u0207', '\u0206'), ('\u0209', '\u0208'), ('\u020b', '\u020a'), ('\u020d', '\u020c'), ('\u020f', '\u020e'), ('\u0211', '\u0210'), ('\u0213', '\u0212'), ('\u0215', '\u0214'), ('\u0217', '\u0216'), ('\u0219', '\u0218'), ('\u021b', '\u021a'), ('\u021d', '\u021c'), ('\u021f', '\u021e'), ('\u0223', '\u0222'), ('\u0225', '\u0224'), ('\u0227', '\u0226'), ('\u0229', '\u0228'), ('\u022b', '\u022a'), ('\u022d', '\u022c'), ('\u022f', '\u022e'), ('\u0231', '\u0230'), ('\u0233', '\u0232'), ('\u023c', '\u023b'), ('\u023f', '\u2c7e'), ('\u0240', '\u2c7f'), ('\u0242', '\u0241'), ('\u0247', '\u0246'), ('\u0249', '\u0248'), ('\u024b', '\u024a'), ('\u024d', '\u024c'), ('\u024f', '\u024e'), ('\u0250', '\u2c6f'), ('\u0251', '\u2c6d'), ('\u0252', '\u2c70'), ('\u0253', '\u0181'), ('\u0254', '\u0186'), ('\u0256', '\u0189'), ('\u0257', '\u018a'), ('\u0259', '\u018f'), ('\u025b', '\u0190'), ('\u025c', '\ua7ab'), ('\u0260', '\u0193'), ('\u0261', '\ua7ac'), ('\u0263', '\u0194'), ('\u0265', '\ua78d'), ('\u0266', '\ua7aa'), ('\u0268', '\u0197'), ('\u0269', '\u0196'), ('\u026b', '\u2c62'), ('\u026c', '\ua7ad'), ('\u026f', '\u019c'), ('\u0271', '\u2c6e'), ('\u0272', '\u019d'), ('\u0275', '\u019f'), ('\u027d', '\u2c64'), ('\u0280', '\u01a6'), ('\u0283', '\u01a9'), ('\u0287', '\ua7b1'), ('\u0288', '\u01ae'), ('\u0289', '\u0244'), ('\u028a', '\u01b1'), ('\u028b', '\u01b2'), ('\u028c', '\u0245'), ('\u0292', '\u01b7'), ('\u029e', '\ua7b0'), ('\u0371', '\u0370'), ('\u0373', '\u0372'), ('\u0377', '\u0376'), ('\u037b', '\u03fd'), ('\u037c', '\u03fe'), ('\u037d', '\u03ff'), ('\u03ac', '\u0386'), ('\u03ad', '\u0388'), ('\u03ae', '\u0389'), ('\u03af', '\u038a'), ('\u03b1', '\u0391'), ('\u03b2', '\u0392'), ('\u03b3', '\u0393'), ('\u03b4', '\u0394'), ('\u03b5', '\u0395'), ('\u03b6', '\u0396'), ('\u03b7', '\u0397'), ('\u03b8', '\u0398'), ('\u03b9', '\u0399'), ('\u03ba', '\u039a'), ('\u03bb', '\u039b'), ('\u03bc', '\u039c'), ('\u03bd', '\u039d'), ('\u03be', '\u039e'), ('\u03bf', '\u039f'), ('\u03c0', '\u03a0'), ('\u03c1', '\u03a1'), ('\u03c2', '\u03a3'), ('\u03c3', '\u03a3'), ('\u03c4', '\u03a4'), ('\u03c5', '\u03a5'), ('\u03c6', '\u03a6'), ('\u03c7', '\u03a7'), ('\u03c8', '\u03a8'), ('\u03c9', '\u03a9'), ('\u03ca', '\u03aa'), ('\u03cb', '\u03ab'), ('\u03cc', '\u038c'), ('\u03cd', '\u038e'), ('\u03ce', '\u038f'), ('\u03d0', '\u0392'), ('\u03d1', '\u0398'), ('\u03d5', '\u03a6'), ('\u03d6', '\u03a0'), ('\u03d7', '\u03cf'), ('\u03d9', '\u03d8'), ('\u03db', '\u03da'), ('\u03dd', '\u03dc'), ('\u03df', '\u03de'), ('\u03e1', '\u03e0'), ('\u03e3', '\u03e2'), ('\u03e5', '\u03e4'), ('\u03e7', '\u03e6'), ('\u03e9', '\u03e8'), ('\u03eb', '\u03ea'), ('\u03ed', '\u03ec'), ('\u03ef', '\u03ee'), ('\u03f0', '\u039a'), ('\u03f1', '\u03a1'), ('\u03f2', '\u03f9'), ('\u03f3', '\u037f'), ('\u03f5', '\u0395'), ('\u03f8', '\u03f7'), ('\u03fb', '\u03fa'), ('\u0430', '\u0410'), ('\u0431', '\u0411'), ('\u0432', '\u0412'), ('\u0433', '\u0413'), ('\u0434', '\u0414'), ('\u0435', '\u0415'), ('\u0436', '\u0416'), ('\u0437', '\u0417'), ('\u0438', '\u0418'), ('\u0439', '\u0419'), ('\u043a', '\u041a'), ('\u043b', '\u041b'), ('\u043c', '\u041c'), ('\u043d', '\u041d'), ('\u043e', '\u041e'), ('\u043f', '\u041f'), ('\u0440', '\u0420'), ('\u0441', '\u0421'), ('\u0442', '\u0422'), ('\u0443', '\u0423'), ('\u0444', '\u0424'), ('\u0445', '\u0425'), ('\u0446', '\u0426'), ('\u0447', '\u0427'), ('\u0448', '\u0428'), ('\u0449', '\u0429'), ('\u044a', '\u042a'), ('\u044b', '\u042b'), ('\u044c', '\u042c'), ('\u044d', '\u042d'), ('\u044e', '\u042e'), ('\u044f', '\u042f'), ('\u0450', '\u0400'), ('\u0451', '\u0401'), ('\u0452', '\u0402'), ('\u0453', '\u0403'), ('\u0454', '\u0404'), ('\u0455', '\u0405'), ('\u0456', '\u0406'), ('\u0457', '\u0407'), ('\u0458', '\u0408'), ('\u0459', '\u0409'), ('\u045a', '\u040a'), ('\u045b', '\u040b'), ('\u045c', '\u040c'), ('\u045d', '\u040d'), ('\u045e', '\u040e'), ('\u045f', '\u040f'), ('\u0461', '\u0460'), ('\u0463', '\u0462'), ('\u0465', '\u0464'), ('\u0467', '\u0466'), ('\u0469', '\u0468'), ('\u046b', '\u046a'), ('\u046d', '\u046c'), ('\u046f', '\u046e'), ('\u0471', '\u0470'), ('\u0473', '\u0472'), ('\u0475', '\u0474'), ('\u0477', '\u0476'), ('\u0479', '\u0478'), ('\u047b', '\u047a'), ('\u047d', '\u047c'), ('\u047f', '\u047e'), ('\u0481', '\u0480'), ('\u048b', '\u048a'), ('\u048d', '\u048c'), ('\u048f', '\u048e'), ('\u0491', '\u0490'), ('\u0493', '\u0492'), ('\u0495', '\u0494'), ('\u0497', '\u0496'), ('\u0499', '\u0498'), ('\u049b', '\u049a'), ('\u049d', '\u049c'), ('\u049f', '\u049e'), ('\u04a1', '\u04a0'), ('\u04a3', '\u04a2'), ('\u04a5', '\u04a4'), ('\u04a7', '\u04a6'), ('\u04a9', '\u04a8'), ('\u04ab', '\u04aa'), ('\u04ad', '\u04ac'), ('\u04af', '\u04ae'), ('\u04b1', '\u04b0'), ('\u04b3', '\u04b2'), ('\u04b5', '\u04b4'), ('\u04b7', '\u04b6'), ('\u04b9', '\u04b8'), ('\u04bb', '\u04ba'), ('\u04bd', '\u04bc'), ('\u04bf', '\u04be'), ('\u04c2', '\u04c1'), ('\u04c4', '\u04c3'), ('\u04c6', '\u04c5'), ('\u04c8', '\u04c7'), ('\u04ca', '\u04c9'), ('\u04cc', '\u04cb'), ('\u04ce', '\u04cd'), ('\u04cf', '\u04c0'), ('\u04d1', '\u04d0'), ('\u04d3', '\u04d2'), ('\u04d5', '\u04d4'), ('\u04d7', '\u04d6'), ('\u04d9', '\u04d8'), ('\u04db', '\u04da'), ('\u04dd', '\u04dc'), ('\u04df', '\u04de'), ('\u04e1', '\u04e0'), ('\u04e3', '\u04e2'), ('\u04e5', '\u04e4'), ('\u04e7', '\u04e6'), ('\u04e9', '\u04e8'), ('\u04eb', '\u04ea'), ('\u04ed', '\u04ec'), ('\u04ef', '\u04ee'), ('\u04f1', '\u04f0'), ('\u04f3', '\u04f2'), ('\u04f5', '\u04f4'), ('\u04f7', '\u04f6'), ('\u04f9', '\u04f8'), ('\u04fb', '\u04fa'), ('\u04fd', '\u04fc'), ('\u04ff', '\u04fe'), ('\u0501', '\u0500'), ('\u0503', '\u0502'), ('\u0505', '\u0504'), ('\u0507', '\u0506'), ('\u0509', '\u0508'), ('\u050b', '\u050a'), ('\u050d', '\u050c'), ('\u050f', '\u050e'), ('\u0511', '\u0510'), ('\u0513', '\u0512'), ('\u0515', '\u0514'), ('\u0517', '\u0516'), ('\u0519', '\u0518'), ('\u051b', '\u051a'), ('\u051d', '\u051c'), ('\u051f', '\u051e'), ('\u0521', '\u0520'), ('\u0523', '\u0522'), ('\u0525', '\u0524'), ('\u0527', '\u0526'), ('\u0529', '\u0528'), ('\u052b', '\u052a'), ('\u052d', '\u052c'), ('\u052f', '\u052e'), ('\u0561', '\u0531'), ('\u0562', '\u0532'), ('\u0563', '\u0533'), ('\u0564', '\u0534'), ('\u0565', '\u0535'), ('\u0566', '\u0536'), ('\u0567', '\u0537'), ('\u0568', '\u0538'), ('\u0569', '\u0539'), ('\u056a', '\u053a'), ('\u056b', '\u053b'), ('\u056c', '\u053c'), ('\u056d', '\u053d'), ('\u056e', '\u053e'), ('\u056f', '\u053f'), ('\u0570', '\u0540'), ('\u0571', '\u0541'), ('\u0572', '\u0542'), ('\u0573', '\u0543'), ('\u0574', '\u0544'), ('\u0575', '\u0545'), ('\u0576', '\u0546'), ('\u0577', '\u0547'), ('\u0578', '\u0548'), ('\u0579', '\u0549'), ('\u057a', '\u054a'), ('\u057b', '\u054b'), ('\u057c', '\u054c'), ('\u057d', '\u054d'), ('\u057e', '\u054e'), ('\u057f', '\u054f'), ('\u0580', '\u0550'), ('\u0581', '\u0551'), ('\u0582', '\u0552'), ('\u0583', '\u0553'), ('\u0584', '\u0554'), ('\u0585', '\u0555'), ('\u0586', '\u0556'), ('\u1d79', '\ua77d'), ('\u1d7d', '\u2c63'), ('\u1e01', '\u1e00'), ('\u1e03', '\u1e02'), ('\u1e05', '\u1e04'), ('\u1e07', '\u1e06'), ('\u1e09', '\u1e08'), ('\u1e0b', '\u1e0a'), ('\u1e0d', '\u1e0c'), ('\u1e0f', '\u1e0e'), ('\u1e11', '\u1e10'), ('\u1e13', '\u1e12'), ('\u1e15', '\u1e14'), ('\u1e17', '\u1e16'), ('\u1e19', '\u1e18'), ('\u1e1b', '\u1e1a'), ('\u1e1d', '\u1e1c'), ('\u1e1f', '\u1e1e'), ('\u1e21', '\u1e20'), ('\u1e23', '\u1e22'), ('\u1e25', '\u1e24'), ('\u1e27', '\u1e26'), ('\u1e29', '\u1e28'), ('\u1e2b', '\u1e2a'), ('\u1e2d', '\u1e2c'), ('\u1e2f', '\u1e2e'), ('\u1e31', '\u1e30'), ('\u1e33', '\u1e32'), ('\u1e35', '\u1e34'), ('\u1e37', '\u1e36'), ('\u1e39', '\u1e38'), ('\u1e3b', '\u1e3a'), ('\u1e3d', '\u1e3c'), ('\u1e3f', '\u1e3e'), ('\u1e41', '\u1e40'), ('\u1e43', '\u1e42'), ('\u1e45', '\u1e44'), ('\u1e47', '\u1e46'), ('\u1e49', '\u1e48'), ('\u1e4b', '\u1e4a'), ('\u1e4d', '\u1e4c'), ('\u1e4f', '\u1e4e'), ('\u1e51', '\u1e50'), ('\u1e53', '\u1e52'), ('\u1e55', '\u1e54'), ('\u1e57', '\u1e56'), ('\u1e59', '\u1e58'), ('\u1e5b', '\u1e5a'), ('\u1e5d', '\u1e5c'), ('\u1e5f', '\u1e5e'), ('\u1e61', '\u1e60'), ('\u1e63', '\u1e62'), ('\u1e65', '\u1e64'), ('\u1e67', '\u1e66'), ('\u1e69', '\u1e68'), ('\u1e6b', '\u1e6a'), ('\u1e6d', '\u1e6c'), ('\u1e6f', '\u1e6e'), ('\u1e71', '\u1e70'), ('\u1e73', '\u1e72'), ('\u1e75', '\u1e74'), ('\u1e77', '\u1e76'), ('\u1e79', '\u1e78'), ('\u1e7b', '\u1e7a'), ('\u1e7d', '\u1e7c'), ('\u1e7f', '\u1e7e'), ('\u1e81', '\u1e80'), ('\u1e83', '\u1e82'), ('\u1e85', '\u1e84'), ('\u1e87', '\u1e86'), ('\u1e89', '\u1e88'), ('\u1e8b', '\u1e8a'), ('\u1e8d', '\u1e8c'), ('\u1e8f', '\u1e8e'), ('\u1e91', '\u1e90'), ('\u1e93', '\u1e92'), ('\u1e95', '\u1e94'), ('\u1e9b', '\u1e60'), ('\u1ea1', '\u1ea0'), ('\u1ea3', '\u1ea2'), ('\u1ea5', '\u1ea4'), ('\u1ea7', '\u1ea6'), ('\u1ea9', '\u1ea8'), ('\u1eab', '\u1eaa'), ('\u1ead', '\u1eac'), ('\u1eaf', '\u1eae'), ('\u1eb1', '\u1eb0'), ('\u1eb3', '\u1eb2'), ('\u1eb5', '\u1eb4'), ('\u1eb7', '\u1eb6'), ('\u1eb9', '\u1eb8'), ('\u1ebb', '\u1eba'), ('\u1ebd', '\u1ebc'), ('\u1ebf', '\u1ebe'), ('\u1ec1', '\u1ec0'), ('\u1ec3', '\u1ec2'), ('\u1ec5', '\u1ec4'), ('\u1ec7', '\u1ec6'), ('\u1ec9', '\u1ec8'), ('\u1ecb', '\u1eca'), ('\u1ecd', '\u1ecc'), ('\u1ecf', '\u1ece'), ('\u1ed1', '\u1ed0'), ('\u1ed3', '\u1ed2'), ('\u1ed5', '\u1ed4'), ('\u1ed7', '\u1ed6'), ('\u1ed9', '\u1ed8'), ('\u1edb', '\u1eda'), ('\u1edd', '\u1edc'), ('\u1edf', '\u1ede'), ('\u1ee1', '\u1ee0'), ('\u1ee3', '\u1ee2'), ('\u1ee5', '\u1ee4'), ('\u1ee7', '\u1ee6'), ('\u1ee9', '\u1ee8'), ('\u1eeb', '\u1eea'), ('\u1eed', '\u1eec'), ('\u1eef', '\u1eee'), ('\u1ef1', '\u1ef0'), ('\u1ef3', '\u1ef2'), ('\u1ef5', '\u1ef4'), ('\u1ef7', '\u1ef6'), ('\u1ef9', '\u1ef8'), ('\u1efb', '\u1efa'), ('\u1efd', '\u1efc'), ('\u1eff', '\u1efe'), ('\u1f00', '\u1f08'), ('\u1f01', '\u1f09'), ('\u1f02', '\u1f0a'), ('\u1f03', '\u1f0b'), ('\u1f04', '\u1f0c'), ('\u1f05', '\u1f0d'), ('\u1f06', '\u1f0e'), ('\u1f07', '\u1f0f'), ('\u1f10', '\u1f18'), ('\u1f11', '\u1f19'), ('\u1f12', '\u1f1a'), ('\u1f13', '\u1f1b'), ('\u1f14', '\u1f1c'), ('\u1f15', '\u1f1d'), ('\u1f20', '\u1f28'), ('\u1f21', '\u1f29'), ('\u1f22', '\u1f2a'), ('\u1f23', '\u1f2b'), ('\u1f24', '\u1f2c'), ('\u1f25', '\u1f2d'), ('\u1f26', '\u1f2e'), ('\u1f27', '\u1f2f'), ('\u1f30', '\u1f38'), ('\u1f31', '\u1f39'), ('\u1f32', '\u1f3a'), ('\u1f33', '\u1f3b'), ('\u1f34', '\u1f3c'), ('\u1f35', '\u1f3d'), ('\u1f36', '\u1f3e'), ('\u1f37', '\u1f3f'), ('\u1f40', '\u1f48'), ('\u1f41', '\u1f49'), ('\u1f42', '\u1f4a'), ('\u1f43', '\u1f4b'), ('\u1f44', '\u1f4c'), ('\u1f45', '\u1f4d'), ('\u1f51', '\u1f59'), ('\u1f53', '\u1f5b'), ('\u1f55', '\u1f5d'), ('\u1f57', '\u1f5f'), ('\u1f60', '\u1f68'), ('\u1f61', '\u1f69'), ('\u1f62', '\u1f6a'), ('\u1f63', '\u1f6b'), ('\u1f64', '\u1f6c'), ('\u1f65', '\u1f6d'), ('\u1f66', '\u1f6e'), ('\u1f67', '\u1f6f'), ('\u1f70', '\u1fba'), ('\u1f71', '\u1fbb'), ('\u1f72', '\u1fc8'), ('\u1f73', '\u1fc9'), ('\u1f74', '\u1fca'), ('\u1f75', '\u1fcb'), ('\u1f76', '\u1fda'), ('\u1f77', '\u1fdb'), ('\u1f78', '\u1ff8'), ('\u1f79', '\u1ff9'), ('\u1f7a', '\u1fea'), ('\u1f7b', '\u1feb'), ('\u1f7c', '\u1ffa'), ('\u1f7d', '\u1ffb'), ('\u1f80', '\u1f88'), ('\u1f81', '\u1f89'), ('\u1f82', '\u1f8a'), ('\u1f83', '\u1f8b'), ('\u1f84', '\u1f8c'), ('\u1f85', '\u1f8d'), ('\u1f86', '\u1f8e'), ('\u1f87', '\u1f8f'), ('\u1f90', '\u1f98'), ('\u1f91', '\u1f99'), ('\u1f92', '\u1f9a'), ('\u1f93', '\u1f9b'), ('\u1f94', '\u1f9c'), ('\u1f95', '\u1f9d'), ('\u1f96', '\u1f9e'), ('\u1f97', '\u1f9f'), ('\u1fa0', '\u1fa8'), ('\u1fa1', '\u1fa9'), ('\u1fa2', '\u1faa'), ('\u1fa3', '\u1fab'), ('\u1fa4', '\u1fac'), ('\u1fa5', '\u1fad'), ('\u1fa6', '\u1fae'), ('\u1fa7', '\u1faf'), ('\u1fb0', '\u1fb8'), ('\u1fb1', '\u1fb9'), ('\u1fb3', '\u1fbc'), ('\u1fbe', '\u0399'), ('\u1fc3', '\u1fcc'), ('\u1fd0', '\u1fd8'), ('\u1fd1', '\u1fd9'), ('\u1fe0', '\u1fe8'), ('\u1fe1', '\u1fe9'), ('\u1fe5', '\u1fec'), ('\u1ff3', '\u1ffc'), ('\u214e', '\u2132'), ('\u2184', '\u2183'), ('\u2c30', '\u2c00'), ('\u2c31', '\u2c01'), ('\u2c32', '\u2c02'), ('\u2c33', '\u2c03'), ('\u2c34', '\u2c04'), ('\u2c35', '\u2c05'), ('\u2c36', '\u2c06'), ('\u2c37', '\u2c07'), ('\u2c38', '\u2c08'), ('\u2c39', '\u2c09'), ('\u2c3a', '\u2c0a'), ('\u2c3b', '\u2c0b'), ('\u2c3c', '\u2c0c'), ('\u2c3d', '\u2c0d'), ('\u2c3e', '\u2c0e'), ('\u2c3f', '\u2c0f'), ('\u2c40', '\u2c10'), ('\u2c41', '\u2c11'), ('\u2c42', '\u2c12'), ('\u2c43', '\u2c13'), ('\u2c44', '\u2c14'), ('\u2c45', '\u2c15'), ('\u2c46', '\u2c16'), ('\u2c47', '\u2c17'), ('\u2c48', '\u2c18'), ('\u2c49', '\u2c19'), ('\u2c4a', '\u2c1a'), ('\u2c4b', '\u2c1b'), ('\u2c4c', '\u2c1c'), ('\u2c4d', '\u2c1d'), ('\u2c4e', '\u2c1e'), ('\u2c4f', '\u2c1f'), ('\u2c50', '\u2c20'), ('\u2c51', '\u2c21'), ('\u2c52', '\u2c22'), ('\u2c53', '\u2c23'), ('\u2c54', '\u2c24'), ('\u2c55', '\u2c25'), ('\u2c56', '\u2c26'), ('\u2c57', '\u2c27'), ('\u2c58', '\u2c28'), ('\u2c59', '\u2c29'), ('\u2c5a', '\u2c2a'), ('\u2c5b', '\u2c2b'), ('\u2c5c', '\u2c2c'), ('\u2c5d', '\u2c2d'), ('\u2c5e', '\u2c2e'), ('\u2c61', '\u2c60'), ('\u2c65', '\u023a'), ('\u2c66', '\u023e'), ('\u2c68', '\u2c67'), ('\u2c6a', '\u2c69'), ('\u2c6c', '\u2c6b'), ('\u2c73', '\u2c72'), ('\u2c76', '\u2c75'), ('\u2c81', '\u2c80'), ('\u2c83', '\u2c82'), ('\u2c85', '\u2c84'), ('\u2c87', '\u2c86'), ('\u2c89', '\u2c88'), ('\u2c8b', '\u2c8a'), ('\u2c8d', '\u2c8c'), ('\u2c8f', '\u2c8e'), ('\u2c91', '\u2c90'), ('\u2c93', '\u2c92'), ('\u2c95', '\u2c94'), ('\u2c97', '\u2c96'), ('\u2c99', '\u2c98'), ('\u2c9b', '\u2c9a'), ('\u2c9d', '\u2c9c'), ('\u2c9f', '\u2c9e'), ('\u2ca1', '\u2ca0'), ('\u2ca3', '\u2ca2'), ('\u2ca5', '\u2ca4'), ('\u2ca7', '\u2ca6'), ('\u2ca9', '\u2ca8'), ('\u2cab', '\u2caa'), ('\u2cad', '\u2cac'), ('\u2caf', '\u2cae'), ('\u2cb1', '\u2cb0'), ('\u2cb3', '\u2cb2'), ('\u2cb5', '\u2cb4'), ('\u2cb7', '\u2cb6'), ('\u2cb9', '\u2cb8'), ('\u2cbb', '\u2cba'), ('\u2cbd', '\u2cbc'), ('\u2cbf', '\u2cbe'), ('\u2cc1', '\u2cc0'), ('\u2cc3', '\u2cc2'), ('\u2cc5', '\u2cc4'), ('\u2cc7', '\u2cc6'), ('\u2cc9', '\u2cc8'), ('\u2ccb', '\u2cca'), ('\u2ccd', '\u2ccc'), ('\u2ccf', '\u2cce'), ('\u2cd1', '\u2cd0'), ('\u2cd3', '\u2cd2'), ('\u2cd5', '\u2cd4'), ('\u2cd7', '\u2cd6'), ('\u2cd9', '\u2cd8'), ('\u2cdb', '\u2cda'), ('\u2cdd', '\u2cdc'), ('\u2cdf', '\u2cde'), ('\u2ce1', '\u2ce0'), ('\u2ce3', '\u2ce2'), ('\u2cec', '\u2ceb'), ('\u2cee', '\u2ced'), ('\u2cf3', '\u2cf2'), ('\u2d00', '\u10a0'), ('\u2d01', '\u10a1'), ('\u2d02', '\u10a2'), ('\u2d03', '\u10a3'), ('\u2d04', '\u10a4'), ('\u2d05', '\u10a5'), ('\u2d06', '\u10a6'), ('\u2d07', '\u10a7'), ('\u2d08', '\u10a8'), ('\u2d09', '\u10a9'), ('\u2d0a', '\u10aa'), ('\u2d0b', '\u10ab'), ('\u2d0c', '\u10ac'), ('\u2d0d', '\u10ad'), ('\u2d0e', '\u10ae'), ('\u2d0f', '\u10af'), ('\u2d10', '\u10b0'), ('\u2d11', '\u10b1'), ('\u2d12', '\u10b2'), ('\u2d13', '\u10b3'), ('\u2d14', '\u10b4'), ('\u2d15', '\u10b5'), ('\u2d16', '\u10b6'), ('\u2d17', '\u10b7'), ('\u2d18', '\u10b8'), ('\u2d19', '\u10b9'), ('\u2d1a', '\u10ba'), ('\u2d1b', '\u10bb'), ('\u2d1c', '\u10bc'), ('\u2d1d', '\u10bd'), ('\u2d1e', '\u10be'), ('\u2d1f', '\u10bf'), ('\u2d20', '\u10c0'), ('\u2d21', '\u10c1'), ('\u2d22', '\u10c2'), ('\u2d23', '\u10c3'), ('\u2d24', '\u10c4'), ('\u2d25', '\u10c5'), ('\u2d27', '\u10c7'), ('\u2d2d', '\u10cd'), ('\ua641', '\ua640'), ('\ua643', '\ua642'), ('\ua645', '\ua644'), ('\ua647', '\ua646'), ('\ua649', '\ua648'), ('\ua64b', '\ua64a'), ('\ua64d', '\ua64c'), ('\ua64f', '\ua64e'), ('\ua651', '\ua650'), ('\ua653', '\ua652'), ('\ua655', '\ua654'), ('\ua657', '\ua656'), ('\ua659', '\ua658'), ('\ua65b', '\ua65a'), ('\ua65d', '\ua65c'), ('\ua65f', '\ua65e'), ('\ua661', '\ua660'), ('\ua663', '\ua662'), ('\ua665', '\ua664'), ('\ua667', '\ua666'), ('\ua669', '\ua668'), ('\ua66b', '\ua66a'), ('\ua66d', '\ua66c'), ('\ua681', '\ua680'), ('\ua683', '\ua682'), ('\ua685', '\ua684'), ('\ua687', '\ua686'), ('\ua689', '\ua688'), ('\ua68b', '\ua68a'), ('\ua68d', '\ua68c'), ('\ua68f', '\ua68e'), ('\ua691', '\ua690'), ('\ua693', '\ua692'), ('\ua695', '\ua694'), ('\ua697', '\ua696'), ('\ua699', '\ua698'), ('\ua69b', '\ua69a'), ('\ua723', '\ua722'), ('\ua725', '\ua724'), ('\ua727', '\ua726'), ('\ua729', '\ua728'), ('\ua72b', '\ua72a'), ('\ua72d', '\ua72c'), ('\ua72f', '\ua72e'), ('\ua733', '\ua732'), ('\ua735', '\ua734'), ('\ua737', '\ua736'), ('\ua739', '\ua738'), ('\ua73b', '\ua73a'), ('\ua73d', '\ua73c'), ('\ua73f', '\ua73e'), ('\ua741', '\ua740'), ('\ua743', '\ua742'), ('\ua745', '\ua744'), ('\ua747', '\ua746'), ('\ua749', '\ua748'), ('\ua74b', '\ua74a'), ('\ua74d', '\ua74c'), ('\ua74f', '\ua74e'), ('\ua751', '\ua750'), ('\ua753', '\ua752'), ('\ua755', '\ua754'), ('\ua757', '\ua756'), ('\ua759', '\ua758'), ('\ua75b', '\ua75a'), ('\ua75d', '\ua75c'), ('\ua75f', '\ua75e'), ('\ua761', '\ua760'), ('\ua763', '\ua762'), ('\ua765', '\ua764'), ('\ua767', '\ua766'), ('\ua769', '\ua768'), ('\ua76b', '\ua76a'), ('\ua76d', '\ua76c'), ('\ua76f', '\ua76e'), ('\ua77a', '\ua779'), ('\ua77c', '\ua77b'), ('\ua77f', '\ua77e'), ('\ua781', '\ua780'), ('\ua783', '\ua782'), ('\ua785', '\ua784'), ('\ua787', '\ua786'), ('\ua78c', '\ua78b'), ('\ua791', '\ua790'), ('\ua793', '\ua792'), ('\ua797', '\ua796'), ('\ua799', '\ua798'), ('\ua79b', '\ua79a'), ('\ua79d', '\ua79c'), ('\ua79f', '\ua79e'), ('\ua7a1', '\ua7a0'), ('\ua7a3', '\ua7a2'), ('\ua7a5', '\ua7a4'), ('\ua7a7', '\ua7a6'), ('\ua7a9', '\ua7a8'), ('\uff41', '\uff21'), ('\uff42', '\uff22'), ('\uff43', '\uff23'), ('\uff44', '\uff24'), ('\uff45', '\uff25'), ('\uff46', '\uff26'), ('\uff47', '\uff27'), ('\uff48', '\uff28'), ('\uff49', '\uff29'), ('\uff4a', '\uff2a'), ('\uff4b', '\uff2b'), ('\uff4c', '\uff2c'), ('\uff4d', '\uff2d'), ('\uff4e', '\uff2e'), ('\uff4f', '\uff2f'), ('\uff50', '\uff30'), ('\uff51', '\uff31'), ('\uff52', '\uff32'), ('\uff53', '\uff33'), ('\uff54', '\uff34'), ('\uff55', '\uff35'), ('\uff56', '\uff36'), ('\uff57', '\uff37'), ('\uff58', '\uff38'), ('\uff59', '\uff39'), ('\uff5a', '\uff3a'), ('\U00010428', '\U00010400'), ('\U00010429', '\U00010401'), ('\U0001042a', '\U00010402'), ('\U0001042b', '\U00010403'), ('\U0001042c', '\U00010404'), ('\U0001042d', '\U00010405'), ('\U0001042e', '\U00010406'), ('\U0001042f', '\U00010407'), ('\U00010430', '\U00010408'), ('\U00010431', '\U00010409'), ('\U00010432', '\U0001040a'), ('\U00010433', '\U0001040b'), ('\U00010434', '\U0001040c'), ('\U00010435', '\U0001040d'), ('\U00010436', '\U0001040e'), ('\U00010437', '\U0001040f'), ('\U00010438', '\U00010410'), ('\U00010439', '\U00010411'), ('\U0001043a', '\U00010412'), ('\U0001043b', '\U00010413'), ('\U0001043c', '\U00010414'), ('\U0001043d', '\U00010415'), ('\U0001043e', '\U00010416'), ('\U0001043f', '\U00010417'), ('\U00010440', '\U00010418'), ('\U00010441', '\U00010419'), ('\U00010442', '\U0001041a'), ('\U00010443', '\U0001041b'), ('\U00010444', '\U0001041c'), ('\U00010445', '\U0001041d'), ('\U00010446', '\U0001041e'), ('\U00010447', '\U0001041f'), ('\U00010448', '\U00010420'), ('\U00010449', '\U00010421'), ('\U0001044a', '\U00010422'), ('\U0001044b', '\U00010423'), ('\U0001044c', '\U00010424'), ('\U0001044d', '\U00010425'), ('\U0001044e', '\U00010426'), ('\U0001044f', '\U00010427'), ('\U000118c0', '\U000118a0'), ('\U000118c1', '\U000118a1'), ('\U000118c2', '\U000118a2'), ('\U000118c3', '\U000118a3'), ('\U000118c4', '\U000118a4'), ('\U000118c5', '\U000118a5'), ('\U000118c6', '\U000118a6'), ('\U000118c7', '\U000118a7'), ('\U000118c8', '\U000118a8'), ('\U000118c9', '\U000118a9'), ('\U000118ca', '\U000118aa'), ('\U000118cb', '\U000118ab'), ('\U000118cc', '\U000118ac'), ('\U000118cd', '\U000118ad'), ('\U000118ce', '\U000118ae'), ('\U000118cf', '\U000118af'), ('\U000118d0', '\U000118b0'), ('\U000118d1', '\U000118b1'), ('\U000118d2', '\U000118b2'), ('\U000118d3', '\U000118b3'), ('\U000118d4', '\U000118b4'), ('\U000118d5', '\U000118b5'), ('\U000118d6', '\U000118b6'), ('\U000118d7', '\U000118b7'), ('\U000118d8', '\U000118b8'), ('\U000118d9', '\U000118b9'), ('\U000118da', '\U000118ba'), ('\U000118db', '\U000118bb'), ('\U000118dc', '\U000118bc'), ('\U000118dd', '\U000118bd'), ('\U000118de', '\U000118be'), ('\U000118df', '\U000118bf') ]; } pub mod charwidth { use core::option::{Option, Some, None}; use core::slice::SlicePrelude; use core::slice; fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 { use core::cmp::{Equal, Less, Greater}; match r.binary_search(|&(lo, hi, _, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { slice::Found(idx) => { let (_, _, r_ncjk, r_cjk) = r[idx]; if is_cjk { r_cjk } else { r_ncjk } } slice::NotFound(_) => 1 } } pub fn width(c: char, is_cjk: bool) -> Option<uint> { match c as uint { _c @ 0 => Some(0), // null is zero width cu if cu < 0x20 => None, // control sequences have no width cu if cu < 0x7F => Some(1), // ASCII cu if cu < 0xA0 => None, // more control sequences _ => Some(bsearch_range_value_table(c, is_cjk, charwidth_table) as uint) } } // character width table. Based on Markus Kuhn's free wcwidth() implementation, // http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c static charwidth_table: &'static [(char, char, u8, u8)] = &[ ('\u00a1', '\u00a1', 1, 2), ('\u00a4', '\u00a4', 1, 2), ('\u00a7', '\u00a8', 1, 2), ('\u00aa', '\u00aa', 1, 2), ('\u00ae', '\u00ae', 1, 2), ('\u00b0', '\u00b4', 1, 2), ('\u00b6', '\u00ba', 1, 2), ('\u00bc', '\u00bf', 1, 2), ('\u00c6', '\u00c6', 1, 2), ('\u00d0', '\u00d0', 1, 2), ('\u00d7', '\u00d8', 1, 2), ('\u00de', '\u00e1', 1, 2), ('\u00e6', '\u00e6', 1, 2), ('\u00e8', '\u00ea', 1, 2), ('\u00ec', '\u00ed', 1, 2), ('\u00f0', '\u00f0', 1, 2), ('\u00f2', '\u00f3', 1, 2), ('\u00f7', '\u00fa', 1, 2), ('\u00fc', '\u00fc', 1, 2), ('\u00fe', '\u00fe', 1, 2), ('\u0101', '\u0101', 1, 2), ('\u0111', '\u0111', 1, 2), ('\u0113', '\u0113', 1, 2), ('\u011b', '\u011b', 1, 2), ('\u0126', '\u0127', 1, 2), ('\u012b', '\u012b', 1, 2), ('\u0131', '\u0133', 1, 2), ('\u0138', '\u0138', 1, 2), ('\u013f', '\u0142', 1, 2), ('\u0144', '\u0144', 1, 2), ('\u0148', '\u014b', 1, 2), ('\u014d', '\u014d', 1, 2), ('\u0152', '\u0153', 1, 2), ('\u0166', '\u0167', 1, 2), ('\u016b', '\u016b', 1, 2), ('\u01ce', '\u01ce', 1, 2), ('\u01d0', '\u01d0', 1, 2), ('\u01d2', '\u01d2', 1, 2), ('\u01d4', '\u01d4', 1, 2), ('\u01d6', '\u01d6', 1, 2), ('\u01d8', '\u01d8', 1, 2), ('\u01da', '\u01da', 1, 2), ('\u01dc', '\u01dc', 1, 2), ('\u0251', '\u0251', 1, 2), ('\u0261', '\u0261', 1, 2), ('\u02c4', '\u02c4', 1, 2), ('\u02c7', '\u02c7', 1, 2), ('\u02c9', '\u02cb', 1, 2), ('\u02cd', '\u02cd', 1, 2), ('\u02d0', '\u02d0', 1, 2), ('\u02d8', '\u02db', 1, 2), ('\u02dd', '\u02dd', 1, 2), ('\u02df', '\u02df', 1, 2), ('\u0300', '\u036f', 0, 0), ('\u0391', '\u03a1', 1, 2), ('\u03a3', '\u03a9', 1, 2), ('\u03b1', '\u03c1', 1, 2), ('\u03c3', '\u03c9', 1, 2), ('\u0401', '\u0401', 1, 2), ('\u0410', '\u044f', 1, 2), ('\u0451', '\u0451', 1, 2), ('\u0483', '\u0489', 0, 0), ('\u0591', '\u05bd', 0, 0), ('\u05bf', '\u05bf', 0, 0), ('\u05c1', '\u05c2', 0, 0), ('\u05c4', '\u05c5', 0, 0), ('\u05c7', '\u05c7', 0, 0), ('\u0600', '\u0605', 0, 0), ('\u0610', '\u061a', 0, 0), ('\u061c', '\u061c', 0, 0), ('\u064b', '\u065f', 0, 0), ('\u0670', '\u0670', 0, 0), ('\u06d6', '\u06dd', 0, 0), ('\u06df', '\u06e4', 0, 0), ('\u06e7', '\u06e8', 0, 0), ('\u06ea', '\u06ed', 0, 0), ('\u070f', '\u070f', 0, 0), ('\u0711', '\u0711', 0, 0), ('\u0730', '\u074a', 0, 0), ('\u07a6', '\u07b0', 0, 0), ('\u07eb', '\u07f3', 0, 0), ('\u0816', '\u0819', 0, 0), ('\u081b', '\u0823', 0, 0), ('\u0825', '\u0827', 0, 0), ('\u0829', '\u082d', 0, 0), ('\u0859', '\u085b', 0, 0), ('\u08e4', '\u0902', 0, 0), ('\u093a', '\u093a', 0, 0), ('\u093c', '\u093c', 0, 0), ('\u0941', '\u0948', 0, 0), ('\u094d', '\u094d', 0, 0), ('\u0951', '\u0957', 0, 0), ('\u0962', '\u0963', 0, 0), ('\u0981', '\u0981', 0, 0), ('\u09bc', '\u09bc', 0, 0), ('\u09c1', '\u09c4', 0, 0), ('\u09cd', '\u09cd', 0, 0), ('\u09e2', '\u09e3', 0, 0), ('\u0a01', '\u0a02', 0, 0), ('\u0a3c', '\u0a3c', 0, 0), ('\u0a41', '\u0a42', 0, 0), ('\u0a47', '\u0a48', 0, 0), ('\u0a4b', '\u0a4d', 0, 0), ('\u0a51', '\u0a51', 0, 0), ('\u0a70', '\u0a71', 0, 0), ('\u0a75', '\u0a75', 0, 0), ('\u0a81', '\u0a82', 0, 0), ('\u0abc', '\u0abc', 0, 0), ('\u0ac1', '\u0ac5', 0, 0), ('\u0ac7', '\u0ac8', 0, 0), ('\u0acd', '\u0acd', 0, 0), ('\u0ae2', '\u0ae3', 0, 0), ('\u0b01', '\u0b01', 0, 0), ('\u0b3c', '\u0b3c', 0, 0), ('\u0b3f', '\u0b3f', 0, 0), ('\u0b41', '\u0b44', 0, 0), ('\u0b4d', '\u0b4d', 0, 0), ('\u0b56', '\u0b56', 0, 0), ('\u0b62', '\u0b63', 0, 0), ('\u0b82', '\u0b82', 0, 0), ('\u0bc0', '\u0bc0', 0, 0), ('\u0bcd', '\u0bcd', 0, 0), ('\u0c00', '\u0c00', 0, 0), ('\u0c3e', '\u0c40', 0, 0), ('\u0c46', '\u0c48', 0, 0), ('\u0c4a', '\u0c4d', 0, 0), ('\u0c55', '\u0c56', 0, 0), ('\u0c62', '\u0c63', 0, 0), ('\u0c81', '\u0c81', 0, 0), ('\u0cbc', '\u0cbc', 0, 0), ('\u0cbf', '\u0cbf', 0, 0), ('\u0cc6', '\u0cc6', 0, 0), ('\u0ccc', '\u0ccd', 0, 0), ('\u0ce2', '\u0ce3', 0, 0), ('\u0d01', '\u0d01', 0, 0), ('\u0d41', '\u0d44', 0, 0), ('\u0d4d', '\u0d4d', 0, 0), ('\u0d62', '\u0d63', 0, 0), ('\u0dca', '\u0dca', 0, 0), ('\u0dd2', '\u0dd4', 0, 0), ('\u0dd6', '\u0dd6', 0, 0), ('\u0e31', '\u0e31', 0, 0), ('\u0e34', '\u0e3a', 0, 0), ('\u0e47', '\u0e4e', 0, 0), ('\u0eb1', '\u0eb1', 0, 0), ('\u0eb4', '\u0eb9', 0, 0), ('\u0ebb', '\u0ebc', 0, 0), ('\u0ec8', '\u0ecd', 0, 0), ('\u0f18', '\u0f19', 0, 0), ('\u0f35', '\u0f35', 0, 0), ('\u0f37', '\u0f37', 0, 0), ('\u0f39', '\u0f39', 0, 0), ('\u0f71', '\u0f7e', 0, 0), ('\u0f80', '\u0f84', 0, 0), ('\u0f86', '\u0f87', 0, 0), ('\u0f8d', '\u0f97', 0, 0), ('\u0f99', '\u0fbc', 0, 0), ('\u0fc6', '\u0fc6', 0, 0), ('\u102d', '\u1030', 0, 0), ('\u1032', '\u1037', 0, 0), ('\u1039', '\u103a', 0, 0), ('\u103d', '\u103e', 0, 0), ('\u1058', '\u1059', 0, 0), ('\u105e', '\u1060', 0, 0), ('\u1071', '\u1074', 0, 0), ('\u1082', '\u1082', 0, 0), ('\u1085', '\u1086', 0, 0), ('\u108d', '\u108d', 0, 0), ('\u109d', '\u109d', 0, 0), ('\u1100', '\u115f', 2, 2), ('\u1160', '\u11ff', 0, 0), ('\u135d', '\u135f', 0, 0), ('\u1712', '\u1714', 0, 0), ('\u1732', '\u1734', 0, 0), ('\u1752', '\u1753', 0, 0), ('\u1772', '\u1773', 0, 0), ('\u17b4', '\u17b5', 0, 0), ('\u17b7', '\u17bd', 0, 0), ('\u17c6', '\u17c6', 0, 0), ('\u17c9', '\u17d3', 0, 0), ('\u17dd', '\u17dd', 0, 0), ('\u180b', '\u180e', 0, 0), ('\u18a9', '\u18a9', 0, 0), ('\u1920', '\u1922', 0, 0), ('\u1927', '\u1928', 0, 0), ('\u1932', '\u1932', 0, 0), ('\u1939', '\u193b', 0, 0), ('\u1a17', '\u1a18', 0, 0), ('\u1a1b', '\u1a1b', 0, 0), ('\u1a56', '\u1a56', 0, 0), ('\u1a58', '\u1a5e', 0, 0), ('\u1a60', '\u1a60', 0, 0), ('\u1a62', '\u1a62', 0, 0), ('\u1a65', '\u1a6c', 0, 0), ('\u1a73', '\u1a7c', 0, 0), ('\u1a7f', '\u1a7f', 0, 0), ('\u1ab0', '\u1abe', 0, 0), ('\u1b00', '\u1b03', 0, 0), ('\u1b34', '\u1b34', 0, 0), ('\u1b36', '\u1b3a', 0, 0), ('\u1b3c', '\u1b3c', 0, 0), ('\u1b42', '\u1b42', 0, 0), ('\u1b6b', '\u1b73', 0, 0), ('\u1b80', '\u1b81', 0, 0), ('\u1ba2', '\u1ba5', 0, 0), ('\u1ba8', '\u1ba9', 0, 0), ('\u1bab', '\u1bad', 0, 0), ('\u1be6', '\u1be6', 0, 0), ('\u1be8', '\u1be9', 0, 0), ('\u1bed', '\u1bed', 0, 0), ('\u1bef', '\u1bf1', 0, 0), ('\u1c2c', '\u1c33', 0, 0), ('\u1c36', '\u1c37', 0, 0), ('\u1cd0', '\u1cd2', 0, 0), ('\u1cd4', '\u1ce0', 0, 0), ('\u1ce2', '\u1ce8', 0, 0), ('\u1ced', '\u1ced', 0, 0), ('\u1cf4', '\u1cf4', 0, 0), ('\u1cf8', '\u1cf9', 0, 0), ('\u1dc0', '\u1df5', 0, 0), ('\u1dfc', '\u1dff', 0, 0), ('\u200b', '\u200f', 0, 0), ('\u2010', '\u2010', 1, 2), ('\u2013', '\u2016', 1, 2), ('\u2018', '\u2019', 1, 2), ('\u201c', '\u201d', 1, 2), ('\u2020', '\u2022', 1, 2), ('\u2024', '\u2027', 1, 2), ('\u202a', '\u202e', 0, 0), ('\u2030', '\u2030', 1, 2), ('\u2032', '\u2033', 1, 2), ('\u2035', '\u2035', 1, 2), ('\u203b', '\u203b', 1, 2), ('\u203e', '\u203e', 1, 2), ('\u2060', '\u2064', 0, 0), ('\u2066', '\u206f', 0, 0), ('\u2074', '\u2074', 1, 2), ('\u207f', '\u207f', 1, 2), ('\u2081', '\u2084', 1, 2), ('\u20ac', '\u20ac', 1, 2), ('\u20d0', '\u20f0', 0, 0), ('\u2103', '\u2103', 1, 2), ('\u2105', '\u2105', 1, 2), ('\u2109', '\u2109', 1, 2), ('\u2113', '\u2113', 1, 2), ('\u2116', '\u2116', 1, 2), ('\u2121', '\u2122', 1, 2), ('\u2126', '\u2126', 1, 2), ('\u212b', '\u212b', 1, 2), ('\u2153', '\u2154', 1, 2), ('\u215b', '\u215e', 1, 2), ('\u2160', '\u216b', 1, 2), ('\u2170', '\u2179', 1, 2), ('\u2189', '\u2189', 1, 2), ('\u2190', '\u2199', 1, 2), ('\u21b8', '\u21b9', 1, 2), ('\u21d2', '\u21d2', 1, 2), ('\u21d4', '\u21d4', 1, 2), ('\u21e7', '\u21e7', 1, 2), ('\u2200', '\u2200', 1, 2), ('\u2202', '\u2203', 1, 2), ('\u2207', '\u2208', 1, 2), ('\u220b', '\u220b', 1, 2), ('\u220f', '\u220f', 1, 2), ('\u2211', '\u2211', 1, 2), ('\u2215', '\u2215', 1, 2), ('\u221a', '\u221a', 1, 2), ('\u221d', '\u2220', 1, 2), ('\u2223', '\u2223', 1, 2), ('\u2225', '\u2225', 1, 2), ('\u2227', '\u222c', 1, 2), ('\u222e', '\u222e', 1, 2), ('\u2234', '\u2237', 1, 2), ('\u223c', '\u223d', 1, 2), ('\u2248', '\u2248', 1, 2), ('\u224c', '\u224c', 1, 2), ('\u2252', '\u2252', 1, 2), ('\u2260', '\u2261', 1, 2), ('\u2264', '\u2267', 1, 2), ('\u226a', '\u226b', 1, 2), ('\u226e', '\u226f', 1, 2), ('\u2282', '\u2283', 1, 2), ('\u2286', '\u2287', 1, 2), ('\u2295', '\u2295', 1, 2), ('\u2299', '\u2299', 1, 2), ('\u22a5', '\u22a5', 1, 2), ('\u22bf', '\u22bf', 1, 2), ('\u2312', '\u2312', 1, 2), ('\u2329', '\u232a', 2, 2), ('\u2460', '\u24e9', 1, 2), ('\u24eb', '\u254b', 1, 2), ('\u2550', '\u2573', 1, 2), ('\u2580', '\u258f', 1, 2), ('\u2592', '\u2595', 1, 2), ('\u25a0', '\u25a1', 1, 2), ('\u25a3', '\u25a9', 1, 2), ('\u25b2', '\u25b3', 1, 2), ('\u25b6', '\u25b7', 1, 2), ('\u25bc', '\u25bd', 1, 2), ('\u25c0', '\u25c1', 1, 2), ('\u25c6', '\u25c8', 1, 2), ('\u25cb', '\u25cb', 1, 2), ('\u25ce', '\u25d1', 1, 2), ('\u25e2', '\u25e5', 1, 2), ('\u25ef', '\u25ef', 1, 2), ('\u2605', '\u2606', 1, 2), ('\u2609', '\u2609', 1, 2), ('\u260e', '\u260f', 1, 2), ('\u2614', '\u2615', 1, 2), ('\u261c', '\u261c', 1, 2), ('\u261e', '\u261e', 1, 2), ('\u2640', '\u2640', 1, 2), ('\u2642', '\u2642', 1, 2), ('\u2660', '\u2661', 1, 2), ('\u2663', '\u2665', 1, 2), ('\u2667', '\u266a', 1, 2), ('\u266c', '\u266d', 1, 2), ('\u266f', '\u266f', 1, 2), ('\u269e', '\u269f', 1, 2), ('\u26be', '\u26bf', 1, 2), ('\u26c4', '\u26cd', 1, 2), ('\u26cf', '\u26e1', 1, 2), ('\u26e3', '\u26e3', 1, 2), ('\u26e8', '\u26ff', 1, 2), ('\u273d', '\u273d', 1, 2), ('\u2757', '\u2757', 1, 2), ('\u2776', '\u277f', 1, 2), ('\u2b55', '\u2b59', 1, 2), ('\u2cef', '\u2cf1', 0, 0), ('\u2d7f', '\u2d7f', 0, 0), ('\u2de0', '\u2dff', 0, 0), ('\u2e80', '\u2e99', 2, 2), ('\u2e9b', '\u2ef3', 2, 2), ('\u2f00', '\u2fd5', 2, 2), ('\u2ff0', '\u2ffb', 2, 2), ('\u3000', '\u3029', 2, 2), ('\u302a', '\u302d', 0, 0), ('\u302e', '\u303e', 2, 2), ('\u3041', '\u3096', 2, 2), ('\u3099', '\u309a', 0, 0), ('\u309b', '\u30ff', 2, 2), ('\u3105', '\u312d', 2, 2), ('\u3131', '\u318e', 2, 2), ('\u3190', '\u31ba', 2, 2), ('\u31c0', '\u31e3', 2, 2), ('\u31f0', '\u321e', 2, 2), ('\u3220', '\u3247', 2, 2), ('\u3248', '\u324f', 1, 2), ('\u3250', '\u32fe', 2, 2), ('\u3300', '\u4dbf', 2, 2), ('\u4e00', '\ua48c', 2, 2), ('\ua490', '\ua4c6', 2, 2), ('\ua66f', '\ua672', 0, 0), ('\ua674', '\ua67d', 0, 0), ('\ua69f', '\ua69f', 0, 0), ('\ua6f0', '\ua6f1', 0, 0), ('\ua802', '\ua802', 0, 0), ('\ua806', '\ua806', 0, 0), ('\ua80b', '\ua80b', 0, 0), ('\ua825', '\ua826', 0, 0), ('\ua8c4', '\ua8c4', 0, 0), ('\ua8e0', '\ua8f1', 0, 0), ('\ua926', '\ua92d', 0, 0), ('\ua947', '\ua951', 0, 0), ('\ua960', '\ua97c', 2, 2), ('\ua980', '\ua982', 0, 0), ('\ua9b3', '\ua9b3', 0, 0), ('\ua9b6', '\ua9b9', 0, 0), ('\ua9bc', '\ua9bc', 0, 0), ('\ua9e5', '\ua9e5', 0, 0), ('\uaa29', '\uaa2e', 0, 0), ('\uaa31', '\uaa32', 0, 0), ('\uaa35', '\uaa36', 0, 0), ('\uaa43', '\uaa43', 0, 0), ('\uaa4c', '\uaa4c', 0, 0), ('\uaa7c', '\uaa7c', 0, 0), ('\uaab0', '\uaab0', 0, 0), ('\uaab2', '\uaab4', 0, 0), ('\uaab7', '\uaab8', 0, 0), ('\uaabe', '\uaabf', 0, 0), ('\uaac1', '\uaac1', 0, 0), ('\uaaec', '\uaaed', 0, 0), ('\uaaf6', '\uaaf6', 0, 0), ('\uabe5', '\uabe5', 0, 0), ('\uabe8', '\uabe8', 0, 0), ('\uabed', '\uabed', 0, 0), ('\uac00', '\ud7a3', 2, 2), ('\ue000', '\uf8ff', 1, 2), ('\uf900', '\ufaff', 2, 2), ('\ufb1e', '\ufb1e', 0, 0), ('\ufe00', '\ufe0f', 0, 0), ('\ufe10', '\ufe19', 2, 2), ('\ufe20', '\ufe2d', 0, 0), ('\ufe30', '\ufe52', 2, 2), ('\ufe54', '\ufe66', 2, 2), ('\ufe68', '\ufe6b', 2, 2), ('\ufeff', '\ufeff', 0, 0), ('\uff01', '\uff60', 2, 2), ('\uffe0', '\uffe6', 2, 2), ('\ufff9', '\ufffb', 0, 0), ('\ufffd', '\ufffd', 1, 2), ('\U000101fd', '\U000101fd', 0, 0), ('\U000102e0', '\U000102e0', 0, 0), ('\U00010376', '\U0001037a', 0, 0), ('\U00010a01', '\U00010a03', 0, 0), ('\U00010a05', '\U00010a06', 0, 0), ('\U00010a0c', '\U00010a0f', 0, 0), ('\U00010a38', '\U00010a3a', 0, 0), ('\U00010a3f', '\U00010a3f', 0, 0), ('\U00010ae5', '\U00010ae6', 0, 0), ('\U00011001', '\U00011001', 0, 0), ('\U00011038', '\U00011046', 0, 0), ('\U0001107f', '\U00011081', 0, 0), ('\U000110b3', '\U000110b6', 0, 0), ('\U000110b9', '\U000110ba', 0, 0), ('\U000110bd', '\U000110bd', 0, 0), ('\U00011100', '\U00011102', 0, 0), ('\U00011127', '\U0001112b', 0, 0), ('\U0001112d', '\U00011134', 0, 0), ('\U00011173', '\U00011173', 0, 0), ('\U00011180', '\U00011181', 0, 0), ('\U000111b6', '\U000111be', 0, 0), ('\U0001122f', '\U00011231', 0, 0), ('\U00011234', '\U00011234', 0, 0), ('\U00011236', '\U00011237', 0, 0), ('\U000112df', '\U000112df', 0, 0), ('\U000112e3', '\U000112ea', 0, 0), ('\U00011301', '\U00011301', 0, 0), ('\U0001133c', '\U0001133c', 0, 0), ('\U00011340', '\U00011340', 0, 0), ('\U00011366', '\U0001136c', 0, 0), ('\U00011370', '\U00011374', 0, 0), ('\U000114b3', '\U000114b8', 0, 0), ('\U000114ba', '\U000114ba', 0, 0), ('\U000114bf', '\U000114c0', 0, 0), ('\U000114c2', '\U000114c3', 0, 0), ('\U000115b2', '\U000115b5', 0, 0), ('\U000115bc', '\U000115bd', 0, 0), ('\U000115bf', '\U000115c0', 0, 0), ('\U00011633', '\U0001163a', 0, 0), ('\U0001163d', '\U0001163d', 0, 0), ('\U0001163f', '\U00011640', 0, 0), ('\U000116ab', '\U000116ab', 0, 0), ('\U000116ad', '\U000116ad', 0, 0), ('\U000116b0', '\U000116b5', 0, 0), ('\U000116b7', '\U000116b7', 0, 0), ('\U00016af0', '\U00016af4', 0, 0), ('\U00016b30', '\U00016b36', 0, 0), ('\U00016f8f', '\U00016f92', 0, 0), ('\U0001b000', '\U0001b001', 2, 2), ('\U0001bc9d', '\U0001bc9e', 0, 0), ('\U0001bca0', '\U0001bca3', 0, 0), ('\U0001d167', '\U0001d169', 0, 0), ('\U0001d173', '\U0001d182', 0, 0), ('\U0001d185', '\U0001d18b', 0, 0), ('\U0001d1aa', '\U0001d1ad', 0, 0), ('\U0001d242', '\U0001d244', 0, 0), ('\U0001e8d0', '\U0001e8d6', 0, 0), ('\U0001f100', '\U0001f10a', 1, 2), ('\U0001f110', '\U0001f12d', 1, 2), ('\U0001f130', '\U0001f169', 1, 2), ('\U0001f170', '\U0001f19a', 1, 2), ('\U0001f200', '\U0001f202', 2, 2), ('\U0001f210', '\U0001f23a', 2, 2), ('\U0001f240', '\U0001f248', 2, 2), ('\U0001f250', '\U0001f251', 2, 2), ('\U00020000', '\U0002fffd', 2, 2), ('\U00030000', '\U0003fffd', 2, 2), ('\U000e0001', '\U000e0001', 0, 0), ('\U000e0020', '\U000e007f', 0, 0), ('\U000e0100', '\U000e01ef', 0, 0), ('\U000f0000', '\U000ffffd', 1, 2), ('\U00100000', '\U0010fffd', 1, 2) ]; } pub mod grapheme { use core::slice::SlicePrelude; use core::slice; #[allow(non_camel_case_types)] #[deriving(Clone)] pub enum GraphemeCat { GC_LV, GC_LVT, GC_T, GC_Extend, GC_V, GC_Control, GC_SpacingMark, GC_L, GC_RegionalIndicator, GC_Any, } fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat { use core::cmp::{Equal, Less, Greater}; match r.binary_search(|&(lo, hi, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { slice::Found(idx) => { let (_, _, cat) = r[idx]; cat } slice::NotFound(_) => GC_Any } } pub fn grapheme_category(c: char) -> GraphemeCat { bsearch_range_value_table(c, grapheme_cat_table) } static grapheme_cat_table: &'static [(char, char, GraphemeCat)] = &[ ('\x00', '\x1f', GC_Control), ('\x7f', '\u009f', GC_Control), ('\u00ad', '\u00ad', GC_Control), ('\u0300', '\u036f', GC_Extend), ('\u0483', '\u0487', GC_Extend), ('\u0488', '\u0489', GC_Extend), ('\u0591', '\u05bd', GC_Extend), ('\u05bf', '\u05bf', GC_Extend), ('\u05c1', '\u05c2', GC_Extend), ('\u05c4', '\u05c5', GC_Extend), ('\u05c7', '\u05c7', GC_Extend), ('\u0600', '\u0605', GC_Control), ('\u0610', '\u061a', GC_Extend), ('\u061c', '\u061c', GC_Control), ('\u064b', '\u065f', GC_Extend), ('\u0670', '\u0670', GC_Extend), ('\u06d6', '\u06dc', GC_Extend), ('\u06dd', '\u06dd', GC_Control), ('\u06df', '\u06e4', GC_Extend), ('\u06e7', '\u06e8', GC_Extend), ('\u06ea', '\u06ed', GC_Extend), ('\u070f', '\u070f', GC_Control), ('\u0711', '\u0711', GC_Extend), ('\u0730', '\u074a', GC_Extend), ('\u07a6', '\u07b0', GC_Extend), ('\u07eb', '\u07f3', GC_Extend), ('\u0816', '\u0819', GC_Extend), ('\u081b', '\u0823', GC_Extend), ('\u0825', '\u0827', GC_Extend), ('\u0829', '\u082d', GC_Extend), ('\u0859', '\u085b', GC_Extend), ('\u08e4', '\u0902', GC_Extend), ('\u0903', '\u0903', GC_SpacingMark), ('\u093a', '\u093a', GC_Extend), ('\u093b', '\u093b', GC_SpacingMark), ('\u093c', '\u093c', GC_Extend), ('\u093e', '\u0940', GC_SpacingMark), ('\u0941', '\u0948', GC_Extend), ('\u0949', '\u094c', GC_SpacingMark), ('\u094d', '\u094d', GC_Extend), ('\u094e', '\u094f', GC_SpacingMark), ('\u0951', '\u0957', GC_Extend), ('\u0962', '\u0963', GC_Extend), ('\u0981', '\u0981', GC_Extend), ('\u0982', '\u0983', GC_SpacingMark), ('\u09bc', '\u09bc', GC_Extend), ('\u09be', '\u09be', GC_Extend), ('\u09bf', '\u09c0', GC_SpacingMark), ('\u09c1', '\u09c4', GC_Extend), ('\u09c7', '\u09c8', GC_SpacingMark), ('\u09cb', '\u09cc', GC_SpacingMark), ('\u09cd', '\u09cd', GC_Extend), ('\u09d7', '\u09d7', GC_Extend), ('\u09e2', '\u09e3', GC_Extend), ('\u0a01', '\u0a02', GC_Extend), ('\u0a03', '\u0a03', GC_SpacingMark), ('\u0a3c', '\u0a3c', GC_Extend), ('\u0a3e', '\u0a40', GC_SpacingMark), ('\u0a41', '\u0a42', GC_Extend), ('\u0a47', '\u0a48', GC_Extend), ('\u0a4b', '\u0a4d', GC_Extend), ('\u0a51', '\u0a51', GC_Extend), ('\u0a70', '\u0a71', GC_Extend), ('\u0a75', '\u0a75', GC_Extend), ('\u0a81', '\u0a82', GC_Extend), ('\u0a83', '\u0a83', GC_SpacingMark), ('\u0abc', '\u0abc', GC_Extend), ('\u0abe', '\u0ac0', GC_SpacingMark), ('\u0ac1', '\u0ac5', GC_Extend), ('\u0ac7', '\u0ac8', GC_Extend), ('\u0ac9', '\u0ac9', GC_SpacingMark), ('\u0acb', '\u0acc', GC_SpacingMark), ('\u0acd', '\u0acd', GC_Extend), ('\u0ae2', '\u0ae3', GC_Extend), ('\u0b01', '\u0b01', GC_Extend), ('\u0b02', '\u0b03', GC_SpacingMark), ('\u0b3c', '\u0b3c', GC_Extend), ('\u0b3e', '\u0b3e', GC_Extend), ('\u0b3f', '\u0b3f', GC_Extend), ('\u0b40', '\u0b40', GC_SpacingMark), ('\u0b41', '\u0b44', GC_Extend), ('\u0b47', '\u0b48', GC_SpacingMark), ('\u0b4b', '\u0b4c', GC_SpacingMark), ('\u0b4d', '\u0b4d', GC_Extend), ('\u0b56', '\u0b56', GC_Extend), ('\u0b57', '\u0b57', GC_Extend), ('\u0b62', '\u0b63', GC_Extend), ('\u0b82', '\u0b82', GC_Extend), ('\u0bbe', '\u0bbe', GC_Extend), ('\u0bbf', '\u0bbf', GC_SpacingMark), ('\u0bc0', '\u0bc0', GC_Extend), ('\u0bc1', '\u0bc2', GC_SpacingMark), ('\u0bc6', '\u0bc8', GC_SpacingMark), ('\u0bca', '\u0bcc', GC_SpacingMark), ('\u0bcd', '\u0bcd', GC_Extend), ('\u0bd7', '\u0bd7', GC_Extend), ('\u0c00', '\u0c00', GC_Extend), ('\u0c01', '\u0c03', GC_SpacingMark), ('\u0c3e', '\u0c40', GC_Extend), ('\u0c41', '\u0c44', GC_SpacingMark), ('\u0c46', '\u0c48', GC_Extend), ('\u0c4a', '\u0c4d', GC_Extend), ('\u0c55', '\u0c56', GC_Extend), ('\u0c62', '\u0c63', GC_Extend), ('\u0c81', '\u0c81', GC_Extend), ('\u0c82', '\u0c83', GC_SpacingMark), ('\u0cbc', '\u0cbc', GC_Extend), ('\u0cbe', '\u0cbe', GC_SpacingMark), ('\u0cbf', '\u0cbf', GC_Extend), ('\u0cc0', '\u0cc1', GC_SpacingMark), ('\u0cc2', '\u0cc2', GC_Extend), ('\u0cc3', '\u0cc4', GC_SpacingMark), ('\u0cc6', '\u0cc6', GC_Extend), ('\u0cc7', '\u0cc8', GC_SpacingMark), ('\u0cca', '\u0ccb', GC_SpacingMark), ('\u0ccc', '\u0ccd', GC_Extend), ('\u0cd5', '\u0cd6', GC_Extend), ('\u0ce2', '\u0ce3', GC_Extend), ('\u0d01', '\u0d01', GC_Extend), ('\u0d02', '\u0d03', GC_SpacingMark), ('\u0d3e', '\u0d3e', GC_Extend), ('\u0d3f', '\u0d40', GC_SpacingMark), ('\u0d41', '\u0d44', GC_Extend), ('\u0d46', '\u0d48', GC_SpacingMark), ('\u0d4a', '\u0d4c', GC_SpacingMark), ('\u0d4d', '\u0d4d', GC_Extend), ('\u0d57', '\u0d57', GC_Extend), ('\u0d62', '\u0d63', GC_Extend), ('\u0d82', '\u0d83', GC_SpacingMark), ('\u0dca', '\u0dca', GC_Extend), ('\u0dcf', '\u0dcf', GC_Extend), ('\u0dd0', '\u0dd1', GC_SpacingMark), ('\u0dd2', '\u0dd4', GC_Extend), ('\u0dd6', '\u0dd6', GC_Extend), ('\u0dd8', '\u0dde', GC_SpacingMark), ('\u0ddf', '\u0ddf', GC_Extend), ('\u0df2', '\u0df3', GC_SpacingMark), ('\u0e31', '\u0e31', GC_Extend), ('\u0e33', '\u0e33', GC_SpacingMark), ('\u0e34', '\u0e3a', GC_Extend), ('\u0e47', '\u0e4e', GC_Extend), ('\u0eb1', '\u0eb1', GC_Extend), ('\u0eb3', '\u0eb3', GC_SpacingMark), ('\u0eb4', '\u0eb9', GC_Extend), ('\u0ebb', '\u0ebc', GC_Extend), ('\u0ec8', '\u0ecd', GC_Extend), ('\u0f18', '\u0f19', GC_Extend), ('\u0f35', '\u0f35', GC_Extend), ('\u0f37', '\u0f37', GC_Extend), ('\u0f39', '\u0f39', GC_Extend), ('\u0f3e', '\u0f3f', GC_SpacingMark), ('\u0f71', '\u0f7e', GC_Extend), ('\u0f7f', '\u0f7f', GC_SpacingMark), ('\u0f80', '\u0f84', GC_Extend), ('\u0f86', '\u0f87', GC_Extend), ('\u0f8d', '\u0f97', GC_Extend), ('\u0f99', '\u0fbc', GC_Extend), ('\u0fc6', '\u0fc6', GC_Extend), ('\u102b', '\u102c', GC_SpacingMark), ('\u102d', '\u1030', GC_Extend), ('\u1031', '\u1031', GC_SpacingMark), ('\u1032', '\u1037', GC_Extend), ('\u1038', '\u1038', GC_SpacingMark), ('\u1039', '\u103a', GC_Extend), ('\u103b', '\u103c', GC_SpacingMark), ('\u103d', '\u103e', GC_Extend), ('\u1056', '\u1057', GC_SpacingMark), ('\u1058', '\u1059', GC_Extend), ('\u105e', '\u1060', GC_Extend), ('\u1062', '\u1064', GC_SpacingMark), ('\u1067', '\u106d', GC_SpacingMark), ('\u1071', '\u1074', GC_Extend), ('\u1082', '\u1082', GC_Extend), ('\u1083', '\u1084', GC_SpacingMark), ('\u1085', '\u1086', GC_Extend), ('\u1087', '\u108c', GC_SpacingMark), ('\u108d', '\u108d', GC_Extend), ('\u108f', '\u108f', GC_SpacingMark), ('\u109a', '\u109c', GC_SpacingMark), ('\u109d', '\u109d', GC_Extend), ('\u1100', '\u115f', GC_L), ('\u1160', '\u11a7', GC_V), ('\u11a8', '\u11ff', GC_T), ('\u135d', '\u135f', GC_Extend), ('\u1712', '\u1714', GC_Extend), ('\u1732', '\u1734', GC_Extend), ('\u1752', '\u1753', GC_Extend), ('\u1772', '\u1773', GC_Extend), ('\u17b4', '\u17b5', GC_Extend), ('\u17b6', '\u17b6', GC_SpacingMark), ('\u17b7', '\u17bd', GC_Extend), ('\u17be', '\u17c5', GC_SpacingMark), ('\u17c6', '\u17c6', GC_Extend), ('\u17c7', '\u17c8', GC_SpacingMark), ('\u17c9', '\u17d3', GC_Extend), ('\u17dd', '\u17dd', GC_Extend), ('\u180b', '\u180d', GC_Extend), ('\u180e', '\u180e', GC_Control), ('\u18a9', '\u18a9', GC_Extend), ('\u1920', '\u1922', GC_Extend), ('\u1923', '\u1926', GC_SpacingMark), ('\u1927', '\u1928', GC_Extend), ('\u1929', '\u192b', GC_SpacingMark), ('\u1930', '\u1931', GC_SpacingMark), ('\u1932', '\u1932', GC_Extend), ('\u1933', '\u1938', GC_SpacingMark), ('\u1939', '\u193b', GC_Extend), ('\u19b0', '\u19c0', GC_SpacingMark), ('\u19c8', '\u19c9', GC_SpacingMark), ('\u1a17', '\u1a18', GC_Extend), ('\u1a19', '\u1a1a', GC_SpacingMark), ('\u1a1b', '\u1a1b', GC_Extend), ('\u1a55', '\u1a55', GC_SpacingMark), ('\u1a56', '\u1a56', GC_Extend), ('\u1a57', '\u1a57', GC_SpacingMark), ('\u1a58', '\u1a5e', GC_Extend), ('\u1a60', '\u1a60', GC_Extend), ('\u1a61', '\u1a61', GC_SpacingMark), ('\u1a62', '\u1a62', GC_Extend), ('\u1a63', '\u1a64', GC_SpacingMark), ('\u1a65', '\u1a6c', GC_Extend), ('\u1a6d', '\u1a72', GC_SpacingMark), ('\u1a73', '\u1a7c', GC_Extend), ('\u1a7f', '\u1a7f', GC_Extend), ('\u1ab0', '\u1abd', GC_Extend), ('\u1abe', '\u1abe', GC_Extend), ('\u1b00', '\u1b03', GC_Extend), ('\u1b04', '\u1b04', GC_SpacingMark), ('\u1b34', '\u1b34', GC_Extend), ('\u1b35', '\u1b35', GC_SpacingMark), ('\u1b36', '\u1b3a', GC_Extend), ('\u1b3b', '\u1b3b', GC_SpacingMark), ('\u1b3c', '\u1b3c', GC_Extend), ('\u1b3d', '\u1b41', GC_SpacingMark), ('\u1b42', '\u1b42', GC_Extend), ('\u1b43', '\u1b44', GC_SpacingMark), ('\u1b6b', '\u1b73', GC_Extend), ('\u1b80', '\u1b81', GC_Extend), ('\u1b82', '\u1b82', GC_SpacingMark), ('\u1ba1', '\u1ba1', GC_SpacingMark), ('\u1ba2', '\u1ba5', GC_Extend), ('\u1ba6', '\u1ba7', GC_SpacingMark), ('\u1ba8', '\u1ba9', GC_Extend), ('\u1baa', '\u1baa', GC_SpacingMark), ('\u1bab', '\u1bad', GC_Extend), ('\u1be6', '\u1be6', GC_Extend), ('\u1be7', '\u1be7', GC_SpacingMark), ('\u1be8', '\u1be9', GC_Extend), ('\u1bea', '\u1bec', GC_SpacingMark), ('\u1bed', '\u1bed', GC_Extend), ('\u1bee', '\u1bee', GC_SpacingMark), ('\u1bef', '\u1bf1', GC_Extend), ('\u1bf2', '\u1bf3', GC_SpacingMark), ('\u1c24', '\u1c2b', GC_SpacingMark), ('\u1c2c', '\u1c33', GC_Extend), ('\u1c34', '\u1c35', GC_SpacingMark), ('\u1c36', '\u1c37', GC_Extend), ('\u1cd0', '\u1cd2', GC_Extend), ('\u1cd4', '\u1ce0', GC_Extend), ('\u1ce1', '\u1ce1', GC_SpacingMark), ('\u1ce2', '\u1ce8', GC_Extend), ('\u1ced', '\u1ced', GC_Extend), ('\u1cf2', '\u1cf3', GC_SpacingMark), ('\u1cf4', '\u1cf4', GC_Extend), ('\u1cf8', '\u1cf9', GC_Extend), ('\u1dc0', '\u1df5', GC_Extend), ('\u1dfc', '\u1dff', GC_Extend), ('\u200b', '\u200b', GC_Control), ('\u200c', '\u200d', GC_Extend), ('\u200e', '\u200f', GC_Control), ('\u2028', '\u202e', GC_Control), ('\u2060', '\u206f', GC_Control), ('\u20d0', '\u20dc', GC_Extend), ('\u20dd', '\u20e0', GC_Extend), ('\u20e1', '\u20e1', GC_Extend), ('\u20e2', '\u20e4', GC_Extend), ('\u20e5', '\u20f0', GC_Extend), ('\u2cef', '\u2cf1', GC_Extend), ('\u2d7f', '\u2d7f', GC_Extend), ('\u2de0', '\u2dff', GC_Extend), ('\u302a', '\u302d', GC_Extend), ('\u302e', '\u302f', GC_Extend), ('\u3099', '\u309a', GC_Extend), ('\ua66f', '\ua66f', GC_Extend), ('\ua670', '\ua672', GC_Extend), ('\ua674', '\ua67d', GC_Extend), ('\ua69f', '\ua69f', GC_Extend), ('\ua6f0', '\ua6f1', GC_Extend), ('\ua802', '\ua802', GC_Extend), ('\ua806', '\ua806', GC_Extend), ('\ua80b', '\ua80b', GC_Extend), ('\ua823', '\ua824', GC_SpacingMark), ('\ua825', '\ua826', GC_Extend), ('\ua827', '\ua827', GC_SpacingMark), ('\ua880', '\ua881', GC_SpacingMark), ('\ua8b4', '\ua8c3', GC_SpacingMark), ('\ua8c4', '\ua8c4', GC_Extend), ('\ua8e0', '\ua8f1', GC_Extend), ('\ua926', '\ua92d', GC_Extend), ('\ua947', '\ua951', GC_Extend), ('\ua952', '\ua953', GC_SpacingMark), ('\ua960', '\ua97c', GC_L), ('\ua980', '\ua982', GC_Extend), ('\ua983', '\ua983', GC_SpacingMark), ('\ua9b3', '\ua9b3', GC_Extend), ('\ua9b4', '\ua9b5', GC_SpacingMark), ('\ua9b6', '\ua9b9', GC_Extend), ('\ua9ba', '\ua9bb', GC_SpacingMark), ('\ua9bc', '\ua9bc', GC_Extend), ('\ua9bd', '\ua9c0', GC_SpacingMark), ('\ua9e5', '\ua9e5', GC_Extend), ('\uaa29', '\uaa2e', GC_Extend), ('\uaa2f', '\uaa30', GC_SpacingMark), ('\uaa31', '\uaa32', GC_Extend), ('\uaa33', '\uaa34', GC_SpacingMark), ('\uaa35', '\uaa36', GC_Extend), ('\uaa43', '\uaa43', GC_Extend), ('\uaa4c', '\uaa4c', GC_Extend), ('\uaa4d', '\uaa4d', GC_SpacingMark), ('\uaa7b', '\uaa7b', GC_SpacingMark), ('\uaa7c', '\uaa7c', GC_Extend), ('\uaa7d', '\uaa7d', GC_SpacingMark), ('\uaab0', '\uaab0', GC_Extend), ('\uaab2', '\uaab4', GC_Extend), ('\uaab7', '\uaab8', GC_Extend), ('\uaabe', '\uaabf', GC_Extend), ('\uaac1', '\uaac1', GC_Extend), ('\uaaeb', '\uaaeb', GC_SpacingMark), ('\uaaec', '\uaaed', GC_Extend), ('\uaaee', '\uaaef', GC_SpacingMark), ('\uaaf5', '\uaaf5', GC_SpacingMark), ('\uaaf6', '\uaaf6', GC_Extend), ('\uabe3', '\uabe4', GC_SpacingMark), ('\uabe5', '\uabe5', GC_Extend), ('\uabe6', '\uabe7', GC_SpacingMark), ('\uabe8', '\uabe8', GC_Extend), ('\uabe9', '\uabea', GC_SpacingMark), ('\uabec', '\uabec', GC_SpacingMark), ('\uabed', '\uabed', GC_Extend), ('\uac00', '\uac00', GC_LV), ('\uac01', '\uac1b', GC_LVT), ('\uac1c', '\uac1c', GC_LV), ('\uac1d', '\uac37', GC_LVT), ('\uac38', '\uac38', GC_LV), ('\uac39', '\uac53', GC_LVT), ('\uac54', '\uac54', GC_LV), ('\uac55', '\uac6f', GC_LVT), ('\uac70', '\uac70', GC_LV), ('\uac71', '\uac8b', GC_LVT), ('\uac8c', '\uac8c', GC_LV), ('\uac8d', '\uaca7', GC_LVT), ('\uaca8', '\uaca8', GC_LV), ('\uaca9', '\uacc3', GC_LVT), ('\uacc4', '\uacc4', GC_LV), ('\uacc5', '\uacdf', GC_LVT), ('\uace0', '\uace0', GC_LV), ('\uace1', '\uacfb', GC_LVT), ('\uacfc', '\uacfc', GC_LV), ('\uacfd', '\uad17', GC_LVT), ('\uad18', '\uad18', GC_LV), ('\uad19', '\uad33', GC_LVT), ('\uad34', '\uad34', GC_LV), ('\uad35', '\uad4f', GC_LVT), ('\uad50', '\uad50', GC_LV), ('\uad51', '\uad6b', GC_LVT), ('\uad6c', '\uad6c', GC_LV), ('\uad6d', '\uad87', GC_LVT), ('\uad88', '\uad88', GC_LV), ('\uad89', '\uada3', GC_LVT), ('\uada4', '\uada4', GC_LV), ('\uada5', '\uadbf', GC_LVT), ('\uadc0', '\uadc0', GC_LV), ('\uadc1', '\uaddb', GC_LVT), ('\uaddc', '\uaddc', GC_LV), ('\uaddd', '\uadf7', GC_LVT), ('\uadf8', '\uadf8', GC_LV), ('\uadf9', '\uae13', GC_LVT), ('\uae14', '\uae14', GC_LV), ('\uae15', '\uae2f', GC_LVT), ('\uae30', '\uae30', GC_LV), ('\uae31', '\uae4b', GC_LVT), ('\uae4c', '\uae4c', GC_LV), ('\uae4d', '\uae67', GC_LVT), ('\uae68', '\uae68', GC_LV), ('\uae69', '\uae83', GC_LVT), ('\uae84', '\uae84', GC_LV), ('\uae85', '\uae9f', GC_LVT), ('\uaea0', '\uaea0', GC_LV), ('\uaea1', '\uaebb', GC_LVT), ('\uaebc', '\uaebc', GC_LV), ('\uaebd', '\uaed7', GC_LVT), ('\uaed8', '\uaed8', GC_LV), ('\uaed9', '\uaef3', GC_LVT), ('\uaef4', '\uaef4', GC_LV), ('\uaef5', '\uaf0f', GC_LVT), ('\uaf10', '\uaf10', GC_LV), ('\uaf11', '\uaf2b', GC_LVT), ('\uaf2c', '\uaf2c', GC_LV), ('\uaf2d', '\uaf47', GC_LVT), ('\uaf48', '\uaf48', GC_LV), ('\uaf49', '\uaf63', GC_LVT), ('\uaf64', '\uaf64', GC_LV), ('\uaf65', '\uaf7f', GC_LVT), ('\uaf80', '\uaf80', GC_LV), ('\uaf81', '\uaf9b', GC_LVT), ('\uaf9c', '\uaf9c', GC_LV), ('\uaf9d', '\uafb7', GC_LVT), ('\uafb8', '\uafb8', GC_LV), ('\uafb9', '\uafd3', GC_LVT), ('\uafd4', '\uafd4', GC_LV), ('\uafd5', '\uafef', GC_LVT), ('\uaff0', '\uaff0', GC_LV), ('\uaff1', '\ub00b', GC_LVT), ('\ub00c', '\ub00c', GC_LV), ('\ub00d', '\ub027', GC_LVT), ('\ub028', '\ub028', GC_LV), ('\ub029', '\ub043', GC_LVT), ('\ub044', '\ub044', GC_LV), ('\ub045', '\ub05f', GC_LVT), ('\ub060', '\ub060', GC_LV), ('\ub061', '\ub07b', GC_LVT), ('\ub07c', '\ub07c', GC_LV), ('\ub07d', '\ub097', GC_LVT), ('\ub098', '\ub098', GC_LV), ('\ub099', '\ub0b3', GC_LVT), ('\ub0b4', '\ub0b4', GC_LV), ('\ub0b5', '\ub0cf', GC_LVT), ('\ub0d0', '\ub0d0', GC_LV), ('\ub0d1', '\ub0eb', GC_LVT), ('\ub0ec', '\ub0ec', GC_LV), ('\ub0ed', '\ub107', GC_LVT), ('\ub108', '\ub108', GC_LV), ('\ub109', '\ub123', GC_LVT), ('\ub124', '\ub124', GC_LV), ('\ub125', '\ub13f', GC_LVT), ('\ub140', '\ub140', GC_LV), ('\ub141', '\ub15b', GC_LVT), ('\ub15c', '\ub15c', GC_LV), ('\ub15d', '\ub177', GC_LVT), ('\ub178', '\ub178', GC_LV), ('\ub179', '\ub193', GC_LVT), ('\ub194', '\ub194', GC_LV), ('\ub195', '\ub1af', GC_LVT), ('\ub1b0', '\ub1b0', GC_LV), ('\ub1b1', '\ub1cb', GC_LVT), ('\ub1cc', '\ub1cc', GC_LV), ('\ub1cd', '\ub1e7', GC_LVT), ('\ub1e8', '\ub1e8', GC_LV), ('\ub1e9', '\ub203', GC_LVT), ('\ub204', '\ub204', GC_LV), ('\ub205', '\ub21f', GC_LVT), ('\ub220', '\ub220', GC_LV), ('\ub221', '\ub23b', GC_LVT), ('\ub23c', '\ub23c', GC_LV), ('\ub23d', '\ub257', GC_LVT), ('\ub258', '\ub258', GC_LV), ('\ub259', '\ub273', GC_LVT), ('\ub274', '\ub274', GC_LV), ('\ub275', '\ub28f', GC_LVT), ('\ub290', '\ub290', GC_LV), ('\ub291', '\ub2ab', GC_LVT), ('\ub2ac', '\ub2ac', GC_LV), ('\ub2ad', '\ub2c7', GC_LVT), ('\ub2c8', '\ub2c8', GC_LV), ('\ub2c9', '\ub2e3', GC_LVT), ('\ub2e4', '\ub2e4', GC_LV), ('\ub2e5', '\ub2ff', GC_LVT), ('\ub300', '\ub300', GC_LV), ('\ub301', '\ub31b', GC_LVT), ('\ub31c', '\ub31c', GC_LV), ('\ub31d', '\ub337', GC_LVT), ('\ub338', '\ub338', GC_LV), ('\ub339', '\ub353', GC_LVT), ('\ub354', '\ub354', GC_LV), ('\ub355', '\ub36f', GC_LVT), ('\ub370', '\ub370', GC_LV), ('\ub371', '\ub38b', GC_LVT), ('\ub38c', '\ub38c', GC_LV), ('\ub38d', '\ub3a7', GC_LVT), ('\ub3a8', '\ub3a8', GC_LV), ('\ub3a9', '\ub3c3', GC_LVT), ('\ub3c4', '\ub3c4', GC_LV), ('\ub3c5', '\ub3df', GC_LVT), ('\ub3e0', '\ub3e0', GC_LV), ('\ub3e1', '\ub3fb', GC_LVT), ('\ub3fc', '\ub3fc', GC_LV), ('\ub3fd', '\ub417', GC_LVT), ('\ub418', '\ub418', GC_LV), ('\ub419', '\ub433', GC_LVT), ('\ub434', '\ub434', GC_LV), ('\ub435', '\ub44f', GC_LVT), ('\ub450', '\ub450', GC_LV), ('\ub451', '\ub46b', GC_LVT), ('\ub46c', '\ub46c', GC_LV), ('\ub46d', '\ub487', GC_LVT), ('\ub488', '\ub488', GC_LV), ('\ub489', '\ub4a3', GC_LVT), ('\ub4a4', '\ub4a4', GC_LV), ('\ub4a5', '\ub4bf', GC_LVT), ('\ub4c0', '\ub4c0', GC_LV), ('\ub4c1', '\ub4db', GC_LVT), ('\ub4dc', '\ub4dc', GC_LV), ('\ub4dd', '\ub4f7', GC_LVT), ('\ub4f8', '\ub4f8', GC_LV), ('\ub4f9', '\ub513', GC_LVT), ('\ub514', '\ub514', GC_LV), ('\ub515', '\ub52f', GC_LVT), ('\ub530', '\ub530', GC_LV), ('\ub531', '\ub54b', GC_LVT), ('\ub54c', '\ub54c', GC_LV), ('\ub54d', '\ub567', GC_LVT), ('\ub568', '\ub568', GC_LV), ('\ub569', '\ub583', GC_LVT), ('\ub584', '\ub584', GC_LV), ('\ub585', '\ub59f', GC_LVT), ('\ub5a0', '\ub5a0', GC_LV), ('\ub5a1', '\ub5bb', GC_LVT), ('\ub5bc', '\ub5bc', GC_LV), ('\ub5bd', '\ub5d7', GC_LVT), ('\ub5d8', '\ub5d8', GC_LV), ('\ub5d9', '\ub5f3', GC_LVT), ('\ub5f4', '\ub5f4', GC_LV), ('\ub5f5', '\ub60f', GC_LVT), ('\ub610', '\ub610', GC_LV), ('\ub611', '\ub62b', GC_LVT), ('\ub62c', '\ub62c', GC_LV), ('\ub62d', '\ub647', GC_LVT), ('\ub648', '\ub648', GC_LV), ('\ub649', '\ub663', GC_LVT), ('\ub664', '\ub664', GC_LV), ('\ub665', '\ub67f', GC_LVT), ('\ub680', '\ub680', GC_LV), ('\ub681', '\ub69b', GC_LVT), ('\ub69c', '\ub69c', GC_LV), ('\ub69d', '\ub6b7', GC_LVT), ('\ub6b8', '\ub6b8', GC_LV), ('\ub6b9', '\ub6d3', GC_LVT), ('\ub6d4', '\ub6d4', GC_LV), ('\ub6d5', '\ub6ef', GC_LVT), ('\ub6f0', '\ub6f0', GC_LV), ('\ub6f1', '\ub70b', GC_LVT), ('\ub70c', '\ub70c', GC_LV), ('\ub70d', '\ub727', GC_LVT), ('\ub728', '\ub728', GC_LV), ('\ub729', '\ub743', GC_LVT), ('\ub744', '\ub744', GC_LV), ('\ub745', '\ub75f', GC_LVT), ('\ub760', '\ub760', GC_LV), ('\ub761', '\ub77b', GC_LVT), ('\ub77c', '\ub77c', GC_LV), ('\ub77d', '\ub797', GC_LVT), ('\ub798', '\ub798', GC_LV), ('\ub799', '\ub7b3', GC_LVT), ('\ub7b4', '\ub7b4', GC_LV), ('\ub7b5', '\ub7cf', GC_LVT), ('\ub7d0', '\ub7d0', GC_LV), ('\ub7d1', '\ub7eb', GC_LVT), ('\ub7ec', '\ub7ec', GC_LV), ('\ub7ed', '\ub807', GC_LVT), ('\ub808', '\ub808', GC_LV), ('\ub809', '\ub823', GC_LVT), ('\ub824', '\ub824', GC_LV), ('\ub825', '\ub83f', GC_LVT), ('\ub840', '\ub840', GC_LV), ('\ub841', '\ub85b', GC_LVT), ('\ub85c', '\ub85c', GC_LV), ('\ub85d', '\ub877', GC_LVT), ('\ub878', '\ub878', GC_LV), ('\ub879', '\ub893', GC_LVT), ('\ub894', '\ub894', GC_LV), ('\ub895', '\ub8af', GC_LVT), ('\ub8b0', '\ub8b0', GC_LV), ('\ub8b1', '\ub8cb', GC_LVT), ('\ub8cc', '\ub8cc', GC_LV), ('\ub8cd', '\ub8e7', GC_LVT), ('\ub8e8', '\ub8e8', GC_LV), ('\ub8e9', '\ub903', GC_LVT), ('\ub904', '\ub904', GC_LV), ('\ub905', '\ub91f', GC_LVT), ('\ub920', '\ub920', GC_LV), ('\ub921', '\ub93b', GC_LVT), ('\ub93c', '\ub93c', GC_LV), ('\ub93d', '\ub957', GC_LVT), ('\ub958', '\ub958', GC_LV), ('\ub959', '\ub973', GC_LVT), ('\ub974', '\ub974', GC_LV), ('\ub975', '\ub98f', GC_LVT), ('\ub990', '\ub990', GC_LV), ('\ub991', '\ub9ab', GC_LVT), ('\ub9ac', '\ub9ac', GC_LV), ('\ub9ad', '\ub9c7', GC_LVT), ('\ub9c8', '\ub9c8', GC_LV), ('\ub9c9', '\ub9e3', GC_LVT), ('\ub9e4', '\ub9e4', GC_LV), ('\ub9e5', '\ub9ff', GC_LVT), ('\uba00', '\uba00', GC_LV), ('\uba01', '\uba1b', GC_LVT), ('\uba1c', '\uba1c', GC_LV), ('\uba1d', '\uba37', GC_LVT), ('\uba38', '\uba38', GC_LV), ('\uba39', '\uba53', GC_LVT), ('\uba54', '\uba54', GC_LV), ('\uba55', '\uba6f', GC_LVT), ('\uba70', '\uba70', GC_LV), ('\uba71', '\uba8b', GC_LVT), ('\uba8c', '\uba8c', GC_LV), ('\uba8d', '\ubaa7', GC_LVT), ('\ubaa8', '\ubaa8', GC_LV), ('\ubaa9', '\ubac3', GC_LVT), ('\ubac4', '\ubac4', GC_LV), ('\ubac5', '\ubadf', GC_LVT), ('\ubae0', '\ubae0', GC_LV), ('\ubae1', '\ubafb', GC_LVT), ('\ubafc', '\ubafc', GC_LV), ('\ubafd', '\ubb17', GC_LVT), ('\ubb18', '\ubb18', GC_LV), ('\ubb19', '\ubb33', GC_LVT), ('\ubb34', '\ubb34', GC_LV), ('\ubb35', '\ubb4f', GC_LVT), ('\ubb50', '\ubb50', GC_LV), ('\ubb51', '\ubb6b', GC_LVT), ('\ubb6c', '\ubb6c', GC_LV), ('\ubb6d', '\ubb87', GC_LVT), ('\ubb88', '\ubb88', GC_LV), ('\ubb89', '\ubba3', GC_LVT), ('\ubba4', '\ubba4', GC_LV), ('\ubba5', '\ubbbf', GC_LVT), ('\ubbc0', '\ubbc0', GC_LV), ('\ubbc1', '\ubbdb', GC_LVT), ('\ubbdc', '\ubbdc', GC_LV), ('\ubbdd', '\ubbf7', GC_LVT), ('\ubbf8', '\ubbf8', GC_LV), ('\ubbf9', '\ubc13', GC_LVT), ('\ubc14', '\ubc14', GC_LV), ('\ubc15', '\ubc2f', GC_LVT), ('\ubc30', '\ubc30', GC_LV), ('\ubc31', '\ubc4b', GC_LVT), ('\ubc4c', '\ubc4c', GC_LV), ('\ubc4d', '\ubc67', GC_LVT), ('\ubc68', '\ubc68', GC_LV), ('\ubc69', '\ubc83', GC_LVT), ('\ubc84', '\ubc84', GC_LV), ('\ubc85', '\ubc9f', GC_LVT), ('\ubca0', '\ubca0', GC_LV), ('\ubca1', '\ubcbb', GC_LVT), ('\ubcbc', '\ubcbc', GC_LV), ('\ubcbd', '\ubcd7', GC_LVT), ('\ubcd8', '\ubcd8', GC_LV), ('\ubcd9', '\ubcf3', GC_LVT), ('\ubcf4', '\ubcf4', GC_LV), ('\ubcf5', '\ubd0f', GC_LVT), ('\ubd10', '\ubd10', GC_LV), ('\ubd11', '\ubd2b', GC_LVT), ('\ubd2c', '\ubd2c', GC_LV), ('\ubd2d', '\ubd47', GC_LVT), ('\ubd48', '\ubd48', GC_LV), ('\ubd49', '\ubd63', GC_LVT), ('\ubd64', '\ubd64', GC_LV), ('\ubd65', '\ubd7f', GC_LVT), ('\ubd80', '\ubd80', GC_LV), ('\ubd81', '\ubd9b', GC_LVT), ('\ubd9c', '\ubd9c', GC_LV), ('\ubd9d', '\ubdb7', GC_LVT), ('\ubdb8', '\ubdb8', GC_LV), ('\ubdb9', '\ubdd3', GC_LVT), ('\ubdd4', '\ubdd4', GC_LV), ('\ubdd5', '\ubdef', GC_LVT), ('\ubdf0', '\ubdf0', GC_LV), ('\ubdf1', '\ube0b', GC_LVT), ('\ube0c', '\ube0c', GC_LV), ('\ube0d', '\ube27', GC_LVT), ('\ube28', '\ube28', GC_LV), ('\ube29', '\ube43', GC_LVT), ('\ube44', '\ube44', GC_LV), ('\ube45', '\ube5f', GC_LVT), ('\ube60', '\ube60', GC_LV), ('\ube61', '\ube7b', GC_LVT), ('\ube7c', '\ube7c', GC_LV), ('\ube7d', '\ube97', GC_LVT), ('\ube98', '\ube98', GC_LV), ('\ube99', '\ubeb3', GC_LVT), ('\ubeb4', '\ubeb4', GC_LV), ('\ubeb5', '\ubecf', GC_LVT), ('\ubed0', '\ubed0', GC_LV), ('\ubed1', '\ubeeb', GC_LVT), ('\ubeec', '\ubeec', GC_LV), ('\ubeed', '\ubf07', GC_LVT), ('\ubf08', '\ubf08', GC_LV), ('\ubf09', '\ubf23', GC_LVT), ('\ubf24', '\ubf24', GC_LV), ('\ubf25', '\ubf3f', GC_LVT), ('\ubf40', '\ubf40', GC_LV), ('\ubf41', '\ubf5b', GC_LVT), ('\ubf5c', '\ubf5c', GC_LV), ('\ubf5d', '\ubf77', GC_LVT), ('\ubf78', '\ubf78', GC_LV), ('\ubf79', '\ubf93', GC_LVT), ('\ubf94', '\ubf94', GC_LV), ('\ubf95', '\ubfaf', GC_LVT), ('\ubfb0', '\ubfb0', GC_LV), ('\ubfb1', '\ubfcb', GC_LVT), ('\ubfcc', '\ubfcc', GC_LV), ('\ubfcd', '\ubfe7', GC_LVT), ('\ubfe8', '\ubfe8', GC_LV), ('\ubfe9', '\uc003', GC_LVT), ('\uc004', '\uc004', GC_LV), ('\uc005', '\uc01f', GC_LVT), ('\uc020', '\uc020', GC_LV), ('\uc021', '\uc03b', GC_LVT), ('\uc03c', '\uc03c', GC_LV), ('\uc03d', '\uc057', GC_LVT), ('\uc058', '\uc058', GC_LV), ('\uc059', '\uc073', GC_LVT), ('\uc074', '\uc074', GC_LV), ('\uc075', '\uc08f', GC_LVT), ('\uc090', '\uc090', GC_LV), ('\uc091', '\uc0ab', GC_LVT), ('\uc0ac', '\uc0ac', GC_LV), ('\uc0ad', '\uc0c7', GC_LVT), ('\uc0c8', '\uc0c8', GC_LV), ('\uc0c9', '\uc0e3', GC_LVT), ('\uc0e4', '\uc0e4', GC_LV), ('\uc0e5', '\uc0ff', GC_LVT), ('\uc100', '\uc100', GC_LV), ('\uc101', '\uc11b', GC_LVT), ('\uc11c', '\uc11c', GC_LV), ('\uc11d', '\uc137', GC_LVT), ('\uc138', '\uc138', GC_LV), ('\uc139', '\uc153', GC_LVT), ('\uc154', '\uc154', GC_LV), ('\uc155', '\uc16f', GC_LVT), ('\uc170', '\uc170', GC_LV), ('\uc171', '\uc18b', GC_LVT), ('\uc18c', '\uc18c', GC_LV), ('\uc18d', '\uc1a7', GC_LVT), ('\uc1a8', '\uc1a8', GC_LV), ('\uc1a9', '\uc1c3', GC_LVT), ('\uc1c4', '\uc1c4', GC_LV), ('\uc1c5', '\uc1df', GC_LVT), ('\uc1e0', '\uc1e0', GC_LV), ('\uc1e1', '\uc1fb', GC_LVT), ('\uc1fc', '\uc1fc', GC_LV), ('\uc1fd', '\uc217', GC_LVT), ('\uc218', '\uc218', GC_LV), ('\uc219', '\uc233', GC_LVT), ('\uc234', '\uc234', GC_LV), ('\uc235', '\uc24f', GC_LVT), ('\uc250', '\uc250', GC_LV), ('\uc251', '\uc26b', GC_LVT), ('\uc26c', '\uc26c', GC_LV), ('\uc26d', '\uc287', GC_LVT), ('\uc288', '\uc288', GC_LV), ('\uc289', '\uc2a3', GC_LVT), ('\uc2a4', '\uc2a4', GC_LV), ('\uc2a5', '\uc2bf', GC_LVT), ('\uc2c0', '\uc2c0', GC_LV), ('\uc2c1', '\uc2db', GC_LVT), ('\uc2dc', '\uc2dc', GC_LV), ('\uc2dd', '\uc2f7', GC_LVT), ('\uc2f8', '\uc2f8', GC_LV), ('\uc2f9', '\uc313', GC_LVT), ('\uc314', '\uc314', GC_LV), ('\uc315', '\uc32f', GC_LVT), ('\uc330', '\uc330', GC_LV), ('\uc331', '\uc34b', GC_LVT), ('\uc34c', '\uc34c', GC_LV), ('\uc34d', '\uc367', GC_LVT), ('\uc368', '\uc368', GC_LV), ('\uc369', '\uc383', GC_LVT), ('\uc384', '\uc384', GC_LV), ('\uc385', '\uc39f', GC_LVT), ('\uc3a0', '\uc3a0', GC_LV), ('\uc3a1', '\uc3bb', GC_LVT), ('\uc3bc', '\uc3bc', GC_LV), ('\uc3bd', '\uc3d7', GC_LVT), ('\uc3d8', '\uc3d8', GC_LV), ('\uc3d9', '\uc3f3', GC_LVT), ('\uc3f4', '\uc3f4', GC_LV), ('\uc3f5', '\uc40f', GC_LVT), ('\uc410', '\uc410', GC_LV), ('\uc411', '\uc42b', GC_LVT), ('\uc42c', '\uc42c', GC_LV), ('\uc42d', '\uc447', GC_LVT), ('\uc448', '\uc448', GC_LV), ('\uc449', '\uc463', GC_LVT), ('\uc464', '\uc464', GC_LV), ('\uc465', '\uc47f', GC_LVT), ('\uc480', '\uc480', GC_LV), ('\uc481', '\uc49b', GC_LVT), ('\uc49c', '\uc49c', GC_LV), ('\uc49d', '\uc4b7', GC_LVT), ('\uc4b8', '\uc4b8', GC_LV), ('\uc4b9', '\uc4d3', GC_LVT), ('\uc4d4', '\uc4d4', GC_LV), ('\uc4d5', '\uc4ef', GC_LVT), ('\uc4f0', '\uc4f0', GC_LV), ('\uc4f1', '\uc50b', GC_LVT), ('\uc50c', '\uc50c', GC_LV), ('\uc50d', '\uc527', GC_LVT), ('\uc528', '\uc528', GC_LV), ('\uc529', '\uc543', GC_LVT), ('\uc544', '\uc544', GC_LV), ('\uc545', '\uc55f', GC_LVT), ('\uc560', '\uc560', GC_LV), ('\uc561', '\uc57b', GC_LVT), ('\uc57c', '\uc57c', GC_LV), ('\uc57d', '\uc597', GC_LVT), ('\uc598', '\uc598', GC_LV), ('\uc599', '\uc5b3', GC_LVT), ('\uc5b4', '\uc5b4', GC_LV), ('\uc5b5', '\uc5cf', GC_LVT), ('\uc5d0', '\uc5d0', GC_LV), ('\uc5d1', '\uc5eb', GC_LVT), ('\uc5ec', '\uc5ec', GC_LV), ('\uc5ed', '\uc607', GC_LVT), ('\uc608', '\uc608', GC_LV), ('\uc609', '\uc623', GC_LVT), ('\uc624', '\uc624', GC_LV), ('\uc625', '\uc63f', GC_LVT), ('\uc640', '\uc640', GC_LV), ('\uc641', '\uc65b', GC_LVT), ('\uc65c', '\uc65c', GC_LV), ('\uc65d', '\uc677', GC_LVT), ('\uc678', '\uc678', GC_LV), ('\uc679', '\uc693', GC_LVT), ('\uc694', '\uc694', GC_LV), ('\uc695', '\uc6af', GC_LVT), ('\uc6b0', '\uc6b0', GC_LV), ('\uc6b1', '\uc6cb', GC_LVT), ('\uc6cc', '\uc6cc', GC_LV), ('\uc6cd', '\uc6e7', GC_LVT), ('\uc6e8', '\uc6e8', GC_LV), ('\uc6e9', '\uc703', GC_LVT), ('\uc704', '\uc704', GC_LV), ('\uc705', '\uc71f', GC_LVT), ('\uc720', '\uc720', GC_LV), ('\uc721', '\uc73b', GC_LVT), ('\uc73c', '\uc73c', GC_LV), ('\uc73d', '\uc757', GC_LVT), ('\uc758', '\uc758', GC_LV), ('\uc759', '\uc773', GC_LVT), ('\uc774', '\uc774', GC_LV), ('\uc775', '\uc78f', GC_LVT), ('\uc790', '\uc790', GC_LV), ('\uc791', '\uc7ab', GC_LVT), ('\uc7ac', '\uc7ac', GC_LV), ('\uc7ad', '\uc7c7', GC_LVT), ('\uc7c8', '\uc7c8', GC_LV), ('\uc7c9', '\uc7e3', GC_LVT), ('\uc7e4', '\uc7e4', GC_LV), ('\uc7e5', '\uc7ff', GC_LVT), ('\uc800', '\uc800', GC_LV), ('\uc801', '\uc81b', GC_LVT), ('\uc81c', '\uc81c', GC_LV), ('\uc81d', '\uc837', GC_LVT), ('\uc838', '\uc838', GC_LV), ('\uc839', '\uc853', GC_LVT), ('\uc854', '\uc854', GC_LV), ('\uc855', '\uc86f', GC_LVT), ('\uc870', '\uc870', GC_LV), ('\uc871', '\uc88b', GC_LVT), ('\uc88c', '\uc88c', GC_LV), ('\uc88d', '\uc8a7', GC_LVT), ('\uc8a8', '\uc8a8', GC_LV), ('\uc8a9', '\uc8c3', GC_LVT), ('\uc8c4', '\uc8c4', GC_LV), ('\uc8c5', '\uc8df', GC_LVT), ('\uc8e0', '\uc8e0', GC_LV), ('\uc8e1', '\uc8fb', GC_LVT), ('\uc8fc', '\uc8fc', GC_LV), ('\uc8fd', '\uc917', GC_LVT), ('\uc918', '\uc918', GC_LV), ('\uc919', '\uc933', GC_LVT), ('\uc934', '\uc934', GC_LV), ('\uc935', '\uc94f', GC_LVT), ('\uc950', '\uc950', GC_LV), ('\uc951', '\uc96b', GC_LVT), ('\uc96c', '\uc96c', GC_LV), ('\uc96d', '\uc987', GC_LVT), ('\uc988', '\uc988', GC_LV), ('\uc989', '\uc9a3', GC_LVT), ('\uc9a4', '\uc9a4', GC_LV), ('\uc9a5', '\uc9bf', GC_LVT), ('\uc9c0', '\uc9c0', GC_LV), ('\uc9c1', '\uc9db', GC_LVT), ('\uc9dc', '\uc9dc', GC_LV), ('\uc9dd', '\uc9f7', GC_LVT), ('\uc9f8', '\uc9f8', GC_LV), ('\uc9f9', '\uca13', GC_LVT), ('\uca14', '\uca14', GC_LV), ('\uca15', '\uca2f', GC_LVT), ('\uca30', '\uca30', GC_LV), ('\uca31', '\uca4b', GC_LVT), ('\uca4c', '\uca4c', GC_LV), ('\uca4d', '\uca67', GC_LVT), ('\uca68', '\uca68', GC_LV), ('\uca69', '\uca83', GC_LVT), ('\uca84', '\uca84', GC_LV), ('\uca85', '\uca9f', GC_LVT), ('\ucaa0', '\ucaa0', GC_LV), ('\ucaa1', '\ucabb', GC_LVT), ('\ucabc', '\ucabc', GC_LV), ('\ucabd', '\ucad7', GC_LVT), ('\ucad8', '\ucad8', GC_LV), ('\ucad9', '\ucaf3', GC_LVT), ('\ucaf4', '\ucaf4', GC_LV), ('\ucaf5', '\ucb0f', GC_LVT), ('\ucb10', '\ucb10', GC_LV), ('\ucb11', '\ucb2b', GC_LVT), ('\ucb2c', '\ucb2c', GC_LV), ('\ucb2d', '\ucb47', GC_LVT), ('\ucb48', '\ucb48', GC_LV), ('\ucb49', '\ucb63', GC_LVT), ('\ucb64', '\ucb64', GC_LV), ('\ucb65', '\ucb7f', GC_LVT), ('\ucb80', '\ucb80', GC_LV), ('\ucb81', '\ucb9b', GC_LVT), ('\ucb9c', '\ucb9c', GC_LV), ('\ucb9d', '\ucbb7', GC_LVT), ('\ucbb8', '\ucbb8', GC_LV), ('\ucbb9', '\ucbd3', GC_LVT), ('\ucbd4', '\ucbd4', GC_LV), ('\ucbd5', '\ucbef', GC_LVT), ('\ucbf0', '\ucbf0', GC_LV), ('\ucbf1', '\ucc0b', GC_LVT), ('\ucc0c', '\ucc0c', GC_LV), ('\ucc0d', '\ucc27', GC_LVT), ('\ucc28', '\ucc28', GC_LV), ('\ucc29', '\ucc43', GC_LVT), ('\ucc44', '\ucc44', GC_LV), ('\ucc45', '\ucc5f', GC_LVT), ('\ucc60', '\ucc60', GC_LV), ('\ucc61', '\ucc7b', GC_LVT), ('\ucc7c', '\ucc7c', GC_LV), ('\ucc7d', '\ucc97', GC_LVT), ('\ucc98', '\ucc98', GC_LV), ('\ucc99', '\uccb3', GC_LVT), ('\uccb4', '\uccb4', GC_LV), ('\uccb5', '\ucccf', GC_LVT), ('\uccd0', '\uccd0', GC_LV), ('\uccd1', '\ucceb', GC_LVT), ('\uccec', '\uccec', GC_LV), ('\ucced', '\ucd07', GC_LVT), ('\ucd08', '\ucd08', GC_LV), ('\ucd09', '\ucd23', GC_LVT), ('\ucd24', '\ucd24', GC_LV), ('\ucd25', '\ucd3f', GC_LVT), ('\ucd40', '\ucd40', GC_LV), ('\ucd41', '\ucd5b', GC_LVT), ('\ucd5c', '\ucd5c', GC_LV), ('\ucd5d', '\ucd77', GC_LVT), ('\ucd78', '\ucd78', GC_LV), ('\ucd79', '\ucd93', GC_LVT), ('\ucd94', '\ucd94', GC_LV), ('\ucd95', '\ucdaf', GC_LVT), ('\ucdb0', '\ucdb0', GC_LV), ('\ucdb1', '\ucdcb', GC_LVT), ('\ucdcc', '\ucdcc', GC_LV), ('\ucdcd', '\ucde7', GC_LVT), ('\ucde8', '\ucde8', GC_LV), ('\ucde9', '\uce03', GC_LVT), ('\uce04', '\uce04', GC_LV), ('\uce05', '\uce1f', GC_LVT), ('\uce20', '\uce20', GC_LV), ('\uce21', '\uce3b', GC_LVT), ('\uce3c', '\uce3c', GC_LV), ('\uce3d', '\uce57', GC_LVT), ('\uce58', '\uce58', GC_LV), ('\uce59', '\uce73', GC_LVT), ('\uce74', '\uce74', GC_LV), ('\uce75', '\uce8f', GC_LVT), ('\uce90', '\uce90', GC_LV), ('\uce91', '\uceab', GC_LVT), ('\uceac', '\uceac', GC_LV), ('\ucead', '\ucec7', GC_LVT), ('\ucec8', '\ucec8', GC_LV), ('\ucec9', '\ucee3', GC_LVT), ('\ucee4', '\ucee4', GC_LV), ('\ucee5', '\uceff', GC_LVT), ('\ucf00', '\ucf00', GC_LV), ('\ucf01', '\ucf1b', GC_LVT), ('\ucf1c', '\ucf1c', GC_LV), ('\ucf1d', '\ucf37', GC_LVT), ('\ucf38', '\ucf38', GC_LV), ('\ucf39', '\ucf53', GC_LVT), ('\ucf54', '\ucf54', GC_LV), ('\ucf55', '\ucf6f', GC_LVT), ('\ucf70', '\ucf70', GC_LV), ('\ucf71', '\ucf8b', GC_LVT), ('\ucf8c', '\ucf8c', GC_LV), ('\ucf8d', '\ucfa7', GC_LVT), ('\ucfa8', '\ucfa8', GC_LV), ('\ucfa9', '\ucfc3', GC_LVT), ('\ucfc4', '\ucfc4', GC_LV), ('\ucfc5', '\ucfdf', GC_LVT), ('\ucfe0', '\ucfe0', GC_LV), ('\ucfe1', '\ucffb', GC_LVT), ('\ucffc', '\ucffc', GC_LV), ('\ucffd', '\ud017', GC_LVT), ('\ud018', '\ud018', GC_LV), ('\ud019', '\ud033', GC_LVT), ('\ud034', '\ud034', GC_LV), ('\ud035', '\ud04f', GC_LVT), ('\ud050', '\ud050', GC_LV), ('\ud051', '\ud06b', GC_LVT), ('\ud06c', '\ud06c', GC_LV), ('\ud06d', '\ud087', GC_LVT), ('\ud088', '\ud088', GC_LV), ('\ud089', '\ud0a3', GC_LVT), ('\ud0a4', '\ud0a4', GC_LV), ('\ud0a5', '\ud0bf', GC_LVT), ('\ud0c0', '\ud0c0', GC_LV), ('\ud0c1', '\ud0db', GC_LVT), ('\ud0dc', '\ud0dc', GC_LV), ('\ud0dd', '\ud0f7', GC_LVT), ('\ud0f8', '\ud0f8', GC_LV), ('\ud0f9', '\ud113', GC_LVT), ('\ud114', '\ud114', GC_LV), ('\ud115', '\ud12f', GC_LVT), ('\ud130', '\ud130', GC_LV), ('\ud131', '\ud14b', GC_LVT), ('\ud14c', '\ud14c', GC_LV), ('\ud14d', '\ud167', GC_LVT), ('\ud168', '\ud168', GC_LV), ('\ud169', '\ud183', GC_LVT), ('\ud184', '\ud184', GC_LV), ('\ud185', '\ud19f', GC_LVT), ('\ud1a0', '\ud1a0', GC_LV), ('\ud1a1', '\ud1bb', GC_LVT), ('\ud1bc', '\ud1bc', GC_LV), ('\ud1bd', '\ud1d7', GC_LVT), ('\ud1d8', '\ud1d8', GC_LV), ('\ud1d9', '\ud1f3', GC_LVT), ('\ud1f4', '\ud1f4', GC_LV), ('\ud1f5', '\ud20f', GC_LVT), ('\ud210', '\ud210', GC_LV), ('\ud211', '\ud22b', GC_LVT), ('\ud22c', '\ud22c', GC_LV), ('\ud22d', '\ud247', GC_LVT), ('\ud248', '\ud248', GC_LV), ('\ud249', '\ud263', GC_LVT), ('\ud264', '\ud264', GC_LV), ('\ud265', '\ud27f', GC_LVT), ('\ud280', '\ud280', GC_LV), ('\ud281', '\ud29b', GC_LVT), ('\ud29c', '\ud29c', GC_LV), ('\ud29d', '\ud2b7', GC_LVT), ('\ud2b8', '\ud2b8', GC_LV), ('\ud2b9', '\ud2d3', GC_LVT), ('\ud2d4', '\ud2d4', GC_LV), ('\ud2d5', '\ud2ef', GC_LVT), ('\ud2f0', '\ud2f0', GC_LV), ('\ud2f1', '\ud30b', GC_LVT), ('\ud30c', '\ud30c', GC_LV), ('\ud30d', '\ud327', GC_LVT), ('\ud328', '\ud328', GC_LV), ('\ud329', '\ud343', GC_LVT), ('\ud344', '\ud344', GC_LV), ('\ud345', '\ud35f', GC_LVT), ('\ud360', '\ud360', GC_LV), ('\ud361', '\ud37b', GC_LVT), ('\ud37c', '\ud37c', GC_LV), ('\ud37d', '\ud397', GC_LVT), ('\ud398', '\ud398', GC_LV), ('\ud399', '\ud3b3', GC_LVT), ('\ud3b4', '\ud3b4', GC_LV), ('\ud3b5', '\ud3cf', GC_LVT), ('\ud3d0', '\ud3d0', GC_LV), ('\ud3d1', '\ud3eb', GC_LVT), ('\ud3ec', '\ud3ec', GC_LV), ('\ud3ed', '\ud407', GC_LVT), ('\ud408', '\ud408', GC_LV), ('\ud409', '\ud423', GC_LVT), ('\ud424', '\ud424', GC_LV), ('\ud425', '\ud43f', GC_LVT), ('\ud440', '\ud440', GC_LV), ('\ud441', '\ud45b', GC_LVT), ('\ud45c', '\ud45c', GC_LV), ('\ud45d', '\ud477', GC_LVT), ('\ud478', '\ud478', GC_LV), ('\ud479', '\ud493', GC_LVT), ('\ud494', '\ud494', GC_LV), ('\ud495', '\ud4af', GC_LVT), ('\ud4b0', '\ud4b0', GC_LV), ('\ud4b1', '\ud4cb', GC_LVT), ('\ud4cc', '\ud4cc', GC_LV), ('\ud4cd', '\ud4e7', GC_LVT), ('\ud4e8', '\ud4e8', GC_LV), ('\ud4e9', '\ud503', GC_LVT), ('\ud504', '\ud504', GC_LV), ('\ud505', '\ud51f', GC_LVT), ('\ud520', '\ud520', GC_LV), ('\ud521', '\ud53b', GC_LVT), ('\ud53c', '\ud53c', GC_LV), ('\ud53d', '\ud557', GC_LVT), ('\ud558', '\ud558', GC_LV), ('\ud559', '\ud573', GC_LVT), ('\ud574', '\ud574', GC_LV), ('\ud575', '\ud58f', GC_LVT), ('\ud590', '\ud590', GC_LV), ('\ud591', '\ud5ab', GC_LVT), ('\ud5ac', '\ud5ac', GC_LV), ('\ud5ad', '\ud5c7', GC_LVT), ('\ud5c8', '\ud5c8', GC_LV), ('\ud5c9', '\ud5e3', GC_LVT), ('\ud5e4', '\ud5e4', GC_LV), ('\ud5e5', '\ud5ff', GC_LVT), ('\ud600', '\ud600', GC_LV), ('\ud601', '\ud61b', GC_LVT), ('\ud61c', '\ud61c', GC_LV), ('\ud61d', '\ud637', GC_LVT), ('\ud638', '\ud638', GC_LV), ('\ud639', '\ud653', GC_LVT), ('\ud654', '\ud654', GC_LV), ('\ud655', '\ud66f', GC_LVT), ('\ud670', '\ud670', GC_LV), ('\ud671', '\ud68b', GC_LVT), ('\ud68c', '\ud68c', GC_LV), ('\ud68d', '\ud6a7', GC_LVT), ('\ud6a8', '\ud6a8', GC_LV), ('\ud6a9', '\ud6c3', GC_LVT), ('\ud6c4', '\ud6c4', GC_LV), ('\ud6c5', '\ud6df', GC_LVT), ('\ud6e0', '\ud6e0', GC_LV), ('\ud6e1', '\ud6fb', GC_LVT), ('\ud6fc', '\ud6fc', GC_LV), ('\ud6fd', '\ud717', GC_LVT), ('\ud718', '\ud718', GC_LV), ('\ud719', '\ud733', GC_LVT), ('\ud734', '\ud734', GC_LV), ('\ud735', '\ud74f', GC_LVT), ('\ud750', '\ud750', GC_LV), ('\ud751', '\ud76b', GC_LVT), ('\ud76c', '\ud76c', GC_LV), ('\ud76d', '\ud787', GC_LVT), ('\ud788', '\ud788', GC_LV), ('\ud789', '\ud7a3', GC_LVT), ('\ud7b0', '\ud7c6', GC_V), ('\ud7cb', '\ud7fb', GC_T), ('\ufb1e', '\ufb1e', GC_Extend), ('\ufe00', '\ufe0f', GC_Extend), ('\ufe20', '\ufe2d', GC_Extend), ('\ufeff', '\ufeff', GC_Control), ('\uff9e', '\uff9f', GC_Extend), ('\ufff0', '\ufffb', GC_Control), ('\U000101fd', '\U000101fd', GC_Extend), ('\U000102e0', '\U000102e0', GC_Extend), ('\U00010376', '\U0001037a', GC_Extend), ('\U00010a01', '\U00010a03', GC_Extend), ('\U00010a05', '\U00010a06', GC_Extend), ('\U00010a0c', '\U00010a0f', GC_Extend), ('\U00010a38', '\U00010a3a', GC_Extend), ('\U00010a3f', '\U00010a3f', GC_Extend), ('\U00010ae5', '\U00010ae6', GC_Extend), ('\U00011000', '\U00011000', GC_SpacingMark), ('\U00011001', '\U00011001', GC_Extend), ('\U00011002', '\U00011002', GC_SpacingMark), ('\U00011038', '\U00011046', GC_Extend), ('\U0001107f', '\U00011081', GC_Extend), ('\U00011082', '\U00011082', GC_SpacingMark), ('\U000110b0', '\U000110b2', GC_SpacingMark), ('\U000110b3', '\U000110b6', GC_Extend), ('\U000110b7', '\U000110b8', GC_SpacingMark), ('\U000110b9', '\U000110ba', GC_Extend), ('\U000110bd', '\U000110bd', GC_Control), ('\U00011100', '\U00011102', GC_Extend), ('\U00011127', '\U0001112b', GC_Extend), ('\U0001112c', '\U0001112c', GC_SpacingMark), ('\U0001112d', '\U00011134', GC_Extend), ('\U00011173', '\U00011173', GC_Extend), ('\U00011180', '\U00011181', GC_Extend), ('\U00011182', '\U00011182', GC_SpacingMark), ('\U000111b3', '\U000111b5', GC_SpacingMark), ('\U000111b6', '\U000111be', GC_Extend), ('\U000111bf', '\U000111c0', GC_SpacingMark), ('\U0001122c', '\U0001122e', GC_SpacingMark), ('\U0001122f', '\U00011231', GC_Extend), ('\U00011232', '\U00011233', GC_SpacingMark), ('\U00011234', '\U00011234', GC_Extend), ('\U00011235', '\U00011235', GC_SpacingMark), ('\U00011236', '\U00011237', GC_Extend), ('\U000112df', '\U000112df', GC_Extend), ('\U000112e0', '\U000112e2', GC_SpacingMark), ('\U000112e3', '\U000112ea', GC_Extend), ('\U00011301', '\U00011301', GC_Extend), ('\U00011302', '\U00011303', GC_SpacingMark), ('\U0001133c', '\U0001133c', GC_Extend), ('\U0001133e', '\U0001133e', GC_Extend), ('\U0001133f', '\U0001133f', GC_SpacingMark), ('\U00011340', '\U00011340', GC_Extend), ('\U00011341', '\U00011344', GC_SpacingMark), ('\U00011347', '\U00011348', GC_SpacingMark), ('\U0001134b', '\U0001134d', GC_SpacingMark), ('\U00011357', '\U00011357', GC_Extend), ('\U00011362', '\U00011363', GC_SpacingMark), ('\U00011366', '\U0001136c', GC_Extend), ('\U00011370', '\U00011374', GC_Extend), ('\U000114b0', '\U000114b0', GC_Extend), ('\U000114b1', '\U000114b2', GC_SpacingMark), ('\U000114b3', '\U000114b8', GC_Extend), ('\U000114b9', '\U000114b9', GC_SpacingMark), ('\U000114ba', '\U000114ba', GC_Extend), ('\U000114bb', '\U000114bc', GC_SpacingMark), ('\U000114bd', '\U000114bd', GC_Extend), ('\U000114be', '\U000114be', GC_SpacingMark), ('\U000114bf', '\U000114c0', GC_Extend), ('\U000114c1', '\U000114c1', GC_SpacingMark), ('\U000114c2', '\U000114c3', GC_Extend), ('\U000115af', '\U000115af', GC_Extend), ('\U000115b0', '\U000115b1', GC_SpacingMark), ('\U000115b2', '\U000115b5', GC_Extend), ('\U000115b8', '\U000115bb', GC_SpacingMark), ('\U000115bc', '\U000115bd', GC_Extend), ('\U000115be', '\U000115be', GC_SpacingMark), ('\U000115bf', '\U000115c0', GC_Extend), ('\U00011630', '\U00011632', GC_SpacingMark), ('\U00011633', '\U0001163a', GC_Extend), ('\U0001163b', '\U0001163c', GC_SpacingMark), ('\U0001163d', '\U0001163d', GC_Extend), ('\U0001163e', '\U0001163e', GC_SpacingMark), ('\U0001163f', '\U00011640', GC_Extend), ('\U000116ab', '\U000116ab', GC_Extend), ('\U000116ac', '\U000116ac', GC_SpacingMark), ('\U000116ad', '\U000116ad', GC_Extend), ('\U000116ae', '\U000116af', GC_SpacingMark), ('\U000116b0', '\U000116b5', GC_Extend), ('\U000116b6', '\U000116b6', GC_SpacingMark), ('\U000116b7', '\U000116b7', GC_Extend), ('\U00016af0', '\U00016af4', GC_Extend), ('\U00016b30', '\U00016b36', GC_Extend), ('\U00016f51', '\U00016f7e', GC_SpacingMark), ('\U00016f8f', '\U00016f92', GC_Extend), ('\U0001bc9d', '\U0001bc9e', GC_Extend), ('\U0001bca0', '\U0001bca3', GC_Control), ('\U0001d165', '\U0001d165', GC_Extend), ('\U0001d166', '\U0001d166', GC_SpacingMark), ('\U0001d167', '\U0001d169', GC_Extend), ('\U0001d16d', '\U0001d16d', GC_SpacingMark), ('\U0001d16e', '\U0001d172', GC_Extend), ('\U0001d173', '\U0001d17a', GC_Control), ('\U0001d17b', '\U0001d182', GC_Extend), ('\U0001d185', '\U0001d18b', GC_Extend), ('\U0001d1aa', '\U0001d1ad', GC_Extend), ('\U0001d242', '\U0001d244', GC_Extend), ('\U0001e8d0', '\U0001e8d6', GC_Extend), ('\U0001f1e6', '\U0001f1ff', GC_RegionalIndicator), ('\U000e0000', '\U000e00ff', GC_Control), ('\U000e0100', '\U000e01ef', GC_Extend), ('\U000e01f0', '\U000e0fff', GC_Control) ]; }
bsearch_range_table
evaluate.py
import torch from model import * from dataloader import * from utils.pyart import * import argparse import numpy as np from pathlib import Path def main(args): print("Processing...") # set device: if torch.cuda.is_available(): device = torch.device('cuda:0') else: device = torch.device('cpu') # make save_dir Path(args.save_dir).mkdir(parents=True, exist_ok=True) # load checkpoint checkpoint = torch.load(args.checkpoint) branchNum = checkpoint['branchNum'] input_dim = checkpoint['input_dim'] branchLs = bnum2ls(branchNum) n_joint = len(branchLs) # load model model = Model(branchNum, input_dim) model.load_state_dict(checkpoint['state_dict']) model = model.to(device) model.eval() # load data IOScale = checkpoint['IOScale'] test_data_loader = ToyDataloader(args.data_path, IOScale, n_workers = 1, batch = 1, shuffle=False) # get IOScale.txt (inputSigma,inputMean),(outputSigma,outputMean) = IOScale inputSigma,inputMean,outputSigma,outputMean = \ inputSigma.detach().numpy(),inputMean.detach().numpy(),outputSigma.detach().numpy(),outputMean.detach().numpy() ScaleInfo = np.array([]).reshape(-1,3) ScaleInfo = np.vstack((ScaleInfo, inputSigma)) ScaleInfo = np.vstack((ScaleInfo, inputMean)) ScaleInfo = np.vstack((ScaleInfo, outputSigma)) ScaleInfo = np.vstack((ScaleInfo, outputMean)) np.savetxt(args.save_dir+"/IOScale.txt",ScaleInfo) # get jointAngle.txt revAngle = np.array([]).reshape(-1,n_joint) priAngle = np.array([]).reshape(-1,n_joint) for input,_ in test_data_loader: input = input.to(device) rev_q_value, pri_q_value = model.q_layer(input) rev_q_value = rev_q_value.detach().cpu().numpy() pri_q_value = pri_q_value.detach().cpu().numpy() revAngle = np.vstack((revAngle,rev_q_value)) priAngle = np.vstack((priAngle,pri_q_value)) np.savetxt(args.save_dir+"/revAngle.txt", revAngle) np.savetxt(args.save_dir+"/priAngle.txt", priAngle) # get branchLs np.savetxt(args.save_dir+'/branchLs.txt',branchLs)
# get targetPose.txt targetPose = test_data_loader.dataset.label targetPose = targetPose.detach().cpu().numpy() np.savetxt(args.save_dir+'/targetPose.txt', targetPose) # get outputPose.txt outputPose = np.array([]).reshape(-1,targetPose.shape[1]) for input,_ in test_data_loader: input = input.to(device) outputPose_temp,_,_ = model(input) outputPose_temp = outputPose_temp[:,:,0:3,3] outputPose_temp = outputPose_temp.reshape(-1,outputPose_temp.size()[1]*outputPose_temp.size()[2]) outputPose_temp = outputPose_temp.detach().cpu().numpy()[0] outputPose = np.vstack((outputPose,outputPose_temp)) np.savetxt(args.save_dir+"/outputPose.txt", outputPose) print("Done...") if __name__ == '__main__': args = argparse.ArgumentParser(description= 'parse for POENet') args.add_argument('--data_path', \ default= './data/Sorosim/SorosimPlot1.txt',type=str, \ help='path to model checkpoint') args.add_argument('--checkpoint', default= './output/0205/10ScaleSoro/checkpoint_100.pth',type=str, help='path to model checkpoint') args.add_argument('--save_dir', default='./2Visualize') args = args.parse_args() main(args)
messages.editChatTitle_handler.go
// Copyright (c) 2018-present, NebulaChat Studio (https://nebula.chat). // All rights reserved. // // 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. // Author: Benqi ([email protected]) package messages import ( "github.com/golang/glog" "github.com/liuhuanqiang/chatengine/pkg/grpc_util" "github.com/liuhuanqiang/chatengine/pkg/logger" "github.com/liuhuanqiang/chatengine/mtproto" "github.com/liuhuanqiang/chatengine/messenger/biz_server/biz/base" "golang.org/x/net/context" "github.com/liuhuanqiang/chatengine/messenger/biz_server/biz/core/update" "github.com/liuhuanqiang/chatengine/messenger/biz_server/biz/core/message" "github.com/liuhuanqiang/chatengine/messenger/biz_server/biz/core" ) // messages.editChatTitle#dc452855 chat_id:int title:string = Updates; func (s *MessagesServiceImpl) MessagesEditChatTitle(ctx context.Context, request *mtproto.TLMessagesEditChatTitle) (*mtproto.Updates, error) { md := grpc_util.RpcMetadataFromIncoming(ctx) glog.Infof("messages.editChatTitle#dc452855 - metadata: %s, request: %s", logger.JsonDebugData(md), logger.JsonDebugData(request)) chatLogic, err := s.ChatModel.NewChatLogicById(request.ChatId) if err != nil { glog.Error("messages.editChatTitle#dc452855 - error: ", err) return nil, err } peer := &base.PeerUtil{ PeerType: base.PEER_CHAT, PeerId: chatLogic.GetChatId(), } err = chatLogic.EditChatTitle(md.UserId, request.Title) if err != nil { glog.Error("messages.editChatTitle#dc452855 - error: ", err) return nil, err } chatEditMessage := chatLogic.MakeChatEditTitleMessage(md.UserId, request.Title) randomId := core.GetUUID() resultCB := func(pts, ptsCount int32, outBox *message.MessageBox2) (*mtproto.Updates, error) { syncUpdates := updates.NewUpdatesLogic(md.UserId) updateChatParticipants := &mtproto.TLUpdateChatParticipants{Data2: &mtproto.Update_Data{ Participants: chatLogic.GetChatParticipants().To_ChatParticipants(), }} syncUpdates.AddUpdate(updateChatParticipants.To_Update()) syncUpdates.AddUpdateNewMessage(pts, ptsCount, outBox.ToMessage(outBox.OwnerId)) syncUpdates.AddUsers(s.UserModel.GetUserListByIdList(md.UserId, chatLogic.GetChatParticipantIdList())) syncUpdates.AddChat(chatLogic.ToChat(md.UserId)) syncUpdates.AddUpdateMessageId(outBox.MessageId, outBox.RandomId) return syncUpdates.ToUpdates(), nil } syncNotMeCB := func(pts, ptsCount int32, outBox *message.MessageBox2) (int64, *mtproto.Updates, error) { syncUpdates := updates.NewUpdatesLogic(md.UserId) updateChatParticipants := &mtproto.TLUpdateChatParticipants{Data2: &mtproto.Update_Data{ Participants: chatLogic.GetChatParticipants().To_ChatParticipants(), }} syncUpdates.AddUpdate(updateChatParticipants.To_Update()) syncUpdates.AddUpdateNewMessage(pts, ptsCount, outBox.ToMessage(outBox.OwnerId)) syncUpdates.AddUsers(s.UserModel.GetUserListByIdList(md.UserId, chatLogic.GetChatParticipantIdList())) syncUpdates.AddChat(chatLogic.ToChat(md.UserId)) return md.AuthId, syncUpdates.ToUpdates(), nil } pushCB := func(pts, ptsCount int32, inBox *message.MessageBox2) (*mtproto.Updates, error) { pushUpdates := updates.NewUpdatesLogic(md.UserId) updateChatParticipants := &mtproto.TLUpdateChatParticipants{Data2: &mtproto.Update_Data{ Participants: chatLogic.GetChatParticipants().To_ChatParticipants(), }} pushUpdates.AddUpdate(updateChatParticipants.To_Update()) pushUpdates.AddUpdateNewMessage(pts, ptsCount, inBox.ToMessage(inBox.OwnerId)) pushUpdates.AddUsers(s.UserModel.GetUserListByIdList(inBox.OwnerId, chatLogic.GetChatParticipantIdList())) pushUpdates.AddChat(chatLogic.ToChat(inBox.OwnerId)) return pushUpdates.ToUpdates(), nil } replyUpdates, _ := s.MessageModel.SendMessage( md.UserId, peer,
randomId, chatEditMessage, resultCB, syncNotMeCB, pushCB) glog.Infof("messages.editChatTitle#dc452855 - reply: {%v}", replyUpdates) return replyUpdates, nil }
tup.rs
// -*- rust -*- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. type point = (int, int); fn f(p: point, x: int, y: int) { let (a, b) = p; assert_eq!(a, x); assert_eq!(b, y); } pub fn main() { let p: point = (10, 20); let (a, b) = p;
assert_eq!(b, 20); let p2: point = p; f(p, 10, 20); f(p2, 10, 20); }
assert_eq!(a, 10);
nvic_icer2.rs
#[doc = "Register `NVIC_ICER2` reader"] pub struct R(crate::R<NVIC_ICER2_SPEC>); impl core::ops::Deref for R { type Target = crate::R<NVIC_ICER2_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<NVIC_ICER2_SPEC>> for R { #[inline(always)] fn from(reader: crate::R<NVIC_ICER2_SPEC>) -> Self { R(reader) } } #[doc = "Register `NVIC_ICER2` writer"] pub struct
(crate::W<NVIC_ICER2_SPEC>); impl core::ops::Deref for W { type Target = crate::W<NVIC_ICER2_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::ops::DerefMut for W { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl From<crate::W<NVIC_ICER2_SPEC>> for W { #[inline(always)] fn from(writer: crate::W<NVIC_ICER2_SPEC>) -> Self { W(writer) } } #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u32)] pub enum CLRENA_A { #[doc = "0: interrupt disabled"] VALUE3 = 0, #[doc = "1: interrupt enabled."] VALUE4 = 1, } impl From<CLRENA_A> for u32 { #[inline(always)] fn from(variant: CLRENA_A) -> Self { variant as _ } } #[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] pub struct CLRENA_R(crate::FieldReader<u32, CLRENA_A>); impl CLRENA_R { pub(crate) fn new(bits: u32) -> Self { CLRENA_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> Option<CLRENA_A> { match self.bits { 0 => Some(CLRENA_A::VALUE3), 1 => Some(CLRENA_A::VALUE4), _ => None, } } #[doc = "Checks if the value of the field is `VALUE3`"] #[inline(always)] pub fn is_value3(&self) -> bool { **self == CLRENA_A::VALUE3 } #[doc = "Checks if the value of the field is `VALUE4`"] #[inline(always)] pub fn is_value4(&self) -> bool { **self == CLRENA_A::VALUE4 } } impl core::ops::Deref for CLRENA_R { type Target = crate::FieldReader<u32, CLRENA_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] pub struct CLRENA_W<'a> { w: &'a mut W, } impl<'a> CLRENA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLRENA_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "interrupt disabled"] #[inline(always)] pub fn value3(self) -> &'a mut W { self.variant(CLRENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] pub fn value4(self) -> &'a mut W { self.variant(CLRENA_A::VALUE4) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); self.w } } impl R { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] pub fn clrena(&self) -> CLRENA_R { CLRENA_R::new((self.bits & 0xffff_ffff) as u32) } } impl W { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] pub fn clrena(&mut self) -> CLRENA_W { CLRENA_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "Interrupt Clear-enable Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nvic_icer2](index.html) module"] pub struct NVIC_ICER2_SPEC; impl crate::RegisterSpec for NVIC_ICER2_SPEC { type Ux = u32; } #[doc = "`read()` method returns [nvic_icer2::R](R) reader structure"] impl crate::Readable for NVIC_ICER2_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [nvic_icer2::W](W) writer structure"] impl crate::Writable for NVIC_ICER2_SPEC { type Writer = W; } #[doc = "`reset()` method sets NVIC_ICER2 to value 0"] impl crate::Resettable for NVIC_ICER2_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } }
W
progress.rs
use std::env; use std::ops::Deref; use std::sync::Arc; use std::time::Instant; use crate::utils::logging; pub use indicatif::{ProgressDrawTarget, ProgressStyle}; pub fn is_progress_bar_visible() -> bool { env::var("SENTRY_NO_PROGRESS_BAR") != Ok("1".into()) } pub struct ProgressBar { inner: Arc<indicatif::ProgressBar>, start: Instant, } impl ProgressBar { pub fn new(len: usize) -> Self { if is_progress_bar_visible() { indicatif::ProgressBar::new(len as u64).into() } else { Self::hidden() } } pub fn new_spinner() -> Self { if is_progress_bar_visible() { indicatif::ProgressBar::new_spinner().into() } else { Self::hidden() } } pub fn hidden() -> Self { indicatif::ProgressBar::hidden().into() } pub fn finish(&self) { self.inner.finish(); logging::set_progress_bar(None); } pub fn finish_with_message(&self, msg: &str) { self.inner.finish_with_message(msg); logging::set_progress_bar(None); } pub fn finish_with_duration(&self, op: &str) { let dur = self.start.elapsed(); // We could use `dur.as_secs_f64()`, but its unnecessarily precise (micros). Millis are enough for our purpose. let msg = format!("{} completed in {}s", op, dur.as_millis() as f64 / 1000.0); let progress_style = ProgressStyle::default_bar().template("{prefix:.dim} {msg}"); self.inner.set_style(progress_style); self.inner.set_prefix(">"); self.inner.finish_with_message(&msg); logging::set_progress_bar(None); } pub fn finish_and_clear(&self) { self.inner.finish_and_clear(); logging::set_progress_bar(None); } }
impl From<indicatif::ProgressBar> for ProgressBar { fn from(pb: indicatif::ProgressBar) -> Self { let inner = Arc::new(pb); logging::set_progress_bar(Some(Arc::downgrade(&inner))); ProgressBar { inner, start: Instant::now(), } } } impl Deref for ProgressBar { type Target = indicatif::ProgressBar; fn deref(&self) -> &Self::Target { &self.inner } }
ember-try.js
'use strict';
useYarn: true, scenarios: [ { name: 'ember-lts-2.12', env: { EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), }, npm: { devDependencies: { '@ember/jquery': '^0.5.1', 'ember-source': '~2.12.0' } } }, { name: 'ember-lts-2.16', env: { EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), }, npm: { devDependencies: { '@ember/jquery': '^0.5.1', 'ember-source': '~2.16.0' } } }, { name: 'ember-lts-2.18', env: { EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }) }, npm: { devDependencies: { '@ember/jquery': '^0.5.1', 'ember-source': '~2.18.0' } } }, { name: 'ember-lts-3.4', npm: { devDependencies: { 'ember-source': '~3.4.0' } } }, { name: 'ember-lts-3.8', npm: { devDependencies: { 'ember-source': '~3.8.0' } } }, { name: 'ember-release', npm: { devDependencies: { 'ember-source': await getChannelURL('release') } } }, { name: 'ember-beta', npm: { devDependencies: { 'ember-source': await getChannelURL('beta') } } }, { name: 'ember-canary', npm: { devDependencies: { 'ember-source': await getChannelURL('canary') } } }, // The default `.travis.yml` runs this scenario via `npm test`, // not via `ember try`. It's still included here so that running // `ember try:each` manually or from a customized CI config will run it // along with all the other scenarios. { name: 'ember-default', npm: { devDependencies: {} } }, { name: 'ember-default-with-jquery', env: { EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }) }, npm: { devDependencies: { '@ember/jquery': '^0.5.1' } } } ] }; };
const getChannelURL = require('ember-source-channel-url'); module.exports = async function() { return {
lib.rs
// Copyright 2014-2020 bluss and ndarray developers. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_name = "ndarray"] #![doc(html_root_url = "https://docs.rs/ndarray/0.15/")] #![doc(html_logo_url = "https://rust-ndarray.github.io/images/rust-ndarray_logo.svg")] #![allow( clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::manual_map, // is not an error clippy::while_let_on_iterator, // is not an error clippy::from_iter_instead_of_collect, // using from_iter is good style clippy::if_then_panic, // is not an error clippy::redundant_closure, // false positives clippy #7812 )] #![doc(test(attr(deny(warnings))))] #![doc(test(attr(allow(unused_variables))))] #![doc(test(attr(allow(deprecated))))] #![cfg_attr(not(feature = "std"), no_std)] //! The `ndarray` crate provides an *n*-dimensional container for general elements //! and for numerics. //! //! In *n*-dimensional we include, for example, 1-dimensional rows or columns, //! 2-dimensional matrices, and higher dimensional arrays. If the array has *n* //! dimensions, then an element in the array is accessed by using that many indices. //! Each dimension is also called an *axis*. //! //! - **[`ArrayBase`]**: //! The *n*-dimensional array type itself.<br> //! It is used to implement both the owned arrays and the views; see its docs //! for an overview of all array features.<br> //! - The main specific array type is **[`Array`]**, which owns //! its elements. //! //! ## Highlights //! //! - Generic *n*-dimensional array //! - Slicing, also with arbitrary step size, and negative indices to mean //! elements from the end of the axis. //! - Views and subviews of arrays; iterators that yield subviews. //! - Higher order operations and arithmetic are performant //! - Array views can be used to slice and mutate any `[T]` data using //! `ArrayView::from` and `ArrayViewMut::from`. //! - [`Zip`] for lock step function application across two or more arrays or other //! item producers ([`NdProducer`] trait). //! //! ## Crate Status //! //! - Still iterating on and evolving the crate //! + The crate is continuously developing, and breaking changes are expected //! during evolution from version to version. We adopt the newest stable //! rust features if we need them. //! + Note that functions/methods/traits/etc. hidden from the docs are not //! considered part of the public API, so changes to them are not //! considered breaking changes. //! - Performance: //! + Prefer higher order methods and arithmetic operations on arrays first, //! then iteration, and as a last priority using indexed algorithms. //! + The higher order functions like [`.map()`](ArrayBase::map), //! [`.map_inplace()`](ArrayBase::map_inplace), [`.zip_mut_with()`](ArrayBase::zip_mut_with), //! [`Zip`] and [`azip!()`](azip) are the most efficient ways //! to perform single traversal and lock step traversal respectively. //! + Performance of an operation depends on the memory layout of the array //! or array view. Especially if it's a binary operation, which //! needs matching memory layout to be efficient (with some exceptions). //! + Efficient floating point matrix multiplication even for very large //! matrices; can optionally use BLAS to improve it further. //! - **Requires Rust 1.49 or later** //! //! ## Crate Feature Flags //! //! The following crate feature flags are available. They are configured in your //! `Cargo.toml`. //! //! - `std` //! - Rust standard library (enabled by default) //! - This crate can be used without the standard library by disabling the //! default `std` feature. To do so, use `default-features = false` in //! your `Cargo.toml`. //! - The `geomspace` `linspace` `logspace` `range` `std` `var` `var_axis` //! and `std_axis` methods are only available when `std` is enabled. //! - `serde` //! - Enables serialization support for serde 1.x //! - `rayon` //! - Enables parallel iterators, parallelized methods, the [`parallel`] module and [`par_azip!`]. //! - Implies std //! - `approx` //! - Enables implementations of traits from the [`approx`] crate. //! - `blas` //! - Enable transparent BLAS support for matrix multiplication. //! Uses ``blas-src`` for pluggable backend, which needs to be configured //! separately (see the README). //! - `matrixmultiply-threading` //! - Enable the ``threading`` feature in the matrixmultiply package //! //! ## Documentation //! //! * The docs for [`ArrayBase`] provide an overview of //! the *n*-dimensional array type. Other good pages to look at are the //! documentation for the [`s![]`](s!) and //! [`azip!()`](azip!) macros. //! //! * If you have experience with NumPy, you may also be interested in //! [`ndarray_for_numpy_users`](doc::ndarray_for_numpy_users). //! //! ## The ndarray ecosystem //! //! `ndarray` provides a lot of functionality, but it's not a one-stop solution. //! //! `ndarray` includes matrix multiplication and other binary/unary operations out of the box. //! More advanced linear algebra routines (e.g. SVD decomposition or eigenvalue computation) //! can be found in [`ndarray-linalg`](https://crates.io/crates/ndarray-linalg). //! //! The same holds for statistics: `ndarray` provides some basic functionalities (e.g. `mean`) //! but more advanced routines can be found in [`ndarray-stats`](https://crates.io/crates/ndarray-stats). //! //! If you are looking to generate random arrays instead, check out [`ndarray-rand`](https://crates.io/crates/ndarray-rand). //! //! For conversion between `ndarray`, [`nalgebra`](https://crates.io/crates/nalgebra) and //! [`image`](https://crates.io/crates/image) check out [`nshare`](https://crates.io/crates/nshare). extern crate alloc; #[cfg(feature = "std")] extern crate std; #[cfg(not(feature = "std"))] extern crate core as std; #[cfg(feature = "blas")] extern crate cblas_sys; #[cfg(feature = "docs")] pub mod doc; use std::marker::PhantomData; use alloc::sync::Arc; pub use crate::dimension::dim::*; pub use crate::dimension::{Axis, AxisDescription, Dimension, IntoDimension, RemoveAxis}; pub use crate::dimension::{DimAdd, DimMax}; pub use crate::dimension::IxDynImpl; pub use crate::dimension::NdIndex; pub use crate::error::{ErrorKind, ShapeError}; pub use crate::indexes::{indices, indices_of}; pub use crate::order::Order; pub use crate::slice::{ MultiSliceArg, NewAxis, Slice, SliceArg, SliceInfo, SliceInfoElem, SliceNextDim, }; use crate::iterators::Baseiter; use crate::iterators::{ElementsBase, ElementsBaseMut, Iter, IterMut}; pub use crate::arraytraits::AsArray; #[cfg(feature = "std")] pub use crate::linalg_traits::NdFloat; pub use crate::linalg_traits::LinalgScalar; #[allow(deprecated)] // stack_new_axis pub use crate::stacking::{concatenate, stack, stack_new_axis}; pub use crate::math_cell::MathCell; pub use crate::impl_views::IndexLonger; pub use crate::shape_builder::{Shape, ShapeBuilder, ShapeArg, StrideShape}; #[macro_use] mod macro_utils; #[macro_use] mod private; mod aliases; #[macro_use] mod itertools; mod argument_traits; #[cfg(feature = "serde")] mod array_serde; mod arrayformat; mod arraytraits; pub use crate::argument_traits::AssignElem; mod data_repr; mod data_traits; pub use crate::aliases::*; pub use crate::data_traits::{ Data, DataMut, DataOwned, DataShared, RawData, RawDataClone, RawDataMut, RawDataSubst, }; mod free_functions; pub use crate::free_functions::*; pub use crate::iterators::iter; mod error; mod extension; mod geomspace; mod indexes; mod iterators; mod layout; mod linalg_traits; mod linspace; mod logspace; mod math_cell; mod numeric_util; mod order; mod partial; mod shape_builder; #[macro_use] mod slice; mod split_at; mod stacking; mod low_level_util; #[macro_use] mod zip; mod dimension; pub use crate::zip::{FoldWhile, IntoNdProducer, NdProducer, Zip}; pub use crate::layout::Layout; /// Implementation's prelude. Common types used everywhere. mod imp_prelude { pub use crate::dimension::DimensionExt; pub use crate::prelude::*; pub use crate::ArcArray; pub use crate::{ CowRepr, Data, DataMut, DataOwned, DataShared, Ix, Ixs, RawData, RawDataMut, RawViewRepr, RemoveAxis, ViewRepr, }; } pub mod prelude; /// Array index type pub type Ix = usize; /// Array index type (signed) pub type Ixs = isize; /// An *n*-dimensional array. /// /// The array is a general container of elements. It cannot grow or shrink (with some exceptions), /// but can be sliced into subsets of its data. /// The array supports arithmetic operations by applying them elementwise. /// /// In *n*-dimensional we include for example 1-dimensional rows or columns, /// 2-dimensional matrices, and higher dimensional arrays. If the array has *n* /// dimensions, then an element is accessed by using that many indices. /// /// The `ArrayBase<S, D>` is parameterized by `S` for the data container and /// `D` for the dimensionality. /// /// Type aliases [`Array`], [`ArcArray`], [`CowArray`], [`ArrayView`], and /// [`ArrayViewMut`] refer to `ArrayBase` with different types for the data /// container. /// /// ## Contents /// /// + [Array](#array) /// + [ArcArray](#arcarray) /// + [CowArray](#cowarray) /// + [Array Views](#array-views) /// + [Indexing and Dimension](#indexing-and-dimension) /// + [Loops, Producers and Iterators](#loops-producers-and-iterators) /// + [Slicing](#slicing) /// + [Subviews](#subviews) /// + [Arithmetic Operations](#arithmetic-operations) /// + [Broadcasting](#broadcasting) /// + [Conversions](#conversions) /// + [Constructor Methods for Owned Arrays](#constructor-methods-for-owned-arrays) /// + [Methods For All Array Types](#methods-for-all-array-types) /// + [Methods For 1-D Arrays](#methods-for-1-d-arrays) /// + [Methods For 2-D Arrays](#methods-for-2-d-arrays) /// + [Methods for Dynamic-Dimensional Arrays](#methods-for-dynamic-dimensional-arrays) /// + [Numerical Methods for Arrays](#numerical-methods-for-arrays) /// /// ## `Array` /// /// [`Array`] is an owned array that owns the underlying array /// elements directly (just like a `Vec`) and it is the default way to create and /// store n-dimensional data. `Array<A, D>` has two type parameters: `A` for /// the element type, and `D` for the dimensionality. A particular /// dimensionality's type alias like `Array3<A>` just has the type parameter /// `A` for element type. /// /// An example: /// /// ``` /// // Create a three-dimensional f64 array, initialized with zeros /// use ndarray::Array3; /// let mut temperature = Array3::<f64>::zeros((3, 4, 5)); /// // Increase the temperature in this location /// temperature[[2, 2, 2]] += 0.5; /// ``` /// /// ## `ArcArray` /// /// [`ArcArray`] is an owned array with reference counted /// data (shared ownership). /// Sharing requires that it uses copy-on-write for mutable operations. /// Calling a method for mutating elements on `ArcArray`, for example /// [`view_mut()`](Self::view_mut) or [`get_mut()`](Self::get_mut), /// will break sharing and require a clone of the data (if it is not uniquely held). /// /// ## `CowArray` /// /// [`CowArray`] is analogous to [`std::borrow::Cow`]. /// It can represent either an immutable view or a uniquely owned array. If a /// `CowArray` instance is the immutable view variant, then calling a method /// for mutating elements in the array will cause it to be converted into the /// owned variant (by cloning all the elements) before the modification is /// performed. /// /// ## Array Views /// /// [`ArrayView`] and [`ArrayViewMut`] are read-only and read-write array views /// respectively. They use dimensionality, indexing, and almost all other /// methods the same way as the other array types. /// /// Methods for `ArrayBase` apply to array views too, when the trait bounds /// allow. /// /// Please see the documentation for the respective array view for an overview /// of methods specific to array views: [`ArrayView`], [`ArrayViewMut`]. /// /// A view is created from an array using [`.view()`](ArrayBase::view), /// [`.view_mut()`](ArrayBase::view_mut), using /// slicing ([`.slice()`](ArrayBase::slice), [`.slice_mut()`](ArrayBase::slice_mut)) or from one of /// the many iterators that yield array views. /// /// You can also create an array view from a regular slice of data not /// allocated with `Array` — see array view methods or their `From` impls. /// /// Note that all `ArrayBase` variants can change their view (slicing) of the /// data freely, even when their data can’t be mutated. /// /// ## Indexing and Dimension /// /// The dimensionality of the array determines the number of *axes*, for example /// a 2D array has two axes. These are listed in “big endian” order, so that /// the greatest dimension is listed first, the lowest dimension with the most /// rapidly varying index is the last. /// /// In a 2D array the index of each element is `[row, column]` as seen in this /// 4 × 3 example: /// /// ```ignore /// [[ [0, 0], [0, 1], [0, 2] ], // row 0 /// [ [1, 0], [1, 1], [1, 2] ], // row 1 /// [ [2, 0], [2, 1], [2, 2] ], // row 2 /// [ [3, 0], [3, 1], [3, 2] ]] // row 3 /// // \ \ \ /// // column 0 \ column 2 /// // column 1 /// ``` /// /// The number of axes for an array is fixed by its `D` type parameter: `Ix1` /// for a 1D array, `Ix2` for a 2D array etc. The dimension type `IxDyn` allows /// a dynamic number of axes. /// /// A fixed size array (`[usize; N]`) of the corresponding dimensionality is /// used to index the `Array`, making the syntax `array[[` i, j, ...`]]` /// /// ``` /// use ndarray::Array2; /// let mut array = Array2::zeros((4, 3)); /// array[[1, 1]] = 7; /// ``` /// /// Important traits and types for dimension and indexing: /// /// - A [`struct@Dim`] value represents a dimensionality or index. /// - Trait [`Dimension`] is implemented by all /// dimensionalities. It defines many operations for dimensions and indices. /// - Trait [`IntoDimension`] is used to convert into a /// `Dim` value. /// - Trait [`ShapeBuilder`] is an extension of /// `IntoDimension` and is used when constructing an array. A shape describes /// not just the extent of each axis but also their strides. /// - Trait [`NdIndex`] is an extension of `Dimension` and is /// for values that can be used with indexing syntax. /// /// /// The default memory order of an array is *row major* order (a.k.a “c” order), /// where each row is contiguous in memory. /// A *column major* (a.k.a. “f” or fortran) memory order array has /// columns (or, in general, the outermost axis) with contiguous elements. /// /// The logical order of any array’s elements is the row major order /// (the rightmost index is varying the fastest). /// The iterators `.iter(), .iter_mut()` always adhere to this order, for example. /// /// ## Loops, Producers and Iterators /// /// Using [`Zip`] is the most general way to apply a procedure /// across one or several arrays or *producers*. /// /// [`NdProducer`] is like an iterable but for /// multidimensional data. All producers have dimensions and axes, like an /// array view, and they can be split and used with parallelization using `Zip`. /// /// For example, `ArrayView<A, D>` is a producer, it has the same dimensions /// as the array view and for each iteration it produces a reference to /// the array element (`&A` in this case). /// /// Another example, if we have a 10 × 10 array and use `.exact_chunks((2, 2))` /// we get a producer of chunks which has the dimensions 5 × 5 (because /// there are *10 / 2 = 5* chunks in either direction). The 5 × 5 chunks producer /// can be paired with any other producers of the same dimension with `Zip`, for /// example 5 × 5 arrays. /// /// ### `.iter()` and `.iter_mut()` /// /// These are the element iterators of arrays and they produce an element /// sequence in the logical order of the array, that means that the elements /// will be visited in the sequence that corresponds to increasing the /// last index first: *0, ..., 0, 0*; *0, ..., 0, 1*; *0, ...0, 2* and so on. /// /// ### `.outer_iter()` and `.axis_iter()` /// /// These iterators produce array views of one smaller dimension. /// /// For example, for a 2D array, `.outer_iter()` will produce the 1D rows. /// For a 3D array, `.outer_iter()` produces 2D subviews. /// /// `.axis_iter()` is like `outer_iter()` but allows you to pick which /// axis to traverse. /// /// The `outer_iter` and `axis_iter` are one dimensional producers. /// /// ## `.rows()`, `.columns()` and `.lanes()` /// /// [`.rows()`][gr] is a producer (and iterable) of all rows in an array. /// /// ``` /// use ndarray::Array; /// /// // 1. Loop over the rows of a 2D array /// let mut a = Array::zeros((10, 10)); /// for mut row in a.rows_mut() { /// row.fill(1.); /// } /// /// // 2. Use Zip to pair each row in 2D `a` with elements in 1D `b` /// use ndarray::Zip; /// let mut b = Array::zeros(a.nrows()); /// /// Zip::from(a.rows()) /// .and(&mut b) /// .for_each(|a_row, b_elt| { /// *b_elt = a_row[a.ncols() - 1] - a_row[0]; /// }); /// ``` /// /// The *lanes* of an array are 1D segments along an axis and when pointed /// along the last axis they are *rows*, when pointed along the first axis /// they are *columns*. /// /// A *m* × *n* array has *m* rows each of length *n* and conversely /// *n* columns each of length *m*. /// /// To generalize this, we say that an array of dimension *a* × *m* × *n* /// has *a m* rows. It's composed of *a* times the previous array, so it /// has *a* times as many rows. /// /// All methods: [`.rows()`][gr], [`.rows_mut()`][grm], /// [`.columns()`][gc], [`.columns_mut()`][gcm], /// [`.lanes(axis)`][l], [`.lanes_mut(axis)`][lm]. /// /// [gr]: Self::rows /// [grm]: Self::rows_mut /// [gc]: Self::columns /// [gcm]: Self::columns_mut /// [l]: Self::lanes /// [lm]: Self::lanes_mut /// /// Yes, for 2D arrays `.rows()` and `.outer_iter()` have about the same /// effect: /// /// + `rows()` is a producer with *n* - 1 dimensions of 1 dimensional items /// + `outer_iter()` is a producer with 1 dimension of *n* - 1 dimensional items /// /// ## Slicing /// /// You can use slicing to create a view of a subset of the data in /// the array. Slicing methods include [`.slice()`], [`.slice_mut()`], /// [`.slice_move()`], and [`.slice_collapse()`]. /// /// The slicing argument can be passed using the macro [`s![]`](s!), /// which will be used in all examples. (The explicit form is an instance of /// [`SliceInfo`] or another type which implements [`SliceArg`]; see their docs /// for more information.) /// /// If a range is used, the axis is preserved. If an index is used, that index /// is selected and the axis is removed; this selects a subview. See /// [*Subviews*](#subviews) for more information about subviews. If a /// [`NewAxis`] instance is used, a new axis is inserted. Note that /// [`.slice_collapse()`] panics on `NewAxis` elements and behaves like /// [`.collapse_axis()`] by preserving the number of dimensions. /// /// [`.slice()`]: Self::slice /// [`.slice_mut()`]: Self::slice_mut /// [`.slice_move()`]: Self::slice_move /// [`.slice_collapse()`]: Self::slice_collapse /// /// When slicing arrays with generic dimensionality, creating an instance of /// [`SliceInfo`] to pass to the multi-axis slicing methods like [`.slice()`] /// is awkward. In these cases, it's usually more convenient to use /// [`.slice_each_axis()`]/[`.slice_each_axis_mut()`]/[`.slice_each_axis_inplace()`] /// or to create a view and then slice individual axes of the view using /// methods such as [`.slice_axis_inplace()`] and [`.collapse_axis()`]. /// /// [`.slice_each_axis()`]: Self::slice_each_axis /// [`.slice_each_axis_mut()`]: Self::slice_each_axis_mut /// [`.slice_each_axis_inplace()`]: Self::slice_each_axis_inplace /// [`.slice_axis_inplace()`]: Self::slice_axis_inplace /// [`.collapse_axis()`]: Self::collapse_axis /// /// It's possible to take multiple simultaneous *mutable* slices with /// [`.multi_slice_mut()`] or (for [`ArrayViewMut`] only) /// [`.multi_slice_move()`]. /// /// [`.multi_slice_mut()`]: Self::multi_slice_mut /// [`.multi_slice_move()`]: ArrayViewMut#method.multi_slice_move /// /// ``` /// use ndarray::{arr2, arr3, s, ArrayBase, DataMut, Dimension, NewAxis, Slice}; /// /// // 2 submatrices of 2 rows with 3 elements per row, means a shape of `[2, 2, 3]`. /// /// let a = arr3(&[[[ 1, 2, 3], // -- 2 rows \_ /// [ 4, 5, 6]], // -- / /// [[ 7, 8, 9], // \_ 2 submatrices /// [10, 11, 12]]]); // / /// // 3 columns ..../.../.../ /// /// assert_eq!(a.shape(), &[2, 2, 3]); /// /// // Let’s create a slice with /// // /// // - Both of the submatrices of the greatest dimension: `..` /// // - Only the first row in each submatrix: `0..1` /// // - Every element in each row: `..` /// /// let b = a.slice(s![.., 0..1, ..]); /// let c = arr3(&[[[ 1, 2, 3]], /// [[ 7, 8, 9]]]); /// assert_eq!(b, c); /// assert_eq!(b.shape(), &[2, 1, 3]); /// /// // Let’s create a slice with /// // /// // - Both submatrices of the greatest dimension: `..` /// // - The last row in each submatrix: `-1..` /// // - Row elements in reverse order: `..;-1` /// let d = a.slice(s![.., -1.., ..;-1]); /// let e = arr3(&[[[ 6, 5, 4]], /// [[12, 11, 10]]]);
/// assert_eq!(d, e); /// assert_eq!(d.shape(), &[2, 1, 3]); /// /// // Let’s create a slice while selecting a subview and inserting a new axis with /// // /// // - Both submatrices of the greatest dimension: `..` /// // - The last row in each submatrix, removing that axis: `-1` /// // - Row elements in reverse order: `..;-1` /// // - A new axis at the end. /// let f = a.slice(s![.., -1, ..;-1, NewAxis]); /// let g = arr3(&[[ [6], [5], [4]], /// [[12], [11], [10]]]); /// assert_eq!(f, g); /// assert_eq!(f.shape(), &[2, 3, 1]); /// /// // Let's take two disjoint, mutable slices of a matrix with /// // /// // - One containing all the even-index columns in the matrix /// // - One containing all the odd-index columns in the matrix /// let mut h = arr2(&[[0, 1, 2, 3], /// [4, 5, 6, 7]]); /// let (s0, s1) = h.multi_slice_mut((s![.., ..;2], s![.., 1..;2])); /// let i = arr2(&[[0, 2], /// [4, 6]]); /// let j = arr2(&[[1, 3], /// [5, 7]]); /// assert_eq!(s0, i); /// assert_eq!(s1, j); /// /// // Generic function which assigns the specified value to the elements which /// // have indices in the lower half along all axes. /// fn fill_lower<S, D>(arr: &mut ArrayBase<S, D>, x: S::Elem) /// where /// S: DataMut, /// S::Elem: Clone, /// D: Dimension, /// { /// arr.slice_each_axis_mut(|ax| Slice::from(0..ax.len / 2)).fill(x); /// } /// fill_lower(&mut h, 9); /// let k = arr2(&[[9, 9, 2, 3], /// [4, 5, 6, 7]]); /// assert_eq!(h, k); /// ``` /// /// ## Subviews /// /// Subview methods allow you to restrict the array view while removing one /// axis from the array. Methods for selecting individual subviews include /// [`.index_axis()`], [`.index_axis_mut()`], [`.index_axis_move()`], and /// [`.index_axis_inplace()`]. You can also select a subview by using a single /// index instead of a range when slicing. Some other methods, such as /// [`.fold_axis()`], [`.axis_iter()`], [`.axis_iter_mut()`], /// [`.outer_iter()`], and [`.outer_iter_mut()`] operate on all the subviews /// along an axis. /// /// A related method is [`.collapse_axis()`], which modifies the view in the /// same way as [`.index_axis()`] except for removing the collapsed axis, since /// it operates *in place*. The length of the axis becomes 1. /// /// Methods for selecting an individual subview take two arguments: `axis` and /// `index`. /// /// [`.axis_iter()`]: Self::axis_iter /// [`.axis_iter_mut()`]: Self::axis_iter_mut /// [`.fold_axis()`]: Self::fold_axis /// [`.index_axis()`]: Self::index_axis /// [`.index_axis_inplace()`]: Self::index_axis_inplace /// [`.index_axis_mut()`]: Self::index_axis_mut /// [`.index_axis_move()`]: Self::index_axis_move /// [`.collapse_axis()`]: Self::collapse_axis /// [`.outer_iter()`]: Self::outer_iter /// [`.outer_iter_mut()`]: Self::outer_iter_mut /// /// ``` /// /// use ndarray::{arr3, aview1, aview2, s, Axis}; /// /// /// // 2 submatrices of 2 rows with 3 elements per row, means a shape of `[2, 2, 3]`. /// /// let a = arr3(&[[[ 1, 2, 3], // \ axis 0, submatrix 0 /// [ 4, 5, 6]], // / /// [[ 7, 8, 9], // \ axis 0, submatrix 1 /// [10, 11, 12]]]); // / /// // \ /// // axis 2, column 0 /// /// assert_eq!(a.shape(), &[2, 2, 3]); /// /// // Let’s take a subview along the greatest dimension (axis 0), /// // taking submatrix 0, then submatrix 1 /// /// let sub_0 = a.index_axis(Axis(0), 0); /// let sub_1 = a.index_axis(Axis(0), 1); /// /// assert_eq!(sub_0, aview2(&[[ 1, 2, 3], /// [ 4, 5, 6]])); /// assert_eq!(sub_1, aview2(&[[ 7, 8, 9], /// [10, 11, 12]])); /// assert_eq!(sub_0.shape(), &[2, 3]); /// /// // This is the subview picking only axis 2, column 0 /// let sub_col = a.index_axis(Axis(2), 0); /// /// assert_eq!(sub_col, aview2(&[[ 1, 4], /// [ 7, 10]])); /// /// // You can take multiple subviews at once (and slice at the same time) /// let double_sub = a.slice(s![1, .., 0]); /// assert_eq!(double_sub, aview1(&[7, 10])); /// ``` /// /// ## Arithmetic Operations /// /// Arrays support all arithmetic operations the same way: they apply elementwise. /// /// Since the trait implementations are hard to overview, here is a summary. /// /// ### Binary Operators with Two Arrays /// /// Let `A` be an array or view of any kind. Let `B` be an array /// with owned storage (either `Array` or `ArcArray`). /// Let `C` be an array with mutable data (either `Array`, `ArcArray` /// or `ArrayViewMut`). /// The following combinations of operands /// are supported for an arbitrary binary operator denoted by `@` (it can be /// `+`, `-`, `*`, `/` and so on). /// /// - `&A @ &A` which produces a new `Array` /// - `B @ A` which consumes `B`, updates it with the result, and returns it /// - `B @ &A` which consumes `B`, updates it with the result, and returns it /// - `C @= &A` which performs an arithmetic operation in place /// /// Note that the element type needs to implement the operator trait and the /// `Clone` trait. /// /// ``` /// use ndarray::{array, ArrayView1}; /// /// let owned1 = array![1, 2]; /// let owned2 = array![3, 4]; /// let view1 = ArrayView1::from(&[5, 6]); /// let view2 = ArrayView1::from(&[7, 8]); /// let mut mutable = array![9, 10]; /// /// let sum1 = &view1 + &view2; // Allocates a new array. Note the explicit `&`. /// // let sum2 = view1 + &view2; // This doesn't work because `view1` is not an owned array. /// let sum3 = owned1 + view1; // Consumes `owned1`, updates it, and returns it. /// let sum4 = owned2 + &view2; // Consumes `owned2`, updates it, and returns it. /// mutable += &view2; // Updates `mutable` in-place. /// ``` /// /// ### Binary Operators with Array and Scalar /// /// The trait [`ScalarOperand`] marks types that can be used in arithmetic /// with arrays directly. For a scalar `K` the following combinations of operands /// are supported (scalar can be on either the left or right side, but /// `ScalarOperand` docs has the detailed condtions). /// /// - `&A @ K` or `K @ &A` which produces a new `Array` /// - `B @ K` or `K @ B` which consumes `B`, updates it with the result and returns it /// - `C @= K` which performs an arithmetic operation in place /// /// ### Unary Operators /// /// Let `A` be an array or view of any kind. Let `B` be an array with owned /// storage (either `Array` or `ArcArray`). The following operands are supported /// for an arbitrary unary operator denoted by `@` (it can be `-` or `!`). /// /// - `@&A` which produces a new `Array` /// - `@B` which consumes `B`, updates it with the result, and returns it /// /// ## Broadcasting /// /// Arrays support limited *broadcasting*, where arithmetic operations with /// array operands of different sizes can be carried out by repeating the /// elements of the smaller dimension array. See /// [`.broadcast()`](Self::broadcast) for a more detailed /// description. /// /// ``` /// use ndarray::arr2; /// /// let a = arr2(&[[1., 1.], /// [1., 2.], /// [0., 3.], /// [0., 4.]]); /// /// let b = arr2(&[[0., 1.]]); /// /// let c = arr2(&[[1., 2.], /// [1., 3.], /// [0., 4.], /// [0., 5.]]); /// // We can add because the shapes are compatible even if not equal. /// // The `b` array is shape 1 × 2 but acts like a 4 × 2 array. /// assert!( /// c == a + b /// ); /// ``` /// /// ## Conversions /// /// ### Conversions Between Array Types /// /// This table is a summary of the conversions between arrays of different /// ownership, dimensionality, and element type. All of the conversions in this /// table preserve the shape of the array. /// /// <table> /// <tr> /// <th rowspan="2">Output</th> /// <th colspan="5">Input</th> /// </tr> /// /// <tr> /// <td> /// /// `Array<A, D>` /// /// </td> /// <td> /// /// `ArcArray<A, D>` /// /// </td> /// <td> /// /// `CowArray<'a, A, D>` /// /// </td> /// <td> /// /// `ArrayView<'a, A, D>` /// /// </td> /// <td> /// /// `ArrayViewMut<'a, A, D>` /// /// </td> /// </tr> /// /// <!--Conversions to `Array<A, D>`--> /// /// <tr> /// <td> /// /// `Array<A, D>` /// /// </td> /// <td> /// /// no-op /// /// </td> /// <td> /// /// [`a.into_owned()`][.into_owned()] /// /// </td> /// <td> /// /// [`a.into_owned()`][.into_owned()] /// /// </td> /// <td> /// /// [`a.to_owned()`][.to_owned()] /// /// </td> /// <td> /// /// [`a.to_owned()`][.to_owned()] /// /// </td> /// </tr> /// /// <!--Conversions to `ArcArray<A, D>`--> /// /// <tr> /// <td> /// /// `ArcArray<A, D>` /// /// </td> /// <td> /// /// [`a.into_shared()`][.into_shared()] /// /// </td> /// <td> /// /// no-op /// /// </td> /// <td> /// /// [`a.into_owned().into_shared()`][.into_shared()] /// /// </td> /// <td> /// /// [`a.to_owned().into_shared()`][.into_shared()] /// /// </td> /// <td> /// /// [`a.to_owned().into_shared()`][.into_shared()] /// /// </td> /// </tr> /// /// <!--Conversions to `CowArray<'a, A, D>`--> /// /// <tr> /// <td> /// /// `CowArray<'a, A, D>` /// /// </td> /// <td> /// /// [`CowArray::from(a)`](CowArray#impl-From<ArrayBase<OwnedRepr<A>%2C%20D>>) /// /// </td> /// <td> /// /// [`CowArray::from(a.into_owned())`](CowArray#impl-From<ArrayBase<OwnedRepr<A>%2C%20D>>) /// /// </td> /// <td> /// /// no-op /// /// </td> /// <td> /// /// [`CowArray::from(a)`](CowArray#impl-From<ArrayBase<ViewRepr<%26%27a%20A>%2C%20D>>) /// /// </td> /// <td> /// /// [`CowArray::from(a.view())`](CowArray#impl-From<ArrayBase<ViewRepr<%26%27a%20A>%2C%20D>>) /// /// </td> /// </tr> /// /// <!--Conversions to `ArrayView<'b, A, D>`--> /// /// <tr> /// <td> /// /// `ArrayView<'b, A, D>` /// /// </td> /// <td> /// /// [`a.view()`][.view()] /// /// </td> /// <td> /// /// [`a.view()`][.view()] /// /// </td> /// <td> /// /// [`a.view()`][.view()] /// /// </td> /// <td> /// /// [`a.view()`][.view()] or [`a.reborrow()`][ArrayView::reborrow()] /// /// </td> /// <td> /// /// [`a.view()`][.view()] /// /// </td> /// </tr> /// /// <!--Conversions to `ArrayViewMut<'b, A, D>`--> /// /// <tr> /// <td> /// /// `ArrayViewMut<'b, A, D>` /// /// </td> /// <td> /// /// [`a.view_mut()`][.view_mut()] /// /// </td> /// <td> /// /// [`a.view_mut()`][.view_mut()] /// /// </td> /// <td> /// /// [`a.view_mut()`][.view_mut()] /// /// </td> /// <td> /// /// illegal /// /// </td> /// <td> /// /// [`a.view_mut()`][.view_mut()] or [`a.reborrow()`][ArrayViewMut::reborrow()] /// /// </td> /// </tr> /// /// <!--Conversions to equivalent with dim `D2`--> /// /// <tr> /// <td> /// /// equivalent with dim `D2` (e.g. converting from dynamic dim to const dim) /// /// </td> /// <td colspan="5"> /// /// [`a.into_dimensionality::<D2>()`][.into_dimensionality()] /// /// </td> /// </tr> /// /// <!--Conversions to equivalent with dim `IxDyn`--> /// /// <tr> /// <td> /// /// equivalent with dim `IxDyn` /// /// </td> /// <td colspan="5"> /// /// [`a.into_dyn()`][.into_dyn()] /// /// </td> /// </tr> /// /// <!--Conversions to `Array<B, D>`--> /// /// <tr> /// <td> /// /// `Array<B, D>` (new element type) /// /// </td> /// <td colspan="5"> /// /// [`a.map(|x| x.do_your_conversion())`][.map()] /// /// </td> /// </tr> /// </table> /// /// ### Conversions Between Arrays and `Vec`s/Slices/Scalars /// /// This is a table of the safe conversions between arrays and /// `Vec`s/slices/scalars. Note that some of the return values are actually /// `Result`/`Option` wrappers around the indicated output types. /// /// Input | Output | Methods /// ------|--------|-------- /// `Vec<A>` | `ArrayBase<S: DataOwned, Ix1>` | [`::from_vec()`](Self::from_vec) /// `Vec<A>` | `ArrayBase<S: DataOwned, D>` | [`::from_shape_vec()`](Self::from_shape_vec) /// `&[A]` | `ArrayView1<A>` | [`::from()`](ArrayView#method.from) /// `&[A]` | `ArrayView<A, D>` | [`::from_shape()`](ArrayView#method.from_shape) /// `&mut [A]` | `ArrayViewMut1<A>` | [`::from()`](ArrayViewMut#method.from) /// `&mut [A]` | `ArrayViewMut<A, D>` | [`::from_shape()`](ArrayViewMut#method.from_shape) /// `&ArrayBase<S, Ix1>` | `Vec<A>` | [`.to_vec()`](Self::to_vec) /// `Array<A, D>` | `Vec<A>` | [`.into_raw_vec()`](Array#method.into_raw_vec)<sup>[1](#into_raw_vec)</sup> /// `&ArrayBase<S, D>` | `&[A]` | [`.as_slice()`](Self::as_slice)<sup>[2](#req_contig_std)</sup>, [`.as_slice_memory_order()`](Self::as_slice_memory_order)<sup>[3](#req_contig)</sup> /// `&mut ArrayBase<S: DataMut, D>` | `&mut [A]` | [`.as_slice_mut()`](Self::as_slice_mut)<sup>[2](#req_contig_std)</sup>, [`.as_slice_memory_order_mut()`](Self::as_slice_memory_order_mut)<sup>[3](#req_contig)</sup> /// `ArrayView<A, D>` | `&[A]` | [`.to_slice()`](ArrayView#method.to_slice)<sup>[2](#req_contig_std)</sup> /// `ArrayViewMut<A, D>` | `&mut [A]` | [`.into_slice()`](ArrayViewMut#method.into_slice)<sup>[2](#req_contig_std)</sup> /// `Array0<A>` | `A` | [`.into_scalar()`](Array#method.into_scalar) /// /// <sup><a name="into_raw_vec">1</a></sup>Returns the data in memory order. /// /// <sup><a name="req_contig_std">2</a></sup>Works only if the array is /// contiguous and in standard order. /// /// <sup><a name="req_contig">3</a></sup>Works only if the array is contiguous. /// /// The table above does not include all the constructors; it only shows /// conversions to/from `Vec`s/slices. See /// [below](#constructor-methods-for-owned-arrays) for more constructors. /// /// [ArrayView::reborrow()]: ArrayView#method.reborrow /// [ArrayViewMut::reborrow()]: ArrayViewMut#method.reborrow /// [.into_dimensionality()]: Self::into_dimensionality /// [.into_dyn()]: Self::into_dyn /// [.into_owned()]: Self::into_owned /// [.into_shared()]: Self::into_shared /// [.to_owned()]: Self::to_owned /// [.map()]: Self::map /// [.view()]: Self::view /// [.view_mut()]: Self::view_mut /// /// ### Conversions from Nested `Vec`s/`Array`s /// /// It's generally a good idea to avoid nested `Vec`/`Array` types, such as /// `Vec<Vec<A>>` or `Vec<Array2<A>>` because: /// /// * they require extra heap allocations compared to a single `Array`, /// /// * they can scatter data all over memory (because of multiple allocations), /// /// * they cause unnecessary indirection (traversing multiple pointers to reach /// the data), /// /// * they don't enforce consistent shape within the nested /// `Vec`s/`ArrayBase`s, and /// /// * they are generally more difficult to work with. /// /// The most common case where users might consider using nested /// `Vec`s/`Array`s is when creating an array by appending rows/subviews in a /// loop, where the rows/subviews are computed within the loop. However, there /// are better ways than using nested `Vec`s/`Array`s. /// /// If you know ahead-of-time the shape of the final array, the cleanest /// solution is to allocate the final array before the loop, and then assign /// the data to it within the loop, like this: /// /// ```rust /// use ndarray::{array, Array2, Axis}; /// /// let mut arr = Array2::zeros((2, 3)); /// for (i, mut row) in arr.axis_iter_mut(Axis(0)).enumerate() { /// // Perform calculations and assign to `row`; this is a trivial example: /// row.fill(i); /// } /// assert_eq!(arr, array![[0, 0, 0], [1, 1, 1]]); /// ``` /// /// If you don't know ahead-of-time the shape of the final array, then the /// cleanest solution is generally to append the data to a flat `Vec`, and then /// convert it to an `Array` at the end with /// [`::from_shape_vec()`](Self::from_shape_vec). You just have to be careful /// that the layout of the data (the order of the elements in the flat `Vec`) /// is correct. /// /// ```rust /// use ndarray::{array, Array2}; /// /// let ncols = 3; /// let mut data = Vec::new(); /// let mut nrows = 0; /// for i in 0..2 { /// // Compute `row` and append it to `data`; this is a trivial example: /// let row = vec![i; ncols]; /// data.extend_from_slice(&row); /// nrows += 1; /// } /// let arr = Array2::from_shape_vec((nrows, ncols), data)?; /// assert_eq!(arr, array![[0, 0, 0], [1, 1, 1]]); /// # Ok::<(), ndarray::ShapeError>(()) /// ``` /// /// If neither of these options works for you, and you really need to convert /// nested `Vec`/`Array` instances to an `Array`, the cleanest solution is /// generally to use [`Iterator::flatten()`] /// to get a flat `Vec`, and then convert the `Vec` to an `Array` with /// [`::from_shape_vec()`](Self::from_shape_vec), like this: /// /// ```rust /// use ndarray::{array, Array2, Array3}; /// /// let nested: Vec<Array2<i32>> = vec![ /// array![[1, 2, 3], [4, 5, 6]], /// array![[7, 8, 9], [10, 11, 12]], /// ]; /// let inner_shape = nested[0].dim(); /// let shape = (nested.len(), inner_shape.0, inner_shape.1); /// let flat: Vec<i32> = nested.iter().flatten().cloned().collect(); /// let arr = Array3::from_shape_vec(shape, flat)?; /// assert_eq!(arr, array![ /// [[1, 2, 3], [4, 5, 6]], /// [[7, 8, 9], [10, 11, 12]], /// ]); /// # Ok::<(), ndarray::ShapeError>(()) /// ``` /// /// Note that this implementation assumes that the nested `Vec`s are all the /// same shape and that the `Vec` is non-empty. Depending on your application, /// it may be a good idea to add checks for these assumptions and possibly /// choose a different way to handle the empty case. /// // # For implementors // // All methods must uphold the following constraints: // // 1. `data` must correctly represent the data buffer / ownership information, // `ptr` must point into the data represented by `data`, and the `dim` and // `strides` must be consistent with `data`. For example, // // * If `data` is `OwnedRepr<A>`, all elements represented by `ptr`, `dim`, // and `strides` must be owned by the `Vec` and not aliased by multiple // indices. // // * If `data` is `ViewRepr<&'a mut A>`, all elements represented by `ptr`, // `dim`, and `strides` must be exclusively borrowed and not aliased by // multiple indices. // // 2. If the type of `data` implements `Data`, then `ptr` must be aligned. // // 3. `ptr` must be non-null, and it must be safe to [`.offset()`] `ptr` by // zero. // // 4. It must be safe to [`.offset()`] the pointer repeatedly along all axes // and calculate the `count`s for the `.offset()` calls without overflow, // even if the array is empty or the elements are zero-sized. // // More specifically, the set of all possible (signed) offset counts // relative to `ptr` can be determined by the following (the casts and // arithmetic must not overflow): // // ```rust // /// Returns all the possible offset `count`s relative to `ptr`. // fn all_offset_counts(shape: &[usize], strides: &[isize]) -> BTreeSet<isize> { // assert_eq!(shape.len(), strides.len()); // let mut all_offsets = BTreeSet::<isize>::new(); // all_offsets.insert(0); // for axis in 0..shape.len() { // let old_offsets = all_offsets.clone(); // for index in 0..shape[axis] { // assert!(index <= isize::MAX as usize); // let off = (index as isize).checked_mul(strides[axis]).unwrap(); // for &old_offset in &old_offsets { // all_offsets.insert(old_offset.checked_add(off).unwrap()); // } // } // } // all_offsets // } // ``` // // Note that it must be safe to offset the pointer *repeatedly* along all // axes, so in addition for it being safe to offset `ptr` by each of these // counts, the difference between the least and greatest address reachable // by these offsets in units of `A` and in units of bytes must not be // greater than `isize::MAX`. // // In other words, // // * All possible pointers generated by moving along all axes must be in // bounds or one byte past the end of a single allocation with element // type `A`. The only exceptions are if the array is empty or the element // type is zero-sized. In these cases, `ptr` may be dangling, but it must // still be safe to [`.offset()`] the pointer along the axes. // // * The offset in units of bytes between the least address and greatest // address by moving along all axes must not exceed `isize::MAX`. This // constraint prevents the computed offset, in bytes, from overflowing // `isize` regardless of the starting point due to past offsets. // // * The offset in units of `A` between the least address and greatest // address by moving along all axes must not exceed `isize::MAX`. This // constraint prevents overflow when calculating the `count` parameter to // [`.offset()`] regardless of the starting point due to past offsets. // // For example, if the shape is [2, 0, 3] and the strides are [3, 6, -1], // the offsets of interest relative to `ptr` are -2, -1, 0, 1, 2, 3. So, // `ptr.offset(-2)`, `ptr.offset(-1)`, …, `ptr.offset(3)` must be pointers // within a single allocation with element type `A`; `(3 - (-2)) * // size_of::<A>()` must not exceed `isize::MAX`, and `3 - (-2)` must not // exceed `isize::MAX`. Note that this is a requirement even though the // array is empty (axis 1 has length 0). // // A dangling pointer can be used when creating an empty array, but this // usually means all the strides have to be zero. A dangling pointer that // can safely be offset by zero bytes can be constructed with // `::std::ptr::NonNull::<A>::dangling().as_ptr()`. (It isn't entirely clear // from the documentation that a pointer created this way is safe to // `.offset()` at all, even by zero bytes, but the implementation of // `Vec<A>` does this, so we can too. See rust-lang/rust#54857 for details.) // // 5. The product of non-zero axis lengths must not exceed `isize::MAX`. (This // also implies that the length of any individual axis must not exceed // `isize::MAX`, and an array can contain at most `isize::MAX` elements.) // This constraint makes various calculations easier because they don't have // to worry about overflow and axis lengths can be freely cast to `isize`. // // Constraints 2–5 are carefully designed such that if they're upheld for the // array, they're also upheld for any subset of axes of the array as well as // slices/subviews/reshapes of the array. This is important for iterators that // produce subviews (and other similar cases) to be safe without extra (easy to // forget) checks for zero-length axes. Constraint 1 is similarly upheld for // any subset of axes and slices/subviews/reshapes, except when removing a // zero-length axis (since if the other axes are non-zero-length, that would // allow accessing elements that should not be possible to access). // // Method/function implementations can rely on these constraints being upheld. // The constraints can be temporarily violated within a method/function // implementation since `ArrayBase` doesn't implement `Drop` and `&mut // ArrayBase` is `!UnwindSafe`, but the implementation must not call // methods/functions on the array while it violates the constraints. // // Users of the `ndarray` crate cannot rely on these constraints because they // may change in the future. // // [`.offset()`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset-1 pub struct ArrayBase<S, D> where S: RawData, { /// Data buffer / ownership information. (If owned, contains the data /// buffer; if borrowed, contains the lifetime and mutability.) data: S, /// A non-null pointer into the buffer held by `data`; may point anywhere /// in its range. If `S: Data`, this pointer must be aligned. ptr: std::ptr::NonNull<S::Elem>, /// The lengths of the axes. dim: D, /// The element count stride per axis. To be parsed as `isize`. strides: D, } /// An array where the data has shared ownership and is copy on write. /// /// The `ArcArray<A, D>` is parameterized by `A` for the element type and `D` for /// the dimensionality. /// /// It can act as both an owner as the data as well as a shared reference (view /// like). /// Calling a method for mutating elements on `ArcArray`, for example /// [`view_mut()`](ArrayBase::view_mut) or /// [`get_mut()`](ArrayBase::get_mut), will break sharing and /// require a clone of the data (if it is not uniquely held). /// /// `ArcArray` uses atomic reference counting like `Arc`, so it is `Send` and /// `Sync` (when allowed by the element type of the array too). /// /// **[`ArrayBase`]** is used to implement both the owned /// arrays and the views; see its docs for an overview of all array features. /// /// See also: /// /// + [Constructor Methods for Owned Arrays](ArrayBase#constructor-methods-for-owned-arrays) /// + [Methods For All Array Types](ArrayBase#methods-for-all-array-types) pub type ArcArray<A, D> = ArrayBase<OwnedArcRepr<A>, D>; /// An array that owns its data uniquely. /// /// `Array` is the main n-dimensional array type, and it owns all its array /// elements. /// /// The `Array<A, D>` is parameterized by `A` for the element type and `D` for /// the dimensionality. /// /// **[`ArrayBase`]** is used to implement both the owned /// arrays and the views; see its docs for an overview of all array features. /// /// See also: /// /// + [Constructor Methods for Owned Arrays](ArrayBase#constructor-methods-for-owned-arrays) /// + [Methods For All Array Types](ArrayBase#methods-for-all-array-types) /// + Dimensionality-specific type alises /// [`Array1`], /// [`Array2`], /// [`Array3`], ..., /// [`ArrayD`], /// and so on. pub type Array<A, D> = ArrayBase<OwnedRepr<A>, D>; /// An array with copy-on-write behavior. /// /// An `CowArray` represents either a uniquely owned array or a view of an /// array. The `'a` corresponds to the lifetime of the view variant. /// /// This type is analogous to [`std::borrow::Cow`]. /// If a `CowArray` instance is the immutable view variant, then calling a /// method for mutating elements in the array will cause it to be converted /// into the owned variant (by cloning all the elements) before the /// modification is performed. /// /// Array views have all the methods of an array (see [`ArrayBase`]). /// /// See also [`ArcArray`], which also provides /// copy-on-write behavior but has a reference-counted pointer to the data /// instead of either a view or a uniquely owned copy. pub type CowArray<'a, A, D> = ArrayBase<CowRepr<'a, A>, D>; /// A read-only array view. /// /// An array view represents an array or a part of it, created from /// an iterator, subview or slice of an array. /// /// The `ArrayView<'a, A, D>` is parameterized by `'a` for the scope of the /// borrow, `A` for the element type and `D` for the dimensionality. /// /// Array views have all the methods of an array (see [`ArrayBase`]). /// /// See also [`ArrayViewMut`]. pub type ArrayView<'a, A, D> = ArrayBase<ViewRepr<&'a A>, D>; /// A read-write array view. /// /// An array view represents an array or a part of it, created from /// an iterator, subview or slice of an array. /// /// The `ArrayViewMut<'a, A, D>` is parameterized by `'a` for the scope of the /// borrow, `A` for the element type and `D` for the dimensionality. /// /// Array views have all the methods of an array (see [`ArrayBase`]). /// /// See also [`ArrayView`]. pub type ArrayViewMut<'a, A, D> = ArrayBase<ViewRepr<&'a mut A>, D>; /// A read-only array view without a lifetime. /// /// This is similar to [`ArrayView`] but does not carry any lifetime or /// ownership information, and its data cannot be read without an unsafe /// conversion into an [`ArrayView`]. The relationship between `RawArrayView` /// and [`ArrayView`] is somewhat analogous to the relationship between `*const /// T` and `&T`, but `RawArrayView` has additional requirements that `*const T` /// does not, such as non-nullness. /// /// The `RawArrayView<A, D>` is parameterized by `A` for the element type and /// `D` for the dimensionality. /// /// Raw array views have all the methods of an array (see /// [`ArrayBase`]). /// /// See also [`RawArrayViewMut`]. /// /// # Warning /// /// You can't use this type with an arbitrary raw pointer; see /// [`from_shape_ptr`](#method.from_shape_ptr) for details. pub type RawArrayView<A, D> = ArrayBase<RawViewRepr<*const A>, D>; /// A mutable array view without a lifetime. /// /// This is similar to [`ArrayViewMut`] but does not carry any lifetime or /// ownership information, and its data cannot be read/written without an /// unsafe conversion into an [`ArrayViewMut`]. The relationship between /// `RawArrayViewMut` and [`ArrayViewMut`] is somewhat analogous to the /// relationship between `*mut T` and `&mut T`, but `RawArrayViewMut` has /// additional requirements that `*mut T` does not, such as non-nullness. /// /// The `RawArrayViewMut<A, D>` is parameterized by `A` for the element type /// and `D` for the dimensionality. /// /// Raw array views have all the methods of an array (see /// [`ArrayBase`]). /// /// See also [`RawArrayView`]. /// /// # Warning /// /// You can't use this type with an arbitrary raw pointer; see /// [`from_shape_ptr`](#method.from_shape_ptr) for details. pub type RawArrayViewMut<A, D> = ArrayBase<RawViewRepr<*mut A>, D>; pub use data_repr::OwnedRepr; /// ArcArray's representation. /// /// *Don’t use this type directly—use the type alias /// [`ArcArray`] for the array type!* #[derive(Debug)] pub struct OwnedArcRepr<A>(Arc<OwnedRepr<A>>); impl<A> Clone for OwnedArcRepr<A> { fn clone(&self) -> Self { OwnedArcRepr(self.0.clone()) } } /// Array pointer’s representation. /// /// *Don’t use this type directly—use the type aliases /// [`RawArrayView`] / [`RawArrayViewMut`] for the array type!* #[derive(Copy, Clone)] // This is just a marker type, to carry the mutability and element type. pub struct RawViewRepr<A> { ptr: PhantomData<A>, } impl<A> RawViewRepr<A> { #[inline(always)] fn new() -> Self { RawViewRepr { ptr: PhantomData } } } /// Array view’s representation. /// /// *Don’t use this type directly—use the type aliases /// [`ArrayView`] / [`ArrayViewMut`] for the array type!* #[derive(Copy, Clone)] // This is just a marker type, to carry the lifetime parameter. pub struct ViewRepr<A> { life: PhantomData<A>, } impl<A> ViewRepr<A> { #[inline(always)] fn new() -> Self { ViewRepr { life: PhantomData } } } /// CowArray's representation. /// /// *Don't use this type directly—use the type alias /// [`CowArray`] for the array type!* pub enum CowRepr<'a, A> { /// Borrowed data. View(ViewRepr<&'a A>), /// Owned data. Owned(OwnedRepr<A>), } impl<'a, A> CowRepr<'a, A> { /// Returns `true` iff the data is the `View` variant. pub fn is_view(&self) -> bool { match self { CowRepr::View(_) => true, CowRepr::Owned(_) => false, } } /// Returns `true` iff the data is the `Owned` variant. pub fn is_owned(&self) -> bool { match self { CowRepr::View(_) => false, CowRepr::Owned(_) => true, } } } // NOTE: The order of modules decides in which order methods on the type ArrayBase // (mainly mentioning that as the most relevant type) show up in the documentation. // Consider the doc effect of ordering modules here. mod impl_clone; mod impl_internal_constructors; mod impl_constructors; mod impl_methods; mod impl_owned_array; mod impl_special_element_types; /// Private Methods impl<A, S, D> ArrayBase<S, D> where S: Data<Elem = A>, D: Dimension, { #[inline] fn broadcast_unwrap<E>(&self, dim: E) -> ArrayView<'_, A, E> where E: Dimension, { #[cold] #[inline(never)] fn broadcast_panic<D, E>(from: &D, to: &E) -> ! where D: Dimension, E: Dimension, { panic!( "ndarray: could not broadcast array from shape: {:?} to: {:?}", from.slice(), to.slice() ) } match self.broadcast(dim.clone()) { Some(it) => it, None => broadcast_panic(&self.dim, &dim), } } // Broadcast to dimension `E`, without checking that the dimensions match // (Checked in debug assertions). #[inline] fn broadcast_assume<E>(&self, dim: E) -> ArrayView<'_, A, E> where E: Dimension, { let dim = dim.into_dimension(); debug_assert_eq!(self.shape(), dim.slice()); let ptr = self.ptr; let mut strides = dim.clone(); strides.slice_mut().copy_from_slice(self.strides.slice()); unsafe { ArrayView::new(ptr, dim, strides) } } fn raw_strides(&self) -> D { self.strides.clone() } /// Remove array axis `axis` and return the result. fn try_remove_axis(self, axis: Axis) -> ArrayBase<S, D::Smaller> { let d = self.dim.try_remove_axis(axis); let s = self.strides.try_remove_axis(axis); // safe because new dimension, strides allow access to a subset of old data unsafe { self.with_strides_dim(s, d) } } } // parallel methods #[cfg(feature = "rayon")] extern crate rayon_ as rayon; #[cfg(feature = "rayon")] pub mod parallel; mod impl_1d; mod impl_2d; mod impl_dyn; mod numeric; pub mod linalg; mod impl_ops; pub use crate::impl_ops::ScalarOperand; #[cfg(feature = "approx")] mod array_approx; // Array view methods mod impl_views; // Array raw view methods mod impl_raw_views; // Copy-on-write array methods mod impl_cow; /// Returns `true` if the pointer is aligned. pub(crate) fn is_aligned<T>(ptr: *const T) -> bool { (ptr as usize) % ::std::mem::align_of::<T>() == 0 }
cometh-jar.ts
import { BigNumber, ethers, Signer } from 'ethers'; import { Provider } from '@ethersproject/providers'; import { AssetProjectedApr, JarDefinition } from '../../model/PickleModelJson'; import { AbstractJarBehavior, ONE_YEAR_IN_SECONDS } from "../AbstractJarBehavior"; import erc20Abi from '../../Contracts/ABIs/erc20.json'; import stakingRewardsAbi from '../../Contracts/ABIs/staking-rewards.json'; import { PickleModel } from '../../model/PickleModel'; import { Provider as MulticallProvider, Contract as MulticallContract} from 'ethers-multicall'; import { Chains } from '../../chain/Chains'; import { formatEther } from 'ethers/lib/utils'; import { getLivePairDataFromContracts, IPairData } from '../../protocols/GenericSwapUtil'; import { ComethPairManager } from '../../protocols/ComethUtil'; export abstract class ComethJar extends AbstractJarBehavior { strategyAbi : any; rewardAddress: string; constructor(strategyAbi : any, rewardAddress: string) { super(); this.strategyAbi = strategyAbi; this.rewardAddress = rewardAddress; } async getHarvestableUSD( jar: JarDefinition, model: PickleModel, resolver: Signer | Provider): Promise<number> { const strategy = new ethers.Contract(jar.details.strategyAddr, this.strategyAbi, resolver); const mustToken = new ethers.Contract(model.addr("must"), erc20Abi, resolver);
]); const harvestable = must.add(wallet).mul(mustPrice.toFixed()); return parseFloat(ethers.utils.formatEther(harvestable));; } async getProjectedAprStats(definition: JarDefinition, model: PickleModel) : Promise<AssetProjectedApr> { const must : number = await this.calculateComethAPY(this.rewardAddress, definition, model); const lp : number = await calculateComethswapLpApr(model, definition.depositToken.addr); return this.aprComponentsToProjectedApr([ this.createAprComponent("lp", lp, false), this.createAprComponent("must", must, true) ]); } async calculateComethAPY(rewardsAddress: string, jar: JarDefinition, model: PickleModel) : Promise<number> { const multicallProvider = model.multicallProviderFor(jar.chain); await multicallProvider.init(); const multicallStakingRewards = new MulticallContract( rewardsAddress,stakingRewardsAbi); const [ rewardsDurationBN, rewardsForDurationBN, totalSupplyBN, ] = await multicallProvider.all([ multicallStakingRewards.rewardsDuration(), multicallStakingRewards.getRewardForDuration(), multicallStakingRewards.totalSupply(), ]); const totalSupply = parseFloat(formatEther(totalSupplyBN)); const rewardsDuration = rewardsDurationBN.toNumber(); //epoch const rewardsForDuration = parseFloat(formatEther(rewardsForDurationBN)); const { pricePerToken } = await this.getComethPairData(jar, model); const rewardsPerYear = rewardsForDuration * ((ONE_YEAR_IN_SECONDS) / rewardsDuration); const valueRewardedPerYear = await model.priceOf("must") * rewardsPerYear; const totalValueStaked = totalSupply * pricePerToken; const apy = valueRewardedPerYear / totalValueStaked; return apy * 100; } async getComethPairData(jar: JarDefinition, model: PickleModel): Promise<IPairData> { return getLivePairDataFromContracts(jar, model, 18); }; } async function calculateComethswapLpApr(model: PickleModel, addr: string): Promise<number> { return await new ComethPairManager().calculateLpApr(model, addr); }
const [must, wallet, mustPrice]: [BigNumber, BigNumber, number] = await Promise.all([ strategy.getHarvestable().catch(() => BigNumber.from('0')), mustToken.balanceOf(jar.details.strategyAddr), await model.priceOf('must'),
fabfile.py
from fabric.api import * from fabric import colors from fabric.contrib.files import exists from fabric.operations import _prefix_commands, _prefix_env_vars, require import os import slack PROJECT_NAME = "Divante.com PWA Book" STAGES = { "test": { "name": "Test", "hosts": [os.environ['TEST_HOST']], "port": os.environ['TEST_PORT'], "user": "divanteco", "dir": "/home/www/divanteco/www/pwabook" }, "prod": { "name": "Production", "hosts": [os.environ['PROD_HOST']], "port": os.environ['PROD_PORT'], "user": "divanteco", "dir": "/home/www/divanteco/www/pwabook" } } SLACK = slack.WebClient(token=os.environ['SLACK_API_TOKEN']) def stage_set(stage_name="test"): env.stage = stage_name for option, value in STAGES[env.stage].items(): setattr(env, option, value) @task def prod(): """ Setup production environment """ stage_set("prod") @task def test(): """ Setup test environment """ stage_set("test") @task def deploy(): """ Start the deployment """ require("stage", provided_by=(test,prod,)) print(colors.green("Start deploying in ") + colors.red(env.name)) notify("*" + PROJECT_NAME + "* @ `" + env.name + "` :: Deployment Started") copy_chapters() #run("ls -la") notify("*" + PROJECT_NAME + "* @ `" + env.name + "` :: Deployment Completed") print(colors.green("Done!")) def copy_chapters(): """ Copy chapters directory """ print(colors.blue("Copying new chapters")) chapter_dir = env.dir + "/chapter" run("rm -rf " + chapter_dir) run("mkdir " + chapter_dir) put("../../docs/.vuepress/dist/.", chapter_dir) def notify(message):
""" Notify slack """ #SLACK.chat_postMessage(channel='#_snippety-apollo-ci',text=message)
Response.ts
export type Response = { Body: string; HtmlAttributes?: string; Title?: string; Meta?: string; Link?: string; Script?: string;
Style?: string; BodyAttributes?: string; } export default Response;
http.py
import asyncio from typing import TYPE_CHECKING from uvicorn.config import Config if TYPE_CHECKING: # pragma: no cover from uvicorn.server import ServerState async def handle_http( reader: asyncio.StreamReader, writer: asyncio.StreamWriter, server_state: "ServerState", config: Config, ) -> None: # Run transport/protocol session from streams. # # This is a bit fiddly, so let me explain why we do this in the first place. # # This was introduced to switch to the asyncio streams API while retaining our # existing protocols-based code. # # The aim was to: # * Make it easier to support alternative async libaries (all of which expose # a streams API, rather than anything similar to asyncio's transports and # protocols) while keeping the change footprint (and risk) at a minimum. # * Keep a "fast track" for asyncio that's as efficient as possible, by reusing # our asyncio-optimized protocols-based implementation. # # See: https://github.com/encode/uvicorn/issues/169 # See: https://github.com/encode/uvicorn/pull/869 # Use a future to coordinate between the protocol and this handler task. # https://docs.python.org/3/library/asyncio-protocol.html#connecting-existing-sockets loop = asyncio.get_event_loop() connection_lost = loop.create_future() # Switch the protocol from the stream reader to our own HTTP protocol class. protocol = config.http_protocol_class( # type: ignore[call-arg, operator] config=config, server_state=server_state, on_connection_lost=lambda: connection_lost.set_result(True), ) transport = writer.transport transport.set_protocol(protocol) # Asyncio stream servers don't `await` handler tasks (like the one we're currently # running), so we must make sure exceptions that occur in protocols but outside the # ASGI cycle (e.g. bugs) are properly retrieved and logged. # Vanilla asyncio handles exceptions properly out-of-the-box, but uvloop doesn't. # So we need to attach a callback to handle exceptions ourselves for that case. # (It's not easy to know which loop we're effectively running on, so we attach the # callback in all cases. In practice it won't be called on vanilla asyncio.) task = asyncio.current_task() assert task is not None @task.add_done_callback def retrieve_exception(task: asyncio.Task) -> None: exc = task.exception() if exc is None: return loop.call_exception_handler( { "message": "Fatal error in server handler", "exception": exc, "transport": transport,
"protocol": protocol, } ) # Hang up the connection so the client doesn't wait forever. transport.close() # Kick off the HTTP protocol. protocol.connection_made(transport) # Pass any data already in the read buffer. # The assumption here is that we haven't read any data off the stream reader # yet: all data that the client might have already sent since the connection has # been established is in the `_buffer`. data = reader._buffer # type: ignore if data: protocol.data_received(data) # Let the transport run in the background. When closed, this future will complete # and we'll exit here. await connection_lost
org_test.go
package organization_test import ( "github.com/cloudfoundry/cli/cf/command_registry" "github.com/cloudfoundry/cli/cf/configuration/core_config" "github.com/cloudfoundry/cli/cf/models" "github.com/cloudfoundry/cli/plugin/models" testcmd "github.com/cloudfoundry/cli/testhelpers/commands" testconfig "github.com/cloudfoundry/cli/testhelpers/configuration" testreq "github.com/cloudfoundry/cli/testhelpers/requirements" testterm "github.com/cloudfoundry/cli/testhelpers/terminal" . "github.com/cloudfoundry/cli/testhelpers/matchers" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) func callShowOrg(args []string, requirementsFactory *testreq.FakeReqFactory) (ui *testterm.FakeUI)
var _ = Describe("org command", func() { var ( ui *testterm.FakeUI configRepo core_config.Repository requirementsFactory *testreq.FakeReqFactory deps command_registry.Dependency ) updateCommandDependency := func(pluginCall bool) { deps.Ui = ui deps.Config = configRepo command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("org").SetDependency(deps, pluginCall)) } BeforeEach(func() { ui = &testterm.FakeUI{} requirementsFactory = &testreq.FakeReqFactory{} configRepo = testconfig.NewRepositoryWithDefaults() deps = command_registry.NewDependency() updateCommandDependency(false) }) runCommand := func(args ...string) bool { cmd := command_registry.Commands.FindCommand("org") return testcmd.RunCliCommand(cmd, args, requirementsFactory) } Describe("requirements", func() { It("fails when not logged in", func() { Expect(runCommand("whoops")).To(BeFalse()) }) It("fails with usage when not provided exactly one arg", func() { requirementsFactory.LoginSuccess = true runCommand("too", "much") Expect(ui.Outputs).To(ContainSubstrings( []string{"Incorrect Usage", "Requires an argument"}, )) }) }) Context("when logged in, and provided the name of an org", func() { BeforeEach(func() { developmentSpaceFields := models.SpaceFields{} developmentSpaceFields.Name = "development" developmentSpaceFields.Guid = "dev-space-guid-1" stagingSpaceFields := models.SpaceFields{} stagingSpaceFields.Name = "staging" stagingSpaceFields.Guid = "staging-space-guid-1" domainFields := models.DomainFields{} domainFields.Name = "cfapps.io" domainFields.Guid = "1111" domainFields.OwningOrganizationGuid = "my-org-guid" domainFields.Shared = true cfAppDomainFields := models.DomainFields{} cfAppDomainFields.Name = "cf-app.com" cfAppDomainFields.Guid = "2222" cfAppDomainFields.OwningOrganizationGuid = "my-org-guid" cfAppDomainFields.Shared = false org := models.Organization{} org.Name = "my-org" org.Guid = "my-org-guid" org.QuotaDefinition = models.NewQuotaFields("cantina-quota", 512, 256, 2, 5, true) org.Spaces = []models.SpaceFields{developmentSpaceFields, stagingSpaceFields} org.Domains = []models.DomainFields{domainFields, cfAppDomainFields} org.SpaceQuotas = []models.SpaceQuota{ {Name: "space-quota-1", Guid: "space-quota-1-guid", MemoryLimit: 512, InstanceMemoryLimit: -1}, {Name: "space-quota-2", Guid: "space-quota-2-guid", MemoryLimit: 256, InstanceMemoryLimit: 128}, } requirementsFactory.LoginSuccess = true requirementsFactory.Organization = org }) It("shows the org with the given name", func() { runCommand("my-org") Expect(requirementsFactory.OrganizationName).To(Equal("my-org")) Expect(ui.Outputs).To(ContainSubstrings( []string{"Getting info for org", "my-org", "my-user"}, []string{"OK"}, []string{"my-org"}, []string{"domains:", "cfapps.io", "cf-app.com"}, []string{"quota: ", "cantina-quota", "512M", "256M instance memory limit", "2 routes", "5 services", "paid services allowed"}, []string{"spaces:", "development", "staging"}, []string{"space quotas:", "space-quota-1", "space-quota-2"}, )) }) Context("when the guid flag is provided", func() { It("shows only the org guid", func() { runCommand("--guid", "my-org") Expect(ui.Outputs).To(ContainSubstrings( []string{"my-org-guid"}, )) Expect(ui.Outputs).ToNot(ContainSubstrings( []string{"Getting info for org", "my-org", "my-user"}, )) }) }) Context("when invoked by a plugin", func() { var ( pluginModel plugin_models.GetOrg_Model ) BeforeEach(func() { pluginModel = plugin_models.GetOrg_Model{} deps.PluginModels.Organization = &pluginModel updateCommandDependency(true) }) It("populates the plugin model", func() { runCommand("my-org") Ω(pluginModel.Name).To(Equal("my-org")) Ω(pluginModel.Guid).To(Equal("my-org-guid")) // quota Ω(pluginModel.QuotaDefinition.Name).To(Equal("cantina-quota")) Ω(pluginModel.QuotaDefinition.MemoryLimit).To(Equal(int64(512))) Ω(pluginModel.QuotaDefinition.InstanceMemoryLimit).To(Equal(int64(256))) Ω(pluginModel.QuotaDefinition.RoutesLimit).To(Equal(2)) Ω(pluginModel.QuotaDefinition.ServicesLimit).To(Equal(5)) Ω(pluginModel.QuotaDefinition.NonBasicServicesAllowed).To(BeTrue()) // domains Ω(pluginModel.Domains).To(HaveLen(2)) Ω(pluginModel.Domains[0].Name).To(Equal("cfapps.io")) Ω(pluginModel.Domains[0].Guid).To(Equal("1111")) Ω(pluginModel.Domains[0].OwningOrganizationGuid).To(Equal("my-org-guid")) Ω(pluginModel.Domains[0].Shared).To(BeTrue()) Ω(pluginModel.Domains[1].Name).To(Equal("cf-app.com")) Ω(pluginModel.Domains[1].Guid).To(Equal("2222")) Ω(pluginModel.Domains[1].OwningOrganizationGuid).To(Equal("my-org-guid")) Ω(pluginModel.Domains[1].Shared).To(BeFalse()) // spaces Ω(pluginModel.Spaces).To(HaveLen(2)) Ω(pluginModel.Spaces[0].Name).To(Equal("development")) Ω(pluginModel.Spaces[0].Guid).To(Equal("dev-space-guid-1")) Ω(pluginModel.Spaces[1].Name).To(Equal("staging")) Ω(pluginModel.Spaces[1].Guid).To(Equal("staging-space-guid-1")) // space quotas Ω(pluginModel.SpaceQuotas).To(HaveLen(2)) Ω(pluginModel.SpaceQuotas[0].Name).To(Equal("space-quota-1")) Ω(pluginModel.SpaceQuotas[0].Guid).To(Equal("space-quota-1-guid")) Ω(pluginModel.SpaceQuotas[0].MemoryLimit).To(Equal(int64(512))) Ω(pluginModel.SpaceQuotas[0].InstanceMemoryLimit).To(Equal(int64(-1))) Ω(pluginModel.SpaceQuotas[1].Name).To(Equal("space-quota-2")) Ω(pluginModel.SpaceQuotas[1].Guid).To(Equal("space-quota-2-guid")) Ω(pluginModel.SpaceQuotas[1].MemoryLimit).To(Equal(int64(256))) Ω(pluginModel.SpaceQuotas[1].InstanceMemoryLimit).To(Equal(int64(128))) }) }) }) })
{ ui = new(testterm.FakeUI) token := core_config.TokenInfo{Username: "my-user"} spaceFields := models.SpaceFields{} spaceFields.Name = "my-space" orgFields := models.OrganizationFields{} orgFields.Name = "my-org" configRepo := testconfig.NewRepositoryWithAccessToken(token) configRepo.SetSpaceFields(spaceFields) configRepo.SetOrganizationFields(orgFields) return }
dataset.py
""" dataset.py """ from six import ( iteritems, with_metaclass, ) from zipline.modelling.term import Term class Column(object): """ An abstract column of data, not yet associated with a dataset. """ def __init__(self, dtype): self.dtype = dtype def bind(self, dataset, name): """ Bind a column to a concrete dataset. """ return BoundColumn(dtype=self.dtype, dataset=dataset, name=name) class
(Term): """ A Column of data that's been concretely bound to a particular dataset. """ def __new__(cls, dtype, dataset, name): return super(BoundColumn, cls).__new__( cls, inputs=(), window_length=0, domain=dataset.domain, dtype=dtype, dataset=dataset, name=name, ) def _init(self, dataset, name, *args, **kwargs): self._dataset = dataset self._name = name return super(BoundColumn, self)._init(*args, **kwargs) @classmethod def static_identity(cls, dataset, name, *args, **kwargs): return ( super(BoundColumn, cls).static_identity(*args, **kwargs), dataset, name, ) @property def dataset(self): return self._dataset @property def name(self): return self._name @property def qualname(self): """ Fully qualified of this column. """ return '.'.join([self.dataset.__name__, self.name]) def __repr__(self): return "{qualname}::{dtype}".format( qualname=self.qualname, dtype=self.dtype.__name__, ) class DataSetMeta(type): """ Metaclass for DataSets Supplies name and dataset information to Column attributes. """ def __new__(mcls, name, bases, dict_): newtype = type.__new__(mcls, name, bases, dict_) _columns = [] for maybe_colname, maybe_column in iteritems(dict_): if isinstance(maybe_column, Column): bound_column = maybe_column.bind(newtype, maybe_colname) setattr(newtype, maybe_colname, bound_column) _columns.append(bound_column) newtype._columns = _columns return newtype @property def columns(self): return self._columns class DataSet(with_metaclass(DataSetMeta)): domain = None
BoundColumn
context_processors.py
# -*- coding: utf-8 -*- # from cms_bs3_theme.models import ThemeSite def settings(request):
""" """ from . import conf conf = dict(vars(conf)) # conf.update(ThemeSite.objects.get_theme_conf(request=request, fail=False)) data = request.session.get('cms_bs3_theme_conf', {}) conf.update(data) return {'bs3_conf': conf}
manager_service.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // source: rpcproto/manager_service.proto // Copyright (c) 2018 Donovan Solms / MiningHQ. Licensed under the MIT license. // See LICENSE in the root of this repository for details. package rpcproto import ( fmt "fmt" proto "github.com/golang/protobuf/proto" context "golang.org/x/net/context" grpc "google.golang.org/grpc" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package func init() { proto.RegisterFile("rpcproto/manager_service.proto", fileDescriptor_ed5554ad61747529) } var fileDescriptor_ed5554ad61747529 = []byte{ // 206 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0x2a, 0x48, 0x2e, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0xcf, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0x8a, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x03, 0x8b, 0x0a, 0x71, 0xc0, 0xe4, 0xa5, 0x84, 0xe1, 0x2a, 0x73, 0xf2, 0xd3, 0x8b, 0x21, 0xd2, 0x52, 0x22, 0x70, 0xc1, 0xe2, 0x92, 0xc4, 0x92, 0x54, 0xac, 0xa2, 0x30, 0xb5, 0xe2, 0x70, 0xd1, 0xa2, 0xcc, 0xf4, 0xf8, 0xcc, 0xbc, 0xb4, 0x7c, 0x88, 0x84, 0xd1, 0x41, 0x26, 0x2e, 0x3e, 0x5f, 0x88, 0xed, 0xc1, 0x10, 0xcb, 0x85, 0xec, 0xb8, 0xd8, 0xdd, 0x53, 0x4b, 0x3c, 0xf3, 0xd2, 0xf2, 0x85, 0x24, 0xf4, 0x60, 0xfa, 0xf4, 0x82, 0x32, 0xd3, 0x41, 0x42, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x52, 0x92, 0x58, 0x64, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xac, 0xb9, 0x38, 0xdc, 0x53, 0x4b, 0x82, 0x41, 0x6e, 0x12, 0x12, 0x43, 0x28, 0x03, 0x0b, 0xc0, 0xb4, 0x8b, 0x63, 0x88, 0x23, 0x34, 0x07, 0x53, 0xa2, 0x19, 0x6a, 0x73, 0x31, 0xba, 0xe6, 0x62, 0x1c, 0x9a, 0x8b, 0xe1, 0x9a, 0x2d, 0xc0, 0xde, 0xf6, 0xc9, 0x4f, 0x2f, 0x16, 0x12, 0x45, 0xa8, 0x01, 0xf1, 0x61, 0x5a, 0xc5, 0xd0, 0x85, 0x21, 0x3a, 0x93, 0xd8, 0xc0, 0x62, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0x5e, 0x89, 0x4b, 0xd0, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // ManagerServiceClient is the client API for ManagerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ManagerServiceClient interface { // GetInfo returns the information about the rig GetInfo(ctx context.Context, in *RigInfoRequest, opts ...grpc.CallOption) (*RigInfoResponse, error) // GetState requests the current rig state GetState(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) // SetState requests the rig to enter the specified state SetState(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) // GetStats requests the current stats from the rig GetStats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) // GetLogs requests a rig's logs GetLogs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (*LogsResponse, error) } type managerServiceClient struct { cc *grpc.ClientConn } func NewManagerServiceClient(cc *grpc.ClientConn) ManagerServiceClient { return &managerServiceClient{cc} } func (c *managerServiceClient) GetInfo(ctx context.Context, in *RigInfoRequest, opts ...grpc.CallOption) (*RigInfoResponse, error) { out := new(RigInfoResponse) err := c.cc.Invoke(ctx, "/rpcproto.ManagerService/GetInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *managerServiceClient) GetState(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) { out := new(StateResponse) err := c.cc.Invoke(ctx, "/rpcproto.ManagerService/GetState", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *managerServiceClient) SetState(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) { out := new(StateResponse) err := c.cc.Invoke(ctx, "/rpcproto.ManagerService/SetState", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *managerServiceClient) GetStats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) { out := new(StatsResponse) err := c.cc.Invoke(ctx, "/rpcproto.ManagerService/GetStats", in, out, opts...) if err != nil
return out, nil } func (c *managerServiceClient) GetLogs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (*LogsResponse, error) { out := new(LogsResponse) err := c.cc.Invoke(ctx, "/rpcproto.ManagerService/GetLogs", in, out, opts...) if err != nil { return nil, err } return out, nil } // ManagerServiceServer is the server API for ManagerService service. type ManagerServiceServer interface { // GetInfo returns the information about the rig GetInfo(context.Context, *RigInfoRequest) (*RigInfoResponse, error) // GetState requests the current rig state GetState(context.Context, *StateRequest) (*StateResponse, error) // SetState requests the rig to enter the specified state SetState(context.Context, *StateRequest) (*StateResponse, error) // GetStats requests the current stats from the rig GetStats(context.Context, *StatsRequest) (*StatsResponse, error) // GetLogs requests a rig's logs GetLogs(context.Context, *LogsRequest) (*LogsResponse, error) } func RegisterManagerServiceServer(s *grpc.Server, srv ManagerServiceServer) { s.RegisterService(&_ManagerService_serviceDesc, srv) } func _ManagerService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RigInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ManagerServiceServer).GetInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/rpcproto.ManagerService/GetInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ManagerServiceServer).GetInfo(ctx, req.(*RigInfoRequest)) } return interceptor(ctx, in, info, handler) } func _ManagerService_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ManagerServiceServer).GetState(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/rpcproto.ManagerService/GetState", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ManagerServiceServer).GetState(ctx, req.(*StateRequest)) } return interceptor(ctx, in, info, handler) } func _ManagerService_SetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ManagerServiceServer).SetState(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/rpcproto.ManagerService/SetState", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ManagerServiceServer).SetState(ctx, req.(*StateRequest)) } return interceptor(ctx, in, info, handler) } func _ManagerService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ManagerServiceServer).GetStats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/rpcproto.ManagerService/GetStats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ManagerServiceServer).GetStats(ctx, req.(*StatsRequest)) } return interceptor(ctx, in, info, handler) } func _ManagerService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LogsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ManagerServiceServer).GetLogs(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/rpcproto.ManagerService/GetLogs", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ManagerServiceServer).GetLogs(ctx, req.(*LogsRequest)) } return interceptor(ctx, in, info, handler) } var _ManagerService_serviceDesc = grpc.ServiceDesc{ ServiceName: "rpcproto.ManagerService", HandlerType: (*ManagerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInfo", Handler: _ManagerService_GetInfo_Handler, }, { MethodName: "GetState", Handler: _ManagerService_GetState_Handler, }, { MethodName: "SetState", Handler: _ManagerService_SetState_Handler, }, { MethodName: "GetStats", Handler: _ManagerService_GetStats_Handler, }, { MethodName: "GetLogs", Handler: _ManagerService_GetLogs_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpcproto/manager_service.proto", }
{ return nil, err }
Tor.js
import React, { useMemo, useCallback } from 'react' import PropTypes from 'prop-types' import { FormattedMessage, defineMessages } from 'react-intl' import { Flex, Text, Container, theme } from 'ooni-components' import styled from 'styled-components' import { useTable, useSortBy } from 'react-table' import { Cross, Tick } from 'ooni-components/dist/icons' import { useClipboard } from 'use-clipboard-copy' import { FaClipboard } from 'react-icons/fa' import AccessPointStatus from '../AccessPointStatus' const TableStyles = styled.div` table { border-spacing: 0; border: 1px solid black; width: 100%; tr { :last-child { td { border-bottom: 0; } } } th, td { margin: 0; padding: 0.5rem; border-bottom: 1px solid black; text-align: center; :last-child { border-right: 0; } } th { border-right: 1px solid black; } } ` const StyledNameCell = styled.div` overflow: hidden; text-overflow: ellipsis; position: relative; ` const ClipboardIcon = styled.div` position: absolute; right: -3px; top: -5px; ` const NameCell = ({ children }) => { const clipboard = useClipboard({ copiedTimeout: 1500 }) return ( <React.Fragment> <StyledNameCell title={`${children} (Click to copy)`} onClick={() => clipboard.copy(children)} > {children} <ClipboardIcon> {clipboard.copied && <FaClipboard size={10} color={theme.colors.green7} />} </ClipboardIcon> </StyledNameCell> </React.Fragment> ) } NameCell.propTypes = { children: PropTypes.element.isRequired } const Table = ({ columns, data }) => { const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable( { columns, data }, useSortBy ) return ( /* eslint-disable react/jsx-key */ <table {...getTableProps()}> <thead> {headerGroups.map(headerGroup => ( <tr {...headerGroup.getHeaderGroupProps()}> {headerGroup.headers.map(column => ( <th {...column.getHeaderProps(column.getSortByToggleProps())}> {column.render('Header')} {/* Sort order indicator */} <span> {column.isSorted ? column.isSortedDesc ? ' 🔽' : ' 🔼' : ''} </span> </th> ))} </tr> ))} </thead> <tbody {...getTableBodyProps()}> {rows.map((row) => { prepareRow(row)
})} </tr> )} )} </tbody> </table> /* eslint-enable react/jsx-key */ ) } const ConnectionStatusCell = ({ cell: { value} }) => { let statusIcon = null if (value === false) { statusIcon = <Text fontWeight='bold' fontSize={1} color={theme.colors.gray7}>N/A</Text> } else { statusIcon = value === null ? <Tick color={theme.colors.green7} /> : <Cross color={theme.colors.red7} /> } return ( <React.Fragment> {statusIcon} {value} </React.Fragment> ) } const TorDetails = ({ isAnomaly, isFailure, measurement, render }) => { // https://github.com/ooni/spec/blob/master/nettests/ts-023-tor.md#possible-conclusions let status, hint, summaryText if (isFailure) { status = 'error' hint = <FormattedMessage id='Measurement.Status.Hint.Tor.Error' /> summaryText = 'Measurement.Details.SummaryText.Tor.Error' } else if (isAnomaly) { status = 'anomaly' hint = <FormattedMessage id='Measurement.Status.Hint.Tor.Blocked' /> summaryText = 'Measurement.Details.SummaryText.Tor.Blocked' } else { status = 'reachable' hint = <FormattedMessage id='Measurement.Status.Hint.Tor.Reachable' /> summaryText = 'Measurement.Details.SummaryText.Tor.OK' } const { or_port_accessible, or_port_total, or_port_dirauth_accessible, or_port_dirauth_total, obfs4_accessible, obfs4_total, dir_port_accessible, dir_port_total, targets = {} } = measurement.test_keys const columns = useMemo(() => [ { Header: <FormattedMessage id='Measurement.Details.Tor.Table.Header.Name' />, accessor: 'name', Cell: ({ cell: { value } }) => ( // eslint-disable-line react/display-name,react/prop-types <NameCell>{value}</NameCell> ) }, { Header: <FormattedMessage id='Measurement.Details.Tor.Table.Header.Address' />, accessor: 'address' }, { Header: <FormattedMessage id='Measurement.Details.Tor.Table.Header.Type' />, accessor: 'type' }, { Header: <FormattedMessage id='Measurement.Details.Tor.Table.Header.Connect' />, accessor: 'connect', collapse: true, Cell: ConnectionStatusCell }, { Header: <FormattedMessage id='Measurement.Details.Tor.Table.Header.Handshake' />, accessor: 'handshake', collapse: true, Cell: ConnectionStatusCell } ], []) const data = useMemo(() => ( Object.keys(targets).map(target => { // Connection Status values // false: Didn't run (N/A) // null: No failure a.k.a success // string: Failure with error string let connectStatus = false, handshakeStatus = false if (targets[target].summary.connect) { connectStatus = targets[target].summary.connect.failure } if (targets[target].summary.handshake) { handshakeStatus = targets[target].summary.handshake.failure } return { name: targets[target].target_name || target, address: targets[target].target_address, type: targets[target].target_protocol, connect: connectStatus, handshake: handshakeStatus } }) ), [targets]) const messages = defineMessages({ tor: { id: 'Measurement.Metadata.Tor', defaultMessage: 'Tor censorship test result in {country}' } }) return ( <React.Fragment> {render({ status: status, statusInfo: hint, summaryText: summaryText, headMetadata: { message: messages.tor, formatted: false }, details: ( <React.Fragment> <Container> <Flex my={4}> <AccessPointStatus width={1/2} label={<FormattedMessage id='Measurement.Details.Tor.Bridges.Label.Title' />} content={ <FormattedMessage id='Measurement.Details.Tor.Bridges.Label.OK' defaultMessage='{bridgesAccessible}/{bridgesTotal} OK' values={{ bridgesAccessible: obfs4_accessible, bridgesTotal: obfs4_total }} /> } ok={true} color='blue5' /> <AccessPointStatus width={1/2} label={<FormattedMessage id='Measurement.Details.Tor.DirAuth.Label.Title' />} content={ <FormattedMessage id='Measurement.Details.Tor.DirAuth.Label.OK' defaultMessage='{dirAuthAccessible}/{dirAuthTotal} OK' values={{ dirAuthAccessible: or_port_dirauth_accessible, dirAuthTotal: or_port_dirauth_total }} /> } ok={true} color='blue5' /> </Flex> <TableStyles> <Table columns={columns} data={data} /> </TableStyles> </Container> </React.Fragment> ) })} </React.Fragment> ) } TorDetails.propTypes = { render: PropTypes.func, measurement: PropTypes.object.isRequired, country: PropTypes.string.isRequired } export default TorDetails
return ( <tr {...row.getRowProps()}> {row.cells.map(cell => { return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>
write.go
package whatsapp import ( "crypto/hmac" "crypto/sha256" "encoding/json" "fmt" "strconv" "time" "github.com/gazandic/go-whatsapp/binary" "github.com/gazandic/go-whatsapp/crypto/cbc" "github.com/gorilla/websocket" "github.com/pkg/errors" ) func (wac *Conn) addListener(ch chan string, messageTag string) { wac.listener.Lock() wac.listener.m[messageTag] = ch wac.listener.Unlock() } func (wac *Conn) removeListener(answerMessageTag string) { wac.listener.Lock() delete(wac.listener.m, answerMessageTag) wac.listener.Unlock() } //writeJson enqueues a json message into the writeChan func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) { ch := make(chan string, 1) wac.writerLock.Lock() defer wac.writerLock.Unlock() d, err := json.Marshal(data) if err != nil { close(ch) return ch, err } ts := time.Now().Unix() messageTag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) bytes := []byte(fmt.Sprintf("%s,%s", messageTag, d)) if wac.timeTag == "" { tss := fmt.Sprintf("%d", ts) wac.timeTag = tss[len(tss)-3:] } wac.addListener(ch, messageTag) err = wac.write(websocket.TextMessage, bytes) if err != nil { close(ch) wac.removeListener(messageTag) return ch, err } wac.msgCount++ return ch, nil } func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, messageTag string) (<-chan string, error) { ch := make(chan string, 1) if len(messageTag) < 2 { close(ch) return ch, ErrMissingMessageTag } wac.writerLock.Lock() defer wac.writerLock.Unlock() data, err := wac.encryptBinaryMessage(node) if err != nil { close(ch) return ch, errors.Wrap(err, "encryptBinaryMessage(node) failed") } bytes := []byte(messageTag + ",") bytes = append(bytes, byte(metric), byte(flag)) bytes = append(bytes, data...) wac.addListener(ch, messageTag) err = wac.write(websocket.BinaryMessage, bytes) if err != nil { close(ch) wac.removeListener(messageTag) return ch, errors.Wrap(err, "failed to write message") } wac.msgCount++ return ch, nil } func (wac *Conn) sendKeepAlive() error { respChan := make(chan string, 1) wac.addListener(respChan, "!") bytes := []byte("?,,") err := wac.write(websocket.TextMessage, bytes) if err != nil { close(respChan) wac.removeListener("!") return errors.Wrap(err, "error sending keepAlive") } select { case resp := <-respChan: msecs, err := strconv.ParseInt(resp, 10, 64) if err != nil { return errors.Wrap(err, "Error converting time string to uint") } wac.ServerLastSeen = time.Unix(msecs/1000, (msecs%1000)*int64(time.Millisecond)) case <-time.After(wac.msgTimeout): return ErrConnectionTimeout } return nil } /* When phone is unreachable, WhatsAppWeb sends ["admin","test"] time after time to try a successful contact. Tested with Airplane mode and no connection at all. */ func (wac *Conn) sendAdminTest() (bool, error) { data := []interface{}{"admin", "test"} r, err := wac.writeJson(data) if err != nil { return false, errors.Wrap(err, "error sending admin test") } var response []interface{} select { case resp := <-r: if err := json.Unmarshal([]byte(resp), &response); err != nil { return false, fmt.Errorf("error decoding response message: %v\n", err) } case <-time.After(wac.msgTimeout): return false, ErrConnectionTimeout } if len(response) == 2 && response[0].(string) == "Pong" && response[1].(bool) == true { return true, nil } else { return false, nil } } func (wac *Conn) write(messageType int, data []byte) error { if wac == nil || wac.ws == nil { return ErrInvalidWebsocket } wac.ws.Lock() err := wac.ws.conn.WriteMessage(messageType, data) wac.ws.Unlock() if err != nil { return errors.Wrap(err, "error writing to websocket") } return nil } func (wac *Conn) encryptBinaryMessage(node binary.Node) (data []byte, err error) { b, err := binary.Marshal(node) if err != nil { return nil, errors.Wrap(err, "binary node marshal failed") } cipher, err := cbc.Encrypt(wac.session.EncKey, nil, b) if err != nil
h := hmac.New(sha256.New, wac.session.MacKey) h.Write(cipher) hash := h.Sum(nil) data = append(data, hash[:32]...) data = append(data, cipher...) return data, nil }
{ return nil, errors.Wrap(err, "encrypt failed") }
controller.go
/* Copyright 2019 The Rook Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package client to manage a rook client. package client import ( "context" "fmt" "reflect" "regexp" "strings" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" "github.com/coreos/pkg/capnslog" cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" "github.com/rook/rook/pkg/clusterd" cephclient "github.com/rook/rook/pkg/daemon/ceph/client" "github.com/rook/rook/pkg/operator/ceph/cluster/mon" opcontroller "github.com/rook/rook/pkg/operator/ceph/controller" "github.com/rook/rook/pkg/operator/ceph/reporting" "github.com/rook/rook/pkg/operator/k8sutil" v1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" ) const ( controllerName = "ceph-client-controller" ) var logger = capnslog.NewPackageLogger("github.com/rook/rook", controllerName) var cephClientKind = reflect.TypeOf(cephv1.CephClient{}).Name() // Sets the type meta for the controller main object var controllerTypeMeta = metav1.TypeMeta{ Kind: cephClientKind, APIVersion: fmt.Sprintf("%s/%s", cephv1.CustomResourceGroup, cephv1.Version), } // ReconcileCephClient reconciles a CephClient object type ReconcileCephClient struct { client client.Client scheme *runtime.Scheme context *clusterd.Context clusterInfo *cephclient.ClusterInfo opManagerContext context.Context recorder record.EventRecorder } // Add creates a new CephClient Controller and adds it to the Manager. The Manager will set fields on the Controller // and Start it when the Manager is Started. func
(mgr manager.Manager, context *clusterd.Context, opManagerContext context.Context, opConfig opcontroller.OperatorConfig) error { return add(mgr, newReconciler(mgr, context, opManagerContext)) } // newReconciler returns a new reconcile.Reconciler func newReconciler(mgr manager.Manager, context *clusterd.Context, opManagerContext context.Context) reconcile.Reconciler { return &ReconcileCephClient{ client: mgr.GetClient(), scheme: mgr.GetScheme(), context: context, opManagerContext: opManagerContext, recorder: mgr.GetEventRecorderFor("rook-" + controllerName), } } func add(mgr manager.Manager, r reconcile.Reconciler) error { // Create a new controller c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r}) if err != nil { return err } logger.Info("successfully started") // Watch for changes on the CephClient CRD object err = c.Watch(&source.Kind{Type: &cephv1.CephClient{TypeMeta: controllerTypeMeta}}, &handler.EnqueueRequestForObject{}, opcontroller.WatchControllerPredicate()) if err != nil { return err } // Watch secrets err = c.Watch(&source.Kind{Type: &v1.Secret{TypeMeta: metav1.TypeMeta{Kind: "Secret", APIVersion: v1.SchemeGroupVersion.String()}}}, &handler.EnqueueRequestForOwner{ IsController: true, OwnerType: &cephv1.CephClient{}, }, opcontroller.WatchPredicateForNonCRDObject(&cephv1.CephClient{TypeMeta: controllerTypeMeta}, mgr.GetScheme())) if err != nil { return err } return nil } // Reconcile reads that state of the cluster for a CephClient object and makes changes based on the state read // and what is in the CephClient.Spec // The Controller will requeue the Request to be processed again if the returned error is non-nil or // Result.Requeue is true, otherwise upon completion it will remove the work from the queue. func (r *ReconcileCephClient) Reconcile(context context.Context, request reconcile.Request) (reconcile.Result, error) { // workaround because the rook logging mechanism is not compatible with the controller-runtime logging interface reconcileResponse, cephClient, err := r.reconcile(request) return reporting.ReportReconcileResult(logger, r.recorder, request, &cephClient, reconcileResponse, err) } func (r *ReconcileCephClient) reconcile(request reconcile.Request) (reconcile.Result, cephv1.CephClient, error) { // Fetch the CephClient instance cephClient := &cephv1.CephClient{} err := r.client.Get(r.opManagerContext, request.NamespacedName, cephClient) if err != nil { if kerrors.IsNotFound(err) { logger.Debug("cephClient resource not found. Ignoring since object must be deleted.") return reconcile.Result{}, *cephClient, nil } // Error reading the object - requeue the request. return reconcile.Result{}, *cephClient, errors.Wrap(err, "failed to get cephClient") } // update observedGeneration local variable with current generation value, // because generation can be changed before reconile got completed // CR status will be updated at end of reconcile, so to reflect the reconcile has finished observedGeneration := cephClient.ObjectMeta.Generation // Set a finalizer so we can do cleanup before the object goes away err = opcontroller.AddFinalizerIfNotPresent(r.opManagerContext, r.client, cephClient) if err != nil { return reconcile.Result{}, *cephClient, errors.Wrap(err, "failed to add finalizer") } // The CR was just created, initializing status fields if cephClient.Status == nil { r.updateStatus(k8sutil.ObservedGenerationNotAvailable, request.NamespacedName, cephv1.ConditionProgressing) } // Make sure a CephCluster is present otherwise do nothing _, isReadyToReconcile, cephClusterExists, reconcileResponse := opcontroller.IsReadyToReconcile(r.opManagerContext, r.client, request.NamespacedName, controllerName) if !isReadyToReconcile { // This handles the case where the Ceph Cluster is gone and we want to delete that CR // We skip the deletePool() function since everything is gone already // // Also, only remove the finalizer if the CephCluster is gone // If not, we should wait for it to be ready // This handles the case where the operator is not ready to accept Ceph command but the cluster exists if !cephClient.GetDeletionTimestamp().IsZero() && !cephClusterExists { // Remove finalizer err = opcontroller.RemoveFinalizer(r.opManagerContext, r.client, cephClient) if err != nil { return opcontroller.ImmediateRetryResult, *cephClient, errors.Wrap(err, "failed to remove finalizer") } // Return and do not requeue. Successful deletion. return reconcile.Result{}, *cephClient, nil } return reconcileResponse, *cephClient, nil } // Populate clusterInfo during each reconcile r.clusterInfo, _, _, err = mon.LoadClusterInfo(r.context, r.opManagerContext, request.NamespacedName.Namespace) if err != nil { return reconcile.Result{}, *cephClient, errors.Wrap(err, "failed to populate cluster info") } r.clusterInfo.Context = r.opManagerContext // DELETE: the CR was deleted if !cephClient.GetDeletionTimestamp().IsZero() { logger.Debugf("deleting pool %q", cephClient.Name) err := r.deleteClient(cephClient) if err != nil { return reconcile.Result{}, *cephClient, errors.Wrapf(err, "failed to delete ceph client %q", cephClient.Name) } r.recorder.Eventf(cephClient, v1.EventTypeNormal, string(cephv1.ReconcileStarted), "deleting CephClient %q", cephClient.Name) // Remove finalizer err = opcontroller.RemoveFinalizer(r.opManagerContext, r.client, cephClient) if err != nil { return reconcile.Result{}, *cephClient, errors.Wrap(err, "failed to remove finalizer") } r.recorder.Event(cephClient, v1.EventTypeNormal, string(cephv1.ReconcileSucceeded), "successfully removed finalizer") // Return and do not requeue. Successful deletion. return reconcile.Result{}, *cephClient, nil } // validate the client settings err = ValidateClient(r.context, cephClient) if err != nil { return reconcile.Result{}, *cephClient, errors.Wrapf(err, "failed to validate client %q arguments", cephClient.Name) } // Create or Update client err = r.createOrUpdateClient(cephClient) if err != nil { if strings.Contains(err.Error(), opcontroller.UninitializedCephConfigError) { logger.Info(opcontroller.OperatorNotInitializedMessage) return opcontroller.WaitForRequeueIfOperatorNotInitialized, *cephClient, nil } r.updateStatus(k8sutil.ObservedGenerationNotAvailable, request.NamespacedName, cephv1.ConditionFailure) return reconcile.Result{}, *cephClient, errors.Wrapf(err, "failed to create or update client %q", cephClient.Name) } // update status with latest ObservedGeneration value at the end of reconcile // Success! Let's update the status r.updateStatus(observedGeneration, request.NamespacedName, cephv1.ConditionReady) // Return and do not requeue logger.Debug("done reconciling") return reconcile.Result{}, *cephClient, nil } // Create the client func (r *ReconcileCephClient) createOrUpdateClient(cephClient *cephv1.CephClient) error { logger.Infof("creating client %s in namespace %s", cephClient.Name, cephClient.Namespace) // Generate the CephX details clientEntity, caps := genClientEntity(cephClient) // Check if client was created manually, create if necessary or update caps and create secret key, err := cephclient.AuthGetKey(r.context, r.clusterInfo, clientEntity) if err != nil { key, err = cephclient.AuthGetOrCreateKey(r.context, r.clusterInfo, clientEntity, caps) if err != nil { return errors.Wrapf(err, "failed to create client %q", cephClient.Name) } } else { err = cephclient.AuthUpdateCaps(r.context, r.clusterInfo, clientEntity, caps) if err != nil { return errors.Wrapf(err, "client %q exists, failed to update client caps", cephClient.Name) } } // Generate Kubernetes Secret secret := &v1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: generateCephUserSecretName(cephClient), Namespace: cephClient.Namespace, }, StringData: map[string]string{ cephClient.Name: key, }, Type: k8sutil.RookType, } // Set CephClient owner ref to the Secret err = controllerutil.SetControllerReference(cephClient, secret, r.scheme) if err != nil { return errors.Wrapf(err, "failed to set owner reference to ceph client secret %q", secret.Name) } // Create or Update Kubernetes Secret _, err = r.context.Clientset.CoreV1().Secrets(cephClient.Namespace).Get(r.clusterInfo.Context, secret.Name, metav1.GetOptions{}) if err != nil { if kerrors.IsNotFound(err) { logger.Debugf("creating secret for %q", secret.Name) if _, err := r.context.Clientset.CoreV1().Secrets(cephClient.Namespace).Create(r.clusterInfo.Context, secret, metav1.CreateOptions{}); err != nil { return errors.Wrapf(err, "failed to create secret for %q", secret.Name) } logger.Infof("created client %q", cephClient.Name) return nil } return errors.Wrapf(err, "failed to get secret for %q", secret.Name) } logger.Debugf("updating secret for %s", secret.Name) _, err = r.context.Clientset.CoreV1().Secrets(cephClient.Namespace).Update(r.clusterInfo.Context, secret, metav1.UpdateOptions{}) if err != nil { return errors.Wrapf(err, "failed to update secret for %q", secret.Name) } logger.Infof("updated client %q", cephClient.Name) return nil } // Delete the client func (r *ReconcileCephClient) deleteClient(cephClient *cephv1.CephClient) error { logger.Infof("deleting client object %q", cephClient.Name) if err := cephclient.AuthDelete(r.context, r.clusterInfo, generateClientName(cephClient.Name)); err != nil { return errors.Wrapf(err, "failed to delete client %q", cephClient.Name) } logger.Infof("deleted client %q", cephClient.Name) return nil } // ValidateClient the client arguments func ValidateClient(context *clusterd.Context, cephClient *cephv1.CephClient) error { // Validate name if cephClient.Name == "" { return errors.New("missing name") } reservedNames := regexp.MustCompile("^admin$|^rgw.*$|^rbd-mirror$|^osd.[0-9]*$|^bootstrap-(mds|mgr|mon|osd|rgw|^rbd-mirror)$") if reservedNames.Match([]byte(cephClient.Name)) { return errors.Errorf("ignoring reserved name %q", cephClient.Name) } // Validate Spec if cephClient.Spec.Caps == nil { return errors.New("no caps specified") } for _, cap := range cephClient.Spec.Caps { if cap == "" { return errors.New("no caps specified") } } return nil } func genClientEntity(cephClient *cephv1.CephClient) (string, []string) { caps := []string{} for name, cap := range cephClient.Spec.Caps { caps = append(caps, name, cap) } return generateClientName(cephClient.Name), caps } func generateClientName(name string) string { return fmt.Sprintf("client.%s", name) } // updateStatus updates an object with a given status func (r *ReconcileCephClient) updateStatus(observedGeneration int64, name types.NamespacedName, status cephv1.ConditionType) { cephClient := &cephv1.CephClient{} if err := r.client.Get(r.opManagerContext, name, cephClient); err != nil { if kerrors.IsNotFound(err) { logger.Debug("CephClient resource not found. Ignoring since object must be deleted.") return } logger.Warningf("failed to retrieve ceph client %q to update status to %q. %v", name, status, err) return } if cephClient.Status == nil { cephClient.Status = &cephv1.CephClientStatus{} } cephClient.Status.Phase = status if cephClient.Status.Phase == cephv1.ConditionReady { cephClient.Status.Info = generateStatusInfo(cephClient) } if observedGeneration != k8sutil.ObservedGenerationNotAvailable { cephClient.Status.ObservedGeneration = observedGeneration } if err := reporting.UpdateStatus(r.client, cephClient); err != nil { logger.Errorf("failed to set ceph client %q status to %q. %v", name, status, err) return } logger.Debugf("ceph client %q status updated to %q", name, status) } func generateStatusInfo(client *cephv1.CephClient) map[string]string { m := make(map[string]string) m["secretName"] = generateCephUserSecretName(client) return m } func generateCephUserSecretName(client *cephv1.CephClient) string { return fmt.Sprintf("rook-ceph-client-%s", client.Name) }
Add
homo_lr_base.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import functools from federatedml.linear_model.linear_model_weight import LinearModelWeights from federatedml.linear_model.logistic_regression.base_logistic_regression import BaseLogisticRegression from federatedml.optim import activation from federatedml.optim.optimizer import optimizer_factory from federatedml.param.logistic_regression_param import HomoLogisticParam from federatedml.protobuf.generated import lr_model_meta_pb2 from federatedml.secureprotol import PaillierEncrypt, FakeEncrypt from federatedml.util.classify_label_checker import ClassifyLabelChecker from federatedml.util.homo_label_encoder import HomoLabelEncoderClient, HomoLabelEncoderArbiter from federatedml.statistic import data_overview from federatedml.transfer_variable.transfer_class.homo_lr_transfer_variable import HomoLRTransferVariable from federatedml.util import LOGGER from federatedml.util import consts from federatedml.util import fate_operator class HomoLRBase(BaseLogisticRegression): def __init__(self):
def _init_model(self, params): super(HomoLRBase, self)._init_model(params) self.re_encrypt_batches = params.re_encrypt_batches if params.encrypt_param.method == consts.PAILLIER: self.cipher_operator = PaillierEncrypt() else: self.cipher_operator = FakeEncrypt() self.transfer_variable = HomoLRTransferVariable() # self.aggregator.register_aggregator(self.transfer_variable) self.optimizer = optimizer_factory(params) self.aggregate_iters = params.aggregate_iters self.use_proximal = params.use_proximal self.mu = params.mu @property def use_loss(self): if self.model_param.early_stop == 'weight_diff': return False return True def _client_check_data(self, data_instances): self._abnormal_detection(data_instances) self.check_abnormal_values(data_instances) self.init_schema(data_instances) num_classes, classes_ = ClassifyLabelChecker.validate_label(data_instances) aligned_label, new_label_mapping = HomoLabelEncoderClient().label_alignment(classes_) if len(aligned_label) > 2: raise ValueError("Homo LR support binary classification only now") elif len(aligned_label) <= 1: raise ValueError("Number of classes should be equal to 2") def _server_check_data(self): HomoLabelEncoderArbiter().label_alignment() def classify(self, predict_wx, threshold): """ convert a probability table into a predicted class table. """ # predict_wx = self.compute_wx(data_instances, self.model_weights.coef_, self.model_weights.intercept_) def predict(x): prob = activation.sigmoid(x) pred_label = 1 if prob > threshold else 0 return prob, pred_label predict_table = predict_wx.mapValues(predict) return predict_table def _init_model_variables(self, data_instances): model_shape = data_overview.get_features_shape(data_instances) LOGGER.info("Initialized model shape is {}".format(model_shape)) w = self.initializer.init_model(model_shape, init_params=self.init_param_obj, data_instance=data_instances) model_weights = LinearModelWeights(w, fit_intercept=self.fit_intercept) return model_weights def _compute_loss(self, data_instances, prev_round_weights): f = functools.partial(self.gradient_operator.compute_loss, coef=self.model_weights.coef_, intercept=self.model_weights.intercept_) loss = data_instances.applyPartitions(f).reduce(fate_operator.reduce_add) if self.use_proximal: # use additional proximal term loss_norm = self.optimizer.loss_norm(self.model_weights, prev_round_weights) else: loss_norm = self.optimizer.loss_norm(self.model_weights) if loss_norm is not None: loss += loss_norm loss /= data_instances.count() self.callback_loss(self.n_iter_, loss) self.loss_history.append(loss) return loss def _get_meta(self): meta_protobuf_obj = lr_model_meta_pb2.LRModelMeta(penalty=self.model_param.penalty, tol=self.model_param.tol, alpha=self.alpha, optimizer=self.model_param.optimizer, batch_size=self.batch_size, learning_rate=self.model_param.learning_rate, max_iter=self.max_iter, early_stop=self.model_param.early_stop, fit_intercept=self.fit_intercept, re_encrypt_batches=self.re_encrypt_batches, need_one_vs_rest=self.need_one_vs_rest) return meta_protobuf_obj
super(HomoLRBase, self).__init__() self.model_name = 'HomoLogisticRegression' self.model_param_name = 'HomoLogisticRegressionParam' self.model_meta_name = 'HomoLogisticRegressionMeta' self.mode = consts.HOMO self.model_param = HomoLogisticParam() self.aggregator = None
main.rs
#![deny(clippy::all, clippy::pedantic)] #![allow( clippy::cognitive_complexity, clippy::large_enum_variant, clippy::similar_names, clippy::module_name_repetitions, clippy::use_self, clippy::match_same_arms, clippy::must_use_candidate, clippy::missing_errors_doc )] use std::{process::Stdio, sync::Arc}; use anyhow::{Context, Error, Result}; use futures_util::future::{self, Either}; use log::{error, info, warn, LevelFilter}; use tokio::{process::Command, sync::Notify, task::JoinHandle}; use api_proxy_module::{ monitors::{certs_monitor, config_monitor, shutdown_handle}, signals::shutdown, }; use shutdown_handle::ShutdownHandle; #[tokio::main] async fn main() -> Result<()> { env_logger::builder().filter_level(LevelFilter::Info).init(); let notify_config_reload_api_proxy = Arc::new(Notify::new()); let notify_cert_reload_api_proxy = Arc::new(Notify::new()); let client = config_monitor::get_sdk_client()?; let mut shutdown_sdk = client .inner() .shutdown_handle() .context("Could not create Shutdown handle")?; let (config_monitor_handle, config_monitor_shutdown_handle) = config_monitor::start(client, notify_config_reload_api_proxy.clone()) .context("Failed running config monitor")?; let (cert_monitor_handle, cert_monitor_shutdown_handle) = certs_monitor::start(notify_cert_reload_api_proxy.clone()) .context("Failed running certificates monitor")?; let (nginx_controller_handle, nginx_controller_shutdown_handle) = nginx_controller_start(notify_config_reload_api_proxy, notify_cert_reload_api_proxy) .context("Failed running nginx controller")?; //If one task closes, clean up everything if let Err(e) = nginx_controller_handle.await
; //Send shutdown signal to all task shutdown_sdk .shutdown() .await .context("Fatal, could not shut down SDK")?; cert_monitor_shutdown_handle.shutdown().await; config_monitor_shutdown_handle.shutdown().await; nginx_controller_shutdown_handle.shutdown().await; if let Err(e) = cert_monitor_handle.await { error!("error on finishing cert monitor: {}", e); } if let Err(e) = config_monitor_handle.await { error!("error on finishing config monitor: {}", e); } info!("Api proxy stopped"); Ok(()) } pub fn nginx_controller_start( notify_config_reload_api_proxy: Arc<Notify>, notify_cert_reload_api_proxy: Arc<Notify>, ) -> Result<(JoinHandle<Result<()>>, ShutdownHandle), Error> { let program_path = "/usr/sbin/nginx"; let args = vec![ "-c".to_string(), "/app/nginx_config.conf".to_string(), "-g".to_string(), "daemon off;".to_string(), ]; let name = "nginx"; let stop_proxy_name = "stop nginx"; let stop_proxy_program_path = "nginx"; let stop_proxy_args = vec!["-s".to_string(), "stop".to_string()]; let shutdown_signal = Arc::new(Notify::new()); let shutdown_handle = ShutdownHandle(shutdown_signal.clone()); let monitor_loop: JoinHandle<Result<()>> = tokio::spawn(async move { //This is just to avoid error at the beginning when nginx tries to start //Wait for configuration and for certs to be ready. notify_config_reload_api_proxy.notified().await; notify_cert_reload_api_proxy.notified().await; loop { //Make sure proxy is stopped by sending stop command. Otherwise port will be blocked let command = Command::new(stop_proxy_program_path) .args(&stop_proxy_args) .spawn() .with_context(|| format!("Failed to start {} process.", stop_proxy_name)) .context("Cannot stop proxy!")?; command .await .context("Error while trying to wait on stop proxy future")?; //Start nginx let child_nginx = Command::new(program_path) .args(&args) .stdout(Stdio::inherit()) .spawn() .with_context(|| format!("Failed to start {} process.", name)) .context("Cannot start proxy!")?; // Restart nginx on new config, new cert or crash. let cert_reload = notify_cert_reload_api_proxy.notified(); let config_reload = notify_config_reload_api_proxy.notified(); futures::pin_mut!(cert_reload, config_reload); let signal_restart_nginx = future::select(cert_reload, config_reload); futures::pin_mut!(child_nginx, signal_restart_nginx); let restart_proxy = future::select(child_nginx, signal_restart_nginx); //Shutdown on ctrl+c or on signal let wait_shutdown_ctrl_c = shutdown::shutdown(); futures::pin_mut!(wait_shutdown_ctrl_c); let wait_shutdown_signal = shutdown_signal.notified(); futures::pin_mut!(wait_shutdown_signal); let wait_shutdown = future::select(wait_shutdown_ctrl_c, wait_shutdown_signal); match future::select(wait_shutdown, restart_proxy).await { Either::Left(_) => { warn!("Shutting down ngxing controller!"); return Ok(()); } Either::Right((result, _)) => { match result { Either::Left(_) => { info!("Nginx crashed, restarting"); } Either::Right(_) => { info!("Request to restart Nginx received"); } }; } } info!("Restarting Proxy"); } }); Ok((monitor_loop, shutdown_handle)) } //add pin utils
{ error!("Tasks encountered and error {}", e); }
generator.go
package generator import ( "encoding/json" "fmt" "html" "strings" "github.com/ahmetb/go-linq" "github.com/dave/jennifer/jen" "github.com/getkin/kin-openapi/openapi3" "github.com/spf13/cast" "github.com/tdewolff/minify/v2/minify" "github.com/mikekonan/go-oas3/configurator" ) type Generator struct { normalizer *Normalizer `di.inject:"normalizer"` typee *Type `di.inject:"typeFiller"` config *configurator.Config `di.inject:"config"` } type Result struct { ComponentsCode *jen.File RouterCode *jen.File SpecCode *jen.File } func (generator *Generator) file(from jen.Code, packagePath string) *jen.File { file := jen.NewFilePathName(packagePath, generator.trimPackagePath(packagePath)) file.HeaderComment("This file is generated by github.com/mikekonan/go-oas3. DO NOT EDIT.") file.ImportAlias("github.com/mikekonan/go-types/country", "countries") file.ImportAlias("github.com/mikekonan/go-types/currency", "currency") file.ImportAlias("github.com/go-ozzo/ozzo-validation/v4", "validation") file.Add(from) return file } func (generator *Generator) Generate(swagger *openapi3.Swagger) *Result { componentsAdditionalVars, parametersAdditionalVars := generator.additionalConstants(swagger) componentsCode := jen.Null().Add(componentsAdditionalVars, generator.components(swagger)) routerCode := jen.Null(). Add(parametersAdditionalVars...).Line(). Add(generator.wrappers(swagger)).Line(). Add(generator.requestResponseBuilders(swagger)).Line(). Add(generator.securitySchemas(swagger)) return &Result{ ComponentsCode: generator.file(componentsCode, generator.config.ComponentsPackage), RouterCode: generator.file(routerCode, generator.config.Package), SpecCode: generator.file(generator.specCode(swagger), generator.config.Package), } } func (generator *Generator) requestParameters(paths map[string]*openapi3.PathItem) jen.Code { var result []jen.Code linq.From(paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) operationsCodeTags := map[string][]jen.Code{} linq.From(kv.Value.(*openapi3.PathItem).Operations()). GroupByT( func(kv linq.KeyValue) string { return generator.normalizer.normalize(kv.Value.(*openapi3.Operation).Tags[0]) }, func(kv linq.KeyValue) (result []jen.Code) { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) operation := kv.Value.(*openapi3.Operation) if operation.RequestBody == nil { result = append(result, generator.requestParameterStruct(name, "", false, operation)) return } if operation.RequestBody != nil && len(operation.RequestBody.Value.Content) == 1 { contentType := cast.ToString(linq.From(operation.RequestBody.Value.Content).SelectT(func(kv linq.KeyValue) string { return cast.ToString(kv.Key) }).First()) result = append(result, generator.requestParameterStruct(name, contentType, false, operation)) return } var contentTypeResult []jen.Code linq.From(operation.RequestBody.Value.Content). SelectT(func(kv linq.KeyValue) jen.Code { return generator.requestParameterStruct(name, cast.ToString(kv.Key), true, operation) }). ToSlice(&contentTypeResult) result = append(result, contentTypeResult...) result = generator.normalizer.doubleLineAfterEachElement(result...) return }, ). ToMapByT(&operationsCodeTags, func(kv linq.Group) interface{} { return kv.Key }, func(kv linq.Group) (grouped []jen.Code) { linq.From(kv.Group).SelectMany(func(i interface{}) linq.Query { return linq.From(i) }).ToSlice(&grouped) return }, ) return linq.From(operationsCodeTags) }). GroupByT( func(kv linq.KeyValue) interface{} { return kv.Key }, func(kv linq.KeyValue) interface{} { return kv.Value }, ). SelectT(func(kv linq.Group) jen.Code { var grouped []jen.Code linq.From(kv.Group).SelectMany(func(i interface{}) linq.Query { return linq.From(i) }).ToSlice(&grouped) return jen.Add(generator.normalizer.lineAfterEachElement(grouped...)...) }). ToSlice(&result) return jen.Null(). Add(result...). Add(jen.Line()) } func (generator *Generator) components(swagger *openapi3.Swagger) jen.Code { var componentsResult []jen.Code linq.From(swagger.Components.Schemas). WhereT(func(kv linq.KeyValue) bool { return len(kv.Value.(*openapi3.SchemaRef).Value.Enum) == 0 }). //filter enums SelectT(func(kv linq.KeyValue) jen.Code { schemaRef := kv.Value.(*openapi3.SchemaRef) return generator.componentFromSchema(cast.ToString(kv.Key), schemaRef) }). ToSlice(&componentsResult) var componentsFromPathsResult []jen.Code linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) componentsByName := map[string]jen.Code{} linq.From(kv.Value.(*openapi3.PathItem).Operations()). WhereT(func(kv linq.KeyValue) bool { operation := kv.Value.(*openapi3.Operation) return operation.RequestBody != nil && len(operation.RequestBody.Value.Content) > 0 && linq.From(operation.RequestBody.Value.Content). AnyWithT(func(kv linq.KeyValue) bool { return kv.Value.(*openapi3.MediaType).Schema.Ref == "" }) }). SelectManyT( func(kv linq.KeyValue) linq.Query { result := map[string]jen.Code{} name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) operation := kv.Value.(*openapi3.Operation) if len(operation.RequestBody.Value.Content) == 1 { name += "RequestBody" obj := linq.From(operation.RequestBody.Value.Content).SelectT(func(kv linq.KeyValue) interface{} { return kv.Value }).First().(*openapi3.MediaType) result[name] = generator.componentFromSchema(name, obj.Schema) return linq.From(result) } linq.From(operation.RequestBody.Value.Content). ToMapByT(&result, func(kv linq.KeyValue) string { return name + generator.normalizer.contentType(cast.ToString(kv.Key)+"RequestBody") }, func(kv linq.KeyValue) jen.Code { meType := kv.Value.(*openapi3.MediaType) objName := name + generator.normalizer.contentType(cast.ToString(kv.Key)+"RequestBody") return generator.componentFromSchema(objName, meType.Schema) }) return linq.From(result) }, ). ToMapByT(&componentsByName, func(kv linq.KeyValue) interface{} { return kv.Key }, func(kv linq.KeyValue) interface{} { return kv.Value }) return linq.From(componentsByName) }). GroupByT( func(kv linq.KeyValue) interface{} { return kv.Key }, func(kv linq.KeyValue) interface{} { return kv.Value }, ). SelectT(func(kv linq.Group) jen.Code { var grouped []jen.Code linq.From(kv.Group).ToSlice(&grouped) return jen.Add(generator.normalizer.doubleLineAfterEachElement(grouped...)...) }). ToSlice(&componentsFromPathsResult) componentsResult = generator.normalizer.doubleLineAfterEachElement(componentsResult...) componentsFromPathsResult = generator.normalizer.doubleLineAfterEachElement(componentsFromPathsResult...) return jen.Null(). Add(componentsResult...). Add(jen.Line()). Add(componentsFromPathsResult...). Add(jen.Line()). Add(generator.enums(swagger)). Add(jen.Line()) } func (generator *Generator) variableForRegex(name string, schema *openapi3.SchemaRef) jen.Code { hasGoRegexExtension := len(schema.Value.Extensions) > 0 && schema.Value.Extensions[goRegex] != nil if !hasGoRegexExtension || schema.Value.Type != "string" { return jen.Null() } var regex string if err := json.Unmarshal(schema.Value.Extensions[goRegex].(json.RawMessage), &regex); err != nil { panic(err) } return jen.Var(). Id(name). Op("="). Qual("regexp", "MustCompile"). Call(jen.Lit(regex)). Line() } func (generator *Generator) additionalConstants(swagger *openapi3.Swagger) (jen.Code, []jen.Code) { var constantsComponentsCode []jen.Code linq.From(swagger.Components.Schemas).SelectManyT(func(kv linq.KeyValue) linq.Query { namePrefix := generator.normalizer.normalize(cast.ToString(kv.Key)) namePrefix = generator.normalizer.decapitalize(cast.ToString(kv.Key)) schema := kv.Value.(*openapi3.SchemaRef) return linq.From(schema.Value.Properties).SelectT(func(kv linq.KeyValue) jen.Code { name := namePrefix + generator.normalizer.normalize(strings.Title(cast.ToString(kv.Key))) + "Regex" return generator.variableForRegex(name, kv.Value.(*openapi3.SchemaRef)) }) }).ToSlice(&constantsComponentsCode) var componentsPathsCode []jen.Code linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) return linq.From(kv.Value.(*openapi3.PathItem).Operations()). WhereT(func(kv linq.KeyValue) bool { operation := kv.Value.(*openapi3.Operation) return operation.RequestBody != nil && len(operation.RequestBody.Value.Content) > 0 && linq.From(operation.RequestBody.Value.Content). AnyWithT(func(kv linq.KeyValue) bool { return kv.Value.(*openapi3.MediaType).Schema.Ref == "" }) }). SelectManyT(func(kv linq.KeyValue) linq.Query { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) name = generator.normalizer.decapitalize(name) operation := kv.Value.(*openapi3.Operation) return linq.From(operation.RequestBody.Value.Content). SelectManyT(func(kv linq.KeyValue) linq.Query { meType := kv.Value.(*openapi3.MediaType) namePrefix := name + generator.normalizer.contentType(cast.ToString(kv.Key)+"Regex") var parametersConstants []jen.Code linq.From(meType.Schema.Value.Properties).SelectT(func(kv linq.KeyValue) jen.Code { name := namePrefix + generator.normalizer.normalize(strings.Title(cast.ToString(kv.Key))) + "Regex" return generator.variableForRegex(name, kv.Value.(*openapi3.SchemaRef)) }).ToSlice(&parametersConstants) return linq.From(parametersConstants) }) }) }).ToSlice(&componentsPathsCode) componentsCode := jen.Null(). Add(constantsComponentsCode...). Line(). Add(componentsPathsCode...). Line() var parametersCode []jen.Code linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) return linq.From(kv.Value.(*openapi3.PathItem).Operations()). SelectManyT(func(kv linq.KeyValue) linq.Query { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) name = generator.normalizer.decapitalize(name) operation := kv.Value.(*openapi3.Operation) return linq.From(operation.Parameters).SelectT(func(parameter *openapi3.ParameterRef) jen.Code { name := name + strings.Title(parameter.Value.In) + generator.normalizer.normalize(strings.Title(parameter.Value.Name)) + "Regex" return generator.variableForRegex(name, parameter.Value.Schema) }) }) }).ToSlice(&parametersCode) return componentsCode, parametersCode } func (generator *Generator) requestParameterStruct(name string, contentType string, appendContentTypeToName bool, operation *openapi3.Operation) jen.Code { type parameter struct { In string Code jen.Code } var additionalParameters []parameter if contentType != "" { if appendContentTypeToName { name += generator.normalizer.contentType(contentType) } bodyTypeName := generator.normalizer.extractNameFromRef(operation.RequestBody.Value.Content[contentType].Schema.Ref) if bodyTypeName == "" { bodyTypeName = name + "RequestBody" } additionalParameters = append(additionalParameters, parameter{In: "Body", Code: jen.Id("Body").Qual(generator.config.ComponentsPackage, bodyTypeName)}) } var parameterStructs []jen.Code linq.From(operation.Parameters). GroupByT( func(parameter *openapi3.ParameterRef) string { return parameter.Value.In }, func(parameter *openapi3.ParameterRef) *openapi3.ParameterRef { return parameter }). SelectT( func(group linq.Group) jen.Code { var structFields []jen.Code linq.From(group.Group). OrderByT(func(parameter *openapi3.ParameterRef) string { return parameter.Value.Name }). SelectT(func(parameter *openapi3.ParameterRef) (result jen.Code) { name := generator.normalizer.normalize(parameter.Value.Name) var statement = jen.Id(name) if len(parameter.Value.Schema.Value.Enum) > 0 { if len(parameter.Value.Schema.Ref) > 0 { generator.typee.fillGoType(statement, "", generator.normalizer.extractNameFromRef(parameter.Value.Schema.Ref), parameter.Value.Schema, false, false) return statement } //todo: generate enum for anonymous type } generator.typee.fillGoType(statement, "", name, parameter.Value.Schema, false, false) return statement }). ToSlice(&structFields) var getters []jen.Code typeName := name + "Request" + strings.Title(cast.ToString(group.Key)) var fieldValidationRules []jen.Code linq.From(group.Group). OrderByT(func(parameter *openapi3.ParameterRef) string { return parameter.Value.Name }). SelectT(func(parameter *openapi3.ParameterRef) (result jen.Code) { name := generator.normalizer.normalize(parameter.Value.Name) var statement = jen.Func().Params(jen.Id(parameter.Value.In).Id(typeName)).Id("Get" + name).Params() fvRule := generator.fieldValidationRuleFromSchema(parameter.Value.In, name, parameter.Value.Schema, parameter.Value.Required) if fvRule != nil { fieldValidationRules = append(fieldValidationRules, jen.Line().Add(fvRule)) } if len(parameter.Value.Schema.Value.Enum) > 0 { if len(parameter.Value.Schema.Ref) > 0 { var returnType = jen.Null() generator.typee.fillGoType(returnType, "", generator.normalizer.extractNameFromRef(parameter.Value.Schema.Ref), parameter.Value.Schema, false, false) statement = statement.Params(returnType).Block(jen.Return().Id(parameter.Value.In).Dot(name)) return statement } //todo: generate enum for anonymous type } var returnType = jen.Null() generator.typee.fillGoType(returnType, "", name, parameter.Value.Schema, false, false) statement = statement.Params(returnType).Block(jen.Return().Id(parameter.Value.In).Dot(name)) return statement }). ToSlice(&getters) validateFunc := generator.validationFuncFromRules(cast.ToString(group.Key), typeName, fieldValidationRules) return jen.Type().Id(typeName).Struct(structFields...). Line().Line(). Add(generator.normalizer.doubleLineAfterEachElement(getters...)...). Add(validateFunc) }). ToSlice(&parameterStructs) var parameters []jen.Code linq.From(operation.Parameters). GroupByT( func(parameter *openapi3.ParameterRef) string { return parameter.Value.In }, func(parameter *openapi3.ParameterRef) *openapi3.ParameterRef { return parameter }). SelectT( func(group linq.Group) (parameter parameter) { var structFields []jen.Code linq.From(group.Group). OrderByT(func(parameter *openapi3.ParameterRef) string { return parameter.Value.Name }). SelectT(func(parameter *openapi3.ParameterRef) (result jen.Code) { name := generator.normalizer.normalize(parameter.Value.Name) var statement = jen.Id(name) if len(parameter.Value.Schema.Value.Enum) > 0 { if len(parameter.Value.Schema.Ref) > 0 { generator.typee.fillGoType(statement, "", generator.normalizer.extractNameFromRef(parameter.Value.Schema.Ref), parameter.Value.Schema, false, false) return statement } //todo: generate enum for anonymous type } generator.typee.fillGoType(statement, "", name, parameter.Value.Schema, false, false) return statement }). ToSlice(&structFields) parameter.In = cast.ToString(group.Key) parameter.Code = jen.Id(strings.Title(cast.ToString(group.Key))).Id(name + "Request" + strings.Title(cast.ToString(group.Key))) return }). Concat(linq.From(additionalParameters)). OrderByT(func(parameter parameter) string { return parameter.In }). SelectT(func(parameter parameter) jen.Code { return parameter.Code }). ToSlice(&parameters) parameters = append(parameters, jen.Id("ProcessingResult").Id("RequestProcessingResult")) hasSecuritySchemas := operation.Security != nil && len(*operation.Security) > 0 if hasSecuritySchemas { parameters = append(parameters, jen.Id("SecurityCheckResults").Map(jen.Id("SecurityScheme")).Id("string")) } return jen.Null(). Add(generator.normalizer.doubleLineAfterEachElement(parameterStructs...)...). Line().Line(). Add(jen.Type().Id(name + "Request").Struct(parameters...)). Line().Line() } func (generator *Generator) enumFromSchema(name string, schema *openapi3.SchemaRef) jen.Code { if len(schema.Ref) > 0 { return jen.Null() } var result []jen.Code var enumValues []jen.Code result = append(result, jen.Type().Id(generator.normalizer.normalize(name)).String()) linq.From(schema.Value.Enum).SelectT(func(value string) jen.Code { return jen.Var().Id(name + generator.normalizer.normalize(strings.Title(value))).Id(name).Op("=").Lit(value) }).ToSlice(&enumValues) var enumSwitchCases []jen.Code linq.From(schema.Value.Enum).SelectT(func(value string) jen.Code { return jen.Id(name + generator.normalizer.normalize(strings.Title(value))) }).ToSlice(&enumSwitchCases) result = append(result, enumValues...) result = append(result, jen.Func().Params( jen.Id("enum").Id(name)).Id("Check").Params().Params( jen.Id("error")).Block( jen.Switch(jen.Id("enum")).Block( jen.Case(enumSwitchCases...).Block( jen.Line().Return().Id("nil"))), jen.Line().Return().Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf("invalid %s enum value", name))), ).Add(jen.Line())) result = append(result, jen.Func().Params( jen.Id("enum").Op("*").Id(name)).Id("UnmarshalJSON").Params( jen.Id("data").Index().Id("byte")).Params( jen.Id("error")).Block( jen.Var().Id("strValue").Id("string"), jen.If(jen.Id("err").Op(":=").Qual("encoding/json", "Unmarshal").Call(jen.Id("data"), jen.Op("&").Id("strValue")), jen.Id("err").Op("!=").Id("nil")).Block( jen.Line().Return().Id("err")), jen.Id("enumValue").Op(":=").Id(name).Call(jen.Id("strValue")), jen.If(jen.Id("err").Op(":=").Id("enumValue").Dot("Check").Call(), jen.Id("err").Op("!=").Id("nil")).Block( jen.Line().Return().Id("err")), jen.Op("*").Id("enum").Op("=").Id("enumValue"), jen.Line().Return().Id("nil"), )) result = generator.normalizer.lineAfterEachElement(result...) return jen.Null().Add(result...).Add(jen.Line()) } func (generator *Generator) getXGoRegex(schema *openapi3.SchemaRef) string { if len(schema.Value.Extensions) > 0 && schema.Value.Extensions[goRegex] != nil { var regex string if err := json.Unmarshal(schema.Value.Extensions[goRegex].(json.RawMessage), &regex); err != nil { panic(err) } return regex } return "" } func (generator *Generator) validationFuncFromRules(receiverName string, name string, rules []jen.Code) jen.Code { block := jen.Return().Id("nil") if len(rules) > 0 { params := append([]jen.Code{jen.Op("&").Id(receiverName)}, rules...) block = jen.Return().Qual("github.com/go-ozzo/ozzo-validation/v4", "ValidateStruct").Call(params...) } return jen.Func().Params( jen.Id(receiverName).Id(name)).Id("Validate").Params().Params( jen.Id("error")).Block(block) } func (generator *Generator) fieldValidationRuleFromSchema(receiverName string, propertyName string, schema *openapi3.SchemaRef, required bool) jen.Code { var fieldRule jen.Code v := schema.Value switch v.Type { case "string": if v.MaxLength != nil || v.MinLength > 0 { var maxLength uint64 if v.MaxLength != nil { maxLength = *v.MaxLength } var params = []jen.Code{jen.Op("&").Id(receiverName).Dot(propertyName)} if v.MinLength > 0 && required { params = append(params, jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Required")) } else if v.MinLength > 0 { params = append(params, jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Skip").Dot("When").Call(jen.Id(receiverName).Dot(propertyName).Op("==").Lit(""))) } params = append(params, jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "RuneLength").Call(jen.Lit(int(v.MinLength)), jen.Lit(int(maxLength)))) fieldRule = jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Field").Call(params...) } case "integer", "number": var rules []jen.Code if v.Min != nil { min := jen.Lit(*v.Min) if v.Type == "integer" { min = jen.Lit(int(*v.Min)) } r := jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Min").Call(min) if v.ExclusiveMin { r.Dot("Exclusive").Call() } rules = append(rules, r) } if v.Max != nil { max := jen.Lit(*v.Max) if v.Type == "integer" { max = jen.Lit(int(*v.Max)) } r := jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Max").Call(max) if v.ExclusiveMax { r.Dot("Exclusive").Call() } rules = append(rules) } if len(rules) > 0 { params := append([]jen.Code{jen.Op("&").Id(receiverName).Dot(propertyName)}, rules...) fieldRule = jen.Qual("github.com/go-ozzo/ozzo-validation/v4", "Field").Call(params...) } } return fieldRule } func (generator *Generator) componentFromSchema(name string, parentSchema *openapi3.SchemaRef) jen.Code { name = generator.normalizer.normalize(name) typeDeclaration := jen.Type().Id(name) if len(parentSchema.Value.Properties) == 0 { if len(parentSchema.Value.Enum) > 0 { generator.typee.fillGoType(typeDeclaration, "", name+"Enum", parentSchema, false, false) return typeDeclaration } //validateFunc := generator.validationFuncFromRules("body", name, nil) generator.typee.fillGoType(typeDeclaration, "", name, parentSchema, false, true) //return typeDeclaration.Add(jen.Line(), validateFunc) return typeDeclaration } componentStruct := typeDeclaration.Struct(generator.typeProperties(name, parentSchema.Value, false)...) helperName := generator.normalizer.decapitalize(name) componentHelperStruct := jen.Type().Id(helperName).Struct(generator.typeProperties(helperName, parentSchema.Value, true)...) var fieldValidationRules []jen.Code var unmarshalNonRequiredAssignments []jen.Code linq.From(parentSchema.Value.Properties). WhereT(func(kv linq.KeyValue) bool { return !linq.From(parentSchema.Value.Required).Contains(kv.Key) }). SelectT(func(kv linq.KeyValue) jen.Code { property := cast.ToString(kv.Key) propertyName := strings.Title(generator.normalizer.normalize(property)) schema := kv.Value.(*openapi3.SchemaRef) var additionalValidationCode []jen.Code regex := generator.getXGoRegex(schema) if regex != "" { regexVarName := generator.normalizer.decapitalize(name) + strings.Title(property) + "Regex" additionalValidationCode = append(additionalValidationCode, jen.If(jen.Op("!").Id(regexVarName).Dot("MatchString").Call(jen.Id("body").Dot(propertyName))).Block( jen.Return().Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf(`%s not matched by the '%s' regex`, property, html.EscapeString(regex))))).Line()) } fvRule := generator.fieldValidationRuleFromSchema("body", propertyName, schema, false) if fvRule != nil { fieldValidationRules = append(fieldValidationRules, jen.Line().Add(fvRule)) } return jen.Null(). Add(additionalValidationCode...). Id("body").Dot(propertyName).Op("=").Id("value").Dot(propertyName).Line() }). ToSlice(&unmarshalNonRequiredAssignments) var unmarshalRequiredAssignments []jen.Code linq.From(parentSchema.Value.Properties). WhereT(func(kv linq.KeyValue) bool { return linq.From(parentSchema.Value.Required).Contains(cast.ToString(kv.Key)) }). SelectT(func(kv linq.KeyValue) jen.Code { property := cast.ToString(kv.Key) propertyName := strings.Title(generator.normalizer.normalize(property)) schema := kv.Value.(*openapi3.SchemaRef) var additionalValidationCode []jen.Code regex := generator.getXGoRegex(schema) if regex != "" { regexVarName := generator.normalizer.decapitalize(name) + strings.Title(property) + "Regex" additionalValidationCode = append(additionalValidationCode, jen.If(jen.Op("!").Id(regexVarName).Dot("MatchString").Call(jen.Op("*").Id("value").Dot(propertyName))).Block( jen.Return().Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf(`%s not matched by the '%s' regex`, property, html.EscapeString(regex))))).Line()) } fvRule := generator.fieldValidationRuleFromSchema("body", propertyName, schema, true) if fvRule != nil { fieldValidationRules = append(fieldValidationRules, jen.Line().Add(fvRule)) } code := jen.If(jen.Id("value").Dot(propertyName).Op("==").Id("nil")). Block(jen.Return().Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf("%s is required", property)))). Line().Line(). Add(additionalValidationCode...). Line().Line(). Id("body").Dot(propertyName).Op("=").Op("*").Id("value").Dot(propertyName). Line().Line() return code }).ToSlice(&unmarshalRequiredAssignments) unmarshalFunc := jen.Func().Params( jen.Id("body").Op("*").Id(name)).Id("UnmarshalJSON").Params( jen.Id("data").Index().Id("byte")).Params( jen.Id("error")).Block( jen.Var().Id("value").Id(helperName), jen.If(jen.Id("err").Op(":=").Qual("encoding/json", "Unmarshal").Call(jen.Id("data"), jen.Op("&").Id("value")), jen.Id("err").Op("!=").Id("nil")).Block( jen.Return().Id("err")).Line().Line(). Add(unmarshalNonRequiredAssignments...).Line().Line(). Add(unmarshalRequiredAssignments...).Line().Line(). Add(jen.Return().Id("nil"))).Line() validateFunc := generator.validationFuncFromRules("body", name, fieldValidationRules) return jen.Add(componentHelperStruct). Add(jen.Line().Line()). Add(componentStruct). Add(jen.Line().Line()). Add(unmarshalFunc). Add(validateFunc) } func (generator *Generator) typeProperties(typeName string, schema *openapi3.Schema, pointersForRequired bool) (parameters []jen.Code) { linq.From(schema.Properties). OrderByT(func(kv linq.KeyValue) interface{} { return kv.Key }). SelectT(func(kv linq.KeyValue) interface{} { originName := cast.ToString(kv.Key) name := generator.normalizer.normalize(originName) parameter := jen.Id(name) schemaRef := kv.Value.(*openapi3.SchemaRef) if len(schemaRef.Value.Enum) > 0 { if schemaRef.Ref != "" { name = generator.normalizer.extractNameFromRef(schemaRef.Ref) } else { name = strings.Title(typeName) + strings.Title(name) + "Enum" } } asPointer := pointersForRequired && linq.From(schema.Required).Contains(originName) generator.typee.fillGoType(parameter, typeName, name, schemaRef, asPointer, false) generator.typee.fillJsonTag(parameter, originName) return parameter }).ToSlice(&parameters) return } func (generator *Generator) enums(swagger *openapi3.Swagger) jen.Code { var pathsResult []jen.Code linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) return linq.From(kv.Value.(*openapi3.PathItem).Operations()). SelectManyT(func(kv linq.KeyValue) linq.Query { var requestBodyResults []jen.Code name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) operation := kv.Value.(*openapi3.Operation) if operation.RequestBody != nil { linq.From(operation.RequestBody.Value.Content). SelectT(func(kv linq.KeyValue) jen.Code { schema := kv.Value.(*openapi3.MediaType).Schema namePrefix := generator.normalizer.normalize(name + generator.normalizer.contentType(cast.ToString(kv.Key))) if len(schema.Value.Enum) > 0 { return generator.enumFromSchema(namePrefix+"RequestBodyEnum", schema) } var result []jen.Code linq.From(schema.Value.Properties).WhereT(func(kv linq.KeyValue) bool { return len(kv.Value.(*openapi3.SchemaRef).Value.Enum) > 0 }).SelectT(func(kv linq.KeyValue) interface{} { enumName := namePrefix + generator.normalizer.normalize(strings.Title(cast.ToString(kv.Key))) + "Enum" enumName = generator.normalizer.normalize(enumName) return generator.enumFromSchema(enumName, kv.Value.(*openapi3.SchemaRef)) }).ToSlice(&result) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(result...)...) }).ToSlice(&requestBodyResults) } var result []jen.Code linq.From(operation.Responses). SelectManyT(func(kv linq.KeyValue) linq.Query { return linq.From(kv.Value.(*openapi3.ResponseRef).Value.Content). WhereT(func(kv linq.KeyValue) bool { return kv.Value.(*openapi3.MediaType).Schema.Ref == "" }). SelectT(func(kv linq.KeyValue) jen.Code { schema := kv.Value.(*openapi3.MediaType).Schema namePrefix := generator.normalizer.normalize(name + generator.normalizer.contentType(cast.ToString(kv.Key))) if len(schema.Value.Enum) > 0 { return generator.enumFromSchema(namePrefix+"ResponseBodyEnum", schema) } var result []jen.Code linq.From(schema.Value.Properties).WhereT(func(kv linq.KeyValue) bool { return len(kv.Value.(*openapi3.SchemaRef).Value.Enum) > 0 }).SelectT(func(kv linq.KeyValue) interface{} { enumName := namePrefix + generator.normalizer.normalize(strings.Title(cast.ToString(kv.Key))) + "Enum" enumName = generator.normalizer.normalize(enumName) return generator.enumFromSchema(enumName, kv.Value.(*openapi3.SchemaRef)) }).ToSlice(&result) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(result...)...) }) }). Concat(linq.From(requestBodyResults)). ToSlice(&result) return linq.From(result) }) }).ToSlice(&pathsResult) var componentsResult []jen.Code linq.From(swagger.Components.Schemas). SelectT(func(kv linq.KeyValue) jen.Code { namePrefix := generator.normalizer.normalize(cast.ToString(kv.Key)) schema := kv.Value.(*openapi3.SchemaRef) if len(schema.Value.Enum) > 0 { return generator.enumFromSchema(namePrefix, schema) } var result []jen.Code linq.From(schema.Value.Properties).WhereT(func(kv linq.KeyValue) bool { return len(kv.Value.(*openapi3.SchemaRef).Value.Enum) > 0 }).SelectT(func(kv linq.KeyValue) interface{} { enumName := namePrefix + generator.normalizer.normalize(strings.Title(cast.ToString(kv.Key))) + "Enum" enumName = generator.normalizer.normalize(enumName) return generator.enumFromSchema(enumName, kv.Value.(*openapi3.SchemaRef)) }).ToSlice(&result) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(result...)...) }).ToSlice(&componentsResult) return jen.Null().Add(generator.normalizer.lineAfterEachElement(pathsResult...)...).Add(generator.normalizer.lineAfterEachElement(componentsResult...)...) } func (generator *Generator) hooksStruct() jen.Code { return jen.Type().Id("Hooks").Struct( jen.Id("RequestSecurityParseFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestSecurityParseCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestSecurityCheckFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestSecurityCheckCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string")), jen.Id("RequestBodyUnmarshalFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestHeaderParseFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestPathParseFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestQueryParseFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestBodyValidationFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestHeaderValidationFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestPathValidationFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestQueryValidationFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("RequestProcessingResult")), jen.Id("RequestBodyUnmarshalCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestHeaderParseCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestPathParseCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestQueryParseCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestParseCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestProcessingCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("RequestRedirectStarted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("string")), jen.Id("ResponseBodyMarshalCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), jen.Id("ResponseBodyWriteCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("int")), jen.Id("ResponseBodyMarshalFailed").Func().Params( jen.Qual("net/http", "ResponseWriter"), jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("error")), jen.Id("ResponseBodyWriteFailed").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string"), jen.Id("int"), jen.Id("error")), jen.Id("ServiceCompleted").Func().Params(jen.Op("*").Qual("net/http", "Request"), jen.Id("string")), ) } func (generator *Generator) requestProcessingResultType() jen.Code { return jen.Type().Id("requestProcessingResultType").Id("uint8"). Add(jen.Line(), jen.Line()). Add(jen.Const().Defs( jen.Id("BodyUnmarshalFailed").Id("requestProcessingResultType").Op("=").Id("iota").Op("+").Lit(1), jen.Id("BodyValidationFailed"), jen.Id("HeaderParseFailed"), jen.Id("HeaderValidationFailed"), jen.Id("QueryParseFailed"), jen.Id("QueryValidationFailed"), jen.Id("PathParseFailed"), jen.Id("PathValidationFailed"), jen.Id("SecurityParseFailed"), jen.Id("SecurityCheckFailed"), jen.Id("ParseSucceed"), )). Add(jen.Line(), jen.Line()). Add(jen.Type().Id("RequestProcessingResult").Struct( jen.Id("error").Id("error"), jen.Id("typee").Id("requestProcessingResultType"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Id("NewRequestProcessingResult").Params( jen.Id("t").Id("requestProcessingResultType"), jen.Id("err").Id("error")). Params(jen.Id("RequestProcessingResult")).Block( jen.Return().Id("RequestProcessingResult").Values(jen.Dict{ jen.Id("typee"): jen.Id("t"), jen.Id("error"): jen.Id("err"), }))). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("r").Id("RequestProcessingResult")).Id("Type").Params().Params( jen.Id("requestProcessingResultType")).Block( jen.Return().Id("r").Dot("typee"))). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("r").Id("RequestProcessingResult")).Id("Err").Params().Params( jen.Id("error")).Block( jen.Return().Id("r").Dot("error"), )) } func (generator *Generator) wrappers(swagger *openapi3.Swagger) jen.Code { var results []jen.Code linq.From(generator.groupedOperations(swagger)). SelectT(func(groupedOperations groupedOperations) jen.Code { tag := generator.normalizer.normalize(cast.ToString(groupedOperations.tag)) var routes []jen.Code linq.From(groupedOperations.operations). SelectT(func(operation operationWithPath) jen.Code { method := generator.normalizer.normalize(strings.Title(strings.ToLower(cast.ToString(operation.method)))) if operation.operation.RequestBody == nil || len(operation.operation.RequestBody.Value.Content) == 1 { name := generator.normalizer.normalizeOperationName(operation.path, cast.ToString(operation.method)) return jen.Id("router").Dot("router").Dot(method).Call(jen.Lit(operation.path), jen.Id("router").Dot(name)) } var result []jen.Code linq.From(operation.operation.RequestBody.Value.Content). SelectT(func(kv linq.KeyValue) jen.Code { name := generator.normalizer.normalizeOperationName(operation.path, cast.ToString(operation.method)) + generator.normalizer.contentType(cast.ToString(kv.Key)) return jen.Id("router").Dot("router").Dot(method).Call(jen.Lit(operation.path), jen.Id("router").Dot(name)) }).ToSlice(&result) return jen.Add(generator.normalizer.lineAfterEachElement(result...)...) }).ToSlice(&routes) var wrappers []jen.Code linq.From(groupedOperations.operations). SelectT(func(operation operationWithPath) jen.Code { method := generator.normalizer.normalize(strings.Title(strings.ToLower(cast.ToString(operation.method)))) routerName := strings.ToLower(tag) + "Router" if operation.operation.RequestBody == nil { name := generator.normalizer.normalizeOperationName(operation.path, cast.ToString(operation.method)) requestName := name + "Request" return generator.wrapper(name, requestName, routerName, method, operation.path, operation.operation, nil, "") } if len(operation.operation.RequestBody.Value.Content) == 1 { name := generator.normalizer.normalizeOperationName(operation.path, cast.ToString(operation.method)) requestName := name + "Request" requestBody := linq.From(operation.operation.RequestBody.Value.Content).SelectT(func(kv linq.KeyValue) interface{} { return kv.Value }).First().(*openapi3.MediaType).Schema contentType := linq.From(operation.operation.RequestBody.Value.Content).SelectT(func(kv linq.KeyValue) interface{} { return kv.Key }).First().(string) return generator.wrapper(name, requestName, routerName, method, operation.path, operation.operation, requestBody, contentType) } var result []jen.Code linq.From(operation.operation.RequestBody.Value.Content). SelectT(func(kv linq.KeyValue) interface{} { name := generator.normalizer.normalizeOperationName(operation.path, cast.ToString(operation.method)) + generator.normalizer.contentType(cast.ToString(kv.Key)) requestName := name + "Request" requestBody := operation.operation.RequestBody.Value.Content[cast.ToString(kv.Key)].Schema return generator.wrapper(name, requestName, routerName, method, operation.path, operation.operation, requestBody, cast.ToString(kv.Key)) }). ToSlice(&result) return jen.Add(generator.normalizer.lineAfterEachElement(result...)...) }).ToSlice(&wrappers) hasSecuritySchemas := linq.From(groupedOperations.operations). AnyWithT(func(operation operationWithPath) bool { return operation.operation.Security != nil && len(*operation.operation.Security) > 0 }) return jen.Null(). Add(generator.handler(strings.Title(tag)+"Handler", strings.Title(tag)+"Service", strings.ToLower(tag)+"Router", hasSecuritySchemas, groupedOperations.operations)). Add(jen.Line()). Add(generator.router(strings.ToLower(tag)+"Router", strings.Title(tag)+"Service", hasSecuritySchemas)). Add(jen.Line()). Add(jen.Func().Params(jen.Id("router").Op("*").Id(strings.ToLower(tag)+"Router")).Id("mount").Params().Block(routes...)). Add(jen.Line(), jen.Line()). Add(generator.normalizer.lineAfterEachElement(wrappers...)...). Add(jen.Line()) }).ToSlice(&results) return jen.Null(). Add(generator.hooksStruct()). Add(jen.Line(), jen.Line()). Add(generator.requestProcessingResultType()). Add(jen.Line(), jen.Line()). Add(generator.normalizer.lineAfterEachElement(results...)...). Add(jen.Line(), jen.Line()) } type groupedOperations struct { tag string operations []operationWithPath } type operationWithPath struct { method string operation *openapi3.Operation path string } func (generator *Generator) groupedOperations(swagger *openapi3.Swagger) []groupedOperations { var result []groupedOperations linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) return linq.From(kv.Value.(*openapi3.PathItem).Operations()). SelectT(func(kv linq.KeyValue) groupedOperations { operation := kv.Value.(*openapi3.Operation) tag := operation.Tags[0] return groupedOperations{ tag: tag, operations: []operationWithPath{{operation: operation, path: path, method: cast.ToString(kv.Key)}}, } }) }). GroupByT( func(wrapper groupedOperations) string { return wrapper.tag }, func(wrapper groupedOperations) groupedOperations { return wrapper }). SelectT(func(group linq.Group) groupedOperations { var operations []operationWithPath linq.From(group.Group). SelectT(func(wrapper groupedOperations) operationWithPath { return wrapper.operations[0] }).ToSlice(&operations) return groupedOperations{ tag: cast.ToString(group.Key), operations: operations, } }). ToSlice(&result) return result } func (generator *Generator) handler(name string, serviceName string, routerName string, hasSchemas bool, operations []operationWithPath) jen.Code { schemas := jen.Null() schemasInterfaceParameter := jen.Null() if hasSchemas { schemasInterfaceParameter = schemasInterfaceParameter.Id("securitySchemas").Id("SecuritySchemas") var declarations []jen.Code linq.From(operations). SelectManyT(func(operation operationWithPath) linq.Query { if operation.operation.Security == nil { return linq.From([]openapi3.SecurityRequirement{}) } return linq.From(*operation.operation.Security) }). SelectManyT(func(securityRequirement openapi3.SecurityRequirement) linq.Query { return linq.From(securityRequirement).SelectT(func(kv linq.KeyValue) interface{} { return kv.Key }) }). Distinct(). SelectT(func(name string) jen.Code { name = strings.Title(name) return jen.Line().Id("SecurityScheme"+name).Op(":").Values(jen.Line().Id("scheme").Op(":").Id("SecurityScheme"+name), jen.Line().Id("extract").Op(":").Id("securityExtractorsFuncs").Index(jen.Id("SecurityScheme"+name)), jen.Line().Id("handle").Op(":").Id("securitySchemas").Dot("SecurityScheme"+name), jen.Line(), ) }).ToSlice(&declarations) declarations = append(declarations, jen.Line()) schemas = schemas.Line().Id("router").Dot("securityHandlers").Op("=").Map(jen.Id("SecurityScheme")).Id("securityProcessor"). Values(declarations...) } code := jen.Func().Id(name). Params( jen.Id("impl").Id(serviceName), jen.Id("r").Qual("github.com/go-chi/chi", "Router"), jen.Id("hooks").Op("*").Id("Hooks"), schemasInterfaceParameter). Params(jen.Qual("net/http", "Handler")). Block( jen.Id("router").Op(":=").Op("&").Id(routerName).Values(jen.Id("router").Op(":").Id("r"), jen.Id("service").Op(":").Id("impl"), jen.Id("hooks").Op(":").Id("hooks")), schemas, jen.Line().Id("router").Dot("mount").Call(), jen.Line().Return().Id("router").Dot("router"), ) return code } func (generator *Generator) router(routerName string, serviceName string, hasSecuritySchemas bool) jen.Code { securityHandlers := jen.Null() if hasSecuritySchemas { securityHandlers = securityHandlers.Id("securityHandlers").Map(jen.Id("SecurityScheme")).Id("securityProcessor") } code := jen.Type().Id(routerName).Struct( jen.Id("router").Qual("github.com/go-chi/chi", "Router"), jen.Id("service").Id(serviceName), jen.Id("hooks").Op("*").Id("Hooks"), securityHandlers, ) return code } func (generator *Generator) wrapperRequestParsers(wrapperName string, operation *openapi3.Operation) (result []jen.Code) { linq.From(operation.Parameters). GroupByT( func(parameter *openapi3.ParameterRef) string { return parameter.Value.In }, func(parameter *openapi3.ParameterRef) *openapi3.ParameterRef { return parameter }, ). SelectManyT(func(group linq.Group) linq.Query { return linq.From(group.Group).SelectT(func(parameter *openapi3.ParameterRef) jen.Code { in := parameter.Value.In name := generator.normalizer.normalize(parameter.Value.Name) paramName := in + name if generator.typee.isCustomType(parameter.Value.Schema.Value) { return generator.wrapperCustomType(in, name, paramName, wrapperName, parameter) } if len(parameter.Value.Schema.Value.Enum) > 0 { //TODO: support anonymous enum types enumType := generator.normalizer.extractNameFromRef(parameter.Value.Schema.Ref) return generator.wrapperEnum(in, enumType, name, paramName, wrapperName, parameter) } if parameter.Value.Schema.Value.Type == "integer" { return generator.wrapperInteger(in, name, paramName, wrapperName, parameter) } return generator.wrapperStr(in, name, paramName, wrapperName, parameter) }).Concat(linq.From([]jen.Code{ jen.Line().Add(jen.If(jen.Id("err").Op(":=").Id("request").Dot(strings.Title(cast.ToString(group.Key))).Dot("Validate").Call(), jen.Id("err").Op("!=").Id("nil")). Block(jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(strings.Title(cast.ToString(group.Key))+"ValidationFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(cast.ToString(group.Key))+"ValidationFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(cast.ToString(group.Key))+"ValidationFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return())), jen.Line().Add(jen.Line()). Add(jen.If(jen.Id("router").Dot("hooks").Dot("Request" + strings.Title(cast.ToString(group.Key)) + "ParseCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(cast.ToString(group.Key))+"ParseCompleted").Call( jen.Id("r"), jen.Lit(wrapperName)))), })) }).ToSlice(&result) return generator.normalizer.lineAfterEachElement(result...) } func (generator *Generator) wrapRequired(name string, isRequired bool, code jen.Code) jen.Code { if !isRequired { return jen.If(jen.Id(name).Op("!=").Lit("")).Block(code).Line() } return code } func (generator *Generator) wrapperCustomType(in string, name string, paramName string, wrapperName string, parameter *openapi3.ParameterRef) jen.Code { result := jen.Null() switch in { case "header": result = result.Add(jen.Id(paramName + "Str").Op(":=").Id("r").Dot("Header").Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "query": result = result.Add(jen.Id(paramName + "Str").Op(":=").Id("r").Dot("URL").Dot("Query").Call().Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "path": result = result.Add(jen.Id(paramName+"Str").Op(":=").Id("chi").Dot("URLParam").Call(jen.Id("r"), jen.Lit(parameter.Value.Name))) default: panic("unsupported " + in + " type") } result = result.Add(jen.Line()) parseFailed := []jen.Code{ jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(strings.Title(in)+"ParseFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("Request" + strings.Title(in) + "ParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Lit(parameter.Value.Name), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return(), } if pkg, parse, ok := generator.typee.getXGoTypeStringParse(parameter.Value.Schema.Value); ok { parameterCode := jen.Null(). Add(jen.List(jen.Id(paramName), jen.Id("err")).Op(":=").Qual(pkg, parse).Call(jen.Id(paramName+"Str"))). Add(jen.Line()). Add(jen.If(jen.Id("err").Op("!=").Id("nil")).Block(parseFailed...)). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot(strings.Title(in)).Dot(name).Op("=").Id(paramName)) result.Add(generator.wrapRequired(paramName+"Str", parameter.Value.Required, parameterCode)) } else { switch parameter.Value.Schema.Value.Format { case "uuid": parameterCode := jen.Null(). Add(jen.List(jen.Id(paramName), jen.Id("err")).Op(":=").Id("uuid").Dot("Parse").Call(jen.Id(paramName+"Str"))). Add(jen.Line()). Add(jen.If(jen.Id("err").Op("!=").Id("nil")).Block(parseFailed...)). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot(strings.Title(in)).Dot(name).Op("=").Id(paramName)) result.Add(generator.wrapRequired(paramName+"Str", parameter.Value.Required, parameterCode)) break case "iso4217-currency-code": parameterCode := jen.Null(). Add(jen.List(jen.Id(paramName), jen.Id("err")).Op(":=").Qual("github.com/mikekonan/go-types/currency", "ByCodeStrErr").Call(jen.Id(paramName+"Str"))). Add(jen.Line()). Add(jen.If(jen.Id("err").Op("!=").Id("nil")).Block(parseFailed...)). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot(strings.Title(in)).Dot(name).Op("=").Id(paramName).Dot("Code").Call()) result.Add(generator.wrapRequired(paramName+"Str", parameter.Value.Required, parameterCode)) break case "iso3166-alpha-2": parameterCode := jen.Null(). Add(jen.List(jen.Id(paramName), jen.Id("err")).Op(":=").Qual("github.com/mikekonan/go-types/country", "ByAlpha2CodeStrErr").Call(jen.Id(paramName+"Str"))). Add(jen.Line()). Add(jen.If(jen.Id("err").Op("!=").Id("nil")).Block(parseFailed...)). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot(strings.Title(in)).Dot(name).Op("=").Id(paramName).Dot("Alpha2Code").Call()) result.Add(generator.wrapRequired(paramName+"Str", parameter.Value.Required, parameterCode)) break default: } } return result.Line() } func (generator *Generator) wrapperEnum(in string, enumType string, name string, paramName string, wrapperName string, parameter *openapi3.ParameterRef) jen.Code { result := jen.Null() switch in { case "header": result = result.Add(jen.Id(paramName).Op(":=").Qual(generator.config.ComponentsPackage, enumType).Call(jen.Id("r").Dot("Header").Dot("Get").Call(jen.Lit(parameter.Value.Name)))) case "query": result = result.Add(jen.Id(paramName).Op(":=").Qual(generator.config.ComponentsPackage, enumType).Call(jen.Id("r").Dot("URL").Dot("Query").Call().Dot("Get").Call(jen.Lit(parameter.Value.Name)))) case "path": result = result.Add(jen.Id(paramName).Op(":=").Qual(generator.config.ComponentsPackage, enumType).Call(jen.Id("chi").Dot("URLParam").Call(jen.Id("r"), jen.Lit(parameter.Value.Name)))) default: panic("unsupported " + in + " type") } result = result. Add(jen.Line()). Add(jen.If(jen.Id("err").Op(":=").Id(paramName).Dot("Check").Call(), jen.Id("err").Op("!=").Id("nil")).Block( jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(strings.Title(in)+"ParseFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Lit(parameter.Value.Name), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return())). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot(strings.Title(parameter.Value.In)).Dot(name).Op("=").Id(paramName)). Add(jen.Line()) return jen.Null().Add(generator.wrapRequired(paramName, parameter.Value.Required, result)).Line() } func (generator *Generator) wrapperStr(in string, name string, paramName string, wrapperName string, parameter *openapi3.ParameterRef) jen.Code { result := jen.Null() switch in { case "header": result = result.Add(jen.Id(paramName).Op(":=").Id("r").Dot("Header").Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "query": result = result.Add(jen.Id(paramName).Op(":=").Id("r").Dot("URL").Dot("Query").Call().Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "path": result = result.Add(jen.Id(paramName).Op(":=").Id("chi").Dot("URLParam").Call(jen.Id("r"), jen.Lit(parameter.Value.Name))) default: panic("unsupported " + in + " type") } if parameter.Value.Required { result = result. Add(jen.Line()). Add(jen.If(jen.Id(paramName).Op("==").Lit("")).Block( jen.Id("err").Op(":=").Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf("%s is empty", parameter.Value.Name))).Line(), jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(strings.Title(in)+"ParseFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Lit(parameter.Value.Name), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return())). Add(jen.Line()) } regex := generator.getXGoRegex(parameter.Value.Schema) if regex != "" { regexVarName := generator.normalizer.decapitalize(wrapperName) + strings.Title(in) + name + "Regex" result = result.Line().If(jen.Op("!").Id(regexVarName).Dot("MatchString").Call(jen.Id("request").Dot("Path").Dot(name))).Block( jen.Id("err").Op(":=").Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf("%s not matched by the '%s' regex", parameter.Value.Name, regex))), jen.Line(), jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(fmt.Sprintf("%sParseFailed", strings.Title(in)))), jen.If(jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Call(jen.Id("r"), jen.Lit(wrapperName), jen.Lit(parameter.Value.Name), jen.Id("request").Dot("ProcessingResult"))), jen.Line(), jen.Return()). Line() } result = result. Line(). Add(jen.Id("request").Dot(strings.Title(parameter.Value.In)).Dot(name).Op("=").Id(paramName)). Line() return result } func (generator *Generator) wrapperInteger(in string, name string, paramName string, wrapperName string, parameter *openapi3.ParameterRef) jen.Code { result := jen.Null() switch in { case "header": result = result.Add(jen.Id(paramName).Op(":=").Id("r").Dot("Header").Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "query": result = result.Add(jen.Id(paramName).Op(":=").Id("r").Dot("URL").Dot("Query").Call().Dot("Get").Call(jen.Lit(parameter.Value.Name))) case "path": result = result.Add(jen.Id(paramName).Op(":=").Id("chi").Dot("URLParam").Call(jen.Id("r"), jen.Lit(parameter.Value.Name))) default: panic("unsupported " + in + " type") } if parameter.Value.Required { result = result. Add(jen.Line()). Add(jen.If(jen.Id(paramName).Op("==").Lit("")).Block( jen.Id("err").Op(":=").Qual("fmt", "Errorf").Call(jen.Lit(fmt.Sprintf("%s is empty", parameter.Value.Name))).Line(), jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id(strings.Title(in)+"ParseFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("Request"+strings.Title(in)+"ParseFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Lit(parameter.Value.Name), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return())). Add(jen.Line()) } return result. Add(jen.Line()). Add(jen.Id("request").Dot(strings.Title(parameter.Value.In)).Dot(name).Op("=").Qual("github.com/spf13/cast", "ToInt").Call(jen.Id(paramName))). Add(jen.Line()) } func (generator *Generator) wrapperBody(method string, path string, contentType string, wrapperName string, operation *openapi3.Operation, body *openapi3.SchemaRef) jen.Code { result := jen.Null() if operation.RequestBody == nil { return result } name := generator.normalizer.extractNameFromRef(body.Ref) if name == "" { name = generator.normalizer.normalizeOperationName(path, method) + generator.normalizer.contentType(cast.ToString(contentType)) + "RequestBody" } result = result. Add(jen.Var().Defs( jen.Id("body").Qual(generator.config.ComponentsPackage, name), jen.Id("decodeErr").Error(), )). Add(jen.Line()). Add(func() *jen.Statement { switch contentType { case "application/xml": return jen.Id("decodeErr").Op("=").Qual("encoding/xml", "NewDecoder").Call(jen.Id("r").Dot("Body")).Dot("Decode").Call(jen.Op("&").Id("body")) case "application/octet-stream": return jen.Add(jen.Var().Defs( jen.Id("buf").Interface(), jen.Id("ok").Bool(), jen.Id("readErr").Error(), ), jen.Line(), jen.If( jen.List(jen.Id("buf"), jen.Id("readErr")).Op("=").Qual("io/ioutil", "ReadAll").Call(jen.Id("r").Dot("Body")), jen.Id("readErr").Op("==").Nil(), ).Block( jen.If( jen.List(jen.Id("body"), jen.Id("ok")).Op("=").Id("buf").Assert(jen.Qual(generator.config.ComponentsPackage, name)), jen.Op("!").Id("ok"), ).Block( jen.Id("decodeErr").Op("=").Qual("errors", "New").Call(jen.Lit("body is not []byte")), ), )) default: return jen.Id("decodeErr").Op("=").Qual("encoding/json", "NewDecoder").Call(jen.Id("r").Dot("Body")).Dot("Decode").Call(jen.Op("&").Id("body")) } }()). Add(jen.Line()). Add(jen.If(jen.Id("decodeErr").Op("!=").Id("nil")).Block( jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("decodeErr"), jen.Id("typee").Op(":").Id("BodyUnmarshalFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("RequestBodyUnmarshalFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestBodyUnmarshalFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Id("request").Dot("ProcessingResult")), jen.Line().Return()), jen.Line().Return())). Add(jen.Line(), jen.Line()). Add(jen.Id("request").Dot("Body").Op("=").Id("body")). Add(jen.Line(), jen.Line()) if contentType != "application/octet-stream" { result = result.Add(jen.If(jen.Id("err").Op(":=").Id("request").Dot("Body").Dot("Validate").Call(), jen.Id("err").Op("!=").Id("nil")). Block(jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id("BodyValidationFailed")), jen.If(jen.Id("router").Dot("hooks").Dot("RequestBodyValidationFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestBodyValidationFailed").Call( jen.Id("r"), jen.Lit(wrapperName), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return())) } return result.Add(jen.Line(), jen.Line()). Add(jen.If(jen.Id("router").Dot("hooks").Dot("RequestBodyUnmarshalCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestBodyUnmarshalCompleted").Call( jen.Id("r"), jen.Lit(wrapperName)))). Add(jen.Line()) } func (generator *Generator) wrapperSecurity(name string, operation *openapi3.Operation) jen.Code { code := jen.Null() hasSecuritySchemas := operation.Security != nil && len(*operation.Security) > 0 if !hasSecuritySchemas { return code } var schemasCode []jen.Code linq.From(*operation.Security). SelectT(func(securityRequirement openapi3.SecurityRequirement) jen.Code { var handlers []jen.Code linq.From(securityRequirement).SelectT(func(kv linq.KeyValue) jen.Code { return jen.Id("router").Dot("securityHandlers").Index(jen.Id("SecurityScheme" + strings.Title(cast.ToString(kv.Key)))) }).ToSlice(&handlers) return jen.Values(handlers...) }). ToSlice(&schemasCode) code = code.Line().Id("isSecurityCheckPassed").Op(":=").Id("false").Line(). For(jen.List(jen.Id("_"), jen.Id("processors")).Op(":=").Range().Index().Index().Id("securityProcessor").Values(schemasCode...)).Block( jen.Id("isLinkedChecksValid").Op(":=").Id("true"), jen.Line().For(jen.List(jen.Id("_"), jen.Id("processor")).Op(":=").Range().Id("processors")).Block( jen.List(jen.Id("name"), jen.Id("value"), jen.Id("isExtracted")).Op(":=").Id("processor").Dot("extract").Call(jen.Id("r")), jen.Line().If(jen.Op("!").Id("isExtracted")).Block( jen.Id("isLinkedChecksValid").Op("=").Id("false"), jen.Break()), jen.Line().If(jen.Id("err").Op(":=").Id("processor").Dot("handle").Call(jen.Id("r"), jen.Id("processor").Dot("scheme"), jen.Id("name"), jen.Id("value")), jen.Id("err").Op("!=").Id("nil")).Block( jen.If(jen.Id("router").Dot("hooks").Dot("RequestSecurityCheckFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestSecurityCheckFailed").Call(jen.Id("r"), jen.Lit(name), jen.Id("string").Call(jen.Id("processor").Dot("scheme")), jen.Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id("SecurityCheckFailed")))), jen.Line().Id("isLinkedChecksValid").Op("=").Id("false"), jen.Line().Break()), jen.Line().If(jen.Id("router").Dot("hooks").Dot("RequestSecurityCheckCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestSecurityCheckCompleted").Call(jen.Id("r"), jen.Lit(name), jen.Id("string").Call(jen.Id("processor").Dot("scheme")))), jen.Line().If(jen.Id("len").Call(jen.Id("request").Dot("SecurityCheckResults")).Op("==").Lit(0)).Block( jen.Id("request").Dot("SecurityCheckResults").Op("=").Map(jen.Id("SecurityScheme")).Id("string").Values()), jen.Line().Id("request").Dot("SecurityCheckResults").Index(jen.Id("processor").Dot("scheme")).Op("=").Id("value")), jen.Line().If(jen.Id("isLinkedChecksValid")).Block( jen.Id("isSecurityCheckPassed").Op("=").Id("true"), jen.Break())). Line().Line().If(jen.Op("!").Id("isSecurityCheckPassed")).Block( jen.Id("err").Op(":=").Qual("fmt", "Errorf").Call(jen.Lit("failed passing security checks")), jen.Line().Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("error").Op(":").Id("err"), jen.Id("typee").Op(":").Id("SecurityParseFailed")), jen.Line().If(jen.Id("router").Dot("hooks").Dot("RequestSecurityParseFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestSecurityParseFailed").Call(jen.Id("r"), jen.Lit(name), jen.Id("request").Dot("ProcessingResult"))), jen.Line().Return()).Line() code = code.Line().If(jen.Id("router").Dot("hooks").Dot("RequestSecurityParseCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestSecurityParseCompleted").Call(jen.Id("r"), jen.Lit(name))) return code.Line() } func (generator *Generator) wrapperRequestParser(name string, requestName string, routerName, method string, path string, operation *openapi3.Operation, requestBody *openapi3.SchemaRef, contentType string) jen.Code { funcCode := []jen.Code{ jen.Id("request").Dot("ProcessingResult").Op("=").Id("RequestProcessingResult").Values(jen.Id("typee").Op(":").Id("ParseSucceed")).Line(), } funcCode = append(funcCode, generator.wrapperSecurity(name, operation)) funcCode = append(funcCode, generator.wrapperRequestParsers(name, operation)...) funcCode = append(funcCode, generator.wrapperBody(method, path, contentType, name, operation, requestBody)) //TODO: support different content-types funcCode = append(funcCode, jen.Line().If(jen.Id("router").Dot("hooks").Dot("RequestParseCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestParseCompleted").Call( jen.Id("r"), jen.Lit(name)))) funcCode = append(funcCode, jen.Line().Return()) return jen.Func().Params( jen.Id("router").Op("*").Id(routerName)).Id("parse" + name + "Request"). Params(jen.Id("r").Op("*").Qual("net/http", "Request")). Params(jen.Id("request").Id(requestName)). Block(funcCode...). Line() } func (generator *Generator) wrapper(name string, requestName string, routerName, method string, path string, operation *openapi3.Operation, requestBody *openapi3.SchemaRef, contentType string) jen.Code { var funcCode []jen.Code funcCode = append(funcCode, jen.Defer().Id("r").Dot("Body").Dot("Close").Call().Line()) funcCode = append(funcCode, jen.Id("response").Op(":=").Id("router").Dot("service").Dot(name).Call(jen.Id("r").Dot("Context").Call(), jen.Id("router").Dot("parse"+name+"Request").Call(jen.Id("r"))), jen.Line().Line(), jen.If(jen.Id("response").Dot("statusCode").Call().Op("==").Lit(302).Op("&&").Id("response").Dot("redirectURL").Call().Op("!=").Lit("")).Block( jen.If(jen.Id("router").Dot("hooks").Dot("RequestRedirectStarted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestRedirectStarted").Call(jen.Id("r"), jen.Lit(name), jen.Id("response").Dot("redirectURL").Call())), jen.Line().Line(), jen.Qual("net/http", "Redirect").Call(jen.Id("w"), jen.Id("r"), jen.Id("response").Dot("redirectURL").Call(), jen.Lit(302)), jen.Line().Line(), jen.If(jen.Id("router").Dot("hooks").Dot("ServiceCompleted").Op("!=").Id("nil")). Block(jen.Id("router").Dot("hooks").Dot("ServiceCompleted").Call(jen.Id("r"), jen.Lit(name))), jen.Line().Line(), jen.Return(), ), jen.Line().Line(), jen.For(jen.List(jen.Id("header"), jen.Id("value")).Op(":=").Range().Id("response").Dot("headers").Call()).Block( jen.Id("w").Dot("Header").Call().Dot("Set").Call(jen.Id("header"), jen.Id("value"))), jen.Line().Line(), jen.For(jen.List(jen.Id("_"), jen.Id("c")).Op(":=").Range().Id("response").Dot("cookies").Call()).Block( jen.Id("cookie").Op(":=").Id("c"), jen.Qual("net/http", "SetCookie").Call(jen.Id("w"), jen.Op("&").Id("cookie")))) funcCode = append(funcCode, jen.Line().Add(jen.Line()). Add(jen.If(jen.Id("router").Dot("hooks").Dot("RequestProcessingCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("RequestProcessingCompleted").Call( jen.Id("r"), jen.Lit(name)))).Line().Line()) if len(operation.Responses) > 0 && linq.From(operation.Responses).AnyWithT(func(kv linq.KeyValue) bool { return len(kv.Value.(*openapi3.ResponseRef).Value.Content) > 0 }) { funcCode = append(funcCode, jen.If(jen.Id("len").Call(jen.Id("response").Dot("contentType").Call()).Op(">").Lit(0)).Block( jen.Id("w").Dot("Header").Call().Dot("Set").Call(jen.Lit("content-type"), jen.Id("response").Dot("contentType").Call())).Line()) funcCode = append(funcCode, jen.Id("w").Dot("WriteHeader").Call(jen.Id("response").Dot("statusCode").Call()).Line().Line()) funcCode = append(funcCode, jen.If(jen.Id("response").Dot("body").Call().Op("!=").Id("nil")).Block( jen.Var().Defs( jen.Id("data").Index().Byte(), jen.Id("err").Error(), ).Line(), jen.Switch(jen.Id("response").Dot("contentType").Call()).Block( jen.Case(jen.Lit("application/xml")).Block( jen.List(jen.Id("data"), jen.Id("err")).Op("="). Qual("encoding/xml", "Marshal").Call(jen.Id("response").Dot("body").Call()), ), jen.Case(jen.Lit("application/octet-stream")).Block( jen.Var().Id("ok").Bool(), jen.If( jen.List(jen.Id("data"), jen.Id("ok")).Op("=").Parens(jen.Id("response").Dot("body").Call()).Assert(jen.Index().Byte()), jen.Op("!").Id("ok"), ).Block( jen.Id("err").Op("=").Qual("errors", "New").Call(jen.Lit("body is not []byte")), ), ), jen.Case(jen.Lit("text/html")).Block( jen.Id("data").Op("="). Index().Byte().Parens(jen.Qual("fmt", "Sprint").Call(jen.Id("response").Dot("body").Call())), ), jen.Case(jen.Lit("application/json")).Block( jen.Fallthrough(), ), jen.Default().Block( jen.List(jen.Id("data"), jen.Id("err")).Op("="). Qual("encoding/json", "Marshal").Call(jen.Id("response").Dot("body").Call()), ), ).Line(), jen.If(jen.Id("err").Op("!=").Id("nil")).Block( jen.If(jen.Id("router").Dot("hooks").Dot("ResponseBodyMarshalFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("ResponseBodyMarshalFailed").Call( jen.Id("w"), jen.Id("r"), jen.Lit(name), jen.Id("err"))), jen.Line().Return()).Line().Line(), jen.If(jen.Id("router").Dot("hooks").Dot("ResponseBodyMarshalCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("ResponseBodyMarshalCompleted").Call( jen.Id("r"), jen.Lit(name))).Line().Line(), jen.List(jen.Id("count"), jen.Id("err")).Op(":=").Id("w").Dot("Write").Call(jen.Id("data")), jen.If(jen.Id("err").Op("!=").Id("nil")).Block( jen.If(jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteFailed").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteFailed").Call(jen.Id("r"), jen.Lit(name), jen.Id("count"), jen.Id("err"))), jen.Line(), jen.If(jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteCompleted").Call( jen.Id("r"), jen.Lit(name), jen.Id("count"))), jen.Line().Return()).Line().Line(), jen.If(jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteCompleted").Op("!=").Id("nil")).Block( jen.Id("router").Dot("hooks").Dot("ResponseBodyWriteCompleted").Call( jen.Id("r"), jen.Lit(name), jen.Id("count")))).Line().Line(), ) } else { funcCode = append(funcCode, jen.Id("w").Dot("WriteHeader").Call(jen.Id("response").Dot("statusCode").Call()).Line().Line()) } funcCode = append(funcCode, jen.If(jen.Id("router").Dot("hooks").Dot("ServiceCompleted").Op("!=").Id("nil")). Block(jen.Id("router").Dot("hooks").Dot("ServiceCompleted").Call(jen.Id("r"), jen.Lit(name)))) return jen.Null(). Add(generator.wrapperRequestParser(name, requestName, routerName, method, path, operation, requestBody, contentType)). Add(jen.Line()). Add(jen.Func().Params( jen.Id("router").Op("*").Id(routerName)).Id(name).Params( jen.Id("w").Qual("net/http", "ResponseWriter"),
jen.Id("r").Op("*").Qual("net/http", "Request")). Block(funcCode...)).Line().Line() } func (generator *Generator) requestResponseBuilders(swagger *openapi3.Swagger) jen.Code { result := []jen.Code{ generator.responseStruct(), generator.handlersTypes(swagger), generator.builders(swagger), generator.handlersInterfaces(swagger), generator.requestParameters(swagger.Paths), } result = generator.normalizer.doubleLineAfterEachElement(result...) return jen.Null().Add(result...) } type operationResponse struct { ContentTypeBodyNameMap map[string]string Headers map[string]*openapi3.HeaderRef SetCookie bool StatusCode string } type operationStruct struct { Tag string Name string RequestName string ResponseName string Responses []operationResponse InterfaceResponseName string PrivateName string } func (generator *Generator) builders(swagger *openapi3.Swagger) (result jen.Code) { var builders []jen.Code linq.From(swagger.Paths). SelectManyT(func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) var operationStructs []operationStruct linq.From(kv.Value.(*openapi3.PathItem).Operations()). SelectT(func(kv linq.KeyValue) operationStruct { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) operation := kv.Value.(*openapi3.Operation) var operationResponses []operationResponse linq.From(operation.Responses). SelectT(func(kv linq.KeyValue) (response operationResponse) { response.ContentTypeBodyNameMap = map[string]string{} headers := map[string]*openapi3.HeaderRef{} for k, v := range kv.Value.(*openapi3.ResponseRef).Value.Headers { if strings.ToLower(k) == "set-cookie" { response.SetCookie = true continue } headers[k] = v } response.Headers = headers linq.From(kv.Value.(*openapi3.ResponseRef).Value.Content). ToMapByT(&response.ContentTypeBodyNameMap, func(kv linq.KeyValue) string { return cast.ToString(kv.Key) }, func(kv linq.KeyValue) (structName string) { if "" == kv.Value.(*openapi3.MediaType).Schema.Ref { structName = name structName += strings.Title(generator.normalizer.normalize(cast.ToString(kv.Key))) return structName } structName = generator.normalizer.extractNameFromRef(kv.Value.(*openapi3.MediaType).Schema.Ref) return }) response.StatusCode = cast.ToString(kv.Key) return }).ToSlice(&operationResponses) return operationStruct{ Tag: operation.Tags[0], Name: name, PrivateName: generator.normalizer.decapitalize(name), RequestName: name + "Request", InterfaceResponseName: name + "Response", ResponseName: generator.normalizer.decapitalize(name + "Response"), Responses: operationResponses, } }).ToSlice(&operationStructs) return linq.From(operationStructs) }). SelectT(func(operationStruct operationStruct) jen.Code { return generator.responseBuilders(operationStruct) }). ToSlice(&builders) return jen.Null().Add(builders...) } func (generator *Generator) handlersTypes(swagger *openapi3.Swagger) jen.Code { var result []jen.Code linq.From(swagger.Paths). SelectT(func(kv linq.KeyValue) jen.Code { path := cast.ToString(kv.Key) var result []jen.Code linq.From(kv.Value.(*openapi3.PathItem).Operations()). SelectT(func(kv linq.KeyValue) jen.Code { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(generator.responseType(name))...) }).ToSlice(&result) result = generator.normalizer.doubleLineAfterEachElement(result...) return jen.Null().Add(result...) }).ToSlice(&result) result = generator.normalizer.doubleLineAfterEachElement(result...) return jen.Null().Add(result...) } func (generator *Generator) handlersInterfaces(swagger *openapi3.Swagger) jen.Code { var result []jen.Code linq.From(swagger.Paths). SelectManyT( func(kv linq.KeyValue) linq.Query { path := cast.ToString(kv.Key) taggedInterfaceMethods := map[string][]jen.Code{} linq.From(kv.Value.(*openapi3.PathItem).Operations()). GroupByT(func(kv linq.KeyValue) string { return generator.normalizer.normalize(kv.Value.(*openapi3.Operation).Tags[0]) }, func(kv linq.KeyValue) []jen.Code { name := generator.normalizer.normalizeOperationName(path, cast.ToString(kv.Key)) operation := kv.Value.(*openapi3.Operation) if operation.RequestBody == nil { return []jen.Code{jen.Id(name).Params(jen.Qual("context", "Context"), jen.Id(name+"Request")).Params(jen.Id(name + "Response"))} } //if we have only one content type we dont need to have it inside function name if len(operation.RequestBody.Value.Content) == 1 { return []jen.Code{jen.Id(name).Params(jen.Qual("context", "Context"), jen.Id(name+"Request")).Params(jen.Id(name + "Response"))} } var contentTypedInterfaceMethods []jen.Code linq.From(operation.RequestBody.Value.Content). SelectT(func(kv linq.KeyValue) jen.Code { contentTypedName := name + generator.normalizer.contentType(cast.ToString(kv.Key)) return jen.Id(contentTypedName).Params(jen.Qual("context", "Context"), jen.Id(contentTypedName+"Request")).Params(jen.Id(name + "Response")) }).ToSlice(&contentTypedInterfaceMethods) return contentTypedInterfaceMethods }). ToMapByT(&taggedInterfaceMethods, func(kv linq.Group) interface{} { return kv.Key }, func(kv linq.Group) (grouped []jen.Code) { linq.From(kv.Group).SelectMany(func(i interface{}) linq.Query { return linq.From(i) }).ToSlice(&grouped) return }, ) return linq.From(taggedInterfaceMethods) }). GroupByT( func(kv linq.KeyValue) interface{} { return kv.Key }, func(kv linq.KeyValue) interface{} { return kv.Value }, ). SelectT(func(kv linq.Group) jen.Code { var grouped []jen.Code linq.From(kv.Group).SelectMany(func(i interface{}) linq.Query { return linq.From(i) }).ToSlice(&grouped) return jen.Type().Id(strings.Title(cast.ToString(kv.Key)) + "Service").Interface(grouped...) }). ToSlice(&result) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(result...)...) } func (generator *Generator) responseStruct() jen.Code { return jen.Type().Id("response").Struct( jen.Id("statusCode").Id("int"), jen.Id("body").Interface(), jen.Id("contentType").Id("string"), jen.Id("redirectURL").Id("string"), jen.Id("headers").Map(jen.Id("string")).Id("string"), jen.Id("cookies").Index().Qual("net/http", "Cookie"), ).Add(jen.Line().Line()). Add(jen.Type().Id("responseInterface").Interface( jen.Id("statusCode").Params().Id("int"), jen.Id("body").Params().Interface(), jen.Id("contentType").Params().Id("string"), jen.Id("redirectURL").Params().Id("string"), jen.Id("cookies").Params().Index().Qual("net/http", "Cookie"), jen.Id("headers").Params().Map(jen.Id("string")).Id("string"))) } func (generator *Generator) responseInterface(name string) jen.Code { name = generator.normalizer.decapitalize(name) return jen.Type().Id(name + "Response").Interface(jen.Id(name + "Response").Params()) } func (generator *Generator) responseType(name string) jen.Code { decapicalizedName := generator.normalizer.decapitalize(name) capitalizedName := strings.Title(name) interfaceDeclaration := jen.Type().Id(capitalizedName+"Response").Interface( jen.Id("responseInterface"), jen.Id(decapicalizedName+"Response").Params(), ) declaration := jen.Type().Id(decapicalizedName + "Response").Struct(jen.Id("response")) interfaceImplementation := jen.Func().Params(jen.Id(decapicalizedName+"Response")).Id(decapicalizedName+"Response").Params().Block(). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName+"Response")).Id("statusCode").Params().Params( jen.Id("int")).Block( jen.Return().Id("response").Dot("response").Dot("statusCode"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName+"Response")).Id("body").Params().Params(jen.Interface()).Block( jen.Return().Id("response").Dot("response").Dot("body"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName+"Response")).Id("contentType").Params().Params( jen.Id("string")).Block( jen.Return().Id("response").Dot("response").Dot("contentType"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName+"Response")).Id("redirectURL").Params().Params( jen.Id("string")).Block( jen.Return().Id("response").Dot("response").Dot("redirectURL"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName+"Response")).Id("headers").Params().Params( jen.Map(jen.Id("string")).Id("string")).Block( jen.Return().Id("response").Dot("response").Dot("headers"), )). Add(jen.Line(), jen.Line()). Add(jen.Func().Params( jen.Id("response").Id(decapicalizedName + "Response")).Id("cookies").Params().Params( jen.Index().Qual("net/http", "Cookie")).Block( jen.Return().Id("response").Dot("response").Dot("cookies"), )) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(interfaceDeclaration, declaration, interfaceImplementation)...) } func (generator *Generator) responseImplementationFunc(name string) jen.Code { return jen.Func().Params(jen.Id(strings.Title(name) + "Response")).Id(generator.normalizer.decapitalize(name) + "Response").Params().Block() } //if hasHeaders && hasContentTypes //N statusCode -> headersStruct -> M contentType -> body -> assemble //if hasHeaders && !hasContentTypes //N statusCode -> headersStruct -> assemble //if !hasHeaders && hasContentTypes //N statusCode -> M contentType -> body -> assemble //if !hasHeaders && !hasContentTypes //N statusCode -> assemble func (generator *Generator) responseBuilders(operationStruct operationStruct) jen.Code { builderConstructorName := generator.builderConstructorName(operationStruct.Name) statusCodesBuilderName := generator.statusCodesBuilderName(operationStruct.PrivateName) structBuilder := jen.Type().Id(statusCodesBuilderName).Struct(jen.Id("response")) structConstructor := jen.Func().Id(builderConstructorName).Params().Params( jen.Op("*").Id(statusCodesBuilderName)).Block( jen.Return().Id("new").Call(jen.Id(statusCodesBuilderName)), ) var results []jen.Code linq.From(operationStruct.Responses). SelectT(func(resp operationResponse) (results []jen.Code) { hasHeaders := len(resp.Headers) > 0 hasContentTypes := len(resp.ContentTypeBodyNameMap) > 0 isRedirect := resp.StatusCode == "302" && !hasHeaders && !hasContentTypes //prepend generated code in following order: assemble -> (optional: content type) -> (optional: headers) -> status codes var nextBuilderName string if hasContentTypes { contentTypeBuilderName := generator.contentTypeBuilderName(operationStruct.PrivateName + resp.StatusCode) //content-type struct results = append(results, jen.Type().Id(contentTypeBuilderName).Struct(jen.Id("response"))) var contentTypeBodyBuild []jen.Code //content-types -> body -> build linq.From(resp.ContentTypeBodyNameMap). SelectT(func(kv linq.KeyValue) jen.Code { var result []jen.Code contentTypeName := cast.ToString(kv.Key) contentType := cast.ToString(kv.Value) bodyBuilderName := generator.bodyGeneratorName(operationStruct.PrivateName+resp.StatusCode, contentTypeName) assemblerName := generator.assemblerName(operationStruct.Name + resp.StatusCode + generator.normalizer.contentType(contentTypeName)) result = append(result, generator.responseContentTypeBuilder(contentTypeName, contentType, contentTypeBuilderName, bodyBuilderName, assemblerName)...) //assembler struct, build results = append(results, generator.responseAssembler(assemblerName, operationStruct.InterfaceResponseName, operationStruct.ResponseName)...) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(result...)...) }).ToSlice(&contentTypeBodyBuild) results = generator.normalizer.doubleLineAfterEachElement(append(results, contentTypeBodyBuild...)...) nextBuilderName = contentTypeBuilderName } else { //assembler struct, build assemblerName := generator.assemblerName(operationStruct.Name + resp.StatusCode) results = append(results, generator.responseAssembler(assemblerName, operationStruct.InterfaceResponseName, operationStruct.ResponseName)...) nextBuilderName = assemblerName } if resp.SetCookie { cookiesBuilderName := generator.cookiesBuilderName(operationStruct.PrivateName + resp.StatusCode) results = append(generator.responseCookiesBuilder(cookiesBuilderName, nextBuilderName), results...) nextBuilderName = cookiesBuilderName } if hasHeaders { headersStructName := generator.headersStructName(operationStruct.Name + resp.StatusCode) headersBuilderName := generator.headersBuilderName(operationStruct.PrivateName + resp.StatusCode) results = append(generator.responseHeadersBuilder(resp.Headers, headersStructName, headersBuilderName, nextBuilderName), results...) nextBuilderName = headersBuilderName } results = append(generator.responseStatusCodeBuilder(isRedirect, resp.StatusCode, statusCodesBuilderName, nextBuilderName), results...) return }). SelectManyT(func(builders []jen.Code) linq.Query { return linq.From(builders) }). ToSlice(&results) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(append([]jen.Code{structBuilder, structConstructor}, results...)...)...) } func (generator *Generator) responseStatusCodeBuilder(isRedirect bool, statusCode string, builderName string, nextBuilderName string) (results []jen.Code) { if isRedirect { results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(builderName)).Id("StatusCode"+statusCode).Params(jen.Id("redirectURL").String()).Params( jen.Op("*").Id(nextBuilderName)).Block( jen.Id("builder").Dot("response").Dot("statusCode").Op("=").Lit(cast.ToInt(statusCode)), jen.Id("builder").Dot("response").Dot("redirectURL").Op("=").Id("redirectURL"), jen.Line().Return().Op("&").Id(nextBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")), )) } else { results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(builderName)).Id("StatusCode"+statusCode).Params().Params( jen.Op("*").Id(nextBuilderName)).Block( jen.Id("builder").Dot("response").Dot("statusCode").Op("=").Lit(cast.ToInt(statusCode)), jen.Line().Return().Op("&").Id(nextBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")), )) } return } func (generator *Generator) responseHeadersBuilder(headers map[string]*openapi3.HeaderRef, headersStructName string, headersBuilderName string, nextBuilderName string) (results []jen.Code) { //headers struct results = append(results, generator.headersStruct(headersStructName, headers)) //headers builder struct results = append(results, jen.Type().Id(headersBuilderName).Struct(jen.Id("response"))) //headers builder.Headers(...) results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(headersBuilderName)).Id("Headers").Params( jen.Id("headers").Id(headersStructName)).Params( jen.Op("*").Id(nextBuilderName)).Block( jen.Id("builder").Dot("headers").Op("=").Id("headers").Dot("toMap").Call(), jen.Line().Return().Op("&").Id(nextBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")), )) return } func (generator *Generator) responseCookiesBuilder(cookieBuilderName string, nextBuilderName string) (results []jen.Code) { //headers builder struct results = append(results, jen.Type().Id(cookieBuilderName).Struct(jen.Id("response"))) //headers builder.SetCookie(...) results = append(results, jen.Func().Params(jen.Id("builder").Op("*").Id(cookieBuilderName)). Id("SetCookie").Params( jen.Id("cookie").Op("...").Qual("net/http", "Cookie")). Params(jen.Op("*").Id(nextBuilderName)).Block( jen.Id("builder").Dot("cookies").Op("=").Id("cookie"), jen.Return().Op("&").Id(nextBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")))) return } func (generator *Generator) responseContentTypeBuilder(contentTypeName string, contentType string, contentTypeBuilderName string, bodyBuilderName string, nextBuilderName string) (results []jen.Code) { //content-type -> body contentTypeFuncName := generator.contentTypeFuncName(contentTypeName) results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(contentTypeBuilderName)).Id(contentTypeFuncName).Params().Params( jen.Op("*").Id(bodyBuilderName)).Block( jen.Id("builder").Dot("response").Dot("contentType").Op("=").Lit(contentTypeName), jen.Line().Return().Op("&").Id(bodyBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")), )) //body struct results = append(results, jen.Type().Id(bodyBuilderName).Struct(jen.Id("response"))) //body builder results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(bodyBuilderName)).Id("Body").Params( jen.Id("body").Qual(generator.config.ComponentsPackage, contentType)).Params( jen.Op("*").Id(nextBuilderName)).Block( jen.Id("builder").Dot("response").Dot("body").Op("=").Id("body"), jen.Line().Return().Op("&").Id(nextBuilderName).Values(jen.Id("response").Op(":").Id("builder").Dot("response")), )) return } func (generator *Generator) responseAssembler(assemblerName string, interfaceResponseName string, responseName string) (results []jen.Code) { //assembler struct results = append(results, jen.Type().Id(assemblerName).Struct(jen.Id("response"))) //assembler.Build() results = append(results, jen.Func().Params( jen.Id("builder").Op("*").Id(assemblerName)).Id("Build").Params().Params( jen.Id(interfaceResponseName)).Block( jen.Return().Id(responseName).Values(jen.Id("response").Op(":").Id("builder").Dot("response"))), ) return } func (generator *Generator) securitySchemas(swagger *openapi3.Swagger) jen.Code { code := jen.Type().Id("SecurityScheme").Id("string").Line().Line() var consts []jen.Code linq.From(swagger.Components.SecuritySchemes). SelectT(func(kv linq.KeyValue) jen.Code { name := strings.Title(cast.ToString(kv.Key)) return jen.Id("SecurityScheme" + name).Id("SecurityScheme").Op("=").Lit(name) }). ToSlice(&consts) code = code.Const().Defs(consts...).Line().Line() code = code.Line().Line(). Type().Id("securityProcessor").Struct( jen.Id("scheme").Id("SecurityScheme"), jen.Id("extract").Func().Params(jen.Id("r").Op("*").Qual("net/http", "Request")). Params(jen.Id("string"), jen.Id("string"), jen.Id("bool")), jen.Id("handle").Func().Params(jen.Id("r").Op("*").Qual("net/http", "Request"), jen.Id("scheme").Id("SecurityScheme"), jen.Id("name").Id("string"), jen.Id("value").Id("string")).Params( jen.Id("error"))) var extractorsHeadersFuncs []jen.Code linq.From(swagger.Components.SecuritySchemes). SelectT(func(kv linq.KeyValue) jen.Code { name := generator.normalizer.normalize(cast.ToString(kv.Key)) schema := kv.Value.(*openapi3.SecuritySchemeRef) if schema.Value.Type == "http" { ifStatement := jen.Null() assignment := jen.Null() if schema.Value.Scheme == "bearer" { ifStatement = ifStatement.Op("!").Qual("strings", "HasPrefix").Call(jen.Id("value"), jen.Lit("Bearer ")) assignment = assignment.Id("value").Op("=").Id("value").Index(jen.Lit(7), jen.Empty()) } else { ifStatement = ifStatement.Op("!").Qual("strings", "HasPrefix").Call(jen.Id("value"), jen.Lit("Basic ")) assignment = assignment.Id("value").Op("=").Id("value").Index(jen.Lit(6), jen.Empty()) } return jen.Line().Id("SecurityScheme"+strings.Title(name)).Op(":").Func().Params( jen.Id("r").Op("*").Qual("net/http", "Request")).Params(jen.Id("string"), jen.Id("string"), jen.Id("bool")).Block( jen.Id("value").Op(":=").Id("r").Dot("Header").Dot("Get").Call(jen.Lit("Authorization")).Line(), jen.If(ifStatement).Block(jen.Return().List(jen.Lit(""), jen.Lit(""), jen.Id("false"))).Line(), assignment.Line(), jen.Return().List(jen.Lit(schema.Value.Name), jen.Id("value"), jen.Id("value").Op("!=").Lit(""))) } if schema.Value.Type == "apiKey" { switch schema.Value.In { case "header": return jen.Line().Id("SecurityScheme"+strings.Title(name)).Op(":").Func().Params( jen.Id("r").Op("*").Qual("net/http", "Request")).Params( jen.Id("string"), jen.Id("string"), jen.Id("bool")).Block( jen.Id("value").Op(":=").Id("r").Dot("Header").Dot("Get").Call(jen.Lit(schema.Value.Name)).Line(), jen.Return().List(jen.Lit(schema.Value.Name), jen.Id("value"), jen.Id("value").Op("!=").Lit(""))) case "cookie": return jen.Line().Id("SecurityScheme"+strings.Title(name)).Op(":").Func().Params( jen.Id("r").Op("*").Qual("net/http", "Request")).Params( jen.Id("string"), jen.Id("string"), jen.Id("bool")).Block( jen.List(jen.Id("cookie"), jen.Id("err")). Op(":=").Id("r").Dot("Cookie").Call(jen.Lit(schema.Value.Name)).Line(), jen.If(jen.Id("err").Op("!=").Id("nil")).Block(jen.Return().List(jen.Lit(""), jen.Lit(""), jen.Id("false"))).Line(), jen.Return().List(jen.Id("cookie").Dot("Name"), jen.Id("cookie").Dot("Value"), jen.Id("true"))) } } return jen.Null() }).ToSlice(&extractorsHeadersFuncs) extractorsHeadersFuncs = append(extractorsHeadersFuncs, jen.Line()) code = code.Line().Line().Var().Id("securityExtractorsFuncs").Op("=").Map(jen.Id("SecurityScheme")).Func().Params( jen.Id("r").Op("*").Qual("net/http", "Request")).Params(jen.Id("string"), jen.Id("string"), jen.Id("bool")).Values(extractorsHeadersFuncs...) var interfaceFuncs []jen.Code linq.From(swagger.Components.SecuritySchemes). SelectT(func(kv linq.KeyValue) interface{} { return kv.Key }). SelectT(func(name string) jen.Code { return jen.Id("SecurityScheme"+strings.Title(name)).Params( jen.Id("r").Op("*").Qual("net/http", "Request"), jen.Id("scheme").Id("SecurityScheme"), jen.Id("name").Id("string"), jen.Id("value").Id("string")).Params( jen.Id("error")) }).ToSlice(&interfaceFuncs) code = code.Line().Line().Type().Id("SecuritySchemas").Interface(interfaceFuncs...) code = code.Line().Line().Type().Id("SecurityCheckResult").Struct( jen.Id("Scheme").Id("SecurityScheme"), jen.Id("Value").Id("string"), ) return code } func (generator *Generator) headersStruct(name string, headers map[string]*openapi3.HeaderRef) jen.Code { if len(headers) == 0 { return jen.Null() } var headersCode []jen.Code linq.From(headers).SelectT(func(kv linq.KeyValue) jen.Code { name := generator.normalizer.normalize(cast.ToString(kv.Key)) field := jen.Id(name) generator.typee.fillGoType(field, "", name, kv.Value.(*openapi3.HeaderRef).Value.Schema, false, false) return field }).ToSlice(&headersCode) headersStruct := jen.Type().Id(name).Struct(headersCode...) var headersMapCode []jen.Code linq.From(headers).SelectT(func(kv linq.KeyValue) jen.Code { key := cast.ToString(kv.Key) name := generator.normalizer.normalize(key) return jen.Lit(key).Op(":").Qual("github.com/spf13/cast", "ToString").Call(jen.Id("headers").Dot(name)) }).ToSlice(&headersMapCode) headersToMap := jen.Func().Params( jen.Id("headers").Id(name)).Id("toMap").Params().Params( jen.Map(jen.Id("string")).Id("string")).Block( jen.Return().Map(jen.Id("string")).Id("string"). Values(headersMapCode...)) return jen.Null().Add(generator.normalizer.doubleLineAfterEachElement(headersStruct, headersToMap)...) } func (generator *Generator) specCode(swagger *openapi3.Swagger) jen.Code { specJson, err := json.Marshal(swagger) if err != nil { panic(err) } minifiedJson, err := minify.JSON(string(specJson)) if err != nil { panic(err) } return jen.Var().Id("spec").Op("=").Index().Id("byte").Call(jen.Lit(minifiedJson)). Line().Line(). Func().Id("Spec").Params( jen.Id("w").Qual("net/http", "ResponseWriter"), jen.Id("_").Op("*").Qual("net/http", "Request")).Block( jen.Id("w").Dot("Header").Call().Dot("Add").Call(jen.Lit("Content-Type"), jen.Lit("application/json")), jen.Id("w").Dot("Write").Call(jen.Id("spec"))) } func (*Generator) builderConstructorName(name string) string { return name + "ResponseBuilder" } func (*Generator) statusCodesBuilderName(name string) string { return name + "StatusCodeResponseBuilder" } func (*Generator) headersBuilderName(name string) string { return name + "HeadersBuilder" } func (*Generator) headersStructName(name string) string { return name + "Headers" } func (*Generator) cookiesBuilderName(name string) string { return name + "CookiesBuilder" } func (*Generator) assemblerName(name string) string { return name + "ResponseBuilder" } func (generator *Generator) contentTypeBuilderName(name string) string { return name + "ContentTypeBuilder" } func (generator *Generator) contentTypeFuncName(contentType string) string { return generator.normalizer.contentType(contentType) } func (generator *Generator) bodyGeneratorName(name string, contentType string) string { return name + generator.normalizer.contentType(contentType) + "BodyBuilder" } func (generator *Generator) trimPackagePath(from string) string { index := strings.LastIndex(from, "/") if index < 0 { return from } return from[index+1:] }
secret_stores.py
# Copyright 2018 Fujitsu. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_versionedobjects import base as object_base from barbican.model import models from barbican.model import repositories as repos from barbican.objects import base from barbican.objects import fields @object_base.VersionedObjectRegistry.register class
(base.BarbicanObject, base.BarbicanPersistentObject, object_base.VersionedObjectDictCompat): fields = { 'store_plugin': fields.StringField(), 'crypto_plugin': fields.StringField(nullable=True), 'global_default': fields.BooleanField(default=False), 'name': fields.StringField(), 'status': fields.StringField(nullable=True, default=base.States.ACTIVE) } db_model = models.SecretStores db_repo = repos.get_secret_stores_repository() @classmethod def get_all(cls, session=None): secret_stores_db = cls.db_repo.get_all(session) secret_stores_obj = [cls()._from_db_object(secret_store_db) for secret_store_db in secret_stores_db] return secret_stores_obj
SecretStores
schematic.option.d.ts
export declare class SchematicOption { private name; private value; constructor(name: string, value: boolean | string); toCommandString(): string; private format;
}
mutators_test.go
package actions import ( "context" "errors" "testing" "github.com/sensu/sensu-go/backend/store" "github.com/sensu/sensu-go/testing/mockstore" "github.com/sensu/sensu-go/testing/testutil" "github.com/sensu/sensu-go/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) func TestNewMutatorController(t *testing.T)
func TestMutatorCreateOrReplace(t *testing.T) { defaultCtx := testutil.NewContext( testutil.ContextWithNamespace("default"), ) badMut := types.FixtureMutator("bad") badMut.Name = "!@#!#$@#^$%&$%&$&$%&%^*%&(%@###" tests := []struct { name string ctx context.Context argument *types.Mutator fetchResult *types.Mutator fetchErr error createErr error expectedErr bool expectedErrCode ErrCode }{ { name: "Created", ctx: defaultCtx, argument: types.FixtureMutator("sleepy"), expectedErr: false, }, { name: "Already Exists", ctx: defaultCtx, argument: types.FixtureMutator("sleepy"), fetchResult: types.FixtureMutator("sleepy"), }, { name: "Validation Error", ctx: defaultCtx, argument: badMut, expectedErr: true, expectedErrCode: InvalidArgument, }, } for _, test := range tests { store := &mockstore.MockStore{} ctl := NewMutatorController(store) t.Run(test.name, func(t *testing.T) { assert := assert.New(t) store.On("GetMutatorByName", mock.Anything, mock.Anything). Return(test.fetchResult, test.fetchErr) store.On("UpdateMutator", mock.Anything, mock.Anything).Return(test.createErr) err := ctl.CreateOrReplace(test.ctx, *test.argument) if test.expectedErr { if cerr, ok := err.(Error); ok { assert.Equal(test.expectedErrCode, cerr.Code) } else { assert.Error(err) assert.FailNow("Not of type 'Error'") } } else { assert.NoError(err) } }) } } func TestMutatorCreate(t *testing.T) { defaultCtx := testutil.NewContext( testutil.ContextWithNamespace("default"), ) badMut := types.FixtureMutator("bad") badMut.Name = "!@#!#$@#^$%&$%&$&$%&%^*%&(%@###" tests := []struct { name string ctx context.Context argument *types.Mutator fetchResult *types.Mutator fetchErr error createErr error expectedErr bool expectedErrCode ErrCode }{ { name: "Created", ctx: defaultCtx, argument: types.FixtureMutator("sleepy"), expectedErr: false, }, { name: "Already Exists", ctx: defaultCtx, argument: types.FixtureMutator("sleepy"), fetchResult: types.FixtureMutator("sleepy"), expectedErr: true, expectedErrCode: AlreadyExistsErr, }, { name: "store Err on Fetch", ctx: defaultCtx, argument: types.FixtureMutator("grumpy"), fetchErr: errors.New("nein"), expectedErr: true, expectedErrCode: InternalErr, }, { name: "Validation Error", ctx: defaultCtx, argument: badMut, expectedErr: true, expectedErrCode: InvalidArgument, }, } for _, test := range tests { store := &mockstore.MockStore{} ctl := NewMutatorController(store) t.Run(test.name, func(t *testing.T) { assert := assert.New(t) store.On("GetMutatorByName", mock.Anything, mock.Anything). Return(test.fetchResult, test.fetchErr) store.On("UpdateMutator", mock.Anything, mock.Anything).Return(test.createErr) err := ctl.Create(test.ctx, *test.argument) if test.expectedErr { if cerr, ok := err.(Error); ok { assert.Equal(test.expectedErrCode, cerr.Code) } else { assert.Error(err) assert.FailNow("Not of type 'Error'") } } else { assert.NoError(err) } }) } } func TestMutatorDestroy(t *testing.T) { defaultCtx := testutil.NewContext( testutil.ContextWithNamespace("default"), ) testCases := []struct { name string ctx context.Context mutator string fetchResult *types.Mutator fetchErr error deleteErr error expectedErr bool expectedErrCode ErrCode }{ { name: "Deleted", ctx: defaultCtx, mutator: "mutator1", fetchResult: types.FixtureMutator("mutator1"), expectedErr: false, }, { name: "Does Not Exist", ctx: defaultCtx, mutator: "mutator1", fetchResult: nil, expectedErr: true, expectedErrCode: NotFound, }, { name: "store Err on Delete", ctx: defaultCtx, mutator: "mutator1", fetchResult: types.FixtureMutator("mutator1"), deleteErr: errors.New("dunno"), expectedErr: true, expectedErrCode: InternalErr, }, { name: "store Err on Fetch", ctx: defaultCtx, mutator: "mutator1", fetchResult: types.FixtureMutator("mutator1"), fetchErr: errors.New("dunno"), expectedErr: true, expectedErrCode: InternalErr, }, } for _, tc := range testCases { store := &mockstore.MockStore{} actions := NewMutatorController(store) t.Run(tc.name, func(t *testing.T) { assert := assert.New(t) // Mock store methods store. On("GetMutatorByName", mock.Anything, mock.Anything). Return(tc.fetchResult, tc.fetchErr) store. On("DeleteMutatorByName", mock.Anything, "mutator1"). Return(tc.deleteErr) // Exec Query err := actions.Destroy(tc.ctx, tc.mutator) if tc.expectedErr { inferErr, ok := err.(Error) if ok { assert.Equal(tc.expectedErrCode, inferErr.Code) } else { assert.Error(err) assert.FailNow("Given was not of type 'Error'") } } else { assert.NoError(err) } }) } } func TestMutatorList(t *testing.T) { readCtx := context.Background() testCases := []struct { name string ctx context.Context records []*types.Mutator storeErr error expectedLen int expectedErr error }{ { name: "No Params, No Mutators", ctx: readCtx, records: nil, expectedLen: 0, storeErr: nil, expectedErr: nil, }, { name: "No Params With Mutators", ctx: readCtx, records: []*types.Mutator{ types.FixtureMutator("homer"), types.FixtureMutator("bart"), }, expectedLen: 2, storeErr: nil, expectedErr: nil, }, { name: "Mutator Param", ctx: readCtx, records: []*types.Mutator{ types.FixtureMutator("mr. burns"), }, expectedLen: 1, storeErr: nil, expectedErr: nil, }, { name: "store Failure", ctx: readCtx, records: nil, expectedLen: 0, storeErr: errors.New(""), expectedErr: NewError(InternalErr, errors.New("")), }, } for _, tc := range testCases { s := &mockstore.MockStore{} actions := NewMutatorController(s) t.Run(tc.name, func(t *testing.T) { assert := assert.New(t) // Mock store methods pred := &store.SelectionPredicate{} s.On("GetMutators", tc.ctx, pred).Return(tc.records, tc.storeErr) // Exec Query results, err := actions.List(tc.ctx, pred) // Assert assert.EqualValues(tc.expectedErr, err) assert.Len(results, tc.expectedLen) }) } } func TestMutatorFind(t *testing.T) { readCtx := context.Background() tests := []struct { name string ctx context.Context mutator *types.Mutator argument string expected bool expectedErrCode ErrCode }{ { name: "Found", ctx: readCtx, mutator: types.FixtureMutator("abe"), argument: "abe", expected: true, expectedErrCode: 0, }, { name: "Not Found", ctx: readCtx, mutator: nil, argument: "fox mulder", expected: false, expectedErrCode: NotFound, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { store := &mockstore.MockStore{} ctl := NewMutatorController(store) // Mock store methods store. On("GetMutatorByName", test.ctx, test.argument). Return(test.mutator, nil) assert := assert.New(t) result, err := ctl.Find(test.ctx, test.argument) if cerr, ok := err.(Error); ok { assert.Equal(test.expectedErrCode, cerr.Code) } else { assert.NoError(err) } assert.Equal(test.expected, result != nil, "expects Find() to return an event") }) } }
{ assert := assert.New(t) store := &mockstore.MockStore{} ctl := NewMutatorController(store) assert.NotNil(ctl) assert.Equal(store, ctl.store) }
material.module.ts
import { NgModule } from '@angular/core'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; const materials = [ MatInputModule, MatSelectModule ]; @NgModule({ imports: materials, exports: materials }) export class
{ }
MaterialsModule
index_list.go
package vals import ( "errors" "strconv" "strings" "src.elv.sh/pkg/eval/errs" ) var ( errIndexMustBeInteger = errors.New("index must must be integer") ) func indexList(l List, rawIndex interface{}) (interface{}, error) { index, err := ConvertListIndex(rawIndex, l.Len()) if err != nil { return nil, err } if index.Slice { return l.SubVector(index.Lower, index.Upper), nil } // Bounds are already checked. value, _ := l.Index(index.Lower) return value, nil } // ListIndex represents a (converted) list index. type ListIndex struct { Slice bool Lower int Upper int } func adjustAndCheckIndex(i, n int, includeN bool) (int, error) { if i < 0 { if i < -n { return 0, negIndexOutOfRange(strconv.Itoa(i), n) } return i + n, nil } if includeN { if i > n { return 0, posIndexOutOfRange(strconv.Itoa(i), n+1) } } else { if i >= n { return 0, posIndexOutOfRange(strconv.Itoa(i), n) } } return i, nil } // ConvertListIndex parses a list index, check whether it is valid, and returns // the converted structure. func ConvertListIndex(rawIndex interface{}, n int) (*ListIndex, error) { switch rawIndex := rawIndex.(type) { case int: index, err := adjustAndCheckIndex(rawIndex, n, false) if err != nil { return nil, err } return &ListIndex{false, index, 0}, nil case string: slice, i, j, err := parseIndexString(rawIndex, n) if err != nil { return nil, err } if !slice { i, err = adjustAndCheckIndex(i, n, false) if err != nil { return nil, err } } else { i, err = adjustAndCheckIndex(i, n, true) if err != nil { return nil, err } j0 := j j, err = adjustAndCheckIndex(j, n, true) if err != nil { return nil, err } if j < i { if j0 < 0 { return nil, errs.OutOfRange{ What: "negative slice upper index", ValidLow: strconv.Itoa(i - n), ValidHigh: "-1", Actual: strconv.Itoa(j0)} } return nil, errs.OutOfRange{ What: "slice upper index", ValidLow: strconv.Itoa(i), ValidHigh: strconv.Itoa(n), Actual: strconv.Itoa(j0)} } } return &ListIndex{slice, i, j}, nil default: return nil, errIndexMustBeInteger } } // Index = Number | // Number ( ':' | '..' | '..=' ) Number func parseIndexString(s string, n int) (slice bool, i int, j int, err error) { low, sep, high := splitIndexString(s) if sep == "" { // A single number i, err := atoi(s, n) if err != nil { return false, 0, 0, err } return false, i, 0, nil } if low == "" { i = 0 } else { i, err = atoi(low, n+1) if err != nil { return false, 0, 0, err } } if high == "" { j = n } else { j, err = atoi(high, n+1) if err != nil { return false, 0, 0, err } if sep == "..=" { // TODO: Handle j == MaxInt-1 j++ } } // Two numbers return true, i, j, nil } func splitIndexString(s string) (low, sep, high string) { if i := strings.IndexRune(s, ':'); i >= 0 { return s[:i], ":", s[i+1:] } if i := strings.Index(s, "..="); i >= 0 { return s[:i], "..=", s[i+3:] } if i := strings.Index(s, ".."); i >= 0 { return s[:i], "..", s[i+2:] } return s, "", "" } // atoi is a wrapper around strconv.Atoi, converting strconv.ErrRange to // errs.OutOfRange. func atoi(a string, n int) (int, error) { i, err := strconv.Atoi(a) if err != nil { if err.(*strconv.NumError).Err == strconv.ErrRange { if i < 0 { return 0, negIndexOutOfRange(a, n) } return 0, posIndexOutOfRange(a, n) } return 0, errIndexMustBeInteger } return i, nil } func posIndexOutOfRange(index string, n int) errs.OutOfRange { return errs.OutOfRange{ What: "index", ValidLow: "0", ValidHigh: strconv.Itoa(n - 1), Actual: index} } func negIndexOutOfRange(index string, n int) errs.OutOfRange
{ return errs.OutOfRange{ What: "negative index", ValidLow: strconv.Itoa(-n), ValidHigh: "-1", Actual: index} }
init.js
"use strict"; const { resolve } = require("path"); const Permissions = require(resolve(require.resolve("zelvbod.js").replace("index.js", "/util/Permissions.js"))); const Constants = require(resolve(require.resolve("zelvbod.js").replace("index.js", "/util/Constants.js"))); const Intents = require(resolve(require.resolve("zelvbod.js").replace("index.js", "/util/Intents.js"))); const APIMessage = require(resolve(require.resolve("zelvbod.js").replace("index.js", "/structures/APIMessage.js"))); const RHPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/rest/APIRequest.js")); const RH = require(RHPath); require.cache[RHPath].exports = class APIRequest extends RH { async make() { const response = await super.make(); if(this.client.listenerCount("rest")) { this.client.emit("rest", { path: this.path, method: this.method, response: this.client.options.restEventIncludeBuffer ? response.clone().buffer() : null }); } return response; } }; const SHPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/client/websocket/WebSocketShard.js")); const SH = require(SHPath); require.cache[SHPath].exports = class WebSocketShard extends SH { async emitReady() { const c = this.manager.client; if(c.options.fetchAllMembers && (!c.options.ws.intents || c.options.ws.intents & Intents.FLAGS.GUILD_MEMBERS)) { this.debug("Attempting to fetch all members"); const guilds = c.guilds.cache.filter(g => g.shardID === this.id); let n = 0; let g = 0; for(const guild of guilds.values()) { if(!guild.available) { this.debug(`Skipped guild ${guild.id}! Guild not available`); continue; } if(this.ratelimit.remaining < 5) { const left = Math.ceil(this.ratelimit.timer._idleStart + this.ratelimit.timer._idleTimeout - (process.uptime() * 1000)) + 1000; this.debug(`Gateway ratelimit reached, continuing in ${left}ms`); this.debug(`Fetching progress: ${g} guilds / ${n} members`); await new Promise(r => { setTimeout(r, left); }); } try { const m = await guild.members.fetch({ time: 15000 }); n += m.size; g++; } catch(err) { this.debug(`Failed to fetch all members for guild ${guild.id}! ${err}`); } } this.debug(`Fetched ${guilds.reduce((a, t) => a + t.members.cache.size, 0)} members`); } this.debug("Ready"); this.status = Constants.Status.READY; this.emit(Constants.ShardEvents.ALL_READY, this.expectedGuilds.size ? this.expectedGuilds : void 0); } checkReady() { if(this.readyTimeout) { this.manager.client.clearTimeout(this.readyTimeout); this.readyTimeout = void 0; } if(!this.expectedGuilds.size) { this.debug("Shard received all its guilds, marking as ready."); this.emitReady(); return; } this.readyTimeout = this.manager.client.setTimeout(() => { this.debug(`Shard did not receive any more guilds in 15 seconds, marking as ready. ${this.expectedGuilds.size} guilds are unavailable`); this.readyTimeout = void 0; this.emitReady(); }, 15000); } }; const VCPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/client/voice/VoiceConnection.js")); const VC = require(VCPath); require.cache[VCPath].exports = class VoiceConnection extends VC { constructor(voiceManager, channel) { super(voiceManager); this._channel = channel; Object.defineProperty(this, "channel", { enumerable: false, get: function() { return this.client.channels.cache.get(this._channel.id) || this._channel; } }); } updateChannel(channel) { this._channel = channel; this.sendVoiceStateUpdate(); } }; const ALPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/structures/GuildAuditLogs.js")); const AL = require(ALPath); AL.Entry = class GuildAuditLogsEntry extends AL.Entry { constructor(logs, guild, data) { super(logs, guild, data); if(!this.executor) { this.executor = guild.client.users.add(logs._users.find(t => t.id === data.user_id) || { id: data.user_id }, false); } const c = logs.constructor; const target = c.targetType(data.action_type); if(((target === c.Targets.USER || target === c.Targets.MESSAGE) && data.action_type !== c.Actions.MESSAGE_BULK_DELETE) && data.target_id && !this.target) { this.target = guild.client.users.add(logs._users.find(t => t.id === data.target_id) || { id: data.target_id }, false); } else if(target === c.Targets.GUILD && !this.target) { this.target = guild.client.guilds.add({ id: data.target_id }, false); } } }; require.cache[ALPath].exports = class GuildAuditLogs extends AL { constructor(guild, data) { const o = {}; for(const i in data) { if(!["users", "audit_log_entries"].includes(i)) { o[i] = data[i]; } } o.audit_log_entries = []; super(guild, o); this._users = data.users; for(const item of data.audit_log_entries) { const entry = new this.constructor.Entry(this, guild, item); this.entries.set(entry.id, entry); } } static build(...args) { const logs = new this(...args); return Promise.all(logs.entries.map(e => e.target)).then(() => logs); } }; const TXPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/structures/interfaces/TextBasedChannel.js")); const TX = require(TXPath); require.cache[TXPath].exports = class TextBasedChannel extends TX { async send(content, options) { if (this.constructor.name === "User" || this.constructor.name === "GuildMember") { return this.createDM().then(dm => dm.send(content, options)); } let apiMessage; if (content instanceof APIMessage) { apiMessage = content.resolveData(); } else { apiMessage = APIMessage.create(this, content, options).resolveData();
return Promise.all(apiMessage.split().map(this.send.bind(this))); } } const { data, files } = await apiMessage.resolveFiles(); return this.client.api.channels[this.id].messages.post({ data, files }).then(d => { if(this.guild) { d.guild_id = this.guild.id; } return this.client.actions.MessageCreate.handle(d).message; }); } }; const GCPath = resolve(require.resolve("zelvbod.js").replace("index.js", "/structures/GuildChannel.js")); const GC = require(GCPath); require.cache[GCPath].exports = class GuildChannel extends GC { constructor(guild, data) { super({ client: guild.client }, data); if(this.client.options.cacheGuilds) { this.guild = guild; } else { this._guildID = guild.id; this._shardID = guild.shardID; Object.defineProperty(this, "guild", { enumerable: false, get: function() { return this.client.guilds.cache.get(this._guildID) || this.client.guilds.add({ id: this._guildID, shardID: this._shardID }, false); } }); } } get deletable() { if(this.deleted) { return false; } if(!this.client.options.cacheRoles && !this.guild.roles.cache.size) { return false; } return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false); } }; const Action = require(resolve(require.resolve("zelvbod.js").replace("index.js", "/client/actions/Action.js"))); Action.prototype.getPayload = function(data, manager, id, partialType, cache) { return manager.cache.get(id) || manager.add(data, cache); };
if (Array.isArray(apiMessage.data.content)) {
common_calls.rs
// SPDX-FileCopyrightText: © 2022 Svix Authors // SPDX-License-Identifier: MIT use std::time::Duration; use anyhow::Result; use chrono::{DateTime, Utc}; use reqwest::StatusCode; use serde::{de::DeserializeOwned, Serialize}; use svix_server::{ core::types::{ApplicationId, EventTypeName, MessageId}, v1::{ endpoints::{ application::{ApplicationIn, ApplicationOut}, attempt::MessageAttemptOut, endpoint::{EndpointIn, EndpointOut, RecoverIn}, event_type::EventTypeIn, message::{MessageIn, MessageOut}, }, utils::ListResponse, }, }; use super::{run_with_retries, IgnoredResponse, TestClient}; // App pub fn application_in(name: &str) -> ApplicationIn { ApplicationIn { name: name.to_owned(), ..Default::default() } } pub async fn create_test_app(client: &TestClient, name: &str) -> Result<ApplicationOut> { client .post("api/v1/app/", application_in(name), StatusCode::CREATED) .await } pub async fn delete_test_app(client: &TestClient, id: ApplicationId) -> Result<IgnoredResponse> { client .delete(&format!("api/v1/app/{}/", id), StatusCode::NO_CONTENT) .await } // Endpoint pub fn endpoint_in(url: &str) -> EndpointIn { EndpointIn { url: url.to_owned(), version: 1, ..Default::default() } } pub async fn create_test_endpoint( client: &TestClient, app_id: &ApplicationId, url: &str, ) -> Result<EndpointOut> { post_endpoint(client, app_id, endpoint_in(url)).await } pub async fn post_endpoint( client: &TestClient, app_id: &str, ep: EndpointIn, ) -> Result<EndpointOut> { client .post( &format!("api/v1/app/{}/endpoint/", app_id), ep, StatusCode::CREATED, ) .await } pub async fn put_endpoint( client: &TestClient, app_id: &str, ep_id: &str, ep: EndpointIn, ) -> Result<EndpointOut> { client .put( &format!("api/v1/app/{}/endpoint/{}/", app_id, ep_id), ep, StatusCode::OK, ) .await } // Message pub fn message_in<T: Serialize>(event_type: &str, payload: T) -> Result<MessageIn> { Ok(MessageIn { event_type: EventTypeName(event_type.to_owned()), payload: serde_json::to_value(payload)?, channels: None, uid: None, }) } pub async fn create_test_message( client: &TestClient, app_id: &ApplicationId, payload: serde_json::Value, ) -> Result<MessageOut> { client .post( &format!("api/v1/app/{}/msg/", &app_id), message_in("event.type", payload)?, StatusCode::ACCEPTED, ) .await } pub fn event_type_in<T: Serialize>(name: &str, payload: T) -> Result<EventTypeIn> { Ok(EventTypeIn { name: EventTypeName(name.to_owned()), description: "test-event-description".to_owned(), deleted: false, schemas: Some(serde_json::to_value(payload)?), }) } // Common tests pub async fn common_test_list< ModelOut: DeserializeOwned + Clone + PartialEq + std::fmt::Debug, ModelIn: Serialize, >( client: &TestClient, path: &str, create_model: fn(usize) -> ModelIn, sort_asc: bool, ) -> Result<()> { let mut items = Vec::new(); for i in 0..10 { let item: ModelOut = client .post(path, create_model(i), StatusCode::CREATED) .await .unwrap(); // Sleep for 5ms because KsuidMs has 4ms accuracy so things got out of order tokio::time::sleep(Duration::from_millis(5)).await; items.push(item); }
.get::<ListResponse<ModelOut>>(&format!("{path}?with_content=true"), StatusCode::OK) .await .unwrap(); assert_eq!(list.data.len(), 10); Ok(list) }) .await .unwrap(); if sort_asc { for i in 0..10 { assert_eq!(items.get(i), list.data.get(i)); } } else { for i in 0..10 { assert_eq!(items.get(10 - i), list.data.get(i)); } } // Limit results let list = client .get::<ListResponse<ModelOut>>(&format!("{}?limit=1", path), StatusCode::OK) .await .unwrap(); assert_eq!(list.data.len(), 1); assert!(!list.done); let list = client .get::<ListResponse<ModelOut>>(&format!("{}?limit=500", path), StatusCode::OK) .await .unwrap(); assert_eq!(list.data.len(), 10); assert!(list.done); let list = client .get::<ListResponse<ModelOut>>(&format!("{}?limit=10", path), StatusCode::OK) .await .unwrap(); assert_eq!(list.data.len(), 10); assert!(list.done); let list = client .get::<ListResponse<ModelOut>>(&format!("{}?limit=6", path), StatusCode::OK) .await .unwrap(); assert_eq!(list.data.len(), 6); assert!(!list.done); let list = client .get::<ListResponse<ModelOut>>( &format!("{}?limit=6&iterator={}", path, list.iterator.unwrap()), StatusCode::OK, ) .await .unwrap(); assert_eq!(list.data.len(), 4); assert!(list.done); let _list = client .get::<IgnoredResponse>( &format!("{}?limit=6&iterator=BAD-$$$ITERATOR", path), StatusCode::UNPROCESSABLE_ENTITY, ) .await .unwrap(); Ok(()) } pub async fn recover_webhooks(client: &TestClient, since: DateTime<Utc>, url: &str) { let _: serde_json::Value = client .post(url, RecoverIn { since }, StatusCode::ACCEPTED) .await .unwrap(); } pub async fn get_msg_attempt_list_and_assert_count( client: &TestClient, app_id: &ApplicationId, msg_id: &MessageId, expected_count: usize, ) -> Result<ListResponse<MessageAttemptOut>> { run_with_retries(|| async { let list: ListResponse<MessageAttemptOut> = client .get( &format!("api/v1/app/{}/attempt/msg/{}/", app_id, msg_id), StatusCode::OK, ) .await?; if list.data.len() != expected_count { anyhow::bail!( "Attempt count {} does not match expected length {}", list.data.len(), expected_count ); } Ok(list) }) .await }
let list = run_with_retries(|| async { let list = client
binarymd5.go
/* Copyright 2017 Google Inc. 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 agreedto in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package vindexes import ( "bytes" "crypto/md5" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/key" ) var ( _ Vindex = (*BinaryMD5)(nil) ) // BinaryMD5 is a vindex that hashes binary bits to a keyspace id. type BinaryMD5 struct { name string } // NewBinaryMD5 creates a new BinaryMD5.
// String returns the name of the vindex. func (vind *BinaryMD5) String() string { return vind.name } // Cost returns the cost as 1. func (vind *BinaryMD5) Cost() int { return 1 } // IsUnique returns true since the Vindex is unique. func (vind *BinaryMD5) IsUnique() bool { return true } // IsFunctional returns true since the Vindex is functional. func (vind *BinaryMD5) IsFunctional() bool { return true } // Verify returns true if ids maps to ksids. func (vind *BinaryMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) { out := make([]bool, len(ids)) for i := range ids { out[i] = (bytes.Compare(binHash(ids[i].ToBytes()), ksids[i]) == 0) } return out, nil } // Map can map ids to key.Destination objects. func (vind *BinaryMD5) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) { out := make([]key.Destination, len(ids)) for i, id := range ids { out[i] = key.DestinationKeyspaceID(binHash(id.ToBytes())) } return out, nil } func binHash(source []byte) []byte { sum := md5.Sum(source) return sum[:] } func init() { Register("binary_md5", NewBinaryMD5) }
func NewBinaryMD5(name string, _ map[string]string) (Vindex, error) { return &BinaryMD5{name: name}, nil }
testbed.rs
use crate::engine::GraphicsManager; use kiss3d::camera::Camera; use kiss3d::event::{Action, Key, Modifiers, WindowEvent}; use kiss3d::loader::obj; use kiss3d::planar_camera::PlanarCamera; use kiss3d::post_processing::PostProcessingEffect; use kiss3d::text::Font; use kiss3d::window::{State, Window}; use na::{self, Point2, Point3}; use ncollide2d::utils::GenerationalId; use ncollide2d::query::Ray; use ncollide2d::world::CollisionGroups; use nphysics2d::joint::{ConstraintHandle, MouseConstraint}; use nphysics2d::object::{BodyHandle, BodyPartHandle, ColliderHandle, ColliderAnchor}; use nphysics2d::world::World; use std::collections::HashMap; use std::env; use std::mem; use std::path::Path; use std::rc::Rc; use std::sync::{Arc, RwLock}; use crate::world_owner::WorldOwner; #[derive(PartialEq)] enum RunMode { Running, Stop, Step, } #[cfg(not(feature = "log"))] fn usage(exe_name: &str) { println!("Usage: {} [OPTION] ", exe_name); println!(); println!("Options:"); println!(" --help - prints this help message and exits."); println!(" --pause - do not start the simulation right away."); println!(); println!("The following keyboard commands are supported:"); println!(" t - pause/continue the simulation."); println!(" s - pause then execute only one simulation step."); println!(" 1 - launch a ball."); println!(" 2 - launch a cube."); println!(" 3 - launch a fast cube using continuous collision detection."); println!(" TAB - switch camera mode (first-person or arc-ball)."); println!(" SHIFT + right click - launch a fast cube using continuous collision detection."); println!( " CTRL + left click + drag - select and drag an object using a ball-in-socket joint." ); println!(" SHIFT + left click - remove an object."); println!(" arrows - move around when in first-person camera mode."); println!(" space - switch wireframe mode. When ON, the contacts points and normals are displayed."); println!(" b - draw the bounding boxes."); } #[cfg(feature = "log")] fn usage(exe_name: &str) { info!("Usage: {} [OPTION] ", exe_name); info!(""); info!("Options:"); info!(" --help - prints this help message and exits."); info!(" --pause - do not start the simulation right away."); info!(""); info!("The following keyboard commands are supported:"); info!(" t - pause/continue the simulation."); info!(" s - pause then execute only one simulation step."); info!(" 1 - launch a ball."); info!(" 2 - launch a cube."); info!(" 3 - launch a fast cube using continuous collision detection."); info!(" TAB - switch camera mode (first-person or arc-ball)."); info!(" SHIFT + right click - launch a fast cube using continuous collision detection."); info!(" CTRL + left click + drag - select and drag an object using a ball-in-socket joint."); info!(" SHIFT + left click - remove an object."); info!(" arrows - move around when in first-person camera mode."); info!(" space - switch wireframe mode. When ON, the contacts points and normals are displayed."); info!(" b - draw the bounding boxes."); } pub struct Testbed { window: Option<Box<Window>>, graphics: GraphicsManager, nsteps: usize, callbacks: Callbacks, time: f32, hide_counters: bool, persistant_contacts: HashMap<GenerationalId, bool>, font: Rc<Font>, running: RunMode, draw_colls: bool, cursor_pos: Point2<f32>, grabbed_object: Option<BodyPartHandle>, grabbed_object_constraint: Option<ConstraintHandle>, world: Box<WorldOwner>, drawing_ray: Option<Point2<f32>>, } type Callbacks = Vec<Box<Fn(&mut WorldOwner, &mut GraphicsManager, f32)>>; impl Testbed { pub fn new_empty() -> Testbed { let graphics = GraphicsManager::new(); let world = World::new(); let mut window = Box::new(Window::new("nphysics: 2d demo")); window.set_background_color(0.9, 0.9, 0.9); window.set_framerate_limit(Some(60)); Testbed { world: Box::new(Arc::new(RwLock::new(world))), callbacks: Vec::new(), window: Some(window), graphics, nsteps: 1, time: 0.0, hide_counters: true, persistant_contacts: HashMap::new(), font: Font::default(), running: RunMode::Running, draw_colls: false, cursor_pos: Point2::new(0.0f32, 0.0), grabbed_object: None, grabbed_object_constraint: None, drawing_ray: None } } pub fn new(world: World<f32>) -> Testbed { Testbed::new_with_world_owner(Box::new(world)) } pub fn new_with_world_owner(world_owner: Box<WorldOwner>) -> Testbed { let mut res = Testbed::new_empty(); res.set_world_owner(world_owner); res } pub fn set_number_of_steps_per_frame(&mut self, nsteps: usize) { self.nsteps = nsteps } pub fn hide_performance_counters(&mut self) { self.hide_counters = true; } pub fn show_performance_counters(&mut self) { self.hide_counters = false; } pub fn set_world(&mut self, world: World<f32>) { self.set_world_owner(Box::new(world)); } pub fn set_world_owner(&mut self, world: Box<WorldOwner>) { self.world = world; let mut world = self.world.get_mut(); world.enable_performance_counters(); self.graphics.clear(self.window.as_mut().unwrap()); for co in world.colliders() { self.graphics .add(self.window.as_mut().unwrap(), co.handle(), &world); } } pub fn look_at(&mut self, at: Point2<f32>, zoom: f32) { self.graphics.look_at(at, zoom); } pub fn set_body_color(&mut self, body: BodyHandle, color: Point3<f32>) { self.graphics.set_body_color(body, color); } pub fn
(&mut self, collider: ColliderHandle, color: Point3<f32>) { self.graphics.set_collider_color(collider, color); } pub fn world(&self) -> &Box<WorldOwner> { &self.world } pub fn graphics_mut(&mut self) -> &mut GraphicsManager { &mut self.graphics } pub fn load_obj(path: &str) -> Vec<(Vec<Point3<f32>>, Vec<usize>)> { let path = Path::new(path); let empty = Path::new("_some_non_existant_folder"); // dont bother loading mtl files correctly let objects = obj::parse_file(&path, &empty, "").expect("Unable to open the obj file."); let mut res = Vec::new(); for (_, m, _) in objects.into_iter() { let vertices = m.coords().read().unwrap().to_owned().unwrap(); let indices = m.faces().read().unwrap().to_owned().unwrap(); let mut flat_indices = Vec::new(); for i in indices.into_iter() { flat_indices.push(i.x as usize); flat_indices.push(i.y as usize); flat_indices.push(i.z as usize); } let m = (vertices, flat_indices); res.push(m); } res } pub fn add_callback<F: Fn(&mut WorldOwner, &mut GraphicsManager, f32) + 'static>( &mut self, callback: F, ) { self.callbacks.push(Box::new(callback)); } pub fn run(mut self) { let mut args = env::args(); if args.len() > 1 { let exname = args.next().unwrap(); for arg in args { if &arg[..] == "--help" || &arg[..] == "-h" { usage(&exname[..]); return; } else if &arg[..] == "--pause" { self.running = RunMode::Stop; } } } let window = mem::replace(&mut self.window, None).unwrap(); window.render_loop(self); } } type CameraEffects<'a> = ( Option<&'a mut Camera>, Option<&'a mut PlanarCamera>, Option<&'a mut PostProcessingEffect>, ); impl State for Testbed { fn cameras_and_effect(&mut self) -> CameraEffects<'_> { (None, Some(self.graphics.camera_mut()), None) } fn step(&mut self, window: &mut Window) { for mut event in window.events().iter() { match event.value { // WindowEvent::MouseButton(MouseButton::Button2, Action::Press, Key::LControl) | // WindowEvent::MouseButton(MouseButton::Button2, Action::Press, Key::RControl) => { // let mut graphics = self.graphics; // let geom = Cuboid::new(Vector3::new(0.5f32, 0.5f32, 0.5f32)); // let mut rb = RigidBody::new_dynamic(geom, 4.0f32, 0.3, 0.6); // let size = window.size(); // let (pos, dir) = graphics.camera().unproject(&cursor_pos, &size); // rb.set_translation(Translation3::from(pos.coords)); // rb.set_lin_vel(dir * 1000.0f32); // let body = self.world.add_rigid_body(rb); // self.world.add_ccd_to(&body, 1.0, false); // graphics.add(window, WorldObject::RigidBody(body)); // }, WindowEvent::MouseButton(_, Action::Press, modifier) => { let physics_world = &mut self.world.get_mut(); let all_groups = &CollisionGroups::new(); for b in physics_world .collider_world() .interferences_with_point(&self.cursor_pos, all_groups) { if !b.query_type().is_proximity_query() && !b.body().is_ground() { if let ColliderAnchor::OnBodyPart { body_part, .. } = b.anchor() { self.grabbed_object = Some(*body_part); } else { continue; } } } if modifier.contains(Modifiers::Shift) { if let Some(body_part) = self.grabbed_object { if !body_part.is_ground() { self.graphics.remove_body_nodes(window, body_part.0); physics_world.remove_bodies(&[body_part.0]); } } self.grabbed_object = None; } else if modifier.contains(Modifiers::Control) { if let Some(body) = self.grabbed_object { if let Some(joint) = self.grabbed_object_constraint { let _ = physics_world.remove_constraint(joint); } let body_pos = physics_world.body(body.0).unwrap().part(body.1).unwrap().position(); let attach1 = self.cursor_pos; let attach2 = body_pos.inverse() * attach1; let joint = MouseConstraint::new( BodyPartHandle::ground(), body, attach1, attach2, 1.0, ); self.grabbed_object_constraint = Some(physics_world.add_constraint(joint)); for node in self .graphics .body_nodes_mut(body.0) .unwrap() .iter_mut() { node.select() } } event.inhibited = true; } else if modifier.contains(Modifiers::Alt) { self.drawing_ray = Some(self.cursor_pos); } else { self.grabbed_object = None; } } WindowEvent::MouseButton(_, Action::Release, _) => { let physics_world = &mut self.world.get_mut(); if let Some(body) = self.grabbed_object { for n in self .graphics .body_nodes_mut(body.0) .unwrap() .iter_mut() { n.unselect() } } if let Some(joint) = self.grabbed_object_constraint { let _ = physics_world.remove_constraint(joint); } if let Some(start) = self.drawing_ray { self.graphics.add_ray(Ray::new(start, self.cursor_pos - start)); } self.drawing_ray = None; self.grabbed_object = None; self.grabbed_object_constraint = None; } WindowEvent::CursorPos(x, y, modifiers) => { let physics_world = &mut self.world.get_mut(); self.cursor_pos.x = x as f32; self.cursor_pos.y = y as f32; self.cursor_pos = self .graphics .camera() .unproject(&self.cursor_pos, &na::convert(window.size())); let attach2 = self.cursor_pos; if self.grabbed_object.is_some() { let joint = self.grabbed_object_constraint.unwrap(); let joint = physics_world .constraint_mut(joint) .downcast_mut::<MouseConstraint<f32>>() .unwrap(); joint.set_anchor_1(attach2); } event.inhibited = modifiers.contains(Modifiers::Control) || modifiers.contains(Modifiers::Shift); } WindowEvent::Key(Key::T, Action::Release, _) => { if self.running == RunMode::Stop { self.running = RunMode::Running; } else { self.running = RunMode::Stop; } } WindowEvent::Key(Key::S, Action::Release, _) => self.running = RunMode::Step, // WindowEvent::Key(Key::B, _, Action::Release, _) => { // // XXX: there is a bug on kiss3d with the removal of objects. // // draw_aabbs = !draw_aabbs; // // if draw_aabbs { // // graphics.enable_aabb_draw(window); // // } // // else { // // graphics.disable_aabb_draw(window); // // } // }, WindowEvent::Key(Key::Space, Action::Release, _) => { let physics_world = &mut self.world.get_mut(); self.draw_colls = !self.draw_colls; for co in physics_world.colliders() { // FIXME: ugly clone. if let Some(ns) = self.graphics.body_nodes_mut(co.body()) { for n in ns.iter_mut() { if let Some(node) = n.scene_node_mut() { if self.draw_colls { node.set_lines_width(1.0); node.set_surface_rendering_activation(false); } else { node.set_lines_width(0.0); node.set_surface_rendering_activation(true); } } } } } } // WindowEvent::Key(Key::Num1, _, Action::Press, _) => { // let mut graphics = self.graphics; // let geom = Ball::new(0.5f32); // let mut rb = RigidBody::new_dynamic(geom, 4.0f32, 0.3, 0.6); // let cam_transfom; // { // let cam = graphics.camera(); // cam_transfom = cam.view_transform().inverse() // } // rb.append_translation(&cam_transfom.translation); // let front = cam_transfom.rotation * -Vector3::z(); // rb.set_lin_vel(front * 40.0f32); // let body = self.world.add_rigid_body(rb); // graphics.add(window, body, &self.world.rigid_bodies()); // }, // WindowEvent::Key(Key::Num2, _, Action::Press, _) => { // let mut graphics = self.graphics; // let geom = Cuboid::new(Vector3::new(0.5f32, 0.5, 0.5)); // let mut rb = RigidBody::new_dynamic(geom, 4.0f32, 0.3, 0.6); // let cam_transform; // { // let cam = graphics.camera(); // cam_transform = cam.view_transform().inverse() // } // rb.append_translation(&cam_transform.translation); // let front = cam_transform.rotation * -Vector3::z(); // rb.set_lin_vel(front * 40.0f32); // let body = self.world.add_rigid_body(rb); // graphics.add(window, body, &self.world.rigid_bodies()); // } _ => {} } } if self.running != RunMode::Stop { for _ in 0..self.nsteps { for f in &self.callbacks { f(&mut *self.world, &mut self.graphics, self.time) } self.world.get_mut().step(); if !self.hide_counters { #[cfg(not(feature = "log"))] println!("{}", self.world.get().performance_counters()); #[cfg(feature = "log")] debug!("{}", self.world.get().performance_counters()); } self.time += self.world.get().timestep(); } let physics_world = &self.world.get(); for co in physics_world.colliders() { if self .graphics .body_nodes_mut(co.body()) .is_none() { self.graphics.add(window, co.handle(), &physics_world); } } } self.graphics.draw(&self.world.get(), window); if self.draw_colls { draw_collisions( window, &self.world.get(), &mut self.persistant_contacts, self.running != RunMode::Stop, ); } if self.running == RunMode::Step { self.running = RunMode::Stop; } if let Some(start) = self.drawing_ray { window.draw_planar_line(&start, &self.cursor_pos, &Point3::new(1.0, 0.0, 0.0)); } let color = Point3::new(0.0, 0.0, 0.0); if true { //running != RunMode::Stop { window.draw_text( &format!( "Simulation time: {:.*}sec.", 4, self.world.get().performance_counters().step_time(), )[..], &Point2::origin(), 60.0, &self.font, &color, ); } else { window.draw_text("Paused", &Point2::origin(), 60.0, &self.font, &color); } window.draw_text(CONTROLS, &Point2::new(0.0, 75.0), 40.0, &self.font, &color); } } const CONTROLS: &str = "Controls: Ctrl + click + drag: select and move a solid. Right click + drag: pan the camera. Mouse wheel: zoom in/zoom out. T: pause/resume simulation. S: step simulation."; fn draw_collisions( window: &mut Window, world: &World<f32>, existing: &mut HashMap<GenerationalId, bool>, running: bool, ) { for (_, _, _, manifold) in world.collider_world().contact_pairs(true) { for c in manifold.contacts() { existing .entry(c.id) .and_modify(|value| { if running { *value = true } }) .or_insert(false); let color = if c.contact.depth < 0.0 {// existing[&c.id] { Point3::new(0.0, 0.0, 1.0) } else { Point3::new(1.0, 0.0, 0.0) }; window.draw_planar_line(&c.contact.world1, &c.contact.world2, &color); // let center = na::center(&c.contact.world1, &c.contact.world2); // let end = center + *c.contact.normal * 0.4f32; // window.draw_planar_line(&center, &end, &Point3::new(0.0, 1.0, 1.0)) } } }
set_collider_color
io.rs
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. /*! The `io` module contains basic input and output routines. A quick summary: ## `Reader` and `Writer` traits These traits define the minimal set of methods that anything that can do input and output should implement. ## `ReaderUtil` and `WriterUtil` traits Richer methods that allow you to do more. `Reader` only lets you read a certain number of bytes into a buffer, while `ReaderUtil` allows you to read a whole line, for example. Generally, these richer methods are probably the ones you want to actually use in day-to-day Rust. Furthermore, because there is an implementation of `ReaderUtil` for `<T: Reader>`, when your input or output code implements `Reader`, you get all of these methods for free. ## `print` and `println` These very useful functions are defined here. You generally don't need to import them, though, as the prelude already does. ## `stdin`, `stdout`, and `stderr` These functions return references to the classic three file descriptors. They implement `Reader` and `Writer`, where appropriate. */ #[allow(missing_doc)]; use cast; use cast::transmute; use clone::Clone; use c_str::ToCStr; use container::Container; use int; use iter::Iterator; use libc::consts::os::posix88::*; use libc::{c_int, c_void, size_t}; use libc; use num; use ops::Drop; use option::{Some, None}; use os; use path::Path; use ptr; use result::{Result, Ok, Err}; use str::{StrSlice, OwnedStr}; use str; use to_str::ToStr; use uint; use vec::{MutableVector, ImmutableVector, OwnedVector, OwnedCopyableVector, CopyableVector}; use vec; #[allow(non_camel_case_types)] // not sure what to do about this pub type fd_t = c_int; pub mod rustrt { use libc; #[abi = "cdecl"] #[link_name = "rustrt"] extern { pub fn rust_get_stdin() -> *libc::FILE; pub fn rust_get_stdout() -> *libc::FILE; pub fn rust_get_stderr() -> *libc::FILE; } } // Reading // FIXME (#2004): This is all buffered. We might need an unbuffered variant // as well /** * The SeekStyle enum describes the relationship between the position * we'd like to seek to from our current position. It's used as an argument * to the `seek` method defined on the `Reader` trait. * * There are three seek styles: * * 1. `SeekSet` means that the new position should become our position. * 2. `SeekCur` means that we should seek from the current position. * 3. `SeekEnd` means that we should seek from the end. * * # Examples * * None right now. */ pub enum SeekStyle { SeekSet, SeekEnd, SeekCur, } /** * The core Reader trait. All readers must implement this trait. * * # Examples * * None right now. */ pub trait Reader { // FIXME (#2004): Seekable really should be orthogonal. // FIXME (#2982): This should probably return an error. /** * Reads bytes and puts them into `bytes`, advancing the cursor. Returns the * number of bytes read. * * The number of bytes to be read is `len` or the end of the file, * whichever comes first. * * The buffer must be at least `len` bytes long. * * `read` is conceptually similar to C's `fread` function. * * # Examples * * None right now. */ fn read(&self, bytes: &mut [u8], len: uint) -> uint; /** * Reads a single byte, advancing the cursor. * * In the case of an EOF or an error, returns a negative value. * * `read_byte` is conceptually similar to C's `getc` function. * * # Examples * * None right now. */ fn read_byte(&self) -> int; /** * Returns a boolean value: are we currently at EOF? * * Note that stream position may be already at the end-of-file point, * but `eof` returns false until an attempt to read at that position. * * `eof` is conceptually similar to C's `feof` function. * * # Examples * * None right now. */ fn eof(&self) -> bool; /** * Seek to a given `position` in the stream. * * Takes an optional SeekStyle, which affects how we seek from the * position. See `SeekStyle` docs for more details. * * `seek` is conceptually similar to C's `fseek` function. * * # Examples * * None right now. */ fn seek(&self, position: int, style: SeekStyle); /** * Returns the current position within the stream. * * `tell` is conceptually similar to C's `ftell` function. * * # Examples * * None right now. */ fn tell(&self) -> uint; } impl Reader for @Reader { fn read(&self, bytes: &mut [u8], len: uint) -> uint { self.read(bytes, len) } fn read_byte(&self) -> int { self.read_byte() } fn eof(&self) -> bool { self.eof() } fn seek(&self, position: int, style: SeekStyle) { self.seek(position, style) } fn tell(&self) -> uint { self.tell() } } /** * The `ReaderUtil` trait is a home for many of the utility functions * a particular Reader should implement. * * The default `Reader` trait is focused entirely on bytes. `ReaderUtil` is based * on higher-level concepts like 'chars' and 'lines.' * * # Examples: * * None right now. */ pub trait ReaderUtil { /** * Reads `len` number of bytes, and gives you a new vector back. * * # Examples * * None right now. */ fn read_bytes(&self, len: uint) -> ~[u8]; /** * Reads up until a specific byte is seen or EOF. * * The `include` parameter specifies if the character should be included * in the returned string. * * # Examples * * None right now. */ fn read_until(&self, c: u8, include: bool) -> ~str; /** * Reads up until the first '\n' or EOF. * * The '\n' is not included in the result. * * # Examples * * None right now. */ fn read_line(&self) -> ~str; /** * Reads `n` chars. * * Assumes that those chars are UTF-8 encoded. * * The '\n' is not included in the result. * * # Examples * * None right now. */ fn read_chars(&self, n: uint) -> ~[char]; /** * Reads a single UTF-8 encoded char. * * # Examples * * None right now. */ fn read_char(&self) -> char; /** * Reads up until the first null byte or EOF. * * The null byte is not returned. * * # Examples * * None right now. */ fn read_c_str(&self) -> ~str; /** * Reads all remaining data in the stream. * * # Examples * * None right now. */ fn read_whole_stream(&self) -> ~[u8]; /** * Iterate over every byte until EOF or the iterator breaks. * * # Examples * * None right now. */ fn each_byte(&self, it: &fn(int) -> bool) -> bool; /** * Iterate over every char until EOF or the iterator breaks. * * # Examples * * None right now. */ fn each_char(&self, it: &fn(char) -> bool) -> bool; /** * Iterate over every line until EOF or the iterator breaks. * * # Examples * * None right now. */ fn each_line(&self, it: &fn(&str) -> bool) -> bool; /** * Reads all of the lines in the stream. * * Returns a vector of those lines. * * # Examples * * None right now. */ fn read_lines(&self) -> ~[~str]; /** * Reads `n` little-endian unsigned integer bytes. * * `n` must be between 1 and 8, inclusive. * * # Examples * * None right now. */ fn read_le_uint_n(&self, nbytes: uint) -> u64; /** * Reads `n` little-endian signed integer bytes. * * `n` must be between 1 and 8, inclusive. * * # Examples * * None right now. */ fn read_le_int_n(&self, nbytes: uint) -> i64; /** * Reads `n` big-endian unsigned integer bytes. * * `n` must be between 1 and 8, inclusive. * * # Examples * * None right now. */ fn read_be_uint_n(&self, nbytes: uint) -> u64; /** * Reads `n` big-endian signed integer bytes. * * `n` must be between 1 and 8, inclusive. * * # Examples * * None right now. */ fn read_be_int_n(&self, nbytes: uint) -> i64; /** * Reads a little-endian unsigned integer. * * The number of bytes returned is system-dependant. * * # Examples * * None right now. */ fn read_le_uint(&self) -> uint; /** * Reads a little-endian integer. * * The number of bytes returned is system-dependant. * * # Examples * * None right now. */ fn read_le_int(&self) -> int; /** * Reads a big-endian unsigned integer. * * The number of bytes returned is system-dependant. * * # Examples * * None right now. */ fn read_be_uint(&self) -> uint; /** * Reads a big-endian integer. * * The number of bytes returned is system-dependant. * * # Examples * * None right now. */ fn read_be_int(&self) -> int; /** * Reads a big-endian `u64`. * * `u64`s are 8 bytes long. * * # Examples * * None right now. */ fn read_be_u64(&self) -> u64; /** * Reads a big-endian `u32`. * * `u32`s are 4 bytes long. * * # Examples * * None right now. */ fn read_be_u32(&self) -> u32; /** * Reads a big-endian `u16`. * * `u16`s are 2 bytes long. * * # Examples * * None right now. */ fn read_be_u16(&self) -> u16; /** * Reads a big-endian `i64`. * * `i64`s are 8 bytes long. * * # Examples * * None right now. */ fn read_be_i64(&self) -> i64; /** * Reads a big-endian `i32`. * * `i32`s are 4 bytes long. * * # Examples * * None right now. */ fn read_be_i32(&self) -> i32; /** * Reads a big-endian `i16`. * * `i16`s are 2 bytes long. * * # Examples * * None right now. */ fn read_be_i16(&self) -> i16; /** * Reads a big-endian `f64`. * * `f64`s are 8 byte, IEEE754 double-precision floating point numbers. * * # Examples * * None right now. */ fn read_be_f64(&self) -> f64; /** * Reads a big-endian `f32`. * * `f32`s are 4 byte, IEEE754 single-precision floating point numbers. * * # Examples * * None right now. */ fn read_be_f32(&self) -> f32; /** * Reads a little-endian `u64`. * * `u64`s are 8 bytes long. * * # Examples * * None right now. */ fn read_le_u64(&self) -> u64; /** * Reads a little-endian `u32`. * * `u32`s are 4 bytes long. * * # Examples * * None right now. */ fn read_le_u32(&self) -> u32; /** * Reads a little-endian `u16`. * * `u16`s are 2 bytes long. * * # Examples * * None right now. */ fn read_le_u16(&self) -> u16; /** * Reads a little-endian `i64`. * * `i64`s are 8 bytes long. * * # Examples * * None right now. */ fn read_le_i64(&self) -> i64; /** * Reads a little-endian `i32`. * * `i32`s are 4 bytes long. * * # Examples * * None right now. */ fn read_le_i32(&self) -> i32; /** * Reads a little-endian `i16`. * * `i16`s are 2 bytes long. * * # Examples * * None right now. */ fn read_le_i16(&self) -> i16; /** * Reads a little-endian `f64`. * * `f64`s are 8 byte, IEEE754 double-precision floating point numbers. * * # Examples * * None right now. */ fn read_le_f64(&self) -> f64; /** * Reads a little-endian `f32`. * * `f32`s are 4 byte, IEEE754 single-precision floating point numbers. * * # Examples * * None right now. */ fn read_le_f32(&self) -> f32; /** * Read a u8. * * `u8`s are 1 byte. * * # Examples * * None right now. */ fn read_u8(&self) -> u8; /** * Read an i8. * * `i8`s are 1 byte. * * # Examples * * None right now. */ fn read_i8(&self) -> i8; } impl<T:Reader> ReaderUtil for T { fn read_bytes(&self, len: uint) -> ~[u8] { let mut bytes = vec::with_capacity(len); unsafe { vec::raw::set_len(&mut bytes, len); } let count = self.read(bytes, len); unsafe { vec::raw::set_len(&mut bytes, count); } bytes } fn read_until(&self, c: u8, include: bool) -> ~str { let mut bytes = ~[]; loop { let ch = self.read_byte(); if ch == -1 || ch == c as int { if include && ch == c as int { bytes.push(ch as u8); } break; } bytes.push(ch as u8); } str::from_utf8(bytes) } fn read_line(&self) -> ~str { self.read_until('\n' as u8, false) } fn read_chars(&self, n: uint) -> ~[char] { // returns the (consumed offset, n_req), appends characters to &chars fn chars_from_utf8<T:Reader>(bytes: &~[u8], chars: &mut ~[char]) -> (uint, uint) { let mut i = 0; let bytes_len = bytes.len(); while i < bytes_len { let b0 = bytes[i]; let w = str::utf8_char_width(b0); let end = i + w; i += 1; assert!((w > 0)); if w == 1 { unsafe { chars.push(transmute(b0 as u32)); } continue; } // can't satisfy this char with the existing data if end > bytes_len { return (i - 1, end - bytes_len); } let mut val = 0; while i < end { let next = bytes[i] as int; i += 1; assert!((next > -1)); assert_eq!(next & 192, 128); val <<= 6; val += (next & 63) as uint; } // See str::StrSlice::char_at val += ((b0 << ((w + 1) as u8)) as uint) << (w - 1) * 6 - w - 1u; unsafe { chars.push(transmute(val as u32)); } } return (i, 0); } let mut bytes = ~[]; let mut chars = ~[]; // might need more bytes, but reading n will never over-read let mut nbread = n; while nbread > 0 { let data = self.read_bytes(nbread); if data.is_empty() { // eof - FIXME (#2004): should we do something if // we're split in a unicode char? break; } bytes.push_all(data); let (offset, nbreq) = chars_from_utf8::<T>(&bytes, &mut chars); let ncreq = n - chars.len(); // again we either know we need a certain number of bytes // to complete a character, or we make sure we don't // over-read by reading 1-byte per char needed nbread = if ncreq > nbreq { ncreq } else { nbreq }; if nbread > 0 { bytes = bytes.slice(offset, bytes.len()).to_owned(); } } chars } fn read_char(&self) -> char { let c = self.read_chars(1); if c.len() == 0 { return unsafe { transmute(-1u32) }; // FIXME: #8971: unsound } assert_eq!(c.len(), 1); return c[0]; } fn read_c_str(&self) -> ~str { self.read_until(0u8, false) } fn read_whole_stream(&self) -> ~[u8] { let mut bytes: ~[u8] = ~[]; while !self.eof() { bytes.push_all(self.read_bytes(2048u)); } bytes } fn each_byte(&self, it: &fn(int) -> bool) -> bool { loop { match self.read_byte() { -1 => break, ch => if !it(ch) { return false; } } } return true; } fn each_char(&self, it: &fn(char) -> bool) -> bool { // FIXME: #8971: unsound let eof: char = unsafe { transmute(-1u32) }; loop { match self.read_char() { c if c == eof => break, ch => if !it(ch) { return false; } } } return true; } fn each_line(&self, it: &fn(s: &str) -> bool) -> bool { while !self.eof() { // include the \n, so that we can distinguish an entirely empty // line read after "...\n", and the trailing empty line in // "...\n\n". let mut line = self.read_until('\n' as u8, true); // blank line at the end of the reader is ignored if self.eof() && line.is_empty() { break; } // trim the \n, so that each_line is consistent with read_line let n = line.len(); if line[n-1] == '\n' as u8 { unsafe { str::raw::set_len(&mut line, n-1); } } if !it(line) { return false; } } return true; } fn read_lines(&self) -> ~[~str] { do vec::build(None) |push| { do self.each_line |line| { push(line.to_owned()); true }; } } // FIXME int reading methods need to deal with eof - issue #2004 fn read_le_uint_n(&self, nbytes: uint) -> u64 { assert!(nbytes > 0 && nbytes <= 8); let mut val = 0u64; let mut pos = 0; let mut i = nbytes; while i > 0 { val += (self.read_u8() as u64) << pos; pos += 8; i -= 1; } val } fn read_le_int_n(&self, nbytes: uint) -> i64 { extend_sign(self.read_le_uint_n(nbytes), nbytes) } fn read_be_uint_n(&self, nbytes: uint) -> u64 { assert!(nbytes > 0 && nbytes <= 8); let mut val = 0u64; let mut i = nbytes; while i > 0 { i -= 1; val += (self.read_u8() as u64) << i * 8; } val } fn read_be_int_n(&self, nbytes: uint) -> i64 { extend_sign(self.read_be_uint_n(nbytes), nbytes) } fn read_le_uint(&self) -> uint { self.read_le_uint_n(uint::bytes) as uint } fn read_le_int(&self) -> int { self.read_le_int_n(int::bytes) as int } fn read_be_uint(&self) -> uint { self.read_be_uint_n(uint::bytes) as uint } fn read_be_int(&self) -> int { self.read_be_int_n(int::bytes) as int } fn read_be_u64(&self) -> u64 { self.read_be_uint_n(8) as u64 } fn read_be_u32(&self) -> u32 { self.read_be_uint_n(4) as u32 } fn read_be_u16(&self) -> u16 { self.read_be_uint_n(2) as u16 } fn read_be_i64(&self) -> i64 { self.read_be_int_n(8) as i64 } fn read_be_i32(&self) -> i32 { self.read_be_int_n(4) as i32 } fn read_be_i16(&self) -> i16 { self.read_be_int_n(2) as i16 } fn read_be_f64(&self) -> f64 { unsafe { cast::transmute::<u64, f64>(self.read_be_u64()) } } fn read_be_f32(&self) -> f32 { unsafe { cast::transmute::<u32, f32>(self.read_be_u32()) } } fn read_le_u64(&self) -> u64 { self.read_le_uint_n(8) as u64 } fn read_le_u32(&self) -> u32 { self.read_le_uint_n(4) as u32 } fn read_le_u16(&self) -> u16 { self.read_le_uint_n(2) as u16 } fn read_le_i64(&self) -> i64 { self.read_le_int_n(8) as i64 } fn read_le_i32(&self) -> i32 { self.read_le_int_n(4) as i32 } fn read_le_i16(&self) -> i16 { self.read_le_int_n(2) as i16 } fn read_le_f64(&self) -> f64 { unsafe { cast::transmute::<u64, f64>(self.read_le_u64()) } } fn read_le_f32(&self) -> f32 { unsafe { cast::transmute::<u32, f32>(self.read_le_u32()) } } fn read_u8(&self) -> u8 { self.read_byte() as u8 } fn read_i8(&self) -> i8 { self.read_byte() as i8 } } fn extend_sign(val: u64, nbytes: uint) -> i64 { let shift = (8 - nbytes) * 8; (val << shift) as i64 >> shift } // Reader implementations fn convert_whence(whence: SeekStyle) -> i32 { return match whence { SeekSet => 0i32, SeekCur => 1i32, SeekEnd => 2i32 }; } impl Reader for *libc::FILE { fn read(&self, bytes: &mut [u8], len: uint) -> uint { #[fixed_stack_segment]; #[inline(never)]; unsafe { do bytes.as_mut_buf |buf_p, buf_len| { assert!(buf_len >= len); let count = libc::fread(buf_p as *mut c_void, 1u as size_t, len as size_t, *self) as uint; if count < len { match libc::ferror(*self) { 0 => (), _ => { error2!("error reading buffer: {}", os::last_os_error()); fail2!(); } } } count } } } fn read_byte(&self) -> int { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::fgetc(*self) as int } } fn eof(&self) -> bool { #[fixed_stack_segment]; #[inline(never)]; unsafe { return libc::feof(*self) != 0 as c_int; } } fn seek(&self, offset: int, whence: SeekStyle) { #[fixed_stack_segment]; #[inline(never)]; unsafe { assert!(libc::fseek(*self, offset as libc::c_long, convert_whence(whence)) == 0 as c_int); } } fn tell(&self) -> uint { #[fixed_stack_segment]; #[inline(never)]; unsafe { return libc::ftell(*self) as uint; } } } struct Wrapper<T, C> { base: T, cleanup: C, } // A forwarding impl of reader that also holds on to a resource for the // duration of its lifetime. // FIXME there really should be a better way to do this // #2004 impl<R:Reader,C> Reader for Wrapper<R, C> { fn read(&self, bytes: &mut [u8], len: uint) -> uint { self.base.read(bytes, len) } fn read_byte(&self) -> int { self.base.read_byte() } fn eof(&self) -> bool { self.base.eof() } fn seek(&self, off: int, whence: SeekStyle) { self.base.seek(off, whence) } fn tell(&self) -> uint { self.base.tell() } } pub struct FILERes { f: *libc::FILE, } impl FILERes { pub fn new(f: *libc::FILE) -> FILERes { FILERes { f: f } } } impl Drop for FILERes { fn drop(&mut self) { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::fclose(self.f); } } } pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader { if cleanup { @Wrapper { base: f, cleanup: FILERes::new(f) } as @Reader } else { @f as @Reader } } // FIXME (#2004): this should either be an trait-less impl, a set of // top-level functions that take a reader, or a set of default methods on // reader (which can then be called reader) /** * Gives a `Reader` that allows you to read values from standard input. * * # Example * * ```rust * let stdin = std::io::stdin(); * let line = stdin.read_line(); * std::io::print(line); * ``` */ pub fn stdin() -> @Reader { #[fixed_stack_segment]; #[inline(never)]; unsafe { @rustrt::rust_get_stdin() as @Reader } } pub fn file_reader(path: &Path) -> Result<@Reader, ~str> { #[fixed_stack_segment]; #[inline(never)]; let f = do path.with_c_str |pathbuf| { do "rb".with_c_str |modebuf| { unsafe { libc::fopen(pathbuf, modebuf as *libc::c_char) } } }; if f as uint == 0u { Err(~"error opening " + path.to_str()) } else { Ok(FILE_reader(f, true)) } } // Byte readers pub struct BytesReader { // FIXME(#5723) see other FIXME below // FIXME(#7268) this should also be parameterized over <'self> bytes: &'static [u8], pos: @mut uint } impl Reader for BytesReader { fn read(&self, bytes: &mut [u8], len: uint) -> uint { let count = num::min(len, self.bytes.len() - *self.pos); let view = self.bytes.slice(*self.pos, self.bytes.len()); vec::bytes::copy_memory(bytes, view, count); *self.pos += count; count } fn read_byte(&self) -> int { if *self.pos == self.bytes.len() { return -1; } let b = self.bytes[*self.pos]; *self.pos += 1u; b as int } fn eof(&self) -> bool { *self.pos == self.bytes.len() } fn seek(&self, offset: int, whence: SeekStyle) { let pos = *self.pos; *self.pos = seek_in_buf(offset, pos, self.bytes.len(), whence); } fn tell(&self) -> uint { *self.pos } } pub fn with_bytes_reader<T>(bytes: &[u8], f: &fn(@Reader) -> T) -> T { // XXX XXX XXX this is glaringly unsound // FIXME(#5723) Use a &Reader for the callback's argument. Should be: // fn with_bytes_reader<'r, T>(bytes: &'r [u8], f: &fn(&'r Reader) -> T) -> T let bytes: &'static [u8] = unsafe { cast::transmute(bytes) }; f(@BytesReader { bytes: bytes, pos: @mut 0 } as @Reader) } pub fn with_str_reader<T>(s: &str, f: &fn(@Reader) -> T) -> T { // FIXME(#5723): As above. with_bytes_reader(s.as_bytes(), f) } // Writing pub enum FileFlag { Append, Create, Truncate, NoFlag, } // What type of writer are we? #[deriving(Eq)] pub enum WriterType { Screen, File } // FIXME (#2004): Seekable really should be orthogonal. // FIXME (#2004): eventually u64 /// The raw underlying writer trait. All writers must implement this. pub trait Writer { /// Write all of the given bytes. fn write(&self, v: &[u8]); /// Move the current position within the stream. The second parameter /// determines the position that the first parameter is relative to. fn seek(&self, int, SeekStyle); /// Return the current position within the stream. fn tell(&self) -> uint; /// Flush the output buffer for this stream (if there is one). fn flush(&self) -> int; /// Determine if this Writer is writing to a file or not. fn get_type(&self) -> WriterType; } impl Writer for @Writer { fn write(&self, v: &[u8]) { self.write(v) } fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) } fn tell(&self) -> uint { self.tell() } fn flush(&self) -> int { self.flush() } fn get_type(&self) -> WriterType { self.get_type() } } impl<W:Writer,C> Writer for Wrapper<W, C> { fn write(&self, bs: &[u8]) { self.base.write(bs); } fn seek(&self, off: int, style: SeekStyle) { self.base.seek(off, style); } fn tell(&self) -> uint { self.base.tell() } fn flush(&self) -> int { self.base.flush() } fn get_type(&self) -> WriterType { File } } impl Writer for *libc::FILE { fn write(&self, v: &[u8]) { #[fixed_stack_segment]; #[inline(never)]; unsafe { do v.as_imm_buf |vbuf, len| { let nout = libc::fwrite(vbuf as *c_void, 1, len as size_t, *self); if nout != len as size_t { error2!("error writing buffer: {}", os::last_os_error()); fail2!(); } } } } fn seek(&self, offset: int, whence: SeekStyle) { #[fixed_stack_segment]; #[inline(never)]; unsafe { assert!(libc::fseek(*self, offset as libc::c_long, convert_whence(whence)) == 0 as c_int); } } fn tell(&self) -> uint { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::ftell(*self) as uint } } fn flush(&self) -> int { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::fflush(*self) as int } } fn get_type(&self) -> WriterType { #[fixed_stack_segment]; #[inline(never)]; unsafe { let fd = libc::fileno(*self); if libc::isatty(fd) == 0 { File } else { Screen } } } } impl Writer for fd_t { fn write(&self, v: &[u8]) { #[fixed_stack_segment]; #[inline(never)]; #[cfg(windows)] type IoSize = libc::c_uint; #[cfg(windows)] type IoRet = c_int; #[cfg(unix)] type IoSize = size_t; #[cfg(unix)] type IoRet = libc::ssize_t; unsafe { let mut count = 0u; do v.as_imm_buf |vbuf, len| { while count < len { let vb = ptr::offset(vbuf, count as int) as *c_void; let nout = libc::write(*self, vb, len as IoSize); if nout < 0 as IoRet { error2!("error writing buffer: {}", os::last_os_error()); fail2!(); } count += nout as uint; } } } } fn seek(&self, _offset: int, _whence: SeekStyle) { error2!("need 64-bit foreign calls for seek, sorry"); fail2!(); } fn tell(&self) -> uint { error2!("need 64-bit foreign calls for tell, sorry"); fail2!(); } fn flush(&self) -> int { 0 } fn get_type(&self) -> WriterType { #[fixed_stack_segment]; #[inline(never)]; unsafe { if libc::isatty(*self) == 0 { File } else { Screen } } } } pub struct FdRes { fd: fd_t, } impl FdRes { pub fn new(fd: fd_t) -> FdRes { FdRes { fd: fd } } } impl Drop for FdRes { fn drop(&mut self) { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::close(self.fd); } } } pub fn fd_writer(fd: fd_t, cleanup: bool) -> @Writer { if cleanup { @Wrapper { base: fd, cleanup: FdRes::new(fd) } as @Writer } else { @fd as @Writer } } pub fn mk_file_writer(path: &Path, flags: &[FileFlag]) -> Result<@Writer, ~str> { #[fixed_stack_segment]; #[inline(never)]; #[cfg(windows)] fn wb() -> c_int { (O_WRONLY | libc::consts::os::extra::O_BINARY) as c_int } #[cfg(unix)] fn wb() -> c_int { O_WRONLY as c_int } let mut fflags: c_int = wb(); for f in flags.iter() { match *f { Append => fflags |= O_APPEND as c_int, Create => fflags |= O_CREAT as c_int, Truncate => fflags |= O_TRUNC as c_int, NoFlag => () } } let fd = unsafe { do path.with_c_str |pathbuf| { libc::open(pathbuf, fflags, (S_IRUSR | S_IWUSR) as c_int) } }; if fd < (0 as c_int) { Err(format!("error opening {}: {}", path.to_str(), os::last_os_error())) } else { Ok(fd_writer(fd, true)) } } pub fn u64_to_le_bytes<T>(n: u64, size: uint, f: &fn(v: &[u8]) -> T) -> T { assert!(size <= 8u); match size { 1u => f(&[n as u8]), 2u => f(&[n as u8, (n >> 8) as u8]), 4u => f(&[n as u8, (n >> 8) as u8, (n >> 16) as u8, (n >> 24) as u8]), 8u => f(&[n as u8, (n >> 8) as u8, (n >> 16) as u8, (n >> 24) as u8, (n >> 32) as u8, (n >> 40) as u8, (n >> 48) as u8, (n >> 56) as u8]), _ => { let mut bytes: ~[u8] = ~[]; let mut i = size; let mut n = n; while i > 0u { bytes.push((n & 255_u64) as u8); n >>= 8_u64; i -= 1u; } f(bytes) } } } pub fn u64_to_be_bytes<T>(n: u64, size: uint, f: &fn(v: &[u8]) -> T) -> T { assert!(size <= 8u); match size { 1u => f(&[n as u8]), 2u => f(&[(n >> 8) as u8, n as u8]), 4u => f(&[(n >> 24) as u8, (n >> 16) as u8, (n >> 8) as u8, n as u8]), 8u => f(&[(n >> 56) as u8, (n >> 48) as u8, (n >> 40) as u8, (n >> 32) as u8, (n >> 24) as u8, (n >> 16) as u8, (n >> 8) as u8, n as u8]), _ => { let mut bytes: ~[u8] = ~[]; let mut i = size; while i > 0u { let shift = ((i - 1u) * 8u) as u64; bytes.push((n >> shift) as u8); i -= 1u; } f(bytes) } } } pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 { let mut sz = size; assert!((sz <= 8u)); let mut val = 0_u64; let mut pos = start; while sz > 0u { sz -= 1u; val += (data[pos] as u64) << ((sz * 8u) as u64); pos += 1u; } return val; } // FIXME: #3048 combine trait+impl (or just move these to // default methods on writer) /// Generic utility functions defined on writers. pub trait WriterUtil { /// Write a single utf-8 encoded char. fn write_char(&self, ch: char); /// Write every char in the given str, encoded as utf-8. fn write_str(&self, s: &str); /// Write the given str, as utf-8, followed by '\n'. fn write_line(&self, s: &str); /// Write the result of passing n through `int::to_str_bytes`. fn write_int(&self, n: int); /// Write the result of passing n through `uint::to_str_bytes`. fn write_uint(&self, n: uint); /// Write a little-endian uint (number of bytes depends on system). fn write_le_uint(&self, n: uint); /// Write a little-endian int (number of bytes depends on system). fn write_le_int(&self, n: int); /// Write a big-endian uint (number of bytes depends on system). fn write_be_uint(&self, n: uint); /// Write a big-endian int (number of bytes depends on system). fn write_be_int(&self, n: int); /// Write a big-endian u64 (8 bytes). fn write_be_u64(&self, n: u64); /// Write a big-endian u32 (4 bytes). fn write_be_u32(&self, n: u32); /// Write a big-endian u16 (2 bytes). fn write_be_u16(&self, n: u16); /// Write a big-endian i64 (8 bytes). fn write_be_i64(&self, n: i64); /// Write a big-endian i32 (4 bytes). fn write_be_i32(&self, n: i32); /// Write a big-endian i16 (2 bytes). fn write_be_i16(&self, n: i16); /// Write a big-endian IEEE754 double-precision floating-point (8 bytes). fn write_be_f64(&self, f: f64); /// Write a big-endian IEEE754 single-precision floating-point (4 bytes). fn write_be_f32(&self, f: f32); /// Write a little-endian u64 (8 bytes). fn write_le_u64(&self, n: u64); /// Write a little-endian u32 (4 bytes). fn write_le_u32(&self, n: u32); /// Write a little-endian u16 (2 bytes). fn write_le_u16(&self, n: u16); /// Write a little-endian i64 (8 bytes). fn write_le_i64(&self, n: i64); /// Write a little-endian i32 (4 bytes). fn write_le_i32(&self, n: i32); /// Write a little-endian i16 (2 bytes). fn write_le_i16(&self, n: i16); /// Write a little-endian IEEE754 double-precision floating-point /// (8 bytes). fn write_le_f64(&self, f: f64); /// Write a little-endian IEEE754 single-precision floating-point /// (4 bytes). fn write_le_f32(&self, f: f32); /// Write a u8 (1 byte). fn write_u8(&self, n: u8); /// Write a i8 (1 byte). fn write_i8(&self, n: i8); } impl<T:Writer> WriterUtil for T { fn write_char(&self, ch: char) { if (ch as uint) < 128u { self.write(&[ch as u8]); } else { self.write_str(str::from_char(ch)); } } fn write_str(&self, s: &str) { self.write(s.as_bytes()) } fn write_line(&self, s: &str) { self.write_str(s); self.write_str(&"\n"); } fn write_int(&self, n: int) { int::to_str_bytes(n, 10u, |bytes| self.write(bytes)) } fn write_uint(&self, n: uint) { uint::to_str_bytes(n, 10u, |bytes| self.write(bytes)) } fn write_le_uint(&self, n: uint) { u64_to_le_bytes(n as u64, uint::bytes, |v| self.write(v)) } fn write_le_int(&self, n: int) { u64_to_le_bytes(n as u64, int::bytes, |v| self.write(v)) } fn write_be_uint(&self, n: uint) { u64_to_be_bytes(n as u64, uint::bytes, |v| self.write(v)) } fn write_be_int(&self, n: int) { u64_to_be_bytes(n as u64, int::bytes, |v| self.write(v)) } fn write_be_u64(&self, n: u64) { u64_to_be_bytes(n, 8u, |v| self.write(v)) } fn write_be_u32(&self, n: u32) { u64_to_be_bytes(n as u64, 4u, |v| self.write(v)) } fn write_be_u16(&self, n: u16) { u64_to_be_bytes(n as u64, 2u, |v| self.write(v)) } fn write_be_i64(&self, n: i64) { u64_to_be_bytes(n as u64, 8u, |v| self.write(v)) } fn write_be_i32(&self, n: i32) { u64_to_be_bytes(n as u64, 4u, |v| self.write(v)) } fn write_be_i16(&self, n: i16) { u64_to_be_bytes(n as u64, 2u, |v| self.write(v)) } fn write_be_f64(&self, f:f64) { unsafe { self.write_be_u64(cast::transmute(f)) } } fn write_be_f32(&self, f:f32) { unsafe { self.write_be_u32(cast::transmute(f)) } } fn write_le_u64(&self, n: u64) { u64_to_le_bytes(n, 8u, |v| self.write(v)) } fn write_le_u32(&self, n: u32) { u64_to_le_bytes(n as u64, 4u, |v| self.write(v)) } fn write_le_u16(&self, n: u16) { u64_to_le_bytes(n as u64, 2u, |v| self.write(v)) } fn write_le_i64(&self, n: i64) { u64_to_le_bytes(n as u64, 8u, |v| self.write(v)) } fn write_le_i32(&self, n: i32) { u64_to_le_bytes(n as u64, 4u, |v| self.write(v)) } fn write_le_i16(&self, n: i16) { u64_to_le_bytes(n as u64, 2u, |v| self.write(v)) } fn write_le_f64(&self, f:f64) { unsafe { self.write_le_u64(cast::transmute(f)) } } fn write_le_f32(&self, f:f32) { unsafe { self.write_le_u32(cast::transmute(f)) } } fn write_u8(&self, n: u8) { self.write([n]) } fn write_i8(&self, n: i8) { self.write([n as u8]) } } pub fn file_writer(path: &Path, flags: &[FileFlag]) -> Result<@Writer, ~str> { mk_file_writer(path, flags).and_then(|w| Ok(w)) } // FIXME (#2004) it would be great if this could be a const // FIXME (#2004) why are these different from the way stdin() is // implemented? /** * Gives a `Writer` which allows you to write to the standard output. * * # Example * * ```rust * let stdout = std::io::stdout(); * stdout.write_str("hello\n"); * ``` */ pub fn stdout() -> @Writer { fd_writer(libc::STDOUT_FILENO as c_int, false) } /** * Gives a `Writer` which allows you to write to standard error. * * # Example * * ```rust * let stderr = std::io::stderr(); * stderr.write_str("hello\n"); * ``` */ pub fn stderr() -> @Writer { fd_writer(libc::STDERR_FILENO as c_int, false) } /** * Prints a string to standard output. * * This string will not have an implicit newline at the end. If you want * an implicit newline, please see `println`. * * # Example * * ```rust * // print is imported into the prelude, and so is always available. * print("hello"); * ``` */ pub fn print(s: &str) { stdout().write_str(s); } /** * Prints a string to standard output, followed by a newline. * * If you do not want an implicit newline, please see `print`. * * # Example * * ```rust * // println is imported into the prelude, and so is always available. * println("hello"); * ``` */ pub fn println(s: &str) { stdout().write_line(s); } pub struct BytesWriter { bytes: @mut ~[u8], pos: @mut uint, } impl BytesWriter { pub fn new() -> BytesWriter { BytesWriter { bytes: @mut ~[], pos: @mut 0 } } } impl Writer for BytesWriter { fn write(&self, v: &[u8]) { let v_len = v.len(); let bytes = &mut *self.bytes; let count = num::max(bytes.len(), *self.pos + v_len); bytes.reserve(count); unsafe { vec::raw::set_len(bytes, count); let view = bytes.mut_slice(*self.pos, count); vec::bytes::copy_memory(view, v, v_len); } *self.pos += v_len; } fn seek(&self, offset: int, whence: SeekStyle) { let pos = *self.pos; let len = self.bytes.len(); *self.pos = seek_in_buf(offset, pos, len, whence); } fn tell(&self) -> uint { *self.pos } fn flush(&self) -> int { 0 } fn get_type(&self) -> WriterType { File } } pub fn with_bytes_writer(f: &fn(@Writer)) -> ~[u8] { let wr = @BytesWriter::new(); f(wr as @Writer); let @BytesWriter { bytes, _ } = wr; (*bytes).clone() } pub fn with_str_writer(f: &fn(@Writer)) -> ~str { str::from_utf8(with_bytes_writer(f)) } // Utility functions pub fn seek_in_buf(offset: int, pos: uint, len: uint, whence: SeekStyle) -> uint { let mut bpos = pos as int; let blen = len as int; match whence { SeekSet => bpos = offset, SeekCur => bpos += offset, SeekEnd => bpos = blen + offset } if bpos < 0 { bpos = 0; } else if bpos > blen { bpos = blen; } return bpos as uint; } pub fn read_whole_file_str(file: &Path) -> Result<~str, ~str> { do read_whole_file(file).and_then |bytes| { if str::is_utf8(bytes) { Ok(str::from_utf8(bytes)) } else { Err(file.to_str() + " is not UTF-8") } } } // FIXME (#2004): implement this in a low-level way. Going through the // abstractions is pointless. pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> { do file_reader(file).and_then |rdr| { Ok(rdr.read_whole_stream()) } } // fsync related pub mod fsync { use io::{FILERes, FdRes, fd_t}; use libc; use ops::Drop; use option::{None, Option, Some}; use os; pub enum Level { // whatever fsync does on that platform FSync, // fdatasync on linux, similiar or more on other platforms FDataSync, // full fsync // // You must additionally sync the parent directory as well! FullFSync, } // Artifacts that need to fsync on destruction pub struct Res<t> { arg: Arg<t>, } impl <t> Res<t> { pub fn new(arg: Arg<t>) -> Res<t> { Res { arg: arg } } } #[unsafe_destructor] impl<T> Drop for Res<T> { fn drop(&mut self) { match self.arg.opt_level {
// fail hard if not succesful assert!(((self.arg.fsync_fn)(&self.arg.val, level) != -1)); } } } } pub struct Arg<t> { val: t, opt_level: Option<Level>, fsync_fn: extern "Rust" fn(f: &t, Level) -> int, } // fsync file after executing blk // FIXME (#2004) find better way to create resources within lifetime of // outer res pub fn FILE_res_sync(file: &FILERes, opt_level: Option<Level>, blk: &fn(v: Res<*libc::FILE>)) { blk(Res::new(Arg { val: file.f, opt_level: opt_level, fsync_fn: fsync_FILE, })); fn fileno(stream: *libc::FILE) -> libc::c_int { #[fixed_stack_segment]; #[inline(never)]; unsafe { libc::fileno(stream) } } fn fsync_FILE(stream: &*libc::FILE, level: Level) -> int { fsync_fd(fileno(*stream), level) } } // fsync fd after executing blk pub fn fd_res_sync(fd: &FdRes, opt_level: Option<Level>, blk: &fn(v: Res<fd_t>)) { blk(Res::new(Arg { val: fd.fd, opt_level: opt_level, fsync_fn: fsync_fd_helper, })); } fn fsync_fd(fd: libc::c_int, level: Level) -> int { #[fixed_stack_segment]; #[inline(never)]; os::fsync_fd(fd, level) as int } fn fsync_fd_helper(fd_ptr: &libc::c_int, level: Level) -> int { fsync_fd(*fd_ptr, level) } // Type of objects that may want to fsync pub trait FSyncable { fn fsync(&self, l: Level) -> int; } // Call o.fsync after executing blk pub fn obj_sync(o: @FSyncable, opt_level: Option<Level>, blk: &fn(v: Res<@FSyncable>)) { blk(Res::new(Arg { val: o, opt_level: opt_level, fsync_fn: obj_fsync_fn, })); } fn obj_fsync_fn(o: &@FSyncable, level: Level) -> int { (*o).fsync(level) } } #[cfg(test)] mod tests { use prelude::*; use i32; use io::{BytesWriter, SeekCur, SeekEnd, SeekSet}; use io; use path::Path; use result::{Ok, Err}; use u64; use vec; use cast::transmute; #[test] fn test_simple() { let tmpfile = &Path("tmp/lib-io-test-simple.tmp"); debug2!("{:?}", tmpfile); let frood: ~str = ~"A hoopy frood who really knows where his towel is."; debug2!("{}", frood.clone()); { let out = io::file_writer(tmpfile, [io::Create, io::Truncate]).unwrap(); out.write_str(frood); } let inp = io::file_reader(tmpfile).unwrap(); let frood2: ~str = inp.read_c_str(); debug2!("{}", frood2.clone()); assert_eq!(frood, frood2); } #[test] fn test_each_byte_each_char_file() { // Issue #5056 -- shouldn't include trailing EOF. let path = Path("tmp/lib-io-test-each-byte-each-char-file.tmp"); { // create empty, enough to reproduce a problem io::file_writer(&path, [io::Create]).unwrap(); } { let file = io::file_reader(&path).unwrap(); do file.each_byte() |_| { fail2!("must be empty") }; } { let file = io::file_reader(&path).unwrap(); do file.each_char() |_| { fail2!("must be empty") }; } } #[test] fn test_readchars_empty() { do io::with_str_reader("") |inp| { let res : ~[char] = inp.read_chars(128); assert_eq!(res.len(), 0); } } #[test] fn test_read_line_utf8() { do io::with_str_reader("生锈的汤匙切肉汤hello生锈的汤匙切肉汤") |inp| { let line = inp.read_line(); assert_eq!(line, ~"生锈的汤匙切肉汤hello生锈的汤匙切肉汤"); } } #[test] fn test_read_lines() { do io::with_str_reader("a\nb\nc\n") |inp| { assert_eq!(inp.read_lines(), ~[~"a", ~"b", ~"c"]); } do io::with_str_reader("a\nb\nc") |inp| { assert_eq!(inp.read_lines(), ~[~"a", ~"b", ~"c"]); } do io::with_str_reader("") |inp| { assert!(inp.read_lines().is_empty()); } } #[test] fn test_readchars_wide() { let wide_test = ~"生锈的汤匙切肉汤hello生锈的汤匙切肉汤"; let ivals : ~[int] = ~[ 29983, 38152, 30340, 27748, 21273, 20999, 32905, 27748, 104, 101, 108, 108, 111, 29983, 38152, 30340, 27748, 21273, 20999, 32905, 27748]; fn check_read_ln(len : uint, s: &str, ivals: &[int]) { do io::with_str_reader(s) |inp| { let res : ~[char] = inp.read_chars(len); if len <= ivals.len() { assert_eq!(res.len(), len); } for (iv, c) in ivals.iter().zip(res.iter()) { assert!(*iv == *c as int) } } } let mut i = 0; while i < 8 { check_read_ln(i, wide_test, ivals); i += 1; } // check a long read for good measure check_read_ln(128, wide_test, ivals); } #[test] fn test_readchar() { do io::with_str_reader("生") |inp| { let res = inp.read_char(); assert_eq!(res as int, 29983); } } #[test] fn test_readchar_empty() { do io::with_str_reader("") |inp| { let res = inp.read_char(); assert_eq!(res, unsafe { transmute(-1u32) }); // FIXME: #8971: unsound } } #[test] fn file_reader_not_exist() { match io::file_reader(&Path("not a file")) { Err(e) => { assert_eq!(e, ~"error opening not a file"); } Ok(_) => fail2!() } } #[test] #[should_fail] fn test_read_buffer_too_small() { let path = &Path("tmp/lib-io-test-read-buffer-too-small.tmp"); // ensure the file exists io::file_writer(path, [io::Create]).unwrap(); let file = io::file_reader(path).unwrap(); let mut buf = vec::from_elem(5, 0u8); file.read(buf, 6); // this should fail because buf is too small } #[test] fn test_read_buffer_big_enough() { let path = &Path("tmp/lib-io-test-read-buffer-big-enough.tmp"); // ensure the file exists io::file_writer(path, [io::Create]).unwrap(); let file = io::file_reader(path).unwrap(); let mut buf = vec::from_elem(5, 0u8); file.read(buf, 4); // this should succeed because buf is big enough } #[test] fn test_write_empty() { let file = io::file_writer(&Path("tmp/lib-io-test-write-empty.tmp"), [io::Create]).unwrap(); file.write([]); } #[test] fn file_writer_bad_name() { match io::file_writer(&Path("?/?"), []) { Err(e) => { assert!(e.starts_with("error opening")); } Ok(_) => fail2!() } } #[test] fn bytes_buffer_overwrite() { let wr = BytesWriter::new(); wr.write([0u8, 1u8, 2u8, 3u8]); assert!(*wr.bytes == ~[0u8, 1u8, 2u8, 3u8]); wr.seek(-2, SeekCur); wr.write([4u8, 5u8, 6u8, 7u8]); assert!(*wr.bytes == ~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]); wr.seek(-2, SeekEnd); wr.write([8u8]); wr.seek(1, SeekSet); wr.write([9u8]); assert!(*wr.bytes == ~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]); } #[test] fn test_read_write_le() { let path = Path("tmp/lib-io-test-read-write-le.tmp"); let uints = [0, 1, 2, 42, 10_123, 100_123_456, u64::max_value]; // write the ints to the file { let file = io::file_writer(&path, [io::Create]).unwrap(); for i in uints.iter() { file.write_le_u64(*i); } } // then read them back and check that they are the same { let file = io::file_reader(&path).unwrap(); for i in uints.iter() { assert_eq!(file.read_le_u64(), *i); } } } #[test] fn test_read_write_be() { let path = Path("tmp/lib-io-test-read-write-be.tmp"); let uints = [0, 1, 2, 42, 10_123, 100_123_456, u64::max_value]; // write the ints to the file { let file = io::file_writer(&path, [io::Create]).unwrap(); for i in uints.iter() { file.write_be_u64(*i); } } // then read them back and check that they are the same { let file = io::file_reader(&path).unwrap(); for i in uints.iter() { assert_eq!(file.read_be_u64(), *i); } } } #[test] fn test_read_be_int_n() { let path = Path("tmp/lib-io-test-read-be-int-n.tmp"); let ints = [i32::min_value, -123456, -42, -5, 0, 1, i32::max_value]; // write the ints to the file { let file = io::file_writer(&path, [io::Create]).unwrap(); for i in ints.iter() { file.write_be_i32(*i); } } // then read them back and check that they are the same { let file = io::file_reader(&path).unwrap(); for i in ints.iter() { // this tests that the sign extension is working // (comparing the values as i32 would not test this) assert_eq!(file.read_be_int_n(4), *i as i64); } } } #[test] fn test_read_f32() { let path = Path("tmp/lib-io-test-read-f32.tmp"); //big-endian floating-point 8.1250 let buf = ~[0x41, 0x02, 0x00, 0x00]; { let file = io::file_writer(&path, [io::Create]).unwrap(); file.write(buf); } { let file = io::file_reader(&path).unwrap(); let f = file.read_be_f32(); assert_eq!(f, 8.1250); } } #[test] fn test_read_write_f32() { let path = Path("tmp/lib-io-test-read-write-f32.tmp"); let f:f32 = 8.1250; { let file = io::file_writer(&path, [io::Create]).unwrap(); file.write_be_f32(f); file.write_le_f32(f); } { let file = io::file_reader(&path).unwrap(); assert_eq!(file.read_be_f32(), 8.1250); assert_eq!(file.read_le_f32(), 8.1250); } } }
None => (), Some(level) => {
test_trading_fee.py
""" Tests for trading_fee.py module. """ import unittest from nowtrade.trading_fee import StaticFee class TestTradingFees(unittest.TestCase): """ Tests trading_fee.py classes. """ def
(self): """ Simple test for all trading fees. """ trading_fee = StaticFee(5) self.assertEquals(trading_fee.__repr__(), 'StaticFee(fee=5)') self.assertEquals(trading_fee.get_fee(100, 1), 5) if __name__ == "__main__": unittest.main()
test_trading_fees
delete_subscription_instance.go
package dts //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" ) // DeleteSubscriptionInstance invokes the dts.DeleteSubscriptionInstance API synchronously func (client *Client) DeleteSubscriptionInstance(request *DeleteSubscriptionInstanceRequest) (response *DeleteSubscriptionInstanceResponse, err error) { response = CreateDeleteSubscriptionInstanceResponse() err = client.DoAction(request, response) return } // DeleteSubscriptionInstanceWithChan invokes the dts.DeleteSubscriptionInstance API asynchronously func (client *Client) DeleteSubscriptionInstanceWithChan(request *DeleteSubscriptionInstanceRequest) (<-chan *DeleteSubscriptionInstanceResponse, <-chan error) { responseChan := make(chan *DeleteSubscriptionInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteSubscriptionInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteSubscriptionInstanceWithCallback invokes the dts.DeleteSubscriptionInstance API asynchronously func (client *Client) DeleteSubscriptionInstanceWithCallback(request *DeleteSubscriptionInstanceRequest, callback func(response *DeleteSubscriptionInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteSubscriptionInstanceResponse var err error defer close(result) response, err = client.DeleteSubscriptionInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteSubscriptionInstanceRequest is the request struct for api DeleteSubscriptionInstance type DeleteSubscriptionInstanceRequest struct { *requests.RpcRequest SubscriptionInstanceId string `position:"Query" name:"SubscriptionInstanceId"` OwnerId string `position:"Query" name:"OwnerId"` AccountId string `position:"Query" name:"AccountId"` } // DeleteSubscriptionInstanceResponse is the response struct for api DeleteSubscriptionInstance type DeleteSubscriptionInstanceResponse struct { *responses.BaseResponse ErrCode string `json:"ErrCode" xml:"ErrCode"` ErrMessage string `json:"ErrMessage" xml:"ErrMessage"` RequestId string `json:"RequestId" xml:"RequestId"` Success string `json:"Success" xml:"Success"` } // CreateDeleteSubscriptionInstanceRequest creates a request to invoke DeleteSubscriptionInstance API func CreateDeleteSubscriptionInstanceRequest() (request *DeleteSubscriptionInstanceRequest)
// CreateDeleteSubscriptionInstanceResponse creates a response to parse from DeleteSubscriptionInstance response func CreateDeleteSubscriptionInstanceResponse() (response *DeleteSubscriptionInstanceResponse) { response = &DeleteSubscriptionInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{ request = &DeleteSubscriptionInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Dts", "2020-01-01", "DeleteSubscriptionInstance", "dts", "openAPI") request.Method = requests.POST return }
range.go
package v1alpha3 import ( "fmt" "github.com/emicklei/go-restful" "github.com/fearlesschenc/kubesphere/pkg/monitoring" "strconv" "time" ) type timeRange struct { Time time.Time Range monitoring.Range isRange bool } func (tr timeRange) IsRange() bool { return tr.isRange } func newTimeRange(ts, start, end, step string) (*timeRange, error)
func parseTimeRange(request *restful.Request) (*timeRange, error) { ts := request.QueryParameter("time") start := request.QueryParameter("start") end := request.QueryParameter("end") step := request.QueryParameter("step") return newTimeRange(ts, start, end, step) }
{ var tr timeRange var err error var timestamp int64 // range queryMetrics if start != "" && end != "" { timestamp, err = strconv.ParseInt(start, 10, 64) if err != nil { return nil, err } tr.Range.Start = time.Unix(timestamp, 0) timestamp, err = strconv.ParseInt(end, 10, 64) if err != nil { return nil, err } tr.Range.End = time.Unix(timestamp, 0) if tr.Range.Start.After(tr.Range.End) { return nil, fmt.Errorf("invalid time range") } tr.Range.Step = 10 * time.Minute if step != "" { if tr.Range.Step, err = time.ParseDuration(step); err != nil { return nil, err } } tr.isRange = true return &tr, nil } // instant queryMetrics tr.Time = time.Now() if ts != "" { timestamp, err = strconv.ParseInt(ts, 10, 64) if err != nil { return nil, err } tr.Time = time.Unix(timestamp, 0) } tr.isRange = false return &tr, nil }
test_geom_methods.py
import string import numpy as np from numpy.testing import assert_array_equal from pandas import DataFrame, MultiIndex, Series from shapely.geometry import LinearRing, LineString, MultiPoint, Point, Polygon from shapely.geometry.collection import GeometryCollection from shapely.ops import unary_union from geopandas import GeoDataFrame, GeoSeries from geopandas.base import GeoPandasBase from geopandas.tests.util import assert_geoseries_equal, geom_almost_equals, geom_equals from pandas.testing import assert_frame_equal, assert_series_equal import pytest def assert_array_dtype_equal(a, b, *args, **kwargs): a = np.asanyarray(a) b = np.asanyarray(b) assert a.dtype == b.dtype assert_array_equal(a, b, *args, **kwargs) class TestGeomMethods: def setup_method(self): self.t1 = Polygon([(0, 0), (1, 0), (1, 1)]) self.t2 = Polygon([(0, 0), (1, 1), (0, 1)]) self.t3 = Polygon([(2, 0), (3, 0), (3, 1)]) self.sq = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) self.inner_sq = Polygon( [(0.25, 0.25), (0.75, 0.25), (0.75, 0.75), (0.25, 0.75)] ) self.nested_squares = Polygon(self.sq.boundary, [self.inner_sq.boundary]) self.p0 = Point(5, 5) self.p3d = Point(5, 5, 5) self.g0 = GeoSeries( [ self.t1, self.t2, self.sq, self.inner_sq, self.nested_squares, self.p0, None, ] ) self.g1 = GeoSeries([self.t1, self.sq]) self.g2 = GeoSeries([self.sq, self.t1]) self.g3 = GeoSeries([self.t1, self.t2]) self.g3.crs = "epsg:4326" self.g4 = GeoSeries([self.t2, self.t1]) self.g4.crs = "epsg:4326" self.g_3d = GeoSeries([self.p0, self.p3d]) self.na = GeoSeries([self.t1, self.t2, Polygon()]) self.na_none = GeoSeries([self.t1, None]) self.a1 = self.g1.copy() self.a1.index = ["A", "B"] self.a2 = self.g2.copy() self.a2.index = ["B", "C"] self.esb = Point(-73.9847, 40.7484) self.sol = Point(-74.0446, 40.6893) self.landmarks = GeoSeries([self.esb, self.sol], crs="epsg:4326") self.l1 = LineString([(0, 0), (0, 1), (1, 1)]) self.l2 = LineString([(0, 0), (1, 0), (1, 1), (0, 1)]) self.g5 = GeoSeries([self.l1, self.l2]) self.g6 = GeoSeries([self.p0, self.t3]) self.empty = GeoSeries([]) self.all_none = GeoSeries([None, None]) self.empty_poly = Polygon() # Crossed lines self.l3 = LineString([(0, 0), (1, 1)]) self.l4 = LineString([(0, 1), (1, 0)]) self.crossed_lines = GeoSeries([self.l3, self.l4]) # Placeholder for testing, will just drop in different geometries # when needed self.gdf1 = GeoDataFrame( {"geometry": self.g1, "col0": [1.0, 2.0], "col1": ["geo", "pandas"]} ) self.gdf2 = GeoDataFrame( {"geometry": self.g1, "col3": [4, 5], "col4": ["rand", "string"]} ) self.gdf3 = GeoDataFrame( {"geometry": self.g3, "col3": [4, 5], "col4": ["rand", "string"]} ) def _test_unary_real(self, op, expected, a): """ Tests for 'area', 'length', 'is_valid', etc. """ fcmp = assert_series_equal self._test_unary(op, expected, a, fcmp) def _test_unary_topological(self, op, expected, a): if isinstance(expected, GeoPandasBase): fcmp = assert_geoseries_equal else: def fcmp(a, b): assert a.equals(b) self._test_unary(op, expected, a, fcmp) def _test_binary_topological(self, op, expected, a, b, *args, **kwargs): """ Tests for 'intersection', 'union', 'symmetric_difference', etc. """ if isinstance(expected, GeoPandasBase): fcmp = assert_geoseries_equal else: def fcmp(a, b): assert geom_equals(a, b) if isinstance(b, GeoPandasBase): right_df = True else: right_df = False self._binary_op_test(op, expected, a, b, fcmp, True, right_df, *args, **kwargs) def _test_binary_real(self, op, expected, a, b, *args, **kwargs): fcmp = assert_series_equal self._binary_op_test(op, expected, a, b, fcmp, True, False, *args, **kwargs) def _test_binary_operator(self, op, expected, a, b): """ The operators only have GeoSeries on the left, but can have GeoSeries or GeoDataFrame on the right. If GeoDataFrame is on the left, geometry column is used. """ if isinstance(expected, GeoPandasBase): fcmp = assert_geoseries_equal else: def fcmp(a, b): assert geom_equals(a, b) if isinstance(b, GeoPandasBase): right_df = True else: right_df = False self._binary_op_test(op, expected, a, b, fcmp, False, right_df) def _binary_op_test( self, op, expected, left, right, fcmp, left_df, right_df, *args, **kwargs ): """ This is a helper to call a function on GeoSeries and GeoDataFrame arguments. For example, 'intersection' is a member of both GeoSeries and GeoDataFrame and can take either GeoSeries or GeoDataFrame inputs. This function has the ability to test all four combinations of input types. Parameters ---------- expected : str The operation to be tested. e.g., 'intersection' left: GeoSeries right: GeoSeries fcmp: function Called with the result of the operation and expected. It should assert if the result is incorrect left_df: bool If the left input should also be called with a GeoDataFrame right_df: bool Indicates whether the right input should be called with a GeoDataFrame """ def _make_gdf(s): n = len(s) col1 = string.ascii_lowercase[:n] col2 = range(n) return GeoDataFrame( {"geometry": s.values, "col1": col1, "col2": col2}, index=s.index, crs=s.crs, ) # Test GeoSeries.op(GeoSeries) result = getattr(left, op)(right, *args, **kwargs) fcmp(result, expected) if left_df: # Test GeoDataFrame.op(GeoSeries) gdf_left = _make_gdf(left) result = getattr(gdf_left, op)(right, *args, **kwargs) fcmp(result, expected) if right_df: # Test GeoSeries.op(GeoDataFrame) gdf_right = _make_gdf(right) result = getattr(left, op)(gdf_right, *args, **kwargs) fcmp(result, expected) if left_df: # Test GeoDataFrame.op(GeoDataFrame) result = getattr(gdf_left, op)(gdf_right, *args, **kwargs) fcmp(result, expected) def _test_unary(self, op, expected, a, fcmp): # GeoSeries, (GeoSeries or geometry) result = getattr(a, op) fcmp(result, expected) # GeoDataFrame, (GeoSeries or geometry) gdf = self.gdf1.set_geometry(a) result = getattr(gdf, op) fcmp(result, expected) # TODO reenable for all operations once we use pyproj > 2 # def test_crs_warning(self): # # operations on geometries should warn for different CRS # no_crs_g3 = self.g3.copy() # no_crs_g3.crs = None # with pytest.warns(UserWarning): # self._test_binary_topological('intersection', self.g3, # self.g3, no_crs_g3) def
(self): self._test_binary_topological("intersection", self.t1, self.g1, self.g2) with pytest.warns(UserWarning, match="The indices .+ different"): self._test_binary_topological( "intersection", self.all_none, self.g1, self.empty ) def test_union_series(self): self._test_binary_topological("union", self.sq, self.g1, self.g2) def test_union_polygon(self): self._test_binary_topological("union", self.sq, self.g1, self.t2) def test_symmetric_difference_series(self): self._test_binary_topological("symmetric_difference", self.sq, self.g3, self.g4) def test_symmetric_difference_poly(self): expected = GeoSeries([GeometryCollection(), self.sq], crs=self.g3.crs) self._test_binary_topological( "symmetric_difference", expected, self.g3, self.t1 ) def test_difference_series(self): expected = GeoSeries([GeometryCollection(), self.t2]) self._test_binary_topological("difference", expected, self.g1, self.g2) def test_difference_poly(self): expected = GeoSeries([self.t1, self.t1]) self._test_binary_topological("difference", expected, self.g1, self.t2) def test_geo_op_empty_result(self): l1 = LineString([(0, 0), (1, 1)]) l2 = LineString([(2, 2), (3, 3)]) expected = GeoSeries([GeometryCollection()]) # binary geo resulting in empty geometry result = GeoSeries([l1]).intersection(l2) assert_geoseries_equal(result, expected) # binary geo empty result with right GeoSeries result = GeoSeries([l1]).intersection(GeoSeries([l2])) assert_geoseries_equal(result, expected) # unary geo resulting in emtpy geometry result = GeoSeries([GeometryCollection()]).convex_hull assert_geoseries_equal(result, expected) def test_boundary(self): l1 = LineString([(0, 0), (1, 0), (1, 1), (0, 0)]) l2 = LineString([(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)]) expected = GeoSeries([l1, l2], index=self.g1.index, crs=self.g1.crs) self._test_unary_topological("boundary", expected, self.g1) def test_area(self): expected = Series(np.array([0.5, 1.0]), index=self.g1.index) self._test_unary_real("area", expected, self.g1) expected = Series(np.array([0.5, np.nan]), index=self.na_none.index) self._test_unary_real("area", expected, self.na_none) def test_bounds(self): # Set columns to get the order right expected = DataFrame( { "minx": [0.0, 0.0], "miny": [0.0, 0.0], "maxx": [1.0, 1.0], "maxy": [1.0, 1.0], }, index=self.g1.index, columns=["minx", "miny", "maxx", "maxy"], ) result = self.g1.bounds assert_frame_equal(expected, result) gdf = self.gdf1.set_geometry(self.g1) result = gdf.bounds assert_frame_equal(expected, result) def test_bounds_empty(self): # test bounds of empty GeoSeries # https://github.com/geopandas/geopandas/issues/1195 s = GeoSeries([]) result = s.bounds expected = DataFrame( columns=["minx", "miny", "maxx", "maxy"], index=s.index, dtype="float64" ) assert_frame_equal(result, expected) def test_unary_union(self): p1 = self.t1 p2 = Polygon([(2, 0), (3, 0), (3, 1)]) expected = unary_union([p1, p2]) g = GeoSeries([p1, p2]) self._test_unary_topological("unary_union", expected, g) def test_contains(self): expected = [True, False, True, False, False, False, False] assert_array_dtype_equal(expected, self.g0.contains(self.t1)) def test_length(self): expected = Series(np.array([2 + np.sqrt(2), 4]), index=self.g1.index) self._test_unary_real("length", expected, self.g1) expected = Series(np.array([2 + np.sqrt(2), np.nan]), index=self.na_none.index) self._test_unary_real("length", expected, self.na_none) def test_crosses(self): expected = [False, False, False, False, False, False, False] assert_array_dtype_equal(expected, self.g0.crosses(self.t1)) expected = [False, True] assert_array_dtype_equal(expected, self.crossed_lines.crosses(self.l3)) def test_disjoint(self): expected = [False, False, False, False, False, True, False] assert_array_dtype_equal(expected, self.g0.disjoint(self.t1)) def test_relate(self): expected = Series( [ "212101212", "212101212", "212FF1FF2", "2FFF1FFF2", "FF2F112F2", "FF0FFF212", None, ], index=self.g0.index, ) assert_array_dtype_equal(expected, self.g0.relate(self.inner_sq)) expected = Series(["FF0FFF212", None], index=self.g6.index) assert_array_dtype_equal(expected, self.g6.relate(self.na_none)) def test_distance(self): expected = Series( np.array([np.sqrt((5 - 1) ** 2 + (5 - 1) ** 2), np.nan]), self.na_none.index ) assert_array_dtype_equal(expected, self.na_none.distance(self.p0)) expected = Series(np.array([np.sqrt(4 ** 2 + 4 ** 2), np.nan]), self.g6.index) assert_array_dtype_equal(expected, self.g6.distance(self.na_none)) def test_intersects(self): expected = [True, True, True, True, True, False, False] assert_array_dtype_equal(expected, self.g0.intersects(self.t1)) expected = [True, False] assert_array_dtype_equal(expected, self.na_none.intersects(self.t2)) expected = np.array([], dtype=bool) assert_array_dtype_equal(expected, self.empty.intersects(self.t1)) expected = np.array([], dtype=bool) assert_array_dtype_equal(expected, self.empty.intersects(self.empty_poly)) expected = [False] * 7 assert_array_dtype_equal(expected, self.g0.intersects(self.empty_poly)) def test_overlaps(self): expected = [True, True, False, False, False, False, False] assert_array_dtype_equal(expected, self.g0.overlaps(self.inner_sq)) expected = [False, False] assert_array_dtype_equal(expected, self.g4.overlaps(self.t1)) def test_touches(self): expected = [False, True, False, False, False, False, False] assert_array_dtype_equal(expected, self.g0.touches(self.t1)) def test_within(self): expected = [True, False, False, False, False, False, False] assert_array_dtype_equal(expected, self.g0.within(self.t1)) expected = [True, True, True, True, True, False, False] assert_array_dtype_equal(expected, self.g0.within(self.sq)) def test_is_valid(self): expected = Series(np.array([True] * len(self.g1)), self.g1.index) self._test_unary_real("is_valid", expected, self.g1) def test_is_empty(self): expected = Series(np.array([False] * len(self.g1)), self.g1.index) self._test_unary_real("is_empty", expected, self.g1) def test_is_ring(self): expected = Series(np.array([True] * len(self.g1)), self.g1.index) self._test_unary_real("is_ring", expected, self.g1) def test_is_simple(self): expected = Series(np.array([True] * len(self.g1)), self.g1.index) self._test_unary_real("is_simple", expected, self.g1) def test_has_z(self): expected = Series([False, True], self.g_3d.index) self._test_unary_real("has_z", expected, self.g_3d) def test_xy_points(self): expected_x = [-73.9847, -74.0446] expected_y = [40.7484, 40.6893] assert_array_dtype_equal(expected_x, self.landmarks.geometry.x) assert_array_dtype_equal(expected_y, self.landmarks.geometry.y) def test_xy_polygons(self): # accessing x attribute in polygon geoseries should raise an error with pytest.raises(ValueError): _ = self.gdf1.geometry.x # and same for accessing y attribute in polygon geoseries with pytest.raises(ValueError): _ = self.gdf1.geometry.y def test_centroid(self): polygon = Polygon([(-1, -1), (1, -1), (1, 1), (-1, 1)]) point = Point(0, 0) polygons = GeoSeries([polygon for i in range(3)]) points = GeoSeries([point for i in range(3)]) assert_geoseries_equal(polygons.centroid, points) def test_convex_hull(self): # the convex hull of a square should be the same as the square squares = GeoSeries([self.sq for i in range(3)]) assert_geoseries_equal(squares, squares.convex_hull) def test_exterior(self): exp_exterior = GeoSeries([LinearRing(p.boundary) for p in self.g3]) for expected, computed in zip(exp_exterior, self.g3.exterior): assert computed.equals(expected) def test_interiors(self): original = GeoSeries([self.t1, self.nested_squares]) # This is a polygon with no interior. expected = [] assert original.interiors[0] == expected # This is a polygon with an interior. expected = LinearRing(self.inner_sq.boundary) assert original.interiors[1][0].equals(expected) def test_interpolate(self): expected = GeoSeries([Point(0.5, 1.0), Point(0.75, 1.0)]) self._test_binary_topological( "interpolate", expected, self.g5, 0.75, normalized=True ) expected = GeoSeries([Point(0.5, 1.0), Point(1.0, 0.5)]) self._test_binary_topological("interpolate", expected, self.g5, 1.5) def test_interpolate_distance_array(self): expected = GeoSeries([Point(0.0, 0.75), Point(1.0, 0.5)]) self._test_binary_topological( "interpolate", expected, self.g5, np.array([0.75, 1.5]) ) expected = GeoSeries([Point(0.5, 1.0), Point(0.0, 1.0)]) self._test_binary_topological( "interpolate", expected, self.g5, np.array([0.75, 1.5]), normalized=True ) def test_interpolate_distance_wrong_length(self): distances = np.array([1, 2, 3]) with pytest.raises(ValueError): self.g5.interpolate(distances) def test_interpolate_distance_wrong_index(self): distances = Series([1, 2], index=[99, 98]) with pytest.raises(ValueError): self.g5.interpolate(distances) def test_project(self): expected = Series([2.0, 1.5], index=self.g5.index) p = Point(1.0, 0.5) self._test_binary_real("project", expected, self.g5, p) expected = Series([1.0, 0.5], index=self.g5.index) self._test_binary_real("project", expected, self.g5, p, normalized=True) def test_affine_transform(self): # 45 degree reflection matrix matrix = [0, 1, 1, 0, 0, 0] expected = self.g4 res = self.g3.affine_transform(matrix) assert_geoseries_equal(expected, res) def test_translate_tuple(self): trans = self.sol.x - self.esb.x, self.sol.y - self.esb.y assert self.landmarks.translate(*trans)[0].equals(self.sol) res = self.gdf1.set_geometry(self.landmarks).translate(*trans)[0] assert res.equals(self.sol) def test_rotate(self): angle = 98 expected = self.g4 o = Point(0, 0) res = self.g4.rotate(angle, origin=o).rotate(-angle, origin=o) assert geom_almost_equals(self.g4, res) res = self.gdf1.set_geometry(self.g4).rotate(angle, origin=Point(0, 0)) assert geom_almost_equals(expected, res.rotate(-angle, origin=o)) def test_scale(self): expected = self.g4 scale = 2.0, 1.0 inv = tuple(1.0 / i for i in scale) o = Point(0, 0) res = self.g4.scale(*scale, origin=o).scale(*inv, origin=o) assert geom_almost_equals(expected, res) res = self.gdf1.set_geometry(self.g4).scale(*scale, origin=o) res = res.scale(*inv, origin=o) assert geom_almost_equals(expected, res) def test_skew(self): expected = self.g4 skew = 45.0 o = Point(0, 0) # Test xs res = self.g4.skew(xs=skew, origin=o).skew(xs=-skew, origin=o) assert geom_almost_equals(expected, res) res = self.gdf1.set_geometry(self.g4).skew(xs=skew, origin=o) res = res.skew(xs=-skew, origin=o) assert geom_almost_equals(expected, res) # Test ys res = self.g4.skew(ys=skew, origin=o).skew(ys=-skew, origin=o) assert geom_almost_equals(expected, res) res = self.gdf1.set_geometry(self.g4).skew(ys=skew, origin=o) res = res.skew(ys=-skew, origin=o) assert geom_almost_equals(expected, res) def test_buffer(self): original = GeoSeries([Point(0, 0)]) expected = GeoSeries([Polygon(((5, 0), (0, -5), (-5, 0), (0, 5), (5, 0)))]) calculated = original.buffer(5, resolution=1) assert geom_almost_equals(expected, calculated) def test_buffer_args(self): args = dict(cap_style=3, join_style=2, mitre_limit=2.5) calculated_series = self.g0.buffer(10, **args) for original, calculated in zip(self.g0, calculated_series): if original is None: assert calculated is None else: expected = original.buffer(10, **args) assert calculated.equals(expected) def test_buffer_distance_array(self): original = GeoSeries([self.p0, self.p0]) expected = GeoSeries( [ Polygon(((6, 5), (5, 4), (4, 5), (5, 6), (6, 5))), Polygon(((10, 5), (5, 0), (0, 5), (5, 10), (10, 5))), ] ) calculated = original.buffer(np.array([1, 5]), resolution=1) assert_geoseries_equal(calculated, expected, check_less_precise=True) def test_buffer_distance_wrong_length(self): original = GeoSeries([self.p0, self.p0]) distances = np.array([1, 2, 3]) with pytest.raises(ValueError): original.buffer(distances) def test_buffer_distance_wrong_index(self): original = GeoSeries([self.p0, self.p0], index=[0, 1]) distances = Series(data=[1, 2], index=[99, 98]) with pytest.raises(ValueError): original.buffer(distances) def test_buffer_empty_none(self): p = Polygon([(0, 0), (0, 1), (1, 1), (1, 0)]) s = GeoSeries([p, GeometryCollection(), None]) result = s.buffer(0) assert_geoseries_equal(result, s) result = s.buffer(np.array([0, 0, 0])) assert_geoseries_equal(result, s) def test_envelope(self): e = self.g3.envelope assert np.all(e.geom_equals(self.sq)) assert isinstance(e, GeoSeries) assert self.g3.crs == e.crs def test_total_bounds(self): bbox = self.sol.x, self.sol.y, self.esb.x, self.esb.y assert isinstance(self.landmarks.total_bounds, np.ndarray) assert tuple(self.landmarks.total_bounds) == bbox df = GeoDataFrame( {"geometry": self.landmarks, "col1": range(len(self.landmarks))} ) assert tuple(df.total_bounds) == bbox def test_explode_geoseries(self): s = GeoSeries( [MultiPoint([(0, 0), (1, 1)]), MultiPoint([(2, 2), (3, 3), (4, 4)])] ) s.index.name = "test_index_name" expected_index_name = ["test_index_name", None] index = [(0, 0), (0, 1), (1, 0), (1, 1), (1, 2)] expected = GeoSeries( [Point(0, 0), Point(1, 1), Point(2, 2), Point(3, 3), Point(4, 4)], index=MultiIndex.from_tuples(index, names=expected_index_name), ) assert_geoseries_equal(expected, s.explode()) @pytest.mark.parametrize("index_name", [None, "test"]) def test_explode_geodataframe(self, index_name): s = GeoSeries([MultiPoint([Point(1, 2), Point(2, 3)]), Point(5, 5)]) df = GeoDataFrame({"col": [1, 2], "geometry": s}) df.index.name = index_name test_df = df.explode() expected_s = GeoSeries([Point(1, 2), Point(2, 3), Point(5, 5)]) expected_df = GeoDataFrame({"col": [1, 1, 2], "geometry": expected_s}) expected_index = MultiIndex( [[0, 1], [0, 1]], # levels [[0, 0, 1], [0, 1, 0]], # labels/codes names=[index_name, None], ) expected_df = expected_df.set_index(expected_index) assert_frame_equal(test_df, expected_df) # # Test '&', '|', '^', and '-' # def test_intersection_operator(self): with pytest.warns(DeprecationWarning): self._test_binary_operator("__and__", self.t1, self.g1, self.g2) with pytest.warns(DeprecationWarning): self._test_binary_operator("__and__", self.t1, self.gdf1, self.g2) def test_union_operator(self): with pytest.warns(DeprecationWarning): self._test_binary_operator("__or__", self.sq, self.g1, self.g2) with pytest.warns(DeprecationWarning): self._test_binary_operator("__or__", self.sq, self.gdf1, self.g2) def test_union_operator_polygon(self): with pytest.warns(DeprecationWarning): self._test_binary_operator("__or__", self.sq, self.g1, self.t2) with pytest.warns(DeprecationWarning): self._test_binary_operator("__or__", self.sq, self.gdf1, self.t2) def test_symmetric_difference_operator(self): with pytest.warns(DeprecationWarning): self._test_binary_operator("__xor__", self.sq, self.g3, self.g4) with pytest.warns(DeprecationWarning): self._test_binary_operator("__xor__", self.sq, self.gdf3, self.g4) def test_difference_series2(self): expected = GeoSeries([GeometryCollection(), self.t2]) with pytest.warns(DeprecationWarning): self._test_binary_operator("__sub__", expected, self.g1, self.g2) with pytest.warns(DeprecationWarning): self._test_binary_operator("__sub__", expected, self.gdf1, self.g2) def test_difference_poly2(self): expected = GeoSeries([self.t1, self.t1]) with pytest.warns(DeprecationWarning): self._test_binary_operator("__sub__", expected, self.g1, self.t2) with pytest.warns(DeprecationWarning): self._test_binary_operator("__sub__", expected, self.gdf1, self.t2)
test_intersection
test_main.py
import json from unittest import mock import pytest import os from side_runner_py import main, config def test_get_side_file_list_by_glob(): assert list(main._get_side_file_list_by_glob('')) == [] def test_get_side_fixed_file_list_by_glob(tmp_path): sidefile = tmp_path / "a.json" sidefile.write_text("[]") assert len(list(main._get_side_file_list_by_glob(str(sidefile)))) == 1 def test_get_side_file_list_by_relative_glob(tmp_path): os.chdir(tmp_path) (tmp_path / "rel").mkdir(parents=True, exist_ok=True) sidefile = tmp_path / "rel/a.json" sidefile.write_text("[]") file_list = list(main._get_side_file_list_by_glob("./rel/*.json")) assert file_list == [(sidefile, None)] assert len(file_list) == 1 @pytest.mark.parametrize('extension', [('json'), ('yml'), ('yaml')]) def test_get_side_params_file(tmp_path, extension): sidefile = tmp_path / "a.json" sidefile.write_text("[]") paramsfile = tmp_path / "a_params.{}".format(extension) paramsfile.write_text("[]") side_fullpath, params_fullpath = list(main._get_side_file_list_by_glob(str(sidefile)))[0] assert str(params_fullpath) == str(paramsfile) def test_main_with_glob_no_match(mocker): mocker.patch('side_runner_py.main.with_retry') os.environ["SIDE_FILE"] = "foobar_not_existed_filename.side" execute_side_file_mock = mocker.patch('side_runner_py.main._execute_side_file') main.main() assert execute_side_file_mock.call_count == 0 def test_main_failed_session_close(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command', side_effect=Exception('foobar'))
sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'suites': [{'id': 'foobar_a', 'tests': ['foobar_a']}], 'tests': [{'id': 'foobar_a', 'commands': [{}]}], 'id': 'foobar_a' } sidefile_a.write_text(json.dumps(orig_test_project_a)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() # driver close called at failure-tests-end, test-suite-end. assert driver_close.call_count == 2 def test_main_failed_persist_session_close(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command', side_effect=Exception('foobar')) driver_close = mocker.patch('side_runner_py.main.SessionManager._close_driver_or_skip') # parepare mock test file sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'suites': [{'id': 'foobar_a', 'tests': ['foobar_a'], 'persistSession': True}], 'tests': [{'id': 'foobar_a', 'commands': [{}]}], 'id': 'foobar_a' } sidefile_a.write_text(json.dumps(orig_test_project_a)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() # driver close called at test-suite only. assert driver_close.call_count == 1 def test_main_persistent_session(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command').return_value = {'is_failed': False} driver_close = mocker.patch('side_runner_py.main.SessionManager._close_driver_or_skip') # parepare mock test file sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'id': 'foobar_a', 'suites': [{'name': 'foobar_a', 'id': 'foobar_a', 'tests': ['foobar_a'], 'persistSession': True}], 'tests': [ {'name': 'foobar_a', 'id': 'foobar_a', 'commands': [{'command': 'foobar', 'target': 'foobar', 'value': 'foobar'}]} ], } sidefile_a.write_text(json.dumps(orig_test_project_a)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() # driver close called at test-suite end assert driver_close.call_count == 1 def test_main_non_persistent_session(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command').return_value = {'is_failed': False} driver_close = mocker.patch('side_runner_py.main.SessionManager._close_driver_or_skip') # parepare mock test file sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'id': 'foobar_a', 'suites': [{'name': 'foobar_a', 'id': 'foobar_a', 'tests': ['foobar_a'], 'persistSession': False}], 'tests': [ {'name': 'foobar_a', 'id': 'foobar_a', 'commands': [{'command': 'foobar', 'target': 'foobar', 'value': 'foobar'}]} ], } sidefile_a.write_text(json.dumps(orig_test_project_a)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() # driver close called at test-suite, tests end assert driver_close.call_count == 2 def test_main_multiple_not_shared(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command') # parepare mock test file sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'suites': [{'id': 'foobar_a', 'tests': ['foobar_a']}], 'tests': [{'id': 'foobar_a', 'commands': []}], 'id': 'foobar_a' } sidefile_a.write_text(json.dumps(orig_test_project_a)) sidefile_b = tmp_path / "b.json" orig_test_project_b = { 'suites': [{'id': 'foobar_b', 'tests': ['foobar_b']}], 'tests': [{'id': 'foobar_b', 'commands': []}], 'id': 'foobar_b' } sidefile_b.write_text(json.dumps(orig_test_project_b)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() def test_main_multiple_shared(mocker, tmp_path): mocker.patch('side_runner_py.main.with_retry') mocker.patch('side_runner_py.main.get_screenshot') mocker.patch('side_runner_py.main.execute_test_command') # parepare mock test file sidefile_a = tmp_path / "a.json" orig_test_project_a = { 'suites': [{'id': 'foobar_a', 'tests': ['foobar_a']}], 'tests': [{'id': 'foobar_a', 'commands': []}], 'id': 'foobar_a' } sidefile_a.write_text(json.dumps(orig_test_project_a)) sidefile_b = tmp_path / "b.json" orig_test_project_b = { 'suites': [{'id': 'foobar_b', 'tests': ['foobar_a', 'foobar_b']}], 'tests': [{'id': 'foobar_b', 'commands': []}], 'id': 'foobar_b' } sidefile_b.write_text(json.dumps(orig_test_project_b)) # call main with mocked driver, etc... with mock.patch.object(config.sys, 'argv', ['prog_name', '--test-file={}'.format(tmp_path/"*.json")]): main.main() def test_main_multiple_test_file_pattern(mocker, tmp_path): mocker.patch('side_runner_py.main._execute_side_file') add_project = mocker.patch('side_runner_py.main.SIDEProjectManager.add_project') # parepare mock test file orig_test_project = {'suites': [], 'tests': [], 'id': 'foobar_a'} sidefile_a = tmp_path / "a_foo.json" sidefile_a.write_text(json.dumps(orig_test_project)) sidefile_b1 = tmp_path / "b_bar.json" sidefile_b1.write_text(json.dumps(orig_test_project)) sidefile_b2 = tmp_path / "b_buz.json" sidefile_b2.write_text(json.dumps(orig_test_project)) # call main with mocked driver, etc... args = ['prog_name', '--test-file', str(tmp_path/"a_*.json"), str(tmp_path/"b_*.json")] with mock.patch.object(config.sys, 'argv', args): main.main() assert add_project.call_count == 3
driver_close = mocker.patch('side_runner_py.main.SessionManager._close_driver_or_skip') # parepare mock test file
ecpoint.py
from btc.utils import mod_inverse, int2hex # Parameters for SECP256k1 elliptic curve (used by Bitcoin) SECP256K1_A = 0 SECP256K1_B = 7 SECP256K1_GX = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 SECP256K1_GY = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 SECP256K1_P = 2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 - 1 SECP256K1_ORDER = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 SECP256K1_ORDER_LEN = SECP256K1_ORDER.bit_length() SECP256K1_H = 1 class ECPoint: """Represents a point on an elliptic curve""" def __init__(self, x, y, a=SECP256K1_A, b=SECP256K1_B, mod=SECP256K1_P): """Construct an ECPoint on the elliptic curve: y^2 = x^3 + a*x + b (mod p) """ # Check if the point(x,y) is the infinity if x or y: # Check if the point(x,y) is on the elliptic curve assert self.is_contained(x, y, a, b, mod), \ "The point {:x}, {:x} is not on " \ "the elliptic curve".format(x, y) self.x, self.y, self.a, self.b, self.mod = x, y, a, b, mod def __add__(self, other): if self.x == other.x and self.y == other.y: return self.double(self) else: return self.add(self, other) def __mul__(self, other): return self.multiply(self, other) def __repr__(self): return "({:s}, {:s})".format(int2hex(self.x), int2hex(self.y)) def __eq__(self, other): return (self.x == other.x) & (self.y == other.y) def add(self, p1, p2):
def double(self, p): """Return point * 2""" if p == ECPoint.infinity(): return ECPoint.infinity() # Sum point: # x3 = s^2 - x1 - x2 # y3 = s*(x1-x3) / y1 # where s = (3*x^2 + a) / 2*y1 p2 = ECPoint(0, 0, p.a, p.b, p.mod) dy = (3 * p.x * p.x + p.a) % p.mod dx = (2 * p.y) % p.mod s = (dy * mod_inverse(dx, p.mod)) % p.mod p2.x = (s * s - p.x - p.x) % p.mod p2.y = (s * (p.x - p2.x) - p.y) % p.mod return p2 def multiply(self, p, x): """Return p * x = p + p + ... + p""" temp = ECPoint(p.x, p.y, p.a, p.b, p.mod) x = x - 1 while x > 0: if x % 2 != 0: temp = self.double(temp) if temp == p else self.add(temp, p) x = x - 1 x = x // 2 p = self.double(p) return temp @staticmethod def infinity(): """Return the infinity point on the elliptic curve point""" return ECPoint(0, 0) @staticmethod def is_contained(x, y, a, b, mod): """Check if a point is on the elliptic curve""" # The elliptic curve -- y^2 = x^3 + a*x + b (mod p) return (y ** 2 - (x ** 3 + a * x + b)) % mod == 0 @classmethod def get_secp256k1_y(cls, x, a=SECP256K1_A, b=SECP256K1_B, p=SECP256K1_P): """Calculate y of a point with x""" # The elliptic curve -- y^2 = x^3 + a*x + b (mod p) # To solve y^2 = z mod p: # if p mod 4 = 3 => y = z^((p+1)/4) # So for y^2 = x^3 + ax + b (mod p): # y = (x^3 + ax + b)^((p+1)/4) (mod p) y = pow(x ** 3 + x * a + b, (p + 1) // 4, p) # Check if the point(x,y) is on the elliptic curve assert cls.is_contained(x, y, a, b, p), \ "The point {:x}, {:x} is not on the elliptic curve".format(x, y) return y @staticmethod def get_secp256k1_a(): return SECP256K1_A @staticmethod def get_secp256k1_b(): return SECP256K1_B @staticmethod def get_secp256k1_gx(): return SECP256K1_GX @staticmethod def get_secp256k1_gy(): return SECP256K1_GY @staticmethod def get_secp256k1_p(): return SECP256K1_P @staticmethod def get_secp256k1_order(): return SECP256K1_ORDER @staticmethod def get_secp256k1_order_len(): return SECP256K1_ORDER_LEN @staticmethod def get_secp256k1_h(): return SECP256K1_H
"""Return the sum of two ECPoint""" # The sum of infinity + p2 = p2 if p1 == ECPoint.infinity(): return p2 # The sum of p1 + infinity = p1 if p2 == ECPoint.infinity(): return p1 # Check if the points are on a vertical line if p1.x == p2.x: # If p1 and p2 is the same then double(point) # else the result is infinity. if p1.y == p2.y: return self.double(p1) else: return ECPoint.infinity() # Sum point: # x3 = s^2 - x1 - x2 # y3 = s(x1-x3) / y1 # where s = (y2-y1) / (x2-x1) p3 = ECPoint(0, 0, p1.a, p1.b, p1.mod) dy = (p2.y - p1.y) % p1.mod dx = (p2.x - p1.x) % p1.mod s = (dy * mod_inverse(dx, p1.mod)) % p1.mod p3.x = (s * s - p1.x - p2.x) % p1.mod p3.y = (s * (p1.x - p3.x) - p1.y) % p1.mod return p3
mod.rs
use bn::Fr; use std::io::Read; use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; use bincode::SizeLimit::Infinite; use bincode::rustc_serialize::encode; use blake2_rfc::blake2b::blake2b; use blake2_rfc::blake2s::blake2s; mod base58; use self::base58::{ToBase58, FromBase58}; #[macro_export] macro_rules! digest256_from_parts { ($($h:ident),*) => ({ let mut contents = vec![]; $( encode_into(&$h, &mut contents, Infinite).unwrap(); )* Digest256::from_reader(&mut (&contents[..])) }) } macro_rules! digest_impl { ($name:ident, $bytes:expr, $hash:ident) => { pub struct $name(pub [u8; $bytes]); impl $name { pub fn from<E: Encodable>(obj: &E) -> Option<Self> { let serialized = encode(obj, Infinite); match serialized { Ok(ref serialized) => { let mut buf: [u8; $bytes] = [0; $bytes]; buf.copy_from_slice(&$hash($bytes, &[], serialized).as_bytes()); Some($name(buf)) }, Err(_) => None } } } impl PartialEq for $name { fn eq(&self, other: &$name) -> bool { (&self.0[..]).eq(&other.0[..]) } } impl Eq for $name { } impl Copy for $name { } impl Clone for $name { fn clone(&self) -> $name { *self } } impl Encodable for $name { fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> { for i in 0..$bytes { try!(s.emit_u8(self.0[i])); } Ok(()) } } impl Decodable for $name { fn decode<S: Decoder>(s: &mut S) -> Result<$name, S::Error> { let mut buf = [0; $bytes]; for i in 0..$bytes { buf[i] = try!(s.read_u8()); } Ok($name(buf)) } } } } digest_impl!(Digest512, 64, blake2b); digest_impl!(Digest256, 32, blake2s); impl Digest512 { pub fn interpret(&self) -> Fr { Fr::interpret(&self.0) } } impl Digest256 { pub fn from_reader<R: Read>(r: &mut R) -> Digest256 { use blake2_rfc::blake2s::blake2s; let mut contents = vec![]; r.read_to_end(&mut contents).unwrap(); let mut output = [0; 32]; output.copy_from_slice(&blake2s(32, &[], &contents).as_bytes()); Digest256(output) } pub fn to_string(&self) -> String { (&self.0[..]).to_base58check() } pub fn
(s: &str) -> Option<Digest256> { let f: Result<Vec<u8>, _> = FromBase58::from_base58check(s); match f { Ok(decoded) => { if decoded.len() == 32 { let mut decoded_bytes: [u8; 32] = [0; 32]; decoded_bytes.copy_from_slice(&decoded); Some(Digest256(decoded_bytes)) } else { None } }, Err(_) => None } } } #[test] fn digest_string_repr() { use super::secrets::*; let rng = &mut ::rand::thread_rng(); let privkey = PrivateKey::new(rng); for _ in 0..100 { let pubkey = privkey.pubkey(rng); let comm = pubkey.hash(); let string = comm.to_string(); let newcomm = Digest256::from_string(&string).unwrap(); assert!(comm == newcomm); } assert!(Digest256::from_string("2b8c8iK5PGtStZzEz45ycJSQLq1RPXGkjqmWAM1Q8jQ4dqVHkY").is_some()); assert!(Digest256::from_string("2b8c8iK5PGtStZzEz45ycJSQLq1RPXGkjqmWAM1Q8jQ4dqVHkS").is_none()); assert!(Digest256::from_string("2b8c8iK5PGtStZzEz45ycJSQLq1RPXGkjqmWAM2Q8jQ4dqVHkY").is_none()); assert!(Digest256::from_string("1b8c8iK5PGtStZzEz45ycJSQLq1RPXGkjqmWAM1Q8jQ4dqVHkY").is_none()); }
from_string
create.rs
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT OR Apache-2.0 use crate::build_targets; use crate::datetime::parse_datetime; use crate::error::{self, Result}; use crate::source::parse_key_source; use chrono::{DateTime, Utc}; use snafu::ResultExt; use std::num::{NonZeroU64, NonZeroUsize}; use std::path::PathBuf; use structopt::StructOpt; use tough::editor::signed::PathExists; use tough::editor::RepositoryEditor; use tough::key_source::KeySource; #[derive(Debug, StructOpt)] pub(crate) struct CreateArgs { /// Key files to sign with #[structopt(short = "k", long = "key", required = true, parse(try_from_str = parse_key_source))] keys: Vec<Box<dyn KeySource>>, /// Version of snapshot.json file #[structopt(long = "snapshot-version")] snapshot_version: NonZeroU64, /// Expiration of snapshot.json file; can be in full RFC 3339 format, or something like 'in /// 7 days' #[structopt(long = "snapshot-expires", parse(try_from_str = parse_datetime))] snapshot_expires: DateTime<Utc>, /// Version of targets.json file #[structopt(long = "targets-version")] targets_version: NonZeroU64, /// Expiration of targets.json file; can be in full RFC 3339 format, or something like 'in /// 7 days' #[structopt(long = "targets-expires", parse(try_from_str = parse_datetime))] targets_expires: DateTime<Utc>, /// Version of timestamp.json file #[structopt(long = "timestamp-version")] timestamp_version: NonZeroU64, /// Expiration of timestamp.json file; can be in full RFC 3339 format, or something like 'in /// 7 days' #[structopt(long = "timestamp-expires", parse(try_from_str = parse_datetime))] timestamp_expires: DateTime<Utc>, /// Path to root.json file for the repository #[structopt(short = "r", long = "root")] root: PathBuf, /// Directory of targets #[structopt(short = "t", long = "add-targets")] targets_indir: PathBuf, /// Behavior when a target exists with the same name and hash in the targets directory, /// for example from another repository when they share a targets directory. /// Options are "replace", "fail", and "skip" #[structopt(long = "target-path-exists", default_value = "skip")]
/// Follow symbolic links in the given directory when adding targets #[structopt(short = "f", long = "follow")] follow: bool, /// Number of target hashing threads to run when adding targets /// (default: number of cores) // No default is specified in structopt here. This is because rayon // automatically spawns the same number of threads as cores when any // of its parallel methods are called. #[structopt(short = "j", long = "jobs")] jobs: Option<NonZeroUsize>, /// The directory where the repository will be written #[structopt(short = "o", long = "outdir")] outdir: PathBuf, } impl CreateArgs { pub(crate) fn run(&self) -> Result<()> { // If a user specifies job count we override the default, which is // the number of cores. if let Some(jobs) = self.jobs { rayon::ThreadPoolBuilder::new() .num_threads(usize::from(jobs)) .build_global() .context(error::InitializeThreadPool)?; } let targets = build_targets(&self.targets_indir, self.follow)?; let mut editor = RepositoryEditor::new(&self.root).context(error::EditorCreate { path: &self.root })?; editor .targets_version(self.targets_version) .context(error::DelegationStructure)? .targets_expires(self.targets_expires) .context(error::DelegationStructure)? .snapshot_version(self.snapshot_version) .snapshot_expires(self.snapshot_expires) .timestamp_version(self.timestamp_version) .timestamp_expires(self.timestamp_expires); for (filename, target) in targets { editor .add_target(&filename, target) .context(error::DelegationStructure)?; } let signed_repo = editor.sign(&self.keys).context(error::SignRepo)?; let metadata_dir = &self.outdir.join("metadata"); let targets_outdir = &self.outdir.join("targets"); signed_repo .link_targets(&self.targets_indir, targets_outdir, self.target_path_exists) .context(error::LinkTargets { indir: &self.targets_indir, outdir: targets_outdir, })?; signed_repo.write(metadata_dir).context(error::WriteRepo { directory: metadata_dir, })?; Ok(()) } }
target_path_exists: PathExists,
module.go
package slashing import ( "context" "encoding/json" "fmt" "math/rand" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" "github.com/cosmos/cosmos-sdk/x/slashing/client/rest" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic defines the basic application module used by the slashing module. type AppModuleBasic struct { cdc codec.Marshaler } var _ module.AppModuleBasic = AppModuleBasic{} // Name returns the slashing module's name. func (AppModuleBasic) Name() string { return types.ModuleName } // RegisterLegacyAminoCodec registers the slashing module's types for the given codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers the module's interface types func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) } // DefaultGenesis returns default genesis state as raw bytes for the slashing // module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { return cdc.MustMarshalJSON(types.DefaultGenesisState()) } // ValidateGenesis performs genesis state validation for the slashing module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxEncodingConfig, bz json.RawMessage) error { var data types.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil
return types.ValidateGenesis(data) } // RegisterRESTRoutes registers the REST routes for the slashing module. func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { rest.RegisterHandlers(clientCtx, rtr) } // RegisterGRPCRoutes registers the gRPC Gateway routes for the slashig module. func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the slashing module. func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd() } // GetQueryCmd returns no root query command for the slashing module. func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } //____________________________________________________________________________ // AppModule implements an application module for the slashing module. type AppModule struct { AppModuleBasic keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper stakingKeeper stakingkeeper.Keeper } // NewAppModule creates a new AppModule object func NewAppModule(cdc codec.Marshaler, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, sk stakingkeeper.Keeper) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, accountKeeper: ak, bankKeeper: bk, stakingKeeper: sk, } } // Name returns the slashing module's name. func (AppModule) Name() string { return types.ModuleName } // RegisterInvariants registers the slashing module invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // Route returns the message routing key for the slashing module. func (am AppModule) Route() sdk.Route { return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) } // QuerierRoute returns the slashing module's querier route name. func (AppModule) QuerierRoute() string { return types.QuerierRoute } // LegacyQuerierHandler returns the slashing module sdk.Querier. func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the slashing module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.keeper, am.stakingKeeper, &genesisState) return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the slashing // module. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage { gs := ExportGenesis(ctx, am.keeper) return cdc.MustMarshalJSON(gs) } // BeginBlock returns the begin blocker for the slashing module. func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { BeginBlocker(ctx, req, am.keeper) } // EndBlock returns the end blocker for the slashing module. It returns no validator // updates. func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } //____________________________________________________________________________ // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the slashing module. func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } // ProposalContents doesn't return any content functions for governance proposals. func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { return nil } // RandomizedParams creates randomized slashing param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) } // RegisterStoreDecoder registers a decoder for slashing module's types func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } // WeightedOperations returns the all the slashing module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return simulation.WeightedOperations( simState.AppParams, simState.Cdc, am.accountKeeper, am.bankKeeper, am.keeper, am.stakingKeeper, ) }
{ return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) }
drawing_classifier.py
# -*- coding: utf-8 -*- # Copyright © 2019 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import turicreate as _tc import numpy as _np import time as _time from turicreate.toolkits._model import CustomModel as _CustomModel from turicreate.toolkits._model import PythonProxy as _PythonProxy from turicreate.toolkits import evaluation as _evaluation import turicreate.toolkits._internal_utils as _tkutl from turicreate.toolkits._main import ToolkitError as _ToolkitError from turicreate import extensions as _extensions from .. import _pre_trained_models BITMAP_WIDTH = 28 BITMAP_HEIGHT = 28 TRAIN_VALIDATION_SPLIT = .95 def _raise_error_if_not_drawing_classifier_input_sframe( dataset, feature, target): """ Performs some sanity checks on the SFrame provided as input to `turicreate.drawing_classifier.create` and raises a ToolkitError if something in the dataset is missing or wrong. """ from turicreate.toolkits._internal_utils import _raise_error_if_not_sframe _raise_error_if_not_sframe(dataset) if feature not in dataset.column_names(): raise _ToolkitError("Feature column '%s' does not exist" % feature) if target not in dataset.column_names(): raise _ToolkitError("Target column '%s' does not exist" % target) if (dataset[feature].dtype != _tc.Image and dataset[feature].dtype != list): raise _ToolkitError("Feature column must contain images" + " or stroke-based drawings encoded as lists of strokes" + " where each stroke is a list of points and" + " each point is stored as a dictionary") if dataset[target].dtype != int and dataset[target].dtype != str: raise _ToolkitError("Target column contains " + str(dataset[target].dtype) + " but it must contain strings or integers to represent" + " labels for drawings.") if len(dataset) == 0: raise _ToolkitError("Input Dataset is empty!") def create(input_dataset, target, feature=None, validation_set='auto', warm_start='auto', batch_size=256, max_iterations=100, verbose=True): """ Create a :class:`DrawingClassifier` model. Parameters ---------- dataset : SFrame Input data. The columns named by the ``feature`` and ``target`` parameters will be extracted for training the drawing classifier. target : string Name of the column containing the target variable. The values in this column must be of string or integer type. feature : string optional Name of the column containing the input drawings. 'None' (the default) indicates the column in `dataset` named "drawing" should be used as the feature. The feature column can contain both bitmap-based drawings as well as stroke-based drawings. Bitmap-based drawing input can be a grayscale tc.Image of any size. Stroke-based drawing input must be in the following format: Every drawing must be represented by a list of strokes, where each stroke must be a list of points in the order in which they were drawn on the canvas. Each point must be a dictionary with two keys, "x" and "y", and their respective values must be numerical, i.e. either integer or float. validation_set : SFrame optional A dataset for monitoring the model's generalization performance. The format of this SFrame must be the same as the training set. By default this argument is set to 'auto' and a validation set is automatically sampled and used for progress printing. If validation_set is set to None, then no additional metrics are computed. The default value is 'auto'. warm_start : string optional A string to denote which pretrained model to use. Set to "auto" by default which uses a model trained on 245 of the 345 classes in the Quick, Draw! dataset. To disable warm start, pass in None to this argument. Here is a list of all the pretrained models that can be passed in as this argument: "auto": Uses quickdraw_245_v0 "quickdraw_245_v0": Uses a model trained on 245 of the 345 classes in the Quick, Draw! dataset. None: No Warm Start batch_size: int optional The number of drawings per training step. If not set, a default value of 256 will be used. If you are getting memory errors, try decreasing this value. If you have a powerful computer, increasing this value may improve performance. max_iterations : int optional The maximum number of allowed passes through the data. More passes over the data can result in a more accurately trained model. verbose : bool optional If True, print progress updates and model details. Returns ------- out : DrawingClassifier A trained :class:`DrawingClassifier` model. See Also -------- DrawingClassifier Examples -------- .. sourcecode:: python # Train a drawing classifier model >>> model = turicreate.drawing_classifier.create(data) # Make predictions on the training set and as column to the SFrame >>> data['predictions'] = model.predict(data) """ import mxnet as _mx from mxnet import autograd as _autograd from ._model_architecture import Model as _Model from ._sframe_loader import SFrameClassifierIter as _SFrameClassifierIter from .._mxnet import _mxnet_utils start_time = _time.time() accepted_values_for_warm_start = ["auto", "quickdraw_245_v0", None] # @TODO: Should be able to automatically choose number of iterations # based on data size: Tracked in Github Issue #1576 # automatically infer feature column if feature is None: feature = _tkutl._find_only_drawing_column(input_dataset) _raise_error_if_not_drawing_classifier_input_sframe( input_dataset, feature, target) if batch_size is not None and not isinstance(batch_size, int): raise TypeError("'batch_size' must be an integer >= 1") if batch_size is not None and batch_size < 1: raise ValueError("'batch_size' must be >= 1") if max_iterations is not None and not isinstance(max_iterations, int): raise TypeError("'max_iterations' must be an integer >= 1") if max_iterations is not None and max_iterations < 1: raise ValueError("'max_iterations' must be >= 1") is_stroke_input = (input_dataset[feature].dtype != _tc.Image) dataset = _extensions._drawing_classifier_prepare_data( input_dataset, feature) if is_stroke_input else input_dataset iteration = 0 classes = dataset[target].unique() classes = sorted(classes) class_to_index = {name: index for index, name in enumerate(classes)} validation_set_corrective_string = ("'validation_set' parameter must be " + "an SFrame, or None, or must be set to 'auto' for the toolkit to " + "automatically create a validation set.") if isinstance(validation_set, _tc.SFrame): _raise_error_if_not_drawing_classifier_input_sframe( validation_set, feature, target) is_validation_stroke_input = (validation_set[feature].dtype != _tc.Image) validation_dataset = _extensions._drawing_classifier_prepare_data( validation_set, feature) if is_validation_stroke_input else validation_set elif isinstance(validation_set, str): if validation_set == 'auto': if dataset.num_rows() >= 100: if verbose: print ( "PROGRESS: Creating a validation set from 5 percent of training data. This may take a while.\n" " You can set ``validation_set=None`` to disable validation tracking.\n") dataset, validation_dataset = dataset.random_split(TRAIN_VALIDATION_SPLIT, exact=True) else: validation_set = None validation_dataset = _tc.SFrame() else: raise _ToolkitError("Unrecognized value for 'validation_set'. " + validation_set_corrective_string) elif validation_set is None: validation_dataset = _tc.SFrame() else: raise TypeError("Unrecognized type for 'validation_set'." + validation_set_corrective_string) train_loader = _SFrameClassifierIter(dataset, batch_size, feature_column=feature, target_column=target, class_to_index=class_to_index, load_labels=True, shuffle=True, iterations=max_iterations) train_loader_to_compute_accuracy = _SFrameClassifierIter(dataset, batch_size, feature_column=feature, target_column=target, class_to_index=class_to_index, load_labels=True, shuffle=True, iterations=1) validation_loader = _SFrameClassifierIter(validation_dataset, batch_size, feature_column=feature, target_column=target, class_to_index=class_to_index, load_labels=True, shuffle=True, iterations=1) if verbose and iteration == 0: column_names = ['iteration', 'train_loss', 'train_accuracy', 'time'] column_titles = ['Iteration', 'Training Loss', 'Training Accuracy', 'Elapsed Time (seconds)'] if validation_set is not None: column_names.insert(3, 'validation_accuracy') column_titles.insert(3, 'Validation Accuracy') table_printer = _tc.util._ProgressTablePrinter( column_names, column_titles) ctx = _mxnet_utils.get_mxnet_context(max_devices=batch_size) model = _Model(num_classes = len(classes), prefix="drawing_") model_params = model.collect_params() model_params.initialize(_mx.init.Xavier(), ctx=ctx) if warm_start is not None: if type(warm_start) is not str: raise TypeError("'warm_start' must be a string or None. " + "'warm_start' can take in the following values: " + str(accepted_values_for_warm_start)) if warm_start not in accepted_values_for_warm_start: raise _ToolkitError("Unrecognized value for 'warm_start': " + warm_start + ". 'warm_start' can take in the following " + "values: " + str(accepted_values_for_warm_start)) pretrained_model = _pre_trained_models.DrawingClassifierPreTrainedModel( warm_start) pretrained_model_params_path = pretrained_model.get_model_path() model.load_params(pretrained_model_params_path, ctx=ctx, allow_missing=True) softmax_cross_entropy = _mx.gluon.loss.SoftmaxCrossEntropyLoss() model.hybridize() trainer = _mx.gluon.Trainer(model.collect_params(), 'adam') train_accuracy = _mx.metric.Accuracy() validation_accuracy = _mx.metric.Accuracy() def get_data_and_label_from_batch(batch): if batch.pad is not None: size = batch_size - batch.pad sliced_data = _mx.nd.slice_axis(batch.data[0], axis=0, begin=0, end=size) sliced_label = _mx.nd.slice_axis(batch.label[0], axis=0, begin=0, end=size) num_devices = min(sliced_data.shape[0], len(ctx)) batch_data = _mx.gluon.utils.split_and_load(sliced_data, ctx_list=ctx[:num_devices], even_split=False) batch_label = _mx.gluon.utils.split_and_load(sliced_label, ctx_list=ctx[:num_devices], even_split=False) else: batch_data = _mx.gluon.utils.split_and_load(batch.data[0], ctx_list=ctx, batch_axis=0) batch_label = _mx.gluon.utils.split_and_load(batch.label[0], ctx_list=ctx, batch_axis=0) return batch_data, batch_label def compute_accuracy(accuracy_metric, batch_loader): batch_loader.reset() accuracy_metric.reset() for batch in batch_loader: batch_data, batch_label = get_data_and_label_from_batch(batch) outputs = [] for x, y in zip(batch_data, batch_label): if x is None or y is None: continue z = model(x) outputs.append(z) accuracy_metric.update(batch_label, outputs) for train_batch in train_loader: train_batch_data, train_batch_label = get_data_and_label_from_batch(train_batch) with _autograd.record(): # Inside training scope for x, y in zip(train_batch_data, train_batch_label): z = model(x) # Computes softmax cross entropy loss. loss = softmax_cross_entropy(z, y) # Backpropagate the error for one iteration. loss.backward() # Make one step of parameter update. Trainer needs to know the # batch size of data to normalize the gradient by 1/batch_size. trainer.step(train_batch.data[0].shape[0]) # calculate training metrics train_loss = loss.mean().asscalar() train_time = _time.time() - start_time if train_batch.iteration > iteration: # Compute training accuracy compute_accuracy(train_accuracy, train_loader_to_compute_accuracy) # Compute validation accuracy if validation_set is not None: compute_accuracy(validation_accuracy, validation_loader) iteration = train_batch.iteration if verbose: kwargs = { "iteration": iteration, "train_loss": float(train_loss), "train_accuracy": train_accuracy.get()[1], "time": train_time} if validation_set is not None: kwargs["validation_accuracy"] = validation_accuracy.get()[1] table_printer.print_row(**kwargs) state = { '_model': model, '_class_to_index': class_to_index, 'num_classes': len(classes), 'classes': classes, 'input_image_shape': (1, BITMAP_WIDTH, BITMAP_HEIGHT), 'batch_size': batch_size, 'training_loss': train_loss, 'training_accuracy': train_accuracy.get()[1], 'training_time': train_time, 'validation_accuracy': validation_accuracy.get()[1], # nan if validation_set=None 'max_iterations': max_iterations, 'target': target, 'feature': feature, 'num_examples': len(input_dataset) } return DrawingClassifier(state) class DrawingClassifier(_CustomModel): """ A trained model that is ready to use for classification, and to be exported to Core ML. This model should not be constructed directly. """ _PYTHON_DRAWING_CLASSIFIER_VERSION = 1 def __init__(self, state): self.__proxy__ = _PythonProxy(state) @classmethod def _native_name(cls): return "drawing_classifier" def _get_native_state(self): from .._mxnet import _mxnet_utils state = self.__proxy__.get_state() mxnet_params = state['_model'].collect_params() state['_model'] = _mxnet_utils.get_gluon_net_params_state(mxnet_params) return state def _get_version(self): return self._PYTHON_DRAWING_CLASSIFIER_VERSION @classmethod def _load_version(cls, state, version): _tkutl._model_version_check(version, cls._PYTHON_DRAWING_CLASSIFIER_VERSION) from ._model_architecture import Model as _Model from .._mxnet import _mxnet_utils net = _Model(num_classes = len(state['classes']), prefix = 'drawing_') ctx = _mxnet_utils.get_mxnet_context(max_devices=state['batch_size']) net_params = net.collect_params() _mxnet_utils.load_net_params_from_state( net_params, state['_model'], ctx=ctx ) state['_model'] = net # For a model trained on integer classes, when saved and loaded back, # the classes are loaded as floats. The following if statement casts # the loaded "float" classes back to int. if len(state['classes']) > 0 and isinstance(state['classes'][0], float): state['classes'] = list(map(int, state['classes'])) return DrawingClassifier(state) def _
self): """ Return a string description of the model to the ``print`` method. Returns ------- out : string A description of the DrawingClassifier. """ return self.__repr__() def __repr__(self): """ Returns a string description of the model when the model name is entered in the terminal. """ width = 40 sections, section_titles = self._get_summary_struct() out = _tkutl._toolkit_repr_print(self, sections, section_titles, width=width) return out def _get_summary_struct(self): """ Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections. Each section is a list. Each item in a section list is a tuple of the form: ('<label>','<field>') section_titles: list A list of section titles. The order matches that of the 'sections' object. """ model_fields = [ ('Number of classes', 'num_classes'), ('Feature column', 'feature'), ('Target column', 'target') ] training_fields = [ ('Training Iterations', 'max_iterations'), ('Training Accuracy', 'training_accuracy'), ('Validation Accuracy', 'validation_accuracy'), ('Training Time', 'training_time'), ('Number of Examples', 'num_examples'), ('Batch Size', 'batch_size'), ('Final Loss (specific to model)', 'training_loss') ] section_titles = ['Schema', 'Training summary'] return([model_fields, training_fields], section_titles) def export_coreml(self, filename, verbose=False): """ Save the model in Core ML format. The Core ML model takes a grayscale drawing of fixed size as input and produces two outputs: `classLabel` and `labelProbabilities`. The first one, `classLabel` is an integer or string (depending on the classes the model was trained on) to store the label of the top prediction by the model. The second one, `labelProbabilities`, is a dictionary with all the class labels in the dataset as the keys, and their respective probabilities as the values. See Also -------- save Parameters ---------- filename : string The path of the file where we want to save the Core ML model. verbose : bool optional If True, prints export progress. Examples -------- >>> model.export_coreml('drawing_classifier.mlmodel') """ import mxnet as _mx from .._mxnet._mxnet_to_coreml import _mxnet_converter import coremltools as _coremltools batch_size = 1 image_shape = (batch_size,) + (1, BITMAP_WIDTH, BITMAP_HEIGHT) s_image = _mx.sym.Variable(self.feature, shape=image_shape, dtype=_np.float32) from copy import copy as _copy net = _copy(self._model) s_ymap = net(s_image) mod = _mx.mod.Module(symbol=s_ymap, label_names=None, data_names=[self.feature]) mod.bind(for_training=False, data_shapes=[(self.feature, image_shape)]) mod.init_params() arg_params, aux_params = mod.get_params() net_params = net.collect_params() new_arg_params = {} for k, param in arg_params.items(): new_arg_params[k] = net_params[k].data(net_params[k].list_ctx()[0]) new_aux_params = {} for k, param in aux_params.items(): new_aux_params[k] = net_params[k].data(net_params[k].list_ctx()[0]) mod.set_params(new_arg_params, new_aux_params) coreml_model = _mxnet_converter.convert(mod, mode='classifier', class_labels=self.classes, input_shape=[(self.feature, image_shape)], builder=None, verbose=verbose, preprocessor_args={ 'image_input_names': [self.feature], 'image_scale': 1.0/255 }) DESIRED_OUTPUT_NAME = self.target + "Probabilities" spec = coreml_model._spec class_label_output_index = 0 if spec.description.output[0].name == "classLabel" else 1 probabilities_output_index = 1-class_label_output_index spec.neuralNetworkClassifier.labelProbabilityLayerName = DESIRED_OUTPUT_NAME spec.neuralNetworkClassifier.layers[-1].name = DESIRED_OUTPUT_NAME spec.neuralNetworkClassifier.layers[-1].output[0] = DESIRED_OUTPUT_NAME spec.description.predictedProbabilitiesName = DESIRED_OUTPUT_NAME spec.description.output[probabilities_output_index].name = DESIRED_OUTPUT_NAME from turicreate.toolkits import _coreml_utils model_type = "drawing classifier" spec.description.metadata.shortDescription = _coreml_utils._mlmodel_short_description(model_type) spec.description.input[0].shortDescription = self.feature spec.description.output[probabilities_output_index].shortDescription = 'Prediction probabilities' spec.description.output[class_label_output_index].shortDescription = 'Class Label of Top Prediction' from coremltools.models.utils import save_spec as _save_spec _save_spec(spec, filename) def _predict_with_probabilities(self, input_dataset, batch_size=None, verbose=True): """ Predict with probabilities. The core prediction part that both `evaluate` and `predict` share. Returns an SFrame with two columns, self.target, and "probabilities". The column with column name, self.target, contains the predictions made by the model for the provided dataset. The "probabilities" column contains the probabilities for each class that the model predicted for the data provided to the function. """ from .._mxnet import _mxnet_utils import mxnet as _mx from ._sframe_loader import SFrameClassifierIter as _SFrameClassifierIter is_stroke_input = (input_dataset[self.feature].dtype != _tc.Image) dataset = _extensions._drawing_classifier_prepare_data( input_dataset, self.feature) if is_stroke_input else input_dataset batch_size = self.batch_size if batch_size is None else batch_size loader = _SFrameClassifierIter(dataset, batch_size, class_to_index=self._class_to_index, feature_column=self.feature, target_column=self.target, load_labels=False, shuffle=False, iterations=1) dataset_size = len(dataset) ctx = _mxnet_utils.get_mxnet_context() index = 0 last_time = 0 done = False from turicreate import SArrayBuilder from array import array classes = self.classes all_predicted_builder = SArrayBuilder(dtype=type(classes[0])) all_probabilities_builder = SArrayBuilder(dtype=array) for batch in loader: if batch.pad is not None: size = batch_size - batch.pad batch_data = _mx.nd.slice_axis(batch.data[0], axis=0, begin=0, end=size) else: batch_data = batch.data[0] size = batch_size num_devices = min(batch_data.shape[0], len(ctx)) split_data = _mx.gluon.utils.split_and_load(batch_data, ctx_list=ctx[:num_devices], even_split=False) for data in split_data: z = self._model(data).asnumpy() predicted = list(map(lambda x: classes[x], z.argmax(axis=1))) split_length = z.shape[0] all_predicted_builder.append_multiple(predicted) all_probabilities_builder.append_multiple(z.tolist()) index += split_length if index == dataset_size - 1: done = True cur_time = _time.time() # Do not print progress if only a few samples are predicted if verbose and (dataset_size >= 5 and cur_time > last_time + 10 or done): print('Predicting {cur_n:{width}d}/{max_n:{width}d}'.format( cur_n = index + 1, max_n = dataset_size, width = len(str(dataset_size)))) last_time = cur_time return (_tc.SFrame({self.target: all_predicted_builder.close(), 'probability': all_probabilities_builder.close()})) def evaluate(self, dataset, metric='auto', batch_size=None, verbose=True): """ Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the feature and target columns used for model training. Additional columns are ignored. metric : str, optional Name of the evaluation metric. Possible values are: - 'auto' : Returns all available metrics. - 'accuracy' : Classification accuracy (micro average). - 'auc' : Area under the ROC curve (macro average) - 'precision' : Precision score (macro average) - 'recall' : Recall score (macro average) - 'f1_score' : F1 score (macro average) - 'confusion_matrix' : An SFrame with counts of possible prediction/true label combinations. - 'roc_curve' : An SFrame containing information needed for an ROC curve verbose : bool, optional If True, prints prediction progress. Returns ------- out : dict Dictionary of evaluation results where the key is the name of the evaluation metric (e.g. `accuracy`) and the value is the evaluation score. See Also ---------- create, predict Examples ---------- .. sourcecode:: python >>> results = model.evaluate(data) >>> print(results['accuracy']) """ if self.target not in dataset.column_names(): raise _ToolkitError("Must provide ground truth column, '" + self.target + "' in the evaluation dataset.") predicted = self._predict_with_probabilities(dataset, batch_size, verbose) avail_metrics = ['accuracy', 'auc', 'precision', 'recall', 'f1_score', 'confusion_matrix', 'roc_curve'] _tkutl._check_categorical_option_type( 'metric', metric, avail_metrics + ['auto']) metrics = avail_metrics if metric == 'auto' else [metric] ret = {} if 'accuracy' in metrics: ret['accuracy'] = _evaluation.accuracy( dataset[self.target], predicted[self.target]) if 'auc' in metrics: ret['auc'] = _evaluation.auc( dataset[self.target], predicted['probability'], index_map=self._class_to_index) if 'precision' in metrics: ret['precision'] = _evaluation.precision( dataset[self.target], predicted[self.target]) if 'recall' in metrics: ret['recall'] = _evaluation.recall( dataset[self.target], predicted[self.target]) if 'f1_score' in metrics: ret['f1_score'] = _evaluation.f1_score( dataset[self.target], predicted[self.target]) if 'confusion_matrix' in metrics: ret['confusion_matrix'] = _evaluation.confusion_matrix( dataset[self.target], predicted[self.target]) if 'roc_curve' in metrics: ret['roc_curve'] = _evaluation.roc_curve( dataset[self.target], predicted['probability'], index_map=self._class_to_index) return ret def predict_topk(self, dataset, output_type="probability", k=3, batch_size=None): """ Return top-k predictions for the ``dataset``, using the trained model. Predictions are returned as an SFrame with three columns: `id`, `class`, and `probability` or `rank`, depending on the ``output_type`` parameter. Parameters ---------- dataset : SFrame | SArray | turicreate.Image | list Drawings to be classified. If dataset is an SFrame, it must include columns with the same names as the features used for model training, but does not require a target column. Additional columns are ignored. output_type : {'probability', 'rank'}, optional Choose the return type of the prediction: - `probability`: Probability associated with each label in the prediction. - `rank` : Rank associated with each label in the prediction. k : int, optional Number of classes to return for each input example. batch_size : int, optional If you are getting memory errors, try decreasing this value. If you have a powerful computer, increasing this value may improve performance. Returns ------- out : SFrame An SFrame with model predictions. See Also -------- predict, evaluate Examples -------- >>> pred = m.predict_topk(validation_data, k=3) >>> pred +----+-------+-------------------+ | id | class | probability | +----+-------+-------------------+ | 0 | 4 | 0.995623886585 | | 0 | 9 | 0.0038311756216 | | 0 | 7 | 0.000301006948575 | | 1 | 1 | 0.928708016872 | | 1 | 3 | 0.0440889261663 | | 1 | 2 | 0.0176190119237 | | 2 | 3 | 0.996967732906 | | 2 | 2 | 0.00151345680933 | | 2 | 7 | 0.000637513934635 | | 3 | 1 | 0.998070061207 | | .. | ... | ... | +----+-------+-------------------+ [35688 rows x 3 columns] """ _tkutl._check_categorical_option_type("output_type", output_type, ["probability", "rank"]) if not isinstance(k, int): raise TypeError("'k' must be an integer >= 1") if k <= 0: raise ValueError("'k' must be >= 1") if batch_size is not None and not isinstance(batch_size, int): raise TypeError("'batch_size' must be an integer >= 1") if batch_size is not None and batch_size < 1: raise ValueError("'batch_size' must be >= 1") prob_vector = self.predict( dataset, output_type='probability_vector', batch_size=batch_size) classes = self.classes if output_type == 'probability': results = prob_vector.apply(lambda p: [ {'class': classes[i], 'probability': p[i]} for i in reversed(_np.argsort(p)[-k:])] ) else: assert(output_type == 'rank') results = prob_vector.apply(lambda p: [ {'class': classes[index], 'rank': rank} for rank, index in enumerate(reversed(_np.argsort(p)[-k:]))] ) results = _tc.SFrame({'X': results}) results = results.add_row_number() results = results.stack('X', new_column_name='X') results = results.unpack('X', column_name_prefix='') return results def predict(self, data, output_type='class', batch_size=None, verbose=True): """ Predict on an SFrame or SArray of drawings, or on a single drawing. Parameters ---------- data : SFrame | SArray | tc.Image | list The drawing(s) on which to perform drawing classification. If dataset is an SFrame, it must have a column with the same name as the feature column during training. Additional columns are ignored. If the data is a single drawing, it can be either of type tc.Image, in which case it is a bitmap-based drawing input, or of type list, in which case it is a stroke-based drawing input. output_type : {'probability', 'class', 'probability_vector'}, optional Form of the predictions which are one of: - 'class': Class prediction. For multi-class classification, this returns the class with maximum probability. - 'probability': Prediction probability associated with the True class (not applicable for multi-class classification) - 'probability_vector': Prediction probability associated with each class as a vector. Label ordering is dictated by the ``classes`` member variable. batch_size : int, optional If you are getting memory errors, try decreasing this value. If you have a powerful computer, increasing this value may improve performance. verbose : bool, optional If True, prints prediction progress. Returns ------- out : SArray An SArray with model predictions. Each element corresponds to a drawing and contains a single value corresponding to the predicted label. Each prediction will have type integer or string depending on the type of the classes the model was trained on. If `data` is a single drawing, the return value will be a single prediction. See Also -------- evaluate Examples -------- .. sourcecode:: python # Make predictions >>> pred = model.predict(data) # Print predictions, for a better overview >>> print(pred) dtype: int Rows: 10 [3, 4, 3, 3, 4, 5, 8, 8, 8, 4] """ _tkutl._check_categorical_option_type("output_type", output_type, ["probability", "class", "probability_vector"]) if isinstance(data, _tc.SArray): predicted = self._predict_with_probabilities( _tc.SFrame({ self.feature: data }), batch_size, verbose ) elif isinstance(data, _tc.SFrame): predicted = self._predict_with_probabilities(data, batch_size, verbose) else: # single input predicted = self._predict_with_probabilities( _tc.SFrame({ self.feature: [data] }), batch_size, verbose ) if output_type == "class": return predicted[self.target] elif output_type == "probability": _class_to_index = self._class_to_index target = self.target return predicted.apply( lambda row: row["probability"][_class_to_index[row[target]]]) else: assert (output_type == "probability_vector") return predicted["probability"]
_str__(
orphanages_view.ts
import Orphanage from '../models/Orphanage'; import imagesView from './images_view'; export default { render(orphanage: Orphanage) { return { id: orphanage.id, name: orphanage.name, latitude: orphanage.latitude, longitude: orphanage.longitude, about: orphanage.about, instructions: orphanage.instructions, opening_hours: orphanage.opening_hours, open_on_weekends: orphanage.open_on_weekends, images: imagesView.renderMany(orphanage.images) } },
renderMany(orphanages: Orphanage[]) { return orphanages.map(orphanage => this.render(orphanage)); } }
lib.rs
// Copyright 2019-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version.
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. //! Parachain specific networking //! //! Provides a custom block announcement implementation for parachains //! that use the relay chain provided consensus. See [`BlockAnnounceValidator`] //! and [`WaitToAnnounce`] for more information about this implementation. use sp_consensus::block_validation::{ BlockAnnounceValidator as BlockAnnounceValidatorT, Validation, }; use sp_core::traits::SpawnNamed; use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, Header as HeaderT}, }; use cumulus_relay_chain_interface::RelayChainInterface; use elexeum_node_primitives::{CollationSecondedSignal, Statement}; use elexeum_parachain::primitives::HeadData; use elexeum_primitives::v1::{ Block as PBlock, CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId, OccupiedCoreAssumption, SigningContext, UncheckedSigned, }; use codec::{Decode, DecodeAll, Encode}; use futures::{channel::oneshot, future::FutureExt, Future}; use std::{convert::TryFrom, fmt, marker::PhantomData, pin::Pin, sync::Arc}; #[cfg(test)] mod tests; const LOG_TARGET: &str = "sync::cumulus"; type BoxedError = Box<dyn std::error::Error + Send>; #[derive(Debug)] struct BlockAnnounceError(String); impl std::error::Error for BlockAnnounceError {} impl fmt::Display for BlockAnnounceError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } /// The data that we attach to a block announcement. /// /// This will be used to prove that a header belongs to a block that is probably being backed by /// the relay chain. #[derive(Encode, Debug)] pub struct BlockAnnounceData { /// The receipt identifying the candidate. receipt: CandidateReceipt, /// The seconded statement issued by a relay chain validator that approves the candidate. statement: UncheckedSigned<CompactStatement>, /// The relay parent that was used as context to sign the [`Self::statement`]. relay_parent: PHash, } impl Decode for BlockAnnounceData { fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> { let receipt = CandidateReceipt::decode(input)?; let statement = UncheckedSigned::<CompactStatement>::decode(input)?; let relay_parent = match PHash::decode(input) { Ok(p) => p, // For being backwards compatible, we support missing relay-chain parent. Err(_) => receipt.descriptor.relay_parent, }; Ok(Self { receipt, statement, relay_parent }) } } impl BlockAnnounceData { /// Validate that the receipt, statement and announced header match. /// /// This will not check the signature, for this you should use [`BlockAnnounceData::check_signature`]. fn validate(&self, encoded_header: Vec<u8>) -> Result<(), Validation> { let candidate_hash = if let CompactStatement::Seconded(h) = self.statement.unchecked_payload() { h } else { tracing::debug!(target: LOG_TARGET, "`CompactStatement` isn't the candidate variant!",); return Err(Validation::Failure { disconnect: true }) }; if *candidate_hash != self.receipt.hash() { tracing::debug!( target: LOG_TARGET, "Receipt candidate hash doesn't match candidate hash in statement", ); return Err(Validation::Failure { disconnect: true }) } if HeadData(encoded_header).hash() != self.receipt.descriptor.para_head { tracing::debug!( target: LOG_TARGET, "Receipt para head hash doesn't match the hash of the header in the block announcement", ); return Err(Validation::Failure { disconnect: true }) } Ok(()) } /// Check the signature of the statement. /// /// Returns an `Err(_)` if it failed. async fn check_signature<RCInterface>( self, relay_chain_client: &RCInterface, ) -> Result<Validation, BlockAnnounceError> where RCInterface: RelayChainInterface + 'static, { let validator_index = self.statement.unchecked_validator_index(); let runtime_api_block_id = BlockId::Hash(self.relay_parent); let session_index = match relay_chain_client.session_index_for_child(&runtime_api_block_id).await { Ok(r) => r, Err(e) => return Err(BlockAnnounceError(format!("{:?}", e))), }; let signing_context = SigningContext { parent_hash: self.relay_parent, session_index }; // Check that the signer is a legit validator. let authorities = match relay_chain_client.validators(&runtime_api_block_id).await { Ok(r) => r, Err(e) => return Err(BlockAnnounceError(format!("{:?}", e))), }; let signer = match authorities.get(validator_index.0 as usize) { Some(r) => r, None => { tracing::debug!( target: LOG_TARGET, "Block announcement justification signer is a validator index out of bound", ); return Ok(Validation::Failure { disconnect: true }) }, }; // Check statement is correctly signed. if self.statement.try_into_checked(&signing_context, &signer).is_err() { tracing::debug!( target: LOG_TARGET, "Block announcement justification signature is invalid.", ); return Ok(Validation::Failure { disconnect: true }) } Ok(Validation::Success { is_new_best: true }) } } impl TryFrom<&'_ CollationSecondedSignal> for BlockAnnounceData { type Error = (); fn try_from(signal: &CollationSecondedSignal) -> Result<BlockAnnounceData, ()> { let receipt = if let Statement::Seconded(receipt) = signal.statement.payload() { receipt.to_plain() } else { return Err(()) }; Ok(BlockAnnounceData { receipt, statement: signal.statement.convert_payload().into(), relay_parent: signal.relay_parent, }) } } /// Parachain specific block announce validator. /// /// This block announce validator is required if the parachain is running /// with the relay chain provided consensus to make sure each node only /// imports a reasonable number of blocks per round. The relay chain provided /// consensus doesn't have any authorities and so it could happen that without /// this special block announce validator a node would need to import *millions* /// of blocks per round, which is clearly not doable. /// /// To solve this problem, each block announcement is delayed until a collator /// has received a [`Statement::Seconded`] for its `PoV`. This message tells the /// collator that its `PoV` was validated successfully by a parachain validator and /// that it is very likely that this `PoV` will be included in the relay chain. Every /// collator that doesn't receive the message for its `PoV` will not announce its block. /// For more information on the block announcement, see [`WaitToAnnounce`]. /// /// For each block announcement that is received, the generic block announcement validation /// will call this validator and provides the extra data that was attached to the announcement. /// We call this extra data `justification`. /// It is expected that the attached data is a SCALE encoded [`BlockAnnounceData`]. The /// statement is checked to be a [`CompactStatement::Candidate`] and that it is signed by an active /// parachain validator. /// /// If no justification was provided we check if the block announcement is at the tip of the known /// chain. If it is at the tip, it is required to provide a justification or otherwise we reject /// it. However, if the announcement is for a block below the tip the announcement is accepted /// as it probably comes from a node that is currently syncing the chain. #[derive(Clone)] pub struct BlockAnnounceValidator<Block, RCInterface> { phantom: PhantomData<Block>, relay_chain_interface: RCInterface, para_id: ParaId, } impl<Block, RCInterface> BlockAnnounceValidator<Block, RCInterface> where RCInterface: Clone, { /// Create a new [`BlockAnnounceValidator`]. pub fn new(relay_chain_interface: RCInterface, para_id: ParaId) -> Self { Self { phantom: Default::default(), relay_chain_interface: relay_chain_interface.clone(), para_id, } } } impl<Block: BlockT, RCInterface> BlockAnnounceValidator<Block, RCInterface> where RCInterface: RelayChainInterface + Clone, { /// Get the included block of the given parachain in the relay chain. async fn included_block( relay_chain_interface: &RCInterface, block_id: &BlockId<PBlock>, para_id: ParaId, ) -> Result<Block::Header, BoxedError> { let validation_data = relay_chain_interface .persisted_validation_data(block_id, para_id, OccupiedCoreAssumption::TimedOut) .await .map_err(|e| Box::new(BlockAnnounceError(format!("{:?}", e))) as Box<_>)? .ok_or_else(|| { Box::new(BlockAnnounceError("Could not find parachain head in relay chain".into())) as Box<_> })?; let para_head = Block::Header::decode(&mut &validation_data.parent_head.0[..]).map_err(|e| { Box::new(BlockAnnounceError(format!("Failed to decode parachain head: {:?}", e))) as Box<_> })?; Ok(para_head) } /// Get the backed block hash of the given parachain in the relay chain. async fn backed_block_hash( relay_chain_interface: &RCInterface, block_id: &BlockId<PBlock>, para_id: ParaId, ) -> Result<Option<PHash>, BoxedError> { let candidate_receipt = relay_chain_interface .candidate_pending_availability(block_id, para_id) .await .map_err(|e| Box::new(BlockAnnounceError(format!("{:?}", e))) as Box<_>)?; Ok(candidate_receipt.map(|cr| cr.descriptor.para_head)) } /// Handle a block announcement with empty data (no statement) attached to it. async fn handle_empty_block_announce_data( &self, header: Block::Header, ) -> Result<Validation, BoxedError> { let relay_chain_interface = self.relay_chain_interface.clone(); let para_id = self.para_id; // Check if block is equal or higher than best (this requires a justification) let relay_chain_best_hash = relay_chain_interface .best_block_hash() .await .map_err(|e| Box::new(e) as Box<_>)?; let runtime_api_block_id = BlockId::Hash(relay_chain_best_hash); let block_number = header.number(); let best_head = Self::included_block(&relay_chain_interface, &runtime_api_block_id, para_id).await?; let known_best_number = best_head.number(); let backed_block = || async { Self::backed_block_hash(&relay_chain_interface, &runtime_api_block_id, para_id).await }; if best_head == header { tracing::debug!(target: LOG_TARGET, "Announced block matches best block.",); Ok(Validation::Success { is_new_best: true }) } else if Some(HeadData(header.encode()).hash()) == backed_block().await? { tracing::debug!(target: LOG_TARGET, "Announced block matches latest backed block.",); Ok(Validation::Success { is_new_best: true }) } else if block_number >= known_best_number { tracing::debug!( target: LOG_TARGET, "Validation failed because a justification is needed if the block at the top of the chain." ); Ok(Validation::Failure { disconnect: false }) } else { Ok(Validation::Success { is_new_best: false }) } } } impl<Block: BlockT, RCInterface> BlockAnnounceValidatorT<Block> for BlockAnnounceValidator<Block, RCInterface> where RCInterface: RelayChainInterface + Clone + 'static, { fn validate( &mut self, header: &Block::Header, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<Validation, BoxedError>> + Send>> { let relay_chain_interface = self.relay_chain_interface.clone(); let mut data = data.to_vec(); let header = header.clone(); let header_encoded = header.encode(); let block_announce_validator = self.clone(); async move { let relay_chain_is_syncing = relay_chain_interface .is_major_syncing() .await .map_err(|e| { tracing::error!(target: LOG_TARGET, "Unable to determine sync status. {}", e) }) .unwrap_or(false); if relay_chain_is_syncing { return Ok(Validation::Success { is_new_best: false }) } if data.is_empty() { return block_announce_validator.handle_empty_block_announce_data(header).await } let block_announce_data = match BlockAnnounceData::decode_all(&mut data) { Ok(r) => r, Err(err) => return Err(Box::new(BlockAnnounceError(format!( "Can not decode the `BlockAnnounceData`: {:?}", err ))) as Box<_>), }; if let Err(e) = block_announce_data.validate(header_encoded) { return Ok(e) } let relay_parent = block_announce_data.receipt.descriptor.relay_parent; relay_chain_interface .wait_for_block(relay_parent) .await .map_err(|e| Box::new(BlockAnnounceError(e.to_string())) as Box<_>)?; block_announce_data .check_signature(&relay_chain_interface) .await .map_err(|e| Box::new(e) as Box<_>) } .boxed() } } /// Wait before announcing a block that a candidate message has been received for this block, then /// add this message as justification for the block announcement. /// /// This object will spawn a new task every time the method `wait_to_announce` is called and cancel /// the previous task running. pub struct WaitToAnnounce<Block: BlockT> { spawner: Arc<dyn SpawnNamed + Send + Sync>, announce_block: Arc<dyn Fn(Block::Hash, Option<Vec<u8>>) + Send + Sync>, } impl<Block: BlockT> WaitToAnnounce<Block> { /// Create the `WaitToAnnounce` object pub fn new( spawner: Arc<dyn SpawnNamed + Send + Sync>, announce_block: Arc<dyn Fn(Block::Hash, Option<Vec<u8>>) + Send + Sync>, ) -> WaitToAnnounce<Block> { WaitToAnnounce { spawner, announce_block } } /// Wait for a candidate message for the block, then announce the block. The candidate /// message will be added as justification to the block announcement. pub fn wait_to_announce( &mut self, block_hash: <Block as BlockT>::Hash, signed_stmt_recv: oneshot::Receiver<CollationSecondedSignal>, ) { let announce_block = self.announce_block.clone(); self.spawner.spawn( "cumulus-wait-to-announce", None, async move { tracing::debug!( target: "cumulus-network", "waiting for announce block in a background task...", ); wait_to_announce::<Block>(block_hash, announce_block, signed_stmt_recv).await; tracing::debug!( target: "cumulus-network", "block announcement finished", ); } .boxed(), ); } } async fn wait_to_announce<Block: BlockT>( block_hash: <Block as BlockT>::Hash, announce_block: Arc<dyn Fn(Block::Hash, Option<Vec<u8>>) + Send + Sync>, signed_stmt_recv: oneshot::Receiver<CollationSecondedSignal>, ) { let signal = match signed_stmt_recv.await { Ok(s) => s, Err(_) => { tracing::debug!( target: "cumulus-network", block = ?block_hash, "Wait to announce stopped, because sender was dropped.", ); return }, }; if let Ok(data) = BlockAnnounceData::try_from(&signal) { announce_block(block_hash, Some(data.encode())); } else { tracing::debug!( target: "cumulus-network", ?signal, block = ?block_hash, "Received invalid statement while waiting to announce block.", ); } }
// Polkadot is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of
subscription.rs
use crate::parser::types::{Selection, TypeCondition}; use crate::{Context, ContextSelectionSet, PathSegment, ServerError, ServerResult, Type}; use futures::{Stream, StreamExt}; use std::pin::Pin; /// A GraphQL subscription object pub trait SubscriptionType: Type { /// This function returns true of type `EmptySubscription` only. #[doc(hidden)] fn is_empty() -> bool { false } #[doc(hidden)] fn create_field_stream<'a>( &'a self, ctx: &'a Context<'a>, ) -> Option<Pin<Box<dyn Stream<Item = ServerResult<serde_json::Value>> + Send + 'a>>>; } type BoxFieldStream<'a> = Pin<Box<dyn Stream<Item = ServerResult<(String, serde_json::Value)>> + 'a + Send>>; pub(crate) fn collect_subscription_streams<'a, T: SubscriptionType + Send + Sync + 'static>( ctx: &ContextSelectionSet<'a>, root: &'a T, streams: &mut Vec<BoxFieldStream<'a>>, ) -> ServerResult<()> { for selection in &ctx.item.node.items { if ctx.is_skip(selection.node.directives())? { continue; } match &selection.node { Selection::Field(field) => streams.push(Box::pin({ let ctx = ctx.clone(); async_stream::stream! { let ctx = ctx.with_field(field); let field_name = ctx .item .node .response_key() .node .as_str(); let stream = root.create_field_stream(&ctx); if let Some(mut stream) = stream { while let Some(item) = stream.next().await { yield match item { Ok(value) => Ok((field_name.to_owned(), value)), Err(e) => Err(e.path(PathSegment::Field(field_name.to_owned()))), }; } } else { yield Err(ServerError::new(format!(r#"Cannot query field "{}" on type "{}"."#, field_name, T::type_name())) .at(ctx.item.pos) .path(PathSegment::Field(field_name.to_owned()))); return; } } })), Selection::FragmentSpread(fragment_spread) => {
.get(&fragment_spread.node.fragment_name.node) { collect_subscription_streams( &ctx.with_selection_set(&fragment.node.selection_set), root, streams, )?; } } Selection::InlineFragment(inline_fragment) => { if let Some(TypeCondition { on: name }) = inline_fragment .node .type_condition .as_ref() .map(|v| &v.node) { if name.node.as_str() == T::type_name() { collect_subscription_streams( &ctx.with_selection_set(&inline_fragment.node.selection_set), root, streams, )?; } } else { collect_subscription_streams( &ctx.with_selection_set(&inline_fragment.node.selection_set), root, streams, )?; } } } } Ok(()) } impl<T: SubscriptionType + Send + Sync> SubscriptionType for &T { fn create_field_stream<'a>( &'a self, ctx: &'a Context<'a>, ) -> Option<Pin<Box<dyn Stream<Item = ServerResult<serde_json::Value>> + Send + 'a>>> { T::create_field_stream(*self, ctx) } }
if let Some(fragment) = ctx .query_env .fragments
service_windows.go
//go:build windows // +build windows package service import ( "golang.org/x/sys/windows/svc" "log" ) type myservice struct { handler func() } func (m *myservice) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) { const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue changes <- svc.Status{State: svc.StartPending} changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} go m.handler() loop: for { select { case c := <-r: switch c.Cmd {
changes <- c.CurrentStatus case svc.Stop, svc.Shutdown: break loop case svc.Pause: changes <- svc.Status{State: svc.Paused, Accepts: cmdsAccepted} case svc.Continue: changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} default: //elog.Error(1, fmt.Sprintf("unexpected control request #%d", c)) } } } changes <- svc.Status{State: svc.StopPending} return } // Returns true if we detected that we are not running in a non-interactive session, and so // launched the service. This function will not return until the service exits. func RunAsService(handler func()) bool { isService, err := svc.IsWindowsService() if err != nil { log.Fatalf("failed to determine if we are running in an interactive session: %v", err) return false } if !isService { return false } serviceName := "" // this doesn't matter when we are a "single-process" service service := &myservice{ handler: handler, } svc.Run(serviceName, service) return true }
case svc.Interrogate:
database.go
package db import ( "database/sql" "fmt" "log" "os" "search-benchmark/engine" _ "github.com/go-sql-driver/mysql" "github.com/lbryio/lbry.go/v2/extras/errors" ) //CREATE TABLE `results` ( // `id` bigint(20) NOT NULL AUTO_INCREMENT, // `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, // `instance` varchar(50) DEFAULT NULL, // `endpoint` varchar(100) DEFAULT NULL, // `description` varchar(255) DEFAULT NULL, // `threshold` float DEFAULT NULL, // `instant_rate` float DEFAULT NULL, // `threshold_rate` float DEFAULT NULL, // `wholesome_rate` float DEFAULT NULL, // `errors` int(11) DEFAULT NULL, // `timing` int(11) DEFAULT NULL, // `version` varchar(120) DEFAULT NULL, // `commit_hash` varchar(120) DEFAULT NULL, // PRIMARY KEY (`id`) //) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 var db *sql.DB func
() error { if db != nil { return errors.Err("db connection already initialized") } var err error password := os.Getenv("BENCHMARK_PASSWORD") host := os.Getenv("BENCHMARK_HOST") user := os.Getenv("BENCHMARK_USER") db, err = sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/benchmark", user, password, host)) if err != nil { return errors.Err(err) } return nil } type Results struct { Instance string Endpoint string Description string Tolerance int InstantRate float64 ThresholdRate float64 WholesomeRate float64 Errors int Timing int64 } func StoreResults(instance string, engine engine.SearchEngine, description string, results Results) error { if db == nil { err := connect() if err != nil { return err } } ver, err := engine.Version() if err != nil { return err } log.Printf("version: %s\ncommit: %s", ver.SemVer, ver.CommitHash) _, err = db.Query("INSERT INTO benchmark.results(`instance`,`endpoint`,`description`,`threshold`,`instant_rate`,`threshold_rate`,`wholesome_rate`,`errors`,`timing`,`version`,`commit_hash`)"+ " values(?,?,?,?,?,?,?,?,?,?,?)", instance, engine.GetEndpoint(), description, results.Tolerance, results.InstantRate, results.ThresholdRate, results.WholesomeRate, results.Errors, results.Timing, ver.SemVer, ver.CommitHash) if err != nil { return errors.Err(err) } return nil }
connect
main.rs
use helpers::input_lines; use std::collections::HashMap; const INPUT: &str = include_str!("../input.txt"); fn are_coprime(mut value1: i64, mut value2: i64) -> bool { // number1 and number2 are coprime if GCD is 1 // We evaluate GCD via Euclid's Algorithm while value1 > 0 && value2 > 0 { if value1 > value2 { value1 %= value2; } else { value2 %= value1; } } (value1 + value2) == 1 } fn paiwise_coprime(values: &[i64]) -> bool { values.iter().enumerate().all(|(index, value1)| { values[index + 1..] .iter() .all(|value2| are_coprime(*value1, *value2)) }) } fn part01(arrival_time: usize, line_numbers: &[Option<usize>]) -> usize { let earliest_departure_to_line_number: HashMap<usize, &usize> = line_numbers .iter() .filter_map(|maybe_line_number| { maybe_line_number.as_ref().map(|line_number| { match arrival_time.checked_rem(*line_number) { Some(0) => (arrival_time, line_number), Some(value) => (arrival_time - value + line_number, line_number), None => unreachable!("Not possible value"), } }) }) .collect(); earliest_departure_to_line_number .keys() .min() .map_or(0, |earliest_departure| { let line_number = *earliest_departure_to_line_number[earliest_departure]; (earliest_departure - arrival_time) * line_number }) } fn positive_module(mut a: i64, mut b: i64) -> i64 { // Evaluate (a % b) and ensures that the result is positive if b < 0 { a *= -1;
} else { a % b } } fn module_inverse(a: i64, b: i64) -> i64 { // Evaluate a^(-1) ≡ 1 (mod b) (1..=b) .find_map(|value| { if (value * a) % b == 1 { Some(value) } else { None } }) .unwrap_or(1) } fn part02(line_numbers: &[Option<usize>]) -> i64 { // Given "7,13,x,x,59,x,31,19" input string // line_numbers will look like // [Some(7), Some(13), None, None, Some(59), None, Some(31), Some(19)] // // We will need to find t such that // 7 * K0 = t // 13 * K1 = t + 1 // 59 * K4 = t + 4 // 31 * K6 = t + 6 // 19 * K7 = t + 7 // Where: Ki are positive integers // // If we generalise we will need to solve // L0 * K0 = t + O0 // L1 * K1 = t + O1 // L2 * K2 = t + O2 // ... // Li * Ki = t + Oi // Where // Li = <line-number i> // Ki = are unknown but by construct are positive integers // Oi = are offsets to the value // // Solving the equations is equivalent to // t ≡ -O0 (mod L0) // t ≡ -O1 (mod L1) // t ≡ -O2 (mod L2) // ... // t ≡ -Oi (mod Li) // This formulation ressamble the one of the Chinese Reminder Theorem. // https://en.wikipedia.org/wiki/Chinese_remainder_theorem // It works only if Li are pairwise coprime // // The implementation works on the following bases // 1. product = L0 * L1 * L2 * ... * Li // 2. partial_i = product / Li // 3. inverse_i, such that (partial_i * inverse_i) ≡ 1 (mod Li) // 4. result = ( // inverse_0 * partial_0 * (-O0) + // inverse_1 * partial_1 * (-O1) + // inverse_2 * partial_2 * (-O2) + // ... // inverse_i * partial_i * (-Oi) // ) % product let li_to_oi: HashMap<_, _> = line_numbers .iter() .enumerate() .filter_map(|(index, maybe_value)| maybe_value.map(|value| (value as i64, index as i64))) .collect(); assert!(paiwise_coprime( &li_to_oi.keys().copied().collect::<Vec<_>>() )); let product = li_to_oi.keys().product(); let partials: HashMap<_, _> = li_to_oi.keys().map(|l_i| (*l_i, product / l_i)).collect(); let inverses: HashMap<_, _> = partials .iter() .map(|(l_i, partial_i)| (*l_i, module_inverse(*partial_i, *l_i))) .collect(); li_to_oi.iter().fold(0, |result, (li, oi)| { positive_module(result + inverses[li] * partials[li] * (-oi), product) }) } fn main() -> anyhow::Result<()> { let lines = input_lines(INPUT)?; let arrival_time: usize = lines[0].parse().unwrap(); let line_numbers: Vec<Option<usize>> = lines[1].split(',').map(|line| line.parse().ok()).collect(); println!("Part 1: {}", part01(arrival_time, &line_numbers)); println!("Part 2: {}", part02(&line_numbers)); Ok(()) }
b *= -1; } if a < 0 { a % b + b
linker.rs
//! This file contains the source code of a dummy linker whose path is going to get passed to //! rustc. Rustc will think that this program is gcc and pass all the arguments to it. Then this //! program will tweak the arguments as needed. use std::collections::HashSet; use std::env; use std::fs::File; use std::io::Write; use std::path::{Path, PathBuf}; use std::process; use std::process::{Command, Stdio}; fn main() { let (args, passthrough) = parse_arguments(); // Write the arguments for the subcommand to pick up. { let mut lib_paths = File::create(Path::new(&args.cargo_apk_libs_path_output)).unwrap(); for lib_path in args.library_path.iter() { writeln!(lib_paths, "{}", lib_path.to_string_lossy()).unwrap(); } let mut libs = File::create(Path::new(&args.cargo_apk_libs_output)).unwrap(); for lib in args.shared_libraries.iter() { writeln!(libs, "{}", lib).unwrap(); } } // Execute the real linker. if Command::new(Path::new(&args.cargo_apk_gcc)) .args(&*passthrough) .arg(args.cargo_apk_native_app_glue) .arg(args.cargo_apk_glue_obj) .arg(args.cargo_apk_glue_lib) .arg("-llog").arg("-landroid") // these two libraries are used by the injected-glue .arg("--sysroot").arg(args.cargo_apk_gcc_sysroot) .arg("-o").arg(args.cargo_apk_linker_output) .arg("-shared") .arg("-Wl,-E") .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) .status().unwrap().code().unwrap() != 0 { println!("Error while executing gcc"); process::exit(1); } } struct
{ // Paths where to search for libraries as passed with the `-L` options. library_path: Vec<PathBuf>, // List of libraries to link to as passed with the `-l` option. shared_libraries: HashSet<String>, cargo_apk_gcc: String, cargo_apk_gcc_sysroot: String, cargo_apk_native_app_glue: String, cargo_apk_glue_obj: String, cargo_apk_glue_lib: String, cargo_apk_linker_output: String, cargo_apk_libs_path_output: String, cargo_apk_libs_output: String, } /// Parses the arguments passed by the CLI and returns two things: the interpretation of some /// arguments, and a list of other arguments that must be passed through to the real linker. fn parse_arguments() -> (Args, Vec<String>) { let mut result_library_path = Vec::new(); let mut result_shared_libraries = HashSet::new(); let mut result_passthrough = Vec::new(); let mut cargo_apk_gcc: Option<String> = None; let mut cargo_apk_gcc_sysroot: Option<String> = None; let mut cargo_apk_native_app_glue: Option<String> = None; let mut cargo_apk_glue_obj: Option<String> = None; let mut cargo_apk_glue_lib: Option<String> = None; let mut cargo_apk_linker_output: Option<String> = None; let mut cargo_apk_libs_path_output: Option<String> = None; let mut cargo_apk_libs_output: Option<String> = None; let args = env::args(); let mut args = args.skip(1); loop { let arg = match args.next() { Some(arg) => arg, None => { let args = Args { library_path: result_library_path, shared_libraries: result_shared_libraries, cargo_apk_gcc: cargo_apk_gcc .expect("Missing cargo_apk_gcc option in linker"), cargo_apk_gcc_sysroot: cargo_apk_gcc_sysroot .expect("Missing cargo_apk_gcc_sysroot option in linker"), cargo_apk_native_app_glue: cargo_apk_native_app_glue .expect("Missing cargo_apk_native_app_glue option in linker"), cargo_apk_glue_obj: cargo_apk_glue_obj .expect("Missing cargo_apk_glue_obj option in linker"), cargo_apk_glue_lib: cargo_apk_glue_lib .expect("Missing cargo_apk_glue_lib option in linker"), cargo_apk_linker_output: cargo_apk_linker_output .expect("Missing cargo_apk_linker_output option in linker"), cargo_apk_libs_path_output: cargo_apk_libs_path_output .expect("Missing cargo_apk_libs_path_output option in linker"), cargo_apk_libs_output: cargo_apk_libs_output .expect("Missing cargo_apk_libs_output option in linker"), }; return (args, result_passthrough); } }; match &*arg { "--cargo-apk-gcc" => { cargo_apk_gcc = Some(args.next().unwrap()); }, "--cargo-apk-gcc-sysroot" => { cargo_apk_gcc_sysroot = Some(args.next().unwrap()); }, "--cargo-apk-native-app-glue" => { cargo_apk_native_app_glue = Some(args.next().unwrap()); }, "--cargo-apk-glue-obj" => { cargo_apk_glue_obj = Some(args.next().unwrap()); }, "--cargo-apk-glue-lib" => { cargo_apk_glue_lib = Some(args.next().unwrap()); }, "--cargo-apk-linker-output" => { cargo_apk_linker_output = Some(args.next().unwrap()); }, "--cargo-apk-libs-path-output" => { cargo_apk_libs_path_output = Some(args.next().unwrap()); }, "--cargo-apk-libs-output" => { cargo_apk_libs_output = Some(args.next().unwrap()); }, "-o" => { // Ignore `-o` and the following argument args.next(); }, "-L" => { let path = args.next().expect("-L must be followed by a path"); result_library_path.push(PathBuf::from(path.clone())); // Also pass these through. result_passthrough.push(arg); result_passthrough.push(path); }, "-l" => { let name = args.next().expect("-l must be followed by a library name"); result_shared_libraries.insert(vec!["lib", &name, ".so"].concat()); // Also pass these through. result_passthrough.push(arg); result_passthrough.push(name); } _ => { if arg.starts_with("-l") { result_shared_libraries.insert(vec!["lib", &arg[2..], ".so"].concat()); } // Also pass these through. result_passthrough.push(arg); } }; } }
Args
commands.rs
//! OlCli Subcommands //! //! This is where you specify the subcommands of your application. //! //! The default application comes with two subcommands: //! //! - `start`: launches the application //! - `version`: print application version //! //! See the `impl Configurable` below for how to specify the path to the //! application's configuration file. mod init_cmd; mod version; mod monitor_cmd; mod mgmt_cmd; mod serve_cmd; mod restore_cmd; mod onboard_cmd; mod query_cmd; mod check_cmd; mod explorer_cmd; use self::{ init_cmd::InitCmd, version::VersionCmd, monitor_cmd::MonitorCmd, mgmt_cmd::MgmtCmd, serve_cmd::ServeCmd, restore_cmd::RestoreCmd, onboard_cmd::OnboardCmd, query_cmd::QueryCmd, check_cmd::CheckCmd, }; use crate::config::OlCliConfig; use abscissa_core::{ config::Override, Command, Configurable, FrameworkError, Help, Options, Runnable, }; use std::path::PathBuf; use dirs; use libra_global_constants::NODE_HOME; use crate::commands::explorer_cmd::ExplorerCMD; /// Filename for all 0L configs pub const CONFIG_FILE: &str = "0L.toml"; /// OlCli Subcommands #[derive(Command, Debug, Options, Runnable)] pub enum OlCliCmd { /// The `help` subcommand #[options(help = "get usage information")] Help(Help<Self>), /// The `start` subcommand #[options(help = "initialize the 0L configs")] Init(InitCmd), /// The `version` subcommand Version(VersionCmd), /// The `monitor` subcommand #[options(help = "monitor the node and upstream")] Monitor(MonitorCmd), /// The `management` subcommand #[options(help = "management tools")] Mgmt(MgmtCmd), /// The `serve` subcommand #[options(help = "serve the monitor over http")] Serve(ServeCmd), /// The `restore` subcommand #[options(help = "restore the database from the epoch-archive repository")] Restore(RestoreCmd), /// The `onboard` subcommand #[options(help = "onboarding validator actions")] Onboard(OnboardCmd), /// The `query` subcommand #[options(help = "run simple queries through subcommands, prints the value to stdout")] Query(QueryCmd), /// The `check` subcommand #[options(help = "run healthcheck on the account, node, and displays some network information")] Check(CheckCmd), /// The `explorer` subcommand #[options(help = "watch a block explorer monitor in terminal")] Explorer(ExplorerCMD), } /// Get home path for all 0L apps pub fn home_path() -> PathBuf
/// This trait allows you to define how application configuration is loaded. impl Configurable<OlCliConfig> for OlCliCmd { /// Location of the configuration file fn config_path(&self) -> Option<PathBuf> { // Check if the config file exists, and if it does not, ignore it. // If you'd like for a missing configuration file to be a hard error // instead, always return `Some(CONFIG_FILE)` here. let mut config_path = home_path(); config_path.push(CONFIG_FILE); if config_path.exists() { Some(config_path) } else { None } } /// Apply changes to the config after it's been loaded, e.g. overriding /// values in a config file using command-line options. /// /// This can be safely deleted if you don't want to override config /// settings from command-line options. fn process_config( &self, config: OlCliConfig, ) -> Result<OlCliConfig, FrameworkError> { match self { OlCliCmd::Init(cmd) => cmd.override_config(config), _ => Ok(config), } } }
{ let mut config_path = dirs::home_dir().unwrap(); config_path.push(NODE_HOME); // config_path.push(CONFIG_FILE); config_path }
vgg.py
# coding:utf-8 ''' python 3.5 mxnet 1.3.0 gluoncv 0.3.0 visdom 0.1.7 gluonbook 0.6.9 auther: helloholmes ''' import mxnet as mx import numpy as np import os import time import pickle from mxnet import gluon from mxnet import init from mxnet import nd from mxnet import autograd from mxnet.gluon import nn class VGG16(nn.HybridBlock): # input size (b, 3, 224, 224) def
(self, num_classes=120, **kwargs): super(VGG16, self).__init__(**kwargs) model = gluon.model_zoo.vision.get_model('vgg16', pretrained=True) with self.name_scope(): self.features = model.features self.output = nn.Dense(num_classes) def initialize(self, ctx=None): for param in self.collect_params().values(): if param._data is not None: continue else: param.initialize() def hybrid_forward(self, F, x): x = self.features(x) x = self.output(x) return x if __name__ == '__main__': m = VGG16() m.initialize() data = mx.nd.random.uniform(shape=(1, 3, 224, 224)) out = m(data) print(out.shape)
__init__
lib.rs
extern crate proc_macro; mod base; mod convert;
mod dummy; mod parse; mod serde; use quote::quote; use syn::parse_macro_input; use crate::parse::IntEnum; #[proc_macro_derive(IntEnum)] pub fn int_enum_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as IntEnum); let int_enum_impl = base::int_enum_impl(&input); let convert_impl = convert::convert_impl(&input); let serde_impl = serde::serde_impl(&input); proc_macro::TokenStream::from(quote! { #int_enum_impl #convert_impl #serde_impl }) }
clipboards.py
# flake8: noqa import sys import subprocess from .exceptions import PyperclipException EXCEPT_MSG = """ Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.org """ PY2 = sys.version_info[0] == 2 text_type = unicode if PY2 else str def init_osx_clipboard(): def copy_osx(text): p = subprocess.Popen(['pbcopy', 'w'], stdin=subprocess.PIPE, close_fds=True) p.communicate(input=text.encode('utf-8')) def paste_osx(): p = subprocess.Popen(['pbpaste', 'r'], stdout=subprocess.PIPE, close_fds=True) stdout, stderr = p.communicate() return stdout.decode('utf-8') return copy_osx, paste_osx def init_gtk_clipboard(): import gtk def copy_gtk(text): global cb cb = gtk.Clipboard() cb.set_text(text) cb.store() def paste_gtk(): clipboardContents = gtk.Clipboard().wait_for_text() # for python 2, returns None if the clipboard is blank. if clipboardContents is None: return '' else: return clipboardContents return copy_gtk, paste_gtk def init_qt_clipboard(): # $DISPLAY should exist from PyQt4.QtGui import QApplication app = QApplication([]) def copy_qt(text): cb = app.clipboard() cb.setText(text) def paste_qt(): cb = app.clipboard() return text_type(cb.text()) return copy_qt, paste_qt def init_xclip_clipboard(): def copy_xclip(text): p = subprocess.Popen(['xclip', '-selection', 'c'], stdin=subprocess.PIPE, close_fds=True) p.communicate(input=text.encode('utf-8')) def paste_xclip(): p = subprocess.Popen(['xclip', '-selection', 'c', '-o'], stdout=subprocess.PIPE, close_fds=True) stdout, stderr = p.communicate() return stdout.decode('utf-8') return copy_xclip, paste_xclip def init_xsel_clipboard(): def copy_xsel(text): p = subprocess.Popen(['xsel', '-b', '-i'], stdin=subprocess.PIPE, close_fds=True) p.communicate(input=text.encode('utf-8')) def paste_xsel(): p = subprocess.Popen(['xsel', '-b', '-o'], stdout=subprocess.PIPE, close_fds=True) stdout, stderr = p.communicate() return stdout.decode('utf-8') return copy_xsel, paste_xsel def
(): def copy_klipper(text): p = subprocess.Popen( ['qdbus', 'org.kde.klipper', '/klipper', 'setClipboardContents', text.encode('utf-8')], stdin=subprocess.PIPE, close_fds=True) p.communicate(input=None) def paste_klipper(): p = subprocess.Popen( ['qdbus', 'org.kde.klipper', '/klipper', 'getClipboardContents'], stdout=subprocess.PIPE, close_fds=True) stdout, stderr = p.communicate() # Workaround for https://bugs.kde.org/show_bug.cgi?id=342874 # TODO: https://github.com/asweigart/pyperclip/issues/43 clipboardContents = stdout.decode('utf-8') # even if blank, Klipper will append a newline at the end assert len(clipboardContents) > 0 # make sure that newline is there assert clipboardContents.endswith('\n') if clipboardContents.endswith('\n'): clipboardContents = clipboardContents[:-1] return clipboardContents return copy_klipper, paste_klipper def init_no_clipboard(): class ClipboardUnavailable(object): def __call__(self, *args, **kwargs): raise PyperclipException(EXCEPT_MSG) if PY2: def __nonzero__(self): return False else: def __bool__(self): return False return ClipboardUnavailable(), ClipboardUnavailable()
init_klipper_clipboard
plot_all.py
import os from robolearn.old_utils.plots.policy_cost import plot_policy_cost from robolearn.old_utils.plots.specific_cost import plot_specific_cost from robolearn.old_utils.plots.duals import plot_duals from robolearn.old_utils.plots.policy_final_distance import plot_policy_final_distance method = 'gps' # 'gps' or 'trajopt' gps_directory_names = ['gps_log1', 'gps_log2'] gps_models_labels = ['gps_log1', 'gps_log2'] states_tuples = [(6, 9), (7, 10), (8, 11)] itr_to_load = None # list(range(8)) block = False plot_cs = True plot_policy_costs = True plot_cost_types = False specific_costs = None #[4] # None for all costs dir_names = [os.path.dirname(os.path.realpath(__file__)) + '/../' + dir_name for dir_name in gps_directory_names] plot_policy_cost(dir_names, itr_to_load=itr_to_load, method=method, gps_models_labels=gps_models_labels, block=block, plot_cs=plot_cs, plot_policy_costs=plot_policy_costs, plot_cost_types=plot_cost_types) plot_specific_cost(dir_names, itr_to_load=itr_to_load, method=method,
gps_models_labels=gps_models_labels, block=block) plot_policy_final_distance(dir_names, states_tuples, itr_to_load=itr_to_load, method=method, gps_models_labels=gps_models_labels, block=block) input('Showing plots. Press a key to close...')
gps_models_labels=gps_models_labels, block=block, specific_costs=specific_costs) plot_duals(dir_names, itr_to_load=itr_to_load, method=method,
issue_watch_test.go
// Copyright 2017 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "testing" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "github.com/stretchr/testify/assert" ) func TestCreateOrUpdateIssueWatch(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) assert.NoError(t, CreateOrUpdateIssueWatch(3, 1, true)) iw := unittest.AssertExistsAndLoadBean(t, &IssueWatch{UserID: 3, IssueID: 1}).(*IssueWatch) assert.True(t, iw.IsWatching) assert.NoError(t, CreateOrUpdateIssueWatch(1, 1, false)) iw = unittest.AssertExistsAndLoadBean(t, &IssueWatch{UserID: 1, IssueID: 1}).(*IssueWatch) assert.False(t, iw.IsWatching) } func TestGetIssueWatch(t *testing.T)
func TestGetIssueWatchers(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) iws, err := GetIssueWatchers(1, db.ListOptions{}) assert.NoError(t, err) // Watcher is inactive, thus 0 assert.Len(t, iws, 0) iws, err = GetIssueWatchers(2, db.ListOptions{}) assert.NoError(t, err) // Watcher is explicit not watching assert.Len(t, iws, 0) iws, err = GetIssueWatchers(5, db.ListOptions{}) assert.NoError(t, err) // Issue has no Watchers assert.Len(t, iws, 0) iws, err = GetIssueWatchers(7, db.ListOptions{}) assert.NoError(t, err) // Issue has one watcher assert.Len(t, iws, 1) }
{ assert.NoError(t, unittest.PrepareTestDatabase()) _, exists, err := GetIssueWatch(9, 1) assert.True(t, exists) assert.NoError(t, err) iw, exists, err := GetIssueWatch(2, 2) assert.True(t, exists) assert.NoError(t, err) assert.False(t, iw.IsWatching) _, exists, err = GetIssueWatch(3, 1) assert.False(t, exists) assert.NoError(t, err) }
table_reader.rs
use crate::block::{Block, BlockIter}; use crate::blockhandle::BlockHandle; use crate::cache; use crate::error::Result; use crate::filter_block::FilterBlockReader; use crate::options::Options; use crate::table_block; use crate::table_builder::{self, Footer}; use crate::types::{current_key_val, RandomAccess, SSIterator}; use std::cmp::Ordering; use std::fs; use std::path; use std::sync::Arc; use integer_encoding::FixedIntWriter; /// Reads the table footer. fn read_footer(f: &dyn RandomAccess, size: usize) -> Result<Footer> { let mut buf = vec![0; table_builder::FULL_FOOTER_LENGTH]; f.read_at(size - table_builder::FULL_FOOTER_LENGTH, &mut buf)?; Ok(Footer::decode(&buf)) } /// `Table` is used for accessing SSTables. #[derive(Clone)] pub struct Table { file: Arc<Box<dyn RandomAccess>>, file_size: usize, cache_id: cache::CacheID, opt: Options, footer: Footer, index_block: Block, filters: Option<FilterBlockReader>, } impl Table { /// Creates a new table reader from a file at `path`. pub fn new_from_file(opt: Options, path: &path::Path) -> Result<Table> { let f = fs::OpenOptions::new().read(true).open(path)?; let size = f.metadata()?.len() as usize; Table::new(opt, Box::new(f), size) } /// Creates a new table reader. pub fn new(opt: Options, file: Box<dyn RandomAccess>, size: usize) -> Result<Table> { let footer = read_footer(file.as_ref(), size)?; let index_block = table_block::read_table_block(opt.clone(), file.as_ref(), &footer.index)?; let metaindex_block = table_block::read_table_block(opt.clone(), file.as_ref(), &footer.meta_index)?; let filter_block_reader = Table::read_filter_block(&metaindex_block, file.as_ref(), &opt)?; let cache_id = { let mut block_cache = opt.block_cache.write()?; block_cache.new_cache_id() }; Ok(Table { file: Arc::new(file), file_size: size, cache_id: cache_id, opt: opt, footer: footer, filters: filter_block_reader, index_block: index_block, }) } fn read_filter_block( metaix: &Block, file: &dyn RandomAccess, options: &Options, ) -> Result<Option<FilterBlockReader>> { // Open filter block for reading let filter_name = format!("filter.{}", options.filter_policy.name()) .as_bytes() .to_vec(); let mut metaindexiter = metaix.iter(); metaindexiter.seek(&filter_name); if let Some((_key, val)) = current_key_val(&metaindexiter) { let filter_block_location = BlockHandle::decode(&val).0; if filter_block_location.size() > 0 { return Ok(Some(table_block::read_filter_block( file, &filter_block_location, options.filter_policy.clone(), )?)); } } Ok(None) } /// block_cache_handle creates a CacheKey for a block with a given offset to be used in the /// block cache. fn block_cache_handle(&self, block_off: usize) -> cache::CacheKey { let mut dst = [0; 2 * 8]; (&mut dst[..8]) .write_fixedint(self.cache_id) .expect("error writing to vec"); (&mut dst[8..]) .write_fixedint(block_off as u64) .expect("error writing to vec"); dst } /// Read a block from the current table at `location`, and cache it in the options' block /// cache. fn read_block(&self, location: &BlockHandle) -> Result<Block> { let cachekey = self.block_cache_handle(location.offset()); let mut block_cache = self.opt.block_cache.write()?; if let Some(block) = block_cache.get(&cachekey) { return Ok(block.clone()); } // Two times as_ref(): First time to get a ref from Rc<>, then one from Box<>. let b = table_block::read_table_block(self.opt.clone(), self.file.as_ref().as_ref(), location)?; // insert a cheap copy (Arc). block_cache.insert(&cachekey, b.clone()); Ok(b) } /// Returns the offset of the block that contains `key`. pub fn approx_offset_of(&self, key: &[u8]) -> usize { let mut iter = self.index_block.iter(); iter.seek(key); if let Some((_, val)) = current_key_val(&iter) { let location = BlockHandle::decode(&val).0; return location.offset(); } return self.footer.meta_index.offset(); } /// Returns an iterator over an SSTable. Iterators hold internal references to the table, so /// make sure to let them expire when not needed anymore. pub fn iter(&self) -> TableIterator { let iter = TableIterator { current_block: None, current_block_off: 0, index_block: self.index_block.iter(), table: self.clone(), }; iter } /// Retrieve an entry for a key from the table. This function uses the attached filters, so /// is better suited if you frequently look for non-existing values (as it will detect the /// non-existence of an entry in a block without having to load the block). pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> { let mut index_iter = self.index_block.iter(); index_iter.seek(key); let handle; if let Some((last_in_block, h)) = current_key_val(&index_iter) { if self.opt.cmp.cmp(key, &last_in_block) == Ordering::Less { handle = BlockHandle::decode(&h).0; } else { return Ok(None); } } else { return Ok(None); } // found correct block. // Check bloom (or whatever) filter if let Some(ref filters) = self.filters { if !filters.key_may_match(handle.offset(), key) { return Ok(None); } } // Read block (potentially from cache) let tb = self.read_block(&handle)?; let mut iter = tb.iter(); // Go to entry and check if it's the wanted entry. iter.seek(key); if let Some((k, v)) = current_key_val(&iter) { if self.opt.cmp.cmp(&k, key) == Ordering::Equal { return Ok(Some(v)); } } Ok(None) } } /// This iterator is a "TwoLevelIterator"; it uses an index block in order to get an offset hint /// into the data blocks. pub struct TableIterator { // A TableIterator is independent of its table (on the syntax level -- it doesn't know its // Table's lifetime). This is mainly required by the dynamic iterators used everywhere, where a // lifetime makes things like returning an iterator from a function neigh-impossible. // // Instead, reference-counted pointers and locks inside the Table ensure that all // TableIterators still share a table. table: Table, current_block: Option<BlockIter>, current_block_off: usize, index_block: BlockIter, } impl TableIterator { // Skips to the entry referenced by the next entry in the index block. // This is called once a block has run out of entries. // Err means corruption or I/O error; Ok(true) means a new block was loaded; Ok(false) means // tht there's no more entries. fn skip_to_next_entry(&mut self) -> Result<bool> { if let Some((_key, val)) = self.index_block.next() { self.load_block(&val).map(|_| true) } else { Ok(false) } } // Load the block at `handle` into `self.current_block` fn load_block(&mut self, handle: &[u8]) -> Result<()> { let (new_block_handle, _) = BlockHandle::decode(handle); let block = self.table.read_block(&new_block_handle)?; self.current_block = Some(block.iter()); self.current_block_off = new_block_handle.offset(); Ok(()) } } impl SSIterator for TableIterator { fn advance(&mut self) -> bool { // Uninitialized case. if self.current_block.is_none()
// Initialized case -- does the current block have more entries? if let Some(ref mut cb) = self.current_block { if cb.advance() { return true; } } // If the current block is exhausted, try loading the next block. self.current_block = None; match self.skip_to_next_entry() { Ok(true) => self.advance(), Ok(false) => { self.reset(); false } // try next block, this might be corruption Err(_) => self.advance(), } } // A call to valid() after seeking is necessary to ensure that the seek worked (e.g., no error // while reading from disk) fn seek(&mut self, to: &[u8]) { // first seek in index block, rewind by one entry (so we get the next smaller index entry), // then set current_block and seek there self.index_block.seek(to); // It's possible that this is a seek past-last; reset in that case. if let Some((past_block, handle)) = current_key_val(&self.index_block) { if self.table.opt.cmp.cmp(to, &past_block) <= Ordering::Equal { // ok, found right block: continue if let Ok(()) = self.load_block(&handle) { // current_block is always set if load_block() returned Ok. self.current_block.as_mut().unwrap().seek(to); return; } } } // Reached in case of failure. self.reset(); } fn prev(&mut self) -> bool { // happy path: current block contains previous entry if let Some(ref mut cb) = self.current_block { if cb.prev() { return true; } } // Go back one block and look for the last entry in the previous block if self.index_block.prev() { if let Some((_, handle)) = current_key_val(&self.index_block) { if self.load_block(&handle).is_ok() { self.current_block.as_mut().unwrap().seek_to_last(); self.current_block.as_ref().unwrap().valid() } else { self.reset(); false } } else { false } } else { false } } fn reset(&mut self) { self.index_block.reset(); self.current_block = None; } // This iterator is special in that it's valid even before the first call to advance(). It // behaves correctly, though. fn valid(&self) -> bool { self.current_block.is_some() && (self.current_block.as_ref().unwrap().valid()) } fn current(&self, key: &mut Vec<u8>, val: &mut Vec<u8>) -> bool { if let Some(ref cb) = self.current_block { cb.current(key, val) } else { false } } fn current_key(&self) -> Option<&[u8]> { if let Some(ref cb) = self.current_block { cb.current_key() } else { None } } } #[cfg(test)] mod tests { use crate::options::CompressionType; use crate::table_builder::TableBuilder; use crate::test_util::{test_iterator_properties, SSIteratorIter}; use crate::types::{current_key_val, SSIterator}; use super::*; const LOCK_POISONED: &str = "Lock poisoned"; fn build_data() -> Vec<(&'static str, &'static str)> { vec![ // block 1 ("abc", "def"), ("abd", "dee"), ("bcd", "asa"), // block 2 ("bsr", "a00"), ("xyz", "xxx"), ("xzz", "yyy"), // block 3 ("zzz", "111"), ] } // Build a table containing raw keys (no format). It returns (vector, length) for convenience // reason, a call f(v, v.len()) doesn't work for borrowing reasons. fn build_table(data: Vec<(&'static str, &'static str)>) -> (Vec<u8>, usize) { let mut d = Vec::with_capacity(512); let mut opt = Options::default(); opt.block_restart_interval = 2; opt.block_size = 32; opt.compression_type = CompressionType::CompressionSnappy; { // Uses the standard comparator in opt. let mut b = TableBuilder::new(opt, &mut d); for &(k, v) in data.iter() { b.add(k.as_bytes(), v.as_bytes()).unwrap(); } b.finish().unwrap(); } let size = d.len(); (d, size) } fn wrap_buffer(src: Vec<u8>) -> Box<dyn RandomAccess> { Box::new(src) } #[test] fn test_table_approximate_offset() { let (src, size) = build_table(build_data()); let mut opt = Options::default(); opt.block_size = 32; let table = Table::new(opt, wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); let expected_offsets = vec![0, 0, 0, 44, 44, 44, 89]; let mut i = 0; for (k, _) in SSIteratorIter::wrap(&mut iter) { assert_eq!(expected_offsets[i], table.approx_offset_of(&k)); i += 1; } // Key-past-last returns offset of metaindex block. assert_eq!(137, table.approx_offset_of("{aa".as_bytes())); } #[test] fn test_table_block_cache_use() { let (src, size) = build_table(build_data()); let mut opt = Options::default(); opt.block_size = 32; let table = Table::new(opt.clone(), wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); // index/metaindex blocks are not cached. That'd be a waste of memory. assert_eq!(opt.block_cache.read().expect(LOCK_POISONED).count(), 0); iter.next(); assert_eq!(opt.block_cache.read().expect(LOCK_POISONED).count(), 1); // This may fail if block parameters or data change. In that case, adapt it. iter.next(); iter.next(); iter.next(); iter.next(); assert_eq!(opt.block_cache.read().expect(LOCK_POISONED).count(), 2); } #[test] fn test_table_iterator_fwd_bwd() { let (src, size) = build_table(build_data()); let data = build_data(); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); let mut i = 0; while let Some((k, v)) = iter.next() { assert_eq!( (data[i].0.as_bytes(), data[i].1.as_bytes()), (k.as_ref(), v.as_ref()) ); i += 1; } assert_eq!(i, data.len()); assert!(!iter.valid()); // Go forward again, to last entry. while let Some((key, _)) = iter.next() { if key.as_slice() == b"zzz" { break; } } assert!(iter.valid()); // backwards count let mut j = 0; while iter.prev() { if let Some((k, v)) = current_key_val(&iter) { j += 1; assert_eq!( ( data[data.len() - 1 - j].0.as_bytes(), data[data.len() - 1 - j].1.as_bytes() ), (k.as_ref(), v.as_ref()) ); } else { break; } } // expecting 7 - 1, because the last entry that the iterator stopped on is the last entry // in the table; that is, it needs to go back over 6 entries. assert_eq!(j, 6); } #[test] fn test_table_iterator_filter() { let (src, size) = build_table(build_data()); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); assert!(table.filters.is_some()); let filter_reader = table.filters.clone().unwrap(); let mut iter = table.iter(); loop { if let Some((k, _)) = iter.next() { assert!(filter_reader.key_may_match(iter.current_block_off, &k)); assert!(!filter_reader.key_may_match(iter.current_block_off, b"somerandomkey")); } else { break; } } } #[test] fn test_table_iterator_state_behavior() { let (src, size) = build_table(build_data()); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); // behavior test // See comment on valid() assert!(!iter.valid()); assert!(current_key_val(&iter).is_none()); assert!(!iter.prev()); assert!(iter.advance()); let first = current_key_val(&iter); assert!(iter.valid()); assert!(current_key_val(&iter).is_some()); assert!(iter.advance()); assert!(iter.prev()); assert!(iter.valid()); iter.reset(); assert!(!iter.valid()); assert!(current_key_val(&iter).is_none()); assert_eq!(first, iter.next()); } #[test] fn test_table_iterator_behavior_standard() { let mut data = build_data(); data.truncate(4); let (src, size) = build_table(data); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); test_iterator_properties(table.iter()); } #[test] fn test_table_iterator_values() { let (src, size) = build_table(build_data()); let data = build_data(); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); let mut i = 0; iter.next(); iter.next(); // Go back to previous entry, check, go forward two entries, repeat // Verifies that prev/next works well. loop { iter.prev(); if let Some((k, v)) = current_key_val(&iter) { assert_eq!( (data[i].0.as_bytes(), data[i].1.as_bytes()), (k.as_ref(), v.as_ref()) ); } else { break; } i += 1; if iter.next().is_none() || iter.next().is_none() { break; } } // Skipping the last value because the second next() above will break the loop assert_eq!(i, 6); } #[test] fn test_table_iterator_seek() { let (src, size) = build_table(build_data()); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); let mut iter = table.iter(); iter.seek(b"bcd"); assert!(iter.valid()); assert_eq!( current_key_val(&iter), Some((b"bcd".to_vec(), b"asa".to_vec())) ); iter.seek(b"abc"); assert!(iter.valid()); assert_eq!( current_key_val(&iter), Some((b"abc".to_vec(), b"def".to_vec())) ); // Seek-past-last invalidates. iter.seek("{{{".as_bytes()); assert!(!iter.valid()); iter.seek(b"bbb"); assert!(iter.valid()); } #[test] fn test_table_get() { let (src, size) = build_table(build_data()); let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); let table2 = table.clone(); let mut _iter = table.iter(); // Test that all of the table's entries are reachable via get() for (k, v) in SSIteratorIter::wrap(&mut _iter) { let r = table2.get(&k); assert_eq!(Ok(Some(v)), r); } assert_eq!( table.opt.block_cache.read().expect(LOCK_POISONED).count(), 3 ); // test that filters work and don't return anything at all. assert!(table.get(b"aaa").unwrap().is_none()); assert!(table.get(b"aaaa").unwrap().is_none()); assert!(table.get(b"aa").unwrap().is_none()); assert!(table.get(b"abcd").unwrap().is_none()); assert!(table.get(b"abb").unwrap().is_none()); assert!(table.get(b"xyy").unwrap().is_none()); assert!(table.get(b"zzy").unwrap().is_none()); assert!(table.get(b"zz1").unwrap().is_none()); assert!(table.get("zz{".as_bytes()).unwrap().is_none()); } #[test] fn test_table_reader_checksum() { let (mut src, size) = build_table(build_data()); src[10] += 1; let table = Table::new(Options::default(), wrap_buffer(src), size).unwrap(); assert!(table.filters.is_some()); assert_eq!(table.filters.as_ref().unwrap().num(), 1); { let mut _iter = table.iter(); let iter = SSIteratorIter::wrap(&mut _iter); // first block is skipped assert_eq!(iter.count(), 4); } { let mut _iter = table.iter(); let iter = SSIteratorIter::wrap(&mut _iter); for (k, _) in iter { if k == build_data()[5].0.as_bytes() { return; } } panic!("Should have hit 5th record in table!"); } } }
{ match self.skip_to_next_entry() { Ok(true) => return self.advance(), Ok(false) => { self.reset(); return false; } // try next block from index, this might be corruption Err(_) => return self.advance(), } }
test.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2021 Taylor C. Richberger # This code is released under the license described in the LICENSE file import unittest from datetime import timedelta from tempfile import TemporaryDirectory import time from pathlib import Path from expiringsqlitedict import SqliteDict, AutocommitSqliteDict from typing import Any import json class JsonSerializer: @staticmethod def loads(data: bytes) -> Any: return json.loads(data.decode('utf-8')) @staticmethod def dumps(value: Any) -> bytes: return json.dumps(value).encode('utf-8') class TestExpiringDict(unittest.TestCase): def test_simple(self): with TemporaryDirectory() as temporary_directory: db_path = Path(temporary_directory) / 'test.db' with SqliteDict(db_path) as d: self.assertFalse(bool(d)) self.assertEqual(set(d), set()) self.assertEqual(set(d.keys()), set()) self.assertEqual(set(d.items()), set()) self.assertEqual(set(d.values()), set()) self.assertEqual(len(d), 0) d['foo'] = 'bar' d['baz'] = 1337 with SqliteDict(db_path) as d: self.assertTrue(bool(d)) self.assertEqual(set(d), {'foo', 'baz'}) self.assertEqual(set(d.keys()), {'foo', 'baz'}) self.assertEqual(set(d.items()), {('foo', 'bar'), ('baz', 1337)}) self.assertEqual(set(d.values()), {'bar', 1337}) self.assertEqual(len(d), 2) def test_autocommit(self): with TemporaryDirectory() as temporary_directory: db_path = Path(temporary_directory) / 'test.db' d = AutocommitSqliteDict(db_path) self.assertFalse(bool(d)) self.assertEqual(set(d), set()) self.assertEqual(set(d.keys()), set()) self.assertEqual(set(d.items()), set()) self.assertEqual(set(d.values()), set()) self.assertEqual(len(d), 0) d['foo'] = 'bar' d['baz'] = 1337 d = AutocommitSqliteDict(db_path) self.assertTrue(bool(d)) self.assertEqual(set(d), {'foo', 'baz'}) self.assertEqual(set(d.keys()), {'foo', 'baz'}) self.assertEqual(set(d.items()), {('foo', 'bar'), ('baz', 1337)}) self.assertEqual(set(d.values()), {'bar', 1337}) self.assertEqual(len(d), 2) def test_nested(self): with TemporaryDirectory() as temporary_directory: db_path = Path(temporary_directory) / 'test.db' with SqliteDict(db_path) as d: d['foo'] = {'foo': 'bar', 'baz': [2, 'two']} with SqliteDict(db_path) as d: self.assertEqual(d['foo'], {'foo': 'bar', 'baz': [2, 'two']}) def test_json(self): with TemporaryDirectory() as temporary_directory: db_path = Path(temporary_directory) / 'test.db' with SqliteDict(db_path, serializer = JsonSerializer()) as d: d['foo'] = {'foo': 'bar', 'baz': [2, 'two']} with SqliteDict(db_path, serializer = JsonSerializer()) as d: self.assertEqual(d['foo'], {'foo': 'bar', 'baz': [2, 'two']})
db_path = Path(temporary_directory) / 'test.db' with SqliteDict(db_path, lifespan=timedelta(seconds=1)) as d: d['foo'] = 'bar' d['postponed'] = 'worked' time.sleep(2.0) with SqliteDict(db_path) as d: d.postpone('postponed') d['baz'] = 1337 with SqliteDict(db_path) as d: self.assertTrue(bool(d)) self.assertEqual(set(d), {'baz', 'postponed'}) self.assertEqual(set(d.keys()), {'baz', 'postponed'}) self.assertEqual(set(d.items()), {('baz', 1337), ('postponed', 'worked')}) self.assertEqual(set(d.values()), {1337, 'worked'}) self.assertEqual(len(d), 2) if __name__ == '__main__': unittest.main()
def test_expire(self): with TemporaryDirectory() as temporary_directory:
double_metaphone_result.rs
/// Metaphone Double result #[derive(Debug, PartialEq)] pub struct DoubleMetaphoneResult { /// Primary metaphone pub primary: String, /// Alternate metaphone pub alternate: String, max_length: usize } impl DoubleMetaphoneResult { pub fn new(length: i32) -> DoubleMetaphoneResult { DoubleMetaphoneResult { primary: String::with_capacity(length as usize), alternate: String::with_capacity(length as usize), max_length: length as usize } } pub fn is_complete(&mut self) -> bool { self.primary.len() >= self.max_length && self.alternate.len() >= self.max_length } pub fn append_primary(&mut self, letter: char) { self.primary.push(letter); } pub fn append_alternate(&mut self, letter: char) { self.alternate.push(letter); } pub fn
(&mut self, letter: char) { self.primary.push(letter); self.alternate.push(letter); } pub fn cleanup(&mut self) { if self.primary.len() > self.max_length { self.primary.truncate(self.max_length); } if self.alternate.len() > self.max_length { self.alternate.truncate(self.max_length); } } }
append
gds-row.tsx
type GdsRowProps = { id?: string children: any } export default function GdsRow({ id, children }: GdsRowProps) { return ( <tr id={id} className="govuk-table__row">
</tr> ) }
{children}
nlargestelement.py
# Python program to find N largest # element from given list of integers # Function returns N largest elements def Nmaxelements(list1, N):
# Driver code list1 = [2, 6, 41, 85, 0, 3, 7, 6, 10] N = 2 # Calling the function Nmaxelements(list1, N)
final_list = [] for i in range(0, N): max1 = 0 for j in range(len(list1)): if list1[j] > max1: max1 = list1[j]; list1.remove(max1); final_list.append(max1) print(final_list)
star.py
"""Data model of a star.""" import typing import pint from . import base, planet from .. import UNITS _LUM_SUN: pint.Quantity = 382.8e24 * UNITS.watt _MASS_SUN: pint.Quantity = 1988500e24 * UNITS.kg class
(base.LuminousCelestialBody[planet.Planet]): """Class describing a star. :param luminosity: the star's luminosity :type luminosity: pint.Quantity['energy'] :param temperature: the start's temperature :type temperature: pint.Quantity['temperature'] :param satellites: a sequence of satellites :type satellites: typing.Sequence[base.Orbit[planet.Planet]] """ def __init__( self, luminosity: pint.Quantity, temperature: pint.Quantity, satellites: typing.Sequence[base.Orbit[planet.Planet]], ) -> None: """Initialize a new instance of a star.""" super().__init__(satellites) self._luminosity: pint.Quantity = luminosity self._temperature: pint.Quantity = temperature self._mass: typing.Optional[pint.Quantity] = None @property def luminosity(self) -> pint.Quantity: """Return the luminosity of the star. :return: the star's luminosity :rtype: pint.Quantity['energy'] """ return self._luminosity @property def temperature(self) -> pint.Quantity: """Return the star's temperature. :return: the star's temperature. :rtype: pint.Quantity['temperature'] """ return self._temperature @property def radius(self) -> pint.Quantity: """Return the estimated radius of the star.""" raise NotImplementedError('TODO: look up radius formula') @property def mass(self) -> pint.Quantity: r"""Return the estimated mass of the star. The mass is derived from the luminosity. The following interpolation formula is used, which has been taken from :cite:p:`Sewell:2012`: .. math:: M / M_{sun} = 0.967 (L / L_{sun})^0.255 + 5.19\times10^{-5}(L / L_{sun}) - 0.0670 :return: the estimated mass of the star :rtype: pint.Quantity['mass'] """ if self._mass is None: lum_rel = self.luminosity / _LUM_SUN mass_rel = 0.967 * lum_rel ** 0.255 + 5.19e-5 * lum_rel - 0.0670 self._mass = mass_rel * _MASS_SUN return self._mass
Star
215-kth-largest-element.py
from random import randint class Solution(object): def findKthLargest(self, nums, k): """ :type nums: List[int] :type k: int :rtype: int """ left = 0 right = len(nums) - 1 while left <= right: pivot_idx = randint(left, right) new_pivot = self.partitionAroundIndex(nums, left, right, pivot_idx) if new_pivot == k - 1: return nums[new_pivot] elif new_pivot > k - 1: right = new_pivot - 1 else:
pivot = nums[idx] new_pivot = left # Swap pivot with right nums[idx], nums[right] = nums[right], nums[idx] for x in xrange(left, right): if nums[x] > pivot: nums[x], nums[new_pivot] = nums[new_pivot], nums[x] new_pivot += 1 # Swap pivot back in nums[new_pivot], nums[right] = nums[right], nums[new_pivot] return new_pivot # Explanation # The task is to find the kth largest element for a given array. We can use # a partitioning system similar to quicksort to achieve this without sorting. # We simply use a similar system to QuickSort, wherein we pick a random pivot, # and partition the list into sublists. We're guaranteed that the new_pivot is # sorted correctly in the list. Thus, we do a binary-search-esque approach to # keep partitioning until we get new_pivot == k. Then, just return the current # value at nums[k]. # Runtime - Worst: O(n^2), Average: O(nlogn) # Just like with Quicksort, we could get very unlucky with our random pivot # indices, and end up having to sort the entire array to get k. However, # on average, we will run a fraction of the entire Quicksort, so runtime will # be something like O(nlogn / c), which is O(nlogn) # Space Complexity - O(1) # The sorting / partitioning operation is done in place.
left = new_pivot + 1 def partitionAroundIndex(self, nums, left, right, idx):
WAF-SizeConstraintSet.go
package resources // Code generated by go generate; DO NOT EDIT. // It's generated by "github.com/KablamoOSS/kombustion/generate" import ( "fmt" "github.com/KablamoOSS/kombustion/types" yaml "github.com/KablamoOSS/yaml" ) // WAFSizeConstraintSet Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-waf-sizeconstraintset.html type WAFSizeConstraintSet struct { Type string `yaml:"Type"` Properties WAFSizeConstraintSetProperties `yaml:"Properties"` Condition interface{} `yaml:"Condition,omitempty"` Metadata interface{} `yaml:"Metadata,omitempty"` DependsOn interface{} `yaml:"DependsOn,omitempty"` } // WAFSizeConstraintSet Properties type WAFSizeConstraintSetProperties struct {
// NewWAFSizeConstraintSet constructor creates a new WAFSizeConstraintSet func NewWAFSizeConstraintSet(properties WAFSizeConstraintSetProperties, deps ...interface{}) WAFSizeConstraintSet { return WAFSizeConstraintSet{ Type: "AWS::WAF::SizeConstraintSet", Properties: properties, DependsOn: deps, } } // ParseWAFSizeConstraintSet parses WAFSizeConstraintSet func ParseWAFSizeConstraintSet( name string, data string, ) ( source string, conditions types.TemplateObject, metadata types.TemplateObject, mappings types.TemplateObject, outputs types.TemplateObject, parameters types.TemplateObject, resources types.TemplateObject, transform types.TemplateObject, errors []error, ) { source = "kombustion-core-resources" var resource WAFSizeConstraintSet err := yaml.Unmarshal([]byte(data), &resource) if err != nil { errors = append(errors, err) return } if validateErrs := resource.Properties.Validate(); len(errors) > 0 { errors = append(errors, validateErrs...) return } resources = types.TemplateObject{name: resource} return } // ParseWAFSizeConstraintSet validator func (resource WAFSizeConstraintSet) Validate() []error { return resource.Properties.Validate() } // ParseWAFSizeConstraintSetProperties validator func (resource WAFSizeConstraintSetProperties) Validate() []error { errors := []error{} if resource.Name == nil { errors = append(errors, fmt.Errorf("Missing required field 'Name'")) } if resource.SizeConstraints == nil { errors = append(errors, fmt.Errorf("Missing required field 'SizeConstraints'")) } return errors }
Name interface{} `yaml:"Name"` SizeConstraints interface{} `yaml:"SizeConstraints"` }
error.rs
use opaque::*; use buffer::*; pub struct Error { pub code: u8, pub msg: String, } #[no_mangle] pub struct _Error; #[no_mangle] pub unsafe extern "C" fn error_msg(error: *mut _Error) -> Buffer { let error = OpaquePtr::<Error>::from_opaque(error); Buffer::from_str(&error.msg) } #[no_mangle] pub unsafe extern "C" fn error_free(error: *mut _Error) { let error = OpaquePtr::<Error>::from_opaque(error); error.free();
}
format.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! HTML formatting module //! //! This module contains a large number of `fmt::Display` implementations for //! various types in `rustdoc::clean`. These implementations all currently //! assume that HTML output is desired, although it may be possible to redesign //! them in the future to instead emit any format desired. use std::fmt; use std::iter::repeat; use rustc::hir::def_id::DefId; use syntax::abi::Abi; use rustc::hir; use clean::{self, PrimitiveType}; use core::DocAccessLevels; use html::item_type::ItemType; use html::escape::Escape; use html::render; use html::render::{cache, CURRENT_LOCATION_KEY}; /// Helper to render an optional visibility with a space after it (if the /// visibility is preset) #[derive(Copy, Clone)] pub struct VisSpace<'a>(pub &'a Option<clean::Visibility>); /// Similarly to VisSpace, this structure is used to render a function style with a /// space after it. #[derive(Copy, Clone)] pub struct UnsafetySpace(pub hir::Unsafety); /// Similarly to VisSpace, this structure is used to render a function constness /// with a space after it. #[derive(Copy, Clone)] pub struct ConstnessSpace(pub hir::Constness); /// Wrapper struct for properly emitting a method declaration. pub struct Method<'a>(pub &'a clean::FnDecl, pub usize); /// Similar to VisSpace, but used for mutability #[derive(Copy, Clone)] pub struct MutableSpace(pub clean::Mutability); /// Similar to VisSpace, but used for mutability #[derive(Copy, Clone)] pub struct RawMutableSpace(pub clean::Mutability); /// Wrapper struct for emitting a where clause from Generics. pub struct WhereClause<'a>(pub &'a clean::Generics, pub usize); /// Wrapper struct for emitting type parameter bounds. pub struct TyParamBounds<'a>(pub &'a [clean::TyParamBound]); /// Wrapper struct for emitting a comma-separated list of items pub struct CommaSep<'a, T: 'a>(pub &'a [T]); pub struct AbiSpace(pub Abi); pub struct HRef<'a> { pub did: DefId, pub text: &'a str, } impl<'a> VisSpace<'a> { pub fn get(self) -> &'a Option<clean::Visibility> { let VisSpace(v) = self; v } } impl UnsafetySpace { pub fn get(&self) -> hir::Unsafety { let UnsafetySpace(v) = *self; v } } impl ConstnessSpace { pub fn get(&self) -> hir::Constness { let ConstnessSpace(v) = *self; v } } impl<'a, T: fmt::Display> fmt::Display for CommaSep<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for (i, item) in self.0.iter().enumerate() { if i != 0 { write!(f, ", ")?; } fmt::Display::fmt(item, f)?; } Ok(()) } } impl<'a> fmt::Display for TyParamBounds<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let &TyParamBounds(bounds) = self; for (i, bound) in bounds.iter().enumerate() { if i > 0 { f.write_str(" + ")?; } fmt::Display::fmt(bound, f)?; } Ok(()) } } impl fmt::Display for clean::Generics { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.lifetimes.is_empty() && self.type_params.is_empty() { return Ok(()) } if f.alternate() { f.write_str("<")?; } else { f.write_str("&lt;")?; } for (i, life) in self.lifetimes.iter().enumerate() { if i > 0 { f.write_str(", ")?; } write!(f, "{}", *life)?; } if !self.type_params.is_empty() { if !self.lifetimes.is_empty() { f.write_str(", ")?; } for (i, tp) in self.type_params.iter().enumerate() { if i > 0 { f.write_str(", ")? } f.write_str(&tp.name)?; if !tp.bounds.is_empty() { if f.alternate() { write!(f, ": {:#}", TyParamBounds(&tp.bounds))?; } else { write!(f, ":&nbsp;{}", TyParamBounds(&tp.bounds))?; } } if let Some(ref ty) = tp.default { if f.alternate() { write!(f, " = {:#}", ty)?; } else { write!(f, "&nbsp;=&nbsp;{}", ty)?; } }; } } if f.alternate() { f.write_str(">")?; } else { f.write_str("&gt;")?; } Ok(()) } } impl<'a> fmt::Display for WhereClause<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let &WhereClause(gens, pad) = self; if gens.where_predicates.is_empty() { return Ok(()); } let mut clause = String::new(); if f.alternate() { clause.push_str(" where "); } else { clause.push_str(" <span class='where'>where "); } for (i, pred) in gens.where_predicates.iter().enumerate() { if i > 0 { if f.alternate() { clause.push_str(", "); } else { clause.push_str(",<br>"); } } match pred { &clean::WherePredicate::BoundPredicate { ref ty, ref bounds } => { let bounds = bounds; if f.alternate() { clause.push_str(&format!("{:#}: {:#}", ty, TyParamBounds(bounds))); } else { clause.push_str(&format!("{}: {}", ty, TyParamBounds(bounds))); } } &clean::WherePredicate::RegionPredicate { ref lifetime, ref bounds } => { clause.push_str(&format!("{}: ", lifetime)); for (i, lifetime) in bounds.iter().enumerate() { if i > 0 { clause.push_str(" + "); } clause.push_str(&format!("{}", lifetime)); } } &clean::WherePredicate::EqPredicate { ref lhs, ref rhs } => { if f.alternate() { clause.push_str(&format!("{:#} == {:#}", lhs, rhs)); } else { clause.push_str(&format!("{} == {}", lhs, rhs)); } } } } if !f.alternate() { clause.push_str("</span>"); let plain = format!("{:#}", self); if plain.len() + pad > 80 { //break it onto its own line regardless, but make sure method impls and trait //blocks keep their fixed padding (2 and 9, respectively) let padding = if pad > 10 { clause = clause.replace("class='where'", "class='where fmt-newline'"); repeat("&nbsp;").take(8).collect::<String>() } else { repeat("&nbsp;").take(pad + 6).collect::<String>() }; clause = clause.replace("<br>", &format!("<br>{}", padding)); } else { clause = clause.replace("<br>", " "); } } write!(f, "{}", clause) } } impl fmt::Display for clean::Lifetime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.get_ref())?; Ok(()) } } impl fmt::Display for clean::PolyTrait { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if !self.lifetimes.is_empty() { if f.alternate() { f.write_str("for<")?; } else { f.write_str("for&lt;")?; } for (i, lt) in self.lifetimes.iter().enumerate() { if i > 0 { f.write_str(", ")?; } write!(f, "{}", lt)?; } if f.alternate() { f.write_str("> ")?; } else { f.write_str("&gt; ")?; } } if f.alternate() { write!(f, "{:#}", self.trait_) } else { write!(f, "{}", self.trait_) } } } impl fmt::Display for clean::TyParamBound { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { clean::RegionBound(ref lt) => { write!(f, "{}", *lt) } clean::TraitBound(ref ty, modifier) => { let modifier_str = match modifier { hir::TraitBoundModifier::None => "", hir::TraitBoundModifier::Maybe => "?", }; if f.alternate() { write!(f, "{}{:#}", modifier_str, *ty) } else { write!(f, "{}{}", modifier_str, *ty) } } } } } impl fmt::Display for clean::PathParameters { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { clean::PathParameters::AngleBracketed { ref lifetimes, ref types, ref bindings } => { if !lifetimes.is_empty() || !types.is_empty() || !bindings.is_empty() { if f.alternate() { f.write_str("<")?; } else { f.write_str("&lt;")?; } let mut comma = false; for lifetime in lifetimes { if comma { f.write_str(", ")?; } comma = true; write!(f, "{}", *lifetime)?; } for ty in types { if comma { f.write_str(", ")?; } comma = true; if f.alternate() { write!(f, "{:#}", *ty)?; } else { write!(f, "{}", *ty)?; } } for binding in bindings { if comma { f.write_str(", ")?; } comma = true; if f.alternate() { write!(f, "{:#}", *binding)?; } else { write!(f, "{}", *binding)?; } } if f.alternate() { f.write_str(">")?; } else { f.write_str("&gt;")?; } } } clean::PathParameters::Parenthesized { ref inputs, ref output } => { f.write_str("(")?; let mut comma = false; for ty in inputs { if comma { f.write_str(", ")?; } comma = true; if f.alternate() { write!(f, "{:#}", *ty)?; } else { write!(f, "{}", *ty)?; } } f.write_str(")")?; if let Some(ref ty) = *output { if f.alternate() { write!(f, " -> {:#}", ty)?; } else { write!(f, " -&gt; {}", ty)?; } } } } Ok(()) } } impl fmt::Display for clean::PathSegment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(&self.name)?; if f.alternate() { write!(f, "{:#}", self.params) } else { write!(f, "{}", self.params) } } } impl fmt::Display for clean::Path { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.global { f.write_str("::")? } for (i, seg) in self.segments.iter().enumerate() { if i > 0 { f.write_str("::")? } if f.alternate() { write!(f, "{:#}", seg)?; } else { write!(f, "{}", seg)?; } } Ok(()) } } pub fn href(did: DefId) -> Option<(String, ItemType, Vec<String>)> { let cache = cache(); if !did.is_local() && !cache.access_levels.is_doc_reachable(did) { return None } let loc = CURRENT_LOCATION_KEY.with(|l| l.borrow().clone()); let (fqp, shortty, mut url) = match cache.paths.get(&did) { Some(&(ref fqp, shortty)) => { (fqp, shortty, repeat("../").take(loc.len()).collect()) } None => match cache.external_paths.get(&did) { Some(&(ref fqp, shortty)) => { (fqp, shortty, match cache.extern_locations[&did.krate] { (.., render::Remote(ref s)) => s.to_string(), (.., render::Local) => repeat("../").take(loc.len()).collect(), (.., render::Unknown) => return None, }) } None => return None, } }; for component in &fqp[..fqp.len() - 1] { url.push_str(component); url.push_str("/"); } match shortty { ItemType::Module => { url.push_str(fqp.last().unwrap()); url.push_str("/index.html"); } _ => { url.push_str(shortty.css_class()); url.push_str("."); url.push_str(fqp.last().unwrap()); url.push_str(".html"); } } Some((url, shortty, fqp.to_vec())) } /// Used when rendering a `ResolvedPath` structure. This invokes the `path` /// rendering function with the necessary arguments for linking to a local path. fn resolved_path(w: &mut fmt::Formatter, did: DefId, path: &clean::Path, print_all: bool) -> fmt::Result { let last = path.segments.last().unwrap(); let rel_root = match &*path.segments[0].name { "self" => Some("./".to_string()), _ => None, }; if print_all { let amt = path.segments.len() - 1; match rel_root { Some(mut root) => { for seg in &path.segments[..amt] { if "super" == seg.name || "self" == seg.name || w.alternate() { write!(w, "{}::", seg.name)?; } else { root.push_str(&seg.name); root.push_str("/"); write!(w, "<a class='mod' href='{}index.html'>{}</a>::", root, seg.name)?; } } } None => { for seg in &path.segments[..amt] { write!(w, "{}::", seg.name)?; } } } } if w.alternate() { write!(w, "{:#}{:#}", HRef::new(did, &last.name), last.params)?; } else { write!(w, "{}{}", HRef::new(did, &last.name), last.params)?; } Ok(()) } fn primitive_link(f: &mut fmt::Formatter, prim: clean::PrimitiveType, name: &str) -> fmt::Result { let m = cache(); let mut needs_termination = false; if !f.alternate() { match m.primitive_locations.get(&prim) { Some(&def_id) if def_id.is_local() => { let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len()); let len = if len == 0 {0} else {len - 1}; write!(f, "<a class='primitive' href='{}primitive.{}.html'>", repeat("../").take(len).collect::<String>(), prim.to_url_str())?; needs_termination = true; } Some(&def_id) => { let loc = match m.extern_locations[&def_id.krate] { (ref cname, _, render::Remote(ref s)) => { Some((cname, s.to_string())) } (ref cname, _, render::Local) => { let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len()); Some((cname, repeat("../").take(len).collect::<String>())) } (.., render::Unknown) => None, }; if let Some((cname, root)) = loc { write!(f, "<a class='primitive' href='{}{}/primitive.{}.html'>", root, cname, prim.to_url_str())?; needs_termination = true; } } None => {} } } write!(f, "{}", name)?; if needs_termination { write!(f, "</a>")?; } Ok(()) } /// Helper to render type parameters fn tybounds(w: &mut fmt::Formatter, typarams: &Option<Vec<clean::TyParamBound> >) -> fmt::Result { match *typarams { Some(ref params) => { for param in params { write!(w, " + ")?; fmt::Display::fmt(param, w)?; } Ok(()) } None => Ok(()) } } impl<'a> HRef<'a> { pub fn
(did: DefId, text: &'a str) -> HRef<'a> { HRef { did: did, text: text } } } impl<'a> fmt::Display for HRef<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match href(self.did) { Some((url, shortty, fqp)) => if !f.alternate() { write!(f, "<a class='{}' href='{}' title='{}'>{}</a>", shortty, url, fqp.join("::"), self.text) } else { write!(f, "{}", self.text) }, _ => write!(f, "{}", self.text), } } } impl fmt::Display for clean::Type { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { clean::Generic(ref name) => { f.write_str(name) } clean::ResolvedPath{ did, ref typarams, ref path, is_generic } => { // Paths like T::Output and Self::Output should be rendered with all segments resolved_path(f, did, path, is_generic)?; tybounds(f, typarams) } clean::Infer => write!(f, "_"), clean::Primitive(prim) => primitive_link(f, prim, prim.as_str()), clean::BareFunction(ref decl) => { if f.alternate() { write!(f, "{}{}fn{:#}{:#}", UnsafetySpace(decl.unsafety), AbiSpace(decl.abi), decl.generics, decl.decl) } else { write!(f, "{}{}fn{}{}", UnsafetySpace(decl.unsafety), AbiSpace(decl.abi), decl.generics, decl.decl) } } clean::Tuple(ref typs) => { match &typs[..] { &[] => primitive_link(f, PrimitiveType::Tuple, "()"), &[ref one] => { primitive_link(f, PrimitiveType::Tuple, "(")?; //carry f.alternate() into this display w/o branching manually fmt::Display::fmt(one, f)?; primitive_link(f, PrimitiveType::Tuple, ",)") } many => { primitive_link(f, PrimitiveType::Tuple, "(")?; fmt::Display::fmt(&CommaSep(&many), f)?; primitive_link(f, PrimitiveType::Tuple, ")") } } } clean::Vector(ref t) => { primitive_link(f, PrimitiveType::Slice, &format!("["))?; fmt::Display::fmt(t, f)?; primitive_link(f, PrimitiveType::Slice, &format!("]")) } clean::FixedVector(ref t, ref s) => { primitive_link(f, PrimitiveType::Array, "[")?; fmt::Display::fmt(t, f)?; if f.alternate() { primitive_link(f, PrimitiveType::Array, &format!("; {}]", s)) } else { primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(s))) } } clean::Never => f.write_str("!"), clean::RawPointer(m, ref t) => { match **t { clean::Generic(_) | clean::ResolvedPath {is_generic: true, ..} => { if f.alternate() { primitive_link(f, clean::PrimitiveType::RawPointer, &format!("*{}{:#}", RawMutableSpace(m), t)) } else { primitive_link(f, clean::PrimitiveType::RawPointer, &format!("*{}{}", RawMutableSpace(m), t)) } } _ => { primitive_link(f, clean::PrimitiveType::RawPointer, &format!("*{}", RawMutableSpace(m)))?; fmt::Display::fmt(t, f) } } } clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => { let lt = match *l { Some(ref l) => format!("{} ", *l), _ => "".to_string(), }; let m = MutableSpace(mutability); match **ty { clean::Vector(ref bt) => { // BorrowedRef{ ... Vector(T) } is &[T] match **bt { clean::Generic(_) => if f.alternate() { primitive_link(f, PrimitiveType::Slice, &format!("&{}{}[{:#}]", lt, m, **bt)) } else { primitive_link(f, PrimitiveType::Slice, &format!("&amp;{}{}[{}]", lt, m, **bt)) }, _ => { if f.alternate() { primitive_link(f, PrimitiveType::Slice, &format!("&{}{}[", lt, m))?; write!(f, "{:#}", **bt)?; } else { primitive_link(f, PrimitiveType::Slice, &format!("&amp;{}{}[", lt, m))?; write!(f, "{}", **bt)?; } primitive_link(f, PrimitiveType::Slice, "]") } } } _ => { if f.alternate() { write!(f, "&{}{}{:#}", lt, m, **ty) } else { write!(f, "&amp;{}{}{}", lt, m, **ty) } } } } clean::PolyTraitRef(ref bounds) => { for (i, bound) in bounds.iter().enumerate() { if i != 0 { write!(f, " + ")?; } if f.alternate() { write!(f, "{:#}", *bound)?; } else { write!(f, "{}", *bound)?; } } Ok(()) } clean::ImplTrait(ref bounds) => { write!(f, "impl ")?; for (i, bound) in bounds.iter().enumerate() { if i != 0 { write!(f, " + ")?; } if f.alternate() { write!(f, "{:#}", *bound)?; } else { write!(f, "{}", *bound)?; } } Ok(()) } // It's pretty unsightly to look at `<A as B>::C` in output, and // we've got hyperlinking on our side, so try to avoid longer // notation as much as possible by making `C` a hyperlink to trait // `B` to disambiguate. // // FIXME: this is still a lossy conversion and there should probably // be a better way of representing this in general? Most of // the ugliness comes from inlining across crates where // everything comes in as a fully resolved QPath (hard to // look at). clean::QPath { ref name, ref self_type, trait_: box clean::ResolvedPath { did, ref typarams, .. }, } => { if f.alternate() { write!(f, "{:#}::", self_type)?; } else { write!(f, "{}::", self_type)?; } let path = clean::Path::singleton(name.clone()); resolved_path(f, did, &path, false)?; // FIXME: `typarams` are not rendered, and this seems bad? drop(typarams); Ok(()) } clean::QPath { ref name, ref self_type, ref trait_ } => { if f.alternate() { write!(f, "<{:#} as {:#}>::{}", self_type, trait_, name) } else { write!(f, "&lt;{} as {}&gt;::{}", self_type, trait_, name) } } clean::Unique(..) => { panic!("should have been cleaned") } } } } fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool) -> fmt::Result { let mut plain = String::new(); if f.alternate() { write!(f, "impl{:#} ", i.generics)?; } else { write!(f, "impl{} ", i.generics)?; } plain.push_str(&format!("impl{:#} ", i.generics)); if let Some(ref ty) = i.trait_ { if i.polarity == Some(clean::ImplPolarity::Negative) { write!(f, "!")?; plain.push_str("!"); } if link_trait { fmt::Display::fmt(ty, f)?; plain.push_str(&format!("{:#}", ty)); } else { match *ty { clean::ResolvedPath{ typarams: None, ref path, is_generic: false, .. } => { let last = path.segments.last().unwrap(); fmt::Display::fmt(&last.name, f)?; fmt::Display::fmt(&last.params, f)?; plain.push_str(&format!("{:#}{:#}", last.name, last.params)); } _ => unreachable!(), } } write!(f, " for ")?; plain.push_str(" for "); } fmt::Display::fmt(&i.for_, f)?; plain.push_str(&format!("{:#}", i.for_)); fmt::Display::fmt(&WhereClause(&i.generics, plain.len() + 1), f)?; Ok(()) } impl fmt::Display for clean::Impl { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt_impl(self, f, true) } } // The difference from above is that trait is not hyperlinked. pub fn fmt_impl_for_trait_page(i: &clean::Impl, f: &mut fmt::Formatter) -> fmt::Result { fmt_impl(i, f, false) } impl fmt::Display for clean::Arguments { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for (i, input) in self.values.iter().enumerate() { if !input.name.is_empty() { write!(f, "{}: ", input.name)?; } if f.alternate() { write!(f, "{:#}", input.type_)?; } else { write!(f, "{}", input.type_)?; } if i + 1 < self.values.len() { write!(f, ", ")?; } } Ok(()) } } impl fmt::Display for clean::FunctionRetTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { clean::Return(clean::Tuple(ref tys)) if tys.is_empty() => Ok(()), clean::Return(ref ty) if f.alternate() => write!(f, " -> {:#}", ty), clean::Return(ref ty) => write!(f, " -&gt; {}", ty), clean::DefaultReturn => Ok(()), } } } impl fmt::Display for clean::FnDecl { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.variadic { if f.alternate() { write!(f, "({args:#}, ...){arrow:#}", args = self.inputs, arrow = self.output) } else { write!(f, "({args}, ...){arrow}", args = self.inputs, arrow = self.output) } } else { if f.alternate() { write!(f, "({args:#}){arrow:#}", args = self.inputs, arrow = self.output) } else { write!(f, "({args}){arrow}", args = self.inputs, arrow = self.output) } } } } impl<'a> fmt::Display for Method<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let decl = self.0; let indent = self.1; let amp = if f.alternate() { "&" } else { "&amp;" }; let mut args = String::new(); let mut args_plain = String::new(); for (i, input) in decl.inputs.values.iter().enumerate() { if let Some(selfty) = input.to_self() { match selfty { clean::SelfValue => { args.push_str("self"); args_plain.push_str("self"); } clean::SelfBorrowed(Some(ref lt), mtbl) => { args.push_str(&format!("{}{} {}self", amp, *lt, MutableSpace(mtbl))); args_plain.push_str(&format!("&{} {}self", *lt, MutableSpace(mtbl))); } clean::SelfBorrowed(None, mtbl) => { args.push_str(&format!("{}{}self", amp, MutableSpace(mtbl))); args_plain.push_str(&format!("&{}self", MutableSpace(mtbl))); } clean::SelfExplicit(ref typ) => { if f.alternate() { args.push_str(&format!("self: {:#}", *typ)); } else { args.push_str(&format!("self: {}", *typ)); } args_plain.push_str(&format!("self: {:#}", *typ)); } } } else { if i > 0 { args.push_str("<br> "); args_plain.push_str(" "); } if !input.name.is_empty() { args.push_str(&format!("{}: ", input.name)); args_plain.push_str(&format!("{}: ", input.name)); } if f.alternate() { args.push_str(&format!("{:#}", input.type_)); } else { args.push_str(&format!("{}", input.type_)); } args_plain.push_str(&format!("{:#}", input.type_)); } if i + 1 < decl.inputs.values.len() { args.push_str(","); args_plain.push_str(","); } } if decl.variadic { args.push_str(",<br> ..."); args_plain.push_str(", ..."); } let arrow_plain = format!("{:#}", decl.output); let arrow = if f.alternate() { format!("{:#}", decl.output) } else { format!("{}", decl.output) }; let mut output: String; let plain: String; let pad = repeat(" ").take(indent).collect::<String>(); if arrow.is_empty() { output = format!("({})", args); plain = format!("{}({})", pad, args_plain); } else { output = format!("({args})<br>{arrow}", args = args, arrow = arrow); plain = format!("{pad}({args}){arrow}", pad = pad, args = args_plain, arrow = arrow_plain); } if plain.len() > 80 { let pad = repeat("&nbsp;").take(indent).collect::<String>(); let pad = format!("<br>{}", pad); output = output.replace("<br>", &pad); } else { output = output.replace("<br>", ""); } if f.alternate() { write!(f, "{}", output.replace("<br>", "\n")) } else { write!(f, "{}", output) } } } impl<'a> fmt::Display for VisSpace<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self.get() { Some(clean::Public) => write!(f, "pub "), Some(clean::Inherited) | None => Ok(()) } } } impl fmt::Display for UnsafetySpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.get() { hir::Unsafety::Unsafe => write!(f, "unsafe "), hir::Unsafety::Normal => Ok(()) } } } impl fmt::Display for ConstnessSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.get() { hir::Constness::Const => write!(f, "const "), hir::Constness::NotConst => Ok(()) } } } impl fmt::Display for clean::Import { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { clean::Import::Simple(ref name, ref src) => { if *name == src.path.last_name() { write!(f, "use {};", *src) } else { write!(f, "use {} as {};", *src, *name) } } clean::Import::Glob(ref src) => { write!(f, "use {}::*;", *src) } } } } impl fmt::Display for clean::ImportSource { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.did { Some(did) => resolved_path(f, did, &self.path, true), _ => { for (i, seg) in self.path.segments.iter().enumerate() { if i > 0 { write!(f, "::")? } write!(f, "{}", seg.name)?; } Ok(()) } } } } impl fmt::Display for clean::TypeBinding { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if f.alternate() { write!(f, "{}={:#}", self.name, self.ty) } else { write!(f, "{}={}", self.name, self.ty) } } } impl fmt::Display for MutableSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { MutableSpace(clean::Immutable) => Ok(()), MutableSpace(clean::Mutable) => write!(f, "mut "), } } } impl fmt::Display for RawMutableSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { RawMutableSpace(clean::Immutable) => write!(f, "const "), RawMutableSpace(clean::Mutable) => write!(f, "mut "), } } } impl fmt::Display for AbiSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let quot = if f.alternate() { "\"" } else { "&quot;" }; match self.0 { Abi::Rust => Ok(()), Abi::C => write!(f, "extern "), abi => write!(f, "extern {0}{1}{0} ", quot, abi.name()), } } }
new
signer_info.rs
use crate::cmsversion::CmsVersion; use crate::pkcs7::Pkcs7Certificate; use crate::{oids, AlgorithmIdentifier, Attribute, Name, SubjectKeyIdentifier}; use picky_asn1::tag::{Tag, TagClass, TagPeeker}; use picky_asn1::wrapper::{ Asn1SequenceOf, Asn1SetOf, ImplicitContextTag0, IntegerAsn1, ObjectIdentifierAsn1, OctetStringAsn1, Optional, }; use serde::{de, ser, Deserialize, Serialize}; /// [RFC 5652 #5.3](https://datatracker.ietf.org/doc/html/rfc5652#section-5.3) /// ``` not_rust /// SignerInfo ::= SEQUENCE { /// version CMSVersion, /// sid SignerIdentifier, /// digestAlgorithm DigestAlgorithmIdentifier, /// signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, /// signatureAlgorithm SignatureAlgorithmIdentifier, /// signature SignatureValue, /// unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } /// /// SignedAttributes ::= SET SIZE (1..MAX) OF Attribute /// /// UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute /// ``` #[derive(Serialize, Debug, PartialEq, Clone)] pub struct SignerInfo { pub version: CmsVersion, pub sid: SignerIdentifier, pub digest_algorithm: DigestAlgorithmIdentifier, pub signed_attrs: Optional<Attributes>, pub signature_algorithm: SignatureAlgorithmIdentifier, pub signature: SignatureValue, #[serde(skip_serializing_if = "Optional::is_default")] pub unsigned_attrs: Optional<UnsignedAttributes>, } impl<'de> de::Deserialize<'de> for SignerInfo { fn deserialize<D>(deserializer: D) -> Result<Self, <D as de::Deserializer<'de>>::Error> where D: de::Deserializer<'de>, { use std::fmt; struct Visitor; impl<'de> de::Visitor<'de> for Visitor { type Value = SignerInfo; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a valid DER-encoded SignerInfo") } fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error> where A: de::SeqAccess<'de>, { let version = seq.next_element()?.ok_or_else(|| de::Error::invalid_length(0, &self))?; if version != CmsVersion::V1 { return Err(serde_invalid_value!( SignerInfo, "wrong version field", "Version equal to 1" )); } Ok(SignerInfo { version, sid: seq.next_element()?.ok_or_else(|| de::Error::invalid_length(1, &self))?, digest_algorithm: seq.next_element()?.ok_or_else(|| de::Error::invalid_length(2, &self))?, signed_attrs: seq.next_element()?.ok_or_else(|| de::Error::invalid_length(3, &self))?, signature_algorithm: seq.next_element()?.ok_or_else(|| de::Error::invalid_length(4, &self))?, signature: seq.next_element()?.ok_or_else(|| de::Error::invalid_length(5, &self))?, unsigned_attrs: seq .next_element() .unwrap_or_default() .unwrap_or_else(|| Optional::from(UnsignedAttributes::default())), }) } } deserializer.deserialize_seq(Visitor) } } // This is a workaround for constructed encoding as implicit #[derive(Debug, Deserialize, PartialEq, Clone, Default)] pub struct Attributes(pub Asn1SequenceOf<Attribute>); impl ser::Serialize for Attributes { fn serialize<S>(&self, serializer: S) -> Result<<S as ser::Serializer>::Ok, <S as ser::Serializer>::Error> where S: ser::Serializer, { let mut raw_der = picky_asn1_der::to_vec(&self.0).unwrap_or_else(|_| vec![0]); raw_der[0] = Tag::context_specific_constructed(0).inner(); picky_asn1_der::Asn1RawDer(raw_der).serialize(serializer) } } /// [RFC 5652 #5.3](https://datatracker.ietf.org/doc/html/rfc5652#section-5.3) /// ``` not_rust /// SignerIdentifier ::= CHOICE { /// issuerAndSerialNumber IssuerAndSerialNumber, /// subjectKeyIdentifier [0] SubjectKeyIdentifier } /// ``` #[derive(Debug, PartialEq, Clone)] pub enum SignerIdentifier { IssuerAndSerialNumber(IssuerAndSerialNumber), SubjectKeyIdentifier(ImplicitContextTag0<SubjectKeyIdentifier>), } impl Serialize for SignerIdentifier { fn serialize<S>(&self, serializer: S) -> Result<<S as ser::Serializer>::Ok, <S as ser::Serializer>::Error> where S: ser::Serializer, { match &self { SignerIdentifier::IssuerAndSerialNumber(issuer_and_serial_number) => { issuer_and_serial_number.serialize(serializer) } SignerIdentifier::SubjectKeyIdentifier(subject_key_identifier) => { subject_key_identifier.serialize(serializer) } } } } impl<'de> Deserialize<'de> for SignerIdentifier { fn deserialize<D>(deserializer: D) -> Result<Self, <D as de::Deserializer<'de>>::Error> where D: de::Deserializer<'de>, { use std::fmt; struct Visitor; impl<'de> de::Visitor<'de> for Visitor { type Value = SignerIdentifier; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a valid DER-encoded SpcLink") } fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error> where A: de::SeqAccess<'de>, { let tag_peeker: TagPeeker = seq_next_element!(seq, SignerIdentifier, "a choice tag"); let signer_identifier = if tag_peeker.next_tag.class() == TagClass::ContextSpecific && tag_peeker.next_tag.number() == 0 { SignerIdentifier::SubjectKeyIdentifier(seq_next_element!( seq, ImplicitContextTag0<SubjectKeyIdentifier>, SignerIdentifier, "SubjectKeyIdentifier" )) } else { SignerIdentifier::IssuerAndSerialNumber(seq_next_element!( seq, IssuerAndSerialNumber, "IssuerAndSerialNumber" )) }; Ok(signer_identifier) } } deserializer.deserialize_enum( "SignerIdentifier", &["SubjectKeyIdentifier, IssuerAndSerialNumber"], Visitor, ) } } /// [RFC 5652 #5.3](https://datatracker.ietf.org/doc/html/rfc5652#section-5.3) /// ``` not_rust /// SignatureValue ::= OCTET STRING /// ``` #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct SignatureValue(pub OctetStringAsn1); /// [RFC 5652 #10.1.1](https://datatracker.ietf.org/doc/html/rfc5652#section-10.1.1) /// ``` not_rust /// DigestAlgorithmIdentifier ::= AlgorithmIdentifier /// ``` #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct DigestAlgorithmIdentifier(pub AlgorithmIdentifier); /// [RFC 5652 #10.1.2](https://datatracker.ietf.org/doc/html/rfc5652#section-10.1.2) /// ``` not_rust /// SignatureAlgorithmIdentifier ::= AlgorithmIdentifier /// ``` #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct SignatureAlgorithmIdentifier(pub AlgorithmIdentifier); /// [RFC 5652 #10.2.4](https://datatracker.ietf.org/doc/html/rfc5652#section-10.2.4) /// ``` not_rust /// IssuerAndSerialNumber ::= SEQUENCE { /// issuer Name, /// serialNumber CertificateSerialNumber } /// ``` #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct IssuerAndSerialNumber { pub issuer: Name, pub serial_number: CertificateSerialNumber, } /// [RFC 5652 #10.2.4](https://datatracker.ietf.org/doc/html/rfc5652#section-10.2.4) /// ``` not_rust /// CertificateSerialNumber ::= INTEGER /// ``` #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct CertificateSerialNumber(pub IntegerAsn1); #[derive(Deserialize, Debug, PartialEq, Clone)] pub struct UnsignedAttributes(pub Vec<UnsignedAttribute>); // This is a workaround for constructed encoding as implicit impl ser::Serialize for UnsignedAttributes { fn serialize<S>(&self, serializer: S) -> Result<<S as ser::Serializer>::Ok, <S as ser::Serializer>::Error> where S: ser::Serializer, { let mut raw_der = picky_asn1_der::to_vec(&self.0).unwrap_or_else(|_| vec![0]); raw_der[0] = Tag::context_specific_constructed(1).inner(); picky_asn1_der::Asn1RawDer(raw_der).serialize(serializer) } } impl Default for UnsignedAttributes { fn default() -> Self { UnsignedAttributes(Vec::new()) } } #[derive(Serialize, Debug, PartialEq, Clone)] pub struct UnsignedAttribute { pub ty: ObjectIdentifierAsn1, pub value: UnsignedAttributeValue, } impl<'de> de::Deserialize<'de> for UnsignedAttribute { fn deserialize<D>(deserializer: D) -> Result<Self, <D as de::Deserializer<'de>>::Error> where D: de::Deserializer<'de>, { use std::fmt; struct Visitor; impl<'de> de::Visitor<'de> for Visitor { type Value = UnsignedAttribute; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a valid DER-encoded ContentInfo") } fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error> where A: de::SeqAccess<'de>, { let ty: ObjectIdentifierAsn1 = seq.next_element()?.ok_or_else(|| de::Error::invalid_length(0, &self))?; let value = match Into::<String>::into(&ty.0).as_str() { oids::MS_COUNTER_SIGN => UnsignedAttributeValue::MsCounterSign(seq_next_element!( seq, Asn1SetOf<Pkcs7Certificate>, UnsignedAttributeValue, "McCounterSign" )), oids::COUNTER_SIGN => UnsignedAttributeValue::CounterSign(seq_next_element!( seq, Asn1SetOf<SignerInfo>, UnsignedAttributeValue, "CounterSign" )), _ => { return Err(serde_invalid_value!( UnsignedAttributeValue, "unknown oid type", "MS_COUNTER_SIGN or CounterSign oid" )) } }; Ok(UnsignedAttribute { ty, value }) } } deserializer.deserialize_seq(Visitor) } } #[derive(Debug, PartialEq, Clone)] pub enum UnsignedAttributeValue { MsCounterSign(Asn1SetOf<Pkcs7Certificate>), CounterSign(Asn1SetOf<SignerInfo>), } impl Serialize for UnsignedAttributeValue { fn serialize<S>(&self, serializer: S) -> Result<<S as ser::Serializer>::Ok, <S as ser::Serializer>::Error> where S: ser::Serializer, { match &self { UnsignedAttributeValue::MsCounterSign(ms_counter_sign) => ms_counter_sign.serialize(serializer), UnsignedAttributeValue::CounterSign(counter_sign) => counter_sign.serialize(serializer), } } } #[cfg(test)] mod tests { use super::*; #[cfg(feature = "ctl")] #[test] fn
() { let decoded = base64::decode( "MIICngIBATCBmTCBgTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x\ EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv\ bjErMCkGA1UEAxMiTWljcm9zb2Z0IENlcnRpZmljYXRlIExpc3QgQ0EgMjAxMQIT\ MwAAAFajs3kCOFJzBAAAAAAAVjANBglghkgBZQMEAgEFAKCB2jAYBgkqhkiG9w0B\ CQMxCwYJKwYBBAGCNwoBMC8GCSqGSIb3DQEJBDEiBCDKbAY82LhZRyLtnnizMz42\ OJp0yEyTg/jBC9lXDMyatTCBjAYKKwYBBAGCNwIBDDF+MHygVoBUAE0AaQBjAHIA\ bwBzAG8AZgB0ACAAQwBlAHIAdABpAGYAaQBjAGEAdABlACAAVAByAHUAcwB0ACAA\ TABpAHMAdAAgAFAAdQBiAGwAaQBzAGgAZQByoSKAIGh0dHA6Ly93d3cubWljcm9z\ b2Z0LmNvbS93aW5kb3dzMA0GCSqGSIb3DQEBAQUABIIBAJolH27b3wLNu+E2Gh+B\ 9FFUsp5eiF1AGyUQb6hcjoYJIUjQgqW1shr+P4z9MI0ziTVWc1qVYh8LgXBAcuzN\ pGu7spEFIckf40eITNeB5KUZFtHWym+MUIQERfs/C+iqCiSgtSiWxUIci7h/VF39\ vhRTABMyZQddozLldJMsawRIhlceaOCTrp9tLQLLHHkEVDHSMOkbd4S9IOhw/YY9\ cwcGic2ebDrpSZe0VVEgF9Blqk49W+JRwADVNdWFcDZbiAQv63vSy+VdFzKZer07\ JAVDdVamvS5pk4MvNkszAG2KHsij6J3M97KcJY0FKuhPsfb9pnR61nmfDaFzoHOY\ pkw=", ) .unwrap(); let signer_info: SignerInfo = picky_asn1_der::from_bytes(&decoded).unwrap(); check_serde!(signer_info: SignerInfo in decoded); } }
decode_certificate_trust_list_signer_info
lib.rs
//! Wrapper types to enable optimized handling of `&[u8]` and `Vec<u8>`. //! //! Without specialization, Rust forces Serde to treat `&[u8]` just like any //! other slice and `Vec<u8>` just like any other vector. In reality this //! particular slice and vector can often be serialized and deserialized in a //! more efficient, compact representation in many formats. //! //! When working with such a format, you can opt into specialized handling of //! `&[u8]` by wrapping it in `serde_bytes::Bytes` and `Vec<u8>` by wrapping it //! in `serde_bytes::ByteBuf`. //! //! This crate supports the Serde `with` attribute to enable efficient handling //! of `&[u8]` and `Vec<u8>` in structs without needing a wrapper type. //! //! ```rust //! #[macro_use] //! extern crate serde_derive; //! //! extern crate serde; //! extern crate serde_bytes; //! //! #[derive(Serialize)] //! struct Efficient<'a> { //! #[serde(with = "serde_bytes")] //! bytes: &'a [u8], //! //! #[serde(with = "serde_bytes")] //! byte_buf: Vec<u8>, //! } //! //! #[derive(Serialize, Deserialize)] //! struct Packet { //! #[serde(with = "serde_bytes")] //! payload: Vec<u8>, //! } //! # //! # fn main() {} //! ``` #![doc(html_root_url = "https://docs.rs/serde_bytes/0.10.4")] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(feature = "alloc", feature(alloc))] #![deny(missing_docs)] #[cfg(feature = "std")] use std::{fmt, ops}; #[cfg(not(feature = "std"))] use core::{fmt, ops}; use self::fmt::Debug; #[cfg(feature = "alloc")] extern crate alloc; #[cfg(feature = "alloc")] use alloc::Vec; #[macro_use] extern crate serde; use serde::de::{Deserialize, Deserializer, Error, Visitor}; use serde::ser::{Serialize, Serializer}; #[cfg(any(feature = "std", feature = "alloc"))] pub use self::bytebuf::ByteBuf; mod value; ////////////////////////////////////////////////////////////////////////////// /// Serde `serialize_with` function to serialize bytes efficiently. /// /// This function can be used with either of the following Serde attributes: /// /// - `#[serde(with = "serde_bytes")]` /// - `#[serde(serialize_with = "serde_bytes::serialize")]` /// /// ```rust /// #[macro_use] /// extern crate serde_derive; /// /// extern crate serde; /// extern crate serde_bytes; /// /// #[derive(Serialize)] /// struct Efficient<'a> { /// #[serde(with = "serde_bytes")] /// bytes: &'a [u8], /// /// #[serde(with = "serde_bytes")] /// byte_buf: Vec<u8>, /// } /// # /// # fn main() {} /// ``` pub fn serialize<T, S>(bytes: &T, serializer: S) -> Result<S::Ok, S::Error> where T: ?Sized + AsRef<[u8]>, S: Serializer, { serializer.serialize_bytes(bytes.as_ref()) } /// Serde `deserialize_with` function to deserialize bytes efficiently. /// /// This function can be used with either of the following Serde attributes: /// /// - `#[serde(with = "serde_bytes")]` /// - `#[serde(deserialize_with = "serde_bytes::deserialize")]` /// /// ```rust /// #[macro_use] /// extern crate serde_derive; /// /// extern crate serde; /// extern crate serde_bytes; /// /// #[derive(Deserialize)] /// struct Packet { /// #[serde(with = "serde_bytes")] /// payload: Vec<u8>, /// } /// # /// # fn main() {} /// ``` #[cfg(any(feature = "std", feature = "alloc"))] pub fn deserialize<'de, T, D>(deserializer: D) -> Result<T, D::Error> where T: From<Vec<u8>>, D: Deserializer<'de>, { ByteBuf::deserialize(deserializer).map(|buf| Into::<Vec<u8>>::into(buf).into()) } ////////////////////////////////////////////////////////////////////////////// /// Wrapper around `&[u8]` to serialize and deserialize efficiently. /// /// ```rust /// extern crate bincode; /// extern crate serde_bytes; /// /// use std::collections::HashMap; /// use std::io; /// /// use serde_bytes::Bytes; /// /// fn print_encoded_cache() -> Result<(), bincode::Error> { /// let mut cache = HashMap::new(); /// cache.insert(3, Bytes::new(b"three")); /// cache.insert(2, Bytes::new(b"two")); /// cache.insert(1, Bytes::new(b"one")); /// /// bincode::serialize_into(&mut io::stdout(), &cache, bincode::Infinite) /// } /// # /// # fn main() { /// # print_encoded_cache().unwrap(); /// # } /// ``` #[derive(Clone, Copy, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct Bytes<'a> { bytes: &'a [u8], } impl<'a> Bytes<'a> { /// Wrap an existing `&[u8]`. pub fn new(bytes: &'a [u8]) -> Self { Bytes { bytes: bytes } } } impl<'a> Debug for Bytes<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Debug::fmt(self.bytes, f) } } impl<'a> From<&'a [u8]> for Bytes<'a> { fn from(bytes: &'a [u8]) -> Self { Bytes::new(bytes) } } impl<'a> From<Bytes<'a>> for &'a [u8] { fn from(wrapper: Bytes<'a>) -> &'a [u8] { wrapper.bytes } } impl<'a> ops::Deref for Bytes<'a> { type Target = [u8]; fn deref(&self) -> &[u8] { self.bytes } } impl<'a> Serialize for Bytes<'a> { #[inline] fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, { serializer.serialize_bytes(self.bytes) } } struct BytesVisitor; impl<'de> Visitor<'de> for BytesVisitor { type Value = Bytes<'de>; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("a borrowed byte array") } #[inline] fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Bytes<'de>, E> where E: Error, { Ok(Bytes::from(v)) } #[inline] fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Bytes<'de>, E> where E: Error, { Ok(Bytes::from(v.as_bytes())) } } impl<'a, 'de: 'a> Deserialize<'de> for Bytes<'a> { #[inline] fn deserialize<D>(deserializer: D) -> Result<Bytes<'a>, D::Error> where D: Deserializer<'de>, { deserializer.deserialize_bytes(BytesVisitor) } } ////////////////////////////////////////////////////////////////////////////// #[cfg(any(feature = "std", feature = "alloc"))] mod bytebuf { #[cfg(feature = "std")] use std::{cmp, fmt, ops}; #[cfg(not(feature = "std"))] use core::{cmp, fmt, ops}; use self::fmt::Debug; #[cfg(feature = "alloc")] use alloc::{String, Vec}; use serde::de::{Deserialize, Deserializer, Error, SeqAccess, Visitor}; use serde::ser::{Serialize, Serializer}; /// Wrapper around `Vec<u8>` to serialize and deserialize efficiently. /// /// ```rust /// extern crate bincode; /// extern crate serde_bytes; /// /// use std::collections::HashMap; /// use std::io; /// /// use serde_bytes::ByteBuf; /// /// fn deserialize_bytebufs() -> Result<(), bincode::Error> { /// let example_data = [ /// 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 116, /// 119, 111, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 111, 110, 101]; /// /// let map: HashMap<u32, ByteBuf> = /// bincode::deserialize_from(&mut &example_data[..], bincode::Infinite)?; /// /// println!("{:?}", map); /// /// Ok(()) /// } /// # /// # fn main() { /// # deserialize_bytebufs().unwrap(); /// # } /// ``` #[derive(Clone, Default, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct ByteBuf { bytes: Vec<u8>, } impl ByteBuf { /// Construct a new, empty `ByteBuf`. pub fn new() -> Self { ByteBuf::from(Vec::new()) } /// Construct a new, empty `ByteBuf` with the specified capacity. pub fn with_capacity(cap: usize) -> Self { ByteBuf::from(Vec::with_capacity(cap)) } /// Wrap existing bytes in a `ByteBuf`. pub fn from<T: Into<Vec<u8>>>(bytes: T) -> Self { ByteBuf { bytes: bytes.into(), } } } impl Debug for ByteBuf { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Debug::fmt(&self.bytes, f) } } impl From<ByteBuf> for Vec<u8> { fn from(wrapper: ByteBuf) -> Vec<u8> { wrapper.bytes } } impl From<Vec<u8>> for ByteBuf { fn from(bytes: Vec<u8>) -> Self { ByteBuf::from(bytes) } } impl AsRef<Vec<u8>> for ByteBuf { fn as_ref(&self) -> &Vec<u8> { &self.bytes } } impl AsRef<[u8]> for ByteBuf { fn as_ref(&self) -> &[u8] { &self.bytes } } impl AsMut<Vec<u8>> for ByteBuf { fn as_mut(&mut self) -> &mut Vec<u8> { &mut self.bytes } } impl AsMut<[u8]> for ByteBuf { fn as_mut(&mut self) -> &mut [u8]
} impl ops::Deref for ByteBuf { type Target = [u8]; fn deref(&self) -> &[u8] { &self.bytes[..] } } impl ops::DerefMut for ByteBuf { fn deref_mut(&mut self) -> &mut [u8] { &mut self.bytes[..] } } impl Serialize for ByteBuf { #[inline] fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, { serializer.serialize_bytes(&self.bytes) } } struct ByteBufVisitor; impl<'de> Visitor<'de> for ByteBufVisitor { type Value = ByteBuf; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("byte array") } #[inline] fn visit_seq<V>(self, mut visitor: V) -> Result<ByteBuf, V::Error> where V: SeqAccess<'de>, { let len = cmp::min(visitor.size_hint().unwrap_or(0), 4096); let mut values = Vec::with_capacity(len); while let Some(value) = try!(visitor.next_element()) { values.push(value); } Ok(ByteBuf::from(values)) } #[inline] fn visit_bytes<E>(self, v: &[u8]) -> Result<ByteBuf, E> where E: Error, { Ok(ByteBuf::from(v)) } #[inline] fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<ByteBuf, E> where E: Error, { Ok(ByteBuf::from(v)) } #[inline] fn visit_str<E>(self, v: &str) -> Result<ByteBuf, E> where E: Error, { Ok(ByteBuf::from(v)) } #[inline] fn visit_string<E>(self, v: String) -> Result<ByteBuf, E> where E: Error, { Ok(ByteBuf::from(v)) } } impl<'de> Deserialize<'de> for ByteBuf { #[inline] fn deserialize<D>(deserializer: D) -> Result<ByteBuf, D::Error> where D: Deserializer<'de>, { deserializer.deserialize_byte_buf(ByteBufVisitor) } } }
{ &mut self.bytes }
test_real_transforms.py
import numpy as np from numpy.testing import assert_allclose, assert_array_equal import pytest from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn import scipy.fft as fft from scipy import fftpack # scipy.fft wraps the fftpack versions but with normalized inverse transforms. # So, the forward transforms and definitions are already thoroughly tested in # fftpack/test_real_transforms.py @pytest.mark.parametrize("forward, backward", [(dct, idct), (dst, idst)]) @pytest.mark.parametrize("type", [1, 2, 3, 4]) @pytest.mark.parametrize("n", [2, 3, 4, 5, 10, 16]) @pytest.mark.parametrize("axis", [0, 1]) @pytest.mark.parametrize("norm", [None, 'ortho']) def test_identity_1d(forward, backward, type, n, axis, norm): # Test the identity f^-1(f(x)) == x x = np.random.rand(n, n)
pad = [(0, 0)] * 2 pad[axis] = (0, 4) y2 = np.pad(y, pad, mode='edge') z2 = backward(y2, type, n, axis, norm) assert_allclose(z2, x) @pytest.mark.parametrize("forward, backward", [(dct, idct), (dst, idst)]) @pytest.mark.parametrize("type", [1, 2, 3, 4]) @pytest.mark.parametrize("dtype", [np.float16, np.float32, np.float64, np.complex64, np.complex128]) @pytest.mark.parametrize("axis", [0, 1]) @pytest.mark.parametrize("norm", [None, 'ortho']) @pytest.mark.parametrize("overwrite_x", [True, False]) def test_identity_1d_overwrite(forward, backward, type, dtype, axis, norm, overwrite_x): # Test the identity f^-1(f(x)) == x x = np.random.rand(7, 8) x_orig = x.copy() y = forward(x, type, axis=axis, norm=norm, overwrite_x=overwrite_x) y_orig = y.copy() z = backward(y, type, axis=axis, norm=norm, overwrite_x=overwrite_x) if not overwrite_x: assert_allclose(z, x, rtol=1e-6, atol=1e-6) assert_array_equal(x, x_orig) assert_array_equal(y, y_orig) else: assert_allclose(z, x_orig, rtol=1e-6, atol=1e-6) @pytest.mark.parametrize("forward, backward", [(dctn, idctn), (dstn, idstn)]) @pytest.mark.parametrize("type", [1, 2, 3, 4]) @pytest.mark.parametrize("shape, axes", [ ((4, 4), 0), ((4, 4), 1), ((4, 4), None), ((4, 4), (0, 1)), ((10, 12), None), ((10, 12), (0, 1)), ((4, 5, 6), None), ((4, 5, 6), 1), ((4, 5, 6), (0, 2)), ]) @pytest.mark.parametrize("norm", [None, 'ortho']) def test_identity_nd(forward, backward, type, shape, axes, norm): # Test the identity f^-1(f(x)) == x x = np.random.random(shape) if axes is not None: shape = np.take(shape, axes) y = forward(x, type, axes=axes, norm=norm) z = backward(y, type, axes=axes, norm=norm) assert_allclose(z, x) if axes is None: pad = [(0, 4)] * x.ndim elif isinstance(axes, int): pad = [(0, 0)] * x.ndim pad[axes] = (0, 4) else: pad = [(0, 0)] * x.ndim for a in axes: pad[a] = (0, 4) y2 = np.pad(y, pad, mode='edge') z2 = backward(y2, type, shape, axes, norm) assert_allclose(z2, x) @pytest.mark.parametrize("forward, backward", [(dctn, idctn), (dstn, idstn)]) @pytest.mark.parametrize("type", [1, 2, 3, 4]) @pytest.mark.parametrize("shape, axes", [ ((4, 5), 0), ((4, 5), 1), ((4, 5), None), ]) @pytest.mark.parametrize("dtype", [np.float16, np.float32, np.float64, np.complex64, np.complex128]) @pytest.mark.parametrize("norm", [None, 'ortho']) @pytest.mark.parametrize("overwrite_x", [False, True]) def test_identity_nd_overwrite(forward, backward, type, shape, axes, dtype, norm, overwrite_x): # Test the identity f^-1(f(x)) == x x = np.random.random(shape).astype(dtype) x_orig = x.copy() if axes is not None: shape = np.take(shape, axes) y = forward(x, type, axes=axes, norm=norm) y_orig = y.copy() z = backward(y, type, axes=axes, norm=norm) if overwrite_x: assert_allclose(z, x_orig, rtol=1e-6, atol=1e-6) else: assert_allclose(z, x, rtol=1e-6, atol=1e-6) assert_array_equal(x, x_orig) assert_array_equal(y, y_orig) @pytest.mark.parametrize("func", ['dct', 'dst', 'dctn', 'dstn']) @pytest.mark.parametrize("type", [1, 2, 3, 4]) @pytest.mark.parametrize("norm", [None, 'ortho']) def test_fftpack_equivalience(func, type, norm): x = np.random.rand(8, 16) fft_res = getattr(fft, func)(x, type, norm=norm) fftpack_res = getattr(fftpack, func)(x, type, norm=norm) assert_allclose(fft_res, fftpack_res)
y = forward(x, type, axis=axis, norm=norm) z = backward(y, type, axis=axis, norm=norm) assert_allclose(z, x)
snapshot.go
package webapi import ( "fmt" "net/http" "path/filepath" "github.com/gin-gonic/gin" "github.com/mitchellh/mapstructure" "github.com/loveandpeople/lpnet/pkg/config" "github.com/loveandpeople/lpnet/pkg/model/milestone" "github.com/loveandpeople/lpnet/plugins/snapshot" ) func
() { addEndpoint("createSnapshotFile", createSnapshotFile, implementedAPIcalls) } func createSnapshotFile(i interface{}, c *gin.Context, abortSignal <-chan struct{}) { e := ErrorReturn{} query := &CreateSnapshotFile{} if err := mapstructure.Decode(i, query); err != nil { e.Error = fmt.Sprintf("%v: %v", ErrInternalError, err) c.JSON(http.StatusInternalServerError, e) return } snapshotFilePath := filepath.Join(filepath.Dir(config.NodeConfig.GetString(config.CfgLocalSnapshotsPath)), fmt.Sprintf("export_%d.bin", query.TargetIndex)) if err := snapshot.CreateLocalSnapshot(milestone.Index(query.TargetIndex), snapshotFilePath, false, abortSignal); err != nil { e.Error = err.Error() c.JSON(http.StatusInternalServerError, e) return } c.JSON(http.StatusOK, CreateSnapshotFileReturn{}) }
init
dcim_rear_port_templates_partial_update_responses.go
// Code generated by go-swagger; DO NOT EDIT. // Copyright 2020 The go-netbox Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/gunnertwin/go-netbox/models" ) // DcimRearPortTemplatesPartialUpdateReader is a Reader for the DcimRearPortTemplatesPartialUpdate structure. type DcimRearPortTemplatesPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *DcimRearPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDcimRearPortTemplatesPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil default: result := NewDcimRearPortTemplatesPartialUpdateDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } if response.Code()/100 == 2 { return result, nil } return nil, result } } // NewDcimRearPortTemplatesPartialUpdateOK creates a DcimRearPortTemplatesPartialUpdateOK with default headers values func NewDcimRearPortTemplatesPartialUpdateOK() *DcimRearPortTemplatesPartialUpdateOK { return &DcimRearPortTemplatesPartialUpdateOK{} } /*DcimRearPortTemplatesPartialUpdateOK handles this case with default header values. DcimRearPortTemplatesPartialUpdateOK dcim rear port templates partial update o k */ type DcimRearPortTemplatesPartialUpdateOK struct { Payload *models.RearPortTemplate } func (o *DcimRearPortTemplatesPartialUpdateOK) Error() string { return fmt.Sprintf("[PATCH /dcim/rear-port-templates/{id}/][%d] dcimRearPortTemplatesPartialUpdateOK %+v", 200, o.Payload) } func (o *DcimRearPortTemplatesPartialUpdateOK) GetPayload() *models.RearPortTemplate { return o.Payload } func (o *DcimRearPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.RearPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewDcimRearPortTemplatesPartialUpdateDefault creates a DcimRearPortTemplatesPartialUpdateDefault with default headers values func NewDcimRearPortTemplatesPartialUpdateDefault(code int) *DcimRearPortTemplatesPartialUpdateDefault { return &DcimRearPortTemplatesPartialUpdateDefault{ _statusCode: code, } } /*DcimRearPortTemplatesPartialUpdateDefault handles this case with default header values. DcimRearPortTemplatesPartialUpdateDefault dcim rear port templates partial update default */ type DcimRearPortTemplatesPartialUpdateDefault struct { _statusCode int Payload interface{} } // Code gets the status code for the dcim rear port templates partial update default response func (o *DcimRearPortTemplatesPartialUpdateDefault) Code() int { return o._statusCode } func (o *DcimRearPortTemplatesPartialUpdateDefault) Error() string { return fmt.Sprintf("[PATCH /dcim/rear-port-templates/{id}/][%d] dcim_rear-port-templates_partial_update default %+v", o._statusCode, o.Payload) } func (o *DcimRearPortTemplatesPartialUpdateDefault) GetPayload() interface{} { return o.Payload } func (o *DcimRearPortTemplatesPartialUpdateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF
return nil }
{ return err }
edit.go
package widget import ( "github.com/twgh/xcgui/xc" "github.com/twgh/xcgui/xcc" ) // 编辑框(常规, 富文本, 聊天气泡). type Edit struct { ScrollView } // 编辑框_创建. // // x: 元素x坐标. // // y: 元素y坐标. // // cx: 宽度. // // cy: 高度. // // hParent: 父为窗口句柄或元素句柄. func NewEdit(x int, y int, cx int, cy int, hParent int) *Edit { p := &Edit{} p.SetH
c.XEdit_Create(x, y, cx, cy, hParent)) return p } // 编辑框_创建扩展. // // x: 元素x坐标. // // y: 元素y坐标. // // cx: 宽度. // // cy: 高度. // // nType: 类型, Edit_Type_. // // hParent: 父为窗口句柄或元素句柄. func NewEditEx(x int, y int, cx int, cy int, nType int, hParent int) *Edit { p := &Edit{} p.Handle = xc.XEdit_CreateEx(x, y, cx, cy, nType, hParent) return p } // 从句柄创建对象. func NewEditByHandle(handle int) *Edit { p := &Edit{} p.SetHandle(handle) return p } // 从name创建对象, 失败返回nil. func NewEditByName(name string) *Edit { handle := xc.XC_GetObjectByName(name) if handle > 0 { p := &Edit{} p.SetHandle(handle) return p } return nil } // 从UID创建对象, 失败返回nil. func NewEditByUID(nUID int) *Edit { handle := xc.XC_GetObjectByUID(nUID) if handle > 0 { p := &Edit{} p.SetHandle(handle) return p } return nil } // 从UID名称创建对象, 失败返回nil. func NewEditByUIDName(name string) *Edit { handle := xc.XC_GetObjectByUIDName(name) if handle > 0 { p := &Edit{} p.SetHandle(handle) return p } return nil } // 编辑框_启用自动换行. // // bEnable: 是否启用. func (e *Edit) EnableAutoWrap(bEnable bool) int { return xc.XEdit_EnableAutoWrap(e.Handle, bEnable) } // 编辑框_启用只读. // // bEnable: 是否启用. func (e *Edit) EnableReadOnly(bEnable bool) int { return xc.XEdit_EnableReadOnly(e.Handle, bEnable) } // 编辑框_启用多行. // // bEnable:. func (e *Edit) EnableMultiLine(bEnable bool) int { return xc.XEdit_EnableMultiLine(e.Handle, bEnable) } // 编辑框_启用密码, 启用密码模式(只支持默认类型编辑框). // // bEnable: 是否启用. func (e *Edit) EnablePassword(bEnable bool) int { return xc.XEdit_EnablePassword(e.Handle, bEnable) } // 编辑框_启用自动选择, 当获得焦点时,自动选择所有内容. // // bEnable: 是否启用. func (e *Edit) EnableAutoSelAll(bEnable bool) int { return xc.XEdit_EnableAutoSelAll(e.Handle, bEnable) } // 编辑框_启用自动取消选择, 当失去焦点时自动取消选择. // // bEnable: 是否启用. func (e *Edit) EnableAutoCancelSel(bEnable bool) int { return xc.XEdit_EnableAutoCancelSel(e.Handle, bEnable) } // 编辑框_是否只读. func (e *Edit) IsReadOnly() bool { return xc.XEdit_IsReadOnly(e.Handle) } // 编辑框_是否多行. func (e *Edit) IsMultiLine() bool { return xc.XEdit_IsMultiLine(e.Handle) } // 编辑框_是否密码. func (e *Edit) IsPassword() bool { return xc.XEdit_IsPassword(e.Handle) } // 编辑框_是否自动换行. func (e *Edit) IsAutoWrap() bool { return xc.XEdit_IsAutoWrap(e.Handle) } // 编辑框_判断为空. func (e *Edit) IsEmpty() bool { return xc.XEdit_IsEmpty(e.Handle) } // 编辑框_是否在选择区域. // // iRow: 行索引. // // iCol: 列索引. func (e *Edit) IsInSelect(iRow int, iCol int) bool { return xc.XEdit_IsInSelect(e.Handle, iRow, iCol) } // 编辑框_取总行数. func (e *Edit) GetRowCount() int { return xc.XEdit_GetRowCount(e.Handle) } // 编辑框_取数据, 包含文本或非文本内容. func (e *Edit) GetData() xc.Edit_Data_Copy_ { return xc.XEdit_GetData(e.Handle) } // 编辑框_添加数据. // // pData: 数据结构. // // styleTable: 样式表. // // nStyleCount: 样式数量. func (e *Edit) AddData(pData *xc.Edit_Data_Copy_, styleTable []uint16, nStyleCount int) int { return xc.XEdit_AddData(e.Handle, pData, styleTable, nStyleCount) } // 编辑框_释放数据. func (e *Edit) FreeData(pData *xc.Edit_Data_Copy_) int { return xc.XEdit_FreeData(pData) } // 编辑框_置默认文本, 当内容为空时, 显示默认文本. // // pString: 文本内容. func (e *Edit) SetDefaultText(pString string) int { return xc.XEdit_SetDefaultText(e.Handle, pString) } // 编辑框_置默认文本颜色. // // color: ABGR颜色值. func (e *Edit) SetDefaultTextColor(color int) int { return xc.XEdit_SetDefaultTextColor(e.Handle, color) } // 编辑框_置密码字符. // // ch: 字符. func (e *Edit) SetPasswordCharacter(ch int) int { return xc.XEdit_SetPasswordCharacter(e.Handle, ch) } // 编辑框_置文本对齐, 单行模式下有效. // // align: 对齐方式, Edit_TextAlign_Flag_. func (e *Edit) SetTextAlign(align int) int { return xc.XEdit_SetTextAlign(e.Handle, align) } // 编辑框_置TAB空格. // // nSpace: 空格数量. func (e *Edit) SetTabSpace(nSpace int) int { return xc.XEdit_SetTabSpace(e.Handle, nSpace) } // 编辑框_置文本. // // pString: 字符串. func (e *Edit) SetText(pString string) int { return xc.XEdit_SetText(e.Handle, pString) } // 编辑框_置文本整数. // // nValue: 整数值. func (e *Edit) SetTextInt(nValue int) int { return xc.XEdit_SetTextInt(e.Handle, nValue) } // 编辑框_取文本, 不包含非文本内容, 返回实际接收文本长度. // // pOut: 接收文本内存指针. // // nOutlen: 内存大小. func (e *Edit) GetText(pOut *string, nOutlen int) int { return xc.XEdit_GetText(e.Handle, pOut, nOutlen) } // 编辑框_取文本行. // // iRow: 行索引. // // pOut: 接收文本内存指针. // // nOutlen: 接收文本内存块长度. func (e *Edit) GetTextRow(iRow int, pOut *string, nOutlen int) int { return xc.XEdit_GetTextRow(e.Handle, iRow, pOut, nOutlen) } // 编辑框_取内容长度, 包含非文本内容. func (e *Edit) GetLength() int { return xc.XEdit_GetLength(e.Handle) } // 编辑框_取内容长度行, 包含非文本内容. // // iRow: 行索引. func (e *Edit) GetLengthRow(iRow int) int { return xc.XEdit_GetLengthRow(e.Handle, iRow) } // 编辑框_取字符, 返回指定位置字符. // // iRow: 行索引. // // iCol: 列索引. func (e *Edit) GetAt(iRow int, iCol int) int { return xc.XEdit_GetAt(e.Handle, iRow, iCol) } // 编辑框_插入文本. // // iRow: 行索引. // // iCol: 列索引. // // pString: 字符串. func (e *Edit) InsertText(iRow int, iCol int, pString string) int { return xc.XEdit_InsertText(e.Handle, iRow, iCol, pString) } // 编辑框_插入文本模拟用户操作, 自动刷新UI, 支持撤销/恢复. // // pString: 字符串. func (e *Edit) InsertTextUser(pString string) int { return xc.XEdit_InsertTextUser(e.Handle, pString) } // 编辑框_添加文本. // // pString: 字符串. func (e *Edit) AddText(pString string) int { return xc.XEdit_AddText(e.Handle, pString) } // 编辑框_添加文本扩展. // // pString: 字符串. // // iStyle: 样式索引. func (e *Edit) AddTextEx(pString string, iStyle int) int { return xc.XEdit_AddTextEx(e.Handle, pString, iStyle) } // 编辑框_添加对象, 例如: 字体, 图片, UI对象, 返回样式索引. // // hObj: 对象句柄. func (e *Edit) AddObject(hObj int) int { return xc.XEdit_AddObject(e.Handle, hObj) } // 编辑框_添加对象从样式, 当样式为图片时有效. // // iStyle: 样式索引. func (e *Edit) AddByStyle(iStyle int) int { return xc.XEdit_AddByStyle(e.Handle, iStyle) } // 编辑框_添加样式, 返回样式索引. // // hFont_image_Obj: 字体. // // color: 颜色. // // bColor: 是否使用颜色. func (e *Edit) AddStyle(hFont_image_Obj int, color int, bColor bool) int { return xc.XEdit_AddStyle(e.Handle, hFont_image_Obj, color, bColor) } // 编辑框_添加样式扩展, 返回样式索引. // // fontName: 字体名称. // // fontSize: 字体大小. // // fontStyle: 字体样式. // // color: 颜色. // // bColor: 是否使用颜色. func (e *Edit) AddStyleEx(fontName string, fontSize int, fontStyle int, color int, bColor bool) int { return xc.XEdit_AddStyleEx(e.Handle, fontName, fontSize, fontStyle, color, bColor) } // 编辑框_取样式信息. // // iStyle: 样式索引. // // info: 返回样式信息. func (e *Edit) GetStyleInfo(iStyle int, info *xc.Edit_Style_Info_) bool { return xc.XEdit_GetStyleInfo(e.Handle, iStyle, info) } // 编辑框_置当前样式. // // iStyle: 样式索引. func (e *Edit) SetCurStyle(iStyle int) int { return xc.XEdit_SetCurStyle(e.Handle, iStyle) } // 编辑框_置插入符颜色. // // color: 颜色. func (e *Edit) SetCaretColor(color int) int { return xc.XEdit_SetCaretColor(e.Handle, color) } // 编辑框_置插入符宽度. // // nWidth: 宽度. func (e *Edit) SetCaretWidth(nWidth int) int { return xc.XEdit_SetCaretWidth(e.Handle, nWidth) } // 编辑框_置选择背景颜色. // // color: ABGR颜色. func (e *Edit) SetSelectBkColor(color int) int { return xc.XEdit_SetSelectBkColor(e.Handle, color) } // 编辑框_置默认行高. // // nHeight: 行高. func (e *Edit) SetRowHeight(nHeight int) int { return xc.XEdit_SetRowHeight(e.Handle, nHeight) } // 编辑框_置指定行高度, 类型为 Edit_Type_Richedit 支持指定不同行高. // // iRow: 行索引. // // nHeight: 高度. func (e *Edit) SetRowHeightEx(iRow int, nHeight int) int { return xc.XEdit_SetRowHeightEx(e.Handle, iRow, nHeight) } // 编辑框_置当前位置. // // iRow: 行索引. // // iCol: 列索引. func (e *Edit) SetCurPos(iRow int, iCol int) int { return xc.XEdit_SetCurPos(e.Handle, iRow, iCol) } // 编辑框_取当前位置点, 返回范围位置点. func (e *Edit) GetCurPos() int { return xc.XEdit_GetCurPos(e.Handle) } // 编辑框_取当前行, 返回行索引. func (e *Edit) GetCurRow() int { return xc.XEdit_GetCurRow(e.Handle) } // 编辑框_取当前列, 返回列索引. func (e *Edit) GetCurCol() int { return xc.XEdit_GetCurCol(e.Handle) } // 编辑框_取坐标点. // // iRow: 行索引. // // iCol: 列索引. // // pOut: 接收返回坐标点. func (e *Edit) GetPoint(iRow int, iCol int, pOut *xc.POINT) int { return xc.XEdit_GetPoint(e.Handle, iRow, iCol, pOut) } // 编辑框_自动滚动, 视图自动滚动到当前插入符位置. func (e *Edit) AutoScroll() bool { return xc.XEdit_AutoScroll(e.Handle) } // 编辑框_自动滚动扩展, 视图自动滚动到指定位置. // // iRow: 行索引. // // iCol: 列索引. func (e *Edit) AutoScrollEx(iRow int, iCol int) bool { return xc.XEdit_AutoScrollEx(e.Handle, iRow, iCol) } // 编辑框_转换位置, 转换位置点到行列. // // iPos: 位置点. // // pInfo: 行列. func (e *Edit) PositionToInfo(iPos int, pInfo *xc.Position_) int { return xc.XEdit_PositionToInfo(e.Handle, iPos, pInfo) } // 编辑框_选择全部. func (e *Edit) SelectAll() bool { return xc.XEdit_SelectAll(e.Handle) } // 编辑框_取消选择. func (e *Edit) CancelSelect() bool { return xc.XEdit_CancelSelect(e.Handle) } // 编辑框_删除选择内容. func (e *Edit) DeleteSelect() bool { return xc.XEdit_DeleteSelect(e.Handle) } // 编辑框_置选择. // // iStartRow: 起始行索引. // // iStartCol: 起始行列索引. // // iEndRow: 结束行索引. // // iEndCol: 结束行列索引. func (e *Edit) SetSelect(iStartRow int, iStartCol int, iEndRow int, iEndCol int) bool { return xc.XEdit_SetSelect(e.Handle, iStartRow, iStartCol, iEndRow, iEndCol) } // 编辑框_取选择文本, 不包括非文本内容, 返回接收文本内容实际长度. // // pOut: 接收返回文本内容. // // nOutLen: 接收内存大小. func (e *Edit) GetSelectText(pOut *string, nOutLen int) int { return xc.XEdit_GetSelectText(e.Handle, pOut, nOutLen) } // 编辑框_取选择内容范围. // // pBegin: 起始位置. // // pEnd: 结束位置. func (e *Edit) GetSelectRange(pBegin *xc.Position_, pEnd *xc.Position_) bool { return xc.XEdit_GetSelectRange(e.Handle, pBegin, pEnd) } // 编辑框_取可视行范围. // // piStart: 起始行索引. // // piEnd: 结束行索引. func (e *Edit) GetVisibleRowRange(piStart *int, piEnd *int) int { return xc.XEdit_GetVisibleRowRange(e.Handle, piStart, piEnd) } // 编辑框_删除, 删除指定范围内容. // // iStartRow: 起始行索引. // // iStartCol: 起始行列索引. // // iEndRow: 结束行索引. // // iEndCol: 结束行列索引. func (e *Edit) Delete(iStartRow int, iStartCol int, iEndRow int, iEndCol int) bool { return xc.XEdit_Delete(e.Handle, iStartRow, iStartCol, iEndRow, iEndCol) } // 编辑框_删除行. // // iRow: 行索引. func (e *Edit) DeleteRow(iRow int) bool { return xc.XEdit_DeleteRow(e.Handle, iRow) } // 编辑框_剪贴板剪切. func (e *Edit) ClipboardCut() bool { return xc.XEdit_ClipboardCut(e.Handle) } // 编辑框_剪贴板复制. func (e *Edit) ClipboardCopy() bool { return xc.XEdit_ClipboardCopy(e.Handle) } // 编辑框_剪贴板粘贴. func (e *Edit) ClipboardPaste() bool { return xc.XEdit_ClipboardPaste(e.Handle) } // 编辑框_撤销. func (e *Edit) Undo() bool { return xc.XEdit_Undo(e.Handle) } // 编辑框_恢复. func (e *Edit) Redo() bool { return xc.XEdit_Redo(e.Handle) } // 编辑框_添加气泡开始, 当前行开始. // // hImageAvatar: 头像. // // hImageBubble: 气泡背景. // // nFlag: 标志, Chat_Flag_. func (e *Edit) AddChatBegin(hImageAvatar int, hImageBubble int, nFlag int) int { return xc.XEdit_AddChatBegin(e.Handle, hImageAvatar, hImageBubble, nFlag) } // 编辑框_添加气泡结束, 当前行结束. func (e *Edit) AddChatEnd() int { return xc.XEdit_AddChatEnd(e.Handle) } // 编辑框_置气泡缩进, 设置聊天气泡内容缩进. // // nIndentation: 缩进值. func (e *Edit) SetChatIndentation(nIndentation int) int { return xc.XEdit_SetChatIndentation(e.Handle, nIndentation) } /* 以下都是事件 */ type XE_EDIT_SET func(pbHandled *bool) int // 编辑框_置文本. type XE_EDIT_SET1 func(hEle int, pbHandled *bool) int // 编辑框_置文本. type XE_EDIT_DRAWROW func(hDraw int, iRow int, pbHandled *bool) int // 和XE_EDIT_CHANGED的对换. type XE_EDIT_DRAWROW1 func(hEle int, hDraw int, iRow int, pbHandled *bool) int // 和XE_EDIT_CHANGED的对换. type XE_EDIT_CHANGED func(pbHandled *bool) int // 编辑框_内容被改变. type XE_EDIT_CHANGED1 func(hEle int, pbHandled *bool) int // 编辑框_内容被改变. type XE_EDIT_POS_CHANGED func(iPos int, pbHandled *bool) int // 编辑框_光标位置_被改变. type XE_EDIT_POS_CHANGED1 func(hEle int, iPos int, pbHandled *bool) int // 编辑框_光标位置_被改变. type XE_EDIT_STYLE_CHANGED func(iStyle int, pbHandled *bool) int // 编辑框_样式_被改变. type XE_EDIT_STYLE_CHANGED1 func(hEle int, iStyle int, pbHandled *bool) int // 编辑框_样式_被改变. type XE_EDIT_ENTER_GET_TABALIGN func(pbHandled *bool) int // 编辑框_回车_获取标签?. type XE_EDIT_ENTER_GET_TABALIGN1 func(hEle int, pbHandled *bool) int // 编辑框_回车_获取标签?. type XE_EDIT_ROW_CHANGED func(iRow int, nChangeRows int, pbHandled *bool) int // 编辑框_行_被改变. type XE_EDIT_ROW_CHANGED1 func(hEle int, iRow int, nChangeRows int, pbHandled *bool) int // 编辑框_行_被改变. // 编辑框_置文本. func (e *Edit) Event_EDIT_SET(pFun XE_EDIT_SET) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_SET, pFun) } // 编辑框_置文本. func (e *Edit) Event_EDIT_SET1(pFun XE_EDIT_SET1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_SET, pFun) } // 和XE_EDIT_CHANGED的对换. func (e *Edit) Event_EDIT_DRAWROW(pFun XE_EDIT_DRAWROW) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_DRAWROW, pFun) } // 和XE_EDIT_CHANGED的对换. func (e *Edit) Event_EDIT_DRAWROW1(pFun XE_EDIT_DRAWROW1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_DRAWROW, pFun) } // 编辑框_内容被改变. func (e *Edit) Event_EDIT_CHANGED(pFun XE_EDIT_CHANGED) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_CHANGED, pFun) } // 编辑框_内容被改变. func (e *Edit) Event_EDIT_CHANGED1(pFun XE_EDIT_CHANGED1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_CHANGED, pFun) } // 编辑框_光标位置_被改变. func (e *Edit) Event_EDIT_POS_CHANGED(pFun XE_EDIT_POS_CHANGED) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_POS_CHANGED, pFun) } // 编辑框_光标位置_被改变. func (e *Edit) Event_EDIT_POS_CHANGED1(pFun XE_EDIT_POS_CHANGED1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_POS_CHANGED, pFun) } // 编辑框_样式_被改变. func (e *Edit) Event_EDIT_STYLE_CHANGED(pFun XE_EDIT_STYLE_CHANGED) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_STYLE_CHANGED, pFun) } // 编辑框_样式_被改变. func (e *Edit) Event_EDIT_STYLE_CHANGED1(pFun XE_EDIT_STYLE_CHANGED1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_STYLE_CHANGED, pFun) } // 编辑框_回车_获取标签?. func (e *Edit) Event_EDIT_ENTER_GET_TABALIGN(pFun XE_EDIT_ENTER_GET_TABALIGN) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_ENTER_GET_TABALIGN, pFun) } // 编辑框_回车_获取标签?. func (e *Edit) Event_EDIT_ENTER_GET_TABALIGN1(pFun XE_EDIT_ENTER_GET_TABALIGN1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_ENTER_GET_TABALIGN, pFun) } // 编辑框_行_被改变. func (e *Edit) Event_EDIT_ROW_CHANGED(pFun XE_EDIT_ROW_CHANGED) bool { return xc.XEle_RegEventC(e.Handle, xcc.XE_EDIT_ROW_CHANGED, pFun) } // 编辑框_行_被改变. func (e *Edit) Event_EDIT_ROW_CHANGED1(pFun XE_EDIT_ROW_CHANGED1) bool { return xc.XEle_RegEventC1(e.Handle, xcc.XE_EDIT_ROW_CHANGED, pFun) }
andle(x
accesscontrolrecords.go
package storsimple // Copyright (c) Microsoft and contributors. All rights reserved. // // 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 Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "net/http" ) // AccessControlRecordsClient is the client for the AccessControlRecords methods of the Storsimple service. type AccessControlRecordsClient struct { BaseClient } // NewAccessControlRecordsClient creates an instance of the AccessControlRecordsClient client. func
(subscriptionID string) AccessControlRecordsClient { return NewAccessControlRecordsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAccessControlRecordsClientWithBaseURI creates an instance of the AccessControlRecordsClient client. func NewAccessControlRecordsClientWithBaseURI(baseURI string, subscriptionID string) AccessControlRecordsClient { return AccessControlRecordsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or Updates an access control record. // Parameters: // accessControlRecordName - the name of the access control record. // parameters - the access control record to be added or updated. // resourceGroupName - the resource group name // managerName - the manager name func (client AccessControlRecordsClient) CreateOrUpdate(ctx context.Context, accessControlRecordName string, parameters AccessControlRecord, resourceGroupName string, managerName string) (result AccessControlRecordsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AccessControlRecordProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.AccessControlRecordProperties.InitiatorName", Name: validation.Null, Rule: true, Chain: nil}}}}}, {TargetValue: managerName, Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil { return result, validation.NewError("storsimple.AccessControlRecordsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, accessControlRecordName, parameters, resourceGroupName, managerName) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client AccessControlRecordsClient) CreateOrUpdatePreparer(ctx context.Context, accessControlRecordName string, parameters AccessControlRecord, resourceGroupName string, managerName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accessControlRecordName": accessControlRecordName, "managerName": managerName, "resourceGroupName": resourceGroupName, "subscriptionId": client.SubscriptionID, } const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AccessControlRecordsClient) CreateOrUpdateSender(req *http.Request) (future AccessControlRecordsCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client AccessControlRecordsClient) CreateOrUpdateResponder(resp *http.Response) (result AccessControlRecord, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete deletes the access control record. // Parameters: // accessControlRecordName - the name of the access control record to delete. // resourceGroupName - the resource group name // managerName - the manager name func (client AccessControlRecordsClient) Delete(ctx context.Context, accessControlRecordName string, resourceGroupName string, managerName string) (result AccessControlRecordsDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: managerName, Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil { return result, validation.NewError("storsimple.AccessControlRecordsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, accessControlRecordName, resourceGroupName, managerName) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "Delete", result.Response(), "Failure sending request") return } return } // DeletePreparer prepares the Delete request. func (client AccessControlRecordsClient) DeletePreparer(ctx context.Context, accessControlRecordName string, resourceGroupName string, managerName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accessControlRecordName": accessControlRecordName, "managerName": managerName, "resourceGroupName": resourceGroupName, "subscriptionId": client.SubscriptionID, } const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AccessControlRecordsClient) DeleteSender(req *http.Request) (future AccessControlRecordsDeleteFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client AccessControlRecordsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get returns the properties of the specified access control record name. // Parameters: // accessControlRecordName - name of access control record to be fetched. // resourceGroupName - the resource group name // managerName - the manager name func (client AccessControlRecordsClient) Get(ctx context.Context, accessControlRecordName string, resourceGroupName string, managerName string) (result AccessControlRecord, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: managerName, Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil { return result, validation.NewError("storsimple.AccessControlRecordsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, accessControlRecordName, resourceGroupName, managerName) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client AccessControlRecordsClient) GetPreparer(ctx context.Context, accessControlRecordName string, resourceGroupName string, managerName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accessControlRecordName": accessControlRecordName, "managerName": managerName, "resourceGroupName": resourceGroupName, "subscriptionId": client.SubscriptionID, } const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AccessControlRecordsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client AccessControlRecordsClient) GetResponder(resp *http.Response) (result AccessControlRecord, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByManager retrieves all the access control records in a manager. // Parameters: // resourceGroupName - the resource group name // managerName - the manager name func (client AccessControlRecordsClient) ListByManager(ctx context.Context, resourceGroupName string, managerName string) (result AccessControlRecordList, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: managerName, Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil { return result, validation.NewError("storsimple.AccessControlRecordsClient", "ListByManager", err.Error()) } req, err := client.ListByManagerPreparer(ctx, resourceGroupName, managerName) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "ListByManager", nil, "Failure preparing request") return } resp, err := client.ListByManagerSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "ListByManager", resp, "Failure sending request") return } result, err = client.ListByManagerResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsClient", "ListByManager", resp, "Failure responding to request") } return } // ListByManagerPreparer prepares the ListByManager request. func (client AccessControlRecordsClient) ListByManagerPreparer(ctx context.Context, resourceGroupName string, managerName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "managerName": managerName, "resourceGroupName": resourceGroupName, "subscriptionId": client.SubscriptionID, } const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByManagerSender sends the ListByManager request. The method will close the // http.Response Body if it receives an error. func (client AccessControlRecordsClient) ListByManagerSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByManagerResponder handles the response to the ListByManager request. The method always // closes the http.Response Body. func (client AccessControlRecordsClient) ListByManagerResponder(resp *http.Response) (result AccessControlRecordList, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
NewAccessControlRecordsClient
lib.rs
#![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] //! (De)serialization helpers for other ruma crates. #![warn(missing_docs)] use serde_json::Value as JsonValue; pub mod base64; mod buf; pub mod can_be_empty; mod canonical_json; mod cow; pub mod duration; mod empty; pub mod json_string; mod raw; pub mod single_element_seq; mod strings; pub mod test; pub mod urlencoded; pub use self::{ base64::Base64, buf::{json_to_buf, slice_to_buf}, can_be_empty::{is_empty, CanBeEmpty}, canonical_json::{ to_canonical_value, try_from_json_map, value::{CanonicalJsonValue, Object as CanonicalJsonObject}, Error as CanonicalJsonError, }, cow::deserialize_cow_str, empty::vec_as_map_of_empty, raw::Raw, strings::{ btreemap_int_or_string_to_int_values, empty_string_as_none, int_or_string_to_int, none_as_empty_string, }, }; /// The inner type of [`JsonValue::Object`]. pub type JsonObject = serde_json::Map<String, JsonValue>; /// Check whether a value is equal to its default value. pub fn is_default<T: Default + PartialEq>(val: &T) -> bool { *val == T::default() } /// Simply returns `true`. /// /// Useful for `#[serde(default = ...)]`. pub fn default_true() -> bool
/// Simply dereferences the given bool. /// /// Useful for `#[serde(skip_serializing_if = ...)]`. #[allow(clippy::trivially_copy_pass_by_ref)] pub fn is_true(b: &bool) -> bool { *b } /// A type that can be sent to another party that understands the matrix protocol. /// /// If any of the fields of `Self` don't implement serde's `Deserialize`, you can derive this trait /// to generate a corresponding 'Incoming' type that supports deserialization. This is useful for /// things like ruma_events' `EventResult` type. For more details, see the /// [derive macro's documentation][doc]. /// /// [doc]: derive.Outgoing.html // TODO: Better explain how this trait relates to serde's traits pub trait Outgoing { /// The 'Incoming' variant of `Self`. type Incoming; } // -- Everything below is macro-related -- pub use ruma_serde_macros::*; /// This module is used to support the generated code from ruma-serde-macros. /// It is not considered part of ruma-serde's public API. #[doc(hidden)] pub mod exports { pub use serde; }
{ true }
protodict.py
#!/usr/bin/env python """A generic serializer for python dictionaries.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections from future.builtins import str from future.utils import iteritems from future.utils import itervalues from future.utils import python_2_unicode_compatible from past.builtins import long from typing import cast, List, Text, Union from grr_response_core.lib import rdfvalue from grr_response_core.lib import utils from grr_response_core.lib.rdfvalues import structs as rdf_structs from grr_response_proto import jobs_pb2 class EmbeddedRDFValue(rdf_structs.RDFProtoStruct): """An object that contains a serialized RDFValue.""" protobuf = jobs_pb2.EmbeddedRDFValue rdf_deps = [ rdfvalue.RDFDatetime, ] def __init__(self, initializer=None, payload=None, *args, **kwargs): if (not payload and isinstance(initializer, rdfvalue.RDFValue) and not isinstance(initializer, EmbeddedRDFValue)): # The initializer is an RDFValue object that we can use as payload. payload = initializer initializer = None super(EmbeddedRDFValue, self).__init__( initializer=initializer, *args, **kwargs) if payload is not None: self.payload = payload @property def payload(self): """Extracts and returns the serialized object.""" try: rdf_cls = self.classes.get(self.name) if rdf_cls: value = rdf_cls.FromSerializedBytes(self.data) value.age = self.embedded_age return value except TypeError: return None @payload.setter def payload(self, payload): self.name = payload.__class__.__name__ self.embedded_age = payload.age self.data = payload.SerializeToBytes()
class DataBlob(rdf_structs.RDFProtoStruct): """Wrapper class for DataBlob protobuf.""" protobuf = jobs_pb2.DataBlob rdf_deps = [ "BlobArray", # TODO(user): dependency loop. "Dict", # TODO(user): dependency loop. EmbeddedRDFValue, ] def SetValue(self, value, raise_on_error=True): """Receives a value and fills it into a DataBlob. Args: value: value to set raise_on_error: if True, raise if we can't serialize. If False, set the key to an error string. Returns: self Raises: TypeError: if the value can't be serialized and raise_on_error is True """ type_mappings = [(Text, "string"), (bytes, "data"), (bool, "boolean"), (int, "integer"), (long, "integer"), (dict, "dict"), (float, "float")] if value is None: self.none = "None" elif isinstance(value, rdfvalue.RDFValue): self.rdf_value.data = value.SerializeToBytes() self.rdf_value.age = int(value.age) self.rdf_value.name = value.__class__.__name__ elif isinstance(value, (list, tuple)): self.list.content.Extend([ DataBlob().SetValue(v, raise_on_error=raise_on_error) for v in value ]) elif isinstance(value, set): self.set.content.Extend([ DataBlob().SetValue(v, raise_on_error=raise_on_error) for v in value ]) elif isinstance(value, dict): self.dict.FromDict(value, raise_on_error=raise_on_error) else: for type_mapping, member in type_mappings: if isinstance(value, type_mapping): setattr(self, member, value) return self message = "Unsupported type for ProtoDict: %s" % type(value) if raise_on_error: raise TypeError(message) setattr(self, "string", message) return self def GetValue(self, ignore_error=True): """Extracts and returns a single value from a DataBlob.""" if self.HasField("none"): return None field_names = [ "integer", "string", "data", "boolean", "list", "dict", "rdf_value", "float", "set" ] values = [getattr(self, x) for x in field_names if self.HasField(x)] if len(values) != 1: return None if self.HasField("boolean"): return bool(values[0]) # Unpack RDFValues. if self.HasField("rdf_value"): try: rdf_class = rdfvalue.RDFValue.classes[self.rdf_value.name] return rdf_class.FromSerializedBytes( self.rdf_value.data, age=self.rdf_value.age) except (ValueError, KeyError) as e: if ignore_error: return e raise elif self.HasField("list"): return [x.GetValue() for x in self.list.content] elif self.HasField("set"): return set([x.GetValue() for x in self.set.content]) else: return values[0] class KeyValue(rdf_structs.RDFProtoStruct): protobuf = jobs_pb2.KeyValue rdf_deps = [ DataBlob, ] @python_2_unicode_compatible class Dict(rdf_structs.RDFProtoStruct): """A high level interface for protobuf Dict objects. This effectively converts from a dict to a proto and back. The dict may contain strings (python unicode objects), int64, or binary blobs (python string objects) as keys and values. """ protobuf = jobs_pb2.Dict rdf_deps = [ KeyValue, ] _values = None def __init__(self, initializer=None, age=None, **kwarg): super(Dict, self).__init__(initializer=None, age=age) self.dat = None # type: Union[List[KeyValue], rdf_structs.RepeatedFieldHelper] # Support initializing from a mapping if isinstance(initializer, dict): self.FromDict(initializer) # Can be initialized from kwargs (like a dict). elif initializer is None: self.FromDict(kwarg) # Initialize from another Dict. elif isinstance(initializer, Dict): self.FromDict(initializer.ToDict()) self.age = initializer.age else: raise rdfvalue.InitializeError("Invalid initializer for ProtoDict.") def ToDict(self): result = {} for x in itervalues(self._values): key = x.k.GetValue() result[key] = x.v.GetValue() try: # Try to unpack nested AttributedDicts result[key] = result[key].ToDict() except AttributeError: pass return result def FromDict(self, dictionary, raise_on_error=True): # First clear and then set the dictionary. self._values = {} for key, value in iteritems(dictionary): self._values[key] = KeyValue( k=DataBlob().SetValue(key, raise_on_error=raise_on_error), v=DataBlob().SetValue(value, raise_on_error=raise_on_error)) self.dat = itervalues(self._values) return self def __getitem__(self, key): return self._values[key].v.GetValue() def __contains__(self, key): return key in self._values # TODO: This implementation is flawed. It returns a new instance # on each invocation, effectively preventing changes to mutable # datastructures, e.g. `dct["key"] = []; dct["key"].append(5)`. def GetItem(self, key, default=None): if key in self._values: return self._values[key].v.GetValue() return default def Items(self): for x in itervalues(self._values): yield x.k.GetValue(), x.v.GetValue() def Values(self): for x in itervalues(self._values): yield x.v.GetValue() def Keys(self): for x in itervalues(self._values): yield x.k.GetValue() get = utils.Proxy("GetItem") items = utils.Proxy("Items") keys = utils.Proxy("Keys") values = utils.Proxy("Values") def __delitem__(self, key): # TODO(user):pytype: assigning "dirty" here is a hack. The assumption # that self.dat is RepeatedFieldHelper may not hold. For some reason the # type checker doesn not respect the isinstance check below and explicit # cast is required. if not isinstance(self.dat, rdf_structs.RepeatedFieldHelper): raise TypeError("self.dat has an unexpected type %s" % self.dat.__class__) cast(rdf_structs.RepeatedFieldHelper, self.dat).dirty = True del self._values[key] def __len__(self): return len(self._values) def SetItem(self, key, value, raise_on_error=True): """Alternative to __setitem__ that can ignore errors. Sometimes we want to serialize a structure that contains some simple objects, and some that can't be serialized. This method gives the caller a way to specify that they don't care about values that can't be serialized. Args: key: dict key value: dict value raise_on_error: if True, raise if we can't serialize. If False, set the key to an error string. """ # TODO(user):pytype: assigning "dirty" here is a hack. The assumption # that self.dat is RepeatedFieldHelper may not hold. For some reason the # type checker doesn not respect the isinstance check below and explicit # cast is required. if not isinstance(self.dat, rdf_structs.RepeatedFieldHelper): raise TypeError("self.dat has an unexpected type %s" % self.dat.__class__) cast(rdf_structs.RepeatedFieldHelper, self.dat).dirty = True self._values[key] = KeyValue( k=DataBlob().SetValue(key, raise_on_error=raise_on_error), v=DataBlob().SetValue(value, raise_on_error=raise_on_error)) def __setitem__(self, key, value): # TODO(user):pytype: assigning "dirty" here is a hack. The assumption # that self.dat is RepeatedFieldHelper may not hold. For some reason the # type checker doesn not respect the isinstance check below and explicit # cast is required. if not isinstance(self.dat, rdf_structs.RepeatedFieldHelper): raise TypeError("self.dat has an unexpected type %s" % self.dat.__class__) cast(rdf_structs.RepeatedFieldHelper, self.dat).dirty = True self._values[key] = KeyValue( k=DataBlob().SetValue(key), v=DataBlob().SetValue(value)) def __iter__(self): for x in itervalues(self._values): yield x.k.GetValue() # Required, because in Python 3 overriding `__eq__` nullifies `__hash__`. __hash__ = rdf_structs.RDFProtoStruct.__hash__ def __eq__(self, other): if isinstance(other, dict): return self.ToDict() == other elif isinstance(other, Dict): return self.ToDict() == other.ToDict() else: return False def GetRawData(self): self.dat = itervalues(self._values) return super(Dict, self).GetRawData() def _CopyRawData(self): self.dat = itervalues(self._values) return super(Dict, self)._CopyRawData() def SetRawData(self, raw_data): super(Dict, self).SetRawData(raw_data) self._values = {} for d in self.dat: self._values[d.k.GetValue()] = d def SerializeToBytes(self): self.dat = itervalues(self._values) return super(Dict, self).SerializeToBytes() def ParseFromBytes(self, value): super(Dict, self).ParseFromBytes(value) self._values = {} for d in self.dat: self._values[d.k.GetValue()] = d def __str__(self): return str(self.ToDict()) class AttributedDict(Dict): """A Dict that supports attribute indexing.""" protobuf = jobs_pb2.AttributedDict rdf_deps = [ KeyValue, ] def __getattr__(self, item): # Pickle is checking for the presence of overrides for various builtins. # Without this check we swallow the error and return None, which confuses # pickle protocol version 2. if item.startswith("__"): raise AttributeError() return self.GetItem(item) def __setattr__(self, item, value): # Existing class or instance members are assigned to normally. if hasattr(self.__class__, item) or item in self.__dict__: object.__setattr__(self, item, value) else: self.SetItem(item, value) class BlobArray(rdf_structs.RDFProtoStruct): protobuf = jobs_pb2.BlobArray rdf_deps = [ DataBlob, ] class RDFValueArray(rdf_structs.RDFProtoStruct): """A type which serializes a list of RDFValue instances. TODO(user): This needs to be deprecated in favor of just defining a protobuf with a repeated field (This can be now done dynamically, which is the main reason we used this in the past). """ protobuf = jobs_pb2.BlobArray allow_custom_class_name = True rdf_deps = [ DataBlob, ] # Set this to an RDFValue class to ensure all members adhere to this type. rdf_type = None def __init__(self, initializer=None, age=None): super(RDFValueArray, self).__init__(age=age) if self.__class__ == initializer.__class__: self.content = initializer.Copy().content self.age = initializer.age # Initialize from a serialized protobuf. elif isinstance(initializer, str): self.ParseFromBytes(initializer) else: try: for item in initializer: self.Append(item) except TypeError: if initializer is not None: raise rdfvalue.InitializeError( "%s can not be initialized from %s" % (self.__class__.__name__, type(initializer))) def Append(self, value=None, **kwarg): """Add another member to the array. Args: value: The new data to append to the array. **kwarg: Create a new element from these keywords. Returns: The value which was added. This can be modified further by the caller and changes will be propagated here. Raises: ValueError: If the value to add is not allowed. """ if self.rdf_type is not None: if (isinstance(value, rdfvalue.RDFValue) and value.__class__ != self.rdf_type): raise ValueError("Can only accept %s" % self.rdf_type) try: # Try to coerce the value. value = self.rdf_type(value, **kwarg) # pylint: disable=not-callable except (TypeError, ValueError): raise ValueError("Unable to initialize %s from type %s" % (self.__class__.__name__, type(value))) self.content.Append(DataBlob().SetValue(value)) def Extend(self, values): for v in values: self.Append(v) def __getitem__(self, item): return self.content[item].GetValue() def __len__(self): return len(self.content) def __iter__(self): for blob in self.content: yield blob.GetValue() def __bool__(self): return bool(self.content) # TODO: Remove after support for Python 2 is dropped. __nonzero__ = __bool__ def Pop(self, index=0): return self.content.Pop(index).GetValue() # TODO(user):pytype: Mapping is likely using abc.ABCMeta that provides a # "register" method. Type checker doesn't see this, unfortunately. collections.Mapping.register(Dict) # pytype: disable=attribute-error
def __reduce__(self): return type(self), (None, self.payload)
test.py
# coding: utf-8 """Base class for tests. All Filesystems should be able to pass these. """ from __future__ import absolute_import from __future__ import unicode_literals from datetime import datetime import io import itertools import json import math import os import time import pytest import fs.copy import fs.move from fs import ResourceType, Seek from fs import errors from fs import walk from fs import glob from fs.opener import open_fs from fs.subfs import ClosingSubFS, SubFS import pytz import six from six import text_type if six.PY2: import collections as collections_abc else: import collections.abc as collections_abc UNICODE_TEXT = """ UTF-8 encoded sample plain-text file ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Markus Kuhn [ˈmaʳkʊs kuːn] &lt;[email protected]> — 1999-08-20 The ASCII compatible UTF-8 encoding of ISO 10646 and Unicode plain-text files is defined in RFC 2279 and in ISO 10646-1 Annex R. Using Unicode/UTF-8, you can write in emails and source code things such as Mathematics and Sciences: ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⊥ &lt; a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (A ⇔ B), 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm Linguistics and dictionaries: ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] APL: ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ Nicer typography in plain text files: ╔══════════════════════════════════════════╗ ║ ║ ║ • ‘single’ and “double” quotes ║ ║ ║ ║ • Curly apostrophes: “We’ve been here” ║ ║ ║ ║ • Latin-1 apostrophe and accents: '´` ║ ║ ║ ║ • ‚deutsche‘ „Anführungszeichen“ ║ ║ ║ ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ ║ ║ ║ • ASCII safety test: 1lI|, 0OD, 8B ║ ║ ╭─────────╮ ║ ║ • the euro symbol: │ 14.95 € │ ║ ║ ╰─────────╯ ║ ╚══════════════════════════════════════════╝ Greek (in Polytonic): The Greek anthem: Σὲ γνωρίζω ἀπὸ τὴν κόψη τοῦ σπαθιοῦ τὴν τρομερή, σὲ γνωρίζω ἀπὸ τὴν ὄψη ποὺ μὲ βία μετράει τὴ γῆ. ᾿Απ᾿ τὰ κόκκαλα βγαλμένη τῶν ῾Ελλήνων τὰ ἱερά καὶ σὰν πρῶτα ἀνδρειωμένη χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! From a speech of Demosthenes in the 4th century BC: Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. Δημοσθένους, Γ´ ᾿Ολυνθιακὸς Georgian: From a Unicode conference invitation: გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. Russian: From a Unicode conference invitation: Зарегистрируйтесь сейчас на Десятую Международную Конференцию по Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. Конференция соберет широкий круг экспертов по вопросам глобального Интернета и Unicode, локализации и интернационализации, воплощению и применению Unicode в различных операционных системах и программных приложениях, шрифтах, верстке и многоязычных компьютерных системах. Thai (UCS Level 2): Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese classic 'San Gua'): [----------------------------|------------------------] ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ (The above is a two-column text. If combining characters are handled correctly, the lines of the second column should be aligned with the | character above.) Ethiopian: Proverbs in the Amharic language: ሰማይ አይታረስ ንጉሥ አይከሰስ። ብላ ካለኝ እንደአባቴ በቆመጠኝ። ጌጥ ያለቤቱ ቁምጥና ነው። ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። የአፍ ወለምታ በቅቤ አይታሽም። አይጥ በበላ ዳዋ ተመታ። ሲተረጉሙ ይደረግሙ። ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። ድር ቢያብር አንበሳ ያስር። ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። ሥራ ከመፍታት ልጄን ላፋታት። ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። ተንጋሎ ቢተፉ ተመልሶ ባፉ። ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። እግርህን በፍራሽህ ልክ ዘርጋ። Runes: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ (Old English, which transcribed into Latin reads 'He cwaeth that he bude thaem lande northweardum with tha Westsae.' and means 'He said that he lived in the northern land near the Western Sea.') Braille: ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ (The first couple of paragraphs of "A Christmas Carol" by Dickens) Compact font selection example text: ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა Greetings in various languages: Hello world, Καλημέρα κόσμε, コンニチハ Box drawing alignment tests: █ ▉ ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ """ class FSTestCases(object): """Basic FS tests. """ def make_fs(self): """Return an FS instance. """ raise NotImplementedError("implement me") def destroy_fs(self, fs): """Destroy a FS instance. Arguments: fs (FS): A filesystem instance previously opened by `~fs.test.FSTestCases.make_fs`. """ fs.close() def setUp(self): self.fs = self.make_fs() def tearDown(self): self.destroy_fs(self.fs) del self.fs def assert_exists(self, path): """Assert a path exists. Arguments: path (str): A path on the filesystem. """ self.assertTrue(self.fs.exists(path)) def assert_not_exists(self, path): """Assert a path does not exist. Arguments: path (str): A path on the filesystem. """ self.assertFalse(self.fs.exists(path)) def assert_isfile(self, path): """Assert a path is a file. Arguments: path (str): A path on the filesystem. """ self.assertTrue(self.fs.isfile(path)) def assert_isdir(self, path): """Assert a path is a directory. Arguments: path (str): A path on the filesystem. """ self.assertTrue(self.fs.isdir(path)) def assert_bytes(self, path, contents): """Assert a file contains the given bytes. Arguments: path (str): A path on the filesystem. contents (bytes): Bytes to compare. """ assert isinstance(contents, bytes) data = self.fs.readbytes(path) self.assertEqual(data, contents) self.assertIsInstance(data, bytes) def assert_text(self, path, contents): """Assert a file contains the given text. Arguments: path (str): A path on the filesystem. contents (str): Text to compare. """ assert isinstance(contents, text_type) with self.fs.open(path, "rt") as f: data = f.read() self.assertEqual(data, contents) self.assertIsInstance(data, text_type) def test_root_dir(self): with self.assertRaises(errors.FileExpected): self.fs.open("/") with self.assertRaises(errors.FileExpected): self.fs.openbin("/") def test_appendbytes(self): with self.assertRaises(TypeError): self.fs.appendbytes("foo", "bar") self.fs.appendbytes("foo", b"bar") self.assert_bytes("foo", b"bar") self.fs.appendbytes("foo", b"baz") self.assert_bytes("foo", b"barbaz") def test_appendtext(self): with self.assertRaises(TypeError): self.fs.appendtext("foo", b"bar") self.fs.appendtext("foo", "bar") self.assert_text("foo", "bar") self.fs.appendtext("foo", "baz") self.assert_text("foo", "barbaz") def test_basic(self): #  Check str and repr don't break repr(self.fs) self.assertIsInstance(six.text_type(self.fs), six.text_type) def test_getmeta(self): # Get the meta dict meta = self.fs.getmeta() # Check default namespace self.assertEqual(meta, self.fs.getmeta(namespace="standard")) # Must be a dict self.assertTrue(isinstance(meta, dict)) no_meta = self.fs.getmeta("__nosuchnamespace__") self.assertIsInstance(no_meta, dict) self.assertFalse(no_meta) def test_isfile(self): self.assertFalse(self.fs.isfile("foo.txt")) self.fs.create("foo.txt") self.assertTrue(self.fs.isfile("foo.txt")) self.fs.makedir("bar") self.assertFalse(self.fs.isfile("bar")) def test_isdir(self): self.assertFalse(self.fs.isdir("foo")) self.fs.create("bar") self.fs.makedir("foo") self.assertTrue(self.fs.isdir("foo")) self.assertFalse(self.fs.isdir("bar")) def test_islink(self): self.fs.touch("foo") self.assertFalse(self.fs.islink("foo")) with self.assertRaises(errors.ResourceNotFound): self.fs.islink("bar") def test_getsize(self): self.fs.writebytes("empty", b"") self.fs.writebytes("one", b"a") self.fs.writebytes("onethousand", ("b" * 1000).encode("ascii")) self.assertEqual(self.fs.getsize("empty"), 0) self.assertEqual(self.fs.getsize("one"), 1) self.assertEqual(self.fs.getsize("onethousand"), 1000) with self.assertRaises(errors.ResourceNotFound): self.fs.getsize("doesnotexist") def test_getsyspath(self): self.fs.create("foo") try: syspath = self.fs.getsyspath("foo") except errors.NoSysPath: self.assertFalse(self.fs.hassyspath("foo")) else: self.assertIsInstance(syspath, text_type) self.assertIsInstance(self.fs.getospath("foo"), bytes) self.assertTrue(self.fs.hassyspath("foo")) # Should not throw an error self.fs.hassyspath("a/b/c/foo/bar") def test_geturl(self): self.fs.create("foo") try: self.fs.geturl("foo") except errors.NoURL: self.assertFalse(self.fs.hasurl("foo")) else: self.assertTrue(self.fs.hasurl("foo")) # Should not throw an error self.fs.hasurl("a/b/c/foo/bar") def test_geturl_purpose(self): """Check an unknown purpose raises a NoURL error. """ self.fs.create("foo") with self.assertRaises(errors.NoURL): self.fs.geturl("foo", purpose="__nosuchpurpose__") def test_validatepath(self): """Check validatepath returns an absolute path. """ path = self.fs.validatepath("foo") self.assertEqual(path, "/foo") def test_invalid_chars(self): # Test invalid path method. with self.assertRaises(errors.InvalidCharsInPath): self.fs.open("invalid\0file", "wb") with self.assertRaises(errors.InvalidCharsInPath): self.fs.validatepath("invalid\0file") def test_getinfo(self): # Test special case of root directory # Root directory has a name of '' root_info = self.fs.getinfo("/") self.assertEqual(root_info.name, "") self.assertTrue(root_info.is_dir) # Make a file of known size self.fs.writebytes("foo", b"bar") self.fs.makedir("dir") # Check basic namespace info = self.fs.getinfo("foo").raw self.assertIsInstance(info["basic"]["name"], text_type) self.assertEqual(info["basic"]["name"], "foo") self.assertFalse(info["basic"]["is_dir"]) # Check basic namespace dir info = self.fs.getinfo("dir").raw self.assertEqual(info["basic"]["name"], "dir") self.assertTrue(info["basic"]["is_dir"]) # Get the info info = self.fs.getinfo("foo", namespaces=["details"]).raw self.assertIsInstance(info, dict) self.assertEqual(info["details"]["size"], 3) self.assertEqual(info["details"]["type"], int(ResourceType.file)) # Test getdetails self.assertEqual(info, self.fs.getdetails("foo").raw) # Raw info should be serializable try: json.dumps(info) except (TypeError, ValueError): raise AssertionError("info should be JSON serializable") # Non existant namespace is not an error no_info = self.fs.getinfo("foo", "__nosuchnamespace__").raw self.assertIsInstance(no_info, dict) self.assertEqual(no_info["basic"], {"name": "foo", "is_dir": False}) # Check a number of standard namespaces # FS objects may not support all these, but we can at least # invoke the code info = self.fs.getinfo("foo", namespaces=["access", "stat", "details"]) # Check that if the details namespace is present, times are # of valid types. if "details" in info.namespaces: details = info.raw["details"] self.assertIsInstance(details.get("accessed"), (type(None), int, float)) self.assertIsInstance(details.get("modified"), (type(None), int, float)) self.assertIsInstance(details.get("created"), (type(None), int, float)) self.assertIsInstance( details.get("metadata_changed"), (type(None), int, float) ) def test_exists(self): # Test exists method. # Check root directory always exists self.assertTrue(self.fs.exists("/")) self.assertTrue(self.fs.exists("")) # Check files don't exist self.assertFalse(self.fs.exists("foo")) self.assertFalse(self.fs.exists("foo/bar")) self.assertFalse(self.fs.exists("foo/bar/baz")) self.assertFalse(self.fs.exists("egg")) # make some files and directories self.fs.makedirs("foo/bar") self.fs.writebytes("foo/bar/baz", b"test") # Check files exists self.assertTrue(self.fs.exists("foo")) self.assertTrue(self.fs.exists("foo/bar")) self.assertTrue(self.fs.exists("foo/bar/baz")) self.assertFalse(self.fs.exists("egg")) self.assert_exists("foo") self.assert_exists("foo/bar") self.assert_exists("foo/bar/baz") self.assert_not_exists("egg") # Delete a file self.fs.remove("foo/bar/baz") # Check it no longer exists self.assert_not_exists("foo/bar/baz") self.assertFalse(self.fs.exists("foo/bar/baz")) self.assert_not_exists("foo/bar/baz") # Check root directory always exists self.assertTrue(self.fs.exists("/")) self.assertTrue(self.fs.exists("")) def test_listdir(self): # Check listing directory that doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.listdir("foobar") # Check aliases for root self.assertEqual(self.fs.listdir("/"), []) self.assertEqual(self.fs.listdir("."), []) self.assertEqual(self.fs.listdir("./"), []) # Make a few objects self.fs.writebytes("foo", b"egg") self.fs.writebytes("bar", b"egg") self.fs.makedir("baz") # This should not be listed self.fs.writebytes("baz/egg", b"egg") # Check list works six.assertCountEqual(self, self.fs.listdir("/"), ["foo", "bar", "baz"]) six.assertCountEqual(self, self.fs.listdir("."), ["foo", "bar", "baz"]) six.assertCountEqual(self, self.fs.listdir("./"), ["foo", "bar", "baz"]) # Check paths are unicode strings for name in self.fs.listdir("/"): self.assertIsInstance(name, text_type) # Create a subdirectory self.fs.makedir("dir") # Should start empty self.assertEqual(self.fs.listdir("/dir"), []) # Write some files self.fs.writebytes("dir/foofoo", b"egg") self.fs.writebytes("dir/barbar", b"egg") # Check listing subdirectory six.assertCountEqual(self, self.fs.listdir("dir"), ["foofoo", "barbar"]) # Make sure they are unicode stringd for name in self.fs.listdir("dir"): self.assertIsInstance(name, text_type) self.fs.create("notadir") with self.assertRaises(errors.DirectoryExpected): self.fs.listdir("notadir") def test_move(self): # Make a file self.fs.writebytes("foo", b"egg") self.assert_isfile("foo") # Move it self.fs.move("foo", "bar") # Check it has gone from original location self.assert_not_exists("foo") # Check it exists in the new location, and contents match self.assert_exists("bar") self.assert_bytes("bar", b"egg") # Check moving to existing file fails self.fs.writebytes("foo2", b"eggegg") with self.assertRaises(errors.DestinationExists): self.fs.move("foo2", "bar") # Check move with overwrite=True self.fs.move("foo2", "bar", overwrite=True) self.assert_not_exists("foo2") # Check moving to a non-existant directory with self.assertRaises(errors.ResourceNotFound): self.fs.move("bar", "egg/bar") # Check moving an unexisting source with self.assertRaises(errors.ResourceNotFound): self.fs.move("egg", "spam") # Check moving between different directories self.fs.makedir("baz") self.fs.writebytes("baz/bazbaz", b"bazbaz") self.fs.makedir("baz2") self.fs.move("baz/bazbaz", "baz2/bazbaz") self.assert_not_exists("baz/bazbaz") self.assert_bytes("baz2/bazbaz", b"bazbaz") # Check moving a directory raises an error self.assert_isdir("baz2") self.assert_not_exists("yolk") with self.assertRaises(errors.FileExpected): self.fs.move("baz2", "yolk") def test_makedir(self): # Check edge case of root with self.assertRaises(errors.DirectoryExists): self.fs.makedir("/") # Making root is a null op with recreate slash_fs = self.fs.makedir("/", recreate=True) self.assertIsInstance(slash_fs, SubFS) self.assertEqual(self.fs.listdir("/"), []) self.assert_not_exists("foo") self.fs.makedir("foo") self.assert_isdir("foo") self.assertEqual(self.fs.gettype("foo"), ResourceType.directory) self.fs.writebytes("foo/bar.txt", b"egg") self.assert_bytes("foo/bar.txt", b"egg") # Directory exists with self.assertRaises(errors.DirectoryExists): self.fs.makedir("foo") # Parent directory doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.makedir("/foo/bar/baz") self.fs.makedir("/foo/bar") self.fs.makedir("/foo/bar/baz") with self.assertRaises(errors.DirectoryExists): self.fs.makedir("foo/bar/baz") with self.assertRaises(errors.DirectoryExists): self.fs.makedir("foo/bar.txt") def test_makedirs(self): self.assertFalse(self.fs.exists("foo")) self.fs.makedirs("foo") self.assertEqual(self.fs.gettype("foo"), ResourceType.directory) self.fs.makedirs("foo/bar/baz") self.assertTrue(self.fs.isdir("foo/bar")) self.assertTrue(self.fs.isdir("foo/bar/baz")) with self.assertRaises(errors.DirectoryExists): self.fs.makedirs("foo/bar/baz") self.fs.makedirs("foo/bar/baz", recreate=True) self.fs.writebytes("foo.bin", b"test") with self.assertRaises(errors.DirectoryExpected): self.fs.makedirs("foo.bin/bar") with self.assertRaises(errors.DirectoryExpected): self.fs.makedirs("foo.bin/bar/baz/egg") def test_repeat_dir(self): # Catches bug with directories contain repeated names, # discovered in s3fs self.fs.makedirs("foo/foo/foo") self.assertEqual(self.fs.listdir(""), ["foo"]) self.assertEqual(self.fs.listdir("foo"), ["foo"]) self.assertEqual(self.fs.listdir("foo/foo"), ["foo"]) self.assertEqual(self.fs.listdir("foo/foo/foo"), []) scan = list(self.fs.scandir("foo")) self.assertEqual(len(scan), 1) self.assertEqual(scan[0].name, "foo") def test_open(self): # Open a file that doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.open("doesnotexist", "r") self.fs.makedir("foo") # Create a new text file text = "Hello, World" with self.fs.open("foo/hello", "wt") as f: repr(f) self.assertIsInstance(f, io.IOBase) self.assertTrue(f.writable()) self.assertFalse(f.readable()) self.assertFalse(f.closed) f.write(text) self.assertTrue(f.closed) # Read it back with self.fs.open("foo/hello", "rt") as f: self.assertIsInstance(f, io.IOBase) self.assertTrue(f.readable()) self.assertFalse(f.writable()) self.assertFalse(f.closed) hello = f.read() self.assertTrue(f.closed) self.assertEqual(hello, text) self.assert_text("foo/hello", text) # Test overwrite text = "Goodbye, World" with self.fs.open("foo/hello", "wt") as f: f.write(text) self.assert_text("foo/hello", text) # Open from missing dir with self.assertRaises(errors.ResourceNotFound): self.fs.open("/foo/bar/test.txt") # Test fileno returns a file number, if supported by the file. with self.fs.open("foo/hello") as f: try: fn = f.fileno() except io.UnsupportedOperation: pass else: self.assertEqual(os.read(fn, 7), b"Goodbye") # Test text files are proper iterators over themselves lines = os.linesep.join(["Line 1", "Line 2", "Line 3"]) self.fs.writetext("iter.txt", lines) with self.fs.open("iter.txt") as f: for actual, expected in zip(f, lines.splitlines(1)): self.assertEqual(actual, expected) def test_openbin_rw(self): # Open a file that doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("doesnotexist", "r") self.fs.makedir("foo") # Create a new text file text = b"Hello, World\n" with self.fs.openbin("foo/hello", "w") as f: repr(f) self.assertIsInstance(f, io.IOBase) self.assertTrue(f.writable()) self.assertFalse(f.readable()) self.assertEqual(len(text), f.write(text)) self.assertFalse(f.closed) self.assertTrue(f.closed) with self.assertRaises(errors.FileExists): with self.fs.openbin("foo/hello", "x") as f: pass # Read it back with self.fs.openbin("foo/hello", "r") as f: self.assertIsInstance(f, io.IOBase) self.assertTrue(f.readable()) self.assertFalse(f.writable()) hello = f.read() self.assertFalse(f.closed) self.assertTrue(f.closed) self.assertEqual(hello, text) self.assert_bytes("foo/hello", text) # Test overwrite text = b"Goodbye, World" with self.fs.openbin("foo/hello", "w") as f: self.assertEqual(len(text), f.write(text)) self.assert_bytes("foo/hello", text) # Test FileExpected raised with self.assertRaises(errors.FileExpected): self.fs.openbin("foo") # directory # Open from missing dir with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("/foo/bar/test.txt") # Test fileno returns a file number, if supported by the file. with self.fs.openbin("foo/hello") as f: try: fn = f.fileno() except io.UnsupportedOperation: pass else: self.assertEqual(os.read(fn, 7), b"Goodbye") # Test binary files are proper iterators over themselves lines = b"\n".join([b"Line 1", b"Line 2", b"Line 3"]) self.fs.writebytes("iter.bin", lines) with self.fs.openbin("iter.bin") as f: for actual, expected in zip(f, lines.splitlines(1)): self.assertEqual(actual, expected) def test_open_files(self): # Test file-like objects work as expected. with self.fs.open("text", "w") as f: repr(f) text_type(f) self.assertIsInstance(f, io.IOBase) self.assertTrue(f.writable()) self.assertFalse(f.readable()) self.assertFalse(f.closed) self.assertEqual(f.tell(), 0) f.write("Hello\nWorld\n") self.assertEqual(f.tell(), 12) f.writelines(["foo\n", "bar\n", "baz\n"]) with self.assertRaises(IOError): f.read(1) self.assertTrue(f.closed) with self.fs.open("bin", "wb") as f: with self.assertRaises(IOError): f.read(1) with self.fs.open("text", "r") as f: repr(f) text_type(f) self.assertIsInstance(f, io.IOBase) self.assertFalse(f.writable()) self.assertTrue(f.readable()) self.assertFalse(f.closed) self.assertEqual( f.readlines(), ["Hello\n", "World\n", "foo\n", "bar\n", "baz\n"] ) with self.assertRaises(IOError): f.write("no") self.assertTrue(f.closed) with self.fs.open("text", "rb") as f: self.assertIsInstance(f, io.IOBase) self.assertFalse(f.writable()) self.assertTrue(f.readable()) self.assertFalse(f.closed) self.assertEqual(f.readlines(8), [b"Hello\n", b"World\n"]) with self.assertRaises(IOError): f.write(b"no") self.assertTrue(f.closed) with self.fs.open("text", "r") as f: self.assertEqual(list(f), ["Hello\n", "World\n", "foo\n", "bar\n", "baz\n"]) self.assertFalse(f.closed) self.assertTrue(f.closed) iter_lines = iter(self.fs.open("text")) self.assertEqual(next(iter_lines), "Hello\n") with self.fs.open("unicode", "w") as f: self.assertEqual(12, f.write("Héllo\nWörld\n")) with self.fs.open("text", "rb") as f: self.assertIsInstance(f, io.IOBase) self.assertFalse(f.writable()) self.assertTrue(f.readable()) self.assertTrue(f.seekable()) self.assertFalse(f.closed) self.assertEqual(f.read(1), b"H") self.assertEqual(3, f.seek(3, Seek.set)) self.assertEqual(f.read(1), b"l") self.assertEqual(6, f.seek(2, Seek.current)) self.assertEqual(f.read(1), b"W") self.assertEqual(22, f.seek(-2, Seek.end)) self.assertEqual(f.read(1), b"z") with self.assertRaises(ValueError): f.seek(10, 77) self.assertTrue(f.closed) with self.fs.open("text", "r+b") as f: self.assertIsInstance(f, io.IOBase) self.assertTrue(f.readable()) self.assertTrue(f.writable()) self.assertTrue(f.seekable()) self.assertFalse(f.closed) self.assertEqual(5, f.seek(5)) self.assertEqual(5, f.truncate()) self.assertEqual(0, f.seek(0)) self.assertEqual(f.read(), b"Hello") self.assertEqual(10, f.truncate(10)) self.assertEqual(5, f.tell()) self.assertEqual(0, f.seek(0)) print(repr(self.fs)) print(repr(f)) self.assertEqual(f.read(), b"Hello\0\0\0\0\0") self.assertEqual(4, f.seek(4)) f.write(b"O") self.assertEqual(4, f.seek(4)) self.assertEqual(f.read(1), b"O") self.assertTrue(f.closed) def test_openbin(self): # Write a binary file with self.fs.openbin("file.bin", "wb") as write_file: repr(write_file) text_type(write_file) self.assertIsInstance(write_file, io.IOBase) self.assertTrue(write_file.writable()) self.assertFalse(write_file.readable()) self.assertFalse(write_file.closed) self.assertEqual(3, write_file.write(b"\0\1\2")) self.assertTrue(write_file.closed) # Read a binary file with self.fs.openbin("file.bin", "rb") as read_file: repr(write_file) text_type(write_file) self.assertIsInstance(read_file, io.IOBase) self.assertTrue(read_file.readable()) self.assertFalse(read_file.writable()) self.assertFalse(read_file.closed) data = read_file.read() self.assertEqual(data, b"\0\1\2") self.assertTrue(read_file.closed) # Check disallow text mode with self.assertRaises(ValueError): with self.fs.openbin("file.bin", "rt") as read_file: pass # Check errors with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("foo.bin") # Open from missing dir with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("/foo/bar/test.txt") self.fs.makedir("foo") # Attempt to open a directory with self.assertRaises(errors.FileExpected): self.fs.openbin("/foo") # Attempt to write to a directory with self.assertRaises(errors.FileExpected): self.fs.openbin("/foo", "w") # Opening a file in a directory which doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("/egg/bar") # Opening a file in a directory which doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.openbin("/egg/bar", "w") # Opening with a invalid mode with self.assertRaises(ValueError): self.fs.openbin("foo.bin", "h") def test_open_exclusive(self): with self.fs.open("test_open_exclusive", "x") as f: f.write("bananas") with self.assertRaises(errors.FileExists): self.fs.open("test_open_exclusive", "x") def test_openbin_exclusive(self): with self.fs.openbin("test_openbin_exclusive", "x") as f: f.write(b"bananas") with self.assertRaises(errors.FileExists): self.fs.openbin("test_openbin_exclusive", "x") def test_opendir(self): # Make a simple directory structure self.fs.makedir("foo") self.fs.writebytes("foo/bar", b"barbar") self.fs.writebytes("foo/egg", b"eggegg") # Open a sub directory with self.fs.opendir("foo") as foo_fs: repr(foo_fs) text_type(foo_fs) six.assertCountEqual(self, foo_fs.listdir("/"), ["bar", "egg"]) self.assertTrue(foo_fs.isfile("bar")) self.assertTrue(foo_fs.isfile("egg")) self.assertEqual(foo_fs.readbytes("bar"), b"barbar") self.assertEqual(foo_fs.readbytes("egg"), b"eggegg") self.assertFalse(self.fs.isclosed()) # Attempt to open a non-existent directory with self.assertRaises(errors.ResourceNotFound): self.fs.opendir("egg") # Check error when doing opendir on a non dir with self.assertRaises(errors.DirectoryExpected): self.fs.opendir("foo/egg") # These should work, and will essentially return a 'clone' of sorts self.fs.opendir("") self.fs.opendir("/") # Check ClosingSubFS closes 'parent' with self.fs.opendir("foo", factory=ClosingSubFS) as foo_fs: six.assertCountEqual(self, foo_fs.listdir("/"), ["bar", "egg"]) self.assertTrue(foo_fs.isfile("bar")) self.assertTrue(foo_fs.isfile("egg")) self.assertEqual(foo_fs.readbytes("bar"), b"barbar") self.assertEqual(foo_fs.readbytes("egg"), b"eggegg") self.assertTrue(self.fs.isclosed()) def test_remove(self): self.fs.writebytes("foo1", b"test1") self.fs.writebytes("foo2", b"test2") self.fs.writebytes("foo3", b"test3") self.assert_isfile("foo1") self.assert_isfile("foo2") self.assert_isfile("foo3") self.fs.remove("foo2") self.assert_isfile("foo1") self.assert_not_exists("foo2") self.assert_isfile("foo3") with self.assertRaises(errors.ResourceNotFound): self.fs.remove("bar") self.fs.makedir("dir") with self.assertRaises(errors.FileExpected): self.fs.remove("dir") self.fs.makedirs("foo/bar/baz/") error_msg = "resource 'foo/bar/egg/test.txt' not found" assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp) with assertRaisesRegex(errors.ResourceNotFound, error_msg): self.fs.remove("foo/bar/egg/test.txt") def test_removedir(self): # Test removing root with self.assertRaises(errors.RemoveRootError): self.fs.removedir("/") self.fs.makedirs("foo/bar/baz") self.assertTrue(self.fs.exists("foo/bar/baz")) self.fs.removedir("foo/bar/baz") self.assertFalse(self.fs.exists("foo/bar/baz")) self.assertTrue(self.fs.isdir("foo/bar")) with self.assertRaises(errors.ResourceNotFound): self.fs.removedir("nodir") # Test force removal self.fs.makedirs("foo/bar/baz") self.fs.writebytes("foo/egg", b"test") with self.assertRaises(errors.DirectoryExpected): self.fs.removedir("foo/egg") with self.assertRaises(errors.DirectoryNotEmpty): self.fs.removedir("foo/bar") def test_removetree(self): self.fs.makedirs("foo/bar/baz") self.fs.makedirs("foo/egg") self.fs.makedirs("foo/a/b/c/d/e") self.fs.create("foo/egg.txt") self.fs.create("foo/bar/egg.bin") self.fs.create("foo/bar/baz/egg.txt") self.fs.create("foo/a/b/c/1.txt") self.fs.create("foo/a/b/c/2.txt") self.fs.create("foo/a/b/c/3.txt") self.assert_exists("foo/egg.txt") self.assert_exists("foo/bar/egg.bin") self.fs.removetree("foo") self.assert_not_exists("foo") def test_setinfo(self): self.fs.create("birthday.txt") now = math.floor(time.time()) change_info = {"details": {"accessed": now + 60, "modified": now + 60 * 60}} self.fs.setinfo("birthday.txt", change_info) new_info = self.fs.getinfo("birthday.txt", namespaces=["details"]).raw if "accessed" in new_info.get("_write", []): self.assertEqual(new_info["details"]["accessed"], now + 60) if "modified" in new_info.get("_write", []): self.assertEqual(new_info["details"]["modified"], now + 60 * 60) with self.assertRaises(errors.ResourceNotFound): self.fs.setinfo("nothing", {}) def test_settimes(self): self.fs.create("birthday.txt") self.fs.settimes("birthday.txt", accessed=datetime(2016, 7, 5)) info = self.fs.getinfo("birthday.txt", namespaces=["details"]) writeable = info.get("details", "_write", []) if "accessed" in writeable: self.assertEqual(info.accessed, datetime(2016, 7, 5, tzinfo=pytz.UTC)) if "modified" in writeable: self.assertEqual(info.modified, datetime(2016, 7, 5, tzinfo=pytz.UTC)) def test_touch(self): self.fs.touch("new.txt") self.assert_isfile("new.txt") self.fs.settimes("new.txt", datetime(2016, 7, 5)) info = self.fs.getinfo("new.txt", namespaces=["details"]) if info.is_writeable("details", "accessed"): self.assertEqual(info.accessed, datetime(2016, 7, 5, tzinfo=pytz.UTC)) now = time.time() self.fs.touch("new.txt") accessed = self.fs.getinfo("new.txt", namespaces=["details"]).raw[ "details" ]["accessed"] self.assertTrue(accessed - now < 5) def test_close(self): self.assertFalse(self.fs.isclosed()) self.fs.close() self.assertTrue(self.fs.isclosed()) # Check second close call is a no-op self.fs.close() self.assertTrue(self.fs.isclosed()) # Check further operations raise a FilesystemClosed exception with self.assertRaises(errors.FilesystemClosed): self.fs.openbin("test.bin") def test_copy(self): # Test copy to new path self.fs.writebytes("foo", b"test") self.fs.copy("foo", "bar") self.assert_bytes("bar", b"test") # Test copy over existing path self.fs.writebytes("baz", b"truncateme") self.fs.copy("foo", "baz", overwrite=True) self.assert_bytes("foo", b"test") # Test copying a file to a destination that exists with self.assertRaises(errors.DestinationExists): self.fs.copy("baz", "foo") # Test copying to a directory that doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.copy("baz", "a/b/c/baz") # Test copying a source that doesn't exist with self.assertRaises(errors.ResourceNotFound): self.fs.copy("egg", "spam") # Test copying a directory self.fs.makedir("dir") with self.assertRaises(errors.FileExpected): self.fs.copy("dir", "folder") def _test_upload(self, workers): """Test fs.copy with varying number of worker threads.""" data1 = b"foo" * 256 * 1024 data2 = b"bar" * 2 * 256 * 1024 data3 = b"baz" * 3 * 256 * 1024 data4 = b"egg" * 7 * 256 * 1024 with open_fs("temp://") as src_fs: src_fs.writebytes("foo", data1) src_fs.writebytes("bar", data2) src_fs.makedir("dir1").writebytes("baz", data3) src_fs.makedirs("dir2/dir3").writebytes("egg", data4) dst_fs = self.fs fs.copy.copy_fs(src_fs, dst_fs, workers=workers) self.assertEqual(dst_fs.readbytes("foo"), data1) self.assertEqual(dst_fs.readbytes("bar"), data2) self.assertEqual(dst_fs.readbytes("dir1/baz"), data3) self.assertEqual(dst_fs.readbytes("dir2/dir3/egg"), data4) def test_upload_0(self): self._test_upload(0) def test_upload_1(self): self._test_upload(1) def test_upload_2(self): self._test_upload(2) def test_upload_4(self): self._test_upload(4) def _test_download(self, workers): """Test fs.copy with varying number of worker threads.""" data1 = b"foo" * 256 * 1024 data2 = b"bar" * 2 * 256 * 1024 data3 = b"baz" * 3 * 256 * 1024 data4 = b"egg" * 7 * 256 * 1024 src_fs = self.fs with open_fs("temp://") as dst_fs: src_fs.writebytes("foo", data1) src_fs.writebytes("bar", data2) src_fs.makedir("dir1").writebytes("baz", data3) src_fs.makedirs("dir2/dir3").writebytes("egg", data4) fs.copy.copy_fs(src_fs, dst_fs, workers=workers) self.assertEqual(dst_fs.readbytes("foo"), data1) self.assertEqual(dst_fs.readbytes("bar"), data2) self.assertEqual(dst_fs.readbytes("dir1/baz"), data3) self.assertEqual(dst_fs.readbytes("dir2/dir3/egg"), data4) def test_download_0(self): self._test_download(0) def test_download_1(self): self._test_download(1) def test_download_2(self): self._test_download(2) def test_download_4(self): self._test_download(4) def test_create(self): # Test create new file self.assertFalse(self.fs.exists("foo")) self.fs.create("foo") self.assertTrue(self.fs.exists("foo")) self.assertEqual(self.fs.gettype("foo"), ResourceType.file) self.assertEqual(self.fs.getsize("foo"), 0) # Test wipe existing file self.fs.writebytes("foo", b"bar") self.assertEqual(self.fs.getsize("foo"), 3) self.fs.create("foo", wipe=True) self.assertEqual(self.fs.getsize("foo"), 0) # Test create with existing file, and not wipe self.fs.writebytes("foo", b"bar") self.assertEqual(self.fs.getsize("foo"), 3) self.fs.create("foo", wipe=False) self.assertEqual(self.fs.getsize("foo"), 3) def test_desc(self): # Describe a file self.fs.create("foo") description = self.fs.desc("foo") self.assertIsInstance(description, text_type) # Describe a dir self.fs.makedir("dir") self.fs.desc("dir") # Special cases that may hide bugs self.fs.desc("/") self.fs.desc("") with self.assertRaises(errors.ResourceNotFound): self.fs.desc("bar") def test_scandir(self): # Check exception for scanning dir that doesn't exist with self.assertRaises(errors.ResourceNotFound): for _info in self.fs.scandir("/foobar"): pass # Check scandir returns an iterable iter_scandir = self.fs.scandir("/") self.assertTrue(isinstance(iter_scandir, collections_abc.Iterable)) self.assertEqual(list(iter_scandir), []) # Check scanning self.fs.create("foo") # Can't scandir on a file with self.assertRaises(errors.DirectoryExpected): list(self.fs.scandir("foo")) self.fs.create("bar") self.fs.makedir("dir") iter_scandir = self.fs.scandir("/") self.assertTrue(isinstance(iter_scandir, collections_abc.Iterable)) scandir = sorted( (r.raw for r in iter_scandir), key=lambda info: info["basic"]["name"] ) # Filesystems may send us more than we ask for # We just want to test the 'basic' namespace scandir = [{"basic": i["basic"]} for i in scandir] self.assertEqual( scandir, [ {"basic": {"name": "bar", "is_dir": False}}, {"basic": {"name": "dir", "is_dir": True}}, {"basic": {"name": "foo", "is_dir": False}}, ], ) # Hard to test optional namespaces, but at least run the code list( self.fs.scandir( "/", namespaces=["details", "link", "stat", "lstat", "access"] ) ) # Test paging page1 = list(self.fs.scandir("/", page=(None, 2))) self.assertEqual(len(page1), 2) page2 = list(self.fs.scandir("/", page=(2, 4))) self.assertEqual(len(page2), 1) page3 = list(self.fs.scandir("/", page=(4, 6))) self.assertEqual(len(page3), 0) paged = {r.name for r in itertools.chain(page1, page2)} self.assertEqual(paged, {"foo", "bar", "dir"}) def test_filterdir(self): self.assertEqual(list(self.fs.filterdir("/", files=["*.py"])), []) self.fs.makedir("bar") self.fs.create("foo.txt") self.fs.create("foo.py") self.fs.create("foo.pyc") page1 = list(self.fs.filterdir("/", page=(None, 2))) page2 = list(self.fs.filterdir("/", page=(2, 4))) page3 = list(self.fs.filterdir("/", page=(4, 6))) self.assertEqual(len(page1), 2) self.assertEqual(len(page2), 2) self.assertEqual(len(page3), 0) names = [info.name for info in itertools.chain(page1, page2, page3)] self.assertEqual(set(names), {"foo.txt", "foo.py", "foo.pyc", "bar"}) # Check filtering by wildcard dir_list = [info.name for info in self.fs.filterdir("/", files=["*.py"])] self.assertEqual(set(dir_list), {"bar", "foo.py"}) # Check filtering by miltiple wildcard dir_list = [ info.name for info in self.fs.filterdir("/", files=["*.py", "*.pyc"]) ] self.assertEqual(set(dir_list), {"bar", "foo.py", "foo.pyc"}) # Check excluding dirs dir_list = [ info.name for info in self.fs.filterdir( "/", exclude_dirs=["*"], files=["*.py", "*.pyc"] ) ] self.assertEqual(set(dir_list), {"foo.py", "foo.pyc"}) # Check excluding files dir_list = [info.name for info in self.fs.filterdir("/", exclude_files=["*"])] self.assertEqual(set(dir_list), {"bar"}) # Check wildcards must be a list with self.assertRaises(TypeError): dir_list = [info.name for info in self.fs.filterdir("/", files="*.py")] self.fs.makedir("baz") dir_list = [ info.name for info in self.fs.filterdir("/", exclude_files=["*"], dirs=["??z"]) ] self.assertEqual(set(dir_list), {"baz"}) with self.assertRaises(TypeError): dir_list = [ info.name for info in self.fs.filterdir("/", exclude_files=["*"], dirs="*.py") ] def test_readbytes(self): # Test readbytes method. all_bytes = b"".join(six.int2byte(n) for n in range(256)) with self.fs.open("foo", "wb") as f: f.write(all_bytes) self.assertEqual(self.fs.readbytes("foo"), all_bytes) _all_bytes = self.fs.readbytes("foo") self.assertIsInstance(_all_bytes, bytes) self.assertEqual(_all_bytes, all_bytes) with self.assertRaises(errors.ResourceNotFound): self.fs.readbytes("foo/bar") self.fs.makedir("baz") with self.assertRaises(errors.FileExpected): self.fs.readbytes("baz") def test_download(self): test_bytes = b"Hello, World" self.fs.writebytes("hello.bin", test_bytes) write_file = io.BytesIO() self.fs.download("hello.bin", write_file) self.assertEqual(write_file.getvalue(), test_bytes) with self.assertRaises(errors.ResourceNotFound): self.fs.download("foo.bin", write_file) def test_download_chunk_size(self): test_bytes = b"Hello, World" * 100 self.fs.writebytes("hello.bin", test_bytes) write_file = io.BytesIO() self.fs.download("hello.bin", write_file, chunk_size=8) self.assertEqual(write_file.getvalue(), test_bytes) def test_isempty(self): self.assertTrue(self.fs.isempty("/")) self.fs.makedir("foo") self.assertFalse(self.fs.isempty("/")) self.assertTrue(self.fs.isempty("/foo")) self.fs.create("foo/bar.txt") self.assertFalse(self.fs.isempty("/foo")) self.fs.remove("foo/bar.txt") self.assertTrue(self.fs.isempty("/foo")) def test_writebytes(self): all_bytes = b"".join(six.int2byte(n) for n in range(256)) self.fs.writebytes("foo", all_bytes) with self.fs.open("foo", "rb") as f: _bytes = f.read() self.assertIsInstance(_bytes, bytes) self.assertEqual(_bytes, all_bytes) self.assert_bytes("foo", all_bytes) with self.assertRaises(TypeError): self.fs.writebytes("notbytes", "unicode") def test_readtext(self): self.fs.makedir("foo") with self.fs.open("foo/unicode.txt", "wt") as f: f.write(UNICODE_TEXT) text = self.fs.readtext("foo/unicode.txt") self.assertIsInstance(text, text_type) self.assertEqual(text, UNICODE_TEXT) self.assert_text("foo/unicode.txt", UNICODE_TEXT) def test_writetext(self): # Test writetext method. self.fs.writetext("foo", "bar") with self.fs.open("foo", "rt") as f: foo = f.read() self.assertEqual(foo, "bar") self.assertIsInstance(foo, text_type) with self.assertRaises(TypeError): self.fs.writetext("nottext", b"bytes") def test_writefile(self): bytes_file = io.BytesIO(b"bar") self.fs.writefile("foo", bytes_file) with self.fs.open("foo", "rb") as f: data = f.read() self.assertEqual(data, b"bar") def test_upload(self): bytes_file = io.BytesIO(b"bar") self.fs.upload("foo", bytes_file) with self.fs.open("foo", "rb") as f: data = f.read() self.assertEqual(data, b"bar") def test_upload_chunk_size(self): test_data = b"bar" * 128 bytes_file = io.BytesIO(test_data) self.fs.upload("foo", bytes_file, chunk_size=8) with self.fs.open("foo", "rb") as f: data = f.read() self.assertEqual(data, test_data) def test_bin_files(self): # Check binary files. with self.fs.openbin("foo1", "wb") as f: text_type(f) repr(f) f.write(b"a") f.write(b"b") f.write(b"c") self.assert_bytes("foo1", b"abc") # Test writelines with self.fs.openbin("foo2", "wb") as f: f.writelines([b"hello\n", b"world"]) self.assert_bytes("foo2", b"hello\nworld") # Test readline with self.fs.openbin("foo2") as f: self.assertEqual(f.readline(), b"hello\n") self.assertEqual(f.readline(), b"world") # Test readlines with self.fs.openbin("foo2") as f: lines = f.readlines() self.assertEqual(lines, [b"hello\n", b"world"]) with self.fs.openbin("foo2") as f: lines = list(f) self.assertEqual(lines, [b"hello\n", b"world"]) with self.fs.openbin("foo2") as f: lines = [] for line in f: lines.append(line) self.assertEqual(lines, [b"hello\n", b"world"]) with self.fs.openbin("foo2") as f: print(repr(f)) self.assertEqual(next(f), b"hello\n") # Test truncate with self.fs.open("foo2", "r+b") as f: f.truncate(3) self.assertEqual(self.fs.getsize("foo2"), 3) self.assert_bytes("foo2", b"hel") def test_files(self): # Test multiple writes with self.fs.open("foo1", "wt") as f: text_type(f) repr(f) f.write("a") f.write("b") f.write("c") self.assert_text("foo1", "abc") # Test writelines with self.fs.open("foo2", "wt") as f: f.writelines(["hello\n", "world"]) self.assert_text("foo2", "hello\nworld") # Test readline with self.fs.open("foo2") as f: self.assertEqual(f.readline(), "hello\n") self.assertEqual(f.readline(), "world") # Test readlines with self.fs.open("foo2") as f: lines = f.readlines() self.assertEqual(lines, ["hello\n", "world"]) with self.fs.open("foo2") as f: lines = list(f) self.assertEqual(lines, ["hello\n", "world"]) with self.fs.open("foo2") as f: lines = [] for line in f: lines.append(line) self.assertEqual(lines, ["hello\n", "world"]) # Test truncate with self.fs.open("foo2", "r+") as f: f.truncate(3) self.assertEqual(self.fs.getsize("foo2"), 3) self.assert_text("foo2", "hel") with self.fs.open("foo2", "ab") as f: f.write(b"p") self.assert_bytes("foo2", b"help") # Test __del__ doesn't throw traceback f = self.fs.open("foo2", "r") del f with self.assertRaises(IOError): with self.fs.open("foo2", "r") as f: f.write("no!") with self.assertRaises(IOError): with self.fs.open("newfoo", "w") as f: f.read(2) def test_copy_file(self): # Test fs.copy.copy_file bytes_test = b"Hello, World" self.fs.writebytes("foo.txt", bytes_test) fs.copy.copy_file(self.fs, "foo.txt", self.fs, "bar.txt") self.assert_bytes("bar.txt", bytes_test) mem_fs = open_fs("mem://") fs.copy.copy_file(self.fs, "foo.txt", mem_fs, "bar.txt") self.assertEqual(mem_fs.readbytes("bar.txt"), bytes_test) def test_copy_structure(self): mem_fs = open_fs("mem://") self.fs.makedirs("foo/bar/baz") self.fs.makedir("egg") fs.copy.copy_structure(self.fs, mem_fs) expected = {"/egg", "/foo", "/foo/bar", "/foo/bar/baz"} self.assertEqual(set(walk.walk_dirs(mem_fs)), expected) def _test_copy_dir(self, protocol): # Test copy.copy_dir. # Test copying to a another fs other_fs = open_fs(protocol) self.fs.makedirs("foo/bar/baz") self.fs.makedir("egg") self.fs.writetext("top.txt", "Hello, World") self.fs.writetext("/foo/bar/baz/test.txt", "Goodbye, World") fs.copy.copy_dir(self.fs, "/", other_fs, "/") expected = {"/egg", "/foo", "/foo/bar", "/foo/bar/baz"} self.assertEqual(set(walk.walk_dirs(other_fs)), expected) self.assert_text("top.txt", "Hello, World") self.assert_text("/foo/bar/baz/test.txt", "Goodbye, World") # Test copying a sub dir other_fs = open_fs("mem://") fs.copy.copy_dir(self.fs, "/foo", other_fs, "/") self.assertEqual(list(walk.walk_files(other_fs)), ["/bar/baz/test.txt"]) print("BEFORE") self.fs.tree() other_fs.tree() fs.copy.copy_dir(self.fs, "/foo", other_fs, "/egg") print("FS") self.fs.tree() print("OTHER") other_fs.tree() self.assertEqual( list(walk.walk_files(other_fs)), ["/bar/baz/test.txt", "/egg/bar/baz/test.txt"], ) def _test_copy_dir_write(self, protocol): # Test copying to this filesystem from another. other_fs = open_fs(protocol) other_fs.makedirs("foo/bar/baz") other_fs.makedir("egg") other_fs.writetext("top.txt", "Hello, World") other_fs.writetext("/foo/bar/baz/test.txt", "Goodbye, World") fs.copy.copy_dir(other_fs, "/", self.fs, "/") expected = {"/egg", "/foo", "/foo/bar", "/foo/bar/baz"} self.assertEqual(set(walk.walk_dirs(self.fs)), expected) self.assert_text("top.txt", "Hello, World") self.assert_text("/foo/bar/baz/test.txt", "Goodbye, World") def test_copy_dir_mem(self): # Test copy_dir with a mem fs. self._test_copy_dir("mem://") self._test_copy_dir_write("mem://") def test_copy_dir_temp(self): # Test copy_dir with a temp fs. self._test_copy_dir("temp://") self._test_copy_dir_write("temp://") def _test_move_dir_write(self, protocol): # Test moving to this filesystem from another. other_fs = open_fs(protocol) other_fs.makedirs("foo/bar/baz") other_fs.makedir("egg") other_fs.writetext("top.txt", "Hello, World") other_fs.writetext("/foo/bar/baz/test.txt", "Goodbye, World") fs.move.move_dir(other_fs, "/", self.fs, "/") expected = {"/egg", "/foo", "/foo/bar", "/foo/bar/baz"} self.assertEqual(other_fs.listdir("/"), []) self.assertEqual(set(walk.walk_dirs(self.fs)), expected) self.assert_text("top.txt", "Hello, World") self.assert_text("/foo/bar/baz/test.txt", "Goodbye, World") def test_move_dir_mem(self): self._test_move_dir_write("mem://") def test_move_dir_temp(self): self._test_move_dir_write("temp://") def test_move_same_fs(self): self.fs.makedirs("foo/bar/baz") self.fs.makedir("egg") self.fs.writetext("top.txt", "Hello, World") self.fs.writetext("/foo/bar/baz/test.txt", "Goodbye, World") fs.move.move_dir(self.fs, "foo", self.fs, "foo2") expected = {"/egg", "/foo2", "/foo2/bar", "/foo2/bar/baz"} self.assertEqual(set(walk.walk_dirs(self.fs)), expected) self.assert_text("top.txt", "Hello, World") self.assert_text("/foo2/bar/baz/test.txt", "Goodbye, World") def test_move_file_same_fs(self): text = "Hello, World" self.fs.makedir("foo").writetext("test.txt", text) self.assert_text("foo/test.txt", text) fs.move.move_file(self.fs, "foo/test.txt", self.fs, "foo/test2.txt") self.assert_not_exists("foo/test.txt") self.assert_text("foo/test2.txt", text) def _test_move_file(self, protocol): other_fs = open_fs(protocol) text = "Hello, World" self.fs.makedir("foo").writetext("test.txt", text) self.assert_text("foo/test.txt", text) with self.assertRaises(errors.ResourceNotFound): fs.move.move_file(self.fs, "foo/test.txt", other_fs, "foo/test2.txt") other_fs.makedir("foo") fs.move.move_file(self.fs, "foo/test.txt", other_fs, "foo/test2.txt") self.assertEqual(other_fs.readtext("foo/test2.txt"), text) def test_move_file_mem(self): self._test_move_file("mem://") def test_move_file_temp(self): self._test_move_file("temp://") def test_copydir(self): self.fs.makedirs("foo/bar/baz/egg") self.fs.writetext("foo/bar/foofoo.txt", "Hello") self.fs.makedir("foo2") self.fs.copydir("foo/bar", "foo2") self.assert_text("foo2/foofoo.txt", "Hello") self.assert_isdir("foo2/baz/egg") self.assert_text("foo/bar/foofoo.txt", "Hello") self.assert_isdir("foo/bar/baz/egg") with self.assertRaises(errors.ResourceNotFound): self.fs.copydir("foo", "foofoo") with self.assertRaises(errors.ResourceNotFound): self.fs.copydir("spam", "egg", create=True) with self.assertRaises(errors.DirectoryExpected): self.fs.copydir("foo2/foofoo.txt", "foofoo.txt", create=True) def test_movedir(self): self.fs.makedirs("foo/bar/baz/egg") self.fs.writetext("foo/bar/foofoo.txt", "Hello") self.fs.makedir("foo2") self.fs.movedir("foo/bar", "foo2") self.assert_text("foo2/foofoo.txt", "Hello") self.assert_isdir("foo2/baz/egg") self.assert_not_exists("foo/bar") self.assert_not_exists("foo/bar/foofoo.txt") self.assert_not_exists("foo/bar/baz/egg") # Check moving to an unexisting directory with self.assertRaises(errors.ResourceNotFound): self.fs.movedir("foo", "foofoo") # Check moving an unexisting directory with self.assertRaises(errors.ResourceNotFound): self.fs.movedir("spam", "egg", create=True) # Check moving a file with self.assertRaises(errors.DirectoryExpected): self.fs.movedir("foo2/foofoo.txt", "foo2/baz/egg") def test_match(self): self.assertTrue(self.fs.match(["*.py"], "foo.py")) self.assertEqual( self.fs.match(["*.py"], "FOO.PY"), self.fs.getmeta().get("case_insensitive", False), ) def test_tree(self): self.fs.makedirs("foo/bar") self.fs.create("test.txt") write_tree = io.StringIO() self.fs.tree(file=write_tree) written = write_tree.getvalue() expected = "|-- foo\n| `-- bar\n`-- test.txt\n" self.assertEqual(expected, written) def test_unicode_path(self): if not self.fs.getmeta().get("unicode_paths", False): return pytest.skip("the filesystem does not support unicode paths.") self.fs.makedir("földér") self.fs.writetext("☭.txt", "Smells like communism.") self.fs.writebytes("földér/☣.txt", b"Smells like an old syringe.") self.assert_isdir("földér") self.assertEqual(["☣.txt"], self.fs.listdir("földér")) self.assertEqual("☣.txt", self.fs.getinfo("földér/☣.txt").name) self.assert_text("☭.txt", "Smells like communism.") self.assert_bytes("földér/☣.txt", b"Smells like an old syringe.") if self.fs.hassyspath("földér/☣.txt"): self.assertTrue(os.path.exists(self.fs.getsyspath("föld
Foo") self.fs.touch("fOO") self.assert_exists("foo") self.assert_exists("Foo") self.assert_exists("fOO") self.assert_not_exists("FoO") self.assert_isdir("foo") self.assert_isdir("Foo") self.assert_isfile("fOO") def test_glob(self): self.assertIsInstance(self.fs.glob, glob.BoundGlobber) def test_hash(self): self.fs.makedir("foo").writebytes("hashme.txt", b"foobar" * 1024) self.assertEqual( self.fs.hash("foo/hashme.txt", "md5"), "9fff4bb103ab8ce4619064109c54cb9c" ) with self.assertRaises(errors.UnsupportedHash): self.fs.hash("foo/hashme.txt", "nohash") with self.fs.opendir("foo") as foo_fs: self.assertEqual( foo_fs.hash("hashme.txt", "md5"), "9fff4bb103ab8ce4619064109c54cb9c" )
ér/☣.txt"))) self.fs.remove("földér/☣.txt") self.assert_not_exists("földér/☣.txt") self.fs.removedir("földér") self.assert_not_exists("földér") def test_case_sensitive(self): meta = self.fs.getmeta() if "case_insensitive" not in meta: return pytest.skip("case sensitivity not known") if meta.get("case_insensitive", False): return pytest.skip("the filesystem is not case sensitive.") self.fs.makedir("foo") self.fs.makedir("
setupwiki.py
from docopt import docopt from appdirs import AppDirs try: from urlparse import urlparse except ImportError: from urllib import parse as urlparse import sys import os import shutil import time import logging from psiopic2.app.baseApp import Arg, BaseApp from psiopic2.app.baseApp import BASE_OPTIONS from psiopic2.app.baseApp import BASE_ARGS from psiopic2.corpus import pages from psiopic2.app.tasks import Extractor, SqlImporter, TableTruncator from psiopic2.app.tasks import Downloader from psiopic2.app.tasks import MWConfigWriter from psiopic2.app.tasks import TableCreator from psiopic2.app.tasks import XmlImporter from psiopic2.app.tasks import CompileXml2Sql from psiopic2.app.tasks import XmlCleaner from psiopic2.app.tasks import Xml2Sql from psiopic2.app.tasks import DumpExtractor from psiopic2.app.ui.logutils import getLogger import psiopic2.app.ui.widgets as widgets import psiopic2.app.ui.prompt as prompt from datetime import datetime from imp import PKG_DIRECTORY from psiopic2.utils.files import getArchiveBasename # WIKINEWS_URL = "http://dumps.wikimedia.org/enwikinews/latest/enwikinews-latest-pages-articles.xml.bz2" MEDIAWIKI_URL = "http://download.wikimedia.org/mediawiki/1.25/mediawiki-1.25.2.tar.gz" WIKINEWS_URL = "http://dumps.wikimedia.org/enwikinews/20150901/enwikinews-20150901-pages-articles.xml.bz2" MEDIAWIKI_DIR = "mediawiki-1.25.2" sysDirs = AppDirs('Psiopic2', 'Psikon') ARGS = [ Arg( title='Installion Directory', description='Path to where Mediawiki should be installed', name='install-dir', valueDesc='DIR', defaultValue=sysDirs.user_cache_dir + '/mediawiki'), Arg( title='Database hostname', description='Hostname or IP address for your MySQL database', name='dbhost', valueDesc='HOST', defaultValue='localhost'), Arg( title='Database port', description='Port number of your MySQL database', name='dbport', valueDesc='PORT', defaultValue=3306), Arg( title='Database username', description='MySQL Username', name='dbuser', valueDesc='USER', defaultValue='root'), Arg( title='Database password', description='Password for MySQL user', name='dbpass', valueDesc='PASS', defaultValue='root'), Arg( title='Database schema name', description='The database schema must already exist', name='dbname', valueDesc='NAME', defaultValue=None), Arg( title='Database type', description='Database type. Currently the only acceptable value is mysql', name='dbtype', valueDesc='TYPE', defaultValue='mysql'), Arg( title='Mediawiki URL', description='URL to the Mediawiki software tarball', name='mediawiki-url', valueDesc='URL', defaultValue=MEDIAWIKI_URL), Arg( title='XML Dump URL', description='URL to the XML database dump', name='xml-dump', valueDesc='URL', defaultValue=WIKINEWS_URL), Arg( title='Skip Database', description='Skip creating the database tables', name='skip-db', defaultValue=False, prompt=False), Arg( title='Force database table creation', description='Force creating the database tables', name='force-db', defaultValue=False, prompt=False), Arg( title='Skip Mediawiki Installation', description='Skip downloading and installing Mediawiki', name='skip-mw-install', defaultValue=False, prompt=False), Arg( title='Skip XML Import', description='Skip importing the XML database', name='skip-import', defaultValue=False, prompt=False), Arg( title='Skip XML Download', description='Skip downloading the XML database', name='skip-xml-download', defaultValue=False, prompt=False), Arg( title='Force Mediawiki Installation', description='If Mediawiki is already installed, this flag will a reinstallation but will not create database tables', defaultValue=False, name='force-mw-install', prompt=False), Arg( title='Force XML Import', description='If the XML database dump already exists, this flag will force it to be reimported', defaultValue=False, name='force-import', prompt=False), Arg( title='Force XML Download', description='If the XML database dump already exists, this flag will force it to be downloaded and extracted again', defaultValue=False, name='force-xml-download', prompt=False), Arg( title='Truncate database tables', description='If enabled, all database tables will be truncated', defaultValue=False, name='truncate', prompt=False) ] + BASE_ARGS def getFinalMediawikiDir(app): return app.getArg('install-dir') + '/' + getArchiveBasename(app.getArg('mediawiki-url')) def setupXmlDownloadWorkflow(app): finalInstallDir = getFinalMediawikiDir(app) pkg = os.path.basename(app.getArg('xml-dump')) finalBz2File = finalInstallDir + '/' + pkg app.addTask(Downloader, { 'src': app.getArg('xml-dump'), 'target': finalInstallDir, }, 'Downloading XML database dump') app.addTask(DumpExtractor, { 'src': finalBz2File, 'target': finalInstallDir }) def setupXmlImportingWorkflow(app): mwDir = getFinalMediawikiDir(app) xmlFileIn = mwDir + '/' + getArchiveBasename(app.getArg('xml-dump')) xmlFileOut = mwDir + '/cleaned-xml-database.xml' app.addTask(CompileXml2Sql, {}, 'Compiling the xml2sql tool') if os.path.exists(xmlFileOut) == False or app.getArg('force-import') == True: app.addTask(XmlCleaner, { 'src': xmlFileIn, 'target': xmlFileOut }, 'Removing incompatible tags from the XML database') if (os.path.exists(mwDir + '/page.sql') == False or os.path.exists(mwDir + '/revision.sql') == False or os.path.exists(mwDir + '/text.sql') == False or app.getArg('force-import') == True): app.addTask(Xml2Sql, { 'src': xmlFileOut, 'target': mwDir }, 'Converting XML database to SQL statements') app.addTask(SqlImporter, { 'pageSql': mwDir + '/page.sql', 'revisionSql': mwDir + '/revision.sql', 'textSql': mwDir + '/text.sql' }, 'Importing SQL statements to database') def setupTableWorkflow(app): finalInstallDir = getFinalMediawikiDir(app) app.addTask(TableCreator, { 'src': finalInstallDir, 'dbtype': app.getArg('dbtype'), 'dbhost': app.getArg('dbhost'), 'dbport': app.getArg('dbport'), 'dbuser': app.getArg('dbuser'), 'dbpass': app.getArg('dbpass'), 'dbname': app.getArg('dbname') }) def setupTruncateWorkflow(app):
def setupMediawikiWorkflow(app): pkg = os.path.basename(app.getArg('mediawiki-url')) finalInstallDir = getFinalMediawikiDir(app) app.addTask(Downloader, { 'src': app.getArg('mediawiki-url'), 'target': app.getArg('install-dir') }, 'Downloading Mediawiki') app.addTask(Extractor, { 'src': app.getArg('install-dir') + '/' + pkg, 'target': app.getArg('install-dir') }, 'Extracting Mediawiki') app.addTask(MWConfigWriter, { 'target': finalInstallDir, 'dbhost': app.getArg('dbhost'), 'dbport': app.getArg('dbport'), 'dbuser': app.getArg('dbuser'), 'dbpass': app.getArg('dbpass'), 'dbname': app.getArg('dbname') }) def SetupWiki(argv): app = BaseApp('setupwiki', argv, '0.0.1', title='Setup Wiki') for arg in ARGS: app.addArg(arg) if "-h" in argv or "--help" in argv: app.help() return 0 if "-v" in argv or "--version" in argv: app.version() return 0 app.initConfiguration() if (os.path.exists(app.getArg('install-dir')) == False and app.getArg('skip-mw-install') == False) or app.getArg('force-mw-install') == True: setupMediawikiWorkflow(app) if (app.getArg('skip-db') == False or app.getArg('force-db') == True): setupTableWorkflow(app) if (app.getArg('truncate') == True): setupTruncateWorkflow(app) xmlFileZip = getFinalMediawikiDir(app) + '/' + os.path.basename(app.getArg('xml-dump')) xmlFile = getFinalMediawikiDir(app) + '/' + getArchiveBasename(app.getArg('xml-dump')) xmlImport = False if (os.path.exists(xmlFileZip) != True and app.getArg('skip-xml-download') == False) or app.getArg('force-xml-download') == True: setupXmlDownloadWorkflow(app) xmlImport = True if (os.path.exists(xmlFile) == True and app.getArg('skip-import') == False) or app.getArg('force-import') == True or xmlImport == True: setupXmlImportingWorkflow(app) app.run() """ class SetupWiki(object): def run(self): app = BaseApp('setupwiki', sys.argv, '0.0.1', title="Setup Wiki") for arg in ARGS: app.addArg(arg) app.initConfiguration() if app.getArg('truncate'): app.addTask(TableTruncator) return app.run() class SetupWiki(PromptingBaseApp): def __init__(self): super(SetupWiki, self).__init__(DOCSTRING) self.log = logging.getLogger('psiopic.SetupWiki') self.startTime = None self.endTime = None def run(self): self.startTime = datetime.now() args = self.getAargs() ret = 0 mediawikiUrl = self.getValue('Mediaiki URL', 'mediawiki-url', MEDIAWIKI_URL) installDir = self.getValue('Mediawiki installation directory', 'install-dir', ) urlPath = urlparse(self.mediawikiUrl).path downloadTarget = self.installDir + "/" + os.path.basename(urlparse(self.mediawikiUrl).path) if self.clean: self.log.warning("Cleaning previous installation") shutil.rmtree(self.mediawikiDir) self.args['--force-truncate'] = True if (os.path.isfile(downloadTarget) == False and self.args['--skip-download-mw'] != True) or self.args['--force-download-mw'] == True: self.log.info('Downloading Mediawiki software') self.args['--force-extract-mw'] = True Downloader( src=self.mediawikiUrl, target=downloadTarget, colors=self.args['colors'], widgets=self.args['widgets'] ).run() if os.path.isfile(self.mediawikiDir + '/xmldb.xml.bz2') == False: self.log.info('Downloading Wikinews XML dump') Downloader( src=self.xmlDump, target=self.mediawikiDir + '/xmldb.xml.bz2', colors=self.args['colors'], widgets=self.args['widgets'] ).run() if (os.path.isdir(self.mediawikiDir) == False and self.args['--skip-extract-mw'] != True) or self.args['--force-extract-mw'] == True: self.log.info("Extracting Mediawiki software") Extractor( src=downloadTarget, target=self.installDir, colors=self.args['colors'], widgets=self.args['widgets'] ).run() if os.path.isfile(self.mediawikiDir + "/LocalSettings.php") == False: self.log.info("Writing config file") MWConfigWriter( target=self.mediawikiDir, dbhost=self.args.get('--dbhost'), dbname=self.args.get('--dbname'), dbpass=self.args.get('--dbpass'), dbuser=self.args.get('--dbuser'), dbtype=self.args.get('--dbtype') ).run() if self.args['--skip-db'] != True or self.args['--force-db'] == True: self.log.info("Creating database tables") TableCreator( installDir=self.mediawikiDir, dbhost=self.args.get('--dbhost') or self.installDir + "/mw.db", dbport=self.args.get('--dbport'), dbuser=self.args.get('--dbuser'), dbpass=self.args.get('--dbpass'), dbname=self.args.get('--dbname'), dbtype=self.args.get('--dbtype') or 'sqlite' ).run() if self.args['--force-truncate'] == True: self.log.info("Truncating database tables") TableTruncator( dbhost=self.args.get('--dbhost') or self.installDir + "/mw.db", dbport=self.args.get('--dbport'), dbuser=self.args.get('--dbuser'), dbpass=self.args.get('--dbpass'), dbname=self.args.get('--dbname'), dbtype=self.args.get('--dbtype') or 'sqlite' ).run() if os.path.isfile(self.mediawikiDir + '/xmldb.xml') == False: self.log.info('Extracting XML zip') Extractor( src=self.mediawikiDir + '/xmldb.xml.bz2', target=self.mediawikiDir, colors=self.args['colors'], widgets=self.args['widgets'] ).run() self.log.info("Compiling the xml2sql tool") CompileXml2Sql().run() self.log.info("Cleaning XML database of unused tags") XmlCleaner(src=self.mediawikiDir + '/xmldb.xml', target=self.mediawikiDir+'/xmldb-cleaned.xml').run() self.log.info("Running xml2sql against the XML database") Xml2Sql(src=self.mediawikiDir+'/xmldb-cleaned.xml', target=self.mediawikiDir+'/xmldb-processed').run() self.log.info("Importing SQL to database") SqlImporter( pageSql=self.mediawikiDir+'/xmldb-processed/page.sql', textSql=self.mediawikiDir+'/xmldb-processed/text.sql', revisionSql=self.mediawikiDir+'/xmldb-processed/revision.sql', dbhost=self.args.get('--dbhost'), dbport=self.args.get('--dbport'), dbuser=self.args.get('--dbuser'), dbpass=self.args.get('--dbpass'), dbname=self.args.get('--dbname'), dbtype=self.args.get('--dbtype') ).run() # XmlImporter( # xmlFile=mediawikiDir + '/xmldb', # dbhost=self.args.get('--dbhost') or self.installDir + "/mw.db", # dbport=self.args.get('--dbport'), # dbuser=self.args.get('--dbuser'), # dbpass=self.args.get('--dbpass'), # dbname=self.args.get('--dbname'), # dbtype=self.args.get('--dbtype') or 'sqlite' # # ).run() self.endTime = datetime.now() - self.startTime self.log.info('Completed in: %s' % self.endTime) """
app.addTask(TableTruncator, {}, 'Truncating all tables')
common.py
""" This file defines cache, session, and translator T object for the app These are fixtures that every app needs so probably you will not be editing this file """ import copy import os import sys import logging from py4web import Session, Cache, Translator, Flash, DAL, Field, action from py4web.utils.mailer import Mailer from py4web.utils.auth import Auth from py4web.utils.downloader import downloader from py4web.utils.tags import Tags from py4web.utils.factories import ActionFactory from py4web.utils.form import FormStyleBulma from . import settings # ####################################################### # implement custom loggers form settings.LOGGERS # ####################################################### logger = logging.getLogger("py4web:" + settings.APP_NAME) formatter = logging.Formatter( "%(asctime)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s" ) for item in settings.LOGGERS: level, filename = item.split(":", 1) if filename in ("stdout", "stderr"): handler = logging.StreamHandler(getattr(sys, filename)) else: handler = logging.FileHandler(filename) handler.setFormatter(formatter) logger.setLevel(getattr(logging, level.upper(), "DEBUG")) logger.addHandler(handler) # ####################################################### # connect to db # ####################################################### db = DAL( settings.DB_URI, folder=settings.DB_FOLDER, pool_size=settings.DB_POOL_SIZE, migrate=settings.DB_MIGRATE, fake_migrate=settings.DB_FAKE_MIGRATE, ) # ####################################################### # define global objects that may or may not be used by the actions # ####################################################### cache = Cache(size=1000) T = Translator(settings.T_FOLDER) flash = Flash() # ####################################################### # pick the session type that suits you best # ####################################################### if settings.SESSION_TYPE == "cookies": session = Session(secret=settings.SESSION_SECRET_KEY) elif settings.SESSION_TYPE == "redis": import redis host, port = settings.REDIS_SERVER.split(":") # for more options: https://github.com/andymccurdy/redis-py/blob/master/redis/client.py conn = redis.Redis(host=host, port=int(port)) conn.set = ( lambda k, v, e, cs=conn.set, ct=conn.ttl: cs(k, v, ct(k)) if ct(k) >= 0 else cs(k, v, e) ) session = Session(secret=settings.SESSION_SECRET_KEY, storage=conn) elif settings.SESSION_TYPE == "memcache": import memcache, time conn = memcache.Client(settings.MEMCACHE_CLIENTS, debug=0) session = Session(secret=settings.SESSION_SECRET_KEY, storage=conn) elif settings.SESSION_TYPE == "database": from py4web.utils.dbstore import DBStore session = Session(secret=settings.SESSION_SECRET_KEY, storage=DBStore(db)) # ####################################################### # Instantiate the object and actions that handle auth # ####################################################### auth = Auth(session, db, define_tables=False) # Fixes the messages. auth_messages = copy.deepcopy(auth.MESSAGES) auth_messages['buttons']['sign-in'] = "Log in" auth_messages['buttons']['sign-up'] = "Sign up" auth_messages['buttons']['lost-password'] = "Lost password" # And button classes. auth_button_classes = { "lost-password": "button is-danger is-light", "register": "button is-info is-light", "request": "button is-primary", "sign-in": "button is-primary", "sign-up": "button is-success", "submit": "button is-primary", } auth.use_username = False auth.param.button_classes = auth_button_classes auth.param.registration_requires_confirmation = False auth.param.registration_requires_approval = False auth.param.allowed_actions = settings.ALLOWED_ACTIONS auth.param.login_expiration_time = 3600 # FIXME: Readd for production. auth.param.password_complexity = {"entropy": 2} auth.param.block_previous_password_num = 3 auth.param.formstyle = FormStyleBulma auth.define_tables() # ####################################################### # Configure email sender for auth # ####################################################### if settings.SMTP_SERVER: auth.sender = Mailer( server=settings.SMTP_SERVER, sender=settings.SMTP_SENDER, login=settings.SMTP_LOGIN, tls=settings.SMTP_TLS, ssl=settings.SMTP_SSL, ) # ####################################################### # Create a table to tag users as group members # ####################################################### if auth.db: groups = Tags(db.auth_user, "groups") # ####################################################### # Enable optional auth plugin # ####################################################### if settings.USE_PAM: from py4web.utils.auth_plugins.pam_plugin import PamPlugin auth.register_plugin(PamPlugin()) if settings.USE_LDAP: from py4web.utils.auth_plugins.ldap_plugin import LDAPPlugin auth.register_plugin(LDAPPlugin(db=db, groups=groups, **settings.LDAP_SETTINGS)) if settings.OAUTH2GOOGLE_CLIENT_ID: from py4web.utils.auth_plugins.oauth2google import OAuth2Google # TESTED auth.register_plugin( OAuth2Google( client_id=settings.OAUTH2GOOGLE_CLIENT_ID, client_secret=settings.OAUTH2GOOGLE_CLIENT_SECRET, callback_url="auth/plugin/oauth2google/callback", ) ) if settings.OAUTH2FACEBOOK_CLIENT_ID: from py4web.utils.auth_plugins.oauth2facebook import OAuth2Facebook # UNTESTED auth.register_plugin( OAuth2Facebook( client_id=settings.OAUTH2FACEBOOK_CLIENT_ID, client_secret=settings.OAUTH2FACEBOOK_CLIENT_SECRET, callback_url="auth/plugin/oauth2facebook/callback", ) ) if settings.OAUTH2OKTA_CLIENT_ID: from py4web.utils.auth_plugins.oauth2okta import OAuth2Okta # TESTED auth.register_plugin( OAuth2Okta( client_id=settings.OAUTH2OKTA_CLIENT_ID, client_secret=settings.OAUTH2OKTA_CLIENT_SECRET, callback_url="auth/plugin/oauth2okta/callback", ) ) # ####################################################### # Define a convenience action to allow users to download # files uploaded and reference by Field(type='upload') # ####################################################### if settings.UPLOAD_FOLDER: @action('download/<filename>') @action.uses(db) def
(filename): return downloader(db, settings.UPLOAD_FOLDER, filename) # To take advantage of this in Form(s) # for every field of type upload you MUST specify: # # field.upload_path = settings.UPLOAD_FOLDER # field.download_url = lambda filename: URL('download/%s' % filename) # ####################################################### # Optionally configure celery # ####################################################### if settings.USE_CELERY: from celery import Celery # to use "from .common import scheduler" and then use it according # to celery docs, examples in tasks.py scheduler = Celery( "apps.%s.tasks" % settings.APP_NAME, broker=settings.CELERY_BROKER ) # ####################################################### # Enable authentication # ####################################################### auth.enable(uses=(session, T, db), env=dict(T=T)) # ####################################################### # Define convenience decorators # ####################################################### unauthenticated = ActionFactory(db, session, T, flash, auth) authenticated = ActionFactory(db, session, T, flash, auth.user)
download
pcloud_v2_volumesclone_post_parameters.go
// Code generated by go-swagger; DO NOT EDIT. package p_cloud_volumes // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" "github.com/IBM-Cloud/power-go-client/power/models" ) // NewPcloudV2VolumesclonePostParams creates a new PcloudV2VolumesclonePostParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPcloudV2VolumesclonePostParams() *PcloudV2VolumesclonePostParams
// NewPcloudV2VolumesclonePostParamsWithTimeout creates a new PcloudV2VolumesclonePostParams object // with the ability to set a timeout on a request. func NewPcloudV2VolumesclonePostParamsWithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { return &PcloudV2VolumesclonePostParams{ timeout: timeout, } } // NewPcloudV2VolumesclonePostParamsWithContext creates a new PcloudV2VolumesclonePostParams object // with the ability to set a context for a request. func NewPcloudV2VolumesclonePostParamsWithContext(ctx context.Context) *PcloudV2VolumesclonePostParams { return &PcloudV2VolumesclonePostParams{ Context: ctx, } } // NewPcloudV2VolumesclonePostParamsWithHTTPClient creates a new PcloudV2VolumesclonePostParams object // with the ability to set a custom HTTPClient for a request. func NewPcloudV2VolumesclonePostParamsWithHTTPClient(client *http.Client) *PcloudV2VolumesclonePostParams { return &PcloudV2VolumesclonePostParams{ HTTPClient: client, } } /* PcloudV2VolumesclonePostParams contains all the parameters to send to the API endpoint for the pcloud v2 volumesclone post operation. Typically these are written to a http.Request. */ type PcloudV2VolumesclonePostParams struct { /* Body. Parameters for preparing a set of volumes to be cloned */ Body *models.VolumesCloneCreate /* CloudInstanceID. Cloud Instance ID of a PCloud Instance */ CloudInstanceID string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). // // All values with no default are reset to their zero value. func (o *PcloudV2VolumesclonePostParams) WithDefaults() *PcloudV2VolumesclonePostParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the pcloud v2 volumesclone post params (not the query body). // // All values with no default are reset to their zero value. func (o *PcloudV2VolumesclonePostParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithTimeout(timeout time.Duration) *PcloudV2VolumesclonePostParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithContext(ctx context.Context) *PcloudV2VolumesclonePostParams { o.SetContext(ctx) return o } // SetContext adds the context to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithHTTPClient(client *http.Client) *PcloudV2VolumesclonePostParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithBody adds the body to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithBody(body *models.VolumesCloneCreate) *PcloudV2VolumesclonePostParams { o.SetBody(body) return o } // SetBody adds the body to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) SetBody(body *models.VolumesCloneCreate) { o.Body = body } // WithCloudInstanceID adds the cloudInstanceID to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudV2VolumesclonePostParams { o.SetCloudInstanceID(cloudInstanceID) return o } // SetCloudInstanceID adds the cloudInstanceId to the pcloud v2 volumesclone post params func (o *PcloudV2VolumesclonePostParams) SetCloudInstanceID(cloudInstanceID string) { o.CloudInstanceID = cloudInstanceID } // WriteToRequest writes these params to a swagger request func (o *PcloudV2VolumesclonePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err } } // path param cloud_instance_id if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { return err } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
{ return &PcloudV2VolumesclonePostParams{ timeout: cr.DefaultTimeout, } }
UIPartScrollBar.py
""" mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original game "minecraft" by Mojang Studios (www.minecraft.net), licenced under the EULA (https://account.mojang.com/documents/minecraft_eula) Mod loader inspired by "Minecraft Forge" (https://github.com/MinecraftForge/MinecraftForge) and similar This project is not official by mojang and does not relate to it. """ import asyncio import mcpython.engine.ResourceLoader import mcpython.util.texture import PIL.Image import pyglet from mcpython.engine.rendering.RenderingLayerManager import MIDDLE_GROUND from mcpython.util.annotation import onlyInClient from pyglet.window import mouse from .AbstractUIPart import AbstractUIPart IMAGE = asyncio.get_event_loop().run_until_complete( mcpython.engine.ResourceLoader.read_image( "assets/minecraft/textures/gui/container/creative_inventory/tabs.png" ) ) scroll_active = mcpython.util.texture.to_pyglet_image( IMAGE.crop((233, 0, 243, 14)).resize((20, 28), PIL.Image.NEAREST) ) scroll_inactive = mcpython.util.texture.to_pyglet_image( IMAGE.crop((244, 0, 255, 14)).resize((20, 28), PIL.Image.NEAREST) ) class
(AbstractUIPart): """ Class representing a scroll bar in a gui-state of the game The user is needed to work with the values returned by this system (on_scroll) """ def __init__(self, position: tuple, scroll_distance: int, on_scroll=None): super().__init__(position, (0, 0)) self.selected = False self.bar_position = position self.bar_sprite = pyglet.sprite.Sprite(scroll_active) self.scroll_distance = scroll_distance self.on_scroll = on_scroll self.active = True def move(self, delta: int): x, y = self.bar_position self.bar_position = x, max( self.position[1], min(self.position[1] + self.scroll_distance, y + delta) ) if self.on_scroll: self.on_scroll(0, 0, 0, delta, 0, 0, self.get_status()) def bind_to_eventbus(self): self.master[0].eventbus.subscribe("user:mouse:press", self.on_mouse_press) self.master[0].eventbus.subscribe("user:mouse:release", self.on_mouse_release) self.master[0].eventbus.subscribe("user:mouse:drag", self.on_mouse_drag) self.master[0].eventbus.subscribe( MIDDLE_GROUND.getRenderingEvent(), self.on_draw ) def on_mouse_press(self, x, y, button, mod): if not self.active: return if button != mouse.LEFT: return bx, by = self.bar_position if 0 <= x - bx <= 20 and 0 <= y - by <= 28: self.selected = True def on_mouse_release(self, x, y, button, mod): self.selected = False def on_mouse_drag(self, x, y, dx, dy, button, mod): if not self.active: return if button == mouse.LEFT and self.selected: self.bar_position = ( self.position[0], max(self.position[1], min(self.position[1] + self.scroll_distance, y)), ) if self.on_scroll: self.on_scroll(x, y, dx, dy, button, mod, self.get_status()) def on_draw(self): if not self.active: return if self.bar_sprite.position != self.bar_position: self.bar_sprite.position = self.bar_position self.bar_sprite.draw() def get_status(self) -> float: """ Will return the status as an float between 0 and 1 where 0 is the downer end and 1 the upper """ if not self.active: return 0 return (self.bar_position[1] - self.position[1]) / self.scroll_distance def set_status(self, status: float): self.bar_position = ( self.bar_position[0], self.position[1] + status * self.scroll_distance, ) def set_size_respective(self, position: tuple, scroll_distance: int): if not self.active: return status = self.get_status() self.position = position self.bar_position = ( self.position[0], self.position[1] + status * scroll_distance, ) self.scroll_distance = scroll_distance
UIScrollBar
StopwatchThin.tsx
import * as React from "react"; import Svg, { Path } from "react-native-svg"; type Props = { size?: number | string; color?: string; }; function
({ size = 16, color = "currentColor", }: Props): JSX.Element { return ( <Svg width={size} height={size} viewBox="0 0 24 24" fill="none"> <Path d="M12 21.36c4.296 0 7.8-3.504 7.8-7.8a7.808 7.808 0 00-2.112-5.328l1.44-1.464-.336-.336-1.464 1.44A7.88 7.88 0 0012.24 5.76V3.12h2.04v-.48H9.72v.48h2.04v2.64c-4.176.12-7.56 3.576-7.56 7.8 0 4.296 3.504 7.8 7.8 7.8zm-7.32-7.8c0-4.032 3.288-7.32 7.32-7.32s7.32 3.288 7.32 7.32-3.288 7.32-7.32 7.32-7.32-3.288-7.32-7.32zm7.08.48c0 .144.096.24.24.24s.24-.096.24-.24V8.16h-.48v5.88z" fill={color} /> </Svg> ); } export default StopwatchThin;
StopwatchThin
any_test.go
package read_test import ( "context" "strings" "testing" "github.com/modern-go/parse" "github.com/modern-go/parse/read" "github.com/modern-go/test" "github.com/modern-go/test/must" ) func TestUntil1(t *testing.T) { t.Run("not found", test.Case(func(ctx context.Context) { src := must.Call(parse.NewSource, strings.NewReader("abcd"), 2)[0].(*parse.Source) must.Equal([]byte{'a', 'b', 'c', 'd'}, read.Until1( src, 'g')) must.NotNil(src.FatalError()) })) t.Run("found", test.Case(func(ctx context.Context) { src := must.Call(parse.NewSource, strings.NewReader("abcd"), 2)[0].(*parse.Source) must.Equal([]byte{'a', 'b', 'c'}, read.Until1( src, 'd')) must.Nil(src.FatalError()) })) } func
(t *testing.T) { t.Run("except one", test.Case(func(ctx context.Context) { src, _ := parse.NewSourceString("hello world 1234 bbb") data := read.AnyExcept1(src, ' ') must.Equal("helloworld1234bbb", string(data)) })) t.Run("except multi", test.Case(func(ctx context.Context) { src, _ := parse.NewSourceString("hello world 1234 bbb") data := read.AnyExcepts(src, []byte{' ', 'o', 'b'}) must.Equal("hellwrld1234", string(data)) })) }
TestExcept
chapter1.py
from manimlib.imports import * from old_projects.eola.chapter0 import UpcomingSeriesOfVidoes import random def plane_wave_homotopy(x, y, z, t): norm = get_norm([x, y]) tau = interpolate(5, -5, t) + norm/FRAME_X_RADIUS alpha = sigmoid(tau) return [x, y + 0.5*np.sin(2*np.pi*alpha)-t*SMALL_BUFF/2, z] class Physicist(PiCreature): CONFIG = { "color": PINK, } class ComputerScientist(PiCreature): CONFIG = { "color": PURPLE_E, "flip_at_start": True, } class OpeningQuote(Scene): def construct(self): words = TextMobject( "``The introduction of numbers as \\\\ coordinates is an act of violence.''", ) words.to_edge(UP) for mob in words.submobjects[27:27+11]: mob.set_color(GREEN) author = TextMobject("-Hermann Weyl") author.set_color(YELLOW) author.next_to(words, DOWN, buff=0.5) self.play(FadeIn(words)) self.wait(1) self.play(Write(author, run_time=4)) self.wait() class DifferentConceptions(Scene): def construct(self): physy = Physicist() mathy = Mathematician(mode="pondering") compy = ComputerScientist() creatures = [physy, compy, mathy] physy.title = TextMobject("Physics student").to_corner(DOWN+LEFT) compy.title = TextMobject("CS student").to_corner(DOWN+RIGHT) mathy.title = TextMobject("Mathematician").to_edge(DOWN) names = VMobject(physy.title, mathy.title, compy.title) names.arrange(RIGHT, buff=1) names.to_corner(DOWN+LEFT) for pi in creatures: pi.next_to(pi.title, UP) vector, symbol, coordinates = self.intro_vector() for pi in creatures: self.play( Write(pi.title), FadeIn(pi), run_time=1 ) self.wait(2) self.remove(symbol, coordinates) self.physics_conception(creatures, vector) self.cs_conception(creatures) self.handle_mathy(creatures) def intro_vector(self): plane = NumberPlane() labels = VMobject(*plane.get_coordinate_labels()) vector = Vector(RIGHT+2*UP, color=YELLOW) coordinates = vector_coordinate_label(vector) symbol = TexMobject("\\vec{\\textbf{v}}") symbol.shift(0.5*(RIGHT+UP)) self.play(ShowCreation( plane, lag_ratio=1, run_time=3 )) self.play(ShowCreation( vector, )) self.play( Write(labels), Write(coordinates), Write(symbol) ) self.wait(2) self.play( FadeOut(plane), FadeOut(labels), ApplyMethod(vector.shift, 4*LEFT+UP), ApplyMethod(coordinates.shift, 2.5*RIGHT+0.5*DOWN), ApplyMethod(symbol.shift, 0.5*(UP+LEFT)) ) self.remove(plane, labels) return vector, symbol, coordinates def physics_conception(self, creatures, original_vector): self.fade_all_but(creatures, 0) physy, compy, mathy = creatures vector = Vector(2*RIGHT) vector.next_to(physy, UP+RIGHT) brace = Brace(vector, DOWN) length = TextMobject("Length") length.next_to(brace, DOWN) group = VMobject(vector, brace, length) group.rotate_in_place(np.pi/6) vector.get_center = lambda: vector.get_start() direction = TextMobject("Direction") direction.next_to(vector, RIGHT) direction.shift(UP) two_dimensional = TextMobject("Two-dimensional") three_dimensional = TextMobject("Three-dimensional") two_dimensional.to_corner(UP+RIGHT) three_dimensional.to_corner(UP+RIGHT) random_vectors = VMobject(*[ Vector( random.uniform(-2, 2)*RIGHT + random.uniform(-2, 2)*UP ).shift( random.uniform(0, 4)*RIGHT + random.uniform(-1, 2)*UP ).set_color(random_color()) for x in range(5) ]) self.play( Transform(original_vector, vector), ApplyMethod(physy.change_mode, "speaking") ) self.remove(original_vector) self.add(vector) self.wait() self.play( GrowFromCenter(brace), Write(length), run_time=1 ) self.wait() self.remove(brace, length) self.play( Rotate(vector, np.pi/3, in_place=True), Write(direction), run_time=1 ) for angle in -2*np.pi/3, np.pi/3: self.play(Rotate( vector, angle, in_place=True, run_time=1 )) self.play(ApplyMethod(physy.change_mode, "plain")) self.remove(direction) for point in 2*UP, 4*RIGHT, ORIGIN: self.play(ApplyMethod(vector.move_to, point)) self.wait() self.play( Write(two_dimensional), ApplyMethod(physy.change_mode, "pondering"), ShowCreation(random_vectors, lag_ratio=0.5), run_time=1 ) self.wait(2) self.remove(random_vectors, vector) self.play(Transform(two_dimensional, three_dimensional)) self.wait(5) self.remove(two_dimensional) self.restore_creatures(creatures) def cs_conception(self, creatures): self.fade_all_but(creatures, 1) physy, compy, mathy = creatures title = TextMobject("Vectors $\\Leftrightarrow$ lists of numbers") title.to_edge(UP) vectors = VMobject(*list(map(matrix_to_mobject, [ [2, 1], [5, 0, 0, -3], [2.3, -7.1, 0.1], ]))) vectors.arrange(RIGHT, buff=1) vectors.to_edge(LEFT) self.play( ApplyMethod(compy.change_mode, "sassy"), Write(title, run_time=1) ) self.play(Write(vectors)) self.wait() self.play(ApplyMethod(compy.change_mode, "pondering")) self.house_example(vectors, title) self.restore_creatures(creatures) def house_example(self, starter_mobject, title): house = SVGMobject("house") house.set_stroke(width=0) house.set_fill(BLUE_C, opacity=1) house.set_height(3) house.center() square_footage_words = TextMobject("Square footage:") price_words = TextMobject("Price: ") square_footage = TexMobject("2{,}600\\text{ ft}^2") price = TextMobject("\\$300{,}000") house.to_edge(LEFT).shift(UP) square_footage_words.next_to(house, RIGHT) square_footage_words.shift(0.5*UP) square_footage_words.set_color(RED) price_words.next_to(square_footage_words, DOWN, aligned_edge=LEFT) price_words.set_color(GREEN) square_footage.next_to(square_footage_words) square_footage.set_color(RED) price.next_to(price_words) price.set_color(GREEN) vector = Matrix([square_footage.copy(), price.copy()]) vector.next_to(house, RIGHT).shift(0.25*UP) new_square_footage, new_price = vector.get_mob_matrix().flatten() not_equals = TexMobject("\\ne") not_equals.next_to(vector) alt_vector = Matrix([ TextMobject("300{,}000\\text{ ft}^2").set_color(RED), TextMobject("\\$2{,}600").set_color(GREEN) ]) alt_vector.next_to(not_equals) brace = Brace(vector, RIGHT) two_dimensional = TextMobject("2 dimensional") two_dimensional.next_to(brace) brackets = vector.get_brackets() self.play(Transform(starter_mobject, house)) self.remove(starter_mobject) self.add(house) self.add(square_footage_words) self.play(Write(square_footage, run_time=2)) self.add(price_words) self.play(Write(price, run_time=2)) self.wait() self.play( FadeOut(square_footage_words), FadeOut(price_words), Transform(square_footage, new_square_footage), Transform(price, new_price), Write(brackets), run_time=1 ) self.remove(square_footage_words, price_words) self.wait() self.play( Write(not_equals), Write(alt_vector), run_time=1 ) self.wait() self.play(FadeOut(not_equals), FadeOut(alt_vector)) self.remove(not_equals, alt_vector) self.wait() self.play( GrowFromCenter(brace), Write(two_dimensional), run_time=1 ) self.wait() everything = VMobject( house, square_footage, price, brackets, brace, two_dimensional, title ) self.play(ApplyMethod(everything.shift, FRAME_WIDTH*LEFT)) self.remove(everything) def handle_mathy(self, creatures): self.fade_all_but(creatures, 2) physy, compy, mathy = creatures v_color = YELLOW w_color = BLUE sum_color = GREEN v_arrow = Vector([1, 1]) w_arrow = Vector([2, 1]) w_arrow.shift(v_arrow.get_end()) sum_arrow = Vector(w_arrow.get_end()) arrows = VMobject(v_arrow, w_arrow, sum_arrow) arrows.scale(0.7) arrows.to_edge(LEFT, buff=2) v_array = matrix_to_mobject([3, -5]) w_array = matrix_to_mobject([2, 1]) sum_array = matrix_to_mobject(["3+2", "-5+1"]) arrays = VMobject( v_array, TexMobject("+"), w_array, TexMobject("="), sum_array ) arrays.arrange(RIGHT) arrays.scale(0.75) arrays.to_edge(RIGHT).shift(UP) v_sym = TexMobject("\\vec{\\textbf{v}}") w_sym = TexMobject("\\vec{\\textbf{w}}") syms = VMobject(v_sym, TexMobject("+"), w_sym) syms.arrange(RIGHT) syms.center().shift(2*UP) statement = TextMobject("We'll ignore him \\\\ for now") statement.set_color(PINK) statement.set_width(arrays.get_width()) statement.next_to(arrays, DOWN, buff=1.5) circle = Circle() circle.shift(syms.get_bottom()) VMobject(v_arrow, v_array, v_sym).set_color(v_color) VMobject(w_arrow, w_array, w_sym).set_color(w_color) VMobject(sum_arrow, sum_array).set_color(sum_color) self.play( Write(syms), Write(arrays), ShowCreation(arrows), ApplyMethod(mathy.change_mode, "pondering"), run_time=2 ) self.play(Blink(mathy)) self.add_scaling(arrows, syms, arrays) self.play(Write(statement)) self.play(ApplyMethod(mathy.change_mode, "sad")) self.wait() self.play( ShowCreation(circle), ApplyMethod(mathy.change_mode, "plain") ) self.wait() def add_scaling(self, arrows, syms, arrays): s_arrows = VMobject( TexMobject("2"), Vector([1, 1]).set_color(YELLOW), TexMobject("="), Vector([2, 2]).set_color(WHITE) ) s_arrows.arrange(RIGHT) s_arrows.scale(0.75) s_arrows.next_to(arrows, DOWN) s_arrays = VMobject( TexMobject("2"), matrix_to_mobject([3, -5]).set_color(YELLOW), TextMobject("="), matrix_to_mobject(["2(3)", "2(-5)"]) ) s_arrays.arrange(RIGHT) s_arrays.scale(0.75) s_arrays.next_to(arrays, DOWN) s_syms = TexMobject(["2", "\\vec{\\textbf{v}}"]) s_syms.split()[-1].set_color(YELLOW) s_syms.next_to(syms, DOWN) self.play( Write(s_arrows), Write(s_arrays), Write(s_syms),
) self.wait() def fade_all_but(self, creatures, index): self.play(*[ FadeOut(VMobject(pi, pi.title)) for pi in creatures[:index] + creatures[index+1:] ]) def restore_creatures(self, creatures): self.play(*[ ApplyFunction(lambda m: m.change_mode( "plain").set_color(m.color), pi) for pi in creatures ] + [ ApplyMethod(pi.title.set_fill, WHITE, 1.0) for pi in creatures ]) class ThreeDVectorField(Scene): pass class HelpsToHaveOneThought(Scene): def construct(self): morty = Mortimer() morty.to_corner(DOWN+RIGHT) morty.look(DOWN+LEFT) new_morty = morty.copy().change_mode("speaking") new_morty.look(DOWN+LEFT) randys = VMobject(*[ Randolph(color=color).scale(0.8) for color in (BLUE_D, BLUE_C, BLUE_E) ]) randys.arrange(RIGHT) randys.to_corner(DOWN+LEFT) randy = randys.split()[1] speech_bubble = morty.get_bubble(SpeechBubble) words = TextMobject("Think of some vector...") speech_bubble.position_mobject_inside(words) thought_bubble = randy.get_bubble() arrow = Vector([2, 1]).scale(0.7) or_word = TextMobject("or") array = Matrix([2, 1]).scale(0.5) q_mark = TextMobject("?") thought = VMobject(arrow, or_word, array, q_mark) thought.arrange(RIGHT, buff=0.2) thought_bubble.position_mobject_inside(thought) thought_bubble.set_fill(BLACK, opacity=1) self.add(morty, randys) self.play( ShowCreation(speech_bubble), Transform(morty, new_morty), Write(words) ) self.wait(2) self.play( FadeOut(speech_bubble), FadeOut(words), ApplyMethod(randy.change_mode, "pondering"), ShowCreation(thought_bubble), Write(thought) ) self.wait(2) class HowIWantYouToThinkAboutVectors(Scene): def construct(self): vector = Vector([-2, 3]) plane = NumberPlane() axis_labels = plane.get_axis_labels() other_vectors = VMobject(*list(map(Vector, [ [1, 2], [2, -1], [4, 0] ]))) colors = [GREEN_B, MAROON_B, PINK] for v, color in zip(other_vectors.split(), colors): v.set_color(color) shift_val = 4*RIGHT+DOWN dot = Dot(radius=0.1) dot.set_color(RED) tail_word = TextMobject("Tail") tail_word.shift(0.5*DOWN+2.5*LEFT) line = Line(tail_word, dot) self.play(ShowCreation(vector)) self.wait(2) self.play( ShowCreation(plane, lag_ratio=0.5), Animation(vector) ) self.play(Write(axis_labels, run_time=1)) self.wait() self.play( GrowFromCenter(dot), ShowCreation(line), Write(tail_word, run_time=1) ) self.wait() self.play( FadeOut(tail_word), ApplyMethod(VMobject(dot, line).scale, 0.01) ) self.remove(tail_word, line, dot) self.wait() self.play(ApplyMethod( vector.shift, shift_val, path_arc=3*np.pi/2, run_time=3 )) self.play(ApplyMethod( vector.shift, -shift_val, rate_func=rush_into, run_time=0.5 )) self.wait(3) self.play(ShowCreation( other_vectors, run_time=3 )) self.wait(3) x_axis, y_axis = plane.get_axes().split() x_label = axis_labels.split()[0] x_axis = x_axis.copy() x_label = x_label.copy() everything = VMobject(*self.mobjects) self.play( FadeOut(everything), Animation(x_axis), Animation(x_label) ) class ListsOfNumbersAddOn(Scene): def construct(self): arrays = VMobject(*list(map(matrix_to_mobject, [ [-2, 3], [1, 2], [2, -1], [4, 0] ]))) arrays.arrange(buff=0.4) arrays.scale(2) self.play(Write(arrays)) self.wait(2) class CoordinateSystemWalkthrough(VectorScene): def construct(self): self.introduce_coordinate_plane() self.show_vector_coordinates() self.coords_to_vector([3, -1]) self.vector_to_coords([-2, -1.5], integer_labels=False) def introduce_coordinate_plane(self): plane = NumberPlane() x_axis, y_axis = plane.get_axes().copy().split() x_label, y_label = plane.get_axis_labels().split() number_line = NumberLine(tick_frequency=1) x_tick_marks = number_line.get_tick_marks() y_tick_marks = x_tick_marks.copy().rotate(np.pi/2) tick_marks = VMobject(x_tick_marks, y_tick_marks) tick_marks.set_color(WHITE) plane_lines = [m for m in plane.get_family() if isinstance(m, Line)] origin_words = TextMobject("Origin") origin_words.shift(2*UP+2*LEFT) dot = Dot(radius=0.1).set_color(RED) line = Line(origin_words.get_bottom(), dot.get_corner(UP+LEFT)) unit_brace = Brace(Line(RIGHT, 2*RIGHT)) one = TexMobject("1").next_to(unit_brace, DOWN) self.add(x_axis, x_label) self.wait() self.play(ShowCreation(y_axis)) self.play(Write(y_label, run_time=1)) self.wait(2) self.play( Write(origin_words), GrowFromCenter(dot), ShowCreation(line), run_time=1 ) self.wait(2) self.play( FadeOut(VMobject(origin_words, dot, line)) ) self.remove(origin_words, dot, line) self.wait() self.play( ShowCreation(tick_marks) ) self.play( GrowFromCenter(unit_brace), Write(one, run_time=1) ) self.wait(2) self.remove(unit_brace, one) self.play( *list(map(GrowFromCenter, plane_lines)) + [ Animation(x_axis), Animation(y_axis) ]) self.wait() self.play( FadeOut(plane), Animation(VMobject(x_axis, y_axis, tick_marks)) ) self.remove(plane) self.add(tick_marks) def show_vector_coordinates(self): starting_mobjects = list(self.mobjects) vector = Vector([-2, 3]) x_line = Line(ORIGIN, -2*RIGHT) y_line = Line(-2*RIGHT, -2*RIGHT+3*UP) x_line.set_color(X_COLOR) y_line.set_color(Y_COLOR) array = vector_coordinate_label(vector) x_label, y_label = array.get_mob_matrix().flatten() x_label_copy = x_label.copy() x_label_copy.set_color(X_COLOR) y_label_copy = y_label.copy() y_label_copy.set_color(Y_COLOR) point = Dot(4*LEFT+2*UP) point_word = TextMobject("(-4, 2) as \\\\ a point") point_word.scale(0.7) point_word.next_to(point, DOWN) point.add(point_word) self.play(ShowCreation(vector)) self.play(Write(array)) self.wait(2) self.play(ApplyMethod(x_label_copy.next_to, x_line, DOWN)) self.play(ShowCreation(x_line)) self.wait(2) self.play(ApplyMethod(y_label_copy.next_to, y_line, LEFT)) self.play(ShowCreation(y_line)) self.wait(2) self.play(FadeIn(point)) self.wait() self.play(ApplyFunction( lambda m: m.scale_in_place(1.25).set_color(YELLOW), array.get_brackets(), rate_func=there_and_back )) self.wait() self.play(FadeOut(point)) self.remove(point) self.wait() self.clear() self.add(*starting_mobjects) class LabeledThreeDVector(Scene): pass class WriteZ(Scene): def construct(self): z = TexMobject("z").set_color(Z_COLOR) z.set_height(4) self.play(Write(z, run_time=2)) self.wait(3) class Write3DVector(Scene): def construct(self): array = Matrix([2, 1, 3]).scale(2) x, y, z = array.get_mob_matrix().flatten() brackets = array.get_brackets() x.set_color(X_COLOR) y.set_color(Y_COLOR) z.set_color(Z_COLOR) self.add(brackets) for mob in x, y, z: self.play(Write(mob), run_time=2) self.wait() class VectorAddition(VectorScene): def construct(self): self.add_plane() vects = self.define_addition() # vects = map(Vector, [[1, 2], [3, -1], [4, 1]]) self.ask_why(*vects) self.answer_why(*vects) def define_addition(self): v1 = self.add_vector([1, 2]) v2 = self.add_vector([3, -1], color=MAROON_B) l1 = self.label_vector(v1, "v") l2 = self.label_vector(v2, "w") self.wait() self.play(ApplyMethod(v2.shift, v1.get_end())) self.wait() v_sum = self.add_vector(v2.get_end(), color=PINK) sum_tex = "\\vec{\\textbf{v}} + \\vec{\\textbf{w}}" self.label_vector(v_sum, sum_tex, rotate=True) self.wait(3) return v1, v2, v_sum def ask_why(self, v1, v2, v_sum): why = TextMobject("Why?") why_not_this = TextMobject("Why not \\\\ this?") new_v2 = v2.copy().shift(-v2.get_start()) new_v_sum = v_sum.copy() alt_vect_sum = new_v2.get_end() - v1.get_end() new_v_sum.shift(-new_v_sum.get_start()) new_v_sum.rotate( angle_of_vector(alt_vect_sum) - new_v_sum.get_angle() ) new_v_sum.scale(get_norm(alt_vect_sum)/new_v_sum.get_length()) new_v_sum.shift(v1.get_end()) new_v_sum.submobjects.reverse() # No idea why I have to do this original_v_sum = v_sum.copy() why.next_to(v2, RIGHT) why_not_this.next_to(new_v_sum, RIGHT) why_not_this.shift(0.5*UP) self.play(Write(why, run_time=1)) self.wait(2) self.play( Transform(v2, new_v2), Transform(v_sum, new_v_sum), Transform(why, why_not_this) ) self.wait(2) self.play( FadeOut(why), Transform(v_sum, original_v_sum) ) self.remove(why) self.wait() def answer_why(self, v1, v2, v_sum): randy = Randolph(color=PINK) randy.shift(-randy.get_bottom()) self.remove(v1, v2, v_sum) for v in v1, v2, v_sum: self.add(v) self.show_ghost_movement(v) self.remove(v) self.add(v1, v2) self.wait() self.play(ApplyMethod(randy.scale, 0.3)) self.play(ApplyMethod(randy.shift, v1.get_end())) self.wait() self.play(ApplyMethod(v2.shift, v1.get_end())) self.play(ApplyMethod(randy.move_to, v2.get_end())) self.wait() self.remove(randy) randy.move_to(ORIGIN) self.play(FadeIn(v_sum)) self.play(ApplyMethod(randy.shift, v_sum.get_end())) self.wait() class AddingNumbersOnNumberLine(Scene): def construct(self): number_line = NumberLine() number_line.add_numbers() two_vect = Vector([2, 0]) five_vect = Vector([5, 0], color=MAROON_B) seven_vect = Vector([7, 0], color=PINK) five_vect.shift(two_vect.get_end()) seven_vect.shift(0.5*DOWN) vects = [two_vect, five_vect, seven_vect] two, five, seven = list(map(TexMobject, ["2", "5", "7"])) two.next_to(two_vect, UP) five.next_to(five_vect, UP) seven.next_to(seven_vect, DOWN) nums = [two, five, seven] sum_mob = TexMobject("2 + 5").shift(3*UP) self.play(ShowCreation(number_line)) self.wait() self.play(Write(sum_mob, run_time=2)) self.wait() for vect, num in zip(vects, nums): self.play( ShowCreation(vect), Write(num, run_time=1) ) self.wait() class VectorAdditionNumerically(VectorScene): def construct(self): plus = TexMobject("+") equals = TexMobject("=") randy = Randolph() randy.set_height(1) randy.shift(-randy.get_bottom()) axes = self.add_axes() x_axis, y_axis = axes.split() v1 = self.add_vector([1, 2]) coords1, x_line1, y_line1 = self.vector_to_coords(v1, clean_up=False) self.play(ApplyFunction( lambda m: m.next_to(y_axis, RIGHT).to_edge(UP), coords1 )) plus.next_to(coords1, RIGHT) v2 = self.add_vector([3, -1], color=MAROON_B) coords2, x_line2, y_line2 = self.vector_to_coords(v2, clean_up=False) self.wait() self.play( ApplyMethod(coords2.next_to, plus, RIGHT), Write(plus, run_time=1), *[ ApplyMethod(mob.shift, v1.get_end()) for mob in (v2, x_line2, y_line2) ] ) equals.next_to(coords2, RIGHT) self.wait() self.play(FadeIn(randy)) for step in [RIGHT, 2*UP, 3*RIGHT, DOWN]: self.play(ApplyMethod(randy.shift, step, run_time=1.5)) self.wait() self.play(ApplyMethod(randy.shift, -randy.get_bottom())) self.play(ApplyMethod(x_line2.shift, 2*DOWN)) self.play(ApplyMethod(y_line1.shift, 3*RIGHT)) for step in [4*RIGHT, 2*UP, DOWN]: self.play(ApplyMethod(randy.shift, step)) self.play(FadeOut(randy)) self.remove(randy) one_brace = Brace(x_line1) three_brace = Brace(x_line2) one = TexMobject("1").next_to(one_brace, DOWN) three = TexMobject("3").next_to(three_brace, DOWN) self.play( GrowFromCenter(one_brace), GrowFromCenter(three_brace), Write(one), Write(three), run_time=1 ) self.wait() two_brace = Brace(y_line1, RIGHT) two = TexMobject("2").next_to(two_brace, RIGHT) new_y_line = Line(4*RIGHT, 4*RIGHT+UP, color=Y_COLOR) two_minus_one_brace = Brace(new_y_line, RIGHT) two_minus_one = TexMobject( "2+(-1)").next_to(two_minus_one_brace, RIGHT) self.play( GrowFromCenter(two_brace), Write(two, run_time=1) ) self.wait() self.play( Transform(two_brace, two_minus_one_brace), Transform(two, two_minus_one), Transform(y_line1, new_y_line), Transform(y_line2, new_y_line) ) self.wait() self.add_vector(v2.get_end(), color=PINK) sum_coords = Matrix(["1+3", "2+(-1)"]) sum_coords.set_height(coords1.get_height()) sum_coords.next_to(equals, RIGHT) brackets = sum_coords.get_brackets() x1, y1 = coords1.get_mob_matrix().flatten() x2, y2 = coords2.get_mob_matrix().flatten() sum_x, sum_y = sum_coords.get_mob_matrix().flatten() sum_x_start = VMobject(x1, x2).copy() sum_y_start = VMobject(y1, y2).copy() self.play( Write(brackets), Write(equals), Transform(sum_x_start, sum_x), run_time=1 ) self.play(Transform(sum_y_start, sum_y)) self.wait(2) starters = [x1, y1, x2, y2, sum_x_start, sum_y_start] variables = list(map(TexMobject, [ "x_1", "y_1", "x_2", "y_2", "x_1+y_1", "x_2+y_2" ])) for i, (var, starter) in enumerate(zip(variables, starters)): if i % 2 == 0: var.set_color(X_COLOR) else: var.set_color(Y_COLOR) var.scale(VECTOR_LABEL_SCALE_FACTOR) var.move_to(starter) self.play( Transform( VMobject(*starters[:4]), VMobject(*variables[:4]) ), FadeOut(sum_x_start), FadeOut(sum_y_start) ) sum_x_end, sum_y_end = variables[-2:] self.wait(2) self.play( Transform(VMobject(x1, x2).copy(), sum_x_end) ) self.play( Transform(VMobject(y1, y2).copy(), sum_y_end) ) self.wait(3) class MultiplicationByANumberIntro(Scene): def construct(self): v = TexMobject("\\vec{\\textbf{v}}") v.set_color(YELLOW) nums = list(map(TexMobject, ["2", "\\dfrac{1}{3}", "-1.8"])) for mob in [v] + nums: mob.scale(1.5) self.play(Write(v, run_time=1)) last = None for num in nums: num.next_to(v, LEFT) if last: self.play(Transform(last, num)) else: self.play(FadeIn(num)) last = num self.wait() class ShowScalarMultiplication(VectorScene): def construct(self): plane = self.add_plane() v = self.add_vector([3, 1]) label = self.label_vector(v, "v", add_to_vector=False) self.scale_vector(v, 2, label) self.scale_vector(v, 1./3, label, factor_tex="\\dfrac{1}{3}") self.scale_vector(v, -1.8, label) self.remove(label) self.describe_scalars(v, plane) def scale_vector(self, v, factor, v_label, v_name="v", factor_tex=None): starting_mobjects = list(self.mobjects) if factor_tex is None: factor_tex = str(factor) scaled_vector = self.add_vector( factor*v.get_end(), animate=False ) self.remove(scaled_vector) label_tex = "%s\\vec{\\textbf{%s}}" % (factor_tex, v_name) label = self.label_vector( scaled_vector, label_tex, animate=False, add_to_vector=False ) self.remove(label) factor_mob = TexMobject(factor_tex) if factor_mob.get_height() > 1: factor_mob.set_height(0.9) if factor_mob.get_width() > 1: factor_mob.set_width(0.9) factor_mob.shift(1.5*RIGHT+2.5*UP) num_factor_parts = len(factor_mob.split()) factor_mob_parts_in_label = label.split()[:num_factor_parts] label_remainder_parts = label.split()[num_factor_parts:] factor_in_label = VMobject(*factor_mob_parts_in_label) label_remainder = VMobject(*label_remainder_parts) self.play(Write(factor_mob, run_time=1)) self.wait() self.play( ApplyMethod(v.copy().set_color, DARK_GREY), ApplyMethod(v_label.copy().set_color, DARK_GREY), Transform(factor_mob, factor_in_label), Transform(v.copy(), scaled_vector), Transform(v_label.copy(), label_remainder), ) self.wait(2) self.clear() self.add(*starting_mobjects) def describe_scalars(self, v, plane): axes = plane.get_axes() long_v = Vector(2*v.get_end()) long_minus_v = Vector(-2*v.get_end()) original_v = v.copy() scaling_word = TextMobject("``Scaling''").to_corner(UP+LEFT) scaling_word.shift(2*RIGHT) scalars = VMobject(*list(map(TexMobject, [ "2,", "\\dfrac{1}{3},", "-1.8,", "\\dots" ]))) scalars.arrange(RIGHT, buff=0.4) scalars.next_to(scaling_word, DOWN, aligned_edge=LEFT) scalars_word = TextMobject("``Scalars''") scalars_word.next_to(scalars, DOWN, aligned_edge=LEFT) self.remove(plane) self.add(axes) self.play( Write(scaling_word), Transform(v, long_v), run_time=1.5 ) self.play(Transform(v, long_minus_v, run_time=3)) self.play(Write(scalars)) self.wait() self.play(Write(scalars_word)) self.play(Transform(v, original_v), run_time=3) self.wait(2) class ScalingNumerically(VectorScene): def construct(self): two_dot = TexMobject("2\\cdot") equals = TexMobject("=") self.add_axes() v = self.add_vector([3, 1]) v_coords, vx_line, vy_line = self.vector_to_coords(v, clean_up=False) self.play(ApplyMethod(v_coords.to_edge, UP)) two_dot.next_to(v_coords, LEFT) equals.next_to(v_coords, RIGHT) two_v = self.add_vector([6, 2], animate=False) self.remove(two_v) self.play( Transform(v.copy(), two_v), Write(two_dot, run_time=1) ) two_v_coords, two_v_x_line, two_v_y_line = self.vector_to_coords( two_v, clean_up=False ) self.play( ApplyMethod(two_v_coords.next_to, equals, RIGHT), Write(equals, run_time=1) ) self.wait(2) x, y = v_coords.get_mob_matrix().flatten() two_v_elems = two_v_coords.get_mob_matrix().flatten() x_sym, y_sym = list(map(TexMobject, ["x", "y"])) two_x_sym, two_y_sym = list(map(TexMobject, ["2x", "2y"])) VMobject(x_sym, two_x_sym).set_color(X_COLOR) VMobject(y_sym, two_y_sym).set_color(Y_COLOR) syms = [x_sym, y_sym, two_x_sym, two_y_sym] VMobject(*syms).scale(VECTOR_LABEL_SCALE_FACTOR) for sym, num in zip(syms, [x, y] + list(two_v_elems)): sym.move_to(num) self.play( Transform(x, x_sym), Transform(y, y_sym), FadeOut(VMobject(*two_v_elems)) ) self.wait() self.play( Transform( VMobject(two_dot.copy(), x.copy()), two_x_sym ), Transform( VMobject(two_dot.copy(), y.copy()), two_y_sym ) ) self.wait(2) class FollowingVideos(UpcomingSeriesOfVidoes): def construct(self): v_sum = VMobject( Vector([1, 1], color=YELLOW), Vector([3, 1], color=BLUE).shift(RIGHT+UP), Vector([4, 2], color=GREEN), ) scalar_multiplication = VMobject( TexMobject("2 \\cdot "), Vector([1, 1]), TexMobject("="), Vector([2, 2], color=WHITE) ) scalar_multiplication.arrange(RIGHT) both = VMobject(v_sum, scalar_multiplication) both.arrange(RIGHT, buff=1) both.shift(2*DOWN) self.add(both) UpcomingSeriesOfVidoes.construct(self) last_video = self.mobjects[-1] self.play(ApplyMethod(last_video.set_color, YELLOW)) self.wait() everything = VMobject(*self.mobjects) everything.remove(last_video) big_last_video = last_video.copy() big_last_video.center() big_last_video.set_height(2.5*FRAME_Y_RADIUS) big_last_video.set_fill(opacity=0) self.play( ApplyMethod(everything.shift, FRAME_WIDTH*LEFT), Transform(last_video, big_last_video), run_time=2 ) class ItDoesntMatterWhich(Scene): def construct(self): physy = Physicist() compy = ComputerScientist() physy.title = TextMobject("Physics student").to_corner(DOWN+LEFT) compy.title = TextMobject("CS student").to_corner(DOWN+RIGHT) for pi in physy, compy: pi.next_to(pi.title, UP) self.add(pi, pi.title) compy_speech = compy.get_bubble(SpeechBubble) physy_speech = physy.get_bubble(SpeechBubble) arrow = Vector([2, 1]) array = matrix_to_mobject([2, 1]) goes_to = TexMobject("\\Rightarrow") physy_statement = VMobject(arrow, goes_to, array) physy_statement.arrange(RIGHT) compy_statement = physy_statement.copy() compy_statement.arrange(LEFT) physy_speech.position_mobject_inside(physy_statement) compy_speech.position_mobject_inside(compy_statement) new_arrow = Vector([2, 1]) x_line = Line(ORIGIN, 2*RIGHT, color=X_COLOR) y_line = Line(2*RIGHT, 2*RIGHT+UP, color=Y_COLOR) x_mob = TexMobject("2").next_to(x_line, DOWN) y_mob = TexMobject("1").next_to(y_line, RIGHT) new_arrow.add(x_line, y_line, x_mob, y_mob) back_and_forth = VMobject( new_arrow, TexMobject("\\Leftrightarrow"), matrix_to_mobject([2, 1]) ) back_and_forth.arrange(LEFT).center() self.wait() self.play( ApplyMethod(physy.change_mode, "speaking"), ShowCreation(physy_speech), Write(physy_statement), run_time=1 ) self.play(Blink(compy)) self.play( ApplyMethod(physy.change_mode, "sassy"), ApplyMethod(compy.change_mode, "speaking"), FadeOut(physy_speech), ShowCreation(compy_speech), Transform(physy_statement, compy_statement, path_arc=np.pi) ) self.wait(2) self.play( ApplyMethod(physy.change_mode, "pondering"), ApplyMethod(compy.change_mode, "pondering"), Transform(compy_speech, VectorizedPoint(compy_speech.get_tip())), Transform(physy_statement, back_and_forth) ) self.wait() class DataAnalyst(Scene): def construct(self): plane = NumberPlane() ellipse = ParametricFunction( lambda x: 2*np.cos(x)*(UP+RIGHT) + np.sin(x)*(UP+LEFT), color=PINK, t_max=2*np.pi ) ellipse_points = [ ellipse.point_from_proportion(x) for x in np.arange(0, 1, 1./20) ] string_vects = [ matrix_to_mobject(("%.02f %.02f" % tuple(ep[:2])).split()) for ep in ellipse_points ] string_vects_matrix = Matrix( np.array(string_vects).reshape((4, 5)) ) string_vects = string_vects_matrix.get_mob_matrix().flatten() string_vects = VMobject(*string_vects) vects = VMobject(*list(map(Vector, ellipse_points))) self.play(Write(string_vects)) self.wait(2) self.play( FadeIn(plane), Transform(string_vects, vects) ) self.remove(string_vects) self.add(vects) self.wait() self.play( ApplyMethod(plane.fade, 0.7), ApplyMethod(vects.set_color, DARK_GREY), ShowCreation(ellipse) ) self.wait(3) class ManipulateSpace(LinearTransformationScene): CONFIG = { "include_background_plane": False, "show_basis_vectors": False, } def construct(self): matrix_rule = TexMobject(""" \\left[ \\begin{array}{c} x \\\\ y \\end{array} \\right] \\rightarrow \\left[ \\begin{array}{c} 2x + y \\\\ y + 2x \\end{array} \\right] """) self.setup() pi_creature = PiCreature(color=PINK).scale(0.5) pi_creature.shift(-pi_creature.get_corner(DOWN+LEFT)) self.plane.prepare_for_nonlinear_transform() self.play(ShowCreation( self.plane, run_time=2 )) self.play(FadeIn(pi_creature)) self.play(Blink(pi_creature)) self.plane.add(pi_creature) self.play(Homotopy(plane_wave_homotopy, self.plane, run_time=3)) self.wait(2) self.apply_matrix([[2, 1], [1, 2]]) self.wait() self.play( FadeOut(self.plane), Write(matrix_rule), run_time=2 ) self.wait() class CodingMathyAnimation(Scene): pass class NextVideo(Scene): def construct(self): title = TextMobject("Next video: Linear combinations, span, and bases") title.to_edge(UP) rect = Rectangle(width=16, height=9, color=BLUE) rect.set_height(6) rect.next_to(title, DOWN) self.add(title) self.play(ShowCreation(rect)) self.wait()
run_time=2
GroupIB_TIA_Feed.py
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * """ IMPORTS """ from typing import Dict, Generator, List, Optional, Tuple, Union import dateparser import urllib3 # Disable insecure warnings urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ''' CONSTANTS ''' DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # todo: add all necessary field types COMMON_FIELD_TYPES = ['trafficlightprotocol'] DATE_FIELDS_LIST = ["creationdate", "firstseenbysource", "lastseenbysource", "gibdatecompromised"] MAPPING: dict = { "compromised/mule": { "indicators": [ { "main_field": 'account', "main_field_type": 'GIB Compromised Mule', "add_fields": [ 'dateAdd', 'sourceType', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'creationdate', 'source', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.url', "main_field_type": 'URL', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.domain', "main_field_type": 'Domain', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.ipv4.ip', "main_field_type": 'IP', "add_fields": [ 'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] } ] }, "compromised/imei": { "indicators": [ { "main_field": 'cnc.url', "main_field_type": 'URL', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.domain', "main_field_type": 'Domain', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.ipv4.ip', "main_field_type": 'IP', "add_fields": [ 'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'device.imei', "main_field_type": 'GIB Compromised IMEI', "add_fields": [ 'dateDetected', 'dateCompromised', 'device.model', 'client.ipv4.asn', 'client.ipv4.countryName', 'client.ipv4.region', 'client.ipv4.ip', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types":[ 'creationdate', 'gibdatecompromised', 'devicemodel', 'asn', 'geocountry', 'geolocation', 'ipaddress', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] } ] }, "attacks/ddos": { "indicators": [ { "main_field": 'cnc.url', "main_field_type": 'URL', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.domain', "main_field_type": 'Domain', "add_fields": [ 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'cnc.ipv4.ip', "main_field_type": 'IP', "add_fields": [ 'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] }, { "main_field": 'target.ipv4.ip', "main_field_type": 'GIB Victim IP', "add_fields": [ 'target.ipv4.asn', 'target.ipv4.countryName', 'target.ipv4.region', 'malware.name', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'dateBegin', 'dateEnd' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibmalwarename', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] } ] }, "attacks/deface": { "indicators": [ { "main_field": 'url', "main_field_type": 'URL', "add_fields": ['threatActor.name', 'threatActor.isAPT', 'threatActor.id'], "add_fields_types": ['gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid'] }, { "main_field": 'targetDomain', "main_field_type": 'Domain', "add_fields": ['threatActor.name', 'threatActor.isAPT', 'threatActor.id'], "add_fields_types": ['gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid'] }, { "main_field": 'targetIp.ip', "main_field_type": 'IP', "add_fields": [ 'targetIp.asn', 'targetIp.countryName', 'targetIp.region', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid' ] } ] }, "attacks/phishing": { "indicators": [ { "main_field": 'url', "main_field_type": 'URL', }, { "main_field": 'phishingDomain.domain', "main_field_type": 'Domain', "add_fields": [ 'phishingDomain.dateRegistered', 'dateDetected', 'phishingDomain.registrar', 'phishingDomain.title', 'targetBrand', 'targetCategory', 'targetDomain' ], "add_fields_types": [ 'creationdate', 'firstseenbysource', 'registrarname', 'gibphishingtitle', 'gibtargetbrand', 'gibtargetcategory', 'gibtargetdomain' ] }, { "main_field": 'ipv4.ip', "main_field_type": 'IP', "add_fields": ['ipv4.asn', 'ipv4.countryName', 'ipv4.region'], "add_fields_types": ['asn', 'geocountry', 'geolocation'] } ] }, "attacks/phishing_kit": { "indicators": [ { "main_field": 'emails', "main_field_type": 'Email', "add_fields": ['dateFirstSeen', 'dateLastSeen'], "add_fields_types": ['firstseenbysource', 'lastseenbysource'] } ] }, "apt/threat": { "indicators": [ { "main_field": 'indicators.params.ipv4', "main_field_type": 'IP', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.domain', "main_field_type": 'Domain', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.url', "main_field_type": 'URL', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.hashes.md5', "main_field_type": 'File', "add_fields": [ 'indicators.params.name', 'indicators.params.hashes.md5', 'indicators.params.hashes.sha1', 'indicators.params.hashes.sha256', 'indicators.params.size', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibfilename', 'md5', 'sha1', 'sha256', 'size', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] } ] }, "hi/threat": { "indicators": [ { "main_field": 'indicators.params.ipv4', "main_field_type": 'IP', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.domain', "main_field_type": 'Domain', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.url', "main_field_type": 'URL', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'indicators.params.hashes.md5', "main_field_type": 'File', "add_fields": [ 'indicators.params.name', 'indicators.params.hashes.md5', 'indicators.params.hashes.sha1', 'indicators.params.hashes.sha256', 'indicators.params.size', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'indicators.dateFirstSeen', 'indicators.dateLastSeen' ], "add_fields_types": [ 'gibfilename', 'md5', 'sha1', 'sha256', 'size', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] } ] }, "suspicious_ip/tor_node": { 'indicators': [ { "main_field": 'ipv4.ip', "main_field_type": 'IP', "add_fields": ['ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'dateFirstSeen', 'dateLastSeen'], "add_fields_types": ['asn', 'geocountry', 'geolocation', 'firstseenbysource', 'lastseenbysource'] } ] }, "suspicious_ip/open_proxy": { 'indicators': [ { "main_field": 'ipv4.ip', "main_field_type": 'IP', "add_fields": [ 'ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'port', 'anonymous', 'source', 'dateFirstSeen', 'dateDetected' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibproxyport', 'gibproxyanonymous', 'source', 'firstseenbysource', 'lastseenbysource' ] } ] }, "suspicious_ip/socks_proxy": { 'indicators': [ { "main_field": 'ipv4.ip', "main_field_type": 'IP', "add_fields": ['ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'dateFirstSeen', 'dateLastSeen'], "add_fields_types": ['asn', 'geocountry', 'geolocation', 'firstseenbysource', 'lastseenbysource'] } ] }, "malware/cnc": { 'indicators': [ { 'main_field': 'url', "main_field_type": 'URL', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'dateDetected', 'dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { 'main_field': 'domain', "main_field_type": 'Domain', "add_fields": [ 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'dateDetected', 'dateLastSeen' ], "add_fields_types": [ 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] }, { "main_field": 'ipv4.ip', "main_field_type": 'IP', "add_fields": [ 'ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'threatActor.name', 'threatActor.isAPT', 'threatActor.id', 'dateDetected', 'dateLastSeen' ], "add_fields_types": [ 'asn', 'geocountry', 'geolocation', 'gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid', 'firstseenbysource', 'lastseenbysource' ] } ] }, "osi/vulnerability": { 'indicators': [ { 'main_field': 'id', "main_field_type": 'CVE', "add_fields": [ 'cvss.score', 'cvss.vector', 'softwareMixed', 'description', 'dateModified', 'datePublished' ], "add_fields_types": [ 'cvss', 'gibcvssvector', 'gibsoftwaremixed', 'cvedescription', 'cvemodified', 'published' ] } ] }, } class Client(BaseClient): """ Client will implement the service API, and should not contain any Demisto logic. Should only do requests and return data. """ def create_update_generator(self, collection_name: str, date_from: Optional[str] = None, seq_update: Union[int, str] = None, limit: int = 200) -> Generator: """ Creates generator of lists with feeds class objects for an update session (feeds are sorted in ascending order) `collection_name` with set parameters. `seq_update` allows you to receive all relevant feeds. Such a request uses the seq_update parameter, you will receive a portion of feeds that starts with the next `seq_update` parameter for the current collection. For all feeds in the Group IB Intelligence continuous numbering is carried out. For example, the `seq_update` equal to 1999998 can be in the `compromised/accounts` collection, and a feed with seq_update equal to 1999999 can be in the `attacks/ddos` collection. If item updates (for example, if new attacks were associated with existing APT by our specialists or tor node has been detected as active again), the item gets a new parameter and it automatically rises in the database and "becomes relevant" again. :param collection_name: collection to update. :param date_from: start date of update session. :param seq_update: identification number from which to start the session. :param limit: size of portion in iteration. """ while True: params = {'df': date_from, 'limit': limit, 'seqUpdate': seq_update} params = {key: value for key, value in params.items() if value} portion = self._http_request(method="GET", url_suffix=collection_name + '/updated', params=params, timeout=60., retries=4, status_list_to_retry=[429, 500]) if portion.get("count") == 0: break seq_update = portion.get("seqUpdate") date_from = None yield portion.get('items') def create_search_generator(self, collection_name: str, date_from: str = None, limit: int = 200) -> Generator: """ Creates generator of lists with feeds for the search session (feeds are sorted in descending order) for `collection_name` with set parameters. :param collection_name: collection to search. :param date_from: start date of search session. :param limit: size of portion in iteration. """ result_id = None while True: params = {'df': date_from, 'limit': limit, 'resultId': result_id} params = {key: value for key, value in params.items() if value} portion = self._http_request(method="GET", url_suffix=collection_name, params=params, timeout=60., retries=4, status_list_to_retry=[429, 500]) if len(portion.get('items')) == 0: break result_id = portion.get("resultId") date_from = None yield portion.get('items') def search_feed_by_id(self, collection_name: str, feed_id: str) -> Dict: """ Searches for feed with `feed_id` in collection with `collection_name`. :param collection_name: in what collection to search. :param feed_id: id of feed to search. """ portion = self._http_request(method="GET", url_suffix=collection_name + '/' + feed_id, timeout=60., retries=4, status_list_to_retry=[429, 500]) return portion def test_module(client: Client) -> str: """ Returning 'ok' indicates that the integration works like it is supposed to. Connection to the service is successful. :param client: GIB_TI&A_Feed client :return: 'ok' if test passed, anything else will fail the test. """ generator = client.create_update_generator(collection_name='compromised/mule', limit=10) generator.__next__() return 'ok' """ Support functions """ def find_element_by_key(obj, key): """ Recursively finds element or elements in dict. """ path = key.split(".", 1) if len(path) == 1: if isinstance(obj, list): return [i.get(path[0]) for i in obj] elif isinstance(obj, dict): return obj.get(path[0]) else: return obj else: if isinstance(obj, list): return [find_element_by_key(i.get(path[0]), path[1]) for i in obj] elif isinstance(obj, dict): return find_element_by_key(obj.get(path[0]), path[1]) else: return obj def unpack_iocs(iocs, ioc_type, fields, fields_names, collection_name): """ Recursively ties together and transforms indicator data. """ unpacked = [] if isinstance(iocs, list): for i, ioc in enumerate(iocs): buf_fields = [] for field in fields: if isinstance(field, list): buf_fields.append(field[i]) else: buf_fields.append(field) unpacked.extend(unpack_iocs(ioc, ioc_type, buf_fields, fields_names, collection_name)) else: if iocs in ['255.255.255.255', '0.0.0.0', '', None]: return unpacked fields_dict = {fields_names[i]: fields[i] for i in range(len(fields_names)) if fields[i] is not None} # Transforming one certain field into a markdown table if ioc_type == "CVE" and len(fields_dict["gibsoftwaremixed"]) != 0: soft_mixed = fields_dict.get("gibsoftwaremixed", {}) buffer = '' for chunk in soft_mixed: software_name = ', '.join(chunk.get('softwareName')) software_type = ', '.join(chunk.get('softwareType')) software_version = ', '.join(chunk.get('softwareVersion')) if len(software_name) != 0 or len(software_type) != 0 or len(software_version) != 0: buffer += '| {0} | {1} | {2} |\n'.format(software_name, software_type, software_version.replace('||', ', ')) if len(buffer) != 0: buffer = "| Software Name | Software Type | Software Version |\n" \ "| ------------- | ------------- | ---------------- |\n" + buffer fields_dict["gibsoftwaremixed"] = buffer else: del fields_dict["gibsoftwaremixed"] # Transforming into correct date format for date_field in DATE_FIELDS_LIST: if fields_dict.get(date_field): fields_dict[date_field] = dateparser.parse(fields_dict.get(date_field)).strftime('%Y-%m-%dT%H:%M:%SZ') fields_dict.update({'gibcollection': collection_name}) unpacked.append({'value': iocs, 'type': ioc_type, 'rawJSON': {'value': iocs, 'type': ioc_type, **fields_dict}, 'fields': fields_dict}) return unpacked def find_iocs_in_feed(feed: Dict, collection_name: str, common_fields: Dict) -> List: """ Finds IOCs in the feed and transform them to the appropriate format to ingest them into Demisto. :param feed: feed from GIB TI&A. :param collection_name: which collection this feed belongs to. :param common_fields: fields defined by user. """ indicators = [] indicators_info = MAPPING.get(collection_name, {}).get('indicators', []) for i in indicators_info: main_field = find_element_by_key(feed, i['main_field']) main_field_type = i['main_field_type'] add_fields = [] add_fields_list = i.get('add_fields', []) + ['id'] for j in add_fields_list: add_fields.append(find_element_by_key(feed, j)) add_fields_types = i.get('add_fields_types', []) + ['gibid'] for field_type in COMMON_FIELD_TYPES: if common_fields.get(field_type): add_fields.append(common_fields.get(field_type)) add_fields_types.append(field_type) if collection_name in ['apt/threat', 'hi/threat', 'malware/cnc']: add_fields.append(', '.join(find_element_by_key(feed, "malwareList.name"))) add_fields_types = add_fields_types + ['gibmalwarename'] indicators.extend(unpack_iocs(main_field, main_field_type, add_fields, add_fields_types, collection_name)) return indicators def get_human_readable_feed(indicators: List, type_: str, collection_name: str) -> str: headers = ['value', 'type'] for fields in MAPPING.get(collection_name, {}).get('indicators', {}): if fields.get('main_field_type') == type_: headers.extend(fields['add_fields_types']) break if collection_name in ['apt/threat', 'hi/threat', 'malware/cnc']: headers.append('gibmalwarename') return tableToMarkdown("{0} indicators".format(type_), indicators, removeNull=True, headers=headers) def format_result_for_manual(indicators: List) -> Dict: formatted_indicators: Dict[str, Any] = {} for indicator in indicators: indicator = indicator.get('rawJSON') type_ = indicator.get('type') if type_ == 'CVE': del indicator["gibsoftwaremixed"] if formatted_indicators.get(type_) is None: formatted_indicators[type_] = [indicator] else: formatted_indicators[type_].append(indicator) return formatted_indicators """ Commands """ def fetch_indicators_command(client: Client, last_run: Dict, first_fetch_time: str, indicator_collections: List, requests_count: int, common_fields: Dict) -> Tuple[Dict, List]: """ This function will execute each interval (default is 1 minute). :param client: GIB_TI&A_Feed client. :param last_run: the greatest sequpdate we fetched from last fetch. :param first_fetch_time: if last_run is None then fetch all incidents since first_fetch_time. :param indicator_collections: list of collections enabled by client. :param requests_count: count of requests to API per collection. :param common_fields: fields defined by user. :return: next_run will be last_run in the next fetch-indicators; indicators will be created in Demisto. """ indicators = [] next_run: Dict[str, Dict[str, Union[int, Any]]] = {"last_fetch": {}} tags = common_fields.pop("tags", []) for collection_name in indicator_collections: last_fetch = last_run.get('last_fetch', {}).get(collection_name) # Handle first time fetch date_from = None seq_update = None if not last_fetch: date_from = dateparser.parse(first_fetch_time) if date_from is None: raise DemistoException('Inappropriate indicators_first_fetch format, ' 'please use something like this: 2020-01-01 or January 1 2020 or 3 days') date_from = date_from.strftime('%Y-%m-%d') else: seq_update = last_fetch portions = client.create_update_generator(collection_name=collection_name, date_from=date_from, seq_update=seq_update) k = 0 for portion in portions: for feed in portion: seq_update = feed.get('seqUpdate') indicators.extend(find_iocs_in_feed(feed, collection_name, common_fields)) k += 1 if k >= requests_count: break if tags: for indicator in indicators: indicator["fields"].update({"tags": tags}) indicator["rawJSON"].update({"tags": tags}) next_run['last_fetch'][collection_name] = seq_update return next_run, indicators def get_indicators_command(client: Client, args: Dict[str, str]): """ Returns limited portion of indicators to War Room. :param client: GIB_TI&A_Feed client. :param args: arguments, provided by client. """ id_, collection_name = args.get('id'), args.get('collection', '') indicators = [] raw_json = None try: limit = int(args.get('limit', '50')) if limit > 50: raise Exception('A limit should be lower than 50.') except ValueError: raise Exception('A limit should be a number, not a string.') if collection_name not in MAPPING.keys(): raise Exception('Incorrect collection name. Please, choose one of the displayed options.') if not id_: portions = client.create_search_generator(collection_name=collection_name, limit=limit) for portion in portions: for feed in portion: indicators.extend(find_iocs_in_feed(feed, collection_name, {})) if len(indicators) >= limit: indicators = indicators[:limit] break if len(indicators) >= limit: break else: raw_json = client.search_feed_by_id(collection_name=collection_name, feed_id=id_) indicators.extend(find_iocs_in_feed(raw_json, collection_name, {})) if len(indicators) >= limit: indicators = indicators[:limit] formatted_indicators = format_result_for_manual(indicators) results = [] for type_, indicator in formatted_indicators.items(): results.append(CommandResults( readable_output=get_human_readable_feed(indicator, type_, collection_name), raw_response=raw_json, ignore_auto_extract=True )) return results def main(): """ PARSE AND VALIDATE INTEGRATION PARAMS """ params = demisto.params() username = params.get('credentials').get('identifier') password = params.get('credentials').get('password') proxy = params.get('proxy', False) verify_certificate = not params.get('insecure', False) base_url = str(params.get("url")) indicator_collections = params.get('indicator_collections', []) indicators_first_fetch = params.get('indicators_first_fetch', '3 days').strip() requests_count = int(params.get('requests_count', 2)) args = demisto.args() command = demisto.command() LOG(f'Command being called is {command}') try: client = Client( base_url=base_url, verify=verify_certificate, auth=(username, password), proxy=proxy, headers={"Accept": "*/*"}) commands = {'gibtia-get-indicators': get_indicators_command} if command == 'test-module': # This is the call made when pressing the integration Test button. result = test_module(client) demisto.results(result) elif command == 'fetch-indicators': # Set and define the fetch incidents command to run after activated via integration settings. common_fields = { 'trafficlightprotocol': params.get("tlp_color"),
'tags': argToList(params.get("feedTags")), } next_run, indicators = fetch_indicators_command(client=client, last_run=get_integration_context(), first_fetch_time=indicators_first_fetch, indicator_collections=indicator_collections, requests_count=requests_count, common_fields=common_fields) set_integration_context(next_run) for b in batch(indicators, batch_size=2000): demisto.createIndicators(b) else: return_results(commands[command](client, args)) # Log exceptions except Exception as e: return_error(f'Failed to execute {demisto.command()} command. Error: {str(e)}') if __name__ in ('__main__', '__builtin__', 'builtins'): main()
userModel.js
"use strict"; const mongoose = require("mongoose"); const _ = require("lodash"); const userSchema = new mongoose.Schema({ username: { type: String, required: true }, email: { type: String, required: true }, password: { type: String, required: true }, profilePicturePath: { type: String, default: null }, creationDate: { type: Date,
default: true }, disabledNotificationsLists: { type: [mongoose.ObjectId], default: [] }, achievements: { type: [Date], default: _.range(0, 14).map(_ => null) }, completedTasks: { type: Number, default: 0 } }); userSchema.path("email").validate( function(email) { return mongoose.model("User").count({ email }).exec().then(count => count === 0, _ => false); }, "A user has already registered with this email, please choose another" ); module.exports = { createUserModel: () => mongoose.model("User", userSchema) };
default: Date.now }, notificationsEnabled: { type: Boolean,
udprelay.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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. # SOCKS5 UDP Request # +----+------+------+----------+----------+----------+ # |RSV | FRAG | ATYP | DST.ADDR | DST.PORT | DATA | # +----+------+------+----------+----------+----------+ # | 2 | 1 | 1 | Variable | 2 | Variable | # +----+------+------+----------+----------+----------+ # SOCKS5 UDP Response # +----+------+------+----------+----------+----------+ # |RSV | FRAG | ATYP | DST.ADDR | DST.PORT | DATA | # +----+------+------+----------+----------+----------+ # | 2 | 1 | 1 | Variable | 2 | Variable | # +----+------+------+----------+----------+----------+ # shadowsocks UDP Request (before encrypted) # +------+----------+----------+----------+ # | ATYP | DST.ADDR | DST.PORT | DATA | # +------+----------+----------+----------+ # | 1 | Variable | 2 | Variable | # +------+----------+----------+----------+ # shadowsocks UDP Response (before encrypted) # +------+----------+----------+----------+ # | ATYP | DST.ADDR | DST.PORT | DATA | # +------+----------+----------+----------+ # | 1 | Variable | 2 | Variable | # +------+----------+----------+----------+ # shadowsocks UDP Request and Response (after encrypted) # +-------+--------------+ # | IV | PAYLOAD | # +-------+--------------+ # | Fixed | Variable | # +-------+--------------+ # HOW TO NAME THINGS # ------------------ # `dest` means destination server, which is from DST fields in the SOCKS5 # request # `local` means local server of shadowsocks # `remote` means remote server of shadowsocks # `client` means UDP clients that connects to other servers # `server` means the UDP server that handles user requests from __future__ import absolute_import, division, print_function, \ with_statement import socket import logging import struct import errno import random from shadowsocks import cryptor, eventloop, lru_cache, common, shell from shadowsocks.common import parse_header, pack_addr, onetimeauth_verify, \ onetimeauth_gen, ONETIMEAUTH_BYTES, ADDRTYPE_AUTH BUF_SIZE = 65536 def client_key(source_addr, server_af): # notice this is server af, not dest af return '%s:%s:%d' % (source_addr[0], source_addr[1], server_af) class UDPRelay(object): def __init__(self, config, dns_resolver, is_local, stat_callback=None): self._config = config if is_local: self._listen_addr = config['local_address'] self._listen_port = config['local_port'] self._remote_addr = config['server'] self._remote_port = config['server_port'] else: self._listen_addr = config['server'] self._listen_port = config['server_port'] self._remote_addr = None self._remote_port = None self.tunnel_remote = config.get('tunnel_remote', "8.8.8.8") self.tunnel_remote_port = config.get('tunnel_remote_port', 53) self.tunnel_port = config.get('tunnel_port', 53) self._is_tunnel = False self._dns_resolver = dns_resolver self._password = common.to_bytes(config['password']) self._method = config['method'] self._timeout = config['timeout'] self._ota_enable = config.get('one_time_auth', False) self._ota_enable_session = self._ota_enable self._is_local = is_local self._cache = lru_cache.LRUCache(timeout=config['timeout'], close_callback=self._close_client) self._client_fd_to_server_addr = \ lru_cache.LRUCache(timeout=config['timeout']) self._dns_cache = lru_cache.LRUCache(timeout=300) self._eventloop = None self._closed = False self._sockets = set() self._forbidden_iplist = config.get('forbidden_ip') self._crypto_path = config['crypto_path'] addrs = socket.getaddrinfo(self._listen_addr, self._listen_port, 0, socket.SOCK_DGRAM, socket.SOL_UDP) if len(addrs) == 0: raise Exception("UDP can't get addrinfo for %s:%d" % (self._listen_addr, self._listen_port)) af, socktype, proto, canonname, sa = addrs[0] server_socket = socket.socket(af, socktype, proto) server_socket.bind((self._listen_addr, self._listen_port)) server_socket.setblocking(False) self._server_socket = server_socket self._stat_callback = stat_callback def _get_a_server(self): server = self._config['server'] server_port = self._config['server_port'] if type(server_port) == list: server_port = random.choice(server_port) if type(server) == list: server = random.choice(server) logging.debug('chosen server: %s:%d', server, server_port) return server, server_port def _close_client(self, client): if hasattr(client, 'close'): self._sockets.remove(client.fileno()) self._eventloop.remove(client) client.close() else: # just an address pass def _handle_server(self): server = self._server_socket data, r_addr = server.recvfrom(BUF_SIZE) key = None iv = None if not data: logging.debug('UDP handle_server: data is empty') if self._stat_callback: self._stat_callback(self._listen_port, len(data)) if self._is_local: if self._is_tunnel: # add ss header to data tunnel_remote = self.tunnel_remote tunnel_remote_port = self.tunnel_remote_port data = common.add_header(tunnel_remote, tunnel_remote_port, data) else: frag = common.ord(data[2]) if frag != 0: logging.warn('UDP drop a message since frag is not 0') return else: data = data[3:] else: # decrypt data try: data, key, iv = cryptor.decrypt_all(self._password, self._method, data, self._crypto_path) except Exception: logging.debug('UDP handle_server: decrypt data failed') return if not data: logging.debug('UDP handle_server: data is empty after decrypt') return header_result = parse_header(data) if header_result is None: return addrtype, dest_addr, dest_port, header_length = header_result logging.info("udp data to %s:%d from %s:%d" % (dest_addr, dest_port, r_addr[0], r_addr[1])) if self._is_local: server_addr, server_port = self._get_a_server() else: server_addr, server_port = dest_addr, dest_port # spec https://shadowsocks.org/en/spec/one-time-auth.html self._ota_enable_session = addrtype & ADDRTYPE_AUTH if self._ota_enable and not self._ota_enable_session: logging.warn('client one time auth is required') return if self._ota_enable_session: if len(data) < header_length + ONETIMEAUTH_BYTES: logging.warn('UDP one time auth header is too short') return _hash = data[-ONETIMEAUTH_BYTES:] data = data[: -ONETIMEAUTH_BYTES] _key = iv + key if onetimeauth_verify(_hash, data, _key) is False: logging.warn('UDP one time auth fail') return addrs = self._dns_cache.get(server_addr, None) if addrs is None: addrs = socket.getaddrinfo(server_addr, server_port, 0, socket.SOCK_DGRAM, socket.SOL_UDP) if not addrs: # drop return else: self._dns_cache[server_addr] = addrs af, socktype, proto, canonname, sa = addrs[0] key = client_key(r_addr, af) client = self._cache.get(key, None) if not client: # TODO async getaddrinfo if self._forbidden_iplist: if common.to_str(sa[0]) in self._forbidden_iplist: logging.debug('IP %s is in forbidden list, drop' % common.to_str(sa[0])) # drop return client = socket.socket(af, socktype, proto) client.setblocking(False) self._cache[key] = client self._client_fd_to_server_addr[client.fileno()] = r_addr self._sockets.add(client.fileno()) self._eventloop.add(client, eventloop.POLL_IN, self) if self._is_local: key, iv, m = cryptor.gen_key_iv(self._password, self._method) # spec https://shadowsocks.org/en/spec/one-time-auth.html if self._ota_enable_session: data = self._ota_chunk_data_gen(key, iv, data) try: data = cryptor.encrypt_all_m(key, iv, m, self._method, data, self._crypto_path) except Exception: logging.debug("UDP handle_server: encrypt data failed") return if not data: return else: data = data[header_length:] if not data: return try: client.sendto(data, (server_addr, server_port)) except IOError as e: err = eventloop.errno_from_exception(e) if err in (errno.EINPROGRESS, errno.EAGAIN): pass else: shell.print_exception(e) def _handle_client(self, sock): data, r_addr = sock.recvfrom(BUF_SIZE) if not data: logging.debug('UDP handle_client: data is empty') return if self._stat_callback: self._stat_callback(self._listen_port, len(data)) if not self._is_local: addrlen = len(r_addr[0]) if addrlen > 255: # drop return data = pack_addr(r_addr[0]) + struct.pack('>H', r_addr[1]) + data try: response = cryptor.encrypt_all(self._password, self._method, data, self._crypto_path) except Exception: logging.debug("UDP handle_client: encrypt data failed") return if not response: return else: try: data, key, iv = cryptor.decrypt_all(self._password, self._method, data, self._crypto_path) except Exception: logging.debug('UDP handle_client: decrypt data failed') return if not data: return header_result = parse_header(data) if header_result is None: return addrtype, dest_addr, dest_port, header_length = header_result if self._is_tunnel: # remove ss header response = data[header_length:] else: response = b'\x00\x00\x00' + data client_addr = self._client_fd_to_server_addr.get(sock.fileno()) if client_addr: logging.debug("send udp response to %s:%d" % (client_addr[0], client_addr[1])) self._server_socket.sendto(response, client_addr) else: # this packet is from somewhere else we know # simply drop that packet pass def _ota_chunk_data_gen(self, key, iv, data): data = common.chr(common.ord(data[0]) | ADDRTYPE_AUTH) + data[1:] key = iv + key return data + onetimeauth_gen(data, key) def add_to_loop(self, loop): if self._eventloop: raise Exception('already add to loop') if self._closed: raise Exception('already closed') self._eventloop = loop server_socket = self._server_socket self._eventloop.add(server_socket, eventloop.POLL_IN | eventloop.POLL_ERR, self) loop.add_periodic(self.handle_periodic) def handle_event(self, sock, fd, event): if sock == self._server_socket: if event & eventloop.POLL_ERR: logging.error('UDP server_socket err') self._handle_server() elif sock and (fd in self._sockets):
def handle_periodic(self): if self._closed: if self._server_socket: self._server_socket.close() self._server_socket = None for sock in self._sockets: sock.close() logging.info('closed UDP port %d', self._listen_port) self._cache.sweep() self._client_fd_to_server_addr.sweep() self._dns_cache.sweep() def close(self, next_tick=False): logging.debug('UDP close') self._closed = True if not next_tick: if self._eventloop: self._eventloop.remove_periodic(self.handle_periodic) self._eventloop.remove(self._server_socket) self._server_socket.close() for client in list(self._cache.values()): client.close()
if event & eventloop.POLL_ERR: logging.error('UDP client_socket err') self._handle_client(sock)
options.go
package scheduler import ( "fmt" "github.com/litekube/LiteKube/pkg/help" "github.com/litekube/LiteKube/pkg/options/common" ) // struct to store args from input type SchedulerOptions struct { ReservedOptions map[string]string `yaml:"reserve"` ProfessionalOptions *SchedulerProfessionalOptions `yaml:"professional"` Options *SchedulerLitekubeOptions `yaml:"options"` IgnoreOptions map[string]string `yaml:"-"` } func NewSchedulerOptions() *SchedulerOptions { return &SchedulerOptions{ ReservedOptions: make(map[string]string), ProfessionalOptions: NewSchedulerProfessionalOptions(), Options: NewSchedulerLitekubeOptions(), IgnoreOptions: make(map[string]string), } } // delete keys already be disable or define in other block func (opt *SchedulerOptions) CheckReservedOptions() error { // deep copy options optionsMap, oErr := common.StructToMap(opt.Options) if oErr != nil { return oErr } for k := range optionsMap { if value, ok := opt.ReservedOptions[k]; ok { opt.IgnoreOptions[k] = value delete(opt.ReservedOptions, k) } } // deep copy professional-options professionalOptionsMap, pErr := common.StructToMap(opt.ProfessionalOptions) if pErr != nil { return pErr
} for k := range professionalOptionsMap { if value, ok := opt.ReservedOptions[k]; ok { opt.IgnoreOptions[k] = value delete(opt.ReservedOptions, k) } } return nil } func (opt *SchedulerOptions) HelpSection() *help.Section { section := help.NewSection("kube-scheduler", "kube-scheduler's startup parameters, we keep almost the same Settings as the original except logs relation: https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/", nil) reserveSection := help.NewSection("reserve", "reserve parameters, you can still add args unmentioned before refer to kube-scheduler official website.", nil) reserveSection.AddTip("<name-1>", "<value-1>", "it will be parse as \"--<name-1>=<value-1>\"", "") reserveSection.AddTip("<name-n>", "<value-n>", "and so on", "") section.AddSection(reserveSection) professionalSection := help.NewSection("professional", "parameters are not recommended to set by users", nil) opt.ProfessionalOptions.AddTips(professionalSection) section.AddSection(professionalSection) litekubeoptionsSection := help.NewSection("options", "Litekube normal options", nil) opt.Options.AddTips(litekubeoptionsSection) section.AddSection(litekubeoptionsSection) return section } func (opt *SchedulerOptions) ToMap() (map[string]string, error) { // check error define for flags opt.CheckReservedOptions() args := make(map[string]string) // deep copy reserved-options for k, v := range opt.ReservedOptions { args[k] = v } // deep copy options optionsMap, oErr := common.StructToMap(opt.Options) if oErr != nil { return nil, oErr } for k, v := range optionsMap { args[k] = v } // deep copy professional-options professionalOptionsMap, pErr := common.StructToMap(opt.ProfessionalOptions) if pErr != nil { return nil, pErr } for k, v := range professionalOptionsMap { args[k] = v } return args, nil } // print all flags func (opt *SchedulerOptions) PrintFlags(prefix string, printFunc func(format string, a ...interface{}) error) error { // print flags flags, err := opt.ToMap() if err != nil { return err } common.PrintMap(flags, prefix, printFunc) // print flags-ignored common.PrintMap(opt.IgnoreOptions, fmt.Sprintf("%s-<%s>", prefix, UnreserveTip), printFunc) return nil }
info.go
package v1 import "github.com/Grarak/GoYTFetcher/miniserver" func
(_ string, client *miniserver.Client) miniserver.Response { return client.ResponseBody("Welcome to V1 API!") }
HandleInfoV1
Fish.tsx
import React from "react";
}; export default Fish;
const Fish = () => { return <div></div>;
WalletImport.tsx
import React from 'react'; import { Trans } from '@lingui/macro'; import { Typography, Container, Grid, } from '@material-ui/core'; // import { shuffle } from 'lodash'; import { useForm, useFieldArray } from 'react-hook-form'; import { useAddKeyMutation, useLogInMutation } from '@hddcoin/api-react'; import { ArrowBackIos as ArrowBackIosIcon } from '@material-ui/icons'; import { useHistory } from 'react-router'; import { Autocomplete, ButtonLoading, Form, Flex, Logo, useShowError } from '@hddcoin/core'; import LayoutHero from '../layout/LayoutHero'; import english from '../../util/english'; import useTrans from '../../hooks/useTrans'; /* const shuffledEnglish = shuffle(english); const test = new Array(24).fill('').map((item, index) => shuffledEnglish[index].word); */ const options = english.map((item) => item.word); type FormData = { mnemonic: string[]; }; export default function WalletImport() { const history = useHistory(); const [addKey, { isLoading: isAddKeyLoading }] = useAddKeyMutation(); const [logIn, { isLoading: isLogInLoading }] = useLogInMutation(); const trans = useTrans(); const showError = useShowError(); const isProcessing = isAddKeyLoading || isLogInLoading; const methods = useForm<FormData>({ defaultValues: { mnemonic: new Array(24).fill(''), }, }); const { fields } = useFieldArray({ control: methods.control, name: 'mnemonic', }); function handleBack() { history.push('/'); } async function handleSubmit(values: FormData) { if (isProcessing) { return; } const { mnemonic } = values; const hasEmptyWord = !!mnemonic.find((word) => !word); if (hasEmptyWord) { throw new Error(trans('Please fill all words')); } const fingerprint = await addKey({ mnemonic, type: 'new_wallet', }).unwrap(); await logIn({ fingerprint, }).unwrap(); history.push('/dashboard/wallets/1');
return ( <LayoutHero header={ <ArrowBackIosIcon onClick={handleBack} fontSize="large" color="secondary" /> } > <Form methods={methods} onSubmit={handleSubmit}> <Container maxWidth="lg"> <Flex flexDirection="column" gap={3} alignItems="center"> <Logo /> <Typography variant="h4" component="h1" gutterBottom> <Trans>Import Wallet from Mnemonics</Trans> </Typography> <Typography variant="subtitle1" align="center"> <Trans> Enter the 24 word mnemonic that you have saved in order to restore your HDDcoin wallet. </Trans> </Typography> <Grid container spacing={2}> {fields.map((field, index) => ( <Grid key={field.id} xs={2} item> <Autocomplete options={options} name={`mnemonic.${index}`} label={index + 1} autoFocus={index === 0} variant="filled" disableClearable /> </Grid> ))} </Grid> <Container maxWidth="xs"> <ButtonLoading type="submit" variant="contained" color="primary" loading={isProcessing} fullWidth > <Trans>Next</Trans> </ButtonLoading> </Container> </Flex> </Container> </Form> </LayoutHero> ); }
}
main.js
const RESET = document.getElementById('reset'); const START = document.getElementById('start'); const STOP = document.getElementById('stop'); const minutesViewer = document.getElementById('minutes'); const milisecondsViewer = document.getElementById('miliseconds'); const secondsViewer = document.getElementById('seconds'); let stop = false; let stopCounter = 0; let miliseconds = 0; let seconds = 0; let minutes = 0; let clicked = false; function startChronometer() { RESET.setAttribute('onclick', 'reset()'); STOP.setAttribute('onclick', 'stopChronometer()'); if(clicked == true) { START.removeAttribute('onclick'); } if(stop == false) { miliseconds += 1; milisecondsViewer.innerHTML = '0' + miliseconds.toString(); if(miliseconds > 9 ){ milisecondsViewer.innerHTML = miliseconds.toString(); if(miliseconds > 98) { milisecondsViewer.innerHTML = miliseconds.toString(); seconds += 1; miliseconds = 0; } } secondsViewer.innerHTML = '0' + seconds.toString() if(seconds > 9) { secondsViewer.innerHTML = seconds.toString(); } if(seconds > 59) { seconds = 0; minutes += 1; minutesViewer.innerHTML = '0' + minutes.toString(); if(minutes > 9) { minutesViewer.innerHTML = minutes.toString(); } } setTimeout(startChronometer, 10 * 1); } clicked = true; stop = false; stopCounter = 1; } function
() { stopCounter = 1; clicked = false; START.setAttribute('onclick', 'startChronometer()'); if(stopCounter == 1){ stop = true; } } function reset() { clicked = false; START.setAttribute('onclick', 'startChronometer()'); miliseconds = 0; seconds = 0; minutes = 0; stop = true; milisecondsViewer.innerHTML = '0' + miliseconds; secondsViewer.innerHTML = '0' + seconds; minutesViewer.innerHTML = '0' + minutes; }
stopChronometer
bitcoin_pt_BR.ts
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About ICOBID</source> <translation>Sobre o ICOBID</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;ICOBID&lt;/b&gt; version</source> <translation>&lt;b&gt;ICOBID&lt;/b&gt; versao</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The ICOBID developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation>⏎ Este é um software experimental.⏎ ⏎ Distribuido sob a licença de software MIT/X11, veja o arquivo anexo COPYING ou http://www.opensource.org/licenses/mit-license.php.⏎ ⏎ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software de criptografia escrito por Eric Young ([email protected]) e sofware UPnP escrito por Thomas Bernard.</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Livro de Endereços</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou a etiqueta</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência do sistema</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Novo Endereço</translation> </message> <message> <location line="-46"/> <source>These are your ICOBID addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Estes são os seus endereços ICOBID para receber pagamentos. Você pode dar um diferente a cada remetente para que você possa acompanhar quem está pagando.</translation> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostrar &amp;QR Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a ICOBID address</source> <translation>Assine a mensagem para provar que você possui um endereço ICOBID</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Excluir os endereços selecionados da lista</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified ICOBID address</source> <translation>Verifique a mensagem para garantir que ela foi assinada com um endereço ICOBID específico</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Excluir</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Etiqueta</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Exportar Dados do Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível escrever no arquivo %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Janela da Frase de Segurança</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Digite a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation>Serve para desativar o envio de dinheiro trivial quando conta do SO for comprometida. Não oferece segurança real.</translation> </message> <message> <location line="+3"/> <source>For staking only</source> <translation>Apenas para participação</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Digite a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Criptografar carteira</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para descriptografar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Descriptografar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Digite a frase de segurança antiga e nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar criptografia da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation>Aviso: Se você criptografar sua carteira e perder sua senha, você vai &lt;b&gt;PERDER TODAS AS SUAS MOEDAS&lt;/ b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem certeza de que deseja criptografar sua carteira?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Qualquer backup prévio que você tenha feito do seu arquivo wallet deve ser substituído pelo novo e encriptado arquivo wallet gerado. Por razões de segurança, qualquer backup do arquivo wallet não criptografado se tornará inútil assim que você começar a usar uma nova carteira criptografada.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Cuidado: A tecla Caps Lock está ligada!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Carteira criptografada</translation> </message> <message> <location line="-58"/> <source>ICOBID will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation>ICOBID vai fechar agora para concluir o processo de criptografia. Lembre-se que a criptografia de sua carteira não pode proteger totalmente suas moedas de serem roubados por malwares infectem seu computador.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A criptografia da carteira falhou</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A criptografia da carteira falhou devido a um erro interno. Sua carteira não estava criptografada.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>A frase de segurança fornecida não confere.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>A abertura da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança digitada para a descriptografia da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A descriptografia da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+280"/> <source>Sign &amp;message...</source> <translation>&amp;Assinar Mensagem...</translation> </message> <message> <location line="+242"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-308"/> <source>&amp;Overview</source> <translation>&amp;Visão geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>&amp;Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Edite a lista de endereços armazenados e rótulos</translation> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation>&amp;Receber moedas</translation> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostrar a lista de endereços para o recebimento de pagamentos</translation> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation>&amp;Enviar moedas</translation> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>S&amp;air</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about ICOBID</source> <translation>Mostrar informações sobre o ICOBID</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informações sobre o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Criptografar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Mudar frase de segurança...</translation> </message> <message numerus="yes"> <location line="+250"/> <source>~%n block(s) remaining</source> <translation><numerusform>~%n bloco faltando</numerusform><numerusform>~%n blocos faltando</numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation>Baixados %1 de %2 blocos de histórico de transações (%3% completo).</translation> </message> <message> <location line="-247"/> <source>&amp;Export...</source> <translation>&amp;Exportar...</translation> </message> <message> <location line="-62"/> <source>Send coins to a ICOBID address</source> <translation>Enviar moedas para um endereço ICOBID</translation> </message> <message> <location line="+45"/> <source>Modify configuration options for ICOBID</source> <translation>Modificar opções de configuração para ICOBID</translation> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados da guia atual para um arquivo</translation> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation>Cryptografar ou Decryptografar carteira</translation> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Fazer cópia de segurança da carteira para uma outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na criptografia da carteira</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>Janela de &amp;Depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir console de depuração e diagnóstico</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-200"/> <source>ICOBID</source> <translation>ICOBID</translation> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+178"/> <source>&amp;About ICOBID</source> <translation>Sobre o ICOBID</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Exibir/Ocultar</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation>&amp;Bloquear Carteira</translation> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation>Bloquear Carteira</translation> </message> <message> <location line="+34"/> <source>&amp;File</source> <translation>&amp;Arquivo</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Configurações</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Ajuda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de ferramentas</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>ICOBID client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to ICOBID network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-284"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+288"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Recuperando o atraso ...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantidade: %2 Tipo: %3 Endereço: %4</translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid ICOBID address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. ICOBID can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation>não</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>trocar</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(de)selecionar tudo</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Modo árvore</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmações</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prioridade</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>mais alta possível</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>alta</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>média-alta</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>média</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>média-baixa</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>baixa</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>a mais baixa possível</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>sim</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>troco de %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(troco)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Endereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Novo endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de envio</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de envio</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço digitado &quot;%1&quot; já se encontra no catálogo de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid ICOBID address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Não foi possível destravar a carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>A geração de nova chave falhou.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>ICOBID-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar taxa de &amp;transação</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start ICOBID after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start ICOBID on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the ICOBID client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the ICOBID network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do serviço de proxy (ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão do SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Mostrar apenas um ícone na bandeja ao minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja em vez da barra de tarefas.</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimizar em vez de sair do aplicativo quando a janela for fechada. Quando esta opção é escolhida, o aplicativo só será fechado selecionando Sair no menu Arquivo.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao sair</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Mostrar</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Língua da interface com usuário:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting ICOBID.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade usada para mostrar quantidades:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a unidade padrão de subdivisão para interface mostrar quando enviar bitcoins.</translation> </message> <message> <location line="+9"/> <source>Whether to show ICOBID addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation>Mostrar ou não opções de controle da moeda.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting ICOBID.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço proxy fornecido é inválido.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the ICOBID network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Seu saldo atual spendable</translation> </message> <message> <location line="+71"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Saldo minerado que ainda não maturou</translation> </message> <message> <location line="+20"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Seu saldo total atual</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando OpenSSL versão</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Horário de inicialização</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de conexões</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Corrente de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Quantidade atual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Horário do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the ICOBID-Qt help message to get a list with possible ICOBID command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data do &apos;build&apos;</translation> </message> <message> <location line="-104"/> <source>ICOBID - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>ICOBID Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Arquivo de log de Depuração</translation> </message> <message> <location line="+7"/> <source>Open the ICOBID debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the ICOBID RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar pelo histórico, e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar a tela.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para uma visão geral dos comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar dinheiro</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Opções de Controle da Moeda</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>automaticamente selecionado</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Saldo insuficiente!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Enviar para vários destinatários de uma só vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+16"/> <source>123.456 BC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmar o envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a ICOBID address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmar envio de dinheiro</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço do destinatário não é válido, favor verificar.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantidade a ser paga precisa ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantidade excede seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede seu saldo quando uma taxa de transação de %1 é incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado: pode-se enviar para cada endereço apenas uma vez por transação.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid ICOBID address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Q&amp;uantidade:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Pagar &amp;Para:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Digite uma etiqueta para este endereço para adicioná-lo ao catálogo de endereços</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a ICOBID address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma mensagem</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Assinar Mensagem</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Você pode assinar mensagens com seus endereços para provar que você é o dono deles. Seja cuidadoso para não assinar algo vago, pois ataques de pishing podem tentar te enganar para dar sua assinatura de identidade para eles. Apenas assine afirmações completamente detalhadas com as quais você concorda.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Entre a mensagem que você quer assinar aqui</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura para a área de transferência do sistema</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this ICOBID address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo &quot;man-in-the-middle&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified ICOBID address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a ICOBID address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique em &quot;Assinar Mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter ICOBID signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço fornecido é inválido.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor, verifique o endereço e tente novamente.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço fornecido não se refere a uma chave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Destravamento da Carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço fornecido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pode ser decodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor, verifique a assinatura e tente novamente.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não corresponde ao &quot;resumo da mensagem&quot;.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation>em conflito</translation> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmadas</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, difundir atráves de %n nó</numerusform><numerusform>, difundir atráves de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fonte</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerados</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>seu próprio endereço</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etiqueta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura em mais %n bloco</numerusform><numerusform>matura em mais %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceito</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 20 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source>
</message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi propagada na rede com sucesso.</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Este painel mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmações)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para mais %n bloco</numerusform><numerusform>Abrir para mais %n blocos</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation>Offline</translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation>Não confirmado</translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Confirmando (%1 de %2 confirmações recomendadas)</translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation>Conflitou</translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>Recém-criado (%1 confirmações, disponível somente após %2)</translation> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por nenhum outro participante da rede e provavelmente não será aceito!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceito</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento para você mesmo</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status da transação. Passe o mouse sobre este campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora em que a transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantidade debitada ou creditada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Todos</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalo...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para você mesmo</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outro</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Procure um endereço ou etiqueta</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantidade mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalo: </translation> </message> <message> <location line="+8"/> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>ICOBID version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or icobidd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Lista de comandos</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Obtenha ajuda sobre um comando</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: icobid.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: icobidd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Especifique o arquivo da carteira (dentro do diretório de dados)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar diretório de dados</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho do cache do banco de dados em megabytes (padrão: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 8559 or testnet: 18559)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; conexões aos peers (padrão: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a um nó para receber endereços de participantes, e desconectar.</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Especificar seu próprio endereço público</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limite para desconectar peers mal comportados (padrão: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos para impedir que peers mal comportados reconectem (padrão: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8560 or testnet: 18560)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar linha de comando e comandos JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Rodar em segundo plano como serviço e aceitar comandos</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Usar rede de teste</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar conexões externas (padrão: 1 se opções -proxy ou -connect não estiverem presentes)</translation> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv6, voltando ao IPv4: %s</translation> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Cuidado: valor de -paytxfee escolhido é muito alto! Este é o valor da taxa de transação que você irá pagar se enviar a transação.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong ICOBID will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Cuidado: erro ao ler arquivo wallet.dat! Todas as chaves foram lidas corretamente, mas dados transações e do catálogo de endereços podem estar faltando ou estar incorretas.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Aviso: wallet.dat corrompido, dados recuperados! Arquivo wallet.dat original salvo como wallet.{timestamp}.bak em %s; se seu saldo ou transações estiverem incorretos, você deve restauras o backup.</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um arquivo wallet.dat corrompido</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Opções de criação de blocos:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Conectar apenas a nó(s) específico(s)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir os próprios endereços IP (padrão: 1 quando no modo listening e opção -externalip não estiver presente)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falha ao escutar em qualquer porta. Use -listen=0 se você quiser isso.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Buffer máximo de recebimento por conexão, &lt;n&gt;*1000 bytes (padrão: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Buffer máximo de envio por conexão, &lt;n&gt;*1000 bytes (padrão: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas conectar em nós na rede &lt;net&gt; (IPv4, IPv6, ou Tor)</translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (veja a Wiki do Bitcoin para instruções de configuração SSL)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Mandar informação de trace/debug para o console em vez de para o arquivo debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Determinar tamanho mínimo de bloco em bytes (padrão: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher arquivo debug.log ao iniciar o cliente (padrão 1 se opção -debug não estiver presente)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especifique o tempo limite (timeout) da conexão em milissegundos (padrão: 5000) </translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 1 quando estiver escutando)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Nome de usuário para conexões JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Cuidado: Esta versão está obsoleta, atualização exigida!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompido, recuperação falhou</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Senha para conexões JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=icobidrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;ICOBID Alert&quot; [email protected] </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexões JSON-RPC de endereços IP específicos</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando para nó rodando em &lt;ip&gt; (pardão: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando o melhor bloco mudar (%s no comando será substituído pelo hash do bloco)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma transação da carteira mudar (%s no comando será substituído por TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Atualizar carteira para o formato mais recente</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Determinar tamanho do pool de endereços para &lt;n&gt; (padrão: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Re-escanear blocos procurando por transações perdidas da carteira</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para conexões JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Arquivo de certificado do servidor (padrão: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (padrão: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. ICOBID is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>ICOBID</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossível vincular a %s neste computador (bind retornou erro %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir consultas DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Carregando endereços...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira corrompida</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of ICOBID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart ICOBID to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida do proxy -socks requisitada: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossível encontrar o endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossível encontrar endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantidade inválida para -paytxfee=&lt;quantidade&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Quantidade inválida</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Saldo insuficiente</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Carregando índice de blocos...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicionar um nó com o qual se conectar e tentar manter a conexão ativa</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. ICOBID is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Carregando carteira...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Não é possível fazer downgrade da carteira</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Não foi possível escrever no endereço padrão</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Re-escaneando...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Carregamento terminado</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Você precisa especificar rpcpassword=&lt;senha&gt; no arquivo de configurações:⏎ %s⏎ Se o arquivo não existir, crie um com permissão de leitura apenas pelo dono</translation> </message> </context> </TS>
<translation>falso</translation>
icon_check_box.rs
pub struct IconCheckBox { props: crate::Props, } impl yew::Component for IconCheckBox { type Properties = crate::Props; type Message = (); fn create(props: Self::Properties, _: yew::prelude::ComponentLink<Self>) -> Self { Self { props } } fn update(&mut self, _: Self::Message) -> yew::prelude::ShouldRender
fn change(&mut self, _: Self::Properties) -> yew::prelude::ShouldRender { false } fn view(&self) -> yew::prelude::Html { yew::prelude::html! { <svg class=self.props.class.unwrap_or("") width=self.props.size.unwrap_or(24).to_string() height=self.props.size.unwrap_or(24).to_string() viewBox="0 0 24 24" fill=self.props.fill.unwrap_or("none") stroke=self.props.color.unwrap_or("currentColor") stroke-width=self.props.stroke_width.unwrap_or(2).to_string() stroke-linecap=self.props.stroke_linecap.unwrap_or("round") stroke-linejoin=self.props.stroke_linejoin.unwrap_or("round") > <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8.29 13.29c-.39.39-1.02.39-1.41 0L5.71 12.7c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0L10 14.17l6.88-6.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-7.58 7.59z"/></svg> </svg> } } }
{ true }