file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
page_frontmatter.go
// Copyright 2018 The Hugo 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 pagemeta import ( "strings" "time" "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/config" "github.com/spf13/cast" ) // FrontMatterHandler maps front matter into Page fields and .Params. // Note that we currently have only extracted the date logic. type FrontMatterHandler struct { fmConfig frontmatterConfig dateHandler frontMatterFieldHandler lastModHandler frontMatterFieldHandler publishDateHandler frontMatterFieldHandler expiryDateHandler frontMatterFieldHandler // A map of all date keys configured, including any custom. allDateKeys map[string]bool logger *loggers.Logger } // FrontMatterDescriptor describes how to handle front matter for a given Page. // It has pointers to values in the receiving page which gets updated. type FrontMatterDescriptor struct { // This the Page's front matter. Frontmatter map[string]interface{} // This is the Page's base filename (BaseFilename), e.g. page.md., or // if page is a leaf bundle, the bundle folder name (ContentBaseName). BaseFilename string // The content file's mod time. ModTime time.Time // May be set from the author date in Git. GitAuthorDate time.Time // The below are pointers to values on Page and will be modified. // This is the Page's params. Params map[string]interface{} // This is the Page's dates. Dates *PageDates // This is the Page's Slug etc. PageURLs *URLPath } var ( dateFieldAliases = map[string][]string{ fmDate: []string{}, fmLastmod: []string{"modified"}, fmPubDate: []string{"pubdate", "published"}, fmExpiryDate: []string{"unpublishdate"}, } ) // HandleDates updates all the dates given the current configuration and the // supplied front matter params. Note that this requires all lower-case keys // in the params map. func (f FrontMatterHandler) HandleDates(d *FrontMatterDescriptor) error { if d.Dates == nil { panic("missing dates") } if f.dateHandler == nil { panic("missing date handler") } if _, err := f.dateHandler(d); err != nil { return err } if _, err := f.lastModHandler(d); err != nil { return err } if _, err := f.publishDateHandler(d); err != nil { return err } if _, err := f.expiryDateHandler(d); err != nil { return err } return nil } // IsDateKey returns whether the given front matter key is considered a date by the current // configuration. func (f FrontMatterHandler) IsDateKey(key string) bool { return f.allDateKeys[key] } // A Zero date is a signal that the name can not be parsed. // This follows the format as outlined in Jekyll, https://jekyllrb.com/docs/posts/: // "Where YEAR is a four-digit number, MONTH and DAY are both two-digit numbers" func dateAndSlugFromBaseFilename(name string) (time.Time, string) { withoutExt, _ := helpers.FileAndExt(name) if len(withoutExt) < 10 { // This can not be a date. return time.Time{}, "" } // Note: Hugo currently have no custom timezone support. // We will have to revisit this when that is in place. d, err := time.Parse("2006-01-02", withoutExt[:10]) if err != nil { return time.Time{}, "" } // Be a little lenient with the format here. slug := strings.Trim(withoutExt[10:], " -_") return d, slug } type frontMatterFieldHandler func(d *FrontMatterDescriptor) (bool, error) func (f FrontMatterHandler) newChainedFrontMatterFieldHandler(handlers ...frontMatterFieldHandler) frontMatterFieldHandler { return func(d *FrontMatterDescriptor) (bool, error) { for _, h := range handlers { // First successful handler wins. success, err := h(d) if err != nil { f.logger.ERROR.Println(err) } else if success { return true, nil } } return false, nil } } type frontmatterConfig struct { date []string lastmod []string publishDate []string expiryDate []string } const ( // These are all the date handler identifiers // All identifiers not starting with a ":" maps to a front matter parameter. fmDate = "date" fmPubDate = "publishdate" fmLastmod = "lastmod" fmExpiryDate = "expirydate" // Gets date from filename, e.g 218-02-22-mypage.md fmFilename = ":filename" // Gets date from file OS mod time. fmModTime = ":filemodtime" // Gets date from Git fmGitAuthorDate = ":git" ) // This is the config you get when doing nothing. func newDefaultFrontmatterConfig() frontmatterConfig { return frontmatterConfig{ date: []string{fmDate, fmPubDate, fmLastmod}, lastmod: []string{fmGitAuthorDate, fmLastmod, fmDate, fmPubDate}, publishDate: []string{fmPubDate, fmDate}, expiryDate: []string{fmExpiryDate}, } } func newFrontmatterConfig(cfg config.Provider) (frontmatterConfig, error) { c := newDefaultFrontmatterConfig() defaultConfig := c if cfg.IsSet("frontmatter") { fm := cfg.GetStringMap("frontmatter") for k, v := range fm { loki := strings.ToLower(k) switch loki { case fmDate: c.date = toLowerSlice(v) case fmPubDate: c.publishDate = toLowerSlice(v) case fmLastmod: c.lastmod = toLowerSlice(v) case fmExpiryDate: c.expiryDate = toLowerSlice(v) } } } expander := func(c, d []string) []string { out := expandDefaultValues(c, d) out = addDateFieldAliases(out) return out } c.date = expander(c.date, defaultConfig.date) c.publishDate = expander(c.publishDate, defaultConfig.publishDate) c.lastmod = expander(c.lastmod, defaultConfig.lastmod) c.expiryDate = expander(c.expiryDate, defaultConfig.expiryDate) return c, nil } func addDateFieldAliases(values []string) []string { var complete []string for _, v := range values { complete = append(complete, v) if aliases, found := dateFieldAliases[v]; found { complete = append(complete, aliases...) } } return helpers.UniqueStrings(complete) } func expandDefaultValues(values []string, defaults []string) []string { var out []string for _, v := range values { if v == ":default" { out = append(out, defaults...) } else { out = append(out, v) } } return out } func toLowerSlice(in interface{}) []string { out := cast.ToStringSlice(in) for i := 0; i < len(out); i++ { out[i] = strings.ToLower(out[i]) } return out } // NewFrontmatterHandler creates a new FrontMatterHandler with the given logger and configuration. // If no logger is provided, one will be created. func NewFrontmatterHandler(logger *loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) { if logger == nil { logger = loggers.NewWarningLogger() } frontMatterConfig, err := newFrontmatterConfig(cfg) if err != nil { return FrontMatterHandler{}, err } allDateKeys := make(map[string]bool) addKeys := func(vals []string) { for _, k := range vals { if !strings.HasPrefix(k, ":")
} } addKeys(frontMatterConfig.date) addKeys(frontMatterConfig.expiryDate) addKeys(frontMatterConfig.lastmod) addKeys(frontMatterConfig.publishDate) f := FrontMatterHandler{logger: logger, fmConfig: frontMatterConfig, allDateKeys: allDateKeys} if err := f.createHandlers(); err != nil { return f, err } return f, nil } func (f *FrontMatterHandler) createHandlers() error { var err error if f.dateHandler, err = f.createDateHandler(f.fmConfig.date, func(d *FrontMatterDescriptor, t time.Time) { d.Dates.Date = t setParamIfNotSet(fmDate, t, d) }); err != nil { return err } if f.lastModHandler, err = f.createDateHandler(f.fmConfig.lastmod, func(d *FrontMatterDescriptor, t time.Time) { setParamIfNotSet(fmLastmod, t, d) d.Dates.Lastmod = t }); err != nil { return err } if f.publishDateHandler, err = f.createDateHandler(f.fmConfig.publishDate, func(d *FrontMatterDescriptor, t time.Time) { setParamIfNotSet(fmPubDate, t, d) d.Dates.PublishDate = t }); err != nil { return err } if f.expiryDateHandler, err = f.createDateHandler(f.fmConfig.expiryDate, func(d *FrontMatterDescriptor, t time.Time) { setParamIfNotSet(fmExpiryDate, t, d) d.Dates.ExpiryDate = t }); err != nil { return err } return nil } func setParamIfNotSet(key string, value interface{}, d *FrontMatterDescriptor) { if _, found := d.Params[key]; found { return } d.Params[key] = value } func (f FrontMatterHandler) createDateHandler(identifiers []string, setter func(d *FrontMatterDescriptor, t time.Time)) (frontMatterFieldHandler, error) { var h *frontmatterFieldHandlers var handlers []frontMatterFieldHandler for _, identifier := range identifiers { switch identifier { case fmFilename: handlers = append(handlers, h.newDateFilenameHandler(setter)) case fmModTime: handlers = append(handlers, h.newDateModTimeHandler(setter)) case fmGitAuthorDate: handlers = append(handlers, h.newDateGitAuthorDateHandler(setter)) default: handlers = append(handlers, h.newDateFieldHandler(identifier, setter)) } } return f.newChainedFrontMatterFieldHandler(handlers...), nil } type frontmatterFieldHandlers int func (f *frontmatterFieldHandlers) newDateFieldHandler(key string, setter func(d *FrontMatterDescriptor, t time.Time)) frontMatterFieldHandler { return func(d *FrontMatterDescriptor) (bool, error) { v, found := d.Frontmatter[key] if !found { return false, nil } date, err := cast.ToTimeE(v) if err != nil { return false, nil } // We map several date keys to one, so, for example, // "expirydate", "unpublishdate" will all set .ExpiryDate (first found). setter(d, date) // This is the params key as set in front matter. d.Params[key] = date return true, nil } } func (f *frontmatterFieldHandlers) newDateFilenameHandler(setter func(d *FrontMatterDescriptor, t time.Time)) frontMatterFieldHandler { return func(d *FrontMatterDescriptor) (bool, error) { date, slug := dateAndSlugFromBaseFilename(d.BaseFilename) if date.IsZero() { return false, nil } setter(d, date) if _, found := d.Frontmatter["slug"]; !found { // Use slug from filename d.PageURLs.Slug = slug } return true, nil } } func (f *frontmatterFieldHandlers) newDateModTimeHandler(setter func(d *FrontMatterDescriptor, t time.Time)) frontMatterFieldHandler { return func(d *FrontMatterDescriptor) (bool, error) { if d.ModTime.IsZero() { return false, nil } setter(d, d.ModTime) return true, nil } } func (f *frontmatterFieldHandlers) newDateGitAuthorDateHandler(setter func(d *FrontMatterDescriptor, t time.Time)) frontMatterFieldHandler { return func(d *FrontMatterDescriptor) (bool, error) { if d.GitAuthorDate.IsZero() { return false, nil } setter(d, d.GitAuthorDate) return true, nil } }
{ allDateKeys[k] = true }
plot_data.rs
use chrono::prelude::*; use core::option::Option; use core::option::Option::{None, Some}; use core::time::Duration; use itertools::Itertools; use tui::style::Style; use tui::symbols; use tui::widgets::{Dataset, GraphType, Paragraph}; pub struct PlotData { pub display: String, pub data: Vec<(f64, f64)>, pub style: Style, buffer: chrono::Duration, simple_graphics: bool, } impl PlotData { pub fn new(display: String, buffer: u64, style: Style, simple_graphics: bool) -> PlotData
pub fn update(&mut self, item: Option<Duration>) { let now = Local::now(); let idx = now.timestamp_millis() as f64 / 1_000f64; match item { Some(dur) => self.data.push((idx, dur.as_micros() as f64)), None => (), // self.data.push((idx, f64::NAN)), } // Find the last index that we should remove. let earliest_timestamp = (now - self.buffer).timestamp_millis() as f64 / 1_000f64; let last_idx = self .data .iter() .enumerate() .filter(|(_, (timestamp, _))| *timestamp < earliest_timestamp) .map(|(idx, _)| idx) .last(); if let Some(idx) = last_idx { self.data.drain(0..idx).for_each(drop) } } pub fn header_stats(&self) -> Vec<Paragraph> { let ping_header = Paragraph::new(self.display.clone()).style(self.style); let items: Vec<&f64> = self .data .iter() .filter(|(_, x)| !x.is_nan()) .sorted_by(|(_, a), (_, b)| a.partial_cmp(b).unwrap()) .map(|(_, v)| v) .collect(); if items.is_empty() { return vec![ping_header]; } let min = **items.first().unwrap(); let max = **items.last().unwrap(); let percentile_position = 0.95 * items.len() as f32; let rounded_position = percentile_position.round() as usize; let p95 = items.get(rounded_position).map(|i| **i).unwrap_or(0f64); // count timeouts let to = self.data.iter().filter(|(_, x)| x.is_nan()).count(); vec![ ping_header, Paragraph::new(format!("min {:?}", Duration::from_micros(min as u64))) .style(self.style), Paragraph::new(format!("max {:?}", Duration::from_micros(max as u64))) .style(self.style), Paragraph::new(format!("p95 {:?}", Duration::from_micros(p95 as u64))) .style(self.style), Paragraph::new(format!("timeout# {:?}", to)).style(self.style), ] } } impl<'a> Into<Dataset<'a>> for &'a PlotData { fn into(self) -> Dataset<'a> { let slice = self.data.as_slice(); Dataset::default() .marker(if self.simple_graphics { symbols::Marker::Dot } else { symbols::Marker::Braille }) .style(self.style) .graph_type(GraphType::Line) .data(slice) // .x_axis_bounds([self.window_min, self.window_max]) } }
{ PlotData { display, data: Vec::with_capacity(150), // ringbuffer::FixedRingBuffer::new(capacity), style, buffer: chrono::Duration::seconds(buffer as i64), simple_graphics, } }
sripe.py
import os from api.exceptions import StripeException from api.payment import PaymentInterface from api.request import Request from transaction.models import Transaction import stripe class StripePayment(Request, PaymentInterface): ''' Stripe payment method class ''' def __init__(self): url = os.getenv("STRIPE_API_URL") super(StripePayment, self).__init__(base=url) # Stripe does not accept application/json content-type self.headers['Content-Type'] = 'application/x-www-form-urlencoded' def pay(self, payload): user = payload.get("user") amount = payload.get("amount") title = payload.get("title") logo = payload.get('logo') description = payload.get("description") redirect_url = payload.get("redirect_url") currency = payload.get('currency') api_key = payload.get('api_key') # stripe stores amount in lower currency (kobo, cent) amount = int(round(amount*100)) # set up stripe api_key stripe.api_key = api_key # create new session for payment response = stripe.checkout.Session.create( # Customer Email is optional, # It is not safe to accept email directly from the client side customer_email=user.email, payment_method_types=['card'], line_items=[ { 'price_data': { 'product_data': { 'name': title, 'logo': logo, 'description': description }, 'currency': currency, 'unit_amount': str(amount), }, 'quantity': 1, } ], mode='payment', success_url=redirect_url, cancel_url=f'{redirect_url}/cancel', ) res = { "hosted_url": response.url, "code": response.id, "expires_at": response.expires_at } return res def verify(self, payload):
user = payload.get("user") api_key = payload.get('api_key') transaction_id = payload.get("transaction_id") method = payload.get("method") stripe.api_key = api_key try: if transaction_id: # retrieve session to confirm if it passed or failed. # using the transaction id response = stripe.checkout.Session.retrieve(transaction_id) tran = Transaction.objects.filter( user=user).filter(transaction_id=transaction_id) payment_stat = response.payment_status if payment_stat == 'paid': stats = 'success' else: stats = 'failed' if not tran: transaction = { 'amount': response.amount_total, 'transaction_id': transaction_id, 'transaction_ref': response.id, 'platform': method, 'user': user, 'status': payment_stat, 'payment_type': response.payment_method_types[0] } transact = Transaction.objects.create(**transaction) transact.save() return { 'status': stats, 'response': response } raise ValueError({"message": "Transaction id is required"}) except Exception as e: raise StripeException(str(e))
Point.ts
import { AbsolutePosition } from '@openhps/core'; import { Geometry } from './Geometry';
type?: "Point"; coordinates: AbsolutePosition; }
export interface Point extends Geometry {
prev-next_test.go
// ORIGINAL: javatest/PagingLinksFinderTest.java // Copyright (c) 2020 Markus Mobius // // 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. // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package pagination_test import ( nurl "net/url" "strings" "testing" "github.com/go-shiori/dom" "github.com/markusmobius/go-domdistiller/internal/pagination" "github.com/markusmobius/go-domdistiller/internal/stringutil" "github.com/markusmobius/go-domdistiller/internal/testutil" "github.com/stretchr/testify/assert" "golang.org/x/net/html" ) const ExampleURL = "http://example.com/path/toward/news.php" // There are some tests in original dom-distiller that not reproduced here // because the structure of our code a bit different : // - Test_Pagination_PrevNext_BaseTag func Test_Pagination_PrevNext_NoLink(t *testing.T) { doc := testutil.CreateHTML() assertDefaultDocumenOutlink(t, doc, nil, nil) } func Test_Pagination_PrevNext_1NextLink(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("next", "next page") dom.AppendChild(root, anchor) assertDefaultDocumenOutlink(t, doc, nil, nil) } func Test_Pagination_PrevNext_1NextLinkWithDifferentDomain(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("http://testing.com/page2", "next page") dom.AppendChild(root, anchor) assertDefaultDocumenOutlink(t, doc, nil, nil) } func Test_Pagination_PrevNext_1NextLinkWithOriginalDomain(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("http://testing.com/page2", "next page") dom.AppendChild(root, anchor) assertDocumentOutlink(t, "http://testing.com", doc, nil, anchor) } func Test_Pagination_PrevNext_CaseInsensitive(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("HTTP://testing.COM/page2", "next page") dom.AppendChild(root, anchor) assertDocumentOutlink(t, "http://testing.com", doc, nil, anchor) } func Test_Pagination_PrevNext_1PageNumberedLink(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("page2", "page 2") dom.AppendChild(root, anchor) // The word "page" in the link text increases its score confidently enough to // be considered as the previous paging link. assertDefaultDocumenOutlink(t, doc, anchor, anchor) } func Test_Pagination_PrevNext_3NumberedLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor1 := testutil.CreateAnchor("page1", "1") anchor2 := testutil.CreateAnchor("page2", "2") anchor3 := testutil.CreateAnchor("page3", "3") dom.AppendChild(root, anchor1) dom.AppendChild(root, anchor2) dom.AppendChild(root, anchor3) // Because link text contains only digits with no paging-related words, no link // has a score high enough to be confidently considered paging link. assertDefaultDocumenOutlink(t, doc, nil, nil) } func
(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor1 := testutil.CreateAnchor("page2", "dummy link") anchor2 := testutil.CreateAnchor("page2", "next page") dom.AppendChild(root, anchor1) assertDefaultDocumenOutlink(t, doc, nil, nil) // anchor1 is not a confident next page link, but anchor2 is due to the link text. dom.AppendChild(root, anchor2) assertDefaultDocumenOutlink(t, doc, nil, anchor1) } func Test_Pagination_PrevNext_PagingParent(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) div := testutil.CreateDiv(1) dom.SetAttribute(div, "class", "page") dom.AppendChild(root, div) anchor := testutil.CreateAnchor("page1", "dummy link") dom.AppendChild(div, anchor) // While it may seem strange that both previous and next links are the same, this test // is testing that the anchor's parents will affect its paging score even if it has a // meaningless link text like "dummy link". assertDefaultDocumenOutlink(t, doc, anchor, anchor) } func Test_Pagination_PrevNext_1PrevLink(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("prev", "prev page") dom.AppendChild(root, anchor) assertDefaultDocumenOutlink(t, doc, anchor, nil) } func Test_Pagination_PrevNext_PrevAnd1NextLink(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) prevAnchor := testutil.CreateAnchor("prev", "prev page") nextAnchor := testutil.CreateAnchor("page2", "next page") dom.AppendChild(root, prevAnchor) dom.AppendChild(root, nextAnchor) assertDefaultDocumenOutlink(t, doc, prevAnchor, nextAnchor) } func Test_Pagination_PrevNext_PopularBadLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) nextAnchor := testutil.CreateAnchor("page2", "next page") dom.AppendChild(root, nextAnchor) // If the same bad URL can get scores accumulated across links, // it would wrongly get selected. bad1 := testutil.CreateAnchor("not-page1", "not") bad2 := testutil.CreateAnchor("not-page1", "not") bad3 := testutil.CreateAnchor("not-page1", "not") bad4 := testutil.CreateAnchor("not-page1", "not") bad5 := testutil.CreateAnchor("not-page1", "not") dom.AppendChild(root, bad1) dom.AppendChild(root, bad2) dom.AppendChild(root, bad3) dom.AppendChild(root, bad4) dom.AppendChild(root, bad5) assertDefaultDocumenOutlink(t, doc, nil, nextAnchor) } func Test_Pagination_PrevNext_HeldBackLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) nextAnchor := testutil.CreateAnchor("page2", "next page") dom.AppendChild(root, nextAnchor) // If "page2" gets bad scores from other links, it would be missed. bad := testutil.CreateAnchor("page2", "prev or next") dom.AppendChild(root, bad) assertDefaultDocumenOutlink(t, doc, nil, nextAnchor) } func Test_Pagination_PrevNext_FirstPageLinkAsFolderURL(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) // Some sites' first page links are the same as the folder URL, // previous page link needs to recognize this. href := ExampleURL[:strings.LastIndex(ExampleURL, "/")] anchor := testutil.CreateAnchor(href, "PREV") dom.AppendChild(root, anchor) assertDefaultDocumenOutlink(t, doc, anchor, nil) } func Test_Pagination_PrevNext_NonHttpOrHttpsLink(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("javascript:void(0)", "next") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) dom.SetAttribute(anchor, "href", "file://test.html") assertDefaultDocumentNextLink(t, doc, nil) } func Test_Pagination_PrevNext_NextArticleLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor1 := testutil.CreateAnchor("page2", "next article") dom.AppendChild(root, anchor1) assertDefaultDocumentNextLink(t, doc, nil) // The banned word "article" also affects anchor2 because it has the same href as anchor anchor2 := testutil.CreateAnchor("page2", "next page") dom.AppendChild(root, anchor2) assertDefaultDocumentNextLink(t, doc, nil) // Removing the banned word revives the link dom.SetInnerHTML(anchor1, "next thing") assertDefaultDocumenOutlink(t, doc, nil, anchor1) } func Test_Pagination_PrevNext_NextChineseArticleLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.SetAttribute(root, "class", "page") dom.AppendChild(body, root) anchor := testutil.CreateAnchor("page2", "下一篇") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) dom.SetInnerHTML(anchor, "下一頁") assertDefaultDocumenOutlink(t, doc, anchor, anchor) } func Test_Pagination_PrevNext_NextPostLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("page2", "next post") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) } func Test_Pagination_PrevNext_AsOneLinks(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor("page2", "view as one page") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) dom.SetInnerHTML(anchor, "next") assertDefaultDocumenOutlink(t, doc, nil, anchor) } func Test_Pagination_PrevNext_LinksWithLongText(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor(ExampleURL+"/page2", "page 2 with long text") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) } func Test_Pagination_PrevNext_NonTailPageInfo(t *testing.T) { doc := testutil.CreateHTML() body := dom.QuerySelector(doc, "body") root := testutil.CreateDiv(0) dom.AppendChild(body, root) anchor := testutil.CreateAnchor(ExampleURL+"/gap/12/somestuff", "page down") dom.AppendChild(root, anchor) assertDefaultDocumentNextLink(t, doc, nil) } func assertDefaultDocumenOutlink(t *testing.T, doc *html.Node, prevAnchor, nextAnchor *html.Node) { assertDocumentOutlink(t, ExampleURL, doc, prevAnchor, nextAnchor) } func assertDocumentOutlink(t *testing.T, pageURL string, doc *html.Node, prevAnchor, nextAnchor *html.Node) { url, err := nurl.ParseRequestURI(pageURL) assert.NoError(t, err) assert.NotNil(t, url) prevHref := pagination.NewPrevNextFinder(nil).FindOutlink(doc, url, false) if prevAnchor == nil { assert.Equal(t, "", prevHref) } else { linkHref := dom.GetAttribute(prevAnchor, "href") linkHref = normalizeLinkHref(linkHref, url) assert.Equal(t, linkHref, prevHref) } nextHref := pagination.NewPrevNextFinder(nil).FindOutlink(doc, url, true) if nextAnchor == nil { assert.Equal(t, "", nextHref) } else { linkHref := dom.GetAttribute(nextAnchor, "href") linkHref = normalizeLinkHref(linkHref, url) assert.Equal(t, linkHref, nextHref) } } func assertDefaultDocumentNextLink(t *testing.T, doc *html.Node, anchor *html.Node) { assertDocumentNextLink(t, ExampleURL, doc, anchor) } func assertDocumentNextLink(t *testing.T, pageURL string, doc *html.Node, anchor *html.Node) { url, err := nurl.ParseRequestURI(pageURL) assert.NoError(t, err) assert.NotNil(t, url) nextHref := pagination.NewPrevNextFinder(nil).FindOutlink(doc, url, true) if anchor == nil { assert.Equal(t, "", nextHref) } else { linkHref := dom.GetAttribute(anchor, "href") linkHref = normalizeLinkHref(linkHref, url) assert.Equal(t, linkHref, nextHref) } } func normalizeLinkHref(linkHref string, pageURL *nurl.URL) string { // Try to convert relative URL in link href to absolute URL linkHref = stringutil.CreateAbsoluteURL(linkHref, pageURL) // Make sure the link href is absolute _, err := nurl.ParseRequestURI(linkHref) if err != nil { return linkHref } // Remove url anchor and then trailing '/' from link's href. tmp, _ := nurl.Parse(linkHref) tmp.RawQuery = "" tmp.Fragment = "" tmp.RawFragment = "" tmp.Path = strings.TrimSuffix(tmp.Path, "/") tmp.RawPath = tmp.Path return stringutil.UnescapedString(tmp) }
Test_Pagination_PrevNext_2NextLinksWithSameHref
colors.ts
export type SurfaceStyle = { strokeColor: string fillColor: string } const surfaceStyleA: SurfaceStyle = { strokeColor: '#5a8055', fillColor: '#1b4d30' } const surfaceStyleB: SurfaceStyle = { strokeColor: '#5a8055', fillColor: '#00a040' } const surfaceStyleC: SurfaceStyle = { strokeColor: '#5a8055', fillColor: '#c5e2c6' } export function
(seriesLength: number) { switch (seriesLength) { case 1: return [surfaceStyleB] case 2: return [surfaceStyleA, surfaceStyleC] default: return [ surfaceStyleA, surfaceStyleB, surfaceStyleC, surfaceStyleC, surfaceStyleC, surfaceStyleC, surfaceStyleC ] } }
getGraphSeriesStyle
bar.js
// @flow import {Foo} from './foo';
foo.foo();
const foo: Foo = new Foo();
zz_generated_constants.go
//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armcontainerregistry const ( moduleName = "armcontainerregistry" moduleVersion = "v0.6.0" ) // Action - The action of IP ACL rule. type Action string const ( ActionAllow Action = "Allow" ) // PossibleActionValues returns the possible values for the Action const type. func PossibleActionValues() []Action { return []Action{ ActionAllow, } } // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. type ActionsRequired string const ( ActionsRequiredNone ActionsRequired = "None" ActionsRequiredRecreate ActionsRequired = "Recreate" ) // PossibleActionsRequiredValues returns the possible values for the ActionsRequired const type. func PossibleActionsRequiredValues() []ActionsRequired { return []ActionsRequired{ ActionsRequiredNone, ActionsRequiredRecreate, } } // ActivationStatus - The activation status of the connected registry. type ActivationStatus string const ( ActivationStatusActive ActivationStatus = "Active" ActivationStatusInactive ActivationStatus = "Inactive" ) // PossibleActivationStatusValues returns the possible values for the ActivationStatus const type. func PossibleActivationStatusValues() []ActivationStatus { return []ActivationStatus{ ActivationStatusActive, ActivationStatusInactive, } } // Architecture - The OS architecture. type Architecture string const ( ArchitectureAmd64 Architecture = "amd64" ArchitectureArm Architecture = "arm" ArchitectureArm64 Architecture = "arm64" ArchitectureThreeHundredEightySix Architecture = "386" ArchitectureX86 Architecture = "x86" ) // PossibleArchitectureValues returns the possible values for the Architecture const type. func PossibleArchitectureValues() []Architecture { return []Architecture{ ArchitectureAmd64, ArchitectureArm, ArchitectureArm64, ArchitectureThreeHundredEightySix, ArchitectureX86, } } // AuditLogStatus - Indicates whether audit logs are enabled on the connected registry. type AuditLogStatus string const ( AuditLogStatusDisabled AuditLogStatus = "Disabled" AuditLogStatusEnabled AuditLogStatus = "Enabled" ) // PossibleAuditLogStatusValues returns the possible values for the AuditLogStatus const type. func PossibleAuditLogStatusValues() []AuditLogStatus { return []AuditLogStatus{ AuditLogStatusDisabled, AuditLogStatusEnabled, } } // AzureADAuthenticationAsArmPolicyStatus - The value that indicates whether the policy is enabled or not. type AzureADAuthenticationAsArmPolicyStatus string const ( AzureADAuthenticationAsArmPolicyStatusDisabled AzureADAuthenticationAsArmPolicyStatus = "disabled" AzureADAuthenticationAsArmPolicyStatusEnabled AzureADAuthenticationAsArmPolicyStatus = "enabled" ) // PossibleAzureADAuthenticationAsArmPolicyStatusValues returns the possible values for the AzureADAuthenticationAsArmPolicyStatus const type. func PossibleAzureADAuthenticationAsArmPolicyStatusValues() []AzureADAuthenticationAsArmPolicyStatus { return []AzureADAuthenticationAsArmPolicyStatus{ AzureADAuthenticationAsArmPolicyStatusDisabled, AzureADAuthenticationAsArmPolicyStatusEnabled, } } // BaseImageDependencyType - The type of the base image dependency. type BaseImageDependencyType string const ( BaseImageDependencyTypeBuildTime BaseImageDependencyType = "BuildTime" BaseImageDependencyTypeRunTime BaseImageDependencyType = "RunTime" ) // PossibleBaseImageDependencyTypeValues returns the possible values for the BaseImageDependencyType const type. func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { return []BaseImageDependencyType{ BaseImageDependencyTypeBuildTime, BaseImageDependencyTypeRunTime, } } // BaseImageTriggerType - The type of the auto trigger for base image dependency updates. type BaseImageTriggerType string const ( BaseImageTriggerTypeAll BaseImageTriggerType = "All" BaseImageTriggerTypeRuntime BaseImageTriggerType = "Runtime" ) // PossibleBaseImageTriggerTypeValues returns the possible values for the BaseImageTriggerType const type. func
() []BaseImageTriggerType { return []BaseImageTriggerType{ BaseImageTriggerTypeAll, BaseImageTriggerTypeRuntime, } } // CertificateType - The type of certificate location. type CertificateType string const ( CertificateTypeLocalDirectory CertificateType = "LocalDirectory" ) // PossibleCertificateTypeValues returns the possible values for the CertificateType const type. func PossibleCertificateTypeValues() []CertificateType { return []CertificateType{ CertificateTypeLocalDirectory, } } // ConnectedRegistryMode - The mode of the connected registry resource that indicates the permissions of the registry. type ConnectedRegistryMode string const ( ConnectedRegistryModeMirror ConnectedRegistryMode = "Mirror" ConnectedRegistryModeReadOnly ConnectedRegistryMode = "ReadOnly" ConnectedRegistryModeReadWrite ConnectedRegistryMode = "ReadWrite" ConnectedRegistryModeRegistry ConnectedRegistryMode = "Registry" ) // PossibleConnectedRegistryModeValues returns the possible values for the ConnectedRegistryMode const type. func PossibleConnectedRegistryModeValues() []ConnectedRegistryMode { return []ConnectedRegistryMode{ ConnectedRegistryModeMirror, ConnectedRegistryModeReadOnly, ConnectedRegistryModeReadWrite, ConnectedRegistryModeRegistry, } } // ConnectionState - The current connection state of the connected registry. type ConnectionState string const ( ConnectionStateOffline ConnectionState = "Offline" ConnectionStateOnline ConnectionState = "Online" ConnectionStateSyncing ConnectionState = "Syncing" ConnectionStateUnhealthy ConnectionState = "Unhealthy" ) // PossibleConnectionStateValues returns the possible values for the ConnectionState const type. func PossibleConnectionStateValues() []ConnectionState { return []ConnectionState{ ConnectionStateOffline, ConnectionStateOnline, ConnectionStateSyncing, ConnectionStateUnhealthy, } } // ConnectionStatus - The private link service connection status. type ConnectionStatus string const ( ConnectionStatusApproved ConnectionStatus = "Approved" ConnectionStatusDisconnected ConnectionStatus = "Disconnected" ConnectionStatusPending ConnectionStatus = "Pending" ConnectionStatusRejected ConnectionStatus = "Rejected" ) // PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type. func PossibleConnectionStatusValues() []ConnectionStatus { return []ConnectionStatus{ ConnectionStatusApproved, ConnectionStatusDisconnected, ConnectionStatusPending, ConnectionStatusRejected, } } // CreatedByType - The type of identity that created the resource. type CreatedByType string const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. func PossibleCreatedByTypeValues() []CreatedByType { return []CreatedByType{ CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser, } } // DefaultAction - The default action of allow or deny when no other rules match. type DefaultAction string const ( DefaultActionAllow DefaultAction = "Allow" DefaultActionDeny DefaultAction = "Deny" ) // PossibleDefaultActionValues returns the possible values for the DefaultAction const type. func PossibleDefaultActionValues() []DefaultAction { return []DefaultAction{ DefaultActionAllow, DefaultActionDeny, } } // EncryptionStatus - Indicates whether or not the encryption is enabled for container registry. type EncryptionStatus string const ( EncryptionStatusDisabled EncryptionStatus = "disabled" EncryptionStatusEnabled EncryptionStatus = "enabled" ) // PossibleEncryptionStatusValues returns the possible values for the EncryptionStatus const type. func PossibleEncryptionStatusValues() []EncryptionStatus { return []EncryptionStatus{ EncryptionStatusDisabled, EncryptionStatusEnabled, } } // ExportPolicyStatus - The value that indicates whether the policy is enabled or not. type ExportPolicyStatus string const ( ExportPolicyStatusDisabled ExportPolicyStatus = "disabled" ExportPolicyStatusEnabled ExportPolicyStatus = "enabled" ) // PossibleExportPolicyStatusValues returns the possible values for the ExportPolicyStatus const type. func PossibleExportPolicyStatusValues() []ExportPolicyStatus { return []ExportPolicyStatus{ ExportPolicyStatusDisabled, ExportPolicyStatusEnabled, } } // ImportMode - When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail // the operation before any copying begins. type ImportMode string const ( ImportModeForce ImportMode = "Force" ImportModeNoForce ImportMode = "NoForce" ) // PossibleImportModeValues returns the possible values for the ImportMode const type. func PossibleImportModeValues() []ImportMode { return []ImportMode{ ImportModeForce, ImportModeNoForce, } } // LastModifiedByType - The type of identity that last modified the resource. type LastModifiedByType string const ( LastModifiedByTypeApplication LastModifiedByType = "Application" LastModifiedByTypeKey LastModifiedByType = "Key" LastModifiedByTypeManagedIdentity LastModifiedByType = "ManagedIdentity" LastModifiedByTypeUser LastModifiedByType = "User" ) // PossibleLastModifiedByTypeValues returns the possible values for the LastModifiedByType const type. func PossibleLastModifiedByTypeValues() []LastModifiedByType { return []LastModifiedByType{ LastModifiedByTypeApplication, LastModifiedByTypeKey, LastModifiedByTypeManagedIdentity, LastModifiedByTypeUser, } } // LogLevel - The verbosity of logs persisted on the connected registry. type LogLevel string const ( LogLevelDebug LogLevel = "Debug" LogLevelError LogLevel = "Error" LogLevelInformation LogLevel = "Information" LogLevelNone LogLevel = "None" LogLevelWarning LogLevel = "Warning" ) // PossibleLogLevelValues returns the possible values for the LogLevel const type. func PossibleLogLevelValues() []LogLevel { return []LogLevel{ LogLevelDebug, LogLevelError, LogLevelInformation, LogLevelNone, LogLevelWarning, } } // NetworkRuleBypassOptions - Whether to allow trusted Azure services to access a network restricted registry. type NetworkRuleBypassOptions string const ( NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices" NetworkRuleBypassOptionsNone NetworkRuleBypassOptions = "None" ) // PossibleNetworkRuleBypassOptionsValues returns the possible values for the NetworkRuleBypassOptions const type. func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { return []NetworkRuleBypassOptions{ NetworkRuleBypassOptionsAzureServices, NetworkRuleBypassOptionsNone, } } // OS - The OS of agent machine type OS string const ( OSLinux OS = "Linux" OSWindows OS = "Windows" ) // PossibleOSValues returns the possible values for the OS const type. func PossibleOSValues() []OS { return []OS{ OSLinux, OSWindows, } } // PasswordName - The password name. type PasswordName string const ( PasswordNamePassword PasswordName = "password" PasswordNamePassword2 PasswordName = "password2" ) // PossiblePasswordNameValues returns the possible values for the PasswordName const type. func PossiblePasswordNameValues() []PasswordName { return []PasswordName{ PasswordNamePassword, PasswordNamePassword2, } } type PipelineOptions string const ( PipelineOptionsContinueOnErrors PipelineOptions = "ContinueOnErrors" PipelineOptionsDeleteSourceBlobOnSuccess PipelineOptions = "DeleteSourceBlobOnSuccess" PipelineOptionsOverwriteBlobs PipelineOptions = "OverwriteBlobs" PipelineOptionsOverwriteTags PipelineOptions = "OverwriteTags" ) // PossiblePipelineOptionsValues returns the possible values for the PipelineOptions const type. func PossiblePipelineOptionsValues() []PipelineOptions { return []PipelineOptions{ PipelineOptionsContinueOnErrors, PipelineOptionsDeleteSourceBlobOnSuccess, PipelineOptionsOverwriteBlobs, PipelineOptionsOverwriteTags, } } // PipelineRunSourceType - The type of the source. type PipelineRunSourceType string const ( PipelineRunSourceTypeAzureStorageBlob PipelineRunSourceType = "AzureStorageBlob" ) // PossiblePipelineRunSourceTypeValues returns the possible values for the PipelineRunSourceType const type. func PossiblePipelineRunSourceTypeValues() []PipelineRunSourceType { return []PipelineRunSourceType{ PipelineRunSourceTypeAzureStorageBlob, } } // PipelineRunTargetType - The type of the target. type PipelineRunTargetType string const ( PipelineRunTargetTypeAzureStorageBlob PipelineRunTargetType = "AzureStorageBlob" ) // PossiblePipelineRunTargetTypeValues returns the possible values for the PipelineRunTargetType const type. func PossiblePipelineRunTargetTypeValues() []PipelineRunTargetType { return []PipelineRunTargetType{ PipelineRunTargetTypeAzureStorageBlob, } } // PipelineSourceType - The type of source for the import pipeline. type PipelineSourceType string const ( PipelineSourceTypeAzureStorageBlobContainer PipelineSourceType = "AzureStorageBlobContainer" ) // PossiblePipelineSourceTypeValues returns the possible values for the PipelineSourceType const type. func PossiblePipelineSourceTypeValues() []PipelineSourceType { return []PipelineSourceType{ PipelineSourceTypeAzureStorageBlobContainer, } } // PolicyStatus - The value that indicates whether the policy is enabled or not. type PolicyStatus string const ( PolicyStatusDisabled PolicyStatus = "disabled" PolicyStatusEnabled PolicyStatus = "enabled" ) // PossiblePolicyStatusValues returns the possible values for the PolicyStatus const type. func PossiblePolicyStatusValues() []PolicyStatus { return []PolicyStatus{ PolicyStatusDisabled, PolicyStatusEnabled, } } // ProvisioningState - The provisioning state of this agent pool type ProvisioningState string const ( ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating, } } // PublicNetworkAccess - Whether or not public network access is allowed for the container registry. type PublicNetworkAccess string const ( PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, } } // RegistryUsageUnit - The unit of measurement. type RegistryUsageUnit string const ( RegistryUsageUnitBytes RegistryUsageUnit = "Bytes" RegistryUsageUnitCount RegistryUsageUnit = "Count" ) // PossibleRegistryUsageUnitValues returns the possible values for the RegistryUsageUnit const type. func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { return []RegistryUsageUnit{ RegistryUsageUnitBytes, RegistryUsageUnitCount, } } // ResourceIdentityType - The identity type. type ResourceIdentityType string const ( ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" ResourceIdentityTypeNone ResourceIdentityType = "None" ) // PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return []ResourceIdentityType{ ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeUserAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeNone, } } // RunStatus - The current status of the run. type RunStatus string const ( RunStatusCanceled RunStatus = "Canceled" RunStatusError RunStatus = "Error" RunStatusFailed RunStatus = "Failed" RunStatusQueued RunStatus = "Queued" RunStatusRunning RunStatus = "Running" RunStatusStarted RunStatus = "Started" RunStatusSucceeded RunStatus = "Succeeded" RunStatusTimeout RunStatus = "Timeout" ) // PossibleRunStatusValues returns the possible values for the RunStatus const type. func PossibleRunStatusValues() []RunStatus { return []RunStatus{ RunStatusCanceled, RunStatusError, RunStatusFailed, RunStatusQueued, RunStatusRunning, RunStatusStarted, RunStatusSucceeded, RunStatusTimeout, } } // RunType - The type of run. type RunType string const ( RunTypeAutoBuild RunType = "AutoBuild" RunTypeAutoRun RunType = "AutoRun" RunTypeQuickBuild RunType = "QuickBuild" RunTypeQuickRun RunType = "QuickRun" ) // PossibleRunTypeValues returns the possible values for the RunType const type. func PossibleRunTypeValues() []RunType { return []RunType{ RunTypeAutoBuild, RunTypeAutoRun, RunTypeQuickBuild, RunTypeQuickRun, } } // SKUName - The SKU name of the container registry. Required for registry creation. type SKUName string const ( SKUNameBasic SKUName = "Basic" SKUNameClassic SKUName = "Classic" SKUNamePremium SKUName = "Premium" SKUNameStandard SKUName = "Standard" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNameBasic, SKUNameClassic, SKUNamePremium, SKUNameStandard, } } // SKUTier - The SKU tier based on the SKU name. type SKUTier string const ( SKUTierBasic SKUTier = "Basic" SKUTierClassic SKUTier = "Classic" SKUTierPremium SKUTier = "Premium" SKUTierStandard SKUTier = "Standard" ) // PossibleSKUTierValues returns the possible values for the SKUTier const type. func PossibleSKUTierValues() []SKUTier { return []SKUTier{ SKUTierBasic, SKUTierClassic, SKUTierPremium, SKUTierStandard, } } // SecretObjectType - The type of the secret object which determines how the value of the secret object has to be interpreted. type SecretObjectType string const ( SecretObjectTypeOpaque SecretObjectType = "Opaque" SecretObjectTypeVaultsecret SecretObjectType = "Vaultsecret" ) // PossibleSecretObjectTypeValues returns the possible values for the SecretObjectType const type. func PossibleSecretObjectTypeValues() []SecretObjectType { return []SecretObjectType{ SecretObjectTypeOpaque, SecretObjectTypeVaultsecret, } } // SourceControlType - The type of source control service. type SourceControlType string const ( SourceControlTypeGithub SourceControlType = "Github" SourceControlTypeVisualStudioTeamService SourceControlType = "VisualStudioTeamService" ) // PossibleSourceControlTypeValues returns the possible values for the SourceControlType const type. func PossibleSourceControlTypeValues() []SourceControlType { return []SourceControlType{ SourceControlTypeGithub, SourceControlTypeVisualStudioTeamService, } } // SourceRegistryLoginMode - The authentication mode which determines the source registry login scope. The credentials for // the source registry will be generated using the given scope. These credentials will be used to login to // the source registry during the run. type SourceRegistryLoginMode string const ( SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default" SourceRegistryLoginModeNone SourceRegistryLoginMode = "None" ) // PossibleSourceRegistryLoginModeValues returns the possible values for the SourceRegistryLoginMode const type. func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { return []SourceRegistryLoginMode{ SourceRegistryLoginModeDefault, SourceRegistryLoginModeNone, } } type SourceTriggerEvent string const ( SourceTriggerEventCommit SourceTriggerEvent = "commit" SourceTriggerEventPullrequest SourceTriggerEvent = "pullrequest" ) // PossibleSourceTriggerEventValues returns the possible values for the SourceTriggerEvent const type. func PossibleSourceTriggerEventValues() []SourceTriggerEvent { return []SourceTriggerEvent{ SourceTriggerEventCommit, SourceTriggerEventPullrequest, } } // StepType - The type of the step. type StepType string const ( StepTypeDocker StepType = "Docker" StepTypeEncodedTask StepType = "EncodedTask" StepTypeFileTask StepType = "FileTask" ) // PossibleStepTypeValues returns the possible values for the StepType const type. func PossibleStepTypeValues() []StepType { return []StepType{ StepTypeDocker, StepTypeEncodedTask, StepTypeFileTask, } } // TLSStatus - Indicates whether HTTPS is enabled for the login server. type TLSStatus string const ( TLSStatusDisabled TLSStatus = "Disabled" TLSStatusEnabled TLSStatus = "Enabled" ) // PossibleTLSStatusValues returns the possible values for the TLSStatus const type. func PossibleTLSStatusValues() []TLSStatus { return []TLSStatus{ TLSStatusDisabled, TLSStatusEnabled, } } // TaskStatus - The current status of task. type TaskStatus string const ( TaskStatusDisabled TaskStatus = "Disabled" TaskStatusEnabled TaskStatus = "Enabled" ) // PossibleTaskStatusValues returns the possible values for the TaskStatus const type. func PossibleTaskStatusValues() []TaskStatus { return []TaskStatus{ TaskStatusDisabled, TaskStatusEnabled, } } type TokenCertificateName string const ( TokenCertificateNameCertificate1 TokenCertificateName = "certificate1" TokenCertificateNameCertificate2 TokenCertificateName = "certificate2" ) // PossibleTokenCertificateNameValues returns the possible values for the TokenCertificateName const type. func PossibleTokenCertificateNameValues() []TokenCertificateName { return []TokenCertificateName{ TokenCertificateNameCertificate1, TokenCertificateNameCertificate2, } } // TokenPasswordName - The password name "password1" or "password2" type TokenPasswordName string const ( TokenPasswordNamePassword1 TokenPasswordName = "password1" TokenPasswordNamePassword2 TokenPasswordName = "password2" ) // PossibleTokenPasswordNameValues returns the possible values for the TokenPasswordName const type. func PossibleTokenPasswordNameValues() []TokenPasswordName { return []TokenPasswordName{ TokenPasswordNamePassword1, TokenPasswordNamePassword2, } } // TokenStatus - The status of the token example enabled or disabled. type TokenStatus string const ( TokenStatusDisabled TokenStatus = "disabled" TokenStatusEnabled TokenStatus = "enabled" ) // PossibleTokenStatusValues returns the possible values for the TokenStatus const type. func PossibleTokenStatusValues() []TokenStatus { return []TokenStatus{ TokenStatusDisabled, TokenStatusEnabled, } } // TokenType - The type of Auth token. type TokenType string const ( TokenTypeOAuth TokenType = "OAuth" TokenTypePAT TokenType = "PAT" ) // PossibleTokenTypeValues returns the possible values for the TokenType const type. func PossibleTokenTypeValues() []TokenType { return []TokenType{ TokenTypeOAuth, TokenTypePAT, } } // TriggerStatus - The current status of trigger. type TriggerStatus string const ( TriggerStatusDisabled TriggerStatus = "Disabled" TriggerStatusEnabled TriggerStatus = "Enabled" ) // PossibleTriggerStatusValues returns the possible values for the TriggerStatus const type. func PossibleTriggerStatusValues() []TriggerStatus { return []TriggerStatus{ TriggerStatusDisabled, TriggerStatusEnabled, } } // TrustPolicyType - The type of trust policy. type TrustPolicyType string const ( TrustPolicyTypeNotary TrustPolicyType = "Notary" ) // PossibleTrustPolicyTypeValues returns the possible values for the TrustPolicyType const type. func PossibleTrustPolicyTypeValues() []TrustPolicyType { return []TrustPolicyType{ TrustPolicyTypeNotary, } } // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. type UpdateTriggerPayloadType string const ( UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = "Default" UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = "Token" ) // PossibleUpdateTriggerPayloadTypeValues returns the possible values for the UpdateTriggerPayloadType const type. func PossibleUpdateTriggerPayloadTypeValues() []UpdateTriggerPayloadType { return []UpdateTriggerPayloadType{ UpdateTriggerPayloadTypeDefault, UpdateTriggerPayloadTypeToken, } } // Variant - Variant of the CPU. type Variant string const ( VariantV6 Variant = "v6" VariantV7 Variant = "v7" VariantV8 Variant = "v8" ) // PossibleVariantValues returns the possible values for the Variant const type. func PossibleVariantValues() []Variant { return []Variant{ VariantV6, VariantV7, VariantV8, } } type WebhookAction string const ( WebhookActionChartDelete WebhookAction = "chart_delete" WebhookActionChartPush WebhookAction = "chart_push" WebhookActionDelete WebhookAction = "delete" WebhookActionPush WebhookAction = "push" WebhookActionQuarantine WebhookAction = "quarantine" ) // PossibleWebhookActionValues returns the possible values for the WebhookAction const type. func PossibleWebhookActionValues() []WebhookAction { return []WebhookAction{ WebhookActionChartDelete, WebhookActionChartPush, WebhookActionDelete, WebhookActionPush, WebhookActionQuarantine, } } // WebhookStatus - The status of the webhook at the time the operation was called. type WebhookStatus string const ( WebhookStatusDisabled WebhookStatus = "disabled" WebhookStatusEnabled WebhookStatus = "enabled" ) // PossibleWebhookStatusValues returns the possible values for the WebhookStatus const type. func PossibleWebhookStatusValues() []WebhookStatus { return []WebhookStatus{ WebhookStatusDisabled, WebhookStatusEnabled, } } // ZoneRedundancy - Whether or not zone redundancy is enabled for this container registry type ZoneRedundancy string const ( ZoneRedundancyDisabled ZoneRedundancy = "Disabled" ZoneRedundancyEnabled ZoneRedundancy = "Enabled" ) // PossibleZoneRedundancyValues returns the possible values for the ZoneRedundancy const type. func PossibleZoneRedundancyValues() []ZoneRedundancy { return []ZoneRedundancy{ ZoneRedundancyDisabled, ZoneRedundancyEnabled, } }
PossibleBaseImageTriggerTypeValues
xml2txt.py
import os import glob import argparse import xml.etree.ElementTree as ET parser = argparse.ArgumentParser() # Define parameter parser.add_argument('--input_dir', type=str) parser.add_argument('--output_dir', type=str) parser.add_argument('--class_list', type=str) args = parser.parse_args() # Set Class Names def set_class_names(class_list): f = open(class_list, mode='r') class_names = [] while True: line = f.readline().strip() if not line: break class_names += [line] f.close() return class_names # Normalize Bounding Box def
(x_min, x_max, y_min, y_max, width, height): x_center = (x_min + x_max) * 0.5 / float(width) y_center = (y_min + y_max) * 0.5 / float(height) x_range = (x_max - x_min) / float(width) y_range = (y_max - y_min) / float(height) return x_center, y_center, x_range, y_range # Convert XML into TXT def convertXML2TXT(class_names, pathI, pathO): fileI = open(pathI, mode='r') fileO = open(pathO, mode='w') tree = ET.parse(fileI) root = tree.getroot() size = root.find('size') width = int(size.find('width').text) height = int(size.find('height').text) for obj in root.iter('object'): class_name = obj.find('name').text class_id = class_names.index(class_name) BB = obj.find('bndbox') x_min = float(BB.find('xmin').text) x_max = float(BB.find('xmax').text) y_min = float(BB.find('ymin').text) y_max = float(BB.find('ymax').text) x_center, y_center, x_range, y_range = normalizeBB(x_min, x_max, y_min, y_max, width, height) fileO.write(f'{class_id} {x_center} {y_center} {x_range} {y_range}\n') fileI.close() fileO.close() if __name__ == '__main__': # Get File Names fnames = [] for f in glob.glob(f'{args.input_dir}/*.xml'): fnames.append(os.path.splitext(os.path.split(f)[1])[0]) # Set Class Names class_names = set_class_names(args.class_list) # Convert XML into TXT os.makedirs(f'{args.output_dir}', exist_ok=False) for f in fnames: pathI = f'{args.input_dir}/{f}.xml' pathO = f'{args.output_dir}/{f}.txt' convertXML2TXT(class_names, pathI, pathO)
normalizeBB
utils.js
export function convertWildcardToRegex(wildcardString) {
let result = wildcardString; result = result.replace(/[-[\]\/{}()*+?.,\\^$|#\s]/g, "\\$&"); result = result.replace(/\\\?/g, "."); result = result.replace(/\\\*/g, ".*"); if ( !wildcardString.startsWith("http://") && !wildcardString.startsWith("https://") ) { result = "https?:\\/\\/" + result; } return "/^" + result + "$/"; }
if (!wildcardString) { return undefined; }
authrouter.go
package routers
) var AuthRouter cobra.Command func init() { AuthRouter = cobra.Command{ Use: "auth", Short: "Login and Register to Kahla Server", Run: func(cmd *cobra.Command, args []string) { err := cmd.Help() if err != nil { panic(err) } }, } AuthRouter.AddCommand(&controllers.LoginCommand) }
import ( "github.com/spf13/cobra" "github.com/xiangrui2019/go-kahla-cli/controllers"
generics.rs
pub mod functions { struct A; struct S(A); struct SGen<T>(T); fn reg_fn(_s: S) {} struct Fib { curr: u32, next: u32, } impl Iterator for Fib { type Item = u32; fn
(&mut self) -> Option<u32> { let new_next = self.curr + self.next; self.curr = self.next; self.next = new_next; Some(self.curr) } } fn fib() -> Fib { Fib { curr: 0, next: 1 } } pub fn test_fib() { let mut sequence = 0..3; println!("Four consecutive `next` calls on 0..3"); println!("> {:?}", sequence.next()); println!("> {:?}", sequence.next()); println!("> {:?}", sequence.next()); println!("> {:?}", sequence.next()); for i in 0..=3 { println!("> {}", i); } let mut Fibn = fib(); for i in 0..=3 { println!("> {:?}", Fibn.next()); } // The `take(n)` method reduces an `Iterator` to its first `n` terms. println!("The first four terms of the Fibonacci sequence are: "); for i in fib().take(4) { println!("> {}", i); } // The `skip(n)` method shortens an `Iterator` by dropping its first `n` terms. println!("The next four terms of the Fibonacci sequence are: "); for i in fib().skip(4).take(4) { println!("> {}", i); } } }
next
PointController.ts
import { Request, Response, response } from 'express'; import knex from '@app/database/connection'; class
{ async index(req: Request, res: Response) { const { city, uf, items } = req.query; const parsedItems = String(items) .split(',') .map((item) => Number(item.trim())); const points = await knex('points') .join('point_items', 'points_id', '=', 'point_items.point_id') .whereIn('point_items.item_id', parsedItems) .where('city', String(city)) .where('uf', String(uf)) .distinct() .select('points.*'); return res.json(points); } async show(req: Request, res: Response) { const { id } = req.params; const point = await knex('points').where('id', id).first(); if (!point) { return response.status(400).json({ message: 'Point not found.' }); } const items = await knex('items') .join('point_items', 'items.id', '=', 'point_items.item_id') .where('point_items.point_id', id) .select('items.title'); return response.json({ point, items }); } async create(req: Request, res: Response) { const { name, email, whatsapp, latitude, longitude, city, uf, items } = req.body; const trx = await knex.transaction(); const point = { image: 'https://source.unsplash.com/collection/4586835/450', name, email, whatsapp, latitude, longitude, city, uf }; const insertedIds = await trx('points').insert(point); const point_id = insertedIds[0]; const pointItems = items.map((item_id: number) => { return { item_id, point_id } }); await trx('point_items').insert(pointItems); await trx.commit(); return res.json({ id: point_id, ...point }); } }; export default PointController;
PointController
state.go
// Copyright 2015 The LUCI 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 txnBuf import ( "bytes" "context" "sync" "go.chromium.org/luci/common/data/stringset" "go.chromium.org/luci/common/errors" "go.chromium.org/luci/common/sync/parallel" "go.chromium.org/luci/gae/impl/memory" "go.chromium.org/luci/gae/service/datastore" "go.chromium.org/luci/gae/service/info" ) // DefaultSizeBudget is the size budget for the root transaction. // // Because our estimation algorithm isn't entirely correct, we take 5% off // the limit for encoding and estimate inaccuracies. // // 10MB taken on 2015/09/24: // https://cloud.google.com/appengine/docs/go/datastore/#Go_Quotas_and_limits const DefaultSizeBudget = int64((10 * 1000 * 1000) * 0.95) // DefaultWriteCountBudget is the maximum number of entities that can be written // in a single call. // // This is not known to be documented, and has instead been extracted from a // datastore error message. const DefaultWriteCountBudget = 500 // XGTransactionGroupLimit is the number of transaction groups to allow in an // XG transaction. // // 25 taken on 2015/09/24: // https://cloud.google.com/appengine/docs/go/datastore/transactions#Go_What_can_be_done_in_a_transaction const XGTransactionGroupLimit = 25 // sizeTracker tracks the size of a buffered transaction. The rules are simple: // * deletes count for the size of their key, but 0 data // * puts count for the size of their key plus the 'EstimateSize' for their // data. type sizeTracker struct { keyToSize map[string]int64 total int64 } // set states that the given key is being set to an entity with the size `val`. // A val of 0 means "I'm deleting this key" func (s *sizeTracker) set(key string, val int64) { if s.keyToSize == nil { s.keyToSize = make(map[string]int64) } prev, existed := s.keyToSize[key] s.keyToSize[key] = val s.total += val - prev if !existed { s.total += int64(len(key)) } } // get returns the currently tracked size for key, and wheter or not the key // has any tracked value. func (s *sizeTracker) get(key string) (int64, bool) { size, has := s.keyToSize[key] return size, has } // has returns true iff key has a tracked value. func (s *sizeTracker) has(key string) bool { _, has := s.keyToSize[key] return has } // numWrites returns the number of tracked write operations. func (s *sizeTracker) numWrites() int { return len(s.keyToSize) } // dup returns a duplicate sizeTracker. func (s *sizeTracker) dup() *sizeTracker { if len(s.keyToSize) == 0 { return &sizeTracker{} } k2s := make(map[string]int64, len(s.keyToSize)) for k, v := range s.keyToSize { k2s[k] = v } return &sizeTracker{k2s, s.total} } type txnBufState struct { sync.Mutex // encoded key -> size of entity. A size of 0 means that the entity is // deleted. entState *sizeTracker bufDS datastore.RawInterface roots stringset.Set rootLimit int kc datastore.KeyContext parentDS datastore.RawInterface // sizeBudget is the number of bytes that this transaction has to operate // within. It's only used when attempting to apply() the transaction, and // it is the threshold for the delta of applying this transaction to the // parent transaction. Note that a buffered transaction could actually have // a negative delta if the parent transaction had many large entities which // the inner transaction deleted. sizeBudget int64 // countBudget is the number of entity writes that this transaction has to // operate in. writeCountBudget int } func withTxnBuf(ctx context.Context, cb func(context.Context) error, opts *datastore.TransactionOptions) error { parentState, _ := ctx.Value(&dsTxnBufParent).(*txnBufState) roots := stringset.New(0) rootLimit := XGTransactionGroupLimit sizeBudget, writeCountBudget := DefaultSizeBudget, DefaultWriteCountBudget if parentState != nil { // TODO(riannucci): this is a bit wonky since it means that a child // transaction declaring XG=true will only get to modify 25 groups IF // they're same groups affected by the parent transactions. So instead of // respecting opts.XG for inner transactions, we just dup everything from // the parent transaction. roots = parentState.roots.Dup() rootLimit = parentState.rootLimit sizeBudget = parentState.sizeBudget - parentState.entState.total writeCountBudget = parentState.writeCountBudget - parentState.entState.numWrites() } state := &txnBufState{ entState: &sizeTracker{}, bufDS: memory.NewDatastore(ctx, info.Raw(ctx)), roots: roots, rootLimit: rootLimit, kc: datastore.GetKeyContext(ctx), parentDS: datastore.Raw(context.WithValue(ctx, &dsTxnBufHaveLock, true)), sizeBudget: sizeBudget, writeCountBudget: writeCountBudget, } if err := cb(context.WithValue(ctx, &dsTxnBufParent, state)); err != nil { return err } // no reason to unlock this ever. At this point it's toast. state.Lock() if parentState == nil { return commitToReal(state) } if err := parentState.canApplyLocked(state); err != nil { return err } parentState.commitLocked(state) return nil } // item is a temporary object for representing key/entity pairs and their cache // state (e.g. if they exist in the in-memory datastore buffer or not). // Additionally item memoizes some common comparison strings. item objects // must never be persisted outside of a single function/query context. type item struct { key *datastore.Key data datastore.PropertyMap buffered bool encKey string // cmpRow is used to hold the toComparableString value for this item during // a query. cmpRow string // err is a bit of a hack for passing back synchronized errors from // queryToIter. err error } func (i *item) getEncKey() string { if i.encKey == "" { i.encKey = string(datastore.Serialize.ToBytes(i.key)) } return i.encKey } func (i *item) getCmpRow(lower, upper []byte, order []datastore.IndexColumn) string { if i.cmpRow == "" { row, key := toComparableString(lower, upper, order, i.key, i.data) i.cmpRow = string(row) if i.encKey == "" { i.encKey = string(key) } } return i.cmpRow } func (t *txnBufState) updateRootsLocked(roots stringset.Set) error { curRootLen := t.roots.Len() proposedRoots := stringset.New(1) roots.Iter(func(root string) bool { if !t.roots.Has(root) { proposedRoots.Add(root) } return proposedRoots.Len()+curRootLen <= t.rootLimit }) if proposedRoots.Len()+curRootLen > t.rootLimit { return ErrTooManyRoots } // only need to update the roots if they did something that required updating if proposedRoots.Len() > 0 { proposedRoots.Iter(func(root string) bool { t.roots.Add(root) return true }) } return nil } func (t *txnBufState) getMulti(keys []*datastore.Key, metas datastore.MultiMetaGetter, cb datastore.GetMultiCB, haveLock bool) error { encKeys, roots := toEncoded(keys) data := make([]item, len(keys)) idxMap := []int(nil) toGetKeys := []*datastore.Key(nil) lme := errors.NewLazyMultiError(len(keys)) err := func() error { if !haveLock { t.Lock() defer t.Unlock() } if err := t.updateRootsLocked(roots); err != nil { return err } for i, key := range keys { data[i].key = key data[i].encKey = encKeys[i] if size, ok := t.entState.get(data[i].getEncKey()); ok { data[i].buffered = true if size > 0 { idxMap = append(idxMap, i) toGetKeys = append(toGetKeys, key) } } } if len(toGetKeys) > 0 { t.bufDS.GetMulti(toGetKeys, nil, func(j int, pm datastore.PropertyMap, err error) { impossible(err) data[idxMap[j]].data = pm }) } idxMap = nil getKeys := []*datastore.Key(nil) getMetas := datastore.MultiMetaGetter(nil) for i, itm := range data { if !itm.buffered { idxMap = append(idxMap, i) getKeys = append(getKeys, itm.key) getMetas = append(getMetas, metas.GetSingle(i)) } } if len(idxMap) > 0 { err := t.parentDS.GetMulti(getKeys, getMetas, func(j int, pm datastore.PropertyMap, err error) { if err != datastore.ErrNoSuchEntity { i := idxMap[j] if !lme.Assign(i, err) { data[i].data = pm } } }) if err != nil { return err } } return nil }() if err != nil { return err } for i, itm := range data { err := lme.GetOne(i) if err != nil { cb(i, nil, err) } else if itm.data == nil { cb(i, nil, datastore.ErrNoSuchEntity) } else { cb(i, itm.data, nil) } } return nil } func (t *txnBufState) deleteMulti(keys []*datastore.Key, cb datastore.DeleteMultiCB, haveLock bool) error { encKeys, roots := toEncoded(keys) err := func() error { if !haveLock { t.Lock() defer t.Unlock() } if err := t.updateRootsLocked(roots); err != nil { return err } err := t.bufDS.DeleteMulti(keys, func(i int, err error) { impossible(err) t.entState.set(encKeys[i], 0) }) impossible(err) return nil }() if err != nil
for i := range keys { cb(i, nil) } return nil } func (t *txnBufState) fixKeys(keys []*datastore.Key) ([]*datastore.Key, error) { // Identify any incomplete keys and allocate IDs for them. // // In order to facilitate this, we will maintain a mapping of the // incompleteKeys index to the key's corresponding index in the keys array. // Any errors or allocations on incompleteKeys operations will be propagated // to the correct keys index using this map. var ( incompleteKeys []*datastore.Key incompleteMap map[int]int ) for i, key := range keys { if key.IsIncomplete() { if incompleteMap == nil { incompleteMap = make(map[int]int) } incompleteMap[len(incompleteKeys)] = i incompleteKeys = append(incompleteKeys, key) } } if len(incompleteKeys) == 0 { return keys, nil } // We're going to update keys, so clone it. keys, origKeys := make([]*datastore.Key, len(keys)), keys copy(keys, origKeys) // Intentionally call AllocateIDs without lock. outerErr := errors.NewLazyMultiError(len(keys)) err := t.parentDS.AllocateIDs(incompleteKeys, func(i int, key *datastore.Key, err error) { outerIdx := incompleteMap[i] if err != nil { outerErr.Assign(outerIdx, err) } else { keys[outerIdx] = key } }) if err != nil { return nil, err } return keys, outerErr.Get() } func (t *txnBufState) putMulti(keys []*datastore.Key, vals []datastore.PropertyMap, cb datastore.NewKeyCB, haveLock bool) error { keys, err := t.fixKeys(keys) if err != nil { for i, e := range err.(errors.MultiError) { cb(i, nil, e) } return nil } encKeys, roots := toEncoded(keys) err = func() error { if !haveLock { t.Lock() defer t.Unlock() } if err := t.updateRootsLocked(roots); err != nil { return err } err := t.bufDS.PutMulti(keys, vals, func(i int, k *datastore.Key, err error) { impossible(err) t.entState.set(encKeys[i], vals[i].EstimateSize()) }) impossible(err) return nil }() if err != nil { return err } for i, k := range keys { cb(i, k, nil) } return nil } func commitToReal(s *txnBufState) error { toPut, toPutKeys, toDel := s.effect() return parallel.FanOutIn(func(ch chan<- func() error) { if len(toPut) > 0 { ch <- func() error { mErr := errors.NewLazyMultiError(len(toPut)) err := s.parentDS.PutMulti(toPutKeys, toPut, func(i int, _ *datastore.Key, err error) { mErr.Assign(i, err) }) if err == nil { err = mErr.Get() } return err } } if len(toDel) > 0 { ch <- func() error { mErr := errors.NewLazyMultiError(len(toDel)) err := s.parentDS.DeleteMulti(toDel, func(i int, err error) { mErr.Assign(i, err) }) if err == nil { err = mErr.Get() } return err } } }) } func (t *txnBufState) effect() (toPut []datastore.PropertyMap, toPutKeys, toDel []*datastore.Key) { // TODO(riannucci): preallocate return slices // need to pull all items out of the in-memory datastore. Fortunately we have // kindless queries, and we disabled all the special entities, so just // run a kindless query without any filters and it will return all data // currently in bufDS :). fq, err := datastore.NewQuery("").Finalize() impossible(err) err = t.bufDS.Run(fq, func(key *datastore.Key, data datastore.PropertyMap, _ datastore.CursorCB) error { toPutKeys = append(toPutKeys, key) toPut = append(toPut, data) return nil }) memoryCorruption(err) for keyStr, size := range t.entState.keyToSize { if size == 0 { k, err := datastore.Deserializer{KeyContext: t.kc}.Key(bytes.NewBufferString(keyStr)) memoryCorruption(err) toDel = append(toDel, k) } } return } func (t *txnBufState) canApplyLocked(s *txnBufState) error { proposedState := t.entState.dup() for k, v := range s.entState.keyToSize { proposedState.set(k, v) } switch { case proposedState.numWrites() > t.writeCountBudget: // The new net number of writes must be below the parent's write count // cutoff. fallthrough case proposedState.total > t.sizeBudget: // Make sure our new calculated size is within the parent's size budget. // // We have: // - proposedState.total: The "new world" total bytes were this child // transaction committed to the parent. // - t.sizeBudget: The maximum number of bytes that this parent can // accommodate. return ErrTransactionTooLarge } return nil } func (t *txnBufState) commitLocked(s *txnBufState) { toPut, toPutKeys, toDel := s.effect() if len(toPut) > 0 { impossible(t.putMulti(toPutKeys, toPut, func(_ int, _ *datastore.Key, err error) { impossible(err) }, true)) } if len(toDel) > 0 { impossible(t.deleteMulti(toDel, func(_ int, err error) { impossible(err) }, true)) } } // toEncoded returns a list of all of the serialized versions of these keys, // plus a stringset of all the encoded root keys that `keys` represents. func toEncoded(keys []*datastore.Key) (full []string, roots stringset.Set) { roots = stringset.New(len(keys)) full = make([]string, len(keys)) for i, k := range keys { roots.Add(string(datastore.Serialize.ToBytes(k.Root()))) full[i] = string(datastore.Serialize.ToBytes(k)) } return }
{ return err }
user.js
import request from '@/utils/request'; export async function
() { return request('/api/users'); } export async function queryCurrent() { return request('/api/currentUser'); }
query
mod.rs
#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::RST_MODE_P6 { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); let r = R { bits: bits }; let mut w = W { bits: bits }; f(&r, &mut w); self.register.set(w.bits); } #[doc = r" Reads the contents of the register"] #[inline] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r" Writes to the register"] #[inline] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { let mut w = W::reset_value(); f(&mut w); self.register.set(w.bits); } #[doc = r" Writes the reset value to the register"] #[inline] pub fn reset(&self) { self.write(|w| w) } } #[doc = "Possible values of the field `pin0`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN0R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN0R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN0R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN0R { match value { i => PIN0R::_Reserved(i), } } } #[doc = "Possible values of the field `pin1`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN1R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN1R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN1R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN1R { match value { i => PIN1R::_Reserved(i), } } } #[doc = "Possible values of the field `pin2`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN2R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN2R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN2R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN2R { match value { i => PIN2R::_Reserved(i), } } } #[doc = "Possible values of the field `pin3`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN3R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN3R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN3R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN3R { match value { i => PIN3R::_Reserved(i), } } } #[doc = "Possible values of the field `pin4`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN4R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN4R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN4R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN4R { match value { i => PIN4R::_Reserved(i), } } } #[doc = "Possible values of the field `pin5`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN5R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN5R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN5R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN5R { match value { i => PIN5R::_Reserved(i), } } } #[doc = "Possible values of the field `pin6`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN6R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN6R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN6R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN6R { match value { i => PIN6R::_Reserved(i), } } } #[doc = "Possible values of the field `pin7`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN7R { #[doc = r" Reserved"] _Reserved(u8), } impl PIN7R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PIN7R::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> PIN7R { match value { i => PIN7R::_Reserved(i), } } } #[doc = "Values that can be written to the field `pin0`"] pub enum PIN0W {} impl PIN0W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN0W<'a> { w: &'a mut W, } impl<'a> _PIN0W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN0W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline]
const OFFSET: u8 = 0; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin1`"] pub enum PIN1W {} impl PIN1W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN1W<'a> { w: &'a mut W, } impl<'a> _PIN1W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN1W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 4; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin2`"] pub enum PIN2W {} impl PIN2W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN2W<'a> { w: &'a mut W, } impl<'a> _PIN2W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN2W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 8; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin3`"] pub enum PIN3W {} impl PIN3W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN3W<'a> { w: &'a mut W, } impl<'a> _PIN3W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN3W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 12; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin4`"] pub enum PIN4W {} impl PIN4W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN4W<'a> { w: &'a mut W, } impl<'a> _PIN4W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN4W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 16; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin5`"] pub enum PIN5W {} impl PIN5W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN5W<'a> { w: &'a mut W, } impl<'a> _PIN5W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN5W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 20; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin6`"] pub enum PIN6W {} impl PIN6W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN6W<'a> { w: &'a mut W, } impl<'a> _PIN6W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN6W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 24; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `pin7`"] pub enum PIN7W {} impl PIN7W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self {} } } #[doc = r" Proxy"] pub struct _PIN7W<'a> { w: &'a mut W, } impl<'a> _PIN7W<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: PIN7W) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7; const OFFSET: u8 = 28; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bits 0:2 - P6.0 Default Output Drive Mode"] #[inline] pub fn pin0(&self) -> PIN0R { PIN0R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 4:6 - P6.1 Default Output Drive Mode"] #[inline] pub fn pin1(&self) -> PIN1R { PIN1R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 4; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 8:10 - P6.2 Default Output Drive Mode"] #[inline] pub fn pin2(&self) -> PIN2R { PIN2R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 8; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 12:14 - P6.3 Default Output Drive Mode"] #[inline] pub fn pin3(&self) -> PIN3R { PIN3R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 12; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 16:18 - P6.4 Default Output Drive Mode"] #[inline] pub fn pin4(&self) -> PIN4R { PIN4R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 16; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 20:22 - P6.5 Default Output Drive Mode"] #[inline] pub fn pin5(&self) -> PIN5R { PIN5R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 20; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 24:26 - P6.6 Default Output Drive Mode"] #[inline] pub fn pin6(&self) -> PIN6R { PIN6R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 24; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } #[doc = "Bits 28:30 - P6.7 Default Output Drive Mode"] #[inline] pub fn pin7(&self) -> PIN7R { PIN7R::_from({ const MASK: u8 = 7; const OFFSET: u8 = 28; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } } impl W { #[doc = r" Reset value of the register"] #[inline] pub fn reset_value() -> W { W { bits: 0 } } #[doc = r" Writes raw bits to the register"] #[inline] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bits 0:2 - P6.0 Default Output Drive Mode"] #[inline] pub fn pin0(&mut self) -> _PIN0W { _PIN0W { w: self } } #[doc = "Bits 4:6 - P6.1 Default Output Drive Mode"] #[inline] pub fn pin1(&mut self) -> _PIN1W { _PIN1W { w: self } } #[doc = "Bits 8:10 - P6.2 Default Output Drive Mode"] #[inline] pub fn pin2(&mut self) -> _PIN2W { _PIN2W { w: self } } #[doc = "Bits 12:14 - P6.3 Default Output Drive Mode"] #[inline] pub fn pin3(&mut self) -> _PIN3W { _PIN3W { w: self } } #[doc = "Bits 16:18 - P6.4 Default Output Drive Mode"] #[inline] pub fn pin4(&mut self) -> _PIN4W { _PIN4W { w: self } } #[doc = "Bits 20:22 - P6.5 Default Output Drive Mode"] #[inline] pub fn pin5(&mut self) -> _PIN5W { _PIN5W { w: self } } #[doc = "Bits 24:26 - P6.6 Default Output Drive Mode"] #[inline] pub fn pin6(&mut self) -> _PIN6W { _PIN6W { w: self } } #[doc = "Bits 28:30 - P6.7 Default Output Drive Mode"] #[inline] pub fn pin7(&mut self) -> _PIN7W { _PIN7W { w: self } } }
pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 7;
directional_lighting_system.rs
// Copyright (c) 2017 The vulkano developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, // at your option. All files in the project carrying such // notice may not be copied, modified, or distributed except // according to those terms. use cgmath::Vector3; use vulkano::buffer::BufferUsage; use vulkano::buffer::CpuAccessibleBuffer; use vulkano::command_buffer::AutoCommandBuffer; use vulkano::command_buffer::AutoCommandBufferBuilder; use vulkano::command_buffer::DynamicState; use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; use vulkano::device::Queue; use vulkano::framebuffer::RenderPassAbstract; use vulkano::framebuffer::Subpass; use vulkano::image::ImageViewAbstract; use vulkano::pipeline::blend::AttachmentBlend; use vulkano::pipeline::blend::BlendFactor; use vulkano::pipeline::blend::BlendOp; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; use vulkano::pipeline::GraphicsPipelineAbstract; use std::sync::Arc; /// Allows applying a directional light source to a scene. pub struct DirectionalLightingSystem { gfx_queue: Arc<Queue>, vertex_buffer: Arc<CpuAccessibleBuffer<[Vertex]>>, pipeline: Arc<dyn GraphicsPipelineAbstract + Send + Sync>, } impl DirectionalLightingSystem { /// Initializes the directional lighting system. pub fn new<R>(gfx_queue: Arc<Queue>, subpass: Subpass<R>) -> DirectionalLightingSystem where R: RenderPassAbstract + Send + Sync + 'static,
/// Builds a secondary command buffer that applies directional lighting. /// /// This secondary command buffer will read `color_input` and `normals_input`, and multiply the /// color with `color` and the dot product of the `direction` with the normal. /// It then writes the output to the current framebuffer with additive blending (in other words /// the value will be added to the existing value in the framebuffer, and not replace the /// existing value). /// /// Since `normals_input` contains normals in world coordinates, `direction` should also be in /// world coordinates. /// /// - `viewport_dimensions` contains the dimensions of the current framebuffer. /// - `color_input` is an image containing the albedo of each object of the scene. It is the /// result of the deferred pass. /// - `normals_input` is an image containing the normals of each object of the scene. It is the /// result of the deferred pass. /// - `direction` is the direction of the light in world coordinates. /// - `color` is the color to apply. /// pub fn draw<C, N>( &self, viewport_dimensions: [u32; 2], color_input: C, normals_input: N, direction: Vector3<f32>, color: [f32; 3], ) -> AutoCommandBuffer where C: ImageViewAbstract + Send + Sync + 'static, N: ImageViewAbstract + Send + Sync + 'static, { let push_constants = fs::ty::PushConstants { color: [color[0], color[1], color[2], 1.0], direction: direction.extend(0.0).into(), }; let layout = self.pipeline.descriptor_set_layout(0).unwrap(); let descriptor_set = PersistentDescriptorSet::start(layout.clone()) .add_image(color_input) .unwrap() .add_image(normals_input) .unwrap() .build() .unwrap(); let dynamic_state = DynamicState { viewports: Some(vec![Viewport { origin: [0.0, 0.0], dimensions: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32], depth_range: 0.0..1.0, }]), ..DynamicState::none() }; let mut builder = AutoCommandBufferBuilder::secondary_graphics( self.gfx_queue.device().clone(), self.gfx_queue.family(), self.pipeline.clone().subpass(), ) .unwrap(); builder .draw( self.pipeline.clone(), &dynamic_state, vec![self.vertex_buffer.clone()], descriptor_set, push_constants, vec![], ) .unwrap(); builder.build().unwrap() } } #[derive(Default, Debug, Clone)] struct Vertex { position: [f32; 2], } vulkano::impl_vertex!(Vertex, position); mod vs { vulkano_shaders::shader! { ty: "vertex", src: " #version 450 layout(location = 0) in vec2 position; void main() { gl_Position = vec4(position, 0.0, 1.0); }" } } mod fs { vulkano_shaders::shader! { ty: "fragment", src: " #version 450 // The `color_input` parameter of the `draw` method. layout(input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput u_diffuse; // The `normals_input` parameter of the `draw` method. layout(input_attachment_index = 1, set = 0, binding = 1) uniform subpassInput u_normals; layout(push_constant) uniform PushConstants { // The `color` parameter of the `draw` method. vec4 color; // The `direction` parameter of the `draw` method. vec4 direction; } push_constants; layout(location = 0) out vec4 f_color; void main() { vec3 in_normal = normalize(subpassLoad(u_normals).rgb); // If the normal is perpendicular to the direction of the lighting, then `light_percent` will // be 0. If the normal is parallel to the direction of the lightin, then `light_percent` will // be 1. Any other angle will yield an intermediate value. float light_percent = -dot(push_constants.direction.xyz, in_normal); // `light_percent` must not go below 0.0. There's no such thing as negative lighting. light_percent = max(light_percent, 0.0); vec3 in_diffuse = subpassLoad(u_diffuse).rgb; f_color.rgb = light_percent * push_constants.color.rgb * in_diffuse; f_color.a = 1.0; }" } }
{ // TODO: vulkano doesn't allow us to draw without a vertex buffer, otherwise we could // hard-code these values in the shader let vertex_buffer = { CpuAccessibleBuffer::from_iter( gfx_queue.device().clone(), BufferUsage::all(), false, [ Vertex { position: [-1.0, -1.0], }, Vertex { position: [-1.0, 3.0], }, Vertex { position: [3.0, -1.0], }, ] .iter() .cloned(), ) .expect("failed to create buffer") }; let pipeline = { let vs = vs::Shader::load(gfx_queue.device().clone()) .expect("failed to create shader module"); let fs = fs::Shader::load(gfx_queue.device().clone()) .expect("failed to create shader module"); Arc::new( GraphicsPipeline::start() .vertex_input_single_buffer::<Vertex>() .vertex_shader(vs.main_entry_point(), ()) .triangle_list() .viewports_dynamic_scissors_irrelevant(1) .fragment_shader(fs.main_entry_point(), ()) .blend_collective(AttachmentBlend { enabled: true, color_op: BlendOp::Add, color_source: BlendFactor::One, color_destination: BlendFactor::One, alpha_op: BlendOp::Max, alpha_source: BlendFactor::One, alpha_destination: BlendFactor::One, mask_red: true, mask_green: true, mask_blue: true, mask_alpha: true, }) .render_pass(subpass) .build(gfx_queue.device().clone()) .unwrap(), ) as Arc<_> }; DirectionalLightingSystem { gfx_queue: gfx_queue, vertex_buffer: vertex_buffer, pipeline: pipeline, } }
auth.service.ts
import { ConflictException, Injectable, NotFoundException } from '@nestjs/common'; import { UserRegisterDto } from '../dto/user-register'; import * as bcrypt from 'bcrypt'; import { Repository } from 'typeorm'; import { UserEntity } from '../entities/user.entity'; import { InjectRepository } from '@nestjs/typeorm'; import { UserLoginDto } from '../dto/user-login'; import { JwtService } from '@nestjs/jwt'; @Injectable() export class
{ constructor( @InjectRepository(UserEntity) private userRepository: Repository<UserEntity>, private jwtService: JwtService ){} async register(userRegisterDto: UserRegisterDto): Promise<Partial<UserEntity>>{ const user = this.userRepository.create({ ...userRegisterDto }); user.salt = await bcrypt.genSalt(); user.password = await bcrypt.hash(user.password,user.salt); try{ await this.userRepository.save(user); } catch (e) { throw new ConflictException('email already exists'); } return { id: user.id, nom: user.nom, prenom: user.prenom, email: user.email, }; } async login(credentilas: UserLoginDto){ const { email, password} = credentilas; const user = await this.userRepository.findOne({email},{relations:['studentDetails','teacherDetails']}); if (!user){ throw new NotFoundException('email or password incorrent'); } else{ if ( await bcrypt.compare(password, user.password)){ const payload = { email: user.email, nom: user.nom, prenom: user.prenom, role:user.role, studentDetails : user.studentDetails, teacherDetails: user.teacherDetails, }; const jwt = this.jwtService.sign(payload); return { "access_token": jwt }; } else{ throw new NotFoundException('email or password wrong') } } } }
AuthService
one_shot.py
import torch.nn as nn import torch.nn.functional as F from . import register_nas_estimator from ..space import BaseSpace from .base import BaseEstimator @register_nas_estimator("oneshot") class
(BaseEstimator): """ One shot estimator. Use model directly to get estimations. """ def infer(self, model: BaseSpace, dataset, mask="train"): device = next(model.parameters()).device dset = dataset[0].to(device) pred = model(dset)[getattr(dset, f"{mask}_mask")] y = dset.y[getattr(dset, f"{mask}_mask")] loss = getattr(F, self.loss_f)(pred, y) # acc=sum(pred.max(1)[1]==y).item()/y.size(0) probs = F.softmax(pred, dim=1).detach().cpu().numpy() y = y.cpu() metrics = [eva.evaluate(probs, y) for eva in self.evaluation] return metrics, loss
OneShotEstimator
eslint.ts
import { CLIEngine } from 'eslint' import { Visitor } from 'babel-traverse' import { codeFrameError } from './utils' const cli = new CLIEngine({ baseConfig: { extends: ['plugin:taro/transformer'] }, useEslintrc: false, parser: 'babel-eslint', parserOptions: { ecmaVersion: 2018, ecmaFeatures: { jsx: true, legacyDecorators: true } } }) export const eslintValidation: () => { visitor: Visitor } = () => { return { visitor: { Program (_, state) {
for (const result of report.results) { for (const msg of result.messages) { const err = codeFrameError({ start: { line: msg.line, column: msg.column }, end: { line: msg.endLine, column: msg.endColumn } }, msg.message) // tslint:disable-next-line console.warn('\n' + `ESLint(${msg.ruleId}) 错误:` + err.message + '\n') } } } } } } }
const { file: { code } } = state const report = cli.executeOnText(code) if (report.errorCount > 0) {
pulumiTypes.go
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v20160516
"reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type ResourceSku struct { Capacity *int `pulumi:"capacity"` Name string `pulumi:"name"` Tier *string `pulumi:"tier"` } // ResourceSkuInput is an input type that accepts ResourceSkuArgs and ResourceSkuOutput values. // You can construct a concrete instance of `ResourceSkuInput` via: // // ResourceSkuArgs{...} type ResourceSkuInput interface { pulumi.Input ToResourceSkuOutput() ResourceSkuOutput ToResourceSkuOutputWithContext(context.Context) ResourceSkuOutput } type ResourceSkuArgs struct { Capacity pulumi.IntPtrInput `pulumi:"capacity"` Name pulumi.StringInput `pulumi:"name"` Tier pulumi.StringPtrInput `pulumi:"tier"` } func (ResourceSkuArgs) ElementType() reflect.Type { return reflect.TypeOf((*ResourceSku)(nil)).Elem() } func (i ResourceSkuArgs) ToResourceSkuOutput() ResourceSkuOutput { return i.ToResourceSkuOutputWithContext(context.Background()) } func (i ResourceSkuArgs) ToResourceSkuOutputWithContext(ctx context.Context) ResourceSkuOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuOutput) } func (i ResourceSkuArgs) ToResourceSkuPtrOutput() ResourceSkuPtrOutput { return i.ToResourceSkuPtrOutputWithContext(context.Background()) } func (i ResourceSkuArgs) ToResourceSkuPtrOutputWithContext(ctx context.Context) ResourceSkuPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuOutput).ToResourceSkuPtrOutputWithContext(ctx) } // ResourceSkuPtrInput is an input type that accepts ResourceSkuArgs, ResourceSkuPtr and ResourceSkuPtrOutput values. // You can construct a concrete instance of `ResourceSkuPtrInput` via: // // ResourceSkuArgs{...} // // or: // // nil type ResourceSkuPtrInput interface { pulumi.Input ToResourceSkuPtrOutput() ResourceSkuPtrOutput ToResourceSkuPtrOutputWithContext(context.Context) ResourceSkuPtrOutput } type resourceSkuPtrType ResourceSkuArgs func ResourceSkuPtr(v *ResourceSkuArgs) ResourceSkuPtrInput { return (*resourceSkuPtrType)(v) } func (*resourceSkuPtrType) ElementType() reflect.Type { return reflect.TypeOf((**ResourceSku)(nil)).Elem() } func (i *resourceSkuPtrType) ToResourceSkuPtrOutput() ResourceSkuPtrOutput { return i.ToResourceSkuPtrOutputWithContext(context.Background()) } func (i *resourceSkuPtrType) ToResourceSkuPtrOutputWithContext(ctx context.Context) ResourceSkuPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuPtrOutput) } type ResourceSkuOutput struct{ *pulumi.OutputState } func (ResourceSkuOutput) ElementType() reflect.Type { return reflect.TypeOf((*ResourceSku)(nil)).Elem() } func (o ResourceSkuOutput) ToResourceSkuOutput() ResourceSkuOutput { return o } func (o ResourceSkuOutput) ToResourceSkuOutputWithContext(ctx context.Context) ResourceSkuOutput { return o } func (o ResourceSkuOutput) ToResourceSkuPtrOutput() ResourceSkuPtrOutput { return o.ToResourceSkuPtrOutputWithContext(context.Background()) } func (o ResourceSkuOutput) ToResourceSkuPtrOutputWithContext(ctx context.Context) ResourceSkuPtrOutput { return o.ApplyTWithContext(ctx, func(_ context.Context, v ResourceSku) *ResourceSku { return &v }).(ResourceSkuPtrOutput) } func (o ResourceSkuOutput) Capacity() pulumi.IntPtrOutput { return o.ApplyT(func(v ResourceSku) *int { return v.Capacity }).(pulumi.IntPtrOutput) } func (o ResourceSkuOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v ResourceSku) string { return v.Name }).(pulumi.StringOutput) } func (o ResourceSkuOutput) Tier() pulumi.StringPtrOutput { return o.ApplyT(func(v ResourceSku) *string { return v.Tier }).(pulumi.StringPtrOutput) } type ResourceSkuPtrOutput struct{ *pulumi.OutputState } func (ResourceSkuPtrOutput) ElementType() reflect.Type { return reflect.TypeOf((**ResourceSku)(nil)).Elem() } func (o ResourceSkuPtrOutput) ToResourceSkuPtrOutput() ResourceSkuPtrOutput { return o } func (o ResourceSkuPtrOutput) ToResourceSkuPtrOutputWithContext(ctx context.Context) ResourceSkuPtrOutput { return o } func (o ResourceSkuPtrOutput) Elem() ResourceSkuOutput { return o.ApplyT(func(v *ResourceSku) ResourceSku { if v != nil { return *v } var ret ResourceSku return ret }).(ResourceSkuOutput) } func (o ResourceSkuPtrOutput) Capacity() pulumi.IntPtrOutput { return o.ApplyT(func(v *ResourceSku) *int { if v == nil { return nil } return v.Capacity }).(pulumi.IntPtrOutput) } func (o ResourceSkuPtrOutput) Name() pulumi.StringPtrOutput { return o.ApplyT(func(v *ResourceSku) *string { if v == nil { return nil } return &v.Name }).(pulumi.StringPtrOutput) } func (o ResourceSkuPtrOutput) Tier() pulumi.StringPtrOutput { return o.ApplyT(func(v *ResourceSku) *string { if v == nil { return nil } return v.Tier }).(pulumi.StringPtrOutput) } type ResourceSkuResponse struct { Capacity *int `pulumi:"capacity"` Name string `pulumi:"name"` Tier *string `pulumi:"tier"` } // ResourceSkuResponseInput is an input type that accepts ResourceSkuResponseArgs and ResourceSkuResponseOutput values. // You can construct a concrete instance of `ResourceSkuResponseInput` via: // // ResourceSkuResponseArgs{...} type ResourceSkuResponseInput interface { pulumi.Input ToResourceSkuResponseOutput() ResourceSkuResponseOutput ToResourceSkuResponseOutputWithContext(context.Context) ResourceSkuResponseOutput } type ResourceSkuResponseArgs struct { Capacity pulumi.IntPtrInput `pulumi:"capacity"` Name pulumi.StringInput `pulumi:"name"` Tier pulumi.StringPtrInput `pulumi:"tier"` } func (ResourceSkuResponseArgs) ElementType() reflect.Type { return reflect.TypeOf((*ResourceSkuResponse)(nil)).Elem() } func (i ResourceSkuResponseArgs) ToResourceSkuResponseOutput() ResourceSkuResponseOutput { return i.ToResourceSkuResponseOutputWithContext(context.Background()) } func (i ResourceSkuResponseArgs) ToResourceSkuResponseOutputWithContext(ctx context.Context) ResourceSkuResponseOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuResponseOutput) } func (i ResourceSkuResponseArgs) ToResourceSkuResponsePtrOutput() ResourceSkuResponsePtrOutput { return i.ToResourceSkuResponsePtrOutputWithContext(context.Background()) } func (i ResourceSkuResponseArgs) ToResourceSkuResponsePtrOutputWithContext(ctx context.Context) ResourceSkuResponsePtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuResponseOutput).ToResourceSkuResponsePtrOutputWithContext(ctx) } // ResourceSkuResponsePtrInput is an input type that accepts ResourceSkuResponseArgs, ResourceSkuResponsePtr and ResourceSkuResponsePtrOutput values. // You can construct a concrete instance of `ResourceSkuResponsePtrInput` via: // // ResourceSkuResponseArgs{...} // // or: // // nil type ResourceSkuResponsePtrInput interface { pulumi.Input ToResourceSkuResponsePtrOutput() ResourceSkuResponsePtrOutput ToResourceSkuResponsePtrOutputWithContext(context.Context) ResourceSkuResponsePtrOutput } type resourceSkuResponsePtrType ResourceSkuResponseArgs func ResourceSkuResponsePtr(v *ResourceSkuResponseArgs) ResourceSkuResponsePtrInput { return (*resourceSkuResponsePtrType)(v) } func (*resourceSkuResponsePtrType) ElementType() reflect.Type { return reflect.TypeOf((**ResourceSkuResponse)(nil)).Elem() } func (i *resourceSkuResponsePtrType) ToResourceSkuResponsePtrOutput() ResourceSkuResponsePtrOutput { return i.ToResourceSkuResponsePtrOutputWithContext(context.Background()) } func (i *resourceSkuResponsePtrType) ToResourceSkuResponsePtrOutputWithContext(ctx context.Context) ResourceSkuResponsePtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ResourceSkuResponsePtrOutput) } type ResourceSkuResponseOutput struct{ *pulumi.OutputState } func (ResourceSkuResponseOutput) ElementType() reflect.Type { return reflect.TypeOf((*ResourceSkuResponse)(nil)).Elem() } func (o ResourceSkuResponseOutput) ToResourceSkuResponseOutput() ResourceSkuResponseOutput { return o } func (o ResourceSkuResponseOutput) ToResourceSkuResponseOutputWithContext(ctx context.Context) ResourceSkuResponseOutput { return o } func (o ResourceSkuResponseOutput) ToResourceSkuResponsePtrOutput() ResourceSkuResponsePtrOutput { return o.ToResourceSkuResponsePtrOutputWithContext(context.Background()) } func (o ResourceSkuResponseOutput) ToResourceSkuResponsePtrOutputWithContext(ctx context.Context) ResourceSkuResponsePtrOutput { return o.ApplyTWithContext(ctx, func(_ context.Context, v ResourceSkuResponse) *ResourceSkuResponse { return &v }).(ResourceSkuResponsePtrOutput) } func (o ResourceSkuResponseOutput) Capacity() pulumi.IntPtrOutput { return o.ApplyT(func(v ResourceSkuResponse) *int { return v.Capacity }).(pulumi.IntPtrOutput) } func (o ResourceSkuResponseOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v ResourceSkuResponse) string { return v.Name }).(pulumi.StringOutput) } func (o ResourceSkuResponseOutput) Tier() pulumi.StringPtrOutput { return o.ApplyT(func(v ResourceSkuResponse) *string { return v.Tier }).(pulumi.StringPtrOutput) } type ResourceSkuResponsePtrOutput struct{ *pulumi.OutputState } func (ResourceSkuResponsePtrOutput) ElementType() reflect.Type { return reflect.TypeOf((**ResourceSkuResponse)(nil)).Elem() } func (o ResourceSkuResponsePtrOutput) ToResourceSkuResponsePtrOutput() ResourceSkuResponsePtrOutput { return o } func (o ResourceSkuResponsePtrOutput) ToResourceSkuResponsePtrOutputWithContext(ctx context.Context) ResourceSkuResponsePtrOutput { return o } func (o ResourceSkuResponsePtrOutput) Elem() ResourceSkuResponseOutput { return o.ApplyT(func(v *ResourceSkuResponse) ResourceSkuResponse { if v != nil { return *v } var ret ResourceSkuResponse return ret }).(ResourceSkuResponseOutput) } func (o ResourceSkuResponsePtrOutput) Capacity() pulumi.IntPtrOutput { return o.ApplyT(func(v *ResourceSkuResponse) *int { if v == nil { return nil } return v.Capacity }).(pulumi.IntPtrOutput) } func (o ResourceSkuResponsePtrOutput) Name() pulumi.StringPtrOutput { return o.ApplyT(func(v *ResourceSkuResponse) *string { if v == nil { return nil } return &v.Name }).(pulumi.StringPtrOutput) } func (o ResourceSkuResponsePtrOutput) Tier() pulumi.StringPtrOutput { return o.ApplyT(func(v *ResourceSkuResponse) *string { if v == nil { return nil } return v.Tier }).(pulumi.StringPtrOutput) } type ServerAdministrators struct { Members []string `pulumi:"members"` } // ServerAdministratorsInput is an input type that accepts ServerAdministratorsArgs and ServerAdministratorsOutput values. // You can construct a concrete instance of `ServerAdministratorsInput` via: // // ServerAdministratorsArgs{...} type ServerAdministratorsInput interface { pulumi.Input ToServerAdministratorsOutput() ServerAdministratorsOutput ToServerAdministratorsOutputWithContext(context.Context) ServerAdministratorsOutput } type ServerAdministratorsArgs struct { Members pulumi.StringArrayInput `pulumi:"members"` } func (ServerAdministratorsArgs) ElementType() reflect.Type { return reflect.TypeOf((*ServerAdministrators)(nil)).Elem() } func (i ServerAdministratorsArgs) ToServerAdministratorsOutput() ServerAdministratorsOutput { return i.ToServerAdministratorsOutputWithContext(context.Background()) } func (i ServerAdministratorsArgs) ToServerAdministratorsOutputWithContext(ctx context.Context) ServerAdministratorsOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsOutput) } func (i ServerAdministratorsArgs) ToServerAdministratorsPtrOutput() ServerAdministratorsPtrOutput { return i.ToServerAdministratorsPtrOutputWithContext(context.Background()) } func (i ServerAdministratorsArgs) ToServerAdministratorsPtrOutputWithContext(ctx context.Context) ServerAdministratorsPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsOutput).ToServerAdministratorsPtrOutputWithContext(ctx) } // ServerAdministratorsPtrInput is an input type that accepts ServerAdministratorsArgs, ServerAdministratorsPtr and ServerAdministratorsPtrOutput values. // You can construct a concrete instance of `ServerAdministratorsPtrInput` via: // // ServerAdministratorsArgs{...} // // or: // // nil type ServerAdministratorsPtrInput interface { pulumi.Input ToServerAdministratorsPtrOutput() ServerAdministratorsPtrOutput ToServerAdministratorsPtrOutputWithContext(context.Context) ServerAdministratorsPtrOutput } type serverAdministratorsPtrType ServerAdministratorsArgs func ServerAdministratorsPtr(v *ServerAdministratorsArgs) ServerAdministratorsPtrInput { return (*serverAdministratorsPtrType)(v) } func (*serverAdministratorsPtrType) ElementType() reflect.Type { return reflect.TypeOf((**ServerAdministrators)(nil)).Elem() } func (i *serverAdministratorsPtrType) ToServerAdministratorsPtrOutput() ServerAdministratorsPtrOutput { return i.ToServerAdministratorsPtrOutputWithContext(context.Background()) } func (i *serverAdministratorsPtrType) ToServerAdministratorsPtrOutputWithContext(ctx context.Context) ServerAdministratorsPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsPtrOutput) } type ServerAdministratorsOutput struct{ *pulumi.OutputState } func (ServerAdministratorsOutput) ElementType() reflect.Type { return reflect.TypeOf((*ServerAdministrators)(nil)).Elem() } func (o ServerAdministratorsOutput) ToServerAdministratorsOutput() ServerAdministratorsOutput { return o } func (o ServerAdministratorsOutput) ToServerAdministratorsOutputWithContext(ctx context.Context) ServerAdministratorsOutput { return o } func (o ServerAdministratorsOutput) ToServerAdministratorsPtrOutput() ServerAdministratorsPtrOutput { return o.ToServerAdministratorsPtrOutputWithContext(context.Background()) } func (o ServerAdministratorsOutput) ToServerAdministratorsPtrOutputWithContext(ctx context.Context) ServerAdministratorsPtrOutput { return o.ApplyTWithContext(ctx, func(_ context.Context, v ServerAdministrators) *ServerAdministrators { return &v }).(ServerAdministratorsPtrOutput) } func (o ServerAdministratorsOutput) Members() pulumi.StringArrayOutput { return o.ApplyT(func(v ServerAdministrators) []string { return v.Members }).(pulumi.StringArrayOutput) } type ServerAdministratorsPtrOutput struct{ *pulumi.OutputState } func (ServerAdministratorsPtrOutput) ElementType() reflect.Type { return reflect.TypeOf((**ServerAdministrators)(nil)).Elem() } func (o ServerAdministratorsPtrOutput) ToServerAdministratorsPtrOutput() ServerAdministratorsPtrOutput { return o } func (o ServerAdministratorsPtrOutput) ToServerAdministratorsPtrOutputWithContext(ctx context.Context) ServerAdministratorsPtrOutput { return o } func (o ServerAdministratorsPtrOutput) Elem() ServerAdministratorsOutput { return o.ApplyT(func(v *ServerAdministrators) ServerAdministrators { if v != nil { return *v } var ret ServerAdministrators return ret }).(ServerAdministratorsOutput) } func (o ServerAdministratorsPtrOutput) Members() pulumi.StringArrayOutput { return o.ApplyT(func(v *ServerAdministrators) []string { if v == nil { return nil } return v.Members }).(pulumi.StringArrayOutput) } type ServerAdministratorsResponse struct { Members []string `pulumi:"members"` } // ServerAdministratorsResponseInput is an input type that accepts ServerAdministratorsResponseArgs and ServerAdministratorsResponseOutput values. // You can construct a concrete instance of `ServerAdministratorsResponseInput` via: // // ServerAdministratorsResponseArgs{...} type ServerAdministratorsResponseInput interface { pulumi.Input ToServerAdministratorsResponseOutput() ServerAdministratorsResponseOutput ToServerAdministratorsResponseOutputWithContext(context.Context) ServerAdministratorsResponseOutput } type ServerAdministratorsResponseArgs struct { Members pulumi.StringArrayInput `pulumi:"members"` } func (ServerAdministratorsResponseArgs) ElementType() reflect.Type { return reflect.TypeOf((*ServerAdministratorsResponse)(nil)).Elem() } func (i ServerAdministratorsResponseArgs) ToServerAdministratorsResponseOutput() ServerAdministratorsResponseOutput { return i.ToServerAdministratorsResponseOutputWithContext(context.Background()) } func (i ServerAdministratorsResponseArgs) ToServerAdministratorsResponseOutputWithContext(ctx context.Context) ServerAdministratorsResponseOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsResponseOutput) } func (i ServerAdministratorsResponseArgs) ToServerAdministratorsResponsePtrOutput() ServerAdministratorsResponsePtrOutput { return i.ToServerAdministratorsResponsePtrOutputWithContext(context.Background()) } func (i ServerAdministratorsResponseArgs) ToServerAdministratorsResponsePtrOutputWithContext(ctx context.Context) ServerAdministratorsResponsePtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsResponseOutput).ToServerAdministratorsResponsePtrOutputWithContext(ctx) } // ServerAdministratorsResponsePtrInput is an input type that accepts ServerAdministratorsResponseArgs, ServerAdministratorsResponsePtr and ServerAdministratorsResponsePtrOutput values. // You can construct a concrete instance of `ServerAdministratorsResponsePtrInput` via: // // ServerAdministratorsResponseArgs{...} // // or: // // nil type ServerAdministratorsResponsePtrInput interface { pulumi.Input ToServerAdministratorsResponsePtrOutput() ServerAdministratorsResponsePtrOutput ToServerAdministratorsResponsePtrOutputWithContext(context.Context) ServerAdministratorsResponsePtrOutput } type serverAdministratorsResponsePtrType ServerAdministratorsResponseArgs func ServerAdministratorsResponsePtr(v *ServerAdministratorsResponseArgs) ServerAdministratorsResponsePtrInput { return (*serverAdministratorsResponsePtrType)(v) } func (*serverAdministratorsResponsePtrType) ElementType() reflect.Type { return reflect.TypeOf((**ServerAdministratorsResponse)(nil)).Elem() } func (i *serverAdministratorsResponsePtrType) ToServerAdministratorsResponsePtrOutput() ServerAdministratorsResponsePtrOutput { return i.ToServerAdministratorsResponsePtrOutputWithContext(context.Background()) } func (i *serverAdministratorsResponsePtrType) ToServerAdministratorsResponsePtrOutputWithContext(ctx context.Context) ServerAdministratorsResponsePtrOutput { return pulumi.ToOutputWithContext(ctx, i).(ServerAdministratorsResponsePtrOutput) } type ServerAdministratorsResponseOutput struct{ *pulumi.OutputState } func (ServerAdministratorsResponseOutput) ElementType() reflect.Type { return reflect.TypeOf((*ServerAdministratorsResponse)(nil)).Elem() } func (o ServerAdministratorsResponseOutput) ToServerAdministratorsResponseOutput() ServerAdministratorsResponseOutput { return o } func (o ServerAdministratorsResponseOutput) ToServerAdministratorsResponseOutputWithContext(ctx context.Context) ServerAdministratorsResponseOutput { return o } func (o ServerAdministratorsResponseOutput) ToServerAdministratorsResponsePtrOutput() ServerAdministratorsResponsePtrOutput { return o.ToServerAdministratorsResponsePtrOutputWithContext(context.Background()) } func (o ServerAdministratorsResponseOutput) ToServerAdministratorsResponsePtrOutputWithContext(ctx context.Context) ServerAdministratorsResponsePtrOutput { return o.ApplyTWithContext(ctx, func(_ context.Context, v ServerAdministratorsResponse) *ServerAdministratorsResponse { return &v }).(ServerAdministratorsResponsePtrOutput) } func (o ServerAdministratorsResponseOutput) Members() pulumi.StringArrayOutput { return o.ApplyT(func(v ServerAdministratorsResponse) []string { return v.Members }).(pulumi.StringArrayOutput) } type ServerAdministratorsResponsePtrOutput struct{ *pulumi.OutputState } func (ServerAdministratorsResponsePtrOutput) ElementType() reflect.Type { return reflect.TypeOf((**ServerAdministratorsResponse)(nil)).Elem() } func (o ServerAdministratorsResponsePtrOutput) ToServerAdministratorsResponsePtrOutput() ServerAdministratorsResponsePtrOutput { return o } func (o ServerAdministratorsResponsePtrOutput) ToServerAdministratorsResponsePtrOutputWithContext(ctx context.Context) ServerAdministratorsResponsePtrOutput { return o } func (o ServerAdministratorsResponsePtrOutput) Elem() ServerAdministratorsResponseOutput { return o.ApplyT(func(v *ServerAdministratorsResponse) ServerAdministratorsResponse { if v != nil { return *v } var ret ServerAdministratorsResponse return ret }).(ServerAdministratorsResponseOutput) } func (o ServerAdministratorsResponsePtrOutput) Members() pulumi.StringArrayOutput { return o.ApplyT(func(v *ServerAdministratorsResponse) []string { if v == nil { return nil } return v.Members }).(pulumi.StringArrayOutput) } func init() { pulumi.RegisterOutputType(ResourceSkuOutput{}) pulumi.RegisterOutputType(ResourceSkuPtrOutput{}) pulumi.RegisterOutputType(ResourceSkuResponseOutput{}) pulumi.RegisterOutputType(ResourceSkuResponsePtrOutput{}) pulumi.RegisterOutputType(ServerAdministratorsOutput{}) pulumi.RegisterOutputType(ServerAdministratorsPtrOutput{}) pulumi.RegisterOutputType(ServerAdministratorsResponseOutput{}) pulumi.RegisterOutputType(ServerAdministratorsResponsePtrOutput{}) }
import ( "context"
superset_test_config.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # type: ignore from copy import copy from superset.config import * from tests.superset_test_custom_template_processors import CustomPrestoTemplateProcessor AUTH_USER_REGISTRATION_ROLE = "alpha" SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db") DEBUG = True SUPERSET_WEBSERVER_PORT = 8081 # Allowing SQLALCHEMY_DATABASE_URI and SQLALCHEMY_EXAMPLES_URI to be defined as an env vars for # continuous integration if "SUPERSET__SQLALCHEMY_DATABASE_URI" in os.environ: SQLALCHEMY_DATABASE_URI = os.environ["SUPERSET__SQLALCHEMY_DATABASE_URI"] SQLALCHEMY_EXAMPLES_URI = SQLALCHEMY_DATABASE_URI if "SUPERSET__SQLALCHEMY_EXAMPLES_URI" in os.environ: SQLALCHEMY_EXAMPLES_URI = os.environ["SUPERSET__SQLALCHEMY_EXAMPLES_URI"] if "UPLOAD_FOLDER" in os.environ: UPLOAD_FOLDER = os.environ["UPLOAD_FOLDER"] if "sqlite" in SQLALCHEMY_DATABASE_URI: logger.warning( "SQLite Database support for metadata databases will be " "removed in a future version of Superset." ) # Speeding up the tests. PRESTO_POLL_INTERVAL = 0.1 HIVE_POLL_INTERVAL = 0.1 SQL_MAX_ROW = 666 SQLLAB_CTAS_NO_LIMIT = True # SQL_MAX_ROW will not take affect for the CTA queries FEATURE_FLAGS = { **FEATURE_FLAGS, "foo": "bar", "KV_STORE": True, "SHARE_QUERIES_VIA_KV_STORE": True, "ENABLE_TEMPLATE_PROCESSING": True, "ENABLE_REACT_CRUD_VIEWS": os.environ.get("ENABLE_REACT_CRUD_VIEWS", False), "ROW_LEVEL_SECURITY": True, } def GET_FEATURE_FLAGS_FUNC(ff): ff_copy = copy(ff) ff_copy["super"] = "set" return ff_copy TESTING = True WTF_CSRF_ENABLED = False FAB_ROLES = {"TestRole": [["Security", "menu_access"], ["List Users", "menu_access"]]} PUBLIC_ROLE_LIKE = "Gamma" AUTH_ROLE_PUBLIC = "Public" EMAIL_NOTIFICATIONS = False CACHE_CONFIG = {"CACHE_TYPE": "simple"} REDIS_HOST = os.environ.get("REDIS_HOST", "localhost") REDIS_PORT = os.environ.get("REDIS_PORT", "6379") REDIS_CELERY_DB = os.environ.get("REDIS_CELERY_DB", 2) REDIS_RESULTS_DB = os.environ.get("REDIS_RESULTS_DB", 3) REDIS_CACHE_DB = os.environ.get("REDIS_CACHE_DB", 4) CACHE_CONFIG = { "CACHE_TYPE": "redis", "CACHE_DEFAULT_TIMEOUT": 60 * 60 * 24, # 1 day default (in secs) "CACHE_KEY_PREFIX": "superset_cache", "CACHE_REDIS_URL": f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CACHE_DB}", } class
(object): BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" CELERY_IMPORTS = ("superset.sql_lab",) CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}" CELERY_ANNOTATIONS = {"sql_lab.add": {"rate_limit": "10/s"}} CONCURRENCY = 1 CELERY_CONFIG = CeleryConfig CUSTOM_TEMPLATE_PROCESSORS = { CustomPrestoTemplateProcessor.engine: CustomPrestoTemplateProcessor } PRESERVE_CONTEXT_ON_EXCEPTION = False
CeleryConfig
keys.rs
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or distributed except according to those terms. Please review the Licences for the // specific language governing permissions and limitations relating to use of the SAFE Network // Software. use super::{ common::ed_sk_from_hex, helpers::{parse_coins_amount, pk_from_hex}, safeurl::{SafeContentType, SafeDataType, SafeUrl}, Safe, }; use crate::{Error, Result}; use hex::encode; use rand::rngs::OsRng; use sn_data_types::{Keypair, SecretKey, Token}; use xor_name::XorName; impl Safe { // Generate a key pair pub fn generate_random_ed_keypair(&self) -> Keypair { let mut rng = OsRng; Keypair::new_ed25519(&mut rng) } // Create a SafeKey allocating token from current client's key onto it, // and return the SafeKey's XOR-URL pub async fn keys_create_and_preload( &mut self, preload_amount: &str, ) -> Result<(String, Keypair)> { let amount = parse_coins_amount(preload_amount)?; let new_keypair = self.generate_random_ed_keypair(); // let's make the transfer let _ = self .safe_client .safecoin_transfer_to_pk(None, new_keypair.public_key(), amount) .await?; let xorname = XorName::from(new_keypair.public_key()); let xorurl = SafeUrl::encode_safekey(xorname, self.xorurl_base)?; Ok((xorurl, new_keypair)) } // Create a SafeKey preloaded from another key and return its XOR-URL. pub async fn keys_create_and_preload_from_sk_string( &mut self, from: &str, preload_amount: &str, ) -> Result<(String, Keypair)> { let from_keypair = match ed_sk_from_hex(&from) { Ok(sk) => Keypair::from(sk), Err(_) => return Err(Error::InvalidInput( "The source of funds needs to be an Ed25519 secret key. The secret key provided is invalid" .to_string(), )), }; let amount = parse_coins_amount(&preload_amount)?; let new_keypair = self.generate_random_ed_keypair(); // let's make the transfer let _ = self .safe_client .safecoin_transfer_to_pk(Some(from_keypair), new_keypair.public_key(), amount) .await?; let xorname = XorName::from(new_keypair.public_key()); let xorurl = SafeUrl::encode_safekey(xorname, self.xorurl_base)?; Ok((xorurl, new_keypair)) } #[cfg(feature = "simulated-payouts")] // Create a SafeKey on the network, allocates testcoins onto it, and return the SafeKey's XOR-URL pub async fn keys_create_preload_test_coins( &mut self, preload_amount: &str, ) -> Result<(String, Keypair)> { let amount = parse_coins_amount(preload_amount)?; let keypair = self.generate_random_ed_keypair(); self.safe_client .trigger_simulated_farming_payout(amount, Some(keypair.clone())) .await?; let xorname = XorName::from(keypair.public_key()); let xorurl = SafeUrl::encode_safekey(xorname, self.xorurl_base)?; Ok((xorurl, keypair)) } // Check SafeKey's balance from the network from a given SecretKey string pub async fn keys_balance_from_sk(&self, secret_key: SecretKey) -> Result<String> { let keypair = match secret_key { SecretKey::Ed25519(sk) => Keypair::from(sk), SecretKey::BlsShare(_) => { return Err(Error::InvalidInput( "Cannot convert from BlsShare key to a Keypair".to_string(), )) } }; let balance = self.safe_client.read_balance_from_keypair(keypair).await?; Ok(balance.to_string()) } // Check SafeKey's balance from the network from a given XOR/NRS-URL and secret key string. // The difference between this and 'keys_balance_from_sk' function is that this will additionally // check that the XOR/NRS-URL corresponds to the public key derived from the provided secret key pub async fn keys_balance_from_url( &mut self, url: &str, secret_key: SecretKey, ) -> Result<String> { self.validate_sk_for_url(&secret_key, url).await?; self.keys_balance_from_sk(secret_key).await } // Check that the XOR/NRS-URL corresponds to the public key derived from the provided client id pub async fn validate_sk_for_url( &mut self, secret_key: &SecretKey, url: &str, ) -> Result<String> { let derived_xorname = match secret_key { SecretKey::Ed25519(sk) => { let pk: ed25519_dalek::PublicKey = sk.into(); XorName(pk.to_bytes()) } _ => { return Err(Error::InvalidInput( "Cannot form a keypair from a BlsKeyShare at this time.".to_string(), )) } }; let (safeurl, _) = self.parse_and_resolve_url(url).await?; if safeurl.xorname() != derived_xorname { Err(Error::InvalidInput( "The URL doesn't correspond to the public key derived from the provided secret key" .to_string(), )) } else { Ok(encode(&derived_xorname)) } } /// # Transfer safecoins from one SafeKey to another, to a Wallet, or to a PublicKey /// /// Using a secret key you can send safecoins to a SafeKey, Wallet, or PublicKey. /// /// ## Example /// ``` /// # use sn_api::Safe; /// let mut safe = Safe::default(); /// # async_std::task::block_on(async { /// # safe.connect("", Some("fake-credentials")).await.unwrap(); /// let (key1_xorurl, keypair1) = safe.keys_create_preload_test_coins("14").await.unwrap(); /// let (key2_xorurl, keypair2) = safe.keys_create_preload_test_coins("1").await.unwrap(); /// let current_balance = safe.keys_balance_from_sk(keypair1.clone().unwrap().sk).await.unwrap(); /// assert_eq!("14.000000000", current_balance); /// /// safe.keys_transfer( "10", Some(&keypair1.clone().unwrap().sk), &key2_xorurl, None ).await.unwrap(); /// let from_balance = safe.keys_balance_from_url( &key1_xorurl, &keypair1.unwrap().sk ).await.unwrap(); /// assert_eq!("4.000000000", from_balance); /// let to_balance = safe.keys_balance_from_url( &key2_xorurl, &keypair2.unwrap().sk ).await.unwrap(); /// assert_eq!("11.000000000", to_balance); /// # }); /// ``` pub async fn keys_transfer( &mut self, amount: &str, from_sk_str: Option<&str>, to: &str, ) -> Result<u64> { // Parse and validate the amount is a valid let amount_coins = parse_coins_amount(amount)?; let from = match &from_sk_str { Some(sk) => Some(Keypair::from(ed_sk_from_hex(sk)?)), None => None, }; let result = if to.starts_with("safe://") { self.transfer_to_url(from, to, amount_coins).await } else { // ...let's assume the 'to' is a PublicKey then match pk_from_hex(to) { Ok(to_pk) => { // and let's make the transfer self.safe_client .safecoin_transfer_to_pk(from, to_pk, amount_coins) .await } Err(_) => { // ...last chance, let's fall back to try it as a URL self.transfer_to_url(from, to, amount_coins).await } } }; match result { Err(Error::NotEnoughBalance(_)) => { let msg = if from_sk_str.is_some() { "Not enough balance for the transfer at provided source SafeKey".to_string() } else { "Not enough balance for the transfer".to_string() }; Err(Error::NotEnoughBalance(msg)) } Err(other_error) => Err(other_error), Ok(id) => Ok(id), } } async fn transfer_to_url( &mut self, from: Option<Keypair>, to: &str, amount_coins: Token, ) -> Result<u64> { // Let's check if the 'to' is a valid Wallet or a SafeKey URL let (to_safe_url, _) = self .parse_and_resolve_url(to) .await .map_err(|_| Error::InvalidInput(format!("Failed to parse the 'to' URL: {}", to)))?; let to_xorname = if to_safe_url.content_type() == SafeContentType::Wallet { let (to_balance, _) = self .wallet_get_default_balance(&to_safe_url.to_string()) .await?; SafeUrl::from_url(&to_balance.xorurl)?.xorname() } else if to_safe_url.content_type() == SafeContentType::Raw && to_safe_url.data_type() == SafeDataType::SafeKey { to_safe_url.xorname() } else { return Err(Error::InvalidInput(format!( "The destination URL doesn't target a SafeKey or Wallet, target is: {:?} ({})", to_safe_url.content_type(), to_safe_url.data_type() ))); }; // Finally, let's make the transfer self.safe_client .safecoin_transfer_to_xorname(from, to_xorname, amount_coins) .await } } #[cfg(all(test, feature = "simulated-payouts"))] mod tests { use super::*; use crate::{ api::{ app::test_helpers::{new_safe_instance, random_nrs_name}, common::sk_to_hex, }, retry_loop, }; use anyhow::{anyhow, bail, Result}; #[tokio::test] async fn test_keys_create_preload_test_coins() -> Result<()> { let mut safe = new_safe_instance().await?; let _ = safe.keys_create_preload_test_coins("12.23").await?; Ok(()) } #[tokio::test] async fn test_keys_create_and_preload_from_sk_string() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, from_keypair) = safe.keys_create_preload_test_coins("543.2312").await?; let from_sk_hex = sk_to_hex(from_keypair.secret_key()?); let preload_amount = "1.800000000"; let (_, keypair) = safe .keys_create_and_preload_from_sk_string(&from_sk_hex, preload_amount) .await?; let balance = safe.keys_balance_from_sk(keypair.secret_key()?).await?; assert_eq!(balance, preload_amount); Ok(()) } #[tokio::test] async fn test_keys_create_preload_invalid_amounts() -> Result<()> { let mut safe = new_safe_instance().await?; match safe.keys_create_preload_test_coins(".45").await { Ok(_) => { bail!("Key with test-coins was created unexpectedly".to_string(),) } Err(Error::InvalidAmount(msg)) => assert_eq!( msg, "Invalid safecoins amount '.45' (Can\'t parse token units)".to_string() ), other => bail!("Error returned is not the expected one: {:?}", other), }; let (_, keypair) = safe.keys_create_preload_test_coins("12").await?; let mut sk_hex = sk_to_hex(keypair.secret_key()?); match safe .keys_create_and_preload_from_sk_string(&sk_hex, ".003") .await { Ok(_) => { bail!("Key was created unexpectedly".to_string(),) } Err(Error::InvalidAmount(msg)) => assert_eq!( msg, "Invalid safecoins amount '.003' (Can\'t parse token units)".to_string() ), other => bail!("Error returned is not the expected one: {:?}", other), }; // test it fails with corrupted secret key sk_hex.replace_range(..6, "ababab"); match safe .keys_create_and_preload_from_sk_string(&sk_hex, ".003") .await { Ok(_) => { bail!("Key was created unexpectedly".to_string(),) } Err(Error::InvalidAmount(msg)) => assert_eq!( msg, "Invalid safecoins amount '.003' (Can\'t parse token units)".to_string() ), other => bail!("Error returned is not the expected one: {:?}", other), }; // test it fails to preload with more than available balance in source (which has only 12 coins) let amount = "12.000000001"; match safe .keys_create_and_preload_from_sk_string(&sk_hex, amount) .await { Ok(_) => Err(anyhow!("Key was created unexpectedly".to_string(),)), Err(Error::NotEnoughBalance(msg)) => { assert_eq!( msg, format!( "Not enough balance at 'source' for the operation: {}", amount ) ); Ok(()) } other => Err(anyhow!( "Error returned is not the expected one: {:?}", other )), } } #[tokio::test] async fn test_keys_create_pk() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, from_keypair) = safe.keys_create_preload_test_coins("1.1").await?; let from_sk_hex = sk_to_hex(from_keypair.secret_key()?); let _ = safe .keys_create_and_preload_from_sk_string(&from_sk_hex, "0.1") .await?; Ok(()) } #[tokio::test] async fn test_keys_test_coins_balance_pk() -> Result<()> { let mut safe = new_safe_instance().await?; let preload_amount = "1.154200000"; let (_, keypair) = safe.keys_create_preload_test_coins(preload_amount).await?; let current_balance = safe.keys_balance_from_sk(keypair.secret_key()?).await?; assert_eq!(preload_amount, current_balance); Ok(()) } #[tokio::test] async fn test_keys_test_coins_balance_xorurl() -> Result<()> { let mut safe = new_safe_instance().await?; let preload_amount = "0.243000000"; let (xorurl, keypair) = safe.keys_create_preload_test_coins(preload_amount).await?; let current_balance = safe .keys_balance_from_url(&xorurl, keypair.secret_key()?) .await?; assert_eq!(preload_amount, current_balance); Ok(()) } #[tokio::test] async fn test_keys_test_coins_balance_wrong_url() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, keypair) = safe.keys_create_preload_test_coins("0").await?; let invalid_xorurl = "safe://this-is-not-a-valid-xor-url"; let current_balance = safe .keys_balance_from_url(&invalid_xorurl, keypair.secret_key()?) .await; match current_balance { Err(Error::ContentNotFound(msg)) => { assert!(msg.contains(&format!("Content not found at {}", invalid_xorurl))); Ok(()) } Err(err) => Err(anyhow!("Error returned is not the expected: {:?}", err)), Ok(balance) => Err(anyhow!("Unexpected balance obtained: {:?}", balance)), } } #[tokio::test] async fn test_keys_test_coins_balance_wrong_location() -> Result<()> { let mut safe = new_safe_instance().await?; let amount = "35312.000000000"; let (xorurl, keypair) = safe.keys_create_preload_test_coins(amount).await?; let current_balance = safe .keys_balance_from_url(&xorurl, keypair.secret_key()?) .await?; assert_eq!(amount, current_balance); // let's use the XOR-URL of another SafeKey let (other_kp_xorurl, _) = safe.keys_create_preload_test_coins("0").await?; let current_balance = safe .keys_balance_from_url(&other_kp_xorurl, keypair.secret_key()?) .await; match current_balance { Err(Error::InvalidInput(msg)) => { assert!(msg.contains( "The URL doesn't correspond to the public key derived from the provided secret key" )); Ok(()) } Err(err) => Err(anyhow!("Error returned is not the expected: {:?}", err)), Ok(balance) => Err(anyhow!("Unexpected balance obtained: {:?}", balance)), } } #[tokio::test] async fn test_keys_test_coins_balance_wrong_sk() -> Result<()> { let mut safe = new_safe_instance().await?; let (xorurl, _) = safe.keys_create_preload_test_coins("0").await?; let mut rng = OsRng; let sk = Keypair::new_ed25519(&mut rng).secret_key()?; let current_balance = safe.keys_balance_from_url(&xorurl, sk).await; match current_balance { Err(Error::InvalidInput(msg)) => { assert_eq!(msg, "The URL doesn't correspond to the public key derived from the provided secret key"); Ok(()) } Err(err) => Err(anyhow!("Error returned is not the expected: {:?}", err)), Ok(balance) => Err(anyhow!("Unexpected balance obtained: {:?}", balance)), } } #[tokio::test] async fn test_keys_balance_pk() -> Result<()> { let mut safe = new_safe_instance().await?; let preload_amount = "1743.234"; let (_, from_keypair) = safe.keys_create_preload_test_coins(preload_amount).await?; let from_sk_hex = sk_to_hex(from_keypair.secret_key()?); let amount = "1740.000000000"; let (_, to_keypair) = safe .keys_create_and_preload_from_sk_string(&from_sk_hex, amount) .await?; let from_current_balance = safe .keys_balance_from_sk(from_keypair.secret_key()?) .await?; assert_eq!( "3.234000000", /*== 1743.234 - 1740 */ from_current_balance ); let to_current_balance = safe.keys_balance_from_sk(to_keypair.secret_key()?).await?; assert_eq!(amount, to_current_balance); Ok(()) } #[tokio::test] async fn test_keys_balance_xorname() -> Result<()> { let mut safe = new_safe_instance().await?; let preload_amount = "435.34"; let (from_xorname, from_keypair) = safe.keys_create_preload_test_coins(preload_amount).await?; let from_sk_hex = sk_to_hex(from_keypair.secret_key()?); let amount = "35.300000000"; let (to_xorname, to_keypair) = safe .keys_create_and_preload_from_sk_string(&from_sk_hex, amount) .await?; let from_current_balance = safe .keys_balance_from_url(&from_xorname, from_keypair.secret_key()?) .await?; assert_eq!( "400.040000000", /*== 435.34 - 35.3*/ from_current_balance ); let to_current_balance = safe .keys_balance_from_url(&to_xorname, to_keypair.secret_key()?) .await?; assert_eq!(amount, to_current_balance); Ok(()) } #[tokio::test] async fn test_keys_validate_sk_for_url() -> Result<()> { let mut safe = new_safe_instance().await?; let (xorurl, keypair) = safe.keys_create_preload_test_coins("23.22").await?; let pk = safe .validate_sk_for_url(&keypair.secret_key()?, &xorurl) .await?; assert_eq!(pk, encode(keypair.public_key().to_bytes())); Ok(()) } #[tokio::test] async fn test_keys_transfer_from_zero_balance() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, keypair1) = safe.keys_create_preload_test_coins("0.0").await?; let from_sk1_hex = sk_to_hex(keypair1.secret_key()?); let (to_safekey_xorurl, _keypair2) = safe.keys_create_preload_test_coins("0.5").await?; // test it fails to transfer with 0 balance at SafeKey in <from> argument match safe .keys_transfer("0", Some(&from_sk1_hex), &to_safekey_xorurl) .await { Err(Error::InvalidAmount(msg)) => { assert!(msg.contains("Cannot send zero-value transfers")); Ok(()) } Err(err) => Err(anyhow!("Error returned is not the expected: {:?}", err)), Ok(_) => Err(anyhow!("Transfer succeeded unexpectedly".to_string(),)), } } #[tokio::test] async fn test_keys_transfer_diff_amounts() -> Result<()> { let mut safe = new_safe_instance().await?; let (safekey1_xorurl, keypair1) = safe.keys_create_preload_test_coins("0.5").await?; let from_sk1_hex = sk_to_hex(keypair1.secret_key()?); let (safekey2_xorurl, keypair2) = safe.keys_create_preload_test_coins("100.5").await?; let from_sk2_hex = sk_to_hex(keypair2.secret_key()?); // test it fails to transfer more than current balance at SafeKey in <from> argument match safe .keys_transfer("100.6", Some(&from_sk1_hex), &safekey2_xorurl) .await { Err(Error::NotEnoughBalance(msg)) => assert_eq!( msg, "Not enough balance for the transfer at provided source SafeKey".to_string() ), Err(err) => { bail!("Error returned is not the expected: {:?}", err) } Ok(_) => { bail!("Transfer succeeded unexpectedly".to_string(),) } }; // test it fails to transfer as it's a invalid/non-numeric amount match safe .keys_transfer(".06", Some(&from_sk2_hex), &safekey2_xorurl) .await { Err(Error::InvalidAmount(msg)) => assert_eq!( msg, "Invalid safecoins amount '.06' (Can\'t parse token units)" ), Err(err) => { bail!("Error returned is not the expected: {:?}", err) } Ok(_) => { bail!("Transfer succeeded unexpectedly".to_string(),) } }; // test it fails to transfer less than 1 nano coin match safe.keys_transfer( "0.0000000009", Some(&from_sk2_hex), &safekey2_xorurl, ).await { Err(Error::InvalidAmount(msg)) => assert_eq!(msg, "Invalid safecoins amount '0.0000000009', the minimum possible amount is one nano coin (0.000000001)"), Err(err) => bail!("Error returned is not the expected: {:?}", err), Ok(_) => bail!("Transfer succeeded unexpectedly".to_string()), }; // test successful transfer match safe .keys_transfer("100.4", Some(&from_sk2_hex), &safekey1_xorurl) .await { Err(msg) => Err(anyhow!("Transfer was expected to succeed: {}", msg)), Ok(_) => { let from_current_balance = safe.keys_balance_from_sk(keypair2.secret_key()?).await?; assert_eq!("0.100000000", from_current_balance); let to_current_balance = safe.keys_balance_from_sk(keypair1.secret_key()?).await?; assert_eq!("100.900000000", to_current_balance); Ok(()) } } } #[tokio::test] async fn test_keys_transfer_to_wallet() -> Result<()> { let mut safe = new_safe_instance().await?; let to_wallet_xorurl = safe.wallet_create().await?; let (_, keypair1) = safe.keys_create_preload_test_coins("10.0").await?; let sk1_hex = sk_to_hex(keypair1.secret_key()?); safe.wallet_insert( &to_wallet_xorurl, Some("my-first-balance"), true, // set --default &sk1_hex, ) .await?; let (_, keypair2) = safe.keys_create_preload_test_coins("4621.45").await?; let sk2_hex = sk_to_hex(keypair2.secret_key()?); // test successful transfer match safe .keys_transfer("523.87", Some(&sk2_hex), &to_wallet_xorurl.clone()) .await { Err(msg) => Err(anyhow!("Transfer was expected to succeed: {}", msg)), Ok(_) => { let from_current_balance = safe.keys_balance_from_sk(keypair2.secret_key()?).await?; assert_eq!( "4097.580000000", /* 4621.45 - 523.87 */ from_current_balance ); let wallet_current_balance = safe.wallet_balance(&to_wallet_xorurl).await?; assert_eq!("533.870000000", wallet_current_balance); Ok(()) } } } #[tokio::test] async fn test_keys_transfer_to_nrs_urls() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, keypair1) = safe.keys_create_preload_test_coins("0.2").await?; let from_sk1_hex = sk_to_hex(keypair1.secret_key()?); let (to_safekey_xorurl, keypair2) = safe.keys_create_preload_test_coins("0.1").await?; let to_nrs_name = random_nrs_name(); let (xorurl, _, _) = safe .nrs_map_container_create(&to_nrs_name, &to_safekey_xorurl, false, true, false) .await?; let _ = retry_loop!(safe.fetch(&xorurl, None)); // test successful transfer let _ = safe .keys_transfer( "0.2",
Some(&from_sk1_hex), &format!("safe://{}", to_nrs_name), ) .await?; let from_current_balance = safe.keys_balance_from_sk(keypair1.secret_key()?).await?; assert_eq!("0.000000000" /* 0.2 - 0.2 */, from_current_balance); let to_current_balance = safe.keys_balance_from_sk(keypair2.secret_key()?).await?; assert_eq!("0.300000000" /* 0.1 + 0.2 */, to_current_balance); Ok(()) } #[tokio::test] async fn test_keys_transfer_to_pk() -> Result<()> { let mut safe = new_safe_instance().await?; let (_, keypair1) = safe.keys_create_preload_test_coins("0.136").await?; let from_sk1_hex = sk_to_hex(keypair1.secret_key()?); let (_, keypair2) = safe.keys_create_preload_test_coins("0.73").await?; let to_pk2_hex = encode(keypair2.public_key().to_bytes()); let _ = safe .keys_transfer("0.111", Some(&from_sk1_hex), &to_pk2_hex) .await?; let from_current_balance = safe.keys_balance_from_sk(keypair1.secret_key()?).await?; assert_eq!("0.025000000" /* 0.136 - 0.111 */, from_current_balance); let to_current_balance = safe.keys_balance_from_sk(keypair2.secret_key()?).await?; assert_eq!("0.841000000" /* 0.73 + 0.111 */, to_current_balance); Ok(()) } }
board.js
class
{ constructor(width, height) { /** @private {number} */ this.width_ = width; /** @private {height} */ this.height_ = height; /** @private {!Array<!Array<number>>} */ this.rows_ = []; for (let i = 0; i < height; ++i) { this.rows_.push([]); } /** @private {!HTMLElement} */ this.canvas_ = document.getElementById('board'); /** @private {!CanvasRenderingContext2D} */ this.context_ = this.canvas_.getContext('2d'); /** @private {string} */ this.liveFillStyle_ = 'rgb(200, 0, 0)'; /** @private {string} */ this.deadFillStyle_ = 'rgb(220, 220, 220)'; /** @private {number} */ this.intervalMs_ = 100; } /** * Draws a new state for the board, which is expressed as an array of * arrays of true column-indices. We draw using deltas, as usually * in Life most cells don't change, so this is faster and less * flickery than redrawing the entire board. * * @param {{!Array<!Array<number>>} rows * @return {void} */ draw(rows) { if (rows.length != this.height_) { console.log("incoming rows has wrong height " + rows.length + " should be " + this.height_); return; } const x_factor = Math.floor(this.canvas_.clientWidth / this.width_); const y_factor = Math.floor(this.canvas_.clientHeight / this.height_); for (let r = 0; r < this.height_; ++r) { const y = r * y_factor; const oldRow = this.rows_[r]; let oldIndex = 0; const newRow = rows[r]; let newIndex = 0; while (true) { const oldColumn = (oldIndex < oldRow.length) ? oldRow[oldIndex] : this.width_; const newColumn = (newIndex < newRow.length) ? newRow[newIndex] : this.width_; if (oldColumn == newColumn) { if (oldColumn == this.width_) { break; } ++oldIndex; ++newIndex; } else if (newColumn < oldColumn) { this.context_.fillStyle = this.liveFillStyle_; this.context_.fillRect(newColumn * x_factor, y, x_factor, y_factor); ++newIndex; } else if (oldColumn < newColumn) { this.context_.fillStyle = this.deadFillStyle_; this.context_.fillRect(oldColumn * x_factor, y, x_factor, y_factor); ++oldIndex; } } } this.rows_ = rows; } step() { const step_api = window.location.origin + '/step'; window.fetch(step_api).then(response => response.json()) .then(jsonResponse => { this.draw(jsonResponse); window.setTimeout(() => this.step(), this.intervalMs_); }); } load() { const load_api = window.location.origin + '/board?width=' + this.width_ + '&height=' + this.height_ + '&density=0.35'; window.fetch(load_api).then(response => response.json()) .then(jsonResponse => { this.draw(jsonResponse); window.setTimeout(() => this.step(), this.intervalMs_); }); } };
Board
taskmanager.py
# Copyright 2015 Tesora Inc. # 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. from eventlet.timeout import Timeout from oslo_log import log as logging from trove.common import cfg from trove.common.strategies.cluster import base from trove.common import utils from trove.instance.models import DBInstance from trove.instance.models import Instance from trove.instance import tasks as inst_tasks from trove.taskmanager import api as task_api import trove.taskmanager.models as task_models LOG = logging.getLogger(__name__) CONF = cfg.CONF class CassandraTaskManagerStrategy(base.BaseTaskManagerStrategy): @property def task_manager_api_class(self): return CassandraTaskManagerAPI @property def task_manager_cluster_tasks_class(self): return CassandraClusterTasks class CassandraClusterTasks(task_models.ClusterTasks): def create_cluster(self, context, cluster_id): LOG.debug("Begin create_cluster for id: %s.", cluster_id) def _create_cluster(): cluster_node_ids = self.find_cluster_node_ids(cluster_id) # Wait for cluster nodes to get to cluster-ready status. LOG.debug("Waiting for all nodes to become ready.") if not self._all_instances_ready(cluster_node_ids, cluster_id): return cluster_nodes = self.load_cluster_nodes(context, cluster_node_ids) LOG.debug("All nodes ready, proceeding with cluster setup.") seeds = self.choose_seed_nodes(cluster_nodes) # Configure each cluster node with the list of seeds. # Once all nodes are configured, start the seed nodes one at a time # followed by the rest of the nodes. try: LOG.debug("Selected seed nodes: %s", seeds) for node in cluster_nodes: LOG.debug("Configuring node: %s.", node['id']) node['guest'].set_seeds(seeds) node['guest'].set_auto_bootstrap(False) LOG.debug("Starting seed nodes.") for node in cluster_nodes: if node['ip'] in seeds: node['guest'].restart() node['guest'].set_auto_bootstrap(True) LOG.debug("All seeds running, starting remaining nodes.") for node in cluster_nodes: if node['ip'] not in seeds: node['guest'].restart() node['guest'].set_auto_bootstrap(True) # Create the in-database user via the first node. The remaining # nodes will replicate in-database changes automatically. # Only update the local authentication file on the other nodes. LOG.debug("Securing the cluster.") key = utils.generate_random_password() admin_creds = None for node in cluster_nodes: if admin_creds is None: admin_creds = node['guest'].cluster_secure(key) else: node['guest'].store_admin_credentials(admin_creds) node['guest'].cluster_complete() LOG.debug("Cluster configuration finished successfully.") except Exception: LOG.exception("Error creating cluster.") self.update_statuses_on_failure(cluster_id) timeout = Timeout(CONF.cluster_usage_timeout) try: _create_cluster() self.reset_task() except Timeout as t: if t is not timeout: raise # not my timeout LOG.exception("Timeout for building cluster.") self.update_statuses_on_failure(cluster_id) finally: timeout.cancel() LOG.debug("End create_cluster for id: %s.", cluster_id) @classmethod def find_cluster_node_ids(cls, cluster_id): db_instances = DBInstance.find_all(cluster_id=cluster_id, deleted=False).all() return [db_instance.id for db_instance in db_instances] @classmethod def load_cluster_nodes(cls, context, node_ids): return [cls.build_node_info(Instance.load(context, node_id)) for node_id in node_ids] @classmethod def build_node_info(cls, instance): guest = cls.get_guest(instance) return {'instance': instance, 'guest': guest, 'id': instance.id, 'ip': cls.get_ip(instance), 'dc': guest.get_data_center(), 'rack': guest.get_rack()} @classmethod def choose_seed_nodes(cls, node_info): """Select gossip seeds. The seeds are cluster nodes from which any new/other cluster nodes request information on the cluster geometry. They should include at least one node from each data center and rack. Gossip optimization is not critical, but it is recommended to use a small seed list. Select one (random) node from each dc and rack. :param node_info: List of cluster nodes. :type node_info: list of dicts """ ips_by_affinity = cls._group_by_affinity(node_info) return {ips_by_affinity[dc][rack][0] for dc in ips_by_affinity for rack in ips_by_affinity[dc]} @classmethod def _group_by_affinity(cls, node_info): """Group node IPs by affinity to data center and rack.""" ips_by_affinity = dict() for node in node_info: ip = node['ip'] dc = node['dc'] rack = node['rack'] if dc in ips_by_affinity: dc_nodes = ips_by_affinity[dc] if rack in dc_nodes: rack_nodes = dc_nodes[rack] rack_nodes.append(ip) else: dc_nodes.update({rack: [ip]}) else: ips_by_affinity.update({dc: {rack: [ip]}}) return ips_by_affinity def grow_cluster(self, context, cluster_id, new_instance_ids): LOG.debug("Begin grow_cluster for id: %s.", cluster_id) def _grow_cluster(): # Wait for new nodes to get to cluster-ready status. LOG.debug("Waiting for new nodes to become ready.") if not self._all_instances_ready(new_instance_ids, cluster_id): return new_instances = [Instance.load(context, instance_id) for instance_id in new_instance_ids] added_nodes = [self.build_node_info(instance) for instance in new_instances] LOG.debug("All nodes ready, proceeding with cluster setup.") cluster_node_ids = self.find_cluster_node_ids(cluster_id) cluster_nodes = self.load_cluster_nodes(context, cluster_node_ids) old_nodes = [node for node in cluster_nodes if node['id'] not in new_instance_ids] try: # All nodes should have the same seeds and credentials. # Retrieve the information from the first node. test_node = old_nodes[0] current_seeds = test_node['guest'].get_seeds() admin_creds = test_node['guest'].get_admin_credentials() # Bootstrap new nodes. # Seed nodes do not bootstrap. Current running nodes # must be used as seeds during the process. # Since we are adding to an existing cluster, ensure that the # new nodes have auto-bootstrapping enabled. # Start the added nodes. LOG.debug("Starting new nodes.") for node in added_nodes: node['guest'].set_auto_bootstrap(True) node['guest'].set_seeds(current_seeds) node['guest'].store_admin_credentials(admin_creds) node['guest'].restart() node['guest'].cluster_complete() # Recompute the seed nodes based on the updated cluster # geometry. seeds = self.choose_seed_nodes(cluster_nodes) # Configure each cluster node with the updated list of seeds. LOG.debug("Updating all nodes with new seeds: %s", seeds) for node in cluster_nodes: node['guest'].set_seeds(seeds) # Run nodetool cleanup on each of the previously existing nodes # to remove the keys that no longer belong to those nodes. # Wait for cleanup to complete on one node before running # it on the next node. LOG.debug("Cleaning up orphan data on old cluster nodes.") for node in old_nodes: nid = node['id'] node['guest'].node_cleanup_begin() node['guest'].node_cleanup() LOG.debug("Waiting for node to finish its " "cleanup: %s", nid) if not self._all_instances_running([nid], cluster_id): LOG.warning("Node did not complete cleanup " "successfully: %s", nid) LOG.debug("Cluster configuration finished successfully.") except Exception: LOG.exception("Error growing cluster.") self.update_statuses_on_failure( cluster_id, status=inst_tasks.InstanceTasks.GROWING_ERROR) timeout = Timeout(CONF.cluster_usage_timeout) try: _grow_cluster() self.reset_task() except Timeout as t: if t is not timeout: raise # not my timeout LOG.exception("Timeout for growing cluster.") self.update_statuses_on_failure( cluster_id, status=inst_tasks.InstanceTasks.GROWING_ERROR) finally: timeout.cancel() LOG.debug("End grow_cluster for id: %s.", cluster_id) def shrink_cluster(self, context, cluster_id, removal_ids): LOG.debug("Begin shrink_cluster for id: %s.", cluster_id) def _shrink_cluster(): cluster_node_ids = self.find_cluster_node_ids(cluster_id) cluster_nodes = self.load_cluster_nodes(context, cluster_node_ids) removed_nodes = CassandraClusterTasks.load_cluster_nodes( context, removal_ids) LOG.debug("All nodes ready, proceeding with cluster setup.") # Update the list of seeds on remaining nodes if necessary. # Once all nodes are configured, decommission the removed nodes. # Cassandra will stream data from decommissioned nodes to the # remaining ones. try: current_seeds = self._get_current_seeds(context, cluster_id) # The seeds will have to be updated on all remaining instances # if any of the seed nodes is going to be removed. update_seeds = any(node['ip'] in current_seeds for node in removed_nodes) LOG.debug("Decommissioning removed nodes.") for node in removed_nodes: node['guest'].node_decommission() node['instance'].update_db(cluster_id=None) # Recompute the seed nodes based on the updated cluster # geometry if any of the existing seed nodes was removed. if update_seeds: LOG.debug("Updating seeds on the remaining nodes.") cluster_nodes = self.load_cluster_nodes( context, cluster_node_ids) remaining_nodes = [node for node in cluster_nodes if node['id'] not in removal_ids] seeds = self.choose_seed_nodes(remaining_nodes) LOG.debug("Selected seed nodes: %s", seeds) for node in remaining_nodes: LOG.debug("Configuring node: %s.", node['id']) node['guest'].set_seeds(seeds) # Wait for the removed nodes to go SHUTDOWN. LOG.debug("Waiting for all decommissioned nodes to shutdown.") if not self._all_instances_shutdown(removal_ids, cluster_id): # Now detached, failed nodes will stay available # in the list of standalone instances. return # Delete decommissioned instances only when the cluster is in a # consistent state. LOG.debug("Deleting decommissioned instances.") for node in removed_nodes: Instance.delete(node['instance']) LOG.debug("Cluster configuration finished successfully.") except Exception: LOG.exception("Error shrinking cluster.") self.update_statuses_on_failure( cluster_id, status=inst_tasks.InstanceTasks.SHRINKING_ERROR) timeout = Timeout(CONF.cluster_usage_timeout) try: _shrink_cluster() self.reset_task() except Timeout as t: if t is not timeout: raise # not my timeout LOG.exception("Timeout for shrinking cluster.") self.update_statuses_on_failure( cluster_id, status=inst_tasks.InstanceTasks.SHRINKING_ERROR) finally: timeout.cancel() LOG.debug("End shrink_cluster for id: %s.", cluster_id) def restart_cluster(self, context, cluster_id):
def upgrade_cluster(self, context, cluster_id, datastore_version): current_seeds = self._get_current_seeds(context, cluster_id) def ordering_function(instance): if self.get_ip(instance) in current_seeds: return -1 return 0 self.rolling_upgrade_cluster(context, cluster_id, datastore_version, ordering_function) def _get_current_seeds(self, context, cluster_id): # All nodes should have the same seeds. # We retrieve current seeds from the first node. cluster_node_ids = self.find_cluster_node_ids(cluster_id) test_node = self.load_cluster_nodes(context, cluster_node_ids[:1])[0] return test_node['guest'].get_seeds() class CassandraTaskManagerAPI(task_api.API): pass
self.rolling_restart_cluster( context, cluster_id, delay_sec=CONF.cassandra.node_sync_time)
eo_uy.go
// Code generated by downloader.go; DO NOT EDIT. package eo_uy import "github.com/nullobsi/go-mc/chat" func init()
var Map = map[string]string{"addServer.add": "Prete", "addServer.enterIp": "Adreso de servilo", "addServer.enterName": "Nomo de servilo", "addServer.hideAddress": "Kaŝi adreson", "addServer.resourcePack": "Servilaj resurspakaĵoj", "addServer.resourcePack.disabled": "Neebligita", "addServer.resourcePack.enabled": "Ebligita", "addServer.resourcePack.prompt": "Demandi", "addServer.title": "Redakti servilajn informojn", "advMode.allEntities": "Uzu \"@e\" por celi al ĉiuj entoj", "advMode.allPlayers": "Uzu \"@a\" por celi al ĉiuj ludantoj", "advMode.command": "Konzola komando", "advMode.mode": "Reĝimo", "advMode.mode.auto": "Ripete", "advMode.mode.autoexec.bat": "Ĉiam aktiva", "advMode.mode.conditional": "Kondiĉe", "advMode.mode.redstone": "Impulse", "advMode.mode.redstoneTriggered": "Bezonas ruĝonon", "advMode.mode.sequence": "Ĉene", "advMode.mode.unconditional": "Senkondiĉe", "advMode.nearestPlayer": "Uzu \"@p\" por celi al plej proksiman ludanton", "advMode.notAllowed": "Devas esti estranta ludanto en krea reĝimo", "advMode.notEnabled": "Komandaj blokoj ne estas ebligitaj en ĉi tiu servilo", "advMode.previousOutput": "Antaŭa eligaĵo", "advMode.randomPlayer": "Uzu \"@r\" por celi al hazarde elektota ludanto", "advMode.self": "Uzu \"@s\" por celi al ekzekutanta ento", "advMode.setCommand": "Difini konzolan komandon por bloko", "advMode.setCommand.success": "Komando estas difinita: %s", "advMode.trackOutput": "Sekvi eligon", "advMode.triggering": "Ekagigado", "advMode.type": "Tipo", "advancement.advancementNotFound": "Nekonata progresero: %s", "advancements.adventure.adventuring_time.description": "Malkovru ĉian biomon", "advancements.adventure.adventuring_time.title": "Tempas aventuri", "advancements.adventure.arbalistic.description": "Mortigu kvin diversajn mobojn per unu arbalesta pafo", "advancements.adventure.arbalistic.title": "Arbalesta", "advancements.adventure.bullseye.description": "Trafu la centron de la pafcelo for de almenaŭ 30 metroj", "advancements.adventure.bullseye.title": "Sur la punkto", "advancements.adventure.hero_of_the_village.description": "Sukcese defendu vilaĝon de invado", "advancements.adventure.hero_of_the_village.title": "Heroo de la vilaĝo", "advancements.adventure.honey_block_slide.description": "Glitu laŭ mielbloko por malrapidigi vian falon", "advancements.adventure.honey_block_slide.title": "Glite kaj glate", "advancements.adventure.kill_a_mob.description": "Mortigu ajnan malamikan monstron", "advancements.adventure.kill_a_mob.title": "Monstra ĉasisto", "advancements.adventure.kill_all_mobs.description": "Mortigu unu el ĉia malamika monstro", "advancements.adventure.kill_all_mobs.title": "Plena kolekto", "advancements.adventure.lightning_rod_with_villager_no_fire.description": "Protektu vilaĝanon de supervoltado, ne okazigante brulon", "advancements.adventure.lightning_rod_with_villager_no_fire.title": "Sen supervoltado", "advancements.adventure.ol_betsy.description": "Pafu per arbalesto", "advancements.adventure.ol_betsy.title": "Kiel tio funkcias?!", "advancements.adventure.root.description": "Aventurado, esplorado kaj batalado", "advancements.adventure.root.title": "Aventuro", "advancements.adventure.shoot_arrow.description": "Trafu ion per sago", "advancements.adventure.shoot_arrow.title": "Precize celu", "advancements.adventure.sleep_in_bed.description": "Dormu en lito por ŝanĝi vian reaperejon", "advancements.adventure.sleep_in_bed.title": "Sonĝu bone", "advancements.adventure.sniper_duel.description": "Mortigu skeleton de pli ol 50 metroj", "advancements.adventure.sniper_duel.title": "Pafista duelo", "advancements.adventure.spyglass_at_dragon.description": "Observu Finejdrakon per lorno", "advancements.adventure.spyglass_at_dragon.title": "Stranga finejano...", "advancements.adventure.spyglass_at_ghast.description": "Observu ĥaston per lorno", "advancements.adventure.spyglass_at_ghast.title": "Hasto de kasto", "advancements.adventure.spyglass_at_parrot.description": "Observu papagon per lorno", "advancements.adventure.spyglass_at_parrot.title": "Ago de Papo?", "advancements.adventure.summon_iron_golem.description": "Alvoku fergolemon por helpi defendi vilaĝon", "advancements.adventure.summon_iron_golem.title": "Dungita helpo", "advancements.adventure.throw_trident.description": "Ĵetu tridenton al io.\nNoto: Forĵeti onian solan armilon ne estas bona ideo.", "advancements.adventure.throw_trident.title": "Forĵeteblaĵo", "advancements.adventure.totem_of_undying.description": "Uzu totemon de senmorteco por trompi morton", "advancements.adventure.totem_of_undying.title": "Postmorta", "advancements.adventure.trade.description": "Sukcese komercu kun vilaĝano", "advancements.adventure.trade.title": "Kvazaŭ estus mi superbazaro", "advancements.adventure.two_birds_one_arrow.description": "Mortu du fantomojn kun penetrema sago", "advancements.adventure.two_birds_one_arrow.title": "2-ope 8-aze", "advancements.adventure.very_very_frightening.description": "Trafu vilaĝanon per fulmo", "advancements.adventure.very_very_frightening.title": "Timigege", "advancements.adventure.voluntary_exile.description": "Mortigu kapitanon de invado.\nPoste, konsideru provizore eviti vilaĝojn...", "advancements.adventure.voluntary_exile.title": "Malbona antaŭsento", "advancements.adventure.walk_on_powder_snow_with_leather_boots.description": "Paŝu sur pulvora neĝo... ne enfalinte", "advancements.adventure.walk_on_powder_snow_with_leather_boots.title": "Malpeza promenado", "advancements.adventure.whos_the_pillager_now.description": "Venku rabiston per lia propra armilo", "advancements.adventure.whos_the_pillager_now.title": "Kiu estas la rabisto nun?", "advancements.empty": "Ŝajne, nenio estas ĉi tie...", "advancements.end.dragon_breath.description": "Metu drakan blovon en vitran botelon", "advancements.end.dragon_breath.title": "Vi bezonas menton", "advancements.end.dragon_egg.description": "Tenu la drakan ovon", "advancements.end.dragon_egg.title": "La sekva generacio", "advancements.end.elytra.description": "Trovu elitrojn", "advancements.end.elytra.title": "Super la ĉielo", "advancements.end.enter_end_gateway.description": "Foriru de la insulo", "advancements.end.enter_end_gateway.title": "Fora foriro", "advancements.end.find_end_city.description": "Iru tien! Kio povus okazi?", "advancements.end.find_end_city.title": "La fina urbo", "advancements.end.kill_dragon.description": "Bonŝancon", "advancements.end.kill_dragon.title": "La fina venk'", "advancements.end.levitate.description": "Leviĝu je 50 blokoj pro atakoj de ŝulkro", "advancements.end.levitate.title": "Oni havas bonan vidon de ĉi tie", "advancements.end.respawn_dragon.description": "Revivigu la Finejdrakon", "advancements.end.respawn_dragon.title": "Fino... Denove...", "advancements.end.root.description": "Aŭ ĉu la komencejo?", "advancements.end.root.title": "La Finejo", "advancements.husbandry.axolotl_in_a_bucket.description": "Kaptu aksolotlon en sitelon", "advancements.husbandry.axolotl_in_a_bucket.title": "La plej ĉarma rabobesto", "advancements.husbandry.balanced_diet.description": "Manĝu ĉion manĝeblan, eĉ se ĝi ne estas bona por vi", "advancements.husbandry.balanced_diet.title": "Sanfavora dieto", "advancements.husbandry.breed_all_animals.description": "Bredu ĉian beston!", "advancements.husbandry.breed_all_animals.title": "Duope", "advancements.husbandry.breed_an_animal.description": "Bredu du bestojn kune", "advancements.husbandry.breed_an_animal.title": "Duopa agado", "advancements.husbandry.complete_catalogue.description": "Hejmigu katojn de ĉiaj rasoj!", "advancements.husbandry.complete_catalogue.title": "Kompleta katologo", "advancements.husbandry.fishy_business.description": "Kaptu fiŝon", "advancements.husbandry.fishy_business.title": "Fiŝaj aferoj", "advancements.husbandry.kill_axolotl_target.description": "Unuiĝu kun aksolotlo kaj venku batalon", "advancements.husbandry.kill_axolotl_target.title": "La forto de amikeco!", "advancements.husbandry.make_a_sign_glow.description": "Lumigu la tekston sur ŝildeto", "advancements.husbandry.make_a_sign_glow.title": "Lumingo", "advancements.husbandry.netherite_hoe.description": "Uzu subenan ingoton por plibonigi sarkilon, kaj poste retaksu viajn vivelektojn", "advancements.husbandry.netherite_hoe.title": "Serioza sindediĉo", "advancements.husbandry.plant_seed.description": "Plantu semon kaj rigardu kiel ĝi kreskas", "advancements.husbandry.plant_seed.title": "Semejo", "advancements.husbandry.ride_a_boat_with_a_goat.description": "Sidiĝu en boaton kun kapro kaj promenu sur akvo", "advancements.husbandry.ride_a_boat_with_a_goat.title": "Se naĝas karpoj, naĝu ankaŭ kaproj!", "advancements.husbandry.root.description": "La mondo plenas de geamikoj kaj manĝaĵoj", "advancements.husbandry.root.title": "Agrikulturo", "advancements.husbandry.safely_harvest_honey.description": "Uzu tendarfajron por kolekti mielon en botelo el abelujo sen koleri la abelojn", "advancements.husbandry.safely_harvest_honey.title": "Ŝtelo de mielo", "advancements.husbandry.silk_touch_nest.description": "Uzante silkan tuŝon, transloku abelneston kun tri abeloj interne", "advancements.husbandry.silk_touch_nest.title": "Kovado post movado", "advancements.husbandry.tactical_fishing.description": "Kaptu fiŝon... sen fiŝkaptilo!", "advancements.husbandry.tactical_fishing.title": "Taktika fiŝkaptado", "advancements.husbandry.tame_an_animal.description": "Hejmigu beston", "advancements.husbandry.tame_an_animal.title": "Ĉiam plej bonaj amikoj", "advancements.husbandry.wax_off.description": "Devaksu blokon el kupro", "advancements.husbandry.wax_off.title": "Malpli da vakso!", "advancements.husbandry.wax_on.description": "Vaksu blokon el kupro", "advancements.husbandry.wax_on.title": "Pli da vakso!", "advancements.nether.all_effects.description": "Havu ĉiujn efikojn samtempe", "advancements.nether.all_effects.title": "Kiel tio povis okazi?", "advancements.nether.all_potions.description": "Havu ĉiujn eliksirajn efikojn samtempe", "advancements.nether.all_potions.title": "Je via sano!", "advancements.nether.brew_potion.description": "Faru eliksiron", "advancements.nether.brew_potion.title": "Hejma trinkfarejo", "advancements.nether.charge_respawn_anchor.description": "Plene ŝargu reaperankron", "advancements.nether.charge_respawn_anchor.title": "Ne ĝuste \"naŭ\" vivoj", "advancements.nether.create_beacon.description": "Kreu kaj metu lumstriilon", "advancements.nether.create_beacon.title": "Naŭ naŭope kaj unu unuope", "advancements.nether.create_full_beacon.description": "Plenpotencigu lumstriilon", "advancements.nether.create_full_beacon.title": "Lumstriilulo", "advancements.nether.distract_piglin.description": "Distru piglojn per oro", "advancements.nether.distract_piglin.title": "Ho, brila!", "advancements.nether.explore_nether.description": "Esploru ĉiun biomon en la Submondo", "advancements.nether.explore_nether.title": "Vojaĝo al la centro de la Tero", "advancements.nether.fast_travel.description": "Uzu la Submondon por veturi 7 kilometrojn en la Supermondo", "advancements.nether.fast_travel.title": "Subspaca bobelo", "advancements.nether.find_bastion.description": "Eniru prabastionon", "advancements.nether.find_bastion.title": "Kiaj tempoj estis", "advancements.nether.find_fortress.description": "Trovu vojon al Submonda fortikaĵo", "advancements.nether.find_fortress.title": "Terura fortikaĵo", "advancements.nether.get_wither_skull.description": "Ekhavu kranion de vizerskeleto", "advancements.nether.get_wither_skull.title": "Ĉu esti, aŭ ne esti", "advancements.nether.loot_bastion.description": "Rabu kofron en prabastiono", "advancements.nether.loot_bastion.title": "Porkoj de l' milit'", "advancements.nether.netherite_armor.description": "Ekhavu tutan subenan kirasaron", "advancements.nether.netherite_armor.title": "Kovru min per rubo", "advancements.nether.obtain_ancient_debris.description": "Ekhavu antikvan rubon", "advancements.nether.obtain_ancient_debris.title": "Arkeologio-diplomo", "advancements.nether.obtain_blaze_rod.description": "Liberigu incedion de ĝia vergo", "advancements.nether.obtain_blaze_rod.title": "Rekte en la fajron", "advancements.nether.obtain_crying_obsidian.description": "Ekhavu plorobsidianon", "advancements.nether.obtain_crying_obsidian.title": "Kiu tranĉas cepojn?", "advancements.nether.return_to_sender.description": "Detruu ĥaston per fajrobulo", "advancements.nether.return_to_sender.title": "Reveno al la sendinto", "advancements.nether.ride_strider.description": "Rajdu lafpaŝanton per fiŝkaptilo kun torda fungo", "advancements.nether.ride_strider.title": "Ĉi boato havas krurojn", "advancements.nether.root.description": "Alportu somerajn vestaĵojn", "advancements.nether.root.title": "Submondo", "advancements.nether.summon_wither.description": "Alvoku la Vizeron", "advancements.nether.summon_wither.title": "Vizeraĵoj", "advancements.nether.uneasy_alliance.description": "Savu ĥaston el la Submondo, sekure alportu ĝin al la Supermondo... kaj mortigu ĝin", "advancements.nether.uneasy_alliance.title": "Malfacila alianco", "advancements.nether.use_lodestone.description": "Uzu kompason sur magnetŝtono", "advancements.nether.use_lodestone.title": "Magnetŝton' – por aventurada bezon'", "advancements.sad_label": ":(", "advancements.story.cure_zombie_villager.description": "Malfortigu kaj kuracu zombia vilaĝanon", "advancements.story.cure_zombie_villager.title": "Kuracisto por zombio", "advancements.story.deflect_arrow.description": "Deturnu pafaĵon per ŝildo", "advancements.story.deflect_arrow.title": "Ne hodiaŭ, dankon", "advancements.story.enchant_item.description": "Sorĉu aĵon per sorĉtablo", "advancements.story.enchant_item.title": "Sorĉisto", "advancements.story.enter_the_end.description": "Eniru finejportalon", "advancements.story.enter_the_end.title": "Ĉu fino?", "advancements.story.enter_the_nether.description": "Konstruu, ŝaltu kaj eniru Submondportalon", "advancements.story.enter_the_nether.title": "Ni devas iri pli suben", "advancements.story.follow_ender_eye.description": "Sekvu finejokulon", "advancements.story.follow_ender_eye.title": "Akraj 8uloj", "advancements.story.form_obsidian.description": "Ekhavu obsidianan blokon", "advancements.story.form_obsidian.title": "Malvarma duŝo", "advancements.story.iron_tools.description": "Plibonigu vian pioĉon", "advancements.story.iron_tools.title": "Nepre feru!", "advancements.story.lava_bucket.description": "Plenigu sitelon per lafo", "advancements.story.lava_bucket.title": "Varma afero", "advancements.story.mine_diamond.description": "Akiru diamantojn", "advancements.story.mine_diamond.title": "Diamantoj!", "advancements.story.mine_stone.description": "Minu ŝtonon per via nova pioĉo", "advancements.story.mine_stone.title": "Ŝtona epoko", "advancements.story.obtain_armor.description": "Protektu vin per fera kiraso", "advancements.story.obtain_armor.title": "Ekipu vin", "advancements.story.root.description": "La koro kaj rakonto de la ludo", "advancements.story.root.title": "Minecraft", "advancements.story.shiny_gear.description": "Diamanta armaĵo ŝparas vivojn", "advancements.story.shiny_gear.title": "Kovru min per diamantoj", "advancements.story.smelt_iron.description": "Elfandu feran ingoton", "advancements.story.smelt_iron.title": "Kiel vi fertas?", "advancements.story.upgrade_tools.description": "Kreu pli bonan pioĉon", "advancements.story.upgrade_tools.title": "Plibonigo", "advancements.toast.challenge": "Defio kompletiĝis!", "advancements.toast.goal": "Celo atingiĝis!", "advancements.toast.task": "Progresero fariĝis!", "argument.anchor.invalid": "Nevalida enta ankra pozicio %s", "argument.angle.incomplete": "Nekompleta (anticipis 1 angulon)", "argument.angle.invalid": "Nevalida angulo", "argument.block.id.invalid": "Nekonata bloktipo '%s'", "argument.block.property.duplicate": "Eco \"%s\" nur povas esti alĝustigita pro bloko \"%s\" unufoje", "argument.block.property.invalid": "Bloko \"%s\" ne akceptas \"%s\" por eco: %s", "argument.block.property.novalue": "Anticipis valoron por proprieto '%s' ĉe bloko %s", "argument.block.property.unclosed": "Anticipis fermanta \"]\" por blokŝtataj ecoj", "argument.block.property.unknown": "Bloko \"%s\" ne havas \"%s\" eco", "argument.block.tag.disallowed": "Priskribiloj ne estas permesitaj ĉi tie, nur blokoj", "argument.color.invalid": "Nekonata koloro '%s'", "argument.component.invalid": "Nevalida babilejkomponanto: %s", "argument.criteria.invalid": "Nekonata kriterio \"%s\"", "argument.dimension.invalid": "Nekonata dimensio '%s'", "argument.double.big": "Duobla reelo devas ne esti pli ol %s, trovis %s", "argument.double.low": "Duobla reelo devas ne esti malpli ol %s, trovis %s", "argument.entity.invalid": "Nevalida nomo aŭ UUID", "argument.entity.notfound.entity": "Ne ento troviĝis", "argument.entity.notfound.player": "Neniu ludanto estas trovita", "argument.entity.options.advancements.description": "Ludantoj kun progreseroj", "argument.entity.options.distance.description": "Distanco al ento", "argument.entity.options.distance.negative": "Distanco ne eblas esti negativa", "argument.entity.options.dx.description": "Entoj inter x kaj x + dx", "argument.entity.options.dy.description": "Entoj inter y kaj y + dy", "argument.entity.options.dz.description": "Entoj inter z kaj z + dz", "argument.entity.options.gamemode.description": "Ludantoj kun ludreĝimo", "argument.entity.options.inapplicable": "Opcio \"%s\" ĉi tie ne estas aplikebla", "argument.entity.options.level.description": "Sperta nivelo", "argument.entity.options.level.negative": "Nivelo ne povus esti negativa", "argument.entity.options.limit.description": "Maksimuma nombro da entoj por redoni", "argument.entity.options.limit.toosmall": "Limo devas esti almenaŭ 1", "argument.entity.options.mode.invalid": "Nevalida aŭ nekonata ludreĝimo \"%s\"", "argument.entity.options.name.description": "Entonomo", "argument.entity.options.nbt.description": "Entoj kun NBT", "argument.entity.options.predicate.description": "Agorda predikato", "argument.entity.options.scores.description": "Entoj kun poentoj", "argument.entity.options.sort.description": "Ordigi la entojn", "argument.entity.options.sort.irreversible": "Nevalida aŭ nekonata ordigtipo \"%s\"", "argument.entity.options.tag.description": "Entoj kun priskribilo", "argument.entity.options.team.description": "Entoj en teamo", "argument.entity.options.type.description": "Entoj kun tipo", "argument.entity.options.type.invalid": "Nevalida aŭ nekonata enttipo \"%s\"", "argument.entity.options.unknown": "Nekonata opcio \"%s\"", "argument.entity.options.unterminated": "Anticipis finon de opcioj", "argument.entity.options.valueless": "Anticipis valoron por opcio \"%s\"", "argument.entity.options.x.description": "x-pozicio", "argument.entity.options.x_rotation.description": "x-rotacio de ento", "argument.entity.options.y.description": "y-pozicio", "argument.entity.options.y_rotation.description": "y-rotacio de ento", "argument.entity.options.z.description": "z-pozicio", "argument.entity.selector.allEntities": "Ĉiuj entoj", "argument.entity.selector.allPlayers": "Ĉiuj ludantoj", "argument.entity.selector.missing": "Netrovebla selektila tipo", "argument.entity.selector.nearestPlayer": "La plej proksima ludanto", "argument.entity.selector.not_allowed": "Selektaĵo ne estas permesata", "argument.entity.selector.randomPlayer": "Ludanto hazarda", "argument.entity.selector.self": "Ento nuna", "argument.entity.selector.unknown": "Nekonata selekta tipo: \"%s\"", "argument.entity.toomany": "Nur unu ento estas permesata, sed la provizita selektaĵo permesas pli ol unu", "argument.float.big": "Reelo devas ne esti pli ol %s, trovis %s", "argument.float.low": "Reelo devas ne esti malpli ol %s, trovis %s", "argument.id.invalid": "Nevalida ID", "argument.id.unknown": "Nekonata ID: %s", "argument.integer.big": "Entjero devas ne esti pli ol %s, trovis %s", "argument.integer.low": "Entjero devas ne esti malpli ol %s, trovis %s", "argument.item.id.invalid": "Nekonata objekto '%s'", "argument.item.tag.disallowed": "Priskribiloj ne estas permesitaj, nur objektoj", "argument.literal.incorrect": "Anticipis laŭvortan %s", "argument.long.big": "Longnombro devas ne esti pli ol %s, trovis %s", "argument.long.low": "Longnombro devas ne esti malpli ol %s, trovis %s", "argument.nbt.array.invalid": "Nevalida tabeltipo \"%s\"", "argument.nbt.array.mixed": "%s ne enmeteblas en %s", "argument.nbt.expected.key": "Anticipis ŝlosilon", "argument.nbt.expected.value": "Anticipis valoron", "argument.nbt.list.mixed": "%s ne enmeteblas en liston de %s", "argument.nbt.trailing": "Neatenditaj vostaj datumoj", "argument.player.entities": "Nur ludantoj povas influiĝi de tiu komando sed la provizita selektaĵo enhavas entojn", "argument.player.toomany": "Nur unu ludanto estas permesata, sed la provizita selektaĵo permesas pli ol unu", "argument.player.unknown": "Tiu ludanto ne ekzistas", "argument.pos.missing.double": "Anticipis koordinaton", "argument.pos.missing.int": "Anticipis lokon de bloko", "argument.pos.mixed": "Mondaj kaj lokaj koordinatoj ne mikseblas (ĉiu devas esti \"^\" aŭ ne)", "argument.pos.outofbounds": "Tiu pozicio estas ekster la permesataj limoj.", "argument.pos.outofworld": "Tiu pozicio estas ekster de ĉi tiu mondo!", "argument.pos.unloaded": "Tiu pozicio ne estas ŝargita", "argument.pos2d.incomplete": "Nekompleta (anticipis 2 koordinatojn)", "argument.pos3d.incomplete": "Nekompleta (anticipis 3 koordinatojn)", "argument.range.empty": "Anticipis valoron aŭ vicon de valoroj", "argument.range.ints": "Nur entjeroj estas permesata, ne decimaloj", "argument.range.swapped": "Minimumo ne povas esti pli granda ol maksimumo", "argument.rotation.incomplete": "Nekompleta (anticipis 2 koordinatojn)", "argument.scoreHolder.empty": "Havantoj de taŭga poentaro ne troveblis", "argument.scoreboardDisplaySlot.invalid": "Nekonata bildigujo \"%s\"", "argument.time.invalid_tick_count": "Nombro da taktoj devas esti ne negativa", "argument.time.invalid_unit": "Malĝusta unito", "argument.uuid.invalid": "Nevalida UUID", "arguments.block.tag.unknown": "Nekonata blokpriskribilo \"%s\"", "arguments.function.tag.unknown": "Nekonata funkcipriskribilo \"%s\"", "arguments.function.unknown": "Nekonata funkcio '%s", "arguments.item.overstacked": "%s povas esti stakata ĝis %s", "arguments.item.tag.unknown": "Nekonata objektpriskribilo \"%s\"", "arguments.nbtpath.node.invalid": "Malĝusta elemento de NBT-vojo", "arguments.nbtpath.nothing_found": "Trovis neniajn elementojn kongruajn kun %s", "arguments.objective.notFound": "Nekonata poentara celo: \"%s\"", "arguments.objective.readonly": "Celo \"%s\" de poentaro estas nurlega", "arguments.operation.div0": "Ne eblas dividi per nulo", "arguments.operation.invalid": "Nevalida operacio", "arguments.swizzle.invalid": "Nevalida aksiskombino, anticipis kombinon de \"x\", \"y\" kaj \"z\"", "attribute.modifier.equals.0": "%s %s", "attribute.modifier.equals.1": "%s%% %s", "attribute.modifier.equals.2": "%s%% %s", "attribute.modifier.plus.0": "+%s %s", "attribute.modifier.plus.1": "+%s%% %s", "attribute.modifier.plus.2": "+%s%% %s", "attribute.modifier.take.0": "-%s %s", "attribute.modifier.take.1": "-%s%% %s", "attribute.modifier.take.2": "-%s%% %s", "attribute.name.generic.armor": "Kiraso", "attribute.name.generic.armor_toughness": "Kirashardeco", "attribute.name.generic.attack_damage": "Atakdamaĝo", "attribute.name.generic.attack_knockback": "Atakforpuŝo", "attribute.name.generic.attack_speed": "Atakrapideco", "attribute.name.generic.flying_speed": "Flugrapideco", "attribute.name.generic.follow_range": "Sekvado-distanco de moboj", "attribute.name.generic.knockback_resistance": "Forpuŝrezisto", "attribute.name.generic.luck": "Bonŝanco", "attribute.name.generic.max_health": "Maksimuma sano", "attribute.name.generic.movement_speed": "Rapideco", "attribute.name.horse.jump_strength": "Ĉevala saltforteco", "attribute.name.zombie.spawn_reinforcements": "Zombiaj plifortigaĵoj", "attribute.unknown": "Nekonata atributo", "biome.minecraft.badlands": "Badlandoj", "biome.minecraft.badlands_plateau": "Altebenaĵo de badlandoj", "biome.minecraft.bamboo_jungle": "Bambua ĝangalo", "biome.minecraft.bamboo_jungle_hills": "Montetoj de bambua ĝangalo", "biome.minecraft.basalt_deltas": "Bazaltaj deltoj", "biome.minecraft.beach": "Strando", "biome.minecraft.birch_forest": "Betula arbaro", "biome.minecraft.birch_forest_hills": "Montetoj de betula arbaro", "biome.minecraft.cold_ocean": "Malvarma oceano", "biome.minecraft.crimson_forest": "Skarlata arbaro", "biome.minecraft.dark_forest": "Malluma arbaro", "biome.minecraft.dark_forest_hills": "Montetoj de malluma arbaro", "biome.minecraft.deep_cold_ocean": "Profunda malvarma oceano", "biome.minecraft.deep_frozen_ocean": "Profunda frostigita oceano", "biome.minecraft.deep_lukewarm_ocean": "Profunda varmeta oceano", "biome.minecraft.deep_ocean": "Profunda oceano", "biome.minecraft.deep_warm_ocean": "Profunda varma oceano", "biome.minecraft.desert": "Dezerto", "biome.minecraft.desert_hills": "Dezertaj montetoj", "biome.minecraft.desert_lakes": "Dezertaj lagoj", "biome.minecraft.dripstone_caves": "Gutŝtonaj kavernoj", "biome.minecraft.end_barrens": "Finejaj sovaĝejoj", "biome.minecraft.end_highlands": "Finejaj altejoj", "biome.minecraft.end_midlands": "Finejaj mezejoj", "biome.minecraft.eroded_badlands": "Erodaj stepoj", "biome.minecraft.flower_forest": "Flora arbaro", "biome.minecraft.forest": "Arbaro", "biome.minecraft.frozen_ocean": "Frostigita oceano", "biome.minecraft.frozen_river": "Frostigita rivero", "biome.minecraft.giant_spruce_taiga": "Tajgo de gigantaj piceoj", "biome.minecraft.giant_spruce_taiga_hills": "Tajgaj montetoj de gigantaj piceoj", "biome.minecraft.giant_tree_taiga": "Tajgo de gigantaj arboj", "biome.minecraft.giant_tree_taiga_hills": "Tajgaj montetoj de gigantaj arboj", "biome.minecraft.gravelly_mountains": "Gruzaj montoj", "biome.minecraft.ice_spikes": "Glaciaj dornoj", "biome.minecraft.jungle": "Ĝangalo", "biome.minecraft.jungle_edge": "Rando de ĝangalo", "biome.minecraft.jungle_hills": "Ĝangalaj montetoj", "biome.minecraft.lukewarm_ocean": "Varmeta oceano", "biome.minecraft.lush_caves": "Luksaj kavernoj", "biome.minecraft.modified_badlands_plateau": "Modifa stepa altebenaĵo", "biome.minecraft.modified_gravelly_mountains": "Gruzaj montoj+", "biome.minecraft.modified_jungle": "Modifa ĝangalo", "biome.minecraft.modified_jungle_edge": "Modifa randa ĝangalo", "biome.minecraft.modified_wooded_badlands_plateau": "Modifa altebenaĵo de arboriĉa stepo", "biome.minecraft.mountain_edge": "Randaj montoj", "biome.minecraft.mountains": "Montoj", "biome.minecraft.mushroom_field_shore": "Bordo de fungaj agroj", "biome.minecraft.mushroom_fields": "Fungaj agroj", "biome.minecraft.nether_wastes": "Submondaj sovaĝejoj", "biome.minecraft.ocean": "Oceano", "biome.minecraft.plains": "Ebenaĵo", "biome.minecraft.river": "Rivero", "biome.minecraft.savanna": "Savano", "biome.minecraft.savanna_plateau": "Savana altebenaĵo", "biome.minecraft.shattered_savanna": "Frakasa savano", "biome.minecraft.shattered_savanna_plateau": "Altebenaĵo de frakasa savano", "biome.minecraft.small_end_islands": "Finejaj insuletoj", "biome.minecraft.snowy_beach": "Neĝa strando", "biome.minecraft.snowy_mountains": "Neĝaj montoj", "biome.minecraft.snowy_taiga": "Neĝa tajgo", "biome.minecraft.snowy_taiga_hills": "Montetoj de neĝa tajgo", "biome.minecraft.snowy_taiga_mountains": "Neĝaj tajgaj montoj", "biome.minecraft.snowy_tundra": "Neĝa tundro", "biome.minecraft.soul_sand_valley": "Animsabla valo", "biome.minecraft.stone_shore": "Ŝtona bordo", "biome.minecraft.sunflower_plains": "Sunflora ebenaĵo", "biome.minecraft.swamp": "Marĉo", "biome.minecraft.swamp_hills": "Marĉaj montetoj", "biome.minecraft.taiga": "Tajgo", "biome.minecraft.taiga_hills": "Tajgaj montetoj", "biome.minecraft.taiga_mountains": "Tajgaj montoj", "biome.minecraft.tall_birch_forest": "Alta betula arbaro", "biome.minecraft.tall_birch_hills": "Montetoj de altaj betuloj", "biome.minecraft.the_end": "La Finejo", "biome.minecraft.the_void": "La vakuejo", "biome.minecraft.warm_ocean": "Varma oceano", "biome.minecraft.warped_forest": "Torda arbaro", "biome.minecraft.wooded_badlands_plateau": "Altebenaĵo de arboriĉa stepo", "biome.minecraft.wooded_hills": "Arboriĉaj montetoj", "biome.minecraft.wooded_mountains": "Arboriĉaj montoj", "block.minecraft.acacia_button": "Akacia butono", "block.minecraft.acacia_door": "Akacia pordo", "block.minecraft.acacia_fence": "Akacia barilo", "block.minecraft.acacia_fence_gate": "Akacia barilpordo", "block.minecraft.acacia_leaves": "Akaciaj folioj", "block.minecraft.acacia_log": "Akacia ŝtipo", "block.minecraft.acacia_planks": "Akaciaj tabuloj", "block.minecraft.acacia_pressure_plate": "Akacia premplato", "block.minecraft.acacia_sapling": "Akacia arbido", "block.minecraft.acacia_sign": "Akacia ŝildeto", "block.minecraft.acacia_slab": "Akacia ŝtupo", "block.minecraft.acacia_stairs": "Akacia ŝtuparo", "block.minecraft.acacia_trapdoor": "Akacia klappordo", "block.minecraft.acacia_wall_sign": "Akacia mura ŝildeto", "block.minecraft.acacia_wood": "Akacia ligno", "block.minecraft.activator_rail": "Aktivigila relo", "block.minecraft.air": "Aero", "block.minecraft.allium": "Aliumo", "block.minecraft.amethyst_block": "Ametista bloko", "block.minecraft.amethyst_cluster": "Amasiĝo da ametisto", "block.minecraft.ancient_debris": "Antikva rubo", "block.minecraft.andesite": "Andezito", "block.minecraft.andesite_slab": "Andezita ŝtupo", "block.minecraft.andesite_stairs": "Andezita ŝtuparo", "block.minecraft.andesite_wall": "Andezita muro", "block.minecraft.anvil": "Amboso", "block.minecraft.attached_melon_stem": "Alligita akvomelona tigo", "block.minecraft.attached_pumpkin_stem": "Alligita kukurba tigo", "block.minecraft.azalea": "Azaleo", "block.minecraft.azalea_leaves": "Azaleaj folioj", "block.minecraft.azure_bluet": "Blua houstonio", "block.minecraft.bamboo": "Bambuo", "block.minecraft.bamboo_sapling": "Bambua plantido", "block.minecraft.banner.base.black": "Plene nigra surfaco", "block.minecraft.banner.base.blue": "Plene blua surfaco", "block.minecraft.banner.base.brown": "Plene bruna surfaco", "block.minecraft.banner.base.cyan": "Plene turkisa surfaco", "block.minecraft.banner.base.gray": "Plene griza surfaco", "block.minecraft.banner.base.green": "Plene verda surfaco", "block.minecraft.banner.base.light_blue": "Plene helblua surfaco", "block.minecraft.banner.base.light_gray": "Plene helgriza surfaco", "block.minecraft.banner.base.lime": "Plene helverda surfaco", "block.minecraft.banner.base.magenta": "Plene malva surfaco", "block.minecraft.banner.base.orange": "Plene oranĝkolora surfaco", "block.minecraft.banner.base.pink": "Plene rozkolora surfaco", "block.minecraft.banner.base.purple": "Plene violkolora surfaco", "block.minecraft.banner.base.red": "Plene ruĝa surfaco", "block.minecraft.banner.base.white": "Plene blanka surfaco", "block.minecraft.banner.base.yellow": "Plene flava surfaco", "block.minecraft.banner.border.black": "Nigra flagbordero", "block.minecraft.banner.border.blue": "Blua flagbordero", "block.minecraft.banner.border.brown": "Bruna flagbordero", "block.minecraft.banner.border.cyan": "Turkisa flagbordero", "block.minecraft.banner.border.gray": "Griza flagbordero", "block.minecraft.banner.border.green": "Verda flagbordero", "block.minecraft.banner.border.light_blue": "Helblua flagbordero", "block.minecraft.banner.border.light_gray": "Helgriza flagbordero", "block.minecraft.banner.border.lime": "Helverda flagbordero", "block.minecraft.banner.border.magenta": "Malva flagbordero", "block.minecraft.banner.border.orange": "Oranĝkolora flagbordero", "block.minecraft.banner.border.pink": "Rozkolora flagbordero", "block.minecraft.banner.border.purple": "Viola flagbordero", "block.minecraft.banner.border.red": "Ruĝa flagbordero", "block.minecraft.banner.border.white": "Blanka flagbordero", "block.minecraft.banner.border.yellow": "Flava flagbordero", "block.minecraft.banner.bricks.black": "Nigra muro", "block.minecraft.banner.bricks.blue": "Blua muro", "block.minecraft.banner.bricks.brown": "Bruna muro", "block.minecraft.banner.bricks.cyan": "Turkisa muro", "block.minecraft.banner.bricks.gray": "Griza muro", "block.minecraft.banner.bricks.green": "Verda muro", "block.minecraft.banner.bricks.light_blue": "Helblua muro", "block.minecraft.banner.bricks.light_gray": "Helgriza muro", "block.minecraft.banner.bricks.lime": "Helverda muro", "block.minecraft.banner.bricks.magenta": "Malva muro", "block.minecraft.banner.bricks.orange": "Oranĝkolora muro", "block.minecraft.banner.bricks.pink": "Rozkolora muro", "block.minecraft.banner.bricks.purple": "Violkolora muro", "block.minecraft.banner.bricks.red": "Ruĝa muro", "block.minecraft.banner.bricks.white": "Blanka muro", "block.minecraft.banner.bricks.yellow": "Flava muro", "block.minecraft.banner.circle.black": "Nigra cirklo", "block.minecraft.banner.circle.blue": "Blua cirklo", "block.minecraft.banner.circle.brown": "Bruna cirklo", "block.minecraft.banner.circle.cyan": "Turkisa cirklo", "block.minecraft.banner.circle.gray": "Griza cirklo", "block.minecraft.banner.circle.green": "Verda cirklo", "block.minecraft.banner.circle.light_blue": "Helblua cirklo", "block.minecraft.banner.circle.light_gray": "Helgriza cirklo", "block.minecraft.banner.circle.lime": "Helverda cirklo", "block.minecraft.banner.circle.magenta": "Malva cirklo", "block.minecraft.banner.circle.orange": "Oranĝkolora cirklo", "block.minecraft.banner.circle.pink": "Rozkolora cirklo", "block.minecraft.banner.circle.purple": "Viola cirklo", "block.minecraft.banner.circle.red": "Ruĝa cirklo", "block.minecraft.banner.circle.white": "Blanka cirklo", "block.minecraft.banner.circle.yellow": "Flava cirklo", "block.minecraft.banner.creeper.black": "Nigra kapo de kripero", "block.minecraft.banner.creeper.blue": "Blua kapo de kripero", "block.minecraft.banner.creeper.brown": "Bruna kapo de kripero", "block.minecraft.banner.creeper.cyan": "Turkisa kapo de kripero", "block.minecraft.banner.creeper.gray": "Griza kapo de kripero", "block.minecraft.banner.creeper.green": "Verda kapo de kripero", "block.minecraft.banner.creeper.light_blue": "Helblua kapo de kripero", "block.minecraft.banner.creeper.light_gray": "Helgriza kapo de kripero", "block.minecraft.banner.creeper.lime": "Helverda kapo de kripero", "block.minecraft.banner.creeper.magenta": "Malva kapo de kripero", "block.minecraft.banner.creeper.orange": "Oranĝkolora kapo de kripero", "block.minecraft.banner.creeper.pink": "Rozkolora kapo de kripero", "block.minecraft.banner.creeper.purple": "Violkolora kapo de kripero", "block.minecraft.banner.creeper.red": "Ruĝa kapo de kripero", "block.minecraft.banner.creeper.white": "Blanka kapo de kripero", "block.minecraft.banner.creeper.yellow": "Flava kapo de kripero", "block.minecraft.banner.cross.black": "Nigra saltiero", "block.minecraft.banner.cross.blue": "Blua saltiero", "block.minecraft.banner.cross.brown": "Bruna saltiero", "block.minecraft.banner.cross.cyan": "Turkisa saltiero", "block.minecraft.banner.cross.gray": "Griza saltiero", "block.minecraft.banner.cross.green": "Verda saltiero", "block.minecraft.banner.cross.light_blue": "Helblua saltiero", "block.minecraft.banner.cross.light_gray": "Helblua saltiero", "block.minecraft.banner.cross.lime": "Helverda saltiero", "block.minecraft.banner.cross.magenta": "Malva saltiero", "block.minecraft.banner.cross.orange": "Oranĝkolora saltiero", "block.minecraft.banner.cross.pink": "Rozkolora saltiero", "block.minecraft.banner.cross.purple": "Violkolora saltiero", "block.minecraft.banner.cross.red": "Ruĝa saltiero", "block.minecraft.banner.cross.white": "Blanka saltiero", "block.minecraft.banner.cross.yellow": "Flava saltiero", "block.minecraft.banner.curly_border.black": "Nigra pintbordero", "block.minecraft.banner.curly_border.blue": "Blua pintbordero", "block.minecraft.banner.curly_border.brown": "Bruna pintbordero", "block.minecraft.banner.curly_border.cyan": "Turkisa pintbordero", "block.minecraft.banner.curly_border.gray": "Griza pintbordero", "block.minecraft.banner.curly_border.green": "Verda pintbordero", "block.minecraft.banner.curly_border.light_blue": "Helblua pintbordero", "block.minecraft.banner.curly_border.light_gray": "Helgriza pintbordero", "block.minecraft.banner.curly_border.lime": "Helverda pintbordero", "block.minecraft.banner.curly_border.magenta": "Malva pintbordero", "block.minecraft.banner.curly_border.orange": "Oranĝkolora pintbordero", "block.minecraft.banner.curly_border.pink": "Roza pintbordero", "block.minecraft.banner.curly_border.purple": "Violkolora pintbordero", "block.minecraft.banner.curly_border.red": "Ruĝa pintbordero", "block.minecraft.banner.curly_border.white": "Blanka pintbordero", "block.minecraft.banner.curly_border.yellow": "Flava pintbordero", "block.minecraft.banner.diagonal_left.black": "Nigra dekstra supra duono", "block.minecraft.banner.diagonal_left.blue": "Blua dekstra supra duono", "block.minecraft.banner.diagonal_left.brown": "Bruna dekstra supra duono", "block.minecraft.banner.diagonal_left.cyan": "Turkisa dekstra supra duono", "block.minecraft.banner.diagonal_left.gray": "Griza dekstra supra duono", "block.minecraft.banner.diagonal_left.green": "Verda dekstra supra duono", "block.minecraft.banner.diagonal_left.light_blue": "Helblua dekstra supra duono", "block.minecraft.banner.diagonal_left.light_gray": "Helgriza dekstra supra duono", "block.minecraft.banner.diagonal_left.lime": "Helverda dekstra supra duono", "block.minecraft.banner.diagonal_left.magenta": "Malva dekstra supra duono", "block.minecraft.banner.diagonal_left.orange": "Oranĝkolora dekstra supra duono", "block.minecraft.banner.diagonal_left.pink": "Rozkolora dekstra supra duono", "block.minecraft.banner.diagonal_left.purple": "Violkolora dekstra supra duono", "block.minecraft.banner.diagonal_left.red": "Ruĝa dekstra supra duono", "block.minecraft.banner.diagonal_left.white": "Blanka dekstra supra duono", "block.minecraft.banner.diagonal_left.yellow": "Flava dekstra supra duono", "block.minecraft.banner.diagonal_right.black": "Nigra maldekstra supra duono", "block.minecraft.banner.diagonal_right.blue": "Blua maldekstra supra duono", "block.minecraft.banner.diagonal_right.brown": "Bruna maldekstra supra duono", "block.minecraft.banner.diagonal_right.cyan": "Turkisa maldekstra supra duono", "block.minecraft.banner.diagonal_right.gray": "Griza maldekstra supra duono", "block.minecraft.banner.diagonal_right.green": "Verda maldekstra supra duono", "block.minecraft.banner.diagonal_right.light_blue": "Helblua maldekstra supra duono", "block.minecraft.banner.diagonal_right.light_gray": "Helgriza maldekstra supra duono", "block.minecraft.banner.diagonal_right.lime": "Helverda maldekstra supra duono", "block.minecraft.banner.diagonal_right.magenta": "Malva maldekstra supra duono", "block.minecraft.banner.diagonal_right.orange": "Oranĝkolora maldekstra supra duono", "block.minecraft.banner.diagonal_right.pink": "Rozkolora maldekstra supra duono", "block.minecraft.banner.diagonal_right.purple": "Violkolora maldekstra supra duono", "block.minecraft.banner.diagonal_right.red": "Ruĝa maldekstra supra duono", "block.minecraft.banner.diagonal_right.white": "Blanka maldekstra supra duono", "block.minecraft.banner.diagonal_right.yellow": "Flava maldekstra supra duono", "block.minecraft.banner.diagonal_up_left.black": "Nigra dekstra suba duono", "block.minecraft.banner.diagonal_up_left.blue": "Blua dekstra suba duono", "block.minecraft.banner.diagonal_up_left.brown": "Bruna dekstra suba duono", "block.minecraft.banner.diagonal_up_left.cyan": "Turkisa dekstra suba duono", "block.minecraft.banner.diagonal_up_left.gray": "Griza dekstra suba duono", "block.minecraft.banner.diagonal_up_left.green": "Verda dekstra suba duono", "block.minecraft.banner.diagonal_up_left.light_blue": "Helblua dekstra suba duono", "block.minecraft.banner.diagonal_up_left.light_gray": "Helgriza dekstra suba duono", "block.minecraft.banner.diagonal_up_left.lime": "Helverda dekstra suba duono", "block.minecraft.banner.diagonal_up_left.magenta": "Malva dekstra suba duono", "block.minecraft.banner.diagonal_up_left.orange": "Oranĝkolora dekstra suba duono", "block.minecraft.banner.diagonal_up_left.pink": "Rozkolora dekstra suba duono", "block.minecraft.banner.diagonal_up_left.purple": "Violkolora dekstra suba duono", "block.minecraft.banner.diagonal_up_left.red": "Ruĝa dekstra suba duono", "block.minecraft.banner.diagonal_up_left.white": "Blanka dekstra suba duono", "block.minecraft.banner.diagonal_up_left.yellow": "Flava dekstra suba duono", "block.minecraft.banner.diagonal_up_right.black": "Nigra maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.blue": "Blua maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.brown": "Bruna maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.cyan": "Turkisa maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.gray": "Griza maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.green": "Verda maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.light_blue": "Helblua maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.light_gray": "Helgriza maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.lime": "Helverda maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.magenta": "Malva maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.orange": "Oranĝkolora maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.pink": "Rozkolora maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.purple": "Violkolora maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.red": "Ruĝa maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.white": "Blanka maldekstra suba duono", "block.minecraft.banner.diagonal_up_right.yellow": "Flava maldekstra suba duono", "block.minecraft.banner.flower.black": "Nigra floro", "block.minecraft.banner.flower.blue": "Blua floro", "block.minecraft.banner.flower.brown": "Bruna floro", "block.minecraft.banner.flower.cyan": "Turkisa floro", "block.minecraft.banner.flower.gray": "Griza floro", "block.minecraft.banner.flower.green": "Verda floro", "block.minecraft.banner.flower.light_blue": "Helblua floro", "block.minecraft.banner.flower.light_gray": "Helgriza floro", "block.minecraft.banner.flower.lime": "Helverda floro", "block.minecraft.banner.flower.magenta": "Malva floro", "block.minecraft.banner.flower.orange": "Oranĝkolora floro", "block.minecraft.banner.flower.pink": "Rozkolora floro", "block.minecraft.banner.flower.purple": "Violkolora floro", "block.minecraft.banner.flower.red": "Ruĝa floro", "block.minecraft.banner.flower.white": "Blanka floro", "block.minecraft.banner.flower.yellow": "Flava floro", "block.minecraft.banner.globe.black": "Nigra terkubo", "block.minecraft.banner.globe.blue": "Blua terkubo", "block.minecraft.banner.globe.brown": "Bruna terkubo", "block.minecraft.banner.globe.cyan": "Turkisa terkubo", "block.minecraft.banner.globe.gray": "Griza terkubo", "block.minecraft.banner.globe.green": "Verda terkubo", "block.minecraft.banner.globe.light_blue": "Helblua terkubo", "block.minecraft.banner.globe.light_gray": "Helgriza terkubo", "block.minecraft.banner.globe.lime": "Helverda terkubo", "block.minecraft.banner.globe.magenta": "Malva terkubo", "block.minecraft.banner.globe.orange": "Oranĝkolora terkubo", "block.minecraft.banner.globe.pink": "Rozkolora terkubo", "block.minecraft.banner.globe.purple": "Violkolora terkubo", "block.minecraft.banner.globe.red": "Ruĝa terkubo", "block.minecraft.banner.globe.white": "Blanka terkubo", "block.minecraft.banner.globe.yellow": "Flava terkubo", "block.minecraft.banner.gradient.black": "Nigra gradiento", "block.minecraft.banner.gradient.blue": "Blua gradiento", "block.minecraft.banner.gradient.brown": "Bruna gradiento", "block.minecraft.banner.gradient.cyan": "Turkisa gradiento", "block.minecraft.banner.gradient.gray": "Griza gradiento", "block.minecraft.banner.gradient.green": "Verda gradiento", "block.minecraft.banner.gradient.light_blue": "Helblua gradiento", "block.minecraft.banner.gradient.light_gray": "Helgriza gradiento", "block.minecraft.banner.gradient.lime": "Helverda gradiento", "block.minecraft.banner.gradient.magenta": "Malva gradiento", "block.minecraft.banner.gradient.orange": "Oranĝkolora gradiento", "block.minecraft.banner.gradient.pink": "Rozkolora gradiento", "block.minecraft.banner.gradient.purple": "Violkolora gradiento", "block.minecraft.banner.gradient.red": "Ruĝa gradiento", "block.minecraft.banner.gradient.white": "Blanka gradiento", "block.minecraft.banner.gradient.yellow": "Flava gradiento", "block.minecraft.banner.gradient_up.black": "Nigra baza gradiento", "block.minecraft.banner.gradient_up.blue": "Blua baza gradiento", "block.minecraft.banner.gradient_up.brown": "Bruna baza gradiento", "block.minecraft.banner.gradient_up.cyan": "Turkisa baza gradiento", "block.minecraft.banner.gradient_up.gray": "Griza baza gradiento", "block.minecraft.banner.gradient_up.green": "Verda baza gradiento", "block.minecraft.banner.gradient_up.light_blue": "Helblua baza gradiento", "block.minecraft.banner.gradient_up.light_gray": "Helgriza baza gradiento", "block.minecraft.banner.gradient_up.lime": "Helverda baza gradiento", "block.minecraft.banner.gradient_up.magenta": "Malva baza gradiento", "block.minecraft.banner.gradient_up.orange": "Oranĝkolora baza gradiento", "block.minecraft.banner.gradient_up.pink": "Rozkolora baza gradiento", "block.minecraft.banner.gradient_up.purple": "Violkolora baza gradiento", "block.minecraft.banner.gradient_up.red": "Ruĝa baza gradiento", "block.minecraft.banner.gradient_up.white": "Blanka baza gradiento", "block.minecraft.banner.gradient_up.yellow": "Flava baza gradiento", "block.minecraft.banner.half_horizontal.black": "Nigra supra duono", "block.minecraft.banner.half_horizontal.blue": "Blua supra duono", "block.minecraft.banner.half_horizontal.brown": "Bruna supra duono", "block.minecraft.banner.half_horizontal.cyan": "Turkisa supra duono", "block.minecraft.banner.half_horizontal.gray": "Griza supra duono", "block.minecraft.banner.half_horizontal.green": "Verda supra duono", "block.minecraft.banner.half_horizontal.light_blue": "Helblua supra duono", "block.minecraft.banner.half_horizontal.light_gray": "Helgriza supra duono", "block.minecraft.banner.half_horizontal.lime": "Helverda supra duono", "block.minecraft.banner.half_horizontal.magenta": "Malva supra duono", "block.minecraft.banner.half_horizontal.orange": "Oranĝkolora supra duono", "block.minecraft.banner.half_horizontal.pink": "Rozkolora supra duono", "block.minecraft.banner.half_horizontal.purple": "Violkolora supra duono", "block.minecraft.banner.half_horizontal.red": "Ruĝa supra duono", "block.minecraft.banner.half_horizontal.white": "Blanka supra duono", "block.minecraft.banner.half_horizontal.yellow": "Flava supra duono", "block.minecraft.banner.half_horizontal_bottom.black": "Nigra suba duono", "block.minecraft.banner.half_horizontal_bottom.blue": "Blua suba duono", "block.minecraft.banner.half_horizontal_bottom.brown": "Bruna suba duono", "block.minecraft.banner.half_horizontal_bottom.cyan": "Turkisa suba duono", "block.minecraft.banner.half_horizontal_bottom.gray": "Griza suba duono", "block.minecraft.banner.half_horizontal_bottom.green": "Verda suba duono", "block.minecraft.banner.half_horizontal_bottom.light_blue": "Helblua suba duono", "block.minecraft.banner.half_horizontal_bottom.light_gray": "Helgriza suba duono", "block.minecraft.banner.half_horizontal_bottom.lime": "Helverda suba duono", "block.minecraft.banner.half_horizontal_bottom.magenta": "Malva suba duono", "block.minecraft.banner.half_horizontal_bottom.orange": "Oranĝkolora suba duono", "block.minecraft.banner.half_horizontal_bottom.pink": "Rozkolora suba duono", "block.minecraft.banner.half_horizontal_bottom.purple": "Violkolora suba duono", "block.minecraft.banner.half_horizontal_bottom.red": "Ruĝa suba duono", "block.minecraft.banner.half_horizontal_bottom.white": "Blanka suba duono", "block.minecraft.banner.half_horizontal_bottom.yellow": "Flava suba duono", "block.minecraft.banner.half_vertical.black": "Nigra dekstra flanko", "block.minecraft.banner.half_vertical.blue": "Blua dekstra flanko", "block.minecraft.banner.half_vertical.brown": "Bruna dekstra flanko", "block.minecraft.banner.half_vertical.cyan": "Turkisa dekstra flanko", "block.minecraft.banner.half_vertical.gray": "Griza dekstra flanko", "block.minecraft.banner.half_vertical.green": "Verda dekstra flanko", "block.minecraft.banner.half_vertical.light_blue": "Helblua dekstra flanko", "block.minecraft.banner.half_vertical.light_gray": "Helgriza dekstra flanko", "block.minecraft.banner.half_vertical.lime": "Helverda dekstra flanko", "block.minecraft.banner.half_vertical.magenta": "Malva dekstra flanko", "block.minecraft.banner.half_vertical.orange": "Oranĝkolora dekstra flanko", "block.minecraft.banner.half_vertical.pink": "Rozkolora dekstra flanko", "block.minecraft.banner.half_vertical.purple": "Violkolora dekstra flanko", "block.minecraft.banner.half_vertical.red": "Ruĝa dekstra flanko", "block.minecraft.banner.half_vertical.white": "Blanka dekstra flanko", "block.minecraft.banner.half_vertical.yellow": "Flava dekstra flanko", "block.minecraft.banner.half_vertical_right.black": "Nigra maldekstra flanko", "block.minecraft.banner.half_vertical_right.blue": "Blua maldekstra flanko", "block.minecraft.banner.half_vertical_right.brown": "Bruna maldekstra flanko", "block.minecraft.banner.half_vertical_right.cyan": "Turkisa maldekstra flanko", "block.minecraft.banner.half_vertical_right.gray": "Griza maldekstra flanko", "block.minecraft.banner.half_vertical_right.green": "Verda maldekstra flanko", "block.minecraft.banner.half_vertical_right.light_blue": "Helblua maldekstra flanko", "block.minecraft.banner.half_vertical_right.light_gray": "Helgriza maldekstra flanko", "block.minecraft.banner.half_vertical_right.lime": "Helverda maldekstra flanko", "block.minecraft.banner.half_vertical_right.magenta": "Malva maldekstra flanko", "block.minecraft.banner.half_vertical_right.orange": "Oranĝkolora maldekstra flanko", "block.minecraft.banner.half_vertical_right.pink": "Rozkolora maldekstra flanko", "block.minecraft.banner.half_vertical_right.purple": "Violkolora maldekstra flanko", "block.minecraft.banner.half_vertical_right.red": "Ruĝa maldekstra flanko", "block.minecraft.banner.half_vertical_right.white": "Blanka maldekstra flanko", "block.minecraft.banner.half_vertical_right.yellow": "Flava maldekstra flanko", "block.minecraft.banner.mojang.black": "Nigra simbolo", "block.minecraft.banner.mojang.blue": "Blua simbolo", "block.minecraft.banner.mojang.brown": "Bruna simbolo", "block.minecraft.banner.mojang.cyan": "Turkisa simbolo", "block.minecraft.banner.mojang.gray": "Griza simbolo", "block.minecraft.banner.mojang.green": "Verda simbolo", "block.minecraft.banner.mojang.light_blue": "Helblua simbolo", "block.minecraft.banner.mojang.light_gray": "Helgriza simbolo", "block.minecraft.banner.mojang.lime": "Limea simbolo", "block.minecraft.banner.mojang.magenta": "Malva simbolo", "block.minecraft.banner.mojang.orange": "Oranĝkolora simbolo", "block.minecraft.banner.mojang.pink": "Roza simbolo", "block.minecraft.banner.mojang.purple": "Viola simbolo", "block.minecraft.banner.mojang.red": "Ruĝa simbolo", "block.minecraft.banner.mojang.white": "Blanka simbolo", "block.minecraft.banner.mojang.yellow": "Flava simbolo", "block.minecraft.banner.piglin.black": "Nigra muzelo", "block.minecraft.banner.piglin.blue": "Blua muzelo", "block.minecraft.banner.piglin.brown": "Bruna muzelo", "block.minecraft.banner.piglin.cyan": "Turkisa muzelo", "block.minecraft.banner.piglin.gray": "Griza muzelo", "block.minecraft.banner.piglin.green": "Verda muzelo", "block.minecraft.banner.piglin.light_blue": "Helblua muzelo", "block.minecraft.banner.piglin.light_gray": "Helgriza muzelo", "block.minecraft.banner.piglin.lime": "Helverda muzelo", "block.minecraft.banner.piglin.magenta": "Malva muzelo", "block.minecraft.banner.piglin.orange": "Oranĝkolora muzelo", "block.minecraft.banner.piglin.pink": "Rozkolora muzelo", "block.minecraft.banner.piglin.purple": "Violkolora muzelo", "block.minecraft.banner.piglin.red": "Ruĝa muzelo", "block.minecraft.banner.piglin.white": "Blanka muzelo", "block.minecraft.banner.piglin.yellow": "Flava muzelo", "block.minecraft.banner.rhombus.black": "Nigra rombo", "block.minecraft.banner.rhombus.blue": "Blua rombo", "block.minecraft.banner.rhombus.brown": "Bruna rombo", "block.minecraft.banner.rhombus.cyan": "Turkisa rombo", "block.minecraft.banner.rhombus.gray": "Griza rombo", "block.minecraft.banner.rhombus.green": "Verda rombo", "block.minecraft.banner.rhombus.light_blue": "Helblua rombo", "block.minecraft.banner.rhombus.light_gray": "Helgriza rombo", "block.minecraft.banner.rhombus.lime": "Helverda rombo", "block.minecraft.banner.rhombus.magenta": "Malva rombo", "block.minecraft.banner.rhombus.orange": "Oranĝkolora rombo", "block.minecraft.banner.rhombus.pink": "Rozkolora rombo", "block.minecraft.banner.rhombus.purple": "Violkolora rombo", "block.minecraft.banner.rhombus.red": "Ruĝa rombo", "block.minecraft.banner.rhombus.white": "Blanka rombo", "block.minecraft.banner.rhombus.yellow": "Flava rombo", "block.minecraft.banner.skull.black": "Nigra kranio", "block.minecraft.banner.skull.blue": "Blua kranio", "block.minecraft.banner.skull.brown": "Bruna kranio", "block.minecraft.banner.skull.cyan": "Turkisa kranio", "block.minecraft.banner.skull.gray": "Griza kranio", "block.minecraft.banner.skull.green": "Verda kranio", "block.minecraft.banner.skull.light_blue": "Helblua kranio", "block.minecraft.banner.skull.light_gray": "Helgriza kranio", "block.minecraft.banner.skull.lime": "Helverda kranio", "block.minecraft.banner.skull.magenta": "Malva kranio", "block.minecraft.banner.skull.orange": "Oranĝkolora kranio", "block.minecraft.banner.skull.pink": "Rozkolora kranio", "block.minecraft.banner.skull.purple": "Violkolora kranio", "block.minecraft.banner.skull.red": "Ruĝa kranio", "block.minecraft.banner.skull.white": "Blanka kranio", "block.minecraft.banner.skull.yellow": "Flava kranio", "block.minecraft.banner.small_stripes.black": "Nigraj strioj", "block.minecraft.banner.small_stripes.blue": "Bluaj strioj", "block.minecraft.banner.small_stripes.brown": "Brunaj strioj", "block.minecraft.banner.small_stripes.cyan": "Turkisaj strioj", "block.minecraft.banner.small_stripes.gray": "Grizaj strioj", "block.minecraft.banner.small_stripes.green": "Verdaj strioj", "block.minecraft.banner.small_stripes.light_blue": "Helblua strioj", "block.minecraft.banner.small_stripes.light_gray": "Helgrizaj strioj", "block.minecraft.banner.small_stripes.lime": "Helverdaj strioj", "block.minecraft.banner.small_stripes.magenta": "Malvaj strioj", "block.minecraft.banner.small_stripes.orange": "Oranĝkoloraj strioj", "block.minecraft.banner.small_stripes.pink": "Rozkoloraj strioj", "block.minecraft.banner.small_stripes.purple": "Violkoloraj strioj", "block.minecraft.banner.small_stripes.red": "Ruĝaj strioj", "block.minecraft.banner.small_stripes.white": "Blankaj strioj", "block.minecraft.banner.small_stripes.yellow": "Flavaj strioj", "block.minecraft.banner.square_bottom_left.black": "Nigra malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.blue": "Blua malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.brown": "Bruna malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.cyan": "Turkisa malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.gray": "Griza malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.green": "Verda malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.light_blue": "Helblua malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.light_gray": "Helgriza malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.lime": "Helverda malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.magenta": "Malva malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.orange": "Oranĝkolora malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.pink": "Rozkolora malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.purple": "Violkolora malsupra dekstra flagokvadrado", "block.minecraft.banner.square_bottom_left.red": "Ruĝa malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.white": "Blanka malsupra dekstra angulo", "block.minecraft.banner.square_bottom_left.yellow": "Flava malsupra dekstra angulo", "block.minecraft.banner.square_bottom_right.black": "Nigra malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.blue": "Blua malsupra maldekstra flagokvadrado", "block.minecraft.banner.square_bottom_right.brown": "Bruna malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.cyan": "Turkisa malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.gray": "Griza malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.green": "Verda malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.light_blue": "Helblua malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.light_gray": "Helgriza malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.lime": "Helverda malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.magenta": "Malva malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.orange": "Oranĝkolora malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.pink": "Rozkolora malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.purple": "Violkolora malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.red": "Ruĝa malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.white": "Blanka malsupra maldekstra angulo", "block.minecraft.banner.square_bottom_right.yellow": "Flava malsupra maldekstra angulo", "block.minecraft.banner.square_top_left.black": "Nigra supra dekstra angulo", "block.minecraft.banner.square_top_left.blue": "Blua supra dekstra angulo", "block.minecraft.banner.square_top_left.brown": "Bruna supra dekstra angulo", "block.minecraft.banner.square_top_left.cyan": "Turkisa supra dekstra angulo", "block.minecraft.banner.square_top_left.gray": "Griza supra dekstra angulo", "block.minecraft.banner.square_top_left.green": "Verda supra dekstra angulo", "block.minecraft.banner.square_top_left.light_blue": "Helblua supra dekstra angulo", "block.minecraft.banner.square_top_left.light_gray": "Helgriza supra dekstra angulo", "block.minecraft.banner.square_top_left.lime": "Helverda supra dekstra angulo", "block.minecraft.banner.square_top_left.magenta": "Malva supra dekstra angulo", "block.minecraft.banner.square_top_left.orange": "Oranĝkolora supra dekstra angulo", "block.minecraft.banner.square_top_left.pink": "Rozkolora supra dekstra angulo", "block.minecraft.banner.square_top_left.purple": "Violkolora supra dekstra angulo", "block.minecraft.banner.square_top_left.red": "Ruĝa supra dekstra angulo", "block.minecraft.banner.square_top_left.white": "Blanka supra dekstra angulo", "block.minecraft.banner.square_top_left.yellow": "Flava supra dekstra angulo", "block.minecraft.banner.square_top_right.black": "Nigra supra maldekstra angulo", "block.minecraft.banner.square_top_right.blue": "Blua supra maldekstra angulo", "block.minecraft.banner.square_top_right.brown": "Bruna supra maldekstra angulo", "block.minecraft.banner.square_top_right.cyan": "Turkisa supra maldekstra angulo", "block.minecraft.banner.square_top_right.gray": "Griza supra maldekstra angulo", "block.minecraft.banner.square_top_right.green": "Verda supra maldekstra angulo", "block.minecraft.banner.square_top_right.light_blue": "Helblua supra maldekstra angulo", "block.minecraft.banner.square_top_right.light_gray": "Helgriza supra maldekstra angulo", "block.minecraft.banner.square_top_right.lime": "Helverda supra maldekstra angulo", "block.minecraft.banner.square_top_right.magenta": "Malva supra maldekstra angulo", "block.minecraft.banner.square_top_right.orange": "Oranĝkolora supra maldekstra angulo", "block.minecraft.banner.square_top_right.pink": "Rozkolora supra maldekstra angulo", "block.minecraft.banner.square_top_right.purple": "Violkolora supra maldekstra angulo", "block.minecraft.banner.square_top_right.red": "Ruĝa supra maldekstra angulo", "block.minecraft.banner.square_top_right.white": "Blanka supra maldekstra angulo", "block.minecraft.banner.square_top_right.yellow": "Flava supra maldekstra angulo", "block.minecraft.banner.straight_cross.black": "Nigra kruco", "block.minecraft.banner.straight_cross.blue": "Blua kruco", "block.minecraft.banner.straight_cross.brown": "Bruna kruco", "block.minecraft.banner.straight_cross.cyan": "Turkisa kruco", "block.minecraft.banner.straight_cross.gray": "Griza kruco", "block.minecraft.banner.straight_cross.green": "Verda kruco", "block.minecraft.banner.straight_cross.light_blue": "Helblua kruco", "block.minecraft.banner.straight_cross.light_gray": "Helgriza kruco", "block.minecraft.banner.straight_cross.lime": "Helverda kruco", "block.minecraft.banner.straight_cross.magenta": "Malva kruco", "block.minecraft.banner.straight_cross.orange": "Oranĝkolora kruco", "block.minecraft.banner.straight_cross.pink": "Rozkolora kruco", "block.minecraft.banner.straight_cross.purple": "Violkolora kruco", "block.minecraft.banner.straight_cross.red": "Ruĝa kruco", "block.minecraft.banner.straight_cross.white": "Blanka kruco", "block.minecraft.banner.straight_cross.yellow": "Flava kruco", "block.minecraft.banner.stripe_bottom.black": "Nigra bazo", "block.minecraft.banner.stripe_bottom.blue": "Blua bazo", "block.minecraft.banner.stripe_bottom.brown": "Bruna bazo", "block.minecraft.banner.stripe_bottom.cyan": "Turkisa bazo", "block.minecraft.banner.stripe_bottom.gray": "Griza bazo", "block.minecraft.banner.stripe_bottom.green": "Verda bazo", "block.minecraft.banner.stripe_bottom.light_blue": "Helblua bazo", "block.minecraft.banner.stripe_bottom.light_gray": "Helgriza bazo", "block.minecraft.banner.stripe_bottom.lime": "Helverda bazo", "block.minecraft.banner.stripe_bottom.magenta": "Malva bazo", "block.minecraft.banner.stripe_bottom.orange": "Oranĝkolora bazo", "block.minecraft.banner.stripe_bottom.pink": "Rozkolora bazo", "block.minecraft.banner.stripe_bottom.purple": "Violkolora bazo", "block.minecraft.banner.stripe_bottom.red": "Ruĝa bazo", "block.minecraft.banner.stripe_bottom.white": "Blanka bazo", "block.minecraft.banner.stripe_bottom.yellow": "Flava bazo", "block.minecraft.banner.stripe_center.black": "Nigra kolono", "block.minecraft.banner.stripe_center.blue": "Blua kolono", "block.minecraft.banner.stripe_center.brown": "Bruna kolono", "block.minecraft.banner.stripe_center.cyan": "Turkisa kolono", "block.minecraft.banner.stripe_center.gray": "Griza kolono", "block.minecraft.banner.stripe_center.green": "Verda kolono", "block.minecraft.banner.stripe_center.light_blue": "Helblua kolono", "block.minecraft.banner.stripe_center.light_gray": "Helgriza kolono", "block.minecraft.banner.stripe_center.lime": "Helverda kolono", "block.minecraft.banner.stripe_center.magenta": "Malva kolono", "block.minecraft.banner.stripe_center.orange": "Oranĝkolora kolono", "block.minecraft.banner.stripe_center.pink": "Rozkolora kolono", "block.minecraft.banner.stripe_center.purple": "Violkolora kolono", "block.minecraft.banner.stripe_center.red": "Ruĝa kolono", "block.minecraft.banner.stripe_center.white": "Blanka kolono", "block.minecraft.banner.stripe_center.yellow": "Flava kolono", "block.minecraft.banner.stripe_downleft.black": "Nigra maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.blue": "Blua maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.brown": "Bruna maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.cyan": "Turkisa maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.gray": "Griza maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.green": "Verda maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.light_blue": "Helblua maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.light_gray": "Helgriza maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.lime": "Helverda maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.magenta": "Malva maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.orange": "Oranĝkolora maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.pink": "Rozkolora maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.purple": "Violkolora maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.red": "Ruĝa maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.white": "Blanka maldekstra diagonalo", "block.minecraft.banner.stripe_downleft.yellow": "Flava maldekstra diagonalo", "block.minecraft.banner.stripe_downright.black": "Nigra dekstra diagonalo", "block.minecraft.banner.stripe_downright.blue": "Blua dekstra diagonalo", "block.minecraft.banner.stripe_downright.brown": "Bruna dekstra diagonalo", "block.minecraft.banner.stripe_downright.cyan": "Turkisa dekstra diagonalo", "block.minecraft.banner.stripe_downright.gray": "Griza dekstra diagonalo", "block.minecraft.banner.stripe_downright.green": "Verda dekstra diagonalo", "block.minecraft.banner.stripe_downright.light_blue": "Helblua dekstra diagonalo", "block.minecraft.banner.stripe_downright.light_gray": "Helgriza dekstra diagonalo", "block.minecraft.banner.stripe_downright.lime": "Helverda dekstra diagonalo", "block.minecraft.banner.stripe_downright.magenta": "Malva dekstra diagonalo", "block.minecraft.banner.stripe_downright.orange": "Oranĝkolora dekstra diagonalo", "block.minecraft.banner.stripe_downright.pink": "Rozkolora dekstra diagonalo", "block.minecraft.banner.stripe_downright.purple": "Violkolora dekstra diagonalo", "block.minecraft.banner.stripe_downright.red": "Ruĝa dekstra diagonalo", "block.minecraft.banner.stripe_downright.white": "Blanka dekstra diagonalo", "block.minecraft.banner.stripe_downright.yellow": "Flava dekstra diagonalo", "block.minecraft.banner.stripe_left.black": "Nigra dekstra kolono", "block.minecraft.banner.stripe_left.blue": "Blua dekstra kolono", "block.minecraft.banner.stripe_left.brown": "Bruna dekstra kolono", "block.minecraft.banner.stripe_left.cyan": "Turkisa dekstra kolono", "block.minecraft.banner.stripe_left.gray": "Griza dekstra kolono", "block.minecraft.banner.stripe_left.green": "Verda dekstra kolono", "block.minecraft.banner.stripe_left.light_blue": "Helblua dekstra kolono", "block.minecraft.banner.stripe_left.light_gray": "Helgriza dekstra kolono", "block.minecraft.banner.stripe_left.lime": "Helverda dekstra kolono", "block.minecraft.banner.stripe_left.magenta": "Malva dekstra kolono", "block.minecraft.banner.stripe_left.orange": "Oranĝkolora dekstra kolono", "block.minecraft.banner.stripe_left.pink": "Rozkolora dekstra kolono", "block.minecraft.banner.stripe_left.purple": "Violkolora dekstra kolono", "block.minecraft.banner.stripe_left.red": "Ruĝa dekstra kolono", "block.minecraft.banner.stripe_left.white": "Blanka dekstra kolono", "block.minecraft.banner.stripe_left.yellow": "Flava dekstra kolono", "block.minecraft.banner.stripe_middle.black": "Nigra trabo", "block.minecraft.banner.stripe_middle.blue": "Blua trabo", "block.minecraft.banner.stripe_middle.brown": "Bruna trabo", "block.minecraft.banner.stripe_middle.cyan": "Turkisa trabo", "block.minecraft.banner.stripe_middle.gray": "Griza trabo", "block.minecraft.banner.stripe_middle.green": "Verda trabo", "block.minecraft.banner.stripe_middle.light_blue": "Helblua trabo", "block.minecraft.banner.stripe_middle.light_gray": "Helgriza trabo", "block.minecraft.banner.stripe_middle.lime": "Helverda trabo", "block.minecraft.banner.stripe_middle.magenta": "Malva trabo", "block.minecraft.banner.stripe_middle.orange": "Oranĝa trabo", "block.minecraft.banner.stripe_middle.pink": "Rozkolora trabo", "block.minecraft.banner.stripe_middle.purple": "Violkolora trabo", "block.minecraft.banner.stripe_middle.red": "Ruĝa trabo", "block.minecraft.banner.stripe_middle.white": "Blanka trabo", "block.minecraft.banner.stripe_middle.yellow": "Flava trabo", "block.minecraft.banner.stripe_right.black": "Nigra maldekstra kolono", "block.minecraft.banner.stripe_right.blue": "Blua maldekstra kolono", "block.minecraft.banner.stripe_right.brown": "Bruna maldekstra kolono", "block.minecraft.banner.stripe_right.cyan": "Turkisa maldekstra kolono", "block.minecraft.banner.stripe_right.gray": "Griza maldekstra kolono", "block.minecraft.banner.stripe_right.green": "Verda maldekstra kolono", "block.minecraft.banner.stripe_right.light_blue": "Helblua maldekstra kolono", "block.minecraft.banner.stripe_right.light_gray": "Helgriza maldekstra kolono", "block.minecraft.banner.stripe_right.lime": "Helverda maldekstra kolono", "block.minecraft.banner.stripe_right.magenta": "Malva maldekstra kolono", "block.minecraft.banner.stripe_right.orange": "Oranĝkolora maldekstra kolono", "block.minecraft.banner.stripe_right.pink": "Rozkolora maldekstra kolono", "block.minecraft.banner.stripe_right.purple": "Violkolora maldekstra kolono", "block.minecraft.banner.stripe_right.red": "Ruĝa maldekstra kolono", "block.minecraft.banner.stripe_right.white": "Blanka maldekstra kolono", "block.minecraft.banner.stripe_right.yellow": "Flava maldekstra kolono", "block.minecraft.banner.stripe_top.black": "Nigra kapo", "block.minecraft.banner.stripe_top.blue": "Blua kapo", "block.minecraft.banner.stripe_top.brown": "Bruna kapo", "block.minecraft.banner.stripe_top.cyan": "Turkisa kapo", "block.minecraft.banner.stripe_top.gray": "Griza kapo", "block.minecraft.banner.stripe_top.green": "Verda kapo", "block.minecraft.banner.stripe_top.light_blue": "Helblua kapo", "block.minecraft.banner.stripe_top.light_gray": "Helgriza kapo", "block.minecraft.banner.stripe_top.lime": "Helverda kapo", "block.minecraft.banner.stripe_top.magenta": "Malva kapo", "block.minecraft.banner.stripe_top.orange": "Oranĝkolora kapo", "block.minecraft.banner.stripe_top.pink": "Rozkolora kapo", "block.minecraft.banner.stripe_top.purple": "Violkolora kapo", "block.minecraft.banner.stripe_top.red": "Ruĝa kapo", "block.minecraft.banner.stripe_top.white": "Blanka kapo", "block.minecraft.banner.stripe_top.yellow": "Flava kapo", "block.minecraft.banner.triangle_bottom.black": "Nigra ĉevrono", "block.minecraft.banner.triangle_bottom.blue": "Blua ĉevrono", "block.minecraft.banner.triangle_bottom.brown": "Bruna ĉevrono", "block.minecraft.banner.triangle_bottom.cyan": "Turkisa ĉevrono", "block.minecraft.banner.triangle_bottom.gray": "Griza ĉevrono", "block.minecraft.banner.triangle_bottom.green": "Verda ĉevrono", "block.minecraft.banner.triangle_bottom.light_blue": "Helblua ĉevrono", "block.minecraft.banner.triangle_bottom.light_gray": "Helgriza ĉevrono", "block.minecraft.banner.triangle_bottom.lime": "Helverda ĉevrono", "block.minecraft.banner.triangle_bottom.magenta": "Malva ĉevrono", "block.minecraft.banner.triangle_bottom.orange": "Oranĝkolora ĉevrono", "block.minecraft.banner.triangle_bottom.pink": "Rozkolora ĉevrono", "block.minecraft.banner.triangle_bottom.purple": "Violkolora ĉevrono", "block.minecraft.banner.triangle_bottom.red": "Ruĝa ĉevrono", "block.minecraft.banner.triangle_bottom.white": "Blanka ĉevrono", "block.minecraft.banner.triangle_bottom.yellow": "Flava ĉevrono", "block.minecraft.banner.triangle_top.black": "Nigra inversa ĉevrono", "block.minecraft.banner.triangle_top.blue": "Blua inversa ĉevrono", "block.minecraft.banner.triangle_top.brown": "Bruna inversa ĉevrono", "block.minecraft.banner.triangle_top.cyan": "Turkisa inversa ĉevrono", "block.minecraft.banner.triangle_top.gray": "Griza inversa ĉevrono", "block.minecraft.banner.triangle_top.green": "Verda inversa ĉevrono", "block.minecraft.banner.triangle_top.light_blue": "Helblua inversa ĉevrono", "block.minecraft.banner.triangle_top.light_gray": "Helgriza inversa ĉevrono", "block.minecraft.banner.triangle_top.lime": "Helverda inversa ĉevrono", "block.minecraft.banner.triangle_top.magenta": "Malva inversa ĉevrono", "block.minecraft.banner.triangle_top.orange": "Oranĝkolora inversa ĉevrono", "block.minecraft.banner.triangle_top.pink": "Rozkolora inversa ĉevrono", "block.minecraft.banner.triangle_top.purple": "Violkolora inversa ĉevrono", "block.minecraft.banner.triangle_top.red": "Ruĝa inversa ĉevrono", "block.minecraft.banner.triangle_top.white": "Blanka inversa ĉevrono", "block.minecraft.banner.triangle_top.yellow": "Flava inversa ĉevrono", "block.minecraft.banner.triangles_bottom.black": "Nigra pinta bazo", "block.minecraft.banner.triangles_bottom.blue": "Blua pinta bazo", "block.minecraft.banner.triangles_bottom.brown": "Bruna pinta bazo", "block.minecraft.banner.triangles_bottom.cyan": "Turkisa pinta bazo", "block.minecraft.banner.triangles_bottom.gray": "Griza pinta bazo", "block.minecraft.banner.triangles_bottom.green": "Verda pinta bazo", "block.minecraft.banner.triangles_bottom.light_blue": "Helblua pinta bazo", "block.minecraft.banner.triangles_bottom.light_gray": "Helgriza pinta bazo", "block.minecraft.banner.triangles_bottom.lime": "Helverda pinta bazo", "block.minecraft.banner.triangles_bottom.magenta": "Malva pinta bazo", "block.minecraft.banner.triangles_bottom.orange": "Oranĝkolora pinta bazo", "block.minecraft.banner.triangles_bottom.pink": "Rozkolora pinta bazo", "block.minecraft.banner.triangles_bottom.purple": "Violkolora pinta bazo", "block.minecraft.banner.triangles_bottom.red": "Ruĝa pinta bazo", "block.minecraft.banner.triangles_bottom.white": "Blanka pinta bazo", "block.minecraft.banner.triangles_bottom.yellow": "Flava pinta bazo", "block.minecraft.banner.triangles_top.black": "Nigra pinta kapo", "block.minecraft.banner.triangles_top.blue": "Blua pinta kapo", "block.minecraft.banner.triangles_top.brown": "Bruna pinta kapo", "block.minecraft.banner.triangles_top.cyan": "Turkisa pinta kapo", "block.minecraft.banner.triangles_top.gray": "Griza pinta kapo", "block.minecraft.banner.triangles_top.green": "Verda pinta kapo", "block.minecraft.banner.triangles_top.light_blue": "Helblua pinta kapo", "block.minecraft.banner.triangles_top.light_gray": "Helgriza pinta kapo", "block.minecraft.banner.triangles_top.lime": "Helverda pinta kapo", "block.minecraft.banner.triangles_top.magenta": "Malva pinta kapo", "block.minecraft.banner.triangles_top.orange": "Oranĝkolora pinta kapo", "block.minecraft.banner.triangles_top.pink": "Rozkolora pinta kapo", "block.minecraft.banner.triangles_top.purple": "Violkolora pinta kapo", "block.minecraft.banner.triangles_top.red": "Ruĝa pinta kapo", "block.minecraft.banner.triangles_top.white": "Blanka pinta kapo", "block.minecraft.banner.triangles_top.yellow": "Flava pinta kapo", "block.minecraft.barrel": "Barelo", "block.minecraft.barrier": "Barilego", "block.minecraft.basalt": "Bazalto", "block.minecraft.beacon": "Lumstriilo", "block.minecraft.beacon.primary": "Unua efiko", "block.minecraft.beacon.secondary": "Dua efiko", "block.minecraft.bed.no_sleep": "Vi povas dormi nur nokte aŭ dum fulmotondro", "block.minecraft.bed.not_safe": "Vi ne povas dormi nun; estas monstroj proksime", "block.minecraft.bed.obstructed": "Ĉi tiu lito estas okupata", "block.minecraft.bed.occupied": "Ĉi tiu lito estas uzata", "block.minecraft.bed.too_far_away": "Vi ne povas dormi nun; la lito estas tro fore", "block.minecraft.bedrock": "Bazroko", "block.minecraft.bee_nest": "Abelnesto", "block.minecraft.beehive": "Abelujo", "block.minecraft.beetroots": "Ruĝbetoj", "block.minecraft.bell": "Sonorilo", "block.minecraft.big_dripleaf": "Gutfoliego", "block.minecraft.big_dripleaf_stem": "Gutfoliega tigo", "block.minecraft.birch_button": "Betula butono", "block.minecraft.birch_door": "Betula pordo", "block.minecraft.birch_fence": "Betula barilo", "block.minecraft.birch_fence_gate": "Betula barilpordo", "block.minecraft.birch_leaves": "Betulaj folioj", "block.minecraft.birch_log": "Betula ŝtipo", "block.minecraft.birch_planks": "Betulaj tabuloj", "block.minecraft.birch_pressure_plate": "Betula premplato", "block.minecraft.birch_sapling": "Betula arbido", "block.minecraft.birch_sign": "Betula ŝildeto", "block.minecraft.birch_slab": "Betula ŝtupo", "block.minecraft.birch_stairs": "Betula ŝtuparo", "block.minecraft.birch_trapdoor": "Betula klappordo", "block.minecraft.birch_wall_sign": "Betula mura ŝildeto", "block.minecraft.birch_wood": "Betula ligno", "block.minecraft.black_banner": "Nigra standardo", "block.minecraft.black_bed": "Nigra lito", "block.minecraft.black_candle": "Nigra kandelo", "block.minecraft.black_candle_cake": "Kuko kun nigra kandelo", "block.minecraft.black_carpet": "Nigra tapiŝo", "block.minecraft.black_concrete": "Nigra betono", "block.minecraft.black_concrete_powder": "Nigra cemento", "block.minecraft.black_glazed_terracotta": "Nigra glazurita terakoto", "block.minecraft.black_shulker_box": "Nigra skatolo de ŝulkro", "block.minecraft.black_stained_glass": "Nigrigita vitro", "block.minecraft.black_stained_glass_pane": "Nigrigita glaco", "block.minecraft.black_terracotta": "Nigra terakoto", "block.minecraft.black_wool": "Nigra lano", "block.minecraft.blackstone": "Nigroŝtono", "block.minecraft.blackstone_slab": "Nigroŝtona ŝtupo", "block.minecraft.blackstone_stairs": "Nigroŝtona ŝtuparo", "block.minecraft.blackstone_wall": "Nigroŝtona muro", "block.minecraft.blast_furnace": "Altforno", "block.minecraft.blue_banner": "Blua standardo", "block.minecraft.blue_bed": "Blua lito", "block.minecraft.blue_candle": "Blua kandelo", "block.minecraft.blue_candle_cake": "Kuko kun blua kandelo", "block.minecraft.blue_carpet": "Blua tapiŝo", "block.minecraft.blue_concrete": "Blua betono", "block.minecraft.blue_concrete_powder": "Blua cemento", "block.minecraft.blue_glazed_terracotta": "Blua glazurita terakoto", "block.minecraft.blue_ice": "Glacio blua", "block.minecraft.blue_orchid": "Blua orkido", "block.minecraft.blue_shulker_box": "Blua skatolo de ŝulkro", "block.minecraft.blue_stained_glass": "Bluigita vitro", "block.minecraft.blue_stained_glass_pane": "Bluigita glaco", "block.minecraft.blue_terracotta": "Blua terakoto", "block.minecraft.blue_wool": "Blua lano", "block.minecraft.bone_block": "Osta bloko", "block.minecraft.bookshelf": "Librobretaro", "block.minecraft.brain_coral": "Cerbokoralo", "block.minecraft.brain_coral_block": "Bloko cerbokorala", "block.minecraft.brain_coral_fan": "Ventumilo cerbokorala", "block.minecraft.brain_coral_wall_fan": "Mura ventumilo cerbokorala", "block.minecraft.brewing_stand": "Eliksirfarilo", "block.minecraft.brick_slab": "Brika ŝtupo", "block.minecraft.brick_stairs": "Brika ŝtuparo", "block.minecraft.brick_wall": "Brika muro", "block.minecraft.bricks": "Brikoj", "block.minecraft.brown_banner": "Bruna standardo", "block.minecraft.brown_bed": "Bruna lito", "block.minecraft.brown_candle": "Bruna kandelo", "block.minecraft.brown_candle_cake": "Kuko kun bruna kandelo", "block.minecraft.brown_carpet": "Bruna tapiŝo", "block.minecraft.brown_concrete": "Bruna betono", "block.minecraft.brown_concrete_powder": "Bruna cemento", "block.minecraft.brown_glazed_terracotta": "Bruna glazurita terakoto", "block.minecraft.brown_mushroom": "Boleto", "block.minecraft.brown_mushroom_block": "Boleta bloko", "block.minecraft.brown_shulker_box": "Bruna skatolo de ŝulkro", "block.minecraft.brown_stained_glass": "Brunigita vitro", "block.minecraft.brown_stained_glass_pane": "Brunigita glaco", "block.minecraft.brown_terracotta": "Bruna terakoto", "block.minecraft.brown_wool": "Bruna lano", "block.minecraft.bubble_column": "Bobela kolumno", "block.minecraft.bubble_coral": "Bobelokoralo", "block.minecraft.bubble_coral_block": "Bloko bobelokorala", "block.minecraft.bubble_coral_fan": "Ventumilo bobelokorala", "block.minecraft.bubble_coral_wall_fan": "Mura ventumilo bobelokorala", "block.minecraft.budding_amethyst": "Burĝonanta ametisto", "block.minecraft.cactus": "Kakto", "block.minecraft.cake": "Kuko", "block.minecraft.calcite": "Kalcito", "block.minecraft.campfire": "Tendarfajro", "block.minecraft.candle": "Kandelo", "block.minecraft.candle_cake": "Kuko kun kandelo", "block.minecraft.carrots": "Karotoj", "block.minecraft.cartography_table": "Kartografitablo", "block.minecraft.carved_pumpkin": "Tajlita kukurbo", "block.minecraft.cauldron": "Kaldrono", "block.minecraft.cave_air": "Kaverna aero", "block.minecraft.cave_vines": "Kavernaj lianoj", "block.minecraft.cave_vines_plant": "Planto de kavernaj lianoj", "block.minecraft.chain": "Ĉeno", "block.minecraft.chain_command_block": "Ĉena komanda bloko", "block.minecraft.chest": "Kofro", "block.minecraft.chipped_anvil": "Fendiĝinta amboso", "block.minecraft.chiseled_deepslate": "Ĉizita ardezo", "block.minecraft.chiseled_nether_bricks": "Ĉizitaj submondbrikoj", "block.minecraft.chiseled_polished_blackstone": "Ĉizita polurita nigroŝtono", "block.minecraft.chiseled_quartz_block": "Ĉizita kvarca bloko", "block.minecraft.chiseled_red_sandstone": "Ĉizita ruĝa sabloŝtono", "block.minecraft.chiseled_sandstone": "Ĉizita sabloŝtono", "block.minecraft.chiseled_stone_bricks": "Ĉizitaj ŝtonbrikoj", "block.minecraft.chorus_flower": "Refrena floro", "block.minecraft.chorus_plant": "Refrena planto", "block.minecraft.clay": "Argilbloko", "block.minecraft.coal_block": "Karba bloko", "block.minecraft.coal_ore": "Karba erco", "block.minecraft.coarse_dirt": "Maldelikata tero", "block.minecraft.cobbled_deepslate": "Pavimardezo", "block.minecraft.cobbled_deepslate_slab": "Pavimardeza ŝtupo", "block.minecraft.cobbled_deepslate_stairs": "Pavimardeza ŝtuparo", "block.minecraft.cobbled_deepslate_wall": "Pavimardeza muro", "block.minecraft.cobblestone": "Pavimŝtono", "block.minecraft.cobblestone_slab": "Pavimŝtona ŝtupo", "block.minecraft.cobblestone_stairs": "Pavimŝtona ŝtuparo", "block.minecraft.cobblestone_wall": "Pavimŝtona muro", "block.minecraft.cobweb": "Araneaĵo", "block.minecraft.cocoa": "Kakao", "block.minecraft.command_block": "Komanda bloko", "block.minecraft.comparator": "Komparilo", "block.minecraft.composter": "Kompoŝtujo", "block.minecraft.conduit": "Markondukto", "block.minecraft.copper_block": "Kupra bloko", "block.minecraft.copper_ore": "Kupra erco", "block.minecraft.cornflower": "Cejano", "block.minecraft.cracked_deepslate_bricks": "Rompitaj ardezbrikoj", "block.minecraft.cracked_deepslate_tiles": "Rompitaj ardezaj briketoj", "block.minecraft.cracked_nether_bricks": "Rompitaj submondbrikoj", "block.minecraft.cracked_polished_blackstone_bricks": "Rompitaj poluritaj nigroŝtonbrikoj", "block.minecraft.cracked_stone_bricks": "Rompitaj ŝtonbrikoj", "block.minecraft.crafting_table": "Labortablo", "block.minecraft.creeper_head": "Kapo de kripero", "block.minecraft.creeper_wall_head": "Mura kapo de kripero", "block.minecraft.crimson_button": "Skarlata butono", "block.minecraft.crimson_door": "Skarlata pordo", "block.minecraft.crimson_fence": "Skarlata barilo", "block.minecraft.crimson_fence_gate": "Skarlata barilpordo", "block.minecraft.crimson_fungus": "Skarlata fungo", "block.minecraft.crimson_hyphae": "Skarlataj hifoj", "block.minecraft.crimson_nylium": "Skarlata nilio", "block.minecraft.crimson_planks": "Skarlataj tabuloj", "block.minecraft.crimson_pressure_plate": "Skarlata premplato", "block.minecraft.crimson_roots": "Skarlataj radikoj", "block.minecraft.crimson_sign": "Skarlata ŝildeto", "block.minecraft.crimson_slab": "Skarlata ŝtupo", "block.minecraft.crimson_stairs": "Skarlata ŝtuparo", "block.minecraft.crimson_stem": "Skarlata stipo", "block.minecraft.crimson_trapdoor": "Skarlata klappordo", "block.minecraft.crimson_wall_sign": "Skarlata mura ŝildeto", "block.minecraft.crying_obsidian": "Plorobsidiano", "block.minecraft.cut_copper": "Tranĉita kupro", "block.minecraft.cut_copper_slab": "Tranĉita kupra ŝtupo", "block.minecraft.cut_copper_stairs": "Tranĉita kupra ŝtuparo", "block.minecraft.cut_red_sandstone": "Tranĉita ruĝa sabloŝtono", "block.minecraft.cut_red_sandstone_slab": "Tranĉita ruĝa sabloŝtona ŝtupo", "block.minecraft.cut_sandstone": "Tranĉita sabloŝtono", "block.minecraft.cut_sandstone_slab": "Tranĉita sabloŝtona ŝtupo", "block.minecraft.cyan_banner": "Turkisa standardo", "block.minecraft.cyan_bed": "Turkisa lito", "block.minecraft.cyan_candle": "Turkisa kandelo", "block.minecraft.cyan_candle_cake": "Kuko kun turkisa kandelo", "block.minecraft.cyan_carpet": "Turkisa tapiŝo", "block.minecraft.cyan_concrete": "Turkisa betono", "block.minecraft.cyan_concrete_powder": "Turkisa cemento", "block.minecraft.cyan_glazed_terracotta": "Turkisa glazurita terakoto", "block.minecraft.cyan_shulker_box": "Turkisa skatolo de ŝulkro", "block.minecraft.cyan_stained_glass": "Turkisigita vitro", "block.minecraft.cyan_stained_glass_pane": "Turkisigita glaco", "block.minecraft.cyan_terracotta": "Turkisa terakoto", "block.minecraft.cyan_wool": "Turkisa lano", "block.minecraft.damaged_anvil": "Damaĝita amboso", "block.minecraft.dandelion": "Leontodo", "block.minecraft.dark_oak_button": "Malhelkverka butono", "block.minecraft.dark_oak_door": "Malhelkverka pordo", "block.minecraft.dark_oak_fence": "Malhelkverka barilo", "block.minecraft.dark_oak_fence_gate": "Malhelkverka barilpordo", "block.minecraft.dark_oak_leaves": "Malhelkverkaj folioj", "block.minecraft.dark_oak_log": "Malhelkverka ŝtipo", "block.minecraft.dark_oak_planks": "Malhelkverkaj tabuloj", "block.minecraft.dark_oak_pressure_plate": "Malhelkverka premplato", "block.minecraft.dark_oak_sapling": "Malhelkverka arbido", "block.minecraft.dark_oak_sign": "Malhelkverka ŝildeto", "block.minecraft.dark_oak_slab": "Malhelkverka ŝtupo", "block.minecraft.dark_oak_stairs": "Malhelkverka ŝtuparo", "block.minecraft.dark_oak_trapdoor": "Malhelkverka klappordo", "block.minecraft.dark_oak_wall_sign": "Malhelkverka mura ŝildeto", "block.minecraft.dark_oak_wood": "Malhelkverka ligno", "block.minecraft.dark_prismarine": "Malhelprismarino", "block.minecraft.dark_prismarine_slab": "Malhelprismarina ŝtupo", "block.minecraft.dark_prismarine_stairs": "Malhelprismarina ŝtuparo", "block.minecraft.daylight_detector": "Taglumdetektilo", "block.minecraft.dead_brain_coral": "Mortinta cerbokoralo", "block.minecraft.dead_brain_coral_block": "Mortinta bloko cerbokorala", "block.minecraft.dead_brain_coral_fan": "Mortinta ventumilo cerbokorala", "block.minecraft.dead_brain_coral_wall_fan": "Mortinta mura ventumilo cerbokorala", "block.minecraft.dead_bubble_coral": "Mortinta bobelokoralo", "block.minecraft.dead_bubble_coral_block": "Mortinta bloko bobelokorala", "block.minecraft.dead_bubble_coral_fan": "Mortinta ventumilo bobelokorala", "block.minecraft.dead_bubble_coral_wall_fan": "Mortinta mura ventumilo bobelokorala", "block.minecraft.dead_bush": "Mortinta arbusto", "block.minecraft.dead_fire_coral": "Mortinta fajrokoralo", "block.minecraft.dead_fire_coral_block": "Mortinta bloko fajrokorala", "block.minecraft.dead_fire_coral_fan": "Mortinta ventumilo fajrokorala", "block.minecraft.dead_fire_coral_wall_fan": "Mortinta mura ventumilo fajrokorala", "block.minecraft.dead_horn_coral": "Mortinta kornokoralo", "block.minecraft.dead_horn_coral_block": "Mortinta bloko kornokorala", "block.minecraft.dead_horn_coral_fan": "Mortinta ventumilo kornokorala", "block.minecraft.dead_horn_coral_wall_fan": "Mortinta mura ventumilo kornokorala", "block.minecraft.dead_tube_coral": "Mortinta tubokoralo", "block.minecraft.dead_tube_coral_block": "Mortinta bloko tubokorala", "block.minecraft.dead_tube_coral_fan": "Mortinta ventumilo tubokorala", "block.minecraft.dead_tube_coral_wall_fan": "Mortinta mura ventumilo tubokorala", "block.minecraft.deepslate": "Ardezo", "block.minecraft.deepslate_brick_slab": "Ardezbrika ŝtupo", "block.minecraft.deepslate_brick_stairs": "Ardezbrika ŝtuparo", "block.minecraft.deepslate_brick_wall": "Ardezbrika muro", "block.minecraft.deepslate_bricks": "Ardezbrikoj", "block.minecraft.deepslate_coal_ore": "Ardeza karba erco", "block.minecraft.deepslate_copper_ore": "Ardeza kupra erco", "block.minecraft.deepslate_diamond_ore": "Ardeza diamanta erco", "block.minecraft.deepslate_emerald_ore": "Ardeza smeralda erco", "block.minecraft.deepslate_gold_ore": "Ardeza ora erco", "block.minecraft.deepslate_iron_ore": "Ardeza fera erco", "block.minecraft.deepslate_lapis_ore": "Ardeza lazurita erco", "block.minecraft.deepslate_redstone_ore": "Ardeza ruĝona erco", "block.minecraft.deepslate_tile_slab": "Ardeza briketa ŝtupo", "block.minecraft.deepslate_tile_stairs": "Ardeza briketa ŝtuparo", "block.minecraft.deepslate_tile_wall": "Ardeza briketa muro", "block.minecraft.deepslate_tiles": "Ardezaj briketoj", "block.minecraft.detector_rail": "Detektila relo", "block.minecraft.diamond_block": "Diamanta bloko", "block.minecraft.diamond_ore": "Diamanta erco", "block.minecraft.diorite": "Diorito", "block.minecraft.diorite_slab": "Diorita ŝtupo", "block.minecraft.diorite_stairs": "Diorita ŝtuparo", "block.minecraft.diorite_wall": "Diorita muro", "block.minecraft.dirt": "Tero", "block.minecraft.dirt_path": "Tera pado", "block.minecraft.dispenser": "Ĵetilo", "block.minecraft.dragon_egg": "Draka ovo", "block.minecraft.dragon_head": "Kapo de drako", "block.minecraft.dragon_wall_head": "Mura kapo de drako", "block.minecraft.dried_kelp_block": "Sekigita alga bloko", "block.minecraft.dripstone_block": "Gutŝtona bloko", "block.minecraft.dropper": "Donilo", "block.minecraft.emerald_block": "Smeralda bloko", "block.minecraft.emerald_ore": "Smeralda erco", "block.minecraft.enchanting_table": "Sorĉtablo", "block.minecraft.end_gateway": "Finejportego", "block.minecraft.end_portal": "Finejportalo", "block.minecraft.end_portal_frame": "Kadro de finejportalo", "block.minecraft.end_rod": "Finejstango", "block.minecraft.end_stone": "Finejŝtono", "block.minecraft.end_stone_brick_slab": "Finejŝtonbrika ŝtupo", "block.minecraft.end_stone_brick_stairs": "Finejŝtonbrika ŝtuparo", "block.minecraft.end_stone_brick_wall": "Finejŝtonbrika muro", "block.minecraft.end_stone_bricks": "Finejŝtonaj brikoj", "block.minecraft.ender_chest": "Finejkofro", "block.minecraft.exposed_copper": "Verdigreta kupro", "block.minecraft.exposed_cut_copper": "Verdigreta tranĉita kupro", "block.minecraft.exposed_cut_copper_slab": "Verdigreta tranĉita kupra ŝtupo", "block.minecraft.exposed_cut_copper_stairs": "Verdigreta tranĉita kupra ŝtuparo", "block.minecraft.farmland": "Kultivtero", "block.minecraft.fern": "Filiko", "block.minecraft.fire": "Fajro", "block.minecraft.fire_coral": "Fajrokoralo", "block.minecraft.fire_coral_block": "Bloko fajrokorala", "block.minecraft.fire_coral_fan": "Ventumilo fajrokorala", "block.minecraft.fire_coral_wall_fan": "Mura ventumilo fajrokorala", "block.minecraft.fletching_table": "Pafarktablo", "block.minecraft.flower_pot": "Florpoto", "block.minecraft.flowering_azalea": "Floranta azaleo", "block.minecraft.flowering_azalea_leaves": "Folioj de floranta azaleo", "block.minecraft.frosted_ice": "Prujno", "block.minecraft.furnace": "Forno", "block.minecraft.gilded_blackstone": "Orita nigroŝtono", "block.minecraft.glass": "Vitro", "block.minecraft.glass_pane": "Glaco", "block.minecraft.glow_lichen": "Lumlikeno", "block.minecraft.glowstone": "Lumŝtono", "block.minecraft.gold_block": "Ora bloko", "block.minecraft.gold_ore": "Ora erco", "block.minecraft.granite": "Granito", "block.minecraft.granite_slab": "Granita ŝtupo", "block.minecraft.granite_stairs": "Granita ŝtuparo", "block.minecraft.granite_wall": "Granita muro", "block.minecraft.grass": "Herbo", "block.minecraft.grass_block": "Herba bloko", "block.minecraft.gravel": "Gruzo", "block.minecraft.gray_banner": "Griza standardo", "block.minecraft.gray_bed": "Griza lito", "block.minecraft.gray_candle": "Griza kandelo", "block.minecraft.gray_candle_cake": "Kuko kun griza kandelo", "block.minecraft.gray_carpet": "Griza tapiŝo", "block.minecraft.gray_concrete": "Griza betono", "block.minecraft.gray_concrete_powder": "Griza cemento", "block.minecraft.gray_glazed_terracotta": "Griza glazurita terakoto", "block.minecraft.gray_shulker_box": "Griza skatolo de ŝulkro", "block.minecraft.gray_stained_glass": "Grizigita vitro", "block.minecraft.gray_stained_glass_pane": "Grizigita glaco", "block.minecraft.gray_terracotta": "Griza terakoto", "block.minecraft.gray_wool": "Griza lano", "block.minecraft.green_banner": "Verda standardo", "block.minecraft.green_bed": "Verda lito", "block.minecraft.green_candle": "Verda kandelo", "block.minecraft.green_candle_cake": "Kuko kun verda kandelo", "block.minecraft.green_carpet": "Verda tapiŝo", "block.minecraft.green_concrete": "Verda betono", "block.minecraft.green_concrete_powder": "Verda cemento", "block.minecraft.green_glazed_terracotta": "Verda glazurita terakoto", "block.minecraft.green_shulker_box": "Verda skatolo de ŝulkro", "block.minecraft.green_stained_glass": "Verdigita vitro", "block.minecraft.green_stained_glass_pane": "Verdigita glaco", "block.minecraft.green_terracotta": "Verda terakoto", "block.minecraft.green_wool": "Verda lano", "block.minecraft.grindstone": "Akrigilo", "block.minecraft.hanging_roots": "Pendantaj radikoj", "block.minecraft.hay_block": "Fojnpako", "block.minecraft.heavy_weighted_pressure_plate": "Peza premplato", "block.minecraft.honey_block": "Mielbloko", "block.minecraft.honeycomb_block": "Mielĉelarbloko", "block.minecraft.hopper": "Funelo", "block.minecraft.horn_coral": "Kornokoralo", "block.minecraft.horn_coral_block": "Bloko kornokorala", "block.minecraft.horn_coral_fan": "Ventumilo kornokorala", "block.minecraft.horn_coral_wall_fan": "Mura ventumilo kornokorala", "block.minecraft.ice": "Glacio", "block.minecraft.infested_chiseled_stone_bricks": "Infestitaj ĉizitaj ŝtonbrikoj", "block.minecraft.infested_cobblestone": "Infestita pavimŝtono", "block.minecraft.infested_cracked_stone_bricks": "Infestitaj rompitaj ŝtonbrikoj", "block.minecraft.infested_deepslate": "Infestita ardezo", "block.minecraft.infested_mossy_stone_bricks": "Infestitaj muskaj ŝtonbrikoj", "block.minecraft.infested_stone": "Infestita ŝtono", "block.minecraft.infested_stone_bricks": "Infestitaj ŝtonbrikoj", "block.minecraft.iron_bars": "Fera krado", "block.minecraft.iron_block": "Fera bloko", "block.minecraft.iron_door": "Fera pordo", "block.minecraft.iron_ore": "Fera erco", "block.minecraft.iron_trapdoor": "Fera klappordo", "block.minecraft.jack_o_lantern": "Kukurba lanterno", "block.minecraft.jigsaw": "Konstruktbloko", "block.minecraft.jukebox": "Muzikaŭtomato", "block.minecraft.jungle_button": "Ĝangala butono", "block.minecraft.jungle_door": "Ĝangala pordo", "block.minecraft.jungle_fence": "Ĝangala barilo", "block.minecraft.jungle_fence_gate": "Ĝangala barilpordo", "block.minecraft.jungle_leaves": "Ĝangalaj folioj", "block.minecraft.jungle_log": "Ĝangala ŝtipo", "block.minecraft.jungle_planks": "Ĝangalaj tabuloj", "block.minecraft.jungle_pressure_plate": "Ĝangala premplato", "block.minecraft.jungle_sapling": "Ĝangala arbido", "block.minecraft.jungle_sign": "Ĝangala ŝildeto", "block.minecraft.jungle_slab": "Ĝangala ŝtupo", "block.minecraft.jungle_stairs": "Ĝangala ŝtuparo", "block.minecraft.jungle_trapdoor": "Ĝangala klappordo", "block.minecraft.jungle_wall_sign": "Ĝangala mura ŝildeto", "block.minecraft.jungle_wood": "Ĝangala ligno", "block.minecraft.kelp": "Algo", "block.minecraft.kelp_plant": "Planto de algo", "block.minecraft.ladder": "Ŝtupetaro", "block.minecraft.lantern": "Lanterno", "block.minecraft.lapis_block": "Lazurita bloko", "block.minecraft.lapis_ore": "Lazurita erco", "block.minecraft.large_amethyst_bud": "Granda ametista burĝono", "block.minecraft.large_fern": "Granda filiko", "block.minecraft.lava": "Lafo", "block.minecraft.lava_cauldron": "Kaldrono da lafo", "block.minecraft.lectern": "Libropupitro", "block.minecraft.lever": "Levilo", "block.minecraft.light": "Lumo", "block.minecraft.light_blue_banner": "Helblua standardo", "block.minecraft.light_blue_bed": "Helblua lito", "block.minecraft.light_blue_candle": "Helblua kandelo", "block.minecraft.light_blue_candle_cake": "Kuko kun helblua kandelo", "block.minecraft.light_blue_carpet": "Helblua tapiŝo", "block.minecraft.light_blue_concrete": "Helblua betono", "block.minecraft.light_blue_concrete_powder": "Helblua cemento", "block.minecraft.light_blue_glazed_terracotta": "Helblua glazurita terakoto", "block.minecraft.light_blue_shulker_box": "Helblua skatolo de ŝulkro", "block.minecraft.light_blue_stained_glass": "Helbluigita vitro", "block.minecraft.light_blue_stained_glass_pane": "Helbluigita glaco", "block.minecraft.light_blue_terracotta": "Helblua terakoto", "block.minecraft.light_blue_wool": "Helblua lano", "block.minecraft.light_gray_banner": "Helgriza standardo", "block.minecraft.light_gray_bed": "Helgriza lito", "block.minecraft.light_gray_candle": "Helgriza kandelo", "block.minecraft.light_gray_candle_cake": "Kuko kun helgriza kandelo", "block.minecraft.light_gray_carpet": "Helgriza tapiŝo", "block.minecraft.light_gray_concrete": "Helgriza betono", "block.minecraft.light_gray_concrete_powder": "Helgriza cemento", "block.minecraft.light_gray_glazed_terracotta": "Helgriza glazurita terakoto", "block.minecraft.light_gray_shulker_box": "Helgriza skatolo de ŝulkro", "block.minecraft.light_gray_stained_glass": "Helgrizigita vitro", "block.minecraft.light_gray_stained_glass_pane": "Helgrizigita glaco", "block.minecraft.light_gray_terracotta": "Helgriza terakoto", "block.minecraft.light_gray_wool": "Helgriza lano", "block.minecraft.light_weighted_pressure_plate": "Malpeza premplato", "block.minecraft.lightning_rod": "Fulmoŝirmilo", "block.minecraft.lilac": "Siringo", "block.minecraft.lily_of_the_valley": "Konvalo", "block.minecraft.lily_pad": "Akvolilio", "block.minecraft.lime_banner": "Helverda standardo", "block.minecraft.lime_bed": "Helverda lito", "block.minecraft.lime_candle": "Helverda kandelo", "block.minecraft.lime_candle_cake": "Kuko kun helverda kandelo", "block.minecraft.lime_carpet": "Helverda tapiŝo", "block.minecraft.lime_concrete": "Helverda betono", "block.minecraft.lime_concrete_powder": "Helverda cemento", "block.minecraft.lime_glazed_terracotta": "Helverda glazurita terakoto", "block.minecraft.lime_shulker_box": "Helverda skatolo de ŝulkro", "block.minecraft.lime_stained_glass": "Helverdigita vitro", "block.minecraft.lime_stained_glass_pane": "Helverdigita glaco", "block.minecraft.lime_terracotta": "Helverda terakoto", "block.minecraft.lime_wool": "Helverda lano", "block.minecraft.lodestone": "Magnetŝtono", "block.minecraft.loom": "Teksilo", "block.minecraft.magenta_banner": "Malva standardo", "block.minecraft.magenta_bed": "Malva lito", "block.minecraft.magenta_candle": "Malva kandelo", "block.minecraft.magenta_candle_cake": "Kuko kun malva kandelo", "block.minecraft.magenta_carpet": "Malva tapiŝo", "block.minecraft.magenta_concrete": "Malva betono", "block.minecraft.magenta_concrete_powder": "Malva cemento", "block.minecraft.magenta_glazed_terracotta": "Malva glazurita terakoto", "block.minecraft.magenta_shulker_box": "Malva skatolo de ŝulkro", "block.minecraft.magenta_stained_glass": "Malvigita vitro", "block.minecraft.magenta_stained_glass_pane": "Malvigita glaco", "block.minecraft.magenta_terracotta": "Malva terakoto", "block.minecraft.magenta_wool": "Malva lano", "block.minecraft.magma_block": "Magma bloko", "block.minecraft.medium_amethyst_bud": "Mezgranda ametista burĝono", "block.minecraft.melon": "Akvomelono", "block.minecraft.melon_stem": "Akvomelona tigo", "block.minecraft.moss_block": "Muska bloko", "block.minecraft.moss_carpet": "Muska tapiŝo", "block.minecraft.mossy_cobblestone": "Muska pavimŝtono", "block.minecraft.mossy_cobblestone_slab": "Muska pavimŝtona ŝtupo", "block.minecraft.mossy_cobblestone_stairs": "Muska pavimŝtona ŝtuparo", "block.minecraft.mossy_cobblestone_wall": "Muska pavimŝtona muro", "block.minecraft.mossy_stone_brick_slab": "Muska ŝtonbrika ŝtupo", "block.minecraft.mossy_stone_brick_stairs": "Muska ŝtonbrika ŝtuparo", "block.minecraft.mossy_stone_brick_wall": "Muska ŝtonbrika muro", "block.minecraft.mossy_stone_bricks": "Muskaj ŝtonbrikoj", "block.minecraft.moving_piston": "Movita bloko", "block.minecraft.mushroom_stem": "Fungstipo", "block.minecraft.mycelium": "Micelio", "block.minecraft.nether_brick_fence": "Submondbrika barilo", "block.minecraft.nether_brick_slab": "Submondbrika ŝtupo", "block.minecraft.nether_brick_stairs": "Submondbrika ŝtuparo", "block.minecraft.nether_brick_wall": "Submondbrika muro", "block.minecraft.nether_bricks": "Submondbrikoj", "block.minecraft.nether_gold_ore": "Submonda ora erco", "block.minecraft.nether_portal": "Submondportalo", "block.minecraft.nether_quartz_ore": "Kvarca erco", "block.minecraft.nether_sprouts": "Submondaj ŝosoj", "block.minecraft.nether_wart": "Submonda veruko", "block.minecraft.nether_wart_block": "Submondveruka bloko", "block.minecraft.netherite_block": "Subena bloko", "block.minecraft.netherrack": "Submondŝtono", "block.minecraft.note_block": "Notbloko", "block.minecraft.oak_button": "Kverka butono", "block.minecraft.oak_door": "Kverka pordo", "block.minecraft.oak_fence": "Kverka barilo", "block.minecraft.oak_fence_gate": "Kverka barilpordo", "block.minecraft.oak_leaves": "Kverkaj folioj", "block.minecraft.oak_log": "Kverka ŝtipo", "block.minecraft.oak_planks": "Kverkaj tabuloj", "block.minecraft.oak_pressure_plate": "Kverka premplato", "block.minecraft.oak_sapling": "Kverka arbido", "block.minecraft.oak_sign": "Kverka ŝildeto", "block.minecraft.oak_slab": "Kverka ŝtupo", "block.minecraft.oak_stairs": "Kverka ŝtuparo", "block.minecraft.oak_trapdoor": "Kverka klappordo", "block.minecraft.oak_wall_sign": "Kverka mura ŝildeto", "block.minecraft.oak_wood": "Kverka ligno", "block.minecraft.observer": "Observilo", "block.minecraft.obsidian": "Obsidiano", "block.minecraft.ominous_banner": "Malbonaŭgura standardo", "block.minecraft.orange_banner": "Oranĝkolora standardo", "block.minecraft.orange_bed": "Oranĝkolora lito", "block.minecraft.orange_candle": "Oranĝkolora kandelo", "block.minecraft.orange_candle_cake": "Kuko kun oranĝkolora kandelo", "block.minecraft.orange_carpet": "Oranĝkolora tapiŝo", "block.minecraft.orange_concrete": "Oranĝkolora betono", "block.minecraft.orange_concrete_powder": "Oranĝkolora cemento", "block.minecraft.orange_glazed_terracotta": "Oranĝkolora glazurita terakoto", "block.minecraft.orange_shulker_box": "Oranĝkolora skatolo de ŝulkro", "block.minecraft.orange_stained_glass": "Oranĝkolorigita vitro", "block.minecraft.orange_stained_glass_pane": "Oranĝkolorigita glaco", "block.minecraft.orange_terracotta": "Oranĝkolora terakoto", "block.minecraft.orange_tulip": "Oranĝkolora tulipo", "block.minecraft.orange_wool": "Oranĝkolora lano", "block.minecraft.oxeye_daisy": "Lekanto", "block.minecraft.oxidized_copper": "Verdigrega kupro", "block.minecraft.oxidized_cut_copper": "Verdigrega tranĉita kupro", "block.minecraft.oxidized_cut_copper_slab": "Verdigrega tranĉita kupra ŝtupo", "block.minecraft.oxidized_cut_copper_stairs": "Verdigrega tranĉita kupra ŝtuparo", "block.minecraft.packed_ice": "Malmola glacio", "block.minecraft.peony": "Peonio", "block.minecraft.petrified_oak_slab": "Ŝtoniĝita kverka ŝtupo", "block.minecraft.pink_banner": "Rozkolora standardo", "block.minecraft.pink_bed": "Roza lito", "block.minecraft.pink_candle": "Rozkolora kandelo", "block.minecraft.pink_candle_cake": "Kuko kun rozkolora kandelo", "block.minecraft.pink_carpet": "Rozkolora tapiŝo", "block.minecraft.pink_concrete": "Rozkolora betono", "block.minecraft.pink_concrete_powder": "Rozkolora cemento", "block.minecraft.pink_glazed_terracotta": "Rozkolora glazurita terakoto", "block.minecraft.pink_shulker_box": "Rozkolora skatolo de ŝulkro", "block.minecraft.pink_stained_glass": "Rozkolorigita vitro", "block.minecraft.pink_stained_glass_pane": "Rozkolorigita glaco", "block.minecraft.pink_terracotta": "Rozkolora terakoto", "block.minecraft.pink_tulip": "Rozkolora tulipo", "block.minecraft.pink_wool": "Rozkolora lano", "block.minecraft.piston": "Piŝto", "block.minecraft.piston_head": "Piŝtokapo", "block.minecraft.player_head": "Kapo de ludanto", "block.minecraft.player_head.named": "Kapo de %s", "block.minecraft.player_wall_head": "Mura kapo de ludano", "block.minecraft.podzol": "Podzolo", "block.minecraft.pointed_dripstone": "Pinta gutŝtono", "block.minecraft.polished_andesite": "Polurita andezito", "block.minecraft.polished_andesite_slab": "Polurita andezita ŝtupo", "block.minecraft.polished_andesite_stairs": "Polurita andezita ŝtuparo", "block.minecraft.polished_basalt": "Polurita bazalto", "block.minecraft.polished_blackstone": "Polurita nigroŝtono", "block.minecraft.polished_blackstone_brick_slab": "Polurita nigroŝtonbrika ŝtupo", "block.minecraft.polished_blackstone_brick_stairs": "Polurita nigroŝtonbrika ŝtuparo", "block.minecraft.polished_blackstone_brick_wall": "Polurita nigroŝtonbrika muro", "block.minecraft.polished_blackstone_bricks": "Poluritaj nigroŝtonbrikoj", "block.minecraft.polished_blackstone_button": "Polurita nigroŝtona butono", "block.minecraft.polished_blackstone_pressure_plate": "Polurita nigroŝtona premplato", "block.minecraft.polished_blackstone_slab": "Polurita nigroŝtona ŝtupo", "block.minecraft.polished_blackstone_stairs": "Polurita nigroŝtona ŝtuparo", "block.minecraft.polished_blackstone_wall": "Polurita nigroŝtona muro", "block.minecraft.polished_deepslate": "Polurita ardezo", "block.minecraft.polished_deepslate_slab": "Polurita ardeza ŝtupo", "block.minecraft.polished_deepslate_stairs": "Polurita ardeza ŝtuparo", "block.minecraft.polished_deepslate_wall": "Polurita ardeza muro", "block.minecraft.polished_diorite": "Polurita diorito", "block.minecraft.polished_diorite_slab": "Polurita diorita ŝtupo", "block.minecraft.polished_diorite_stairs": "Polurita diorita ŝtuparo", "block.minecraft.polished_granite": "Polurita granito", "block.minecraft.polished_granite_slab": "Polurita granita ŝtupo", "block.minecraft.polished_granite_stairs": "Polurita granita ŝtuparo", "block.minecraft.poppy": "Papaveto", "block.minecraft.potatoes": "Terpomoj", "block.minecraft.potted_acacia_sapling": "Akacia arbido en florpoto", "block.minecraft.potted_allium": "Aliumo en florpoto", "block.minecraft.potted_azalea_bush": "Azaleo en florpoto", "block.minecraft.potted_azure_bluet": "Blua houstonio en florpoto", "block.minecraft.potted_bamboo": "Bambuo en florpoto", "block.minecraft.potted_birch_sapling": "Betula arbido en florpoto", "block.minecraft.potted_blue_orchid": "Blua orkido en florpoto", "block.minecraft.potted_brown_mushroom": "Boleto en florpoto", "block.minecraft.potted_cactus": "Kakto en florpoto", "block.minecraft.potted_cornflower": "Cejano en florpoto", "block.minecraft.potted_crimson_fungus": "Skarlata fungo en florpoto", "block.minecraft.potted_crimson_roots": "Skarlataj radikoj en florpoto", "block.minecraft.potted_dandelion": "Leontodo en florpoto", "block.minecraft.potted_dark_oak_sapling": "Malhelkverka arbido en florpoto", "block.minecraft.potted_dead_bush": "Mortinta arbusto en florpoto", "block.minecraft.potted_fern": "Filiko en florpoto", "block.minecraft.potted_flowering_azalea_bush": "Floranta azaleo en florpoto", "block.minecraft.potted_jungle_sapling": "Ĝangala arbido en florpoto", "block.minecraft.potted_lily_of_the_valley": "Konvalo en florpoto", "block.minecraft.potted_oak_sapling": "Kverka arbido en florpoto", "block.minecraft.potted_orange_tulip": "Oranĝkolora tulipo en florpoto", "block.minecraft.potted_oxeye_daisy": "Lekanto en florpoto", "block.minecraft.potted_pink_tulip": "Rozkolora tulipo en florpoto", "block.minecraft.potted_poppy": "Papaveto en florpoto", "block.minecraft.potted_red_mushroom": "Muŝfungo en florpoto", "block.minecraft.potted_red_tulip": "Ruĝa tulipo en florpoto", "block.minecraft.potted_spruce_sapling": "Picea arbido en florpoto", "block.minecraft.potted_warped_fungus": "Torda fungo en florpoto", "block.minecraft.potted_warped_roots": "Tordaj radikoj en florpoto", "block.minecraft.potted_white_tulip": "Blanka tulipo en florpoto", "block.minecraft.potted_wither_rose": "Vizerrozo en florpoto", "block.minecraft.powder_snow": "Pulvora neĝo", "block.minecraft.powder_snow_cauldron": "Kaldrono da pulvora neĝo", "block.minecraft.powered_rail": "Elektra relo", "block.minecraft.prismarine": "Prismarino", "block.minecraft.prismarine_brick_slab": "Prismarinbrika ŝtupo", "block.minecraft.prismarine_brick_stairs": "Prismarinbrika ŝtuparo", "block.minecraft.prismarine_bricks": "Prismarinbrikoj", "block.minecraft.prismarine_slab": "Prismarina ŝtupo", "block.minecraft.prismarine_stairs": "Prismarina ŝtuparo", "block.minecraft.prismarine_wall": "Prismarina muro", "block.minecraft.pumpkin": "Kukurbo", "block.minecraft.pumpkin_stem": "Kukurba tigo", "block.minecraft.purple_banner": "Violkolora standardo", "block.minecraft.purple_bed": "Viola lito", "block.minecraft.purple_candle": "Violkolora kandelo", "block.minecraft.purple_candle_cake": "Kuko kun violkolora kandelo", "block.minecraft.purple_carpet": "Violkolora tapiŝo", "block.minecraft.purple_concrete": "Purpura betono", "block.minecraft.purple_concrete_powder": "Violkolora cemento", "block.minecraft.purple_glazed_terracotta": "Violkolora glazurita terakoto", "block.minecraft.purple_shulker_box": "Violkolora skatolo de ŝulkro", "block.minecraft.purple_stained_glass": "Violkolorigita vitro", "block.minecraft.purple_stained_glass_pane": "Violkolorigita glaco", "block.minecraft.purple_terracotta": "Violkolora terakoto", "block.minecraft.purple_wool": "Violkolora lano", "block.minecraft.purpur_block": "Purpura bloko", "block.minecraft.purpur_pillar": "Purpura kolono", "block.minecraft.purpur_slab": "Purpura ŝtupo", "block.minecraft.purpur_stairs": "Purpura ŝtuparo", "block.minecraft.quartz_block": "Kvarca bloko", "block.minecraft.quartz_bricks": "Kvarcbrikoj", "block.minecraft.quartz_pillar": "Kvarca kolono", "block.minecraft.quartz_slab": "Kvarca ŝtupo", "block.minecraft.quartz_stairs": "Kvarca ŝtuparo", "block.minecraft.rail": "Relo", "block.minecraft.raw_copper_block": "Krudkupra bloko", "block.minecraft.raw_gold_block": "Krudora bloko", "block.minecraft.raw_iron_block": "Krudfera bloko", "block.minecraft.red_banner": "Ruĝa standardo", "block.minecraft.red_bed": "Ruĝa lito", "block.minecraft.red_candle": "Ruĝa kandelo", "block.minecraft.red_candle_cake": "Kuko kun ruĝa kandelo", "block.minecraft.red_carpet": "Ruĝa tapiŝo", "block.minecraft.red_concrete": "Ruĝa betono", "block.minecraft.red_concrete_powder": "Ruĝa cemento", "block.minecraft.red_glazed_terracotta": "Ruĝa glazurita terakoto", "block.minecraft.red_mushroom": "Muŝfungo", "block.minecraft.red_mushroom_block": "Muŝfunga bloko", "block.minecraft.red_nether_brick_slab": "Ruĝa submondbrika ŝtupo", "block.minecraft.red_nether_brick_stairs": "Ruĝa submondbrika ŝtuparo", "block.minecraft.red_nether_brick_wall": "Ruĝa submondbrika muro", "block.minecraft.red_nether_bricks": "Ruĝaj submondbrikoj", "block.minecraft.red_sand": "Ruĝa sablo", "block.minecraft.red_sandstone": "Ruĝa sabloŝtono", "block.minecraft.red_sandstone_slab": "Ruĝa sabloŝtona ŝtupo", "block.minecraft.red_sandstone_stairs": "Ruĝa sabloŝtona ŝtuparo", "block.minecraft.red_sandstone_wall": "Ruĝa sabloŝtona muro", "block.minecraft.red_shulker_box": "Ruĝa skatolo de ŝulkro", "block.minecraft.red_stained_glass": "Ruĝigita vitro", "block.minecraft.red_stained_glass_pane": "Ruĝigita glaco", "block.minecraft.red_terracotta": "Ruĝa terakoto", "block.minecraft.red_tulip": "Ruĝa tulipo", "block.minecraft.red_wool": "Ruĝa lano", "block.minecraft.redstone_block": "Ruĝona bloko", "block.minecraft.redstone_lamp": "Ruĝona lampo", "block.minecraft.redstone_ore": "Ruĝona erco", "block.minecraft.redstone_torch": "Ruĝona torĉo", "block.minecraft.redstone_wall_torch": "Ruĝona mura torĉo", "block.minecraft.redstone_wire": "Ruĝona pado", "block.minecraft.repeater": "Repetilo", "block.minecraft.repeating_command_block": "Ripeta komanda bloko", "block.minecraft.respawn_anchor": "Reaperankro", "block.minecraft.rooted_dirt": "Radika tero", "block.minecraft.rose_bush": "Rozarbusto", "block.minecraft.sand": "Sablo", "block.minecraft.sandstone": "Sabloŝtono", "block.minecraft.sandstone_slab": "Sabloŝtona ŝtupo", "block.minecraft.sandstone_stairs": "Sabloŝtona ŝtuparo", "block.minecraft.sandstone_wall": "Sabloŝtona muro", "block.minecraft.scaffolding": "Skafaldo", "block.minecraft.sculk_sensor": "Skulka sensoro", "block.minecraft.sea_lantern": "Marlanterno", "block.minecraft.sea_pickle": "Pirosomo", "block.minecraft.seagrass": "Marherbo", "block.minecraft.set_spawn": "Reaperejo ŝanĝiĝis", "block.minecraft.shroomlight": "Lumfungo", "block.minecraft.shulker_box": "Skatolo de ŝulkro", "block.minecraft.skeleton_skull": "Kranio de skeleto", "block.minecraft.skeleton_wall_skull": "Mura kranio de skeleto", "block.minecraft.slime_block": "Mukbloko", "block.minecraft.small_amethyst_bud": "Malgranda ametista burĝono", "block.minecraft.small_dripleaf": "Gutfolieto", "block.minecraft.smithing_table": "Fandtablo", "block.minecraft.smoker": "Fumilo", "block.minecraft.smooth_basalt": "Glata bazalto", "block.minecraft.smooth_quartz": "Glata kvarca bloko", "block.minecraft.smooth_quartz_slab": "Glata kvarca ŝtupo", "block.minecraft.smooth_quartz_stairs": "Glata kvarca ŝtuparo", "block.minecraft.smooth_red_sandstone": "Glata ruĝa sabloŝtono", "block.minecraft.smooth_red_sandstone_slab": "Glata ruĝa sabloŝtona ŝtupo", "block.minecraft.smooth_red_sandstone_stairs": "Glata ruĝa sabloŝtona ŝtuparo", "block.minecraft.smooth_sandstone": "Glata sabloŝtono", "block.minecraft.smooth_sandstone_slab": "Glata sabloŝtona ŝtupo", "block.minecraft.smooth_sandstone_stairs": "Glata sabloŝtona ŝtuparo", "block.minecraft.smooth_stone": "Glata ŝtono", "block.minecraft.smooth_stone_slab": "Glata ŝtona ŝtupo", "block.minecraft.snow": "Neĝo", "block.minecraft.snow_block": "Neĝa bloko", "block.minecraft.soul_campfire": "Animtendarfajro", "block.minecraft.soul_fire": "Animfajro", "block.minecraft.soul_lantern": "Anima lanterno", "block.minecraft.soul_sand": "Animsablo", "block.minecraft.soul_soil": "Animtero", "block.minecraft.soul_torch": "Anima torĉo", "block.minecraft.soul_wall_torch": "Anima mura torĉo", "block.minecraft.spawn.not_valid": "Vi ne havas hejmliton aŭ ŝargitan reaperankron, aŭ ĝi blokiĝis", "block.minecraft.spawner": "Generilo", "block.minecraft.sponge": "Spongo", "block.minecraft.spore_blossom": "Sporfloro", "block.minecraft.spruce_button": "Picea butono", "block.minecraft.spruce_door": "Picea pordo", "block.minecraft.spruce_fence": "Picea barilo", "block.minecraft.spruce_fence_gate": "Picea barilpordo", "block.minecraft.spruce_leaves": "Piceaj folioj", "block.minecraft.spruce_log": "Picea ŝtipo", "block.minecraft.spruce_planks": "Piceaj tabuloj", "block.minecraft.spruce_pressure_plate": "Picea premplato", "block.minecraft.spruce_sapling": "Picea arbido", "block.minecraft.spruce_sign": "Picea ŝildeto", "block.minecraft.spruce_slab": "Picea ŝtupo", "block.minecraft.spruce_stairs": "Picea ŝtuparo", "block.minecraft.spruce_trapdoor": "Picea klappordo", "block.minecraft.spruce_wall_sign": "Picea mura ŝildeto", "block.minecraft.spruce_wood": "Picea ligno", "block.minecraft.sticky_piston": "Adhera piŝto", "block.minecraft.stone": "Ŝtono", "block.minecraft.stone_brick_slab": "Ŝtonbrika ŝtupo", "block.minecraft.stone_brick_stairs": "Ŝtonbrika ŝtuparo", "block.minecraft.stone_brick_wall": "Ŝtonbrika muro", "block.minecraft.stone_bricks": "Ŝtonbrikoj", "block.minecraft.stone_button": "Ŝtona butono", "block.minecraft.stone_pressure_plate": "Ŝtona premplato", "block.minecraft.stone_slab": "Ŝtona ŝtupo", "block.minecraft.stone_stairs": "Ŝtona ŝtuparo", "block.minecraft.stonecutter": "Ŝtontranĉilo", "block.minecraft.stripped_acacia_log": "Senŝela akacia ŝtipo", "block.minecraft.stripped_acacia_wood": "Senŝela akacia ligno", "block.minecraft.stripped_birch_log": "Senŝela betula ŝtipo", "block.minecraft.stripped_birch_wood": "Senŝela betula ligno", "block.minecraft.stripped_crimson_hyphae": "Senŝelaj skarlataj hifoj", "block.minecraft.stripped_crimson_stem": "Senŝela skarlata stipo", "block.minecraft.stripped_dark_oak_log": "Senŝela malhelkverka ŝtipo", "block.minecraft.stripped_dark_oak_wood": "Senŝela malhelkverka ligno", "block.minecraft.stripped_jungle_log": "Senŝela ĝangala ŝtipo", "block.minecraft.stripped_jungle_wood": "Senŝela ĝangala ligno", "block.minecraft.stripped_oak_log": "Senŝela kverka ŝtipo", "block.minecraft.stripped_oak_wood": "Senŝela kverka ligno", "block.minecraft.stripped_spruce_log": "Senŝela picea ŝtipo", "block.minecraft.stripped_spruce_wood": "Senŝela picea ligno", "block.minecraft.stripped_warped_hyphae": "Senŝelaj tordaj hifoj", "block.minecraft.stripped_warped_stem": "Senŝela torda stipo", "block.minecraft.structure_block": "Strukturbloko", "block.minecraft.structure_void": "Strukturvakuo", "block.minecraft.sugar_cane": "Sukerkano", "block.minecraft.sunflower": "Sunfloro", "block.minecraft.sweet_berry_bush": "Dolĉbera arbusto", "block.minecraft.tall_grass": "Alta herbo", "block.minecraft.tall_seagrass": "Alta marherbo", "block.minecraft.target": "Pafcelo", "block.minecraft.terracotta": "Terakoto", "block.minecraft.tinted_glass": "Malluma vitro", "block.minecraft.tnt": "TNT", "block.minecraft.torch": "Torĉo", "block.minecraft.trapped_chest": "Baskulkofro", "block.minecraft.tripwire": "Insiddrato", "block.minecraft.tripwire_hook": "Hoko por insiddrato", "block.minecraft.tube_coral": "Tubokoralo", "block.minecraft.tube_coral_block": "Bloko tubokorala", "block.minecraft.tube_coral_fan": "Ventumilo tubokorala", "block.minecraft.tube_coral_wall_fan": "Mura ventumilo tubokorala", "block.minecraft.tuff": "Tofo", "block.minecraft.turtle_egg": "Testudovo", "block.minecraft.twisting_vines": "Serpentantaj hederoj", "block.minecraft.twisting_vines_plant": "Planto de serpentantaj hederoj", "block.minecraft.vine": "Hederoj", "block.minecraft.void_air": "Vakueja aero", "block.minecraft.wall_torch": "Mura torĉo", "block.minecraft.warped_button": "Torda butono", "block.minecraft.warped_door": "Torda pordo", "block.minecraft.warped_fence": "Torda barilo", "block.minecraft.warped_fence_gate": "Torda barilpordo", "block.minecraft.warped_fungus": "Torda fungo", "block.minecraft.warped_hyphae": "Tordaj hifoj", "block.minecraft.warped_nylium": "Torda nilio", "block.minecraft.warped_planks": "Tordaj tabuloj", "block.minecraft.warped_pressure_plate": "Torda premplato", "block.minecraft.warped_roots": "Tordaj radikoj", "block.minecraft.warped_sign": "Torda ŝildeto", "block.minecraft.warped_slab": "Torda ŝtupo", "block.minecraft.warped_stairs": "Torda ŝtuparo", "block.minecraft.warped_stem": "Torda stipo", "block.minecraft.warped_trapdoor": "Torda klappordo", "block.minecraft.warped_wall_sign": "Torda mura ŝildeto", "block.minecraft.warped_wart_block": "Torda submondveruka bloko", "block.minecraft.water": "Akvo", "block.minecraft.water_cauldron": "Kaldrono da akvo", "block.minecraft.waxed_copper_block": "Vaksita kupra bloko", "block.minecraft.waxed_cut_copper": "Vaksita tranĉita kupro", "block.minecraft.waxed_cut_copper_slab": "Vaksita tranĉita kupra ŝtupo", "block.minecraft.waxed_cut_copper_stairs": "Vaksita tranĉita kupra ŝtuparo", "block.minecraft.waxed_exposed_copper": "Vaksita verdigreta kupro", "block.minecraft.waxed_exposed_cut_copper": "Vaksita verdigreta tranĉita kupro", "block.minecraft.waxed_exposed_cut_copper_slab": "Vaksita verdigreta tranĉita kupra ŝtupo", "block.minecraft.waxed_exposed_cut_copper_stairs": "Vaksita verdigreta tranĉita kupra ŝtuparo", "block.minecraft.waxed_oxidized_copper": "Vaksita verdigrega kupro", "block.minecraft.waxed_oxidized_cut_copper": "Vaksita verdigrega tranĉita kupro", "block.minecraft.waxed_oxidized_cut_copper_slab": "Vaksita verdigrega tranĉita kupra ŝtupo", "block.minecraft.waxed_oxidized_cut_copper_stairs": "Vaksita verdigrega tranĉita kupra ŝtuparo", "block.minecraft.waxed_weathered_copper": "Vaksita verdigra kupro", "block.minecraft.waxed_weathered_cut_copper": "Vaksita verdigra tranĉita kupro", "block.minecraft.waxed_weathered_cut_copper_slab": "Vaksita verdigra tranĉita kupra ŝtupo", "block.minecraft.waxed_weathered_cut_copper_stairs": "Vaksita verdigra tranĉita kupra ŝtuparo", "block.minecraft.weathered_copper": "Verdigra kupro", "block.minecraft.weathered_cut_copper": "Verdigra tranĉita kupro", "block.minecraft.weathered_cut_copper_slab": "Verdigra tranĉita kupra ŝtupo", "block.minecraft.weathered_cut_copper_stairs": "Verdigra tranĉita kupra ŝtuparo", "block.minecraft.weeping_vines": "Larmantaj hederoj", "block.minecraft.weeping_vines_plant": "Planto de larmantaj hederoj", "block.minecraft.wet_sponge": "Malseka spongo", "block.minecraft.wheat": "Tritikaj semitaĵoj", "block.minecraft.white_banner": "Blanka standardo", "block.minecraft.white_bed": "Blanka lito", "block.minecraft.white_candle": "Blanka kandelo", "block.minecraft.white_candle_cake": "Kuko kun blanka kandelo", "block.minecraft.white_carpet": "Blanka tapiŝo", "block.minecraft.white_concrete": "Blanka betono", "block.minecraft.white_concrete_powder": "Blanka cemento", "block.minecraft.white_glazed_terracotta": "Blanka glazurita terakoto", "block.minecraft.white_shulker_box": "Blanka skatolo de ŝulkro", "block.minecraft.white_stained_glass": "Blankigita vitro", "block.minecraft.white_stained_glass_pane": "Blankigita glaco", "block.minecraft.white_terracotta": "Blanka terakoto", "block.minecraft.white_tulip": "Blanka tulipo", "block.minecraft.white_wool": "Blanka lano", "block.minecraft.wither_rose": "Vizerrozo", "block.minecraft.wither_skeleton_skull": "Kranio de vizerskeleto", "block.minecraft.wither_skeleton_wall_skull": "Mura kranio de vizerskeleto", "block.minecraft.yellow_banner": "Flava standardo", "block.minecraft.yellow_bed": "Flava lito", "block.minecraft.yellow_candle": "Flava kandelo", "block.minecraft.yellow_candle_cake": "Kuko kun flava kandelo", "block.minecraft.yellow_carpet": "Flava tapiŝo", "block.minecraft.yellow_concrete": "Flava betono", "block.minecraft.yellow_concrete_powder": "Flava cemento", "block.minecraft.yellow_glazed_terracotta": "Flava glazurita terakoto", "block.minecraft.yellow_shulker_box": "Flava skatolo de ŝulkro", "block.minecraft.yellow_stained_glass": "Flavigita vitro", "block.minecraft.yellow_stained_glass_pane": "Flavigita glaco", "block.minecraft.yellow_terracotta": "Flava terakoto", "block.minecraft.yellow_wool": "Flava lano", "block.minecraft.zombie_head": "Kapo de zombio", "block.minecraft.zombie_wall_head": "Mura kapo de zombio", "book.byAuthor": "de %[1]s", "book.editTitle": "Tajpu titolon de la libro:", "book.finalizeButton": "Subskribi kaj fermi", "book.finalizeWarning": "Atentu! Kiam vi subskribos la libron, ĝi ne plu estos redaktebla.", "book.generation.0": "Originalo", "book.generation.1": "Kopio de la originalo", "book.generation.2": "Kopio de kopio", "book.generation.3": "Ĉifona", "book.invalid.tag": "* Malvalida libra priskribilo *", "book.pageIndicator": "Paĝo %[1]s el %[2]s", "book.signButton": "Subskribi", "build.tooHigh": "Konstrua altlimo estas %s", "chat.cannotSend": "Ne eblas sendi mesaĝon", "chat.coordinates": "%s, %s, %s", "chat.coordinates.tooltip": "Klaku por teleportiĝi", "chat.copy": "Kopii al poŝo", "chat.copy.click": "Klaku por kopii al poŝo", "chat.disabled.launcher": "Babilejo estas malŝaltita per lanĉilo. La mesaĝo ne sendeblas", "chat.disabled.options": "Babilejo estas malŝaltita en agordoj de uzanto", "chat.disabled.profile": "Babilejo ne estas uzebla laŭ kontaj agordoj. La mesaĝo ne sendeblas", "chat.editBox": "babilejo", "chat.link.confirm": "Ĉu vi certas ke vi volas malfermi la jenan retejon?", "chat.link.confirmTrusted": "Ĉu vi volas malfermi ĉi tiun ligilon aŭ kopii ĝin al poŝo?", "chat.link.open": "Malfermi enrete", "chat.link.warning": "Neniam malfermu ligilojn de personoj, kiujn vi ne fidas!", "chat.queue": "[+%s atendantaj linioj]", "chat.square_brackets": "[%s]", "chat.type.admin": "[%s: %s]", "chat.type.advancement.challenge": "%s finis la difion %s", "chat.type.advancement.goal": "%s atingis la celon %s", "chat.type.advancement.task": "%s faris la progreseron %s", "chat.type.announcement": "[%s] %s", "chat.type.emote": "* %s %s", "chat.type.team.hover": "Skribi al teamo", "chat.type.team.sent": "-> %s <%s> %s", "chat.type.team.text": "%s <%s> %s", "chat.type.text": "<%s> %s", "chat.type.text.narrate": "%s diras %s", "chat_screen.message": "Sendota mesaĝo: %s", "chat_screen.title": "Babileja ekrano", "chat_screen.usage": "Entajpu la mesaĝon kaj premu la klavon enigo", "clear.failed.multiple": "Neniuj aĵoj estas trovitaj ĉe %s ludantoj", "clear.failed.single": "Neniuj aĵoj estas trovitaj ĉe la ludanto %s", "color.minecraft.black": "Nigra", "color.minecraft.blue": "Blua", "color.minecraft.brown": "Bruna", "color.minecraft.cyan": "Turkisa", "color.minecraft.gray": "Griza", "color.minecraft.green": "Verda", "color.minecraft.light_blue": "Helblua", "color.minecraft.light_gray": "Helgriza", "color.minecraft.lime": "Helverda", "color.minecraft.magenta": "Malva", "color.minecraft.orange": "Oranĝkolora", "color.minecraft.pink": "Rozkolora", "color.minecraft.purple": "Violkolora", "color.minecraft.red": "Ruĝa", "color.minecraft.white": "Blanka", "color.minecraft.yellow": "Flava", "command.context.here": "<--[ĈI TIE]", "command.context.parse_error": "%s ĉe pozicio %s: %s", "command.exception": "Sintaksa analizo de la komando ne fareblis: %s", "command.expected.separator": "Atendis blankspacon por fini unu argumenton, sed trovis vostajn datumojn", "command.failed": "Eraro okazis dum plenumado de la komando", "command.unknown.argument": "Malĝusta argumento por komando", "command.unknown.command": "Nekonata aŭ nekompleta komando, vidu la eraron sube", "commands.advancement.advancementNotFound": "Neniu progresero estas trovita per la nomo \"%[1]s\"", "commands.advancement.criterionNotFound": "La progresero \"%[1]s\" ne enhavas kriterion \"%[2]s\"", "commands.advancement.grant.criterion.to.many.failure": "Kriterio \"%s\" de la progresero \"%s\" ne doneblis al %s ludantoj ĉar ili jam havas ĝin", "commands.advancement.grant.criterion.to.many.success": "Donis kriterion \"%s\" de la progresso \"%s\" al %s ludantoj", "commands.advancement.grant.criterion.to.one.failure": "Kriterio \"%s\" de la progresero \"%s\" ne doneblis al %s ĉar tiu jam havas ĝin", "commands.advancement.grant.criterion.to.one.success": "Donis kriterion \"%s\" de la progresso \"%s\" al %s", "commands.advancement.grant.many.to.many.failure": "Ne povis doni %s progreserojn al %s ludantoj ĉar tiuj jam havas ilin", "commands.advancement.grant.many.to.many.success": "Donis %s progreserojn al %s ludantoj", "commands.advancement.grant.many.to.one.failure": "%s progreseroj ne doneblis al %s ĉar tiu jam havas ilin", "commands.advancement.grant.many.to.one.success": "Donis %s progreserojn al %s", "commands.advancement.grant.one.to.many.failure": "Progresero \"%s\" ne doneblis al %s lundantoj ĉar ili jam havas ĝin", "commands.advancement.grant.one.to.many.success": "Donis la progreseron \"%s\" al %s ludantoj", "commands.advancement.grant.one.to.one.failure": "Progresero \"%s\" ne doneblis al %s, ĉar tiu jam havas ĝin", "commands.advancement.grant.one.to.one.success": "Donis la progreseron \"%s\" al %s", "commands.advancement.revoke.criterion.to.many.failure": "Kriterio \"%s\" de la progresero \"%s\" ne forigeblis de %s ludantoj ĉar ili ne havas ĝin", "commands.advancement.revoke.criterion.to.many.success": "Reprenis kriterion \"%s\" de la progresero \"%s\" el %s ludantoj", "commands.advancement.revoke.criterion.to.one.failure": "Kriterio \"%s\" de la progresero \"%s\" ne forigeblis de %s ĉar tiu ne havas ĝin", "commands.advancement.revoke.criterion.to.one.success": "Reprenis kriterion \"%s\" de la progresero \"%s\" el %s", "commands.advancement.revoke.many.to.many.failure": "%s progreseroj ne forigeblis de %s ludantoj ĉar tiuj ne havas ilin", "commands.advancement.revoke.many.to.many.success": "Reprenis %s progreserojn el %s ludantoj", "commands.advancement.revoke.many.to.one.failure": "%s progreseroj ne forigeblis de %s ĉar tiu ne havas ilin", "commands.advancement.revoke.many.to.one.success": "Reprenis %s progreserojn el %s", "commands.advancement.revoke.one.to.many.failure": "Progresero \"%s\" ne forigeblis de %s ludantoj ĉar ili ne havas ĝin", "commands.advancement.revoke.one.to.many.success": "Reprenis la progreseron \"%s\" el %s ludantoj", "commands.advancement.revoke.one.to.one.failure": "Rrogresero \"%s\" ne forigeblis de %s ĉar tiu ne havas ĝin", "commands.advancement.revoke.one.to.one.success": "Reprenis la progreseron \"%s\" el %s", "commands.attribute.base_value.get.success": "Bazvaloro de atributo %s de ento %s estas %s", "commands.attribute.base_value.set.success": "Bazvaloro de atributo %s de ento %s estas ŝanĝita al %s", "commands.attribute.failed.entity": "%s ne estas valida ento por tiu komando", "commands.attribute.failed.modifier_already_present": "Modifilo %s jam ekzistas por atributo %s de ento %s", "commands.attribute.failed.no_attribute": "Ento %s ne havas atributon %s", "commands.attribute.failed.no_modifier": "Atributo %s de ento %s ne havas modifilon %s", "commands.attribute.modifier.add.success": "Aldonis modifilon %s al atributo %s de ento %s", "commands.attribute.modifier.remove.success": "Modifilo %s estas forigita el la atributo %s de ento %s", "commands.attribute.modifier.value.get.success": "Valoro de modifilo %s por atributo %s de ento %s estas %s", "commands.attribute.value.get.success": "Valoro de atributo %s de ento %s estas %s", "commands.ban.failed": "Nenio ŝanĝiĝis. La ludanto jam estas forbarita", "commands.ban.success": "Forbaris %s: %s", "commands.banip.failed": "Nenio ŝanĝiĝis. Tiu IP-adreso jam estas forbarita", "commands.banip.info": "Tiu forbaro efikas %s ludantojn: %s", "commands.banip.invalid": "Nevalida IP-adreso aŭ nekonata ludanto", "commands.banip.success": "Forbaris IP %s: %s", "commands.banlist.entry": "%s estas forbarita de %s: %s", "commands.banlist.list": "Estas %s forbaritojn:", "commands.banlist.none": "Ne estas forbaritojn", "commands.bossbar.create.failed": "Estrobreto kun la \"%s\" indentigaĵon jam ekzistas", "commands.bossbar.create.success": "Agordita estrobreto %s estas kreita", "commands.bossbar.get.max": "Agordita estrobreto %s havas maksimumon de %s", "commands.bossbar.get.players.none": "Agordita estrobreto %s ne havas ludantojn momente enretajn", "commands.bossbar.get.players.some": "Agordita estrobreto %s havas %s ludantojn momente enretajn: %s", "commands.bossbar.get.value": "Agordita estrobreto %s havas valoron de %s", "commands.bossbar.get.visible.hidden": "Agordita estrobreto %s estas momente kaŝita", "commands.bossbar.get.visible.visible": "Agordita estrobreto %s estas momente videbla", "commands.bossbar.list.bars.none": "Ne estas aktivaj agorditaj estrobretoj", "commands.bossbar.list.bars.some": "Estas %s aktivaj agorditaj estrobretoj: %s", "commands.bossbar.remove.success": "Agordita estrobreto %s estas forigita", "commands.bossbar.set.color.success": "La koloro de la agordita estrobreto %s estas ŝanĝita", "commands.bossbar.set.color.unchanged": "Nenio ŝanĝiĝis. Tio jam estas la estrobreta koloro", "commands.bossbar.set.max.success": "La maksimumo de la agordita estrobreto %s estas ŝanĝita al %s", "commands.bossbar.set.max.unchanged": "Nenio ŝanĝiĝis. Tio jam estas la estrobreta maksimumo", "commands.bossbar.set.name.success": "Agordita estrobreto %s estis renomita", "commands.bossbar.set.name.unchanged": "Nenio ŝanĝiĝis. Tio jam estas la estrobreta nomo", "commands.bossbar.set.players.success.none": "Agordita estrobreto %s ne plu havas ajnajn ludantojn", "commands.bossbar.set.players.success.some": "Agordita estrobreto %s nun havas %s ludantojn: %s", "commands.bossbar.set.players.unchanged": "Nenio ŝanĝiĝis. Tiuj ludantoj jam estas en la estrobreto kaj neniu aldoneblas aŭ forigeblas", "commands.bossbar.set.style.success": "La stilo de la agordita estrobreto %s estas ŝanĝita", "commands.bossbar.set.style.unchanged": "Nenio ŝanĝiĝis. Tio jam estas la estrobreta stilo", "commands.bossbar.set.value.success": "La valoro de la agordita estrobreto %s estas ŝanĝita al %s", "commands.bossbar.set.value.unchanged": "Nenio ŝanĝiĝis. Tio jam estas la estrobreta valoro", "commands.bossbar.set.visibility.unchanged.hidden": "Nenio ŝanĝiĝis. La estrobreto jam estas kaŝita", "commands.bossbar.set.visibility.unchanged.visible": "Nenio ŝanĝiĝis. La estrobreto jam estas videbla", "commands.bossbar.set.visible.success.hidden": "Agordita estrobreto %s estas nun kaŝita", "commands.bossbar.set.visible.success.visible": "Agordita estrobreto %s estas nun videbla", "commands.bossbar.unknown": "Estrobreto kun la \"%s\" indentigaĵon ne ekzistas", "commands.clear.success.multiple": "Forigis %s aĵojn de %s ludantoj", "commands.clear.success.single": "%s aĵoj estas forigitaj de la ludanto %s", "commands.clear.test.multiple": "Trovis %s kongruajn objektojn ĉe %s ludantoj", "commands.clear.test.single": "Trovis %s kongruajn objektojn ĉe ludanto %s", "commands.clone.failed": "Neniuj blokoj estas multobligitaj", "commands.clone.overlap": "La fonta kaj cela regiono ne povas surmetiĝi", "commands.clone.success": "%s blokoj sukcese multobliĝis", "commands.clone.toobig": "Tro da blokoj en la specifita areo (maksimume %s, specifitaj %s)", "commands.data.block.get": "%s de bloko %s, %s, %s post skalfaktoro de %s estas %s", "commands.data.block.invalid": "La cela bloko ne estas blokento", "commands.data.block.modified": "Modifis blokdatumojn de %s, %s, %s", "commands.data.block.query": "%s, %s, %s, havas la sekvantajn blokdatumojn: %s", "commands.data.entity.get": "%s de %s post skalfaktoro de %s estas %s", "commands.data.entity.invalid": "Ludanto-datumoj ne redakteblas", "commands.data.entity.modified": "Modifis entdatumojn de %s", "commands.data.entity.query": "%s havas la sekvantajn entdatumojn: %s", "commands.data.get.invalid": "%s ne akireblas; nur nombraj priskribiloj estas permesitaj", "commands.data.get.multiple": "Ĉi tiu argumento akceptas unuopa NBT-valoro", "commands.data.get.unknown": "%s ne akireblas; priskribilo ne ekzistas", "commands.data.merge.failed": "Nenio ŝanĝiĝis. La specifitaj ecoj jam havas ĉi tiujn valorojn", "commands.data.modify.expected_list": "Listo atendita, ricevis: %s", "commands.data.modify.expected_object": "Objekto atendita, ricevis: %s", "commands.data.modify.invalid_index": "Nevalida lista indekso: %s", "commands.data.storage.get": "%s en konservejo %s post skalfaktoro de %s estas %s", "commands.data.storage.modified": "Modifis konservejon %s", "commands.data.storage.query": "Konservejo %s havas jenajn enhavojn: %s", "commands.datapack.disable.failed": "Datumpakaĵo \"%s\" ne estas ebligita!", "commands.datapack.enable.failed": "Datumpakaĵo \"%s\" jam estas ebligita!", "commands.datapack.list.available.none": "Neniuj aliaj datumpakaĵoj disponeblas", "commands.datapack.list.available.success": "%s datumpakaĵoj disponeblas: %s", "commands.datapack.list.enabled.none": "Neniuj datumpakaĵoj estas ebligitaj", "commands.datapack.list.enabled.success": "%s datumpakaĵoj estas ebligitaj: %s", "commands.datapack.modify.disable": "Malŝaltado de datumpakaĵo \"%s\"", "commands.datapack.modify.enable": "Ŝaltado de datumpakaĵo \"%s\"", "commands.datapack.unknown": "Nekonata datumpakaĵo \"%s\"", "commands.debug.alreadyRunning": "La takta profililo jam komencis", "commands.debug.function.noRecursion": "Ne eblas spuri el la funkcio", "commands.debug.function.success.multiple": "%s komandoj estas spuritaj el %s funkcioj en la eligan dosieron %s", "commands.debug.function.success.single": "%s komandoj estas spuritaj el la funkcio \"%s\" en la eligan dosieron %s", "commands.debug.function.traceFailed": "La funkcio ne spureblis", "commands.debug.notRunning": "La takta profililo ne komencis", "commands.debug.started": "Takta profilado komenciĝis", "commands.debug.stopped": "Takta profilado ĉesis post %s sekundoj kaj %s taktoj (%s taktoj sekunde)", "commands.defaultgamemode.success": "La defaŭlta ludreĝimo nun estas %s", "commands.deop.failed": "Nenio ŝanĝiĝis. La ludanto ne estas operacianto", "commands.deop.success": "Igis %s ne plu serviloperacianto", "commands.difficulty.failure": "La facilnivelo ne ŝanĝiĝis, ĝi jam estas ŝanĝita al %s", "commands.difficulty.query": "La facilnivelo estas %s", "commands.difficulty.success": "La facileco estas ŝanĝita al %s", "commands.drop.no_held_items": "Ento ne povas teni iujn ajn objektojn", "commands.drop.no_loot_table": "Ento %s ne havas predan tablon", "commands.drop.success.multiple": "Ŝutis %s objektoj", "commands.drop.success.multiple_with_table": "Ŝutis %s objektoj de preda tablo: %s", "commands.drop.success.single": "Ŝutis %s %s", "commands.drop.success.single_with_table": "Ŝutis %s %s de preda tablo: %s", "commands.effect.clear.everything.failed": "Celo havas ne efikojn por forigi", "commands.effect.clear.everything.success.multiple": "Ĉiu efiko estas forigita de %s celoj", "commands.effect.clear.everything.success.single": "Ĉiu efiko estas forigita de %s", "commands.effect.clear.specific.failed": "Celo ne havas la petitan efikon", "commands.effect.clear.specific.success.multiple": "Efiko \"%s\" estas forigita de %s celoj", "commands.effect.clear.specific.success.single": "Efiko \"%s\" estas forigita de %s", "commands.effect.give.failed": "Tiu efiko ne aplikeblas (celo estas aŭ imuna de efikoj, aŭ havas ion pli fortan)", "commands.effect.give.success.multiple": "Aplikis efikon \"%s\" al %s celoj", "commands.effect.give.success.single": "Aplikis efikon \"%s\" al %s", "commands.enchant.failed": "Nenio ŝanĝiĝis. Aŭ la celoj ne havas objekton en siaj manoj aŭ la sorĉo ne aplikeblis", "commands.enchant.failed.entity": "%s ne estas valida ento por tiu komando", "commands.enchant.failed.incompatible": "%s ne povas subteni tiun sorĉon", "commands.enchant.failed.itemless": "%s ne tenas ajnan objekton", "commands.enchant.failed.level": "%s estas pli granda ol la maksimuma nivelo de %s, subtenite de tiu sorĉo", "commands.enchant.success.multiple": "Aplikis sorĉon \"%s\" al %s entoj", "commands.enchant.success.single": "Aplikis sorĉon \"%s\" al la objekto de %s", "commands.execute.blocks.toobig": "Tro da blokoj en la specifita areo (maksimume %s, specifitaj %s)", "commands.execute.conditional.fail": "Testo malsukcesis", "commands.execute.conditional.fail_count": "Testo malsukcesis, nombro: %s", "commands.execute.conditional.pass": "Testo sukcesis", "commands.execute.conditional.pass_count": "Testo sukcesis, nombro: %s", "commands.experience.add.levels.success.multiple": "Donis %s spertajn nivelojn al %s ludantoj", "commands.experience.add.levels.success.single": "Donis %s spertajn nivelojn al %s", "commands.experience.add.points.success.multiple": "Donis %s spertajn punktojn al %s ludantoj", "commands.experience.add.points.success.single": "Donis %s spertajn punktojn al %s", "commands.experience.query.levels": "%s havas %s spertajn nivelojn", "commands.experience.query.points": "%s havas %s spertajn punktojn", "commands.experience.set.levels.success.multiple": "%[2]s ludantoj nun havas po %[1]s spertaj niveloj", "commands.experience.set.levels.success.single": "%[2]s nun havas %[1]s spertajn nivelojn", "commands.experience.set.points.invalid": "Spertaj punktoj ne agordeblas al valoro, superanta la maksimuman punktaron por la nuna nivelo de la ludanto", "commands.experience.set.points.success.multiple": "%[2]s ludantoj nun havas po %[1]s spertaj punktoj", "commands.experience.set.points.success.single": "%[2]s nun havas %[1]s spertajn punktojn", "commands.fill.failed": "Neniuj blokoj estas plenigitaj", "commands.fill.success": "%s blokoj sukcese pleniĝis", "commands.fill.toobig": "Tro da blokoj en la specifita areo (maksimume %s, specifitaj %s)", "commands.forceload.added.failure": "Neniuj pecaroj estis markitaj ŝargendaj", "commands.forceload.added.multiple": "Stampis %s pecarojn en %s de %s al %s por esti ŝargitaj devige", "commands.forceload.added.none": "Neniuj ŝargendaj pecaroj estas trovitaj en %s", "commands.forceload.added.single": "Stampis pecaron %s en %s por esti ŝargita devige", "commands.forceload.list.multiple": "%s devige ŝargitaj pecaroj estas trovitaj en %s ĉe: %s", "commands.forceload.list.single": "Pecaro devige ŝargita estas trovita en %s ĉe: %s", "commands.forceload.query.failure": "Pecaro ĉe %s en %s ne estas stampita por deviga ŝargado", "commands.forceload.query.success": "Pecaro ĉe %s en %s estas stampita por deviga ŝargado", "commands.forceload.removed.all": "Malstampis ĉiujn devige ŝargitajn pecarojn en %s", "commands.forceload.removed.failure": "Neniuj pecaroj estis reigitaj ne ŝargendaj", "commands.forceload.removed.multiple": "Malstampis %s pecarojn en %s de %s al %s por deviga ŝargado", "commands.forceload.removed.single": "Malstampis pecaron %s en %s por deviga ŝargado", "commands.forceload.toobig": "Tro da pecaroj en la specifita areo (maksimume %s, specifitaj %s)", "commands.function.success.multiple": "Plenumis %s komandojn de %s funkcioj", "commands.function.success.single": "Plenumis %s komandojn de la funkcio '%s'", "commands.gamemode.success.other": "La ludreĝimo de %s estas ŝanĝita al %s", "commands.gamemode.success.self": "La ludreĝimo estas ŝanĝita al %s", "commands.gamerule.query": "Ludregulo \"%s\" estas nuntempe agordita al: %s", "commands.gamerule.set": "Valoro de la ludregulo \"%s\" estas ŝanĝita al: %s", "commands.give.failed.toomanyitems": "%[2]s ne doneblas je plia kvanto ol %[1]s", "commands.give.success.multiple": "Donis %s %s al %s ludantoj", "commands.give.success.single": "Donis %s %s al %s", "commands.help.failed": "Nekonata komando aŭ nesufiĉaj permesoj", "commands.item.block.set.success": "Anstataŭigis ujon en %s, %s, %s kun %s", "commands.item.entity.set.success.multiple": "Anstataŭigis ujon en %s entoj kun %s", "commands.item.entity.set.success.single": "Anstataŭigis ujon en \"%s\" kun %s", "commands.item.source.no_such_slot": "La fonto ne havas ujon \"%s\"", "commands.item.source.not_a_container": "Fontpozicio %s, %s, %s ne estas entenilo", "commands.item.target.no_changed.known_item": "Neniuj celoj akceptis objekton %s en la ujon %s", "commands.item.target.no_changes": "Neniuj celoj akceptis objekton en la ujon %s", "commands.item.target.no_such_slot": "La celo ne havas ujon \"%s\"", "commands.item.target.not_a_container": "Celpozicio %s, %s, %s ne estas entenilo", "commands.kick.success": "Forpelis %s: %s", "commands.kill.success.multiple": "%s entoj mortiĝis", "commands.kill.success.single": "%s mortiĝis", "commands.list.nameAndId": "%s (%s)", "commands.list.players": "Jen %s el maksimumo de %s ludantoj enrete: %s", "commands.locate.failed": "Tiaj strukturoj ne troveblis proksime", "commands.locate.success": "La plej proksima %s estas ĉe %s (%s blokojn for)", "commands.locatebiome.invalid": "Neniu biomo havas tipon \"%s\"", "commands.locatebiome.notFound": "Biomo de tipo \"%s\" ne troveblas en akceptebla distanco", "commands.locatebiome.success": "La plej proksima %s estas ĉe %s (%s blokoj for)", "commands.message.display.incoming": "%s flustras al vi: %s", "commands.message.display.outgoing": "Vi flustras al %s: %s", "commands.op.failed": "Nenio ŝanĝiĝis. La ludanto jam estas operacianto", "commands.op.success": "Igis %s serviloperacianto", "commands.pardon.failed": "Nenio ŝanĝiĝis. La ludanto ne estas forbarita", "commands.pardon.success": "Malforbaris %s", "commands.pardonip.failed": "Nenio ŝanĝiĝis. Tiu IP-adreso ne estas forbarita", "commands.pardonip.invalid": "Nevalida IP-adreso", "commands.pardonip.success": "Malforbaris IP %s", "commands.particle.failed": "La partiklo ne estis videbla por iu ajn", "commands.particle.success": "Montras partiklon %s", "commands.perf.alreadyRunning": "La rendimenta profililo jam komencis", "commands.perf.notRunning": "La rendimenta profililo ne komencis", "commands.perf.reportFailed": "Sencimiga raporto ne kreeblis", "commands.perf.reportSaved": "Sencimiga raporto estas kreita en %s", "commands.perf.started": "10-sekunda rendimenta profilado komenciĝis (uzu \"/perf stop\" por ĉesigi ĝin pli frue)", "commands.perf.stopped": "Rendimenta profilado ĉesis post %s sekundoj kaj %s taktoj (%s taktoj sekunde)", "commands.playsound.failed": "La sono estas tro malproksime por aŭdi", "commands.playsound.success.multiple": "Ludis sonon %s al %s ludantoj", "commands.playsound.success.single": "Ludis sonon %s al %s", "commands.publish.alreadyPublished": "Multludanta ludo jam estas gastigata ĉe pordo %s", "commands.publish.failed": "Loka ludo ne gastigeblas", "commands.publish.started": "Loka ludo estas gastigata ĉe pordo %s", "commands.publish.success": "Multludanta ludo nun estas gastigata ĉe pordo %s", "commands.recipe.give.failed": "Neniuj novaj receptoj estas lernitaj", "commands.recipe.give.success.multiple": "Malŝlosis %s receptojn por %s ludantoj", "commands.recipe.give.success.single": "Malŝlosis %s receptojn por %s", "commands.recipe.take.failed": "Neniuj receptoj forgeseblis", "commands.recipe.take.success.multiple": "Prenis %s receptojn el %s ludantoj", "commands.recipe.take.success.single": "Prenis %s receptojn el %s", "commands.reload.failure": "Reŝargado malsukcesis, gardado de lastaj datumoj", "commands.reload.success": "Reŝargado!", "commands.save.alreadyOff": "Konservado jam estas malaktiva", "commands.save.alreadyOn": "Konservado jam estas aktiva", "commands.save.disabled": "Aŭtomata konservado nun estas malaktivigita", "commands.save.enabled": "Aŭtomata konservado nun estas aktivigita", "commands.save.failed": "La ludo ne konserveblas (ĉu la disko havas sufiĉan spacon?)", "commands.save.saving": "Konservado de la ludo (tio povas preni momenton!)", "commands.save.success": "La ludo konserviĝis", "commands.schedule.cleared.failure": "Neniuj horaroj kun ID: %s", "commands.schedule.cleared.success": "%s horaroj kun ID %s estas forigitaj", "commands.schedule.created.function": "Planis funkcion \"%s\" en %s tikoj ĉe ludtempo %s", "commands.schedule.created.tag": "Planis priskribilon \"%s\" en %s tikoj ĉe ludtempo %s", "commands.schedule.same_tick": "Ne eblas plani por ĉi-takto", "commands.scoreboard.objectives.add.duplicate": "Celo jam ekzistas kun tiu nomo", "commands.scoreboard.objectives.add.longName": "Nomoj de celoj ne povas esti pli longaj ol %s signoj", "commands.scoreboard.objectives.add.success": "Nova celo %s estas kreita", "commands.scoreboard.objectives.display.alreadyEmpty": "Nenio ŝanĝiĝis. La bildigujo jam estas malplena", "commands.scoreboard.objectives.display.alreadySet": "Nenio ŝanĝiĝis. La bildigujo jam montras la celon", "commands.scoreboard.objectives.display.cleared": "Ĉiuj celoj en bildigujo \"%s\" estas viŝitaj", "commands.scoreboard.objectives.display.set": "Bildigujo \"%s\" alĝustiĝis por montri la celon \"%s\"", "commands.scoreboard.objectives.list.empty": "Ne estas celoj", "commands.scoreboard.objectives.list.success": "Estas %s celojn: %s", "commands.scoreboard.objectives.modify.displayname": "La montrata nomo estas ŝanĝita de %s al %s", "commands.scoreboard.objectives.modify.rendertype": "Bildigtipo de celo %s estas ŝanĝita", "commands.scoreboard.objectives.remove.success": "Celo %s estas forigita", "commands.scoreboard.players.add.success.multiple": "Aldonis %s al %s por %s entoj", "commands.scoreboard.players.add.success.single": "Aldonis %s al %s por %s (nun %s)", "commands.scoreboard.players.enable.failed": "Nenio ŝanĝiĝis. La ekagilo jam estas ebligita", "commands.scoreboard.players.enable.invalid": "Oni povas ebligi nur ekagilcelojn", "commands.scoreboard.players.enable.success.multiple": "Ebligis ekagilon %s por %s entoj", "commands.scoreboard.players.enable.success.single": "Ebligis ekagilon %s por %s", "commands.scoreboard.players.get.null": "Valoro de %s por %s ne akireblas; nenio estas elektita", "commands.scoreboard.players.get.success": "%s havas %s %s", "commands.scoreboard.players.list.empty": "Estas neniaj sekvataj entoj", "commands.scoreboard.players.list.entity.empty": "%s ne havas poentarojn por montri", "commands.scoreboard.players.list.entity.entry": "%s: %s", "commands.scoreboard.players.list.entity.success": "%s havas %s poentarojn:", "commands.scoreboard.players.list.success": "Estas %s sekvataj entoj: %s", "commands.scoreboard.players.operation.success.multiple": "Aktualigis %s por %s entoj", "commands.scoreboard.players.operation.success.single": "%s de %s estas ŝanĝita al %s", "commands.scoreboard.players.remove.success.multiple": "%s estas forigita de %s por %s entoj", "commands.scoreboard.players.remove.success.single": "%s estas forigita de %s por %s (nun %s)", "commands.scoreboard.players.reset.all.multiple": "Ĉiuj poentaroj de %s entoj estas nuligitaj", "commands.scoreboard.players.reset.all.single": "Ĉiuj poentaroj de %s estas nuligitaj", "commands.scoreboard.players.reset.specific.multiple": "%s de %s entoj estas nuligita", "commands.scoreboard.players.reset.specific.single": "%s de %s estas nuligita", "commands.scoreboard.players.set.success.multiple": "%s de %s entoj estas ŝanĝita al %s", "commands.scoreboard.players.set.success.single": "%s de %s estas ŝanĝita al %s", "commands.seed.success": "Semaĵo: %s", "commands.setblock.failed": "La bloko ne meteblis", "commands.setblock.success": "La bloko ĉe %s, %s, %s estas ŝanĝita", "commands.setidletimeout.success": "La limo de senagtempo de ludanto estas nun %s minutoj", "commands.setworldspawn.success": "La monda aperejo estas ŝanĝita al %s, %s, %s [%s]", "commands.spawnpoint.success.multiple": "Reaperejo de %s ludantoj en %s estas ŝanĝita al %s, %s, %s [%s]", "commands.spawnpoint.success.single": "Reaperejo de %s en %s estas ŝanĝita al %s, %s, %s [%s]", "commands.spectate.not_spectator": "%s ne estas en spektanta reĝimo", "commands.spectate.self": "Ne eblas spekti sin mem", "commands.spectate.success.started": "Nun spektas: %s", "commands.spectate.success.stopped": "Jam ne spektas enton", "commands.spreadplayers.failed.entities": "%s entoj ne disvastigeblas ĉirkaŭ %s, %s (tro multe da entoj por la spaco - provu uzi disvastigecon de maksimume %s)", "commands.spreadplayers.failed.teams": "%s teamoj ne disĵeteblas ĉirkaŭ %s, %s (estas tro multe da entoj por la spaco - provu uzi disĵeton de maksimume %s)", "commands.spreadplayers.success.entities": "Disvastigis %s ludantojn ĉirkaŭ %s, %s kun averaĝa distanco de %s blokoj aparte", "commands.spreadplayers.success.teams": "%s teamoj estas disĵetitaj ĉirkaŭ %s, %s kun averaĝa distanco de %s blokoj unu de la alia", "commands.stop.stopping": "Haltigado de servilo", "commands.stopsound.success.source.any": "Ĉiuj sonoj \"%s\" ĉesis", "commands.stopsound.success.source.sound": "Sono \"%s\" de fonto \"%s\" ĉesis", "commands.stopsound.success.sourceless.any": "Ĉiuj sonoj ĉesis", "commands.stopsound.success.sourceless.sound": "Sono \"%s\" ĉesis", "commands.summon.failed": "Ento ne alvokeblas", "commands.summon.failed.uuid": "Ento ne alvokeblas pro identaj UUID-j", "commands.summon.invalidPosition": "Nevalida pozicio por alvoki", "commands.summon.success": "Alvokis novan %sn", "commands.tag.add.failed": "Celo aŭ jam havas la priskribilon aŭ havas tro da priskribiloj", "commands.tag.add.success.multiple": "Aldonis priskribilon \"%s\" al %s entoj", "commands.tag.add.success.single": "Aldonis priskribilon \"%s\" al %s", "commands.tag.list.multiple.empty": "Ne estas priskribiloj je la %s entoj", "commands.tag.list.multiple.success": "La %s entoj totale havas %s priskribilojn: %s", "commands.tag.list.single.empty": "%s ne havas priskribilojn", "commands.tag.list.single.success": "%s havas %s priskribilojn: %s", "commands.tag.remove.failed": "Celo ne havas tian priskribilon", "commands.tag.remove.success.multiple": "Priskribilo \"%s\" estas forigita de %s entoj", "commands.tag.remove.success.single": "Priskribilo \"%s\" estas forigita de %s", "commands.team.add.duplicate": "Teamo jam ekzistas kun tiu nomo", "commands.team.add.longName": "Teamonomoj ne povas esti pli longaj ol %s signoj", "commands.team.add.success": "Teamo %s estas kreita", "commands.team.empty.success": "%s membroj estas forigitaj el la teamo %s", "commands.team.empty.unchanged": "Nenio ŝanĝiĝis. La teamo jam estas malplena", "commands.team.join.success.multiple": "%s membroj aniĝis en la teamo %s", "commands.team.join.success.single": "%s aniĝis en la teamo %s", "commands.team.leave.success.multiple": "%s membroj estas forigitaj el siaj teamoj", "commands.team.leave.success.single": "%s estas forigita el sia teamo", "commands.team.list.members.empty": "La teamo %s ne havas membrojn", "commands.team.list.members.success": "La teamo %s havas %s membrojn: %s", "commands.team.list.teams.empty": "Ne estas teamoj", "commands.team.list.teams.success": "Estas %s teamoj: %s", "commands.team.option.collisionRule.success": "Koliziregulo por la teamo %s nun estas \"%s\"", "commands.team.option.collisionRule.unchanged": "Nenio ŝanĝiĝis. Koliziregulo jam havas tian valoron", "commands.team.option.color.success": "La koloro de la teamo %s estas ŝanĝita al %s", "commands.team.option.color.unchanged": "Nenio ŝanĝiĝis. La teamo jam havas la koloron", "commands.team.option.deathMessageVisibility.success": "Videblo de mesaĝoj pri morto de anoj de la teamo %s nun estas \"%s\"", "commands.team.option.deathMessageVisibility.unchanged": "Nenio ŝanĝiĝis. Mortomesaĝa videbleco jam havas tian valoron", "commands.team.option.friendlyfire.alreadyDisabled": "Nenio ŝanĝiĝis. Damaĝo de amikoj jam estas malebligita por la teamo", "commands.team.option.friendlyfire.alreadyEnabled": "Nenio ŝanĝiĝis. Damaĝo de amikoj jam estas ebligita por la teamo", "commands.team.option.friendlyfire.disabled": "Damaĝo de amikoj estas malebligita por la teamo %s", "commands.team.option.friendlyfire.enabled": "Damaĝo de amikoj estas ebligita por la teamo %s", "commands.team.option.name.success": "La nomo de la teamo %s estas ŝanĝita", "commands.team.option.name.unchanged": "Nenio ŝanĝiĝis. La teamo jam havas la nomon", "commands.team.option.nametagVisibility.success": "Nometikeda videblo por la teamo %s nun estas \"%s\"", "commands.team.option.nametagVisibility.unchanged": "Nenio ŝanĝiĝis. Nometikeda videbleco jam havas tian valoron", "commands.team.option.prefix.success": "Prefikso de la teamo estas ŝanĝita al %s", "commands.team.option.seeFriendlyInvisibles.alreadyDisabled": "Nenio ŝanĝiĝis. La teamo jam ne povas vidi nevideblajn samteamanojn", "commands.team.option.seeFriendlyInvisibles.alreadyEnabled": "Nenio ŝanĝiĝis. La teamo jam povas vidi nevideblajn samteamanojn", "commands.team.option.seeFriendlyInvisibles.disabled": "La teamo %s ne plu povas vidi nevideblajn samteamanojn", "commands.team.option.seeFriendlyInvisibles.enabled": "La teamo %s nun povas vidi nevideblajn samteamanojn", "commands.team.option.suffix.success": "Sufikso de la teamo estas ŝanĝita al %s", "commands.team.remove.success": "Teamo %s estas forigita", "commands.teammsg.failed.noteam": "Vi devas esti en teamo por mesaĝi vian teamon", "commands.teleport.invalidPosition": "Nevalida pozicio por teleporto", "commands.teleport.success.entity.multiple": "Teleportis %s entojn al %s", "commands.teleport.success.entity.single": "Teleportis %s al %s", "commands.teleport.success.location.multiple": "Teleportis %s entojn al %s, %s, %s", "commands.teleport.success.location.single": "Teleportis %s al %s, %s, %s", "commands.time.query": "La tempo estas %s", "commands.time.set": "La tempo estas alĝustigita al %s", "commands.title.cleared.multiple": "Titoloj estas viŝitaj por %s lundantoj", "commands.title.cleared.single": "Titoloj por %s estas viŝitaj", "commands.title.reset.multiple": "Titolagordoj de %s ludantoj estas nuligitaj", "commands.title.reset.single": "Titolagordoj de %s estas nuligitaj", "commands.title.show.actionbar.multiple": "Montras novan agbretan titolon por %s ludantojn", "commands.title.show.actionbar.single": "Montras novan agbretan titolon por %s", "commands.title.show.subtitle.multiple": "Montras novan subtekston por %s ludantoj", "commands.title.show.subtitle.single": "Montras novan subtekston por %s", "commands.title.show.title.multiple": "Montras novan titolon por %s ludantoj", "commands.title.show.title.single": "Montras novan titolon por %s", "commands.title.times.multiple": "Daŭro de titola bildigo estas ŝanĝita por %s ludantoj", "commands.title.times.single": "Daŭro de titola bildigo por %s estas ŝanĝita", "commands.trigger.add.success": "Ekagigis %s (aldonis %s al valoro)", "commands.trigger.failed.invalid": "Vi nur povas ekagigi celojn, kiuj estas \"ekagila\" tipoj", "commands.trigger.failed.unprimed": "Vi ne povas ankoraŭ ekagigi ĉi tiun celon", "commands.trigger.set.success": "%s estas ekagigita (la valoro ŝanĝiĝis al %s)", "commands.trigger.simple.success": "Ekagigis %s", "commands.weather.set.clear": "La vetero estas ŝanĝita al serena", "commands.weather.set.rain": "La vetero estas ŝanĝita al pluvo", "commands.weather.set.thunder": "La vetero estas ŝanĝita al fulmotondro", "commands.whitelist.add.failed": "Ludanto jam estas aproblistiĝita", "commands.whitelist.add.success": "%s estas aldonita al la aproblisto", "commands.whitelist.alreadyOff": "Aproblisto jam estas malaktivigita", "commands.whitelist.alreadyOn": "Aproblisto jam estas aktivigita", "commands.whitelist.disabled": "Aproblisto nun estas malaktivigita", "commands.whitelist.enabled": "Aproblisto nun estas aktivigita", "commands.whitelist.list": "Estas %s aprobitaj ludantoj: %s", "commands.whitelist.none": "Ne estas aprobitaj ludantoj", "commands.whitelist.reloaded": "Aproblisto reŝargita", "commands.whitelist.remove.failed": "Ludanto ne estas aproblistiĝita", "commands.whitelist.remove.success": "%s estas forigita de la aproblisto", "commands.worldborder.center.failed": "Nenio ŝanĝiĝis. La mondlima centro jam estas tie", "commands.worldborder.center.success": "La mondlima centro estas alĝustigita al %s, %s", "commands.worldborder.damage.amount.failed": "Nenio ŝanĝiĝis. La mondlima damaĝo jam havas tiun valoron", "commands.worldborder.damage.amount.success": "La mondlima damaĝo estas ŝanĝita al %s por unu bloko ĉiun sekundon", "commands.worldborder.damage.buffer.failed": "Nenio ŝanĝiĝis. La mondlima damaĝbufro jam havas tiun distancon", "commands.worldborder.damage.buffer.success": "La mondlima damaĝbufro estas ŝanĝita al %s blokoj", "commands.worldborder.get": "Mondlimo nuntempe estas %s blokoj larĝa", "commands.worldborder.set.failed.big": "La mondlimo ne povas esti pli larĝa ol %s blokoj", "commands.worldborder.set.failed.nochange": "Nenio ŝanĝiĝis. La mondlimo jam estas tiom granda", "commands.worldborder.set.failed.small": "Mondlimo ne povas esti malpli larĝa ol 1 bloko", "commands.worldborder.set.grow": "La mondlimo larĝiĝos ĝis %s blokoj dum %s sekundoj", "commands.worldborder.set.immediate": "La mondlima larĝo estas ŝanĝita al %s blokoj", "commands.worldborder.set.shrink": "La mondlimo mallarĝiĝos ĝis %s blokoj dum %s sekundoj", "commands.worldborder.warning.distance.failed": "Nenio ŝanĝiĝis. La mondlima averto jam havas tiun distancon", "commands.worldborder.warning.distance.success": "La mondlima avertdistanco estas ŝanĝita al %s blokoj", "commands.worldborder.warning.time.failed": "Nenio ŝanĝiĝis. La mondlima averto jam estas tiom da tempo", "commands.worldborder.warning.time.success": "La mondlima averttempo estas ŝanĝita al %s sekundoj", "connect.aborted": "Abortita", "connect.authorizing": "Ensalutado...", "connect.connecting": "Konektado al la servilo...", "connect.encrypting": "Ĉifrado...", "connect.failed": "Servilo ne konektiĝeblas", "connect.joining": "Aliĝado al la mondo...", "connect.negotiating": "Negocado...", "container.barrel": "Barelo", "container.beacon": "Lumstriilo", "container.blast_furnace": "Altforno", "container.brewing": "Eliksirfarilo", "container.cartography_table": "Kartografitablo", "container.chest": "Kofro", "container.chestDouble": "Granda kofro", "container.crafting": "Konstruado", "container.creative": "Objektselektado", "container.dispenser": "Ĵetilo", "container.dropper": "Donilo", "container.enchant": "Sorĉado", "container.enchant.clue": "%s . . . ?", "container.enchant.lapis.many": "%s lazuritoj", "container.enchant.lapis.one": "1 lazurito", "container.enchant.level.many": "%s sorĉniveloj", "container.enchant.level.one": "1 sorĉnivelo", "container.enchant.level.requirement": "Nivelpostulo: %s", "container.enderchest": "Finejkofro", "container.furnace": "Forno", "container.grindstone_title": "Riparado kaj desorĉado", "container.hopper": "Funelo", "container.inventory": "Inventaro", "container.isLocked": "%s estas ŝlosita!", "container.lectern": "Libropupitro", "container.loom": "Teksilo", "container.repair": "Riparado kaj nomado", "container.repair.cost": "Kosto de sorĉado: %[1]s", "container.repair.expensive": "Tro multekosta!", "container.shulkerBox": "Skatolo de ŝulkro", "container.shulkerBox.more": "kaj %s pliaj...", "container.smoker": "Fumilo", "container.spectatorCantOpen": "Entenilo ne malfermeblas. Predo ankoraŭ ne generiĝis.", "container.stonecutter": "Ŝtontranĉilo", "container.upgrade": "Plibonigi ekipaĵon", "controls.reset": "Defaŭltigi", "controls.resetAll": "Defaŭltigi klavojn", "controls.title": "Regiloj", "createWorld.customize.buffet.biome": "Bonvolu elekti biomon", "createWorld.customize.buffet.title": "Agordo de bufeda mondo", "createWorld.customize.custom.baseSize": "Baza grandeco de profundo", "createWorld.customize.custom.biomeDepthOffset": "Deŝovo de biomprofundo", "createWorld.customize.custom.biomeDepthWeight": "Pezo de biomprofundo", "createWorld.customize.custom.biomeScaleOffset": "Deŝovo de biomskalo", "createWorld.customize.custom.biomeScaleWeight": "Pezo de biomskalo", "createWorld.customize.custom.biomeSize": "Dimensio de la biomo", "createWorld.customize.custom.center": "Centra alteco", "createWorld.customize.custom.confirm1": "Ĉi tio anstataŭigos viajn nuntempajn", "createWorld.customize.custom.confirm2": "agordojn, kaj ne eblos poste malfari.", "createWorld.customize.custom.confirmTitle": "Averto!", "createWorld.customize.custom.coordinateScale": "Skalo de koordinato", "createWorld.customize.custom.count": "Aperaĵaj provoj", "createWorld.customize.custom.defaults": "Defaŭltoj", "createWorld.customize.custom.depthNoiseScaleExponent": "Eksponento de profundbruo", "createWorld.customize.custom.depthNoiseScaleX": "Profundbrua skalo je X", "createWorld.customize.custom.depthNoiseScaleZ": "Profundbrua skalo je Z", "createWorld.customize.custom.dungeonChance": "Karcera nombro", "createWorld.customize.custom.fixedBiome": "Biomo", "createWorld.customize.custom.heightScale": "Alteca skalo", "createWorld.customize.custom.lavaLakeChance": "Malofteco de la lafolagoj", "createWorld.customize.custom.lowerLimitScale": "Skalo de malsupra limito", "createWorld.customize.custom.mainNoiseScaleX": "Ĉefa brua skalo je X", "createWorld.customize.custom.mainNoiseScaleY": "Ĉefa brua skalo je Y", "createWorld.customize.custom.mainNoiseScaleZ": "Ĉefa brua skalo je Z", "createWorld.customize.custom.maxHeight": "Maksimuma alteco", "createWorld.customize.custom.minHeight": "Minimuma alteco", "createWorld.customize.custom.next": "Sekvanta paĝo", "createWorld.customize.custom.page0": "Bazaj agordoj", "createWorld.customize.custom.page1": "Ercaj agordoj", "createWorld.customize.custom.page2": "Precizaj agordoj (Nur por lertuloj!)", "createWorld.customize.custom.page3": "Precizegaj agordoj (Nur por lertuloj!)", "createWorld.customize.custom.preset.caveChaos": "Kavernoj de ĥaoso", "createWorld.customize.custom.preset.caveDelight": "Plezuro de la kavernesploristo", "createWorld.customize.custom.preset.drought": "La trosekeco", "createWorld.customize.custom.preset.goodLuck": "Bonan ŝancon", "createWorld.customize.custom.preset.isleLand": "Insula tero", "createWorld.customize.custom.preset.mountains": "Monta frenezeco", "createWorld.customize.custom.preset.waterWorld": "Akva mondo", "createWorld.customize.custom.presets": "Ŝablonoj", "createWorld.customize.custom.presets.title": "Agordi mondajn ŝablonojn", "createWorld.customize.custom.prev": "Antaŭa paĝo", "createWorld.customize.custom.randomize": "Hazardigi", "createWorld.customize.custom.riverSize": "Dimensio de la rivero", "createWorld.customize.custom.seaLevel": "Marnivelo", "createWorld.customize.custom.size": "Aperaĵa grandeco", "createWorld.customize.custom.spread": "Diseca alteco", "createWorld.customize.custom.stretchY": "Alteca etendo", "createWorld.customize.custom.upperLimitScale": "Skalo de supra limito", "createWorld.customize.custom.useCaves": "Kavernoj", "createWorld.customize.custom.useDungeons": "Karceroj", "createWorld.customize.custom.useLavaLakes": "Lafolagoj", "createWorld.customize.custom.useLavaOceans": "Lafoceanoj", "createWorld.customize.custom.useMansions": "Arbaraj kortegoj", "createWorld.customize.custom.useMineShafts": "Mingalerioj", "createWorld.customize.custom.useMonuments": "Marmonumentoj", "createWorld.customize.custom.useOceanRuins": "Oceanaj ruinoj", "createWorld.customize.custom.useRavines": "Ravinoj", "createWorld.customize.custom.useStrongholds": "Fortikaĵoj", "createWorld.customize.custom.useTemples": "Temploj", "createWorld.customize.custom.useVillages": "Vilaĝoj", "createWorld.customize.custom.useWaterLakes": "Akvolagoj", "createWorld.customize.custom.waterLakeChance": "Malofteco de la akvolagoj", "createWorld.customize.flat.height": "Alteco", "createWorld.customize.flat.layer": "%s", "createWorld.customize.flat.layer.bottom": "Malsupro - %s", "createWorld.customize.flat.layer.top": "Supro - %s", "createWorld.customize.flat.removeLayer": "Forigi tavolon", "createWorld.customize.flat.tile": "Tavolmaterialo", "createWorld.customize.flat.title": "Agordo de platega mondo", "createWorld.customize.preset.bottomless_pit": "Senfunda kavo", "createWorld.customize.preset.classic_flat": "Klasika plata", "createWorld.customize.preset.desert": "Dezerto", "createWorld.customize.preset.overworld": "Supermondo", "createWorld.customize.preset.redstone_ready": "Ruĝonejo", "createWorld.customize.preset.snowy_kingdom": "Neĝlando", "createWorld.customize.preset.the_void": "La malplenaĵo", "createWorld.customize.preset.tunnelers_dream": "Revo de tunelistoj", "createWorld.customize.preset.water_world": "Akvomondo", "createWorld.customize.presets": "Ŝablonoj", "createWorld.customize.presets.list": "Alikaze, jen kelkaj kiujn ni faris antaŭe!", "createWorld.customize.presets.select": "Uzi ŝablonon", "createWorld.customize.presets.share": "Ĉu vi volas sendi vian ŝablonon al iu? Uzu la suban kampon!", "createWorld.customize.presets.title": "Elekti ŝablonon", "createWorld.preparing": "Preparado por mondo-kreado...", "dataPack.title": "Elekti datumpakaĵojn", "dataPack.validation.back": "Reiri", "dataPack.validation.failed": "Datumpakaĵoj ne validigeblis!", "dataPack.validation.reset": "Defaŭltigi", "dataPack.validation.working": "Validigado de elektitaj datumpakaĵoj...", "dataPack.vanilla.description": "La defaŭltaj datumoj por Minecraft", "datapackFailure.safeMode": "Sekura reĝimo", "datapackFailure.title": "Eraroj de nuntempe elektitaj datumpakoj preventis mondon ŝargi.\nVi povas aŭ provi ŝargi kun nur vanila datumpako (\"sekura reĝimo\") aŭ reiri al la ĉefmenuo kaj ripari ĝin permane.", "death.attack.anvil": "%[1]s estis premplatigita de falinta amboso", "death.attack.anvil.player": "%[1]s estis premplatigita de falinta amboso batalante kontraŭ %[2]s", "death.attack.arrow": "%[1]s estis pafmortigita de %[2]s", "death.attack.arrow.item": "%[1]s estis pafmortigita de %[2]s per %[3]s", "death.attack.badRespawnPoint.link": "intenca ludodesegno", "death.attack.badRespawnPoint.message": "%[1]s estis mortigita de %[2]s", "death.attack.cactus": "%[1]s estis pikita ĝis la morto de kakto", "death.attack.cactus.player": "%[1]s paŝis en kakton batalante kontraŭ %[2]s", "death.attack.cramming": "%[1]s estis dispremita tro multe", "death.attack.cramming.player": "%[1]s estis dispremita de %[2]s", "death.attack.dragonBreath": "%[1]s estis rostita per draka blovo", "death.attack.dragonBreath.player": "%[1]s estis rostita per draka blovo batalante kontraŭ %[2]s", "death.attack.drown": "%[1]s dronis", "death.attack.drown.player": "%[1]s dronis batalante kontraŭ %[2]s", "death.attack.dryout": "%[1]s mortis pro senhidratiĝo", "death.attack.dryout.player": "%[1]s mortis pro senhidratiĝo batalante kontraŭ %[2]s", "death.attack.even_more_magic": "%[1]s mortis pro eĉ pli da magio", "death.attack.explosion": "%[1]s eksplodis", "death.attack.explosion.player": "%[1]s estis eksplodigita de %[2]s", "death.attack.explosion.player.item": "%[1]s estis eksplodigita de %[2]s per %[3]s", "death.attack.fall": "%[1]s falis tro profunde", "death.attack.fall.player": "%[1]s falis tro profunde batalante kontraŭ %[2]s", "death.attack.fallingBlock": "%[1]s estis premplatigita de falinta bloko", "death.attack.fallingBlock.player": "%[1]s estis premplatigita de falinta bloko batalante kontraŭ %[2]s", "death.attack.fallingStalactite": "%[1]s estis trapikita de falinta stalaktito", "death.attack.fallingStalactite.player": "%[1]s estis trapikita de falinta stalaktito batalante kontraŭ %[2]s", "death.attack.fireball": "%[1]s estis mortige fajrobulita de %[2]s", "death.attack.fireball.item": "%[1]s estis mortige fajrobulita de %[2]s per %[3]s", "death.attack.fireworks": "%[1]s artfajraĵis", "death.attack.fireworks.item": "%[1]s artfajraĵis de artfajraĵo pafita de %[3]s per %[2]s", "death.attack.fireworks.player": "%[1]s artfajraĵis batalante kontraŭ %[2]s", "death.attack.flyIntoWall": "%[1]s spertis kinetan energion", "death.attack.flyIntoWall.player": "%[1]s spertis kinetan energion batalante kontraŭ %[2]s", "death.attack.freeze": "%[1]s frostiĝis ĝis la morto", "death.attack.freeze.player": "%[1]s estis frostigita ĝis la morto de %[2]s", "death.attack.generic": "%[1]s mortis", "death.attack.generic.player": "%[1]s mortis pro %[2]s", "death.attack.hotFloor": "%[1]s malkovris ke la planko estis lafo", "death.attack.hotFloor.player": "%[1]s paŝis en danĝeran zonon pro %[2]s", "death.attack.inFire": "%[1]s ekbrulis", "death.attack.inFire.player": "%[1]s paŝis en fajron batalante kontraŭ %[2]s", "death.attack.inWall": "%[1]s sufokiĝis en muro", "death.attack.inWall.player": "%[1]s sufokiĝis en muro batalante kontraŭ %[2]s", "death.attack.indirectMagic": "%[1]s estis mortigita de %[2]s per magio", "death.attack.indirectMagic.item": "%[1]s estis mortigita de %[2]s per %[3]s", "death.attack.lava": "%[1]s provis naĝi en lafo", "death.attack.lava.player": "%[1]s provis naĝi en lafo por eskapi de %[2]s", "death.attack.lightningBolt": "%[1]s estis trafita de fulmo", "death.attack.lightningBolt.player": "%[1]s estis trafita de fulmo batalante kontraŭ %[2]s", "death.attack.magic": "%[1]s mortis pro magio", "death.attack.magic.player": "%[1]s mortis pro magio batalante kontraŭ %[2]s", "death.attack.message_too_long": "La originala mesaĝo estis tro longa por esti liverita plene. Jen la mallongigita versio: %s", "death.attack.mob": "%[1]s estis mortigita de %[2]s", "death.attack.mob.item": "%[1]s estis mortigita de %[2]s per %[3]s", "death.attack.onFire": "%[1]s brulis ĝis la morto", "death.attack.onFire.player": "%[1]s brulis ĝis la morto batalante kontraŭ %[2]s", "death.attack.outOfWorld": "%[1]s falis el la mondo", "death.attack.outOfWorld.player": "%[1]s ne volis vivi en la sama mondo kun %[2]s", "death.attack.player": "%[1]s estis mortigita de %[2]s", "death.attack.player.item": "%[1]s estis mortigita de %[2]s per %[3]s", "death.attack.stalagmite": "%[1]s estis palisumita de stalagmito", "death.attack.stalagmite.player": "%[1]s estis palisumita de stalagmito batalante kontraŭ %[2]s", "death.attack.starve": "%[1]s malsatmortis", "death.attack.starve.player": "%[1]s malsatmortis batalante kontraŭ %[2]s", "death.attack.sting": "%[1]s estis pikita ĝis la morto de abelo", "death.attack.sting.player": "%[1]s estis pikita ĝis la morto de %[2]s", "death.attack.sweetBerryBush": "%[1]s estis pikita ĝis la morto de dolĉbera arbusto", "death.attack.sweetBerryBush.player": "%[1]s estis pikita ĝis la morto de dolĉbera arbusto batalante kontraŭ %[2]s", "death.attack.thorns": "%[1]s estis mortigita provante dolorigi %[2]s", "death.attack.thorns.item": "%[1]s estis mortigita de %[3]s provante dolorigi %[2]s", "death.attack.thrown": "%[1]s estis frapmortigita de %[2]s", "death.attack.thrown.item": "%[1]s estis frapmortigita de %[2]s per %[3]s", "death.attack.trident": "%[1]s estis palisumita de %[2]s", "death.attack.trident.item": "%[1]s estis palisumita de %[2]s per %[3]s", "death.attack.wither": "%[1]s forvelkis", "death.attack.wither.player": "%[1]s forvelkis batalante kontraŭ %[2]s", "death.attack.witherSkull": "%[1]s estis pafmortigita per kranio de %[2]s", "death.fell.accident.generic": "%[1]s falis de alta loko", "death.fell.accident.ladder": "%[1]s falis de ŝtupetaro", "death.fell.accident.other_climbable": "%[1]s falis grimpante", "death.fell.accident.scaffolding": "%[1]s falis de skafaldo", "death.fell.accident.twisting_vines": "%[1]s falis de serpentantaj hederoj", "death.fell.accident.vines": "%[1]s falis de hederoj", "death.fell.accident.weeping_vines": "%[1]s falis de larmantaj hederoj", "death.fell.assist": "%[1]s estis devigita fali de %[2]s", "death.fell.assist.item": "%[1]s estis devigita fali de %[2]s per %[3]s", "death.fell.finish": "%[1]s falis tro profunde kaj estis mortigita de %[2]s", "death.fell.finish.item": "%[1]s falis tro profunde kaj estis mortigita de %[2]s per %[3]s", "death.fell.killer": "%[1]s estis devigita fali", "deathScreen.quit.confirm": "Ĉu vi certas ke vi volas eliri?", "deathScreen.respawn": "Reaperi", "deathScreen.score": "Poentoj", "deathScreen.spectate": "Spektadi mondon", "deathScreen.title": "Vi mortis!", "deathScreen.title.hardcore": "Ludo finiĝis!", "deathScreen.titleScreen": "Ĉefa menuo", "debug.advanced_tooltips.help": "F3 + H = Precizaj priskriboj", "debug.advanced_tooltips.off": "Precizaj priskriboj: kaŝataj", "debug.advanced_tooltips.on": "Precizaj priskriboj: montrataj", "debug.chunk_boundaries.help": "F3 + G = Montri pecarlimojn", "debug.chunk_boundaries.off": "Pecaraj limoj: kaŝataj", "debug.chunk_boundaries.on": "Pecaraj limoj: montrataj", "debug.clear_chat.help": "F3 + D = Viŝi babilejon", "debug.copy_location.help": "F3 + C = Kopii lokon kiel /tp komandon, premu F3 + C por kraŝi la ludon", "debug.copy_location.message": "Kopiis lokon al poŝo", "debug.crash.message": "F3 + C estas premita. Tio kraŝos la ludon krom se malpremita.", "debug.crash.warning": "Kraŝas post %s...", "debug.creative_spectator.error": "Ludreĝimo ne ŝanĝeblas; mankas permeso", "debug.creative_spectator.help": "F3 + N = Alterni inter antaŭa reĝimo <-> spektanta", "debug.cycle_renderdistance.help": "F3 + F = Alterni bildigan distancon (majuskliga por inversigi)", "debug.cycle_renderdistance.message": "Bildiga distanco: %s", "debug.gamemodes.error": "Ludreĝima ŝanĝilo ne malfermeblas, vi ne havas permeson", "debug.gamemodes.help": "F3 + F4 = Malfermi ludreĝiman ŝanĝilon", "debug.gamemodes.press_f4": "[ F4 ]", "debug.gamemodes.select_next": "%s Sekva", "debug.help.help": "F3 + Q = Montri ĉi tiun liston", "debug.help.message": "Klavkomandojn:", "debug.inspect.client.block": "Kopiis klientflankajn blokdatumojn al poŝo", "debug.inspect.client.entity": "Kopiis klientflankajn entdatumojn al poŝo", "debug.inspect.help": "F3 + I = Kopii enton aŭ blokdatumojn al poŝo", "debug.inspect.server.block": "Kopiis servilflankajn blokdatumojn al poŝo", "debug.inspect.server.entity": "Kopiis servilflankajn entdatumojn al poŝo", "debug.pause.help": "F3 + Esk = Paŭzi sen la paŭzomenuo (se eblas paŭzi)", "debug.pause_focus.help": "F3 + P = Paŭzi post foriri la ludfenestron", "debug.pause_focus.off": "Paŭzi post foriri la ludfenestron: malaktivigita", "debug.pause_focus.on": "Paŭzi post foriri la ludfenestron: aktivigita", "debug.prefix": "[Sencimigo]:", "debug.profiling.help": "F3 + L = Komenci/ĉesi profili", "debug.profiling.start": "Profilado komenciĝis por %s sekundoj. Uzu F3+L por ĉesigi ĝin pli frue", "debug.profiling.stop": "La profilado ĉesis. La rezultoj konserviĝis al %s", "debug.reload_chunks.help": "F3 + A = Reŝargi pecarojn", "debug.reload_chunks.message": "Reŝargado de ĉiuj pecaroj", "debug.reload_resourcepacks.help": "F3 + T = Reŝargi resurspakaĵojn", "debug.reload_resourcepacks.message": "Reŝargis resurspakaĵojn", "debug.show_hitboxes.help": "F3 + B = Montri batskatolojn", "debug.show_hitboxes.off": "Batskatoloj: kaŝita", "debug.show_hitboxes.on": "Batskatoloj: montritaj", "demo.day.1": "Ĉi tiu demonstra ludo daŭros kvin tagojn. Bonŝancon!", "demo.day.2": "Dua tago", "demo.day.3": "Tria tago", "demo.day.4": "Kvara tago", "demo.day.5": "Lasta tago!", "demo.day.6": "La kvina tago forpasis. Uzu %s por konservi ekranbildon de via kreaĵo.", "demo.day.warning": "Via tempo preskaŭ forpasis!", "demo.demoExpired": "Demonstro finiĝis!", "demo.help.buy": "Aĉetu nun!", "demo.help.fullWrapped": "Ĉi tiu provoversio daŭros dum 5 enludaj tagoj (ĉirkaŭ 1 horo kaj 40 minutoj da realviva tempo). Kontrolu la progreserojn por instruaĵoj! Ĝuu!", "demo.help.inventory": "Uzu %[1]s por malfermi vian inventaron", "demo.help.jump": "Saltu premante %[1]s", "demo.help.later": "Daŭrigi ludon!", "demo.help.movement": "Uzu %[1]s, %[2]s, %[3]s, %[4]s kaj la muson por moviĝi", "demo.help.movementMouse": "Ĉirkaŭrigardu per movi la muson", "demo.help.movementShort": "Moviĝu per premi %[1]s, %[2]s, %[3]s, %[4]s", "demo.help.title": "Minecraft demonstra reĝimo", "demo.remainingTime": "Cetera tempo: %s", "demo.reminder": "La provtempo finiĝis. Aĉetu la ludon por plu ludi aŭ kreu novan mondon!", "difficulty.lock.question": "Ĉu vi certas, ke vi volas ŝlosi la facilnivelon de ĉi tiu mondo? Poste ĉi tiu mondo ĉiam estos %[1]s, kaj vi neniam povos ŝanĝi tiun denove.", "difficulty.lock.title": "Ŝlosi la mondan facilnivelon", "disconnect.closed": "Konekto fermita", "disconnect.disconnected": "Malkonektita de la servilo", "disconnect.endOfStream": "Elsendfluo finiĝis", "disconnect.exceeded_packet_rate": "Forpelita pro transpasado de paketrapidlimo", "disconnect.genericReason": "%s", "disconnect.kicked": "Estis forpelita el la ludo", "disconnect.loginFailed": "Ensaluto malsukcesis", "disconnect.loginFailedInfo": "Ensaluto malsukcesis: %s", "disconnect.loginFailedInfo.insufficientPrivileges": "Plurludanta reĝimo estas malebligita. Bonvolu kontroli la agordojn de via Microsoft-konto.", "disconnect.loginFailedInfo.invalidSession": "Nevalida seanco (Provu restartigi vian ludon kaj la lanĉilon)", "disconnect.loginFailedInfo.serversUnavailable": "La serviloj de aŭtentigo nun ne atingeblas. Bonvolu reprovi.", "disconnect.lost": "La konekto perdiĝis", "disconnect.overflow": "Bufrosuperfluo", "disconnect.quitting": "Elirado", "disconnect.spam": "Forpelita pro spamado", "disconnect.timeout": "Templimo pasis", "disconnect.unknownHost": "Nekonata gastiganto", "editGamerule.default": "Defaŭlte: %s", "editGamerule.title": "Redakti ludregulojn", "effect.effectNotFound": "Nekonata efiko: %s", "effect.minecraft.absorption": "Sansorbeco", "effect.minecraft.bad_omen": "Malbona omeno", "effect.minecraft.blindness": "Blindeco", "effect.minecraft.conduit_power": "Markondukta potenco", "effect.minecraft.dolphins_grace": "Gracio de delfeno", "effect.minecraft.fire_resistance": "Fajrorezisto", "effect.minecraft.glowing": "Brilado", "effect.minecraft.haste": "Hasto", "effect.minecraft.health_boost": "Sanplibonigo", "effect.minecraft.hero_of_the_village": "Heroo de la vilaĝo", "effect.minecraft.hunger": "Malsato", "effect.minecraft.instant_damage": "Tuja damaĝo", "effect.minecraft.instant_health": "Tuja sano", "effect.minecraft.invisibility": "Nevidebleco", "effect.minecraft.jump_boost": "Saltego", "effect.minecraft.levitation": "Levitacio", "effect.minecraft.luck": "Bonŝanco", "effect.minecraft.mining_fatigue": "Mina laceco", "effect.minecraft.nausea": "Naŭzo", "effect.minecraft.night_vision": "Noktvido", "effect.minecraft.poison": "Veneno", "effect.minecraft.regeneration": "Resaniĝo", "effect.minecraft.resistance": "Rezisto", "effect.minecraft.saturation": "Sateco", "effect.minecraft.slow_falling": "Malrapida falo", "effect.minecraft.slowness": "Malrapideco", "effect.minecraft.speed": "Rapideco", "effect.minecraft.strength": "Forteco", "effect.minecraft.unluck": "Malbonŝanco", "effect.minecraft.water_breathing": "Submarspirado", "effect.minecraft.weakness": "Malforteco", "effect.minecraft.wither": "Velko", "effect.none": "Neniu efiko", "enchantment.level.1": "I", "enchantment.level.10": "X", "enchantment.level.2": "II", "enchantment.level.3": "III", "enchantment.level.4": "IV", "enchantment.level.5": "V", "enchantment.level.6": "VI", "enchantment.level.7": "VII", "enchantment.level.8": "VIII", "enchantment.level.9": "IX", "enchantment.minecraft.aqua_affinity": "Akva afineco", "enchantment.minecraft.bane_of_arthropods": "Turmento de artropodoj", "enchantment.minecraft.binding_curse": "Malbeno de kunligo", "enchantment.minecraft.blast_protection": "Eksploda protekto", "enchantment.minecraft.channeling": "Kanalado", "enchantment.minecraft.depth_strider": "Funda paŝanto", "enchantment.minecraft.efficiency": "Efikeco", "enchantment.minecraft.feather_falling": "Plumfalo", "enchantment.minecraft.fire_aspect": "Bruligo", "enchantment.minecraft.fire_protection": "Fajra protekto", "enchantment.minecraft.flame": "Flamo", "enchantment.minecraft.fortune": "Fortuno", "enchantment.minecraft.frost_walker": "Prujnmarŝanto", "enchantment.minecraft.impaling": "Palisumado", "enchantment.minecraft.infinity": "Senfino", "enchantment.minecraft.knockback": "Forpuŝo", "enchantment.minecraft.looting": "Predado", "enchantment.minecraft.loyalty": "Fideleco", "enchantment.minecraft.luck_of_the_sea": "Bonŝanco de la maro", "enchantment.minecraft.lure": "Logilo", "enchantment.minecraft.mending": "Flikado", "enchantment.minecraft.multishot": "Multpafo", "enchantment.minecraft.piercing": "Penetremo", "enchantment.minecraft.power": "Potenco", "enchantment.minecraft.projectile_protection": "Pafaĵa protekto", "enchantment.minecraft.protection": "Protekto", "enchantment.minecraft.punch": "Pafego", "enchantment.minecraft.quick_charge": "Rapida superŝarĝado", "enchantment.minecraft.respiration": "Spirado", "enchantment.minecraft.riptide": "Impulso", "enchantment.minecraft.sharpness": "Akreco", "enchantment.minecraft.silk_touch": "Silka tuŝo", "enchantment.minecraft.smite": "Turmento de malmortuloj", "enchantment.minecraft.soul_speed": "Animrapido", "enchantment.minecraft.sweeping": "Eksvinganta eĝo", "enchantment.minecraft.thorns": "Dornoj", "enchantment.minecraft.unbreaking": "Nerompiĝemo", "enchantment.minecraft.vanishing_curse": "Malbeno de malapero", "enchantment.unknown": "Nekonata sorĉo: %s", "entity.minecraft.area_effect_cloud": "Nubo de areoefiko", "entity.minecraft.armor_stand": "Kirasa tenilo", "entity.minecraft.arrow": "Sago", "entity.minecraft.axolotl": "Aksolotlo", "entity.minecraft.bat": "Vesperto", "entity.minecraft.bee": "Abelo", "entity.minecraft.blaze": "Incendio", "entity.minecraft.boat": "Boato", "entity.minecraft.cat": "Kato", "entity.minecraft.cave_spider": "Kavernaraneo", "entity.minecraft.chest_minecart": "Vagoneto kun kofro", "entity.minecraft.chicken": "Koko", "entity.minecraft.cod": "Moruo", "entity.minecraft.command_block_minecart": "Vagoneto kun komanda bloko", "entity.minecraft.cow": "Bovo", "entity.minecraft.creeper": "Kripero", "entity.minecraft.dolphin": "Delfeno", "entity.minecraft.donkey": "Azeno", "entity.minecraft.dragon_fireball": "Draka farjrobulo", "entity.minecraft.drowned": "Droninto", "entity.minecraft.egg": "Ĵetita ovo", "entity.minecraft.elder_guardian": "Pragardisto", "entity.minecraft.end_crystal": "Finejkristalo", "entity.minecraft.ender_dragon": "Finejdrako", "entity.minecraft.ender_pearl": "Ĵetita finejperlo", "entity.minecraft.enderman": "Finejano", "entity.minecraft.endermite": "Finejmito", "entity.minecraft.evoker": "Alvokisto", "entity.minecraft.evoker_fangs": "Alvokista dentegoj", "entity.minecraft.experience_bottle": "Ĵetita botelo de sorĉado", "entity.minecraft.experience_orb": "Spertobulo", "entity.minecraft.eye_of_ender": "Finejokulo", "entity.minecraft.falling_block": "Falanta bloko", "entity.minecraft.fireball": "Fajrobulo", "entity.minecraft.firework_rocket": "Artfajraĵa raketo", "entity.minecraft.fishing_bobber": "Fiŝflosilo", "entity.minecraft.fox": "Vulpo", "entity.minecraft.furnace_minecart": "Vagoneto kun forno", "entity.minecraft.ghast": "Ĥasto", "entity.minecraft.giant": "Giganto", "entity.minecraft.glow_item_frame": "Luma kadro", "entity.minecraft.glow_squid": "Lumkalmaro", "entity.minecraft.goat": "Kapro", "entity.minecraft.guardian": "Gardanto", "entity.minecraft.hoglin": "Hoglo", "entity.minecraft.hopper_minecart": "Vagoneto kun funelo", "entity.minecraft.horse": "Ĉevalo", "entity.minecraft.husk": "Sekulo", "entity.minecraft.illusioner": "Iluziisto", "entity.minecraft.iron_golem": "Fergolemo", "entity.minecraft.item": "Objekto", "entity.minecraft.item_frame": "Kadro", "entity.minecraft.killer_bunny": "La murdema kuniklo", "entity.minecraft.leash_knot": "Ŝnuron nodo", "entity.minecraft.lightning_bolt": "Fulmo", "entity.minecraft.llama": "Lamo", "entity.minecraft.llama_spit": "Lama kraĉaĵo", "entity.minecraft.magma_cube": "Magmokubo", "entity.minecraft.marker": "Marko", "entity.minecraft.minecart": "Vagoneto", "entity.minecraft.mooshroom": "Fungobovo", "entity.minecraft.mule": "Mulo", "entity.minecraft.ocelot": "Oceloto", "entity.minecraft.painting": "Pentraĵo", "entity.minecraft.panda": "Pando", "entity.minecraft.parrot": "Papago", "entity.minecraft.phantom": "Fantomo", "entity.minecraft.pig": "Porko", "entity.minecraft.piglin": "Piglino", "entity.minecraft.piglin_brute": "Piglinbruto", "entity.minecraft.pillager": "Rabisto", "entity.minecraft.player": "Ludanto", "entity.minecraft.polar_bear": "Blanka urso", "entity.minecraft.potion": "Eliksiro", "entity.minecraft.pufferfish": "Pintfiŝo", "entity.minecraft.rabbit": "Kuniklo", "entity.minecraft.ravager": "Ruiniganto", "entity.minecraft.salmon": "Salmo", "entity.minecraft.sheep": "Ŝafo", "entity.minecraft.shulker": "Ŝulkro", "entity.minecraft.shulker_bullet": "Pafaĵo de ŝulkro", "entity.minecraft.silverfish": "Lepismo", "entity.minecraft.skeleton": "Skeleto", "entity.minecraft.skeleton_horse": "Skeleta ĉevalo", "entity.minecraft.slime": "Mukokubo", "entity.minecraft.small_fireball": "Malgranda fajrobulo", "entity.minecraft.snow_golem": "Neĝgolemo", "entity.minecraft.snowball": "Neĝbulo", "entity.minecraft.spawner_minecart": "Vagoneto kun generilo", "entity.minecraft.spectral_arrow": "Spektra sago", "entity.minecraft.spider": "Araneo", "entity.minecraft.squid": "Kalmaro", "entity.minecraft.stray": "Devojiĝanto", "entity.minecraft.strider": "Lafpaŝanto", "entity.minecraft.tnt": "TNT fajrigita", "entity.minecraft.tnt_minecart": "Vagoneto kun TNT", "entity.minecraft.trader_llama": "Vendista lamo", "entity.minecraft.trident": "Tridento", "entity.minecraft.tropical_fish": "Tropika fiŝo", "entity.minecraft.tropical_fish.predefined.0": "Anemonklaŭnfiŝo", "entity.minecraft.tropical_fish.predefined.1": "Kirurgfiŝo nigra", "entity.minecraft.tropical_fish.predefined.10": "Idolo maŭra", "entity.minecraft.tropical_fish.predefined.11": "Papilifiŝo ornamita", "entity.minecraft.tropical_fish.predefined.12": "Papagfiŝo", "entity.minecraft.tropical_fish.predefined.13": "Anĝelfiŝo reĝina", "entity.minecraft.tropical_fish.predefined.14": "Ruĝa cikledo", "entity.minecraft.tropical_fish.predefined.15": "Blenio ruĝlipa", "entity.minecraft.tropical_fish.predefined.16": "Lucjo ruĝa", "entity.minecraft.tropical_fish.predefined.17": "Volverampfiŝo", "entity.minecraft.tropical_fish.predefined.18": "Tomata klaŭnfiŝo", "entity.minecraft.tropical_fish.predefined.19": "Kornfiŝo", "entity.minecraft.tropical_fish.predefined.2": "Kirurgo blua", "entity.minecraft.tropical_fish.predefined.20": "Papagfiŝo flavvosta", "entity.minecraft.tropical_fish.predefined.21": "Kirurgfiŝo flava", "entity.minecraft.tropical_fish.predefined.3": "Papilifiŝo", "entity.minecraft.tropical_fish.predefined.4": "Cikledo", "entity.minecraft.tropical_fish.predefined.5": "Klaŭnfiŝo", "entity.minecraft.tropical_fish.predefined.6": "Sukerŝpinaĵa batalfiŝo", "entity.minecraft.tropical_fish.predefined.7": "Punktdorsulo", "entity.minecraft.tropical_fish.predefined.8": "Lucjo reĝa", "entity.minecraft.tropical_fish.predefined.9": "Mulledo", "entity.minecraft.tropical_fish.type.betty": "Bettio", "entity.minecraft.tropical_fish.type.blockfish": "Blokfiŝo", "entity.minecraft.tropical_fish.type.brinely": "Sunulo", "entity.minecraft.tropical_fish.type.clayfish": "Argilfiŝo", "entity.minecraft.tropical_fish.type.dasher": "Zomantulo", "entity.minecraft.tropical_fish.type.flopper": "Plaŭdantulo", "entity.minecraft.tropical_fish.type.glitter": "Brilfiŝo", "entity.minecraft.tropical_fish.type.kob": "Hipogloso", "entity.minecraft.tropical_fish.type.snooper": "Enflarantulo", "entity.minecraft.tropical_fish.type.spotty": "Punktfiŝo", "entity.minecraft.tropical_fish.type.stripey": "Strifiŝo", "entity.minecraft.tropical_fish.type.sunstreak": "Blirulo", "entity.minecraft.turtle": "Testudo", "entity.minecraft.vex": "Vekso", "entity.minecraft.villager": "Vilaĝano", "entity.minecraft.villager.armorer": "Armaĵforĝisto", "entity.minecraft.villager.butcher": "Viandisto", "entity.minecraft.villager.cartographer": "Mapisto", "entity.minecraft.villager.cleric": "Kleriko", "entity.minecraft.villager.farmer": "Farmisto", "entity.minecraft.villager.fisherman": "Fiŝisto", "entity.minecraft.villager.fletcher": "Sagisto", "entity.minecraft.villager.leatherworker": "Ledlaboristo", "entity.minecraft.villager.librarian": "Bibliotekisto", "entity.minecraft.villager.mason": "Masonisto", "entity.minecraft.villager.nitwit": "Stultulo", "entity.minecraft.villager.none": "Vilaĝano", "entity.minecraft.villager.shepherd": "Ŝafisto", "entity.minecraft.villager.toolsmith": "Ilforĝisto", "entity.minecraft.villager.weaponsmith": "Armilforĝisto", "entity.minecraft.vindicator": "Praviganto", "entity.minecraft.wandering_trader": "Vaganta vendisto", "entity.minecraft.witch": "Sorĉistino", "entity.minecraft.wither": "Vizero", "entity.minecraft.wither_skeleton": "Vizerskeleto", "entity.minecraft.wither_skull": "Kranio de Vizero", "entity.minecraft.wolf": "Lupo", "entity.minecraft.zoglin": "Zoglo", "entity.minecraft.zombie": "Zombio", "entity.minecraft.zombie_horse": "Zombia ĉevalo", "entity.minecraft.zombie_villager": "Zombia vilaĝano", "entity.minecraft.zombified_piglin": "Zombia piglo", "entity.notFound": "Nekonata ento: %s", "event.minecraft.raid": "Invado", "event.minecraft.raid.defeat": "Malvenko", "event.minecraft.raid.raiders_remaining": "Ceteraj invadantoj: %s", "event.minecraft.raid.victory": "Venko", "filled_map.buried_treasure": "Enterigita trezormapo", "filled_map.id": "N-ro %s", "filled_map.level": "(Nivelo %s/%s)", "filled_map.locked": "Statika", "filled_map.mansion": "Arbara trezormapo", "filled_map.monument": "Oceana trezormapo", "filled_map.scale": "Skalo 1:%s", "filled_map.unknown": "Nekonata mapo", "gameMode.adventure": "Aventura reĝimo", "gameMode.changed": "Via ludreĝimo estas ŝanĝita al %s", "gameMode.creative": "Krea reĝimo", "gameMode.hardcore": "Malfacilega reĝimo!", "gameMode.spectator": "Spektanta reĝimo", "gameMode.survival": "Traviva reĝimo", "gamerule.announceAdvancements": "Anoncadi progreserojn", "gamerule.category.chat": "Babilejo", "gamerule.category.drops": "Falaĵoj", "gamerule.category.misc": "Diversaĵoj", "gamerule.category.mobs": "Moboj", "gamerule.category.player": "Ludanto", "gamerule.category.spawning": "Aperigado", "gamerule.category.updates": "Antaŭeniĝado de mondo", "gamerule.commandBlockOutput": "Elsendadi komandblokan eligon", "gamerule.disableElytraMovementCheck": "Malebligi kontrolon de flugo per elitroj", "gamerule.disableRaids": "Malebligi invadojn", "gamerule.doDaylightCycle": "Daŭrigi tagtempon", "gamerule.doEntityDrops": "Faligadi ekipaĵon de entoj", "gamerule.doEntityDrops.description": "Regas falaĵojn de vagonetoj (inkluzive inventarojn), kadroj, boatoj, ktp.", "gamerule.doFireTick": "Disvastigadi fajron", "gamerule.doImmediateRespawn": "Reaperigadi tujtuje", "gamerule.doInsomnia": "Aperigadi fantomojn", "gamerule.doLimitedCrafting": "Postuladi recepton por farado", "gamerule.doLimitedCrafting.description": "Se ebligita, ludantoj povos fari nur malŝlositajn receptojn", "gamerule.doMobLoot": "Faligadi moban predon", "gamerule.doMobLoot.description": "Kontrolas resursfalado el moboj, inkluzivante spertobuloj", "gamerule.doMobSpawning": "Aperigadi mobojn", "gamerule.doMobSpawning.description": "Iuj entoj eblas havi apartajn regulojn", "gamerule.doPatrolSpawning": "Rabistaj patroloj", "gamerule.doTileDrops": "Faligadi blokojn", "gamerule.doTileDrops.description": "Kontrolas resursfalado el blokoj, inkluzivante spertobuloj", "gamerule.doTraderSpawning": "Aperigadi vagantajn vendistojn", "gamerule.doWeatherCycle": "Ŝanĝadi veteron", "gamerule.drowningDamage": "Dronada damaĝo", "gamerule.fallDamage": "Fala damaĝo", "gamerule.fireDamage": "Fajra damaĝo", "gamerule.forgiveDeadPlayers": "Pardonadi mortintajn ludantojn", "gamerule.forgiveDeadPlayers.description": "Kolerigitaj neŭtraj moboj ĉesas koleri kiam la celato mortas proksime.", "gamerule.freezeDamage": "Frosta damaĝo", "gamerule.keepInventory": "Konservadi inventaron post morto", "gamerule.logAdminCommands": "Elsendadi komandojn de administranto", "gamerule.maxCommandChainLength": "Limo de komandĉena longeco", "gamerule.maxCommandChainLength.description": "Aplikiĝas al komandblokaj ĉenoj kaj funkcioj", "gamerule.maxEntityCramming": "Limo de enta amasiĝado", "gamerule.mobGriefing": "Vandaliga agado de moboj", "gamerule.naturalRegeneration": "Natura resaniĝado", "gamerule.playersSleepingPercentage": "Dorma elcentaĵo", "gamerule.playersSleepingPercentage.description": "La elcentaĵo da ludantoj, kiuj devas dormi por ke la nokto forpasu.", "gamerule.randomTickSpeed": "Rapido de hazardaj taktoj", "gamerule.reducedDebugInfo": "Malpliigi sencimigajn informojn", "gamerule.reducedDebugInfo.description": "Limigas informojn de sencimiga ekrano", "gamerule.sendCommandFeedback": "Sendadi komandan retrokupladon", "gamerule.showDeathMessages": "Montradi mortomesaĝojn", "gamerule.spawnRadius": "Radio de reaperejo", "gamerule.spectatorsGenerateChunks": "Spektantoj generadas terenon", "gamerule.universalAnger": "Universala kolero", "gamerule.universalAnger.description": "Kolerigitaj neŭtraj moboj atakas ĉiujn proksimajn ludantojn, ne nur la koleriginton. Funkcias pli bone se forgiveDeadPlayers estas malebligita.", "generator.amplified": "AMPLIFITA", "generator.amplified.info": "Avizo: Nur por amuzo! Bezonas fortan komputilon.", "generator.custom": "Agordita", "generator.customized": "Agordita (malnova)", "generator.debug_all_block_states": "Erarserĉa reĝimo", "generator.default": "Defaŭlta", "generator.flat": "Platega", "generator.large_biomes": "Grandaj biomoj", "generator.single_biome_caves": "Kavernoj", "generator.single_biome_floating_islands": "Ŝvebantaj insuloj", "generator.single_biome_surface": "Unu biomo", "gui.advancements": "Progreseroj", "gui.all": "Ĉiuj", "gui.back": "Reen", "gui.cancel": "Nuligi", "gui.done": "Prete", "gui.down": "Malsupren", "gui.entity_tooltip.type": "Tipo: %s", "gui.narrate.button": "%s butono", "gui.narrate.editBox": "tajpujo por %s: %s", "gui.narrate.slider": "%s ŝovilo", "gui.no": "Ne", "gui.none": "Neniu", "gui.ok": "Bone", "gui.proceed": "Pluiri", "gui.recipebook.moreRecipes": "Alklaku dekstre por pli", "gui.recipebook.search_hint": "Serĉi...", "gui.recipebook.toggleRecipes.all": "Montras ĉiujn", "gui.recipebook.toggleRecipes.blastable": "Montras fandeblaĵojn", "gui.recipebook.toggleRecipes.craftable": "Montras fareblaĵojn", "gui.recipebook.toggleRecipes.smeltable": "Montras hejteblaĵojn", "gui.recipebook.toggleRecipes.smokable": "Montras fumeblaĵojn", "gui.socialInteractions.blocking_hint": "Administri per Microsoft-konto", "gui.socialInteractions.empty_blocked": "Ne estas blokitaj ludantoj en babilejo", "gui.socialInteractions.empty_hidden": "Ne estas kaŝataj ludantoj en babilejo", "gui.socialInteractions.hidden_in_chat": "Babilejmesaĝoj de %s estos kaŝataj", "gui.socialInteractions.hide": "Kaŝi en babilejo", "gui.socialInteractions.search_empty": "Ludantoj kun tia nomo ne troveblas", "gui.socialInteractions.search_hint": "Serĉi...", "gui.socialInteractions.server_label.multiple": "%s – %s ludantoj", "gui.socialInteractions.server_label.single": "%s – %s ludanto", "gui.socialInteractions.show": "Montri en babilejo", "gui.socialInteractions.shown_in_chat": "Babilejmesaĝoj de %s estos montrataj", "gui.socialInteractions.status_blocked": "Blokita", "gui.socialInteractions.status_blocked_offline": "Blokita - Eksterreta", "gui.socialInteractions.status_hidden": "Kaŝita", "gui.socialInteractions.status_hidden_offline": "Kaŝita - Eksterreta", "gui.socialInteractions.status_offline": "Eksterreta", "gui.socialInteractions.tab_all": "Ĉiuj", "gui.socialInteractions.tab_blocked": "Blokitaj", "gui.socialInteractions.tab_hidden": "Kaŝita", "gui.socialInteractions.title": "Sociaj interagoj", "gui.socialInteractions.tooltip.hide": "Kaŝadi mesaĝojn de %s en babilejo", "gui.socialInteractions.tooltip.show": "Montradi mesaĝojn de %s en babilejo", "gui.stats": "Statistikoj", "gui.toMenu": "Reiri al la servilaro", "gui.toTitle": "Reiri al la ĉefmenuo", "gui.up": "Supren", "gui.yes": "Jes", "inventory.binSlot": "Detrui objekton", "inventory.hotbarInfo": "Redoni objektujaro kun %[1]s+%[2]s", "inventory.hotbarSaved": "Objektujaro konserviĝis (remeti per %[1]s+%[2]s)", "item.canBreak": "Povanta rompi:", "item.canPlace": "Metebla sur:", "item.color": "Koloro: %s", "item.durability": "Fortikeco: %s / %s", "item.dyed": "Tinkturita", "item.minecraft.acacia_boat": "Akacia boato", "item.minecraft.amethyst_shard": "Fragmento de ametisto", "item.minecraft.apple": "Pomo", "item.minecraft.armor_stand": "Kirasa tenilo", "item.minecraft.arrow": "Sago", "item.minecraft.axolotl_bucket": "Sitelo kun aksolotlo", "item.minecraft.axolotl_spawn_egg": "Aperigovo de aksolotlo", "item.minecraft.baked_potato": "Bakita terpomo", "item.minecraft.bat_spawn_egg": "Aperigovo de vesperto", "item.minecraft.bee_spawn_egg": "Aperigovo de abelo", "item.minecraft.beef": "Kruda bovaĵo", "item.minecraft.beetroot": "Ruĝbeto", "item.minecraft.beetroot_seeds": "Ruĝbetaj semoj", "item.minecraft.beetroot_soup": "Barĉo", "item.minecraft.birch_boat": "Betula boato", "item.minecraft.black_dye": "Nigra tinkturo", "item.minecraft.blaze_powder": "Incendia pulvoro", "item.minecraft.blaze_rod": "Incendia vergo", "item.minecraft.blaze_spawn_egg": "Aperigovo de incendio", "item.minecraft.blue_dye": "Blua tinkturo", "item.minecraft.bone": "Osto", "item.minecraft.bone_meal": "Osta faruno", "item.minecraft.book": "Libro", "item.minecraft.bow": "Pafarko", "item.minecraft.bowl": "Bovlo", "item.minecraft.bread": "Pano", "item.minecraft.brewing_stand": "Eliksira farilo", "item.minecraft.brick": "Briko", "item.minecraft.brown_dye": "Bruna tinkturo", "item.minecraft.bucket": "Sitelo", "item.minecraft.bundle": "Sako", "item.minecraft.bundle.fullness": "%s/%s", "item.minecraft.carrot": "Karoto", "item.minecraft.carrot_on_a_stick": "Fiŝkaptilo kun karoto", "item.minecraft.cat_spawn_egg": "Aperigovo de kato", "item.minecraft.cauldron": "Kaldrono", "item.minecraft.cave_spider_spawn_egg": "Aperigovo de kavernaraneo", "item.minecraft.chainmail_boots": "Ĉenaj botoj", "item.minecraft.chainmail_chestplate": "Ĉena brustokiraso", "item.minecraft.chainmail_helmet": "Ĉena kasko", "item.minecraft.chainmail_leggings": "Ĉena pantalono", "item.minecraft.charcoal": "Lignokarbo", "item.minecraft.chest_minecart": "Vagoneto kun kofro", "item.minecraft.chicken": "Kruda kokaĵo", "item.minecraft.chicken_spawn_egg": "Aperigovo de koko", "item.minecraft.chorus_fruit": "Refrena frukto", "item.minecraft.clay_ball": "Argilbulo", "item.minecraft.clock": "Horloĝo", "item.minecraft.coal": "Karbo", "item.minecraft.cocoa_beans": "Kakao", "item.minecraft.cod": "Kruda moruo", "item.minecraft.cod_bucket": "Sitelo kun moruo", "item.minecraft.cod_spawn_egg": "Aperigovo de moruo", "item.minecraft.command_block_minecart": "Vagoneto kun komanda bloko", "item.minecraft.compass": "Kompaso", "item.minecraft.cooked_beef": "Bifsteko", "item.minecraft.cooked_chicken": "Kuirita kokaĵo", "item.minecraft.cooked_cod": "Kuirita muruo", "item.minecraft.cooked_mutton": "Kuirita ŝafaĵo", "item.minecraft.cooked_porkchop": "Kuirita porkaĵo", "item.minecraft.cooked_rabbit": "Kuirita kuniklaĵo", "item.minecraft.cooked_salmon": "Kuirita salmo", "item.minecraft.cookie": "Kekso", "item.minecraft.copper_ingot": "Kupra ingoto", "item.minecraft.cow_spawn_egg": "Aperigovo de bovo", "item.minecraft.creeper_banner_pattern": "Standarda ŝablono", "item.minecraft.creeper_banner_pattern.desc": "Kripera bildo", "item.minecraft.creeper_spawn_egg": "Aperigovo de kripero", "item.minecraft.crossbow": "Arbalesto", "item.minecraft.crossbow.projectile": "Pafaĵo:", "item.minecraft.cyan_dye": "Turkisa tinkturo", "item.minecraft.dark_oak_boat": "Malhelkverka boato", "item.minecraft.debug_stick": "Sencimiga bastono", "item.minecraft.debug_stick.empty": "%s ne havas proprietojn", "item.minecraft.debug_stick.select": "vi elektis \"%s\" (%s)", "item.minecraft.debug_stick.update": "\"%s\" al %s", "item.minecraft.diamond": "Diamanto", "item.minecraft.diamond_axe": "Diamanta hakilo", "item.minecraft.diamond_boots": "Diamantaj botoj", "item.minecraft.diamond_chestplate": "Diamanta brustokiraso", "item.minecraft.diamond_helmet": "Diamanta kasko", "item.minecraft.diamond_hoe": "Diamanta sarkilo", "item.minecraft.diamond_horse_armor": "Diamanta ĉevala kiraso", "item.minecraft.diamond_leggings": "Diamanta pantalono", "item.minecraft.diamond_pickaxe": "Diamanta pioĉo", "item.minecraft.diamond_shovel": "Diamanta fosilo", "item.minecraft.diamond_sword": "Diamanta glavo", "item.minecraft.dolphin_spawn_egg": "Aperigovo de delfeno", "item.minecraft.donkey_spawn_egg": "Aperigovo de azeno", "item.minecraft.dragon_breath": "Draka blovo", "item.minecraft.dried_kelp": "Sekigita algo", "item.minecraft.drowned_spawn_egg": "Aperigovo de droninto", "item.minecraft.egg": "Ovo", "item.minecraft.elder_guardian_spawn_egg": "Aperigovo de pragardisto", "item.minecraft.elytra": "Elitroj", "item.minecraft.emerald": "Smeraldo", "item.minecraft.enchanted_book": "Sorĉita libro", "item.minecraft.enchanted_golden_apple": "Sorĉita ora pomo", "item.minecraft.end_crystal": "Finejkristalo", "item.minecraft.ender_eye": "Finejokulo", "item.minecraft.ender_pearl": "Finejperlo", "item.minecraft.enderman_spawn_egg": "Aperigovo de finejano", "item.minecraft.endermite_spawn_egg": "Aperigovo de finejmito", "item.minecraft.evoker_spawn_egg": "Aperigovo de alvokisto", "item.minecraft.experience_bottle": "Botelo de sorĉado", "item.minecraft.feather": "Plumo", "item.minecraft.fermented_spider_eye": "Fermentita okulo de araneo", "item.minecraft.filled_map": "Mapo", "item.minecraft.fire_charge": "Fajrobulo", "item.minecraft.firework_rocket": "Artfajraĵa raketo", "item.minecraft.firework_rocket.flight": "Flugdaŭro:", "item.minecraft.firework_star": "Artfajraĵa stelo", "item.minecraft.firework_star.black": "Nigra", "item.minecraft.firework_star.blue": "Blua", "item.minecraft.firework_star.brown": "Bruna", "item.minecraft.firework_star.custom_color": "Agordita", "item.minecraft.firework_star.cyan": "Turkisa", "item.minecraft.firework_star.fade_to": "Foriĝas je", "item.minecraft.firework_star.flicker": "Sparko", "item.minecraft.firework_star.gray": "Griza", "item.minecraft.firework_star.green": "Verda", "item.minecraft.firework_star.light_blue": "Helblua", "item.minecraft.firework_star.light_gray": "Helgriza", "item.minecraft.firework_star.lime": "Helverda", "item.minecraft.firework_star.magenta": "Malva", "item.minecraft.firework_star.orange": "Oranĝkolora", "item.minecraft.firework_star.pink": "Rozkolora", "item.minecraft.firework_star.purple": "Violkolora", "item.minecraft.firework_star.red": "Ruĝa", "item.minecraft.firework_star.shape": "Nekonata formo", "item.minecraft.firework_star.shape.burst": "Splitiĝo", "item.minecraft.firework_star.shape.creeper": "Kripera formo", "item.minecraft.firework_star.shape.large_ball": "Granda bulo", "item.minecraft.firework_star.shape.small_ball": "Malgranda bulo", "item.minecraft.firework_star.shape.star": "Stela formo", "item.minecraft.firework_star.trail": "Poststrio", "item.minecraft.firework_star.white": "Blanka", "item.minecraft.firework_star.yellow": "Flava", "item.minecraft.fishing_rod": "Fiŝkaptilo", "item.minecraft.flint": "Siliko", "item.minecraft.flint_and_steel": "Fajrilo", "item.minecraft.flower_banner_pattern": "Standarda ŝablono", "item.minecraft.flower_banner_pattern.desc": "Flora bildo", "item.minecraft.flower_pot": "Florpoto", "item.minecraft.fox_spawn_egg": "Aperigovo de vulpo", "item.minecraft.furnace_minecart": "Vagoneto kun forno", "item.minecraft.ghast_spawn_egg": "Aperigovo de ĥasto", "item.minecraft.ghast_tear": "Ĥasta larmo", "item.minecraft.glass_bottle": "Vitra botelo", "item.minecraft.glistering_melon_slice": "Tranĉaĵo da brila akvomelono", "item.minecraft.globe_banner_pattern": "Standarda ŝablono", "item.minecraft.globe_banner_pattern.desc": "Terkubo", "item.minecraft.glow_berries": "Lumberoj", "item.minecraft.glow_ink_sac": "Sako da luminko", "item.minecraft.glow_item_frame": "Luma kadro", "item.minecraft.glow_squid_spawn_egg": "Aperigovo de lumkalmaro", "item.minecraft.glowstone_dust": "Lumpolvo", "item.minecraft.goat_spawn_egg": "Aperigovo de kapro", "item.minecraft.gold_ingot": "Ora ingoto", "item.minecraft.gold_nugget": "Orobulo", "item.minecraft.golden_apple": "Ora pomo", "item.minecraft.golden_axe": "Ora hakilo", "item.minecraft.golden_boots": "Oraj botoj", "item.minecraft.golden_carrot": "Ora karoto", "item.minecraft.golden_chestplate": "Ora brustokiraso", "item.minecraft.golden_helmet": "Ora kasko", "item.minecraft.golden_hoe": "Ora sarkilo", "item.minecraft.golden_horse_armor": "Ora ĉevala kiraso", "item.minecraft.golden_leggings": "Ora pantalono", "item.minecraft.golden_pickaxe": "Ora pioĉo", "item.minecraft.golden_shovel": "Ora fosilo", "item.minecraft.golden_sword": "Ora glavo", "item.minecraft.gray_dye": "Griza tinkturo", "item.minecraft.green_dye": "Verda tinkturo", "item.minecraft.guardian_spawn_egg": "Aperigovo de gardisto", "item.minecraft.gunpowder": "Pulvo", "item.minecraft.heart_of_the_sea": "Kerno de la maro", "item.minecraft.hoglin_spawn_egg": "Aperigovo de hoglo", "item.minecraft.honey_bottle": "Botelo da mielo", "item.minecraft.honeycomb": "Miela ĉelaro", "item.minecraft.hopper_minecart": "Vagoneto kun funelo", "item.minecraft.horse_spawn_egg": "Aperigovo de ĉevalo", "item.minecraft.husk_spawn_egg": "Aperigovo de sekulo", "item.minecraft.ink_sac": "Inksako", "item.minecraft.iron_axe": "Fera hakilo", "item.minecraft.iron_boots": "Feraj botoj", "item.minecraft.iron_chestplate": "Fera brustokiraso", "item.minecraft.iron_helmet": "Fera kasko", "item.minecraft.iron_hoe": "Fera sarkilo", "item.minecraft.iron_horse_armor": "Fera ĉevala kiraso", "item.minecraft.iron_ingot": "Fera ingoto", "item.minecraft.iron_leggings": "Fera pantalono", "item.minecraft.iron_nugget": "Ferobulo", "item.minecraft.iron_pickaxe": "Fera pioĉo", "item.minecraft.iron_shovel": "Fera fosilo", "item.minecraft.iron_sword": "Fera glavo", "item.minecraft.item_frame": "Kadro", "item.minecraft.jungle_boat": "Ĝangala boato", "item.minecraft.knowledge_book": "Libro de sciado", "item.minecraft.lapis_lazuli": "Lazurito", "item.minecraft.lava_bucket": "Sitelo da lafo", "item.minecraft.lead": "Kondukilo", "item.minecraft.leather": "Ledo", "item.minecraft.leather_boots": "Ledaj botoj", "item.minecraft.leather_chestplate": "Leda tuniko", "item.minecraft.leather_helmet": "Leda ĉapo", "item.minecraft.leather_horse_armor": "Leda ĉevala kiraso", "item.minecraft.leather_leggings": "Leda pantalono", "item.minecraft.light_blue_dye": "Helblua tinkturo", "item.minecraft.light_gray_dye": "Helgriza tinkturo", "item.minecraft.lime_dye": "Helverda tinkturo", "item.minecraft.lingering_potion": "Resta eliksiro", "item.minecraft.lingering_potion.effect.awkward": "Stranga resta eliksiro", "item.minecraft.lingering_potion.effect.empty": "Resta nefarebla eliksiro", "item.minecraft.lingering_potion.effect.fire_resistance": "Resta eliksiro de fajrorezisto", "item.minecraft.lingering_potion.effect.harming": "Resta eliksiro de lezado", "item.minecraft.lingering_potion.effect.healing": "Resta eliksiro de sanigo", "item.minecraft.lingering_potion.effect.invisibility": "Resta eliksiro de nevidebleco", "item.minecraft.lingering_potion.effect.leaping": "Resta eliksiro de saltado", "item.minecraft.lingering_potion.effect.levitation": "Resta eliksiro de levitacio", "item.minecraft.lingering_potion.effect.luck": "Resta eliksiro de bonŝanco", "item.minecraft.lingering_potion.effect.mundane": "Banala resta eliksiro", "item.minecraft.lingering_potion.effect.night_vision": "Resta eliksiro de noktvido", "item.minecraft.lingering_potion.effect.poison": "Resta eliksiro de veneno", "item.minecraft.lingering_potion.effect.regeneration": "Resta eliksiro de resanigado", "item.minecraft.lingering_potion.effect.slow_falling": "Resta eliksiro de malrapida falo", "item.minecraft.lingering_potion.effect.slowness": "Resta eliksiro de malrapideco", "item.minecraft.lingering_potion.effect.strength": "Resta eliksiro de forteco", "item.minecraft.lingering_potion.effect.swiftness": "Resta eliksiro de rapideco", "item.minecraft.lingering_potion.effect.thick": "Densa resta eliksiro", "item.minecraft.lingering_potion.effect.turtle_master": "Resta eliksiro de la testudmajstro", "item.minecraft.lingering_potion.effect.water": "Resta botelo da akvo", "item.minecraft.lingering_potion.effect.water_breathing": "Rest eliksiro de submarspirado", "item.minecraft.lingering_potion.effect.weakness": "Resta eliksiro de malforteco", "item.minecraft.llama_spawn_egg": "Aperigovo de lamo", "item.minecraft.lodestone_compass": "Magnetigita kompaso", "item.minecraft.magenta_dye": "Malva tinkturo", "item.minecraft.magma_cream": "Magmokremo", "item.minecraft.magma_cube_spawn_egg": "Aperigovo de magmokubo", "item.minecraft.map": "Blanka mapo", "item.minecraft.melon_seeds": "Akvomelonaj semoj", "item.minecraft.melon_slice": "Akvomelontranĉaĵo", "item.minecraft.milk_bucket": "Sitelo da lakto", "item.minecraft.minecart": "Vagoneto", "item.minecraft.mojang_banner_pattern": "Standarda ŝablono", "item.minecraft.mojang_banner_pattern.desc": "Simbolo", "item.minecraft.mooshroom_spawn_egg": "Aperigovo de fungobovo", "item.minecraft.mule_spawn_egg": "Aperigovo de mulo", "item.minecraft.mushroom_stew": "Fungosupo", "item.minecraft.music_disc_11": "Sondisko", "item.minecraft.music_disc_11.desc": "C418 - 11", "item.minecraft.music_disc_13": "Sondisko", "item.minecraft.music_disc_13.desc": "C418 - 13", "item.minecraft.music_disc_blocks": "Sondisko", "item.minecraft.music_disc_blocks.desc": "C418 - blocks", "item.minecraft.music_disc_cat": "Sondisko", "item.minecraft.music_disc_cat.desc": "C418 - cat", "item.minecraft.music_disc_chirp": "Sondisko", "item.minecraft.music_disc_chirp.desc": "C418 - chirp", "item.minecraft.music_disc_far": "Sondisko", "item.minecraft.music_disc_far.desc": "C418 - far", "item.minecraft.music_disc_mall": "Sondisko", "item.minecraft.music_disc_mall.desc": "C418 - mall", "item.minecraft.music_disc_mellohi": "Sondisko", "item.minecraft.music_disc_mellohi.desc": "C418 - mellohi", "item.minecraft.music_disc_pigstep": "Sondisko", "item.minecraft.music_disc_pigstep.desc": "Lena Raine - Pigstep", "item.minecraft.music_disc_stal": "Sondisko", "item.minecraft.music_disc_stal.desc": "C418 - stal", "item.minecraft.music_disc_strad": "Sondisko", "item.minecraft.music_disc_strad.desc": "C418 - strad", "item.minecraft.music_disc_wait": "Sondisko", "item.minecraft.music_disc_wait.desc": "C418 - wait", "item.minecraft.music_disc_ward": "Sondisko", "item.minecraft.music_disc_ward.desc": "C418 - ward", "item.minecraft.mutton": "Kruda ŝafaĵo", "item.minecraft.name_tag": "Nomilo", "item.minecraft.nautilus_shell": "Naŭtila konko", "item.minecraft.nether_brick": "Submondbriko", "item.minecraft.nether_star": "Submonda stelo", "item.minecraft.nether_wart": "Submonda veruko", "item.minecraft.netherite_axe": "Subena hakilo", "item.minecraft.netherite_boots": "Subenaj botoj", "item.minecraft.netherite_chestplate": "Subena brustokiraso", "item.minecraft.netherite_helmet": "Subena kasko", "item.minecraft.netherite_hoe": "Subena sarkilo", "item.minecraft.netherite_ingot": "Subena ingoto", "item.minecraft.netherite_leggings": "Subena pantalono", "item.minecraft.netherite_pickaxe": "Subena pioĉo", "item.minecraft.netherite_scrap": "Subena fragmento", "item.minecraft.netherite_shovel": "Subena fosilo", "item.minecraft.netherite_sword": "Subena glavo", "item.minecraft.oak_boat": "Kverka boato", "item.minecraft.ocelot_spawn_egg": "Aperigovo de oceloto", "item.minecraft.orange_dye": "Oranĝkolora tinkturo", "item.minecraft.painting": "Pentraĵo", "item.minecraft.panda_spawn_egg": "Aperigovo de pando", "item.minecraft.paper": "Papero", "item.minecraft.parrot_spawn_egg": "Aperigovo de papago", "item.minecraft.phantom_membrane": "Fantoma membrano", "item.minecraft.phantom_spawn_egg": "Aperigovo de fantomo", "item.minecraft.pig_spawn_egg": "Aperigovo de porko", "item.minecraft.piglin_banner_pattern": "Standarda ŝablono", "item.minecraft.piglin_banner_pattern.desc": "Muzelo", "item.minecraft.piglin_brute_spawn_egg": "Aperigovo de brutala piglo", "item.minecraft.piglin_spawn_egg": "Aperigovo de piglo", "item.minecraft.pillager_spawn_egg": "Aperigovo de rabisto", "item.minecraft.pink_dye": "Rozkolora tinkturo", "item.minecraft.poisonous_potato": "Venena terpomo", "item.minecraft.polar_bear_spawn_egg": "Aperigovo de blanka urso", "item.minecraft.popped_chorus_fruit": "Krevita refrena frukto", "item.minecraft.porkchop": "Kruda porkaĵo", "item.minecraft.potato": "Terpomo", "item.minecraft.potion": "Eliksiro", "item.minecraft.potion.effect.awkward": "Stranga eliksiro", "item.minecraft.potion.effect.empty": "Nefarebla eliksiro", "item.minecraft.potion.effect.fire_resistance": "Eliksiro de fajrorezisto", "item.minecraft.potion.effect.harming": "Eliksiro de lezado", "item.minecraft.potion.effect.healing": "Eliksiro de sanigo", "item.minecraft.potion.effect.invisibility": "Eliksiro de nevidebleco", "item.minecraft.potion.effect.leaping": "Eliksiro de saltado", "item.minecraft.potion.effect.levitation": "Eliksiro de levitacio", "item.minecraft.potion.effect.luck": "Eliksiro de bonŝanco", "item.minecraft.potion.effect.mundane": "Banala eliksiro", "item.minecraft.potion.effect.night_vision": "Eliksiro de noktvido", "item.minecraft.potion.effect.poison": "Eliksiro de veneno", "item.minecraft.potion.effect.regeneration": "Eliksiro de resanigado", "item.minecraft.potion.effect.slow_falling": "Eliksiro de malrapida falo", "item.minecraft.potion.effect.slowness": "Eliksiro de malrapideco", "item.minecraft.potion.effect.strength": "Eliksiro de forteco", "item.minecraft.potion.effect.swiftness": "Eliksiro de rapideco", "item.minecraft.potion.effect.thick": "Densa eliksiro", "item.minecraft.potion.effect.turtle_master": "Eliksiro de la testudmajstro", "item.minecraft.potion.effect.water": "Botelo da akvo", "item.minecraft.potion.effect.water_breathing": "Eliksiro de submarspirado", "item.minecraft.potion.effect.weakness": "Eliksiro de malforteco", "item.minecraft.powder_snow_bucket": "Sitelo da pulvora neĝo", "item.minecraft.prismarine_crystals": "Prismarina kristalo", "item.minecraft.prismarine_shard": "Prismarina rompopeco", "item.minecraft.pufferfish": "Pintfiŝo", "item.minecraft.pufferfish_bucket": "Sitelo kun pintfiŝo", "item.minecraft.pufferfish_spawn_egg": "Aperigovo de pintfiŝo", "item.minecraft.pumpkin_pie": "Kukurba pirogo", "item.minecraft.pumpkin_seeds": "Kukurbaj semoj", "item.minecraft.purple_dye": "Violkolora tinkturo", "item.minecraft.quartz": "Kvarco", "item.minecraft.rabbit": "Kruda kuniklaĵo", "item.minecraft.rabbit_foot": "Kunikla piedo", "item.minecraft.rabbit_hide": "Kunikla felo", "item.minecraft.rabbit_spawn_egg": "Aperigovo de kuniklo", "item.minecraft.rabbit_stew": "Kuniklaĵa raguo", "item.minecraft.ravager_spawn_egg": "Aperigovo de ruiniganto", "item.minecraft.raw_copper": "Kruda kupro", "item.minecraft.raw_gold": "Kruda oro", "item.minecraft.raw_iron": "Kruda fero", "item.minecraft.red_dye": "Ruĝa tinkturo", "item.minecraft.redstone": "Ruĝona polvo", "item.minecraft.rotten_flesh": "Putra karno", "item.minecraft.saddle": "Selo", "item.minecraft.salmon": "Kruda salmo", "item.minecraft.salmon_bucket": "Sitelo kun salmo", "item.minecraft.salmon_spawn_egg": "Aperigovo de salmo", "item.minecraft.scute": "Ŝelero", "item.minecraft.shears": "Tondilo", "item.minecraft.sheep_spawn_egg": "Aperigovo de ŝafo", "item.minecraft.shield": "Ŝildo", "item.minecraft.shield.black": "Nigra ŝildo", "item.minecraft.shield.blue": "Blua ŝildo", "item.minecraft.shield.brown": "Bruna ŝildo", "item.minecraft.shield.cyan": "Turkisa ŝildo", "item.minecraft.shield.gray": "Griza ŝildo", "item.minecraft.shield.green": "Verda ŝildo", "item.minecraft.shield.light_blue": "Helblua ŝildo", "item.minecraft.shield.light_gray": "Helgriza ŝildo", "item.minecraft.shield.lime": "Helverda ŝildo", "item.minecraft.shield.magenta": "Malva ŝildo", "item.minecraft.shield.orange": "Oranĝkolora ŝildo", "item.minecraft.shield.pink": "Rozkolora ŝildo", "item.minecraft.shield.purple": "Violkolora ŝildo", "item.minecraft.shield.red": "Ruĝa ŝildo", "item.minecraft.shield.white": "Blanka ŝildo", "item.minecraft.shield.yellow": "Flava ŝildo", "item.minecraft.shulker_shell": "Ŝelo de ŝulkro", "item.minecraft.shulker_spawn_egg": "Aperigovo de ŝulkro", "item.minecraft.sign": "Ŝildeto", "item.minecraft.silverfish_spawn_egg": "Aperigovo de lepismo", "item.minecraft.skeleton_horse_spawn_egg": "Aperigovo de skeleta ĉevalo", "item.minecraft.skeleton_spawn_egg": "Aperigovo de skeleto", "item.minecraft.skull_banner_pattern": "Standarda ŝablono", "item.minecraft.skull_banner_pattern.desc": "Krania bildo", "item.minecraft.slime_ball": "Mukbulo", "item.minecraft.slime_spawn_egg": "Aperigovo de mukokubo", "item.minecraft.snowball": "Neĝbulo", "item.minecraft.spectral_arrow": "Spektra sago", "item.minecraft.spider_eye": "Okulo de araneo", "item.minecraft.spider_spawn_egg": "Aperigovo de araneo", "item.minecraft.splash_potion": "Ŝpruca eliksiro", "item.minecraft.splash_potion.effect.awkward": "Stranga ŝpruca eliksiro", "item.minecraft.splash_potion.effect.empty": "Ŝpruca nefarebla eliksiro", "item.minecraft.splash_potion.effect.fire_resistance": "Ŝpruca eliksiro de fajrorezisto", "item.minecraft.splash_potion.effect.harming": "Ŝpruca eliksiro de lezado", "item.minecraft.splash_potion.effect.healing": "Ŝpruca eliksiro de sanigo", "item.minecraft.splash_potion.effect.invisibility": "Ŝpruca eliksiro de nevidebleco", "item.minecraft.splash_potion.effect.leaping": "Ŝpruca eliksiro de saltado", "item.minecraft.splash_potion.effect.levitation": "Ŝpruca eliksiro de levitacio", "item.minecraft.splash_potion.effect.luck": "Ŝpruca eliksiro de bonŝanco", "item.minecraft.splash_potion.effect.mundane": "Banala ŝpruca eliksiro", "item.minecraft.splash_potion.effect.night_vision": "Ŝpruca eliksiro de noktvido", "item.minecraft.splash_potion.effect.poison": "Ŝpruca eliksiro de veneno", "item.minecraft.splash_potion.effect.regeneration": "Ŝpruca eliksiro de resanigado", "item.minecraft.splash_potion.effect.slow_falling": "Ŝpruca eliksiro de malrapida falo", "item.minecraft.splash_potion.effect.slowness": "Ŝpruca eliksiro de malrapideco", "item.minecraft.splash_potion.effect.strength": "Ŝpruca eliksiro de forteco", "item.minecraft.splash_potion.effect.swiftness": "Ŝpruca eliksiro de rapideco", "item.minecraft.splash_potion.effect.thick": "Densa ŝpruca eliksiro", "item.minecraft.splash_potion.effect.turtle_master": "Ŝpruca eliksiro de la testudmajstro", "item.minecraft.splash_potion.effect.water": "Ŝpruca botelo da akvo", "item.minecraft.splash_potion.effect.water_breathing": "Ŝpruca eliksiro de submarspirado", "item.minecraft.splash_potion.effect.weakness": "Ŝpruca eliksiro de malforteco", "item.minecraft.spruce_boat": "Picea boato", "item.minecraft.spyglass": "Lorno", "item.minecraft.squid_spawn_egg": "Aperigovo de kalmaro", "item.minecraft.stick": "Bastono", "item.minecraft.stone_axe": "Ŝtona hakilo", "item.minecraft.stone_hoe": "Ŝtona sarkilo", "item.minecraft.stone_pickaxe": "Ŝtona pioĉo", "item.minecraft.stone_shovel": "Ŝtona fosilo", "item.minecraft.stone_sword": "Ŝtona glavo", "item.minecraft.stray_spawn_egg": "Aperigovo de devojiĝanto", "item.minecraft.strider_spawn_egg": "Aperigovo de lafpaŝanto", "item.minecraft.string": "Fadeno", "item.minecraft.sugar": "Sukero", "item.minecraft.suspicious_stew": "Suspektinda manĝaĵo", "item.minecraft.sweet_berries": "Dolĉberoj", "item.minecraft.tipped_arrow": "Eliksira sago", "item.minecraft.tipped_arrow.effect.awkward": "Eliksira sago", "item.minecraft.tipped_arrow.effect.empty": "Nefarebla eliksira sago", "item.minecraft.tipped_arrow.effect.fire_resistance": "Sago de fajrorezisto", "item.minecraft.tipped_arrow.effect.harming": "Sago de lezado", "item.minecraft.tipped_arrow.effect.healing": "Sago de sanigo", "item.minecraft.tipped_arrow.effect.invisibility": "Sago de nevidebleco", "item.minecraft.tipped_arrow.effect.leaping": "Sago de saltado", "item.minecraft.tipped_arrow.effect.levitation": "Sago de ŝvebado", "item.minecraft.tipped_arrow.effect.luck": "Sago de bonŝanco", "item.minecraft.tipped_arrow.effect.mundane": "Eliksira sago", "item.minecraft.tipped_arrow.effect.night_vision": "Sago de noktvido", "item.minecraft.tipped_arrow.effect.poison": "Sago de veneno", "item.minecraft.tipped_arrow.effect.regeneration": "Sago de resanigado", "item.minecraft.tipped_arrow.effect.slow_falling": "Sago de malrapida falo", "item.minecraft.tipped_arrow.effect.slowness": "Sago de malrapideco", "item.minecraft.tipped_arrow.effect.strength": "Sago de forteco", "item.minecraft.tipped_arrow.effect.swiftness": "Sago de rapideco", "item.minecraft.tipped_arrow.effect.thick": "Eliksira sago", "item.minecraft.tipped_arrow.effect.turtle_master": "Sago de la testudmajstro", "item.minecraft.tipped_arrow.effect.water": "Sago de ŝprucado", "item.minecraft.tipped_arrow.effect.water_breathing": "Sago de submarspirado", "item.minecraft.tipped_arrow.effect.weakness": "Sago de malforteco", "item.minecraft.tnt_minecart": "Vagoneto kun TNT", "item.minecraft.totem_of_undying": "Totemo de senmorteco", "item.minecraft.trader_llama_spawn_egg": "Aperigovo de vendista lamo", "item.minecraft.trident": "Tridento", "item.minecraft.tropical_fish": "Tropika fiŝo", "item.minecraft.tropical_fish_bucket": "Sitelo kun tropika fiŝo", "item.minecraft.tropical_fish_spawn_egg": "Aperigovo de tropika fiŝo", "item.minecraft.turtle_helmet": "Testuda ŝelo", "item.minecraft.turtle_spawn_egg": "Aperigovo de testudo", "item.minecraft.vex_spawn_egg": "Aperigovo de vekso", "item.minecraft.villager_spawn_egg": "Aperigovo de vilaĝano", "item.minecraft.vindicator_spawn_egg": "Aperigovo de praviganto", "item.minecraft.wandering_trader_spawn_egg": "Aperigovo de vaganta vendisto", "item.minecraft.warped_fungus_on_a_stick": "Fiŝkaptilo kun torda fungo", "item.minecraft.water_bucket": "Sitelo da akvo", "item.minecraft.wheat": "Tritiko", "item.minecraft.wheat_seeds": "Tritikaj semoj", "item.minecraft.white_dye": "Blanka tinkturo", "item.minecraft.witch_spawn_egg": "Aperigovo de sorĉistino", "item.minecraft.wither_skeleton_spawn_egg": "Aperigovo de vizerskeleto", "item.minecraft.wolf_spawn_egg": "Aperigovo de lupo", "item.minecraft.wooden_axe": "Ligna hakilo", "item.minecraft.wooden_hoe": "Ligna sarkilo", "item.minecraft.wooden_pickaxe": "Ligna pioĉo", "item.minecraft.wooden_shovel": "Ligna fosilo", "item.minecraft.wooden_sword": "Ligna glavo", "item.minecraft.writable_book": "Libro kaj plumo", "item.minecraft.written_book": "Skribita libro", "item.minecraft.yellow_dye": "Flava tinkturo", "item.minecraft.zoglin_spawn_egg": "Aperigovo de zoglo", "item.minecraft.zombie_horse_spawn_egg": "Aperigovo de zombia ĉevalo", "item.minecraft.zombie_spawn_egg": "Aperigovo de zombio", "item.minecraft.zombie_villager_spawn_egg": "Aperigovo de zombia vilaĝano", "item.minecraft.zombified_piglin_spawn_egg": "Aperigovo de zombia piglo", "item.modifiers.chest": "Kiam sur torso:", "item.modifiers.feet": "Kiam sur piedoj:", "item.modifiers.head": "Kiam sur kapo:", "item.modifiers.legs": "Kiam sur kruroj:", "item.modifiers.mainhand": "Kiam en ĉefa mano:", "item.modifiers.offhand": "Kiam en neĉefa mano:", "item.nbt_tags": "NBT: %s priskribilo(j)", "item.unbreakable": "Nerompebla", "itemGroup.brewing": "Eliksiroj", "itemGroup.buildingBlocks": "Konstruaj blokoj", "itemGroup.combat": "Batalaĵoj", "itemGroup.decorations": "Dekoraciaj blokoj", "itemGroup.food": "Manĝaĵoj", "itemGroup.hotbar": "Objektujaroj konservitaj", "itemGroup.inventory": "Traviva inventaro", "itemGroup.materials": "Materialoj", "itemGroup.misc": "Diversaj", "itemGroup.redstone": "Ruĝono", "itemGroup.search": "Serĉi", "itemGroup.tools": "Iloj", "itemGroup.transportation": "Transporto", "item_modifier.unknown": "Nekonata objektomodifilo: %s", "jigsaw_block.final_state": "Iĝas:", "jigsaw_block.generate": "Generi", "jigsaw_block.joint.aligned": "Fiksita", "jigsaw_block.joint.rollable": "Rulebla", "jigsaw_block.joint_label": "Artika tipo:", "jigsaw_block.keep_jigsaws": "Gardi blokojn", "jigsaw_block.levels": "Niveloj: %s", "jigsaw_block.name": "Nomo:", "jigsaw_block.pool": "Cela provizado:", "jigsaw_block.target": "Cela nomo:", "key.advancements": "Progreseroj", "key.attack": "Ataki/detrui", "key.back": "Paŝi malantaŭen", "key.categories.creative": "Krea reĝimo", "key.categories.gameplay": "Ludo", "key.categories.inventory": "Inventaro", "key.categories.misc": "Diversaĵoj", "key.categories.movement": "Movado", "key.categories.multiplayer": "Plurludanta reĝimo", "key.categories.ui": "Ludinterfaco", "key.chat": "Babili", "key.command": "Fari komandon", "key.drop": "Faligi elektitan objekton", "key.forward": "Paŝi antaŭen", "key.fullscreen": "Baskuligi tutekranan reĝimon", "key.hotbar.1": "Objektujo 1", "key.hotbar.2": "Objektujo 2", "key.hotbar.3": "Objektujo 3", "key.hotbar.4": "Objektujo 4", "key.hotbar.5": "Objektujo 5", "key.hotbar.6": "Objektujo 6", "key.hotbar.7": "Objektujo 7", "key.hotbar.8": "Objektujo 8", "key.hotbar.9": "Objektujo 9", "key.inventory": "Mal-/fermi inventaron", "key.jump": "Salti", "key.keyboard.apostrophe": "'", "key.keyboard.backslash": "\\", "key.keyboard.backspace": "Retro-klavo", "key.keyboard.caps.lock": "FiksMajuskl", "key.keyboard.comma": ",", "key.keyboard.delete": "Foriga klavo", "key.keyboard.down": "Suben", "key.keyboard.end": "Finklavo", "key.keyboard.enter": "Eniga klavo", "key.keyboard.equal": "=", "key.keyboard.escape": "Eskapklavo", "key.keyboard.f1": "F1", "key.keyboard.f10": "F10", "key.keyboard.f11": "F11", "key.keyboard.f12": "F12", "key.keyboard.f13": "F13", "key.keyboard.f14": "F14", "key.keyboard.f15": "F15", "key.keyboard.f16": "F16", "key.keyboard.f17": "F17", "key.keyboard.f18": "F18", "key.keyboard.f19": "F19", "key.keyboard.f2": "F2", "key.keyboard.f20": "F20", "key.keyboard.f21": "F21", "key.keyboard.f22": "F22", "key.keyboard.f23": "F23", "key.keyboard.f24": "F24", "key.keyboard.f25": "F25", "key.keyboard.f3": "F3", "key.keyboard.f4": "F4", "key.keyboard.f5": "F5", "key.keyboard.f6": "F6", "key.keyboard.f7": "F7", "key.keyboard.f8": "F8", "key.keyboard.f9": "F9", "key.keyboard.grave.accent": "`", "key.keyboard.home": "Hejmen-klavo", "key.keyboard.insert": "Enmeta klavo", "key.keyboard.keypad.0": "Klavareta 0", "key.keyboard.keypad.1": "Klavareta 1", "key.keyboard.keypad.2": "Klavareta 2", "key.keyboard.keypad.3": "Klavareta 3", "key.keyboard.keypad.4": "Klavareta 4", "key.keyboard.keypad.5": "Klavareta 5", "key.keyboard.keypad.6": "Klavareta 6", "key.keyboard.keypad.7": "Klavareta 7", "key.keyboard.keypad.8": "Klavareta 8", "key.keyboard.keypad.9": "Klavareta 9", "key.keyboard.keypad.add": "Klavareta +", "key.keyboard.keypad.decimal": "On-punkto", "key.keyboard.keypad.divide": "Klavareta /", "key.keyboard.keypad.enter": "Klavareta enigo", "key.keyboard.keypad.equal": "Klavareta =", "key.keyboard.keypad.multiply": "Klavareta *", "key.keyboard.keypad.subtract": "Klavareta -", "key.keyboard.left": "Maldekstren", "key.keyboard.left.alt": "M-dksAlt", "key.keyboard.left.bracket": "[", "key.keyboard.left.control": "M-dksStir", "key.keyboard.left.shift": "M-DksMajuskl", "key.keyboard.left.win": "M-dks Win", "key.keyboard.menu": "Menuklavo", "key.keyboard.minus": "-", "key.keyboard.num.lock": "NomBask", "key.keyboard.page.down": "PĝSub", "key.keyboard.page.up": "PĝSup", "key.keyboard.pause": "Paŭzklavo", "key.keyboard.period": ".", "key.keyboard.print.screen": "Ekrankopia", "key.keyboard.right": "Dekstren", "key.keyboard.right.alt": "DksAlt", "key.keyboard.right.bracket": "]", "key.keyboard.right.control": "DksStir", "key.keyboard.right.shift": "DksMajuskl", "key.keyboard.right.win": "Dks Win", "key.keyboard.scroll.lock": "RulumBask", "key.keyboard.semicolon": ";", "key.keyboard.slash": "/", "key.keyboard.space": "Spaco", "key.keyboard.tab": "Taba klavo", "key.keyboard.unknown": "Malligita", "key.keyboard.up": "Supren", "key.keyboard.world.1": "Monda 1", "key.keyboard.world.2": "Monda 2", "key.left": "Flankpaŝi maldekstren", "key.loadToolbarActivator": "Ŝargi objektujaron", "key.mouse": "Butono %[1]s", "key.mouse.left": "M-dks butono", "key.mouse.middle": "Meza butono", "key.mouse.right": "Dks butono", "key.pickItem": "Elekti blokon", "key.playerlist": "Ludantolisto", "key.right": "Flankpaŝi dekstren", "key.saveToolbarActivator": "Konservi objektujaron", "key.screenshot": "Fari ekranbildon", "key.smoothCamera": "Baskuligi kinan kameraon", "key.sneak": "Kaŭri", "key.socialInteractions": "Ekrano de sociaj interagoj", "key.spectatorOutlines": "Emfazi la ludantojn (spektantoj)", "key.sprint": "Kuri", "key.swapOffhand": "Interŝanĝi objektojn inter la manoj", "key.togglePerspective": "Ŝanĝi perspektivon", "key.use": "Uzi objekton/meti blokon", "lanServer.otherPlayers": "Agordoj pri aliaj ludantoj", "lanServer.scanning": "Serĉado de ludoj en via lokreto", "lanServer.start": "Komenci lokretomondon", "lanServer.title": "Lokreta mondo", "language.code": "eo", "language.name": "Esperanto", "language.region": "Esperantujo", "lectern.take_book": "Preni libron", "menu.convertingLevel": "Konvertado de mondo", "menu.disconnect": "Malkonektiĝi", "menu.game": "Ludmenuo", "menu.generatingLevel": "Generado de la mondo", "menu.generatingTerrain": "Konstruado de tereno", "menu.loadingForcedChunks": "Ŝargado de pecaroj devigataj por dimensio %s", "menu.loadingLevel": "Ŝargado de la mondo", "menu.modded": " (kun modifoj)", "menu.multiplayer": "Pluraj ludantoj", "menu.online": "Minecraft Realms", "menu.options": "Agordoj...", "menu.paused": "Ludo paŭziĝis", "menu.playdemo": "Ludi demonstran mondon", "menu.preparingSpawn": "Preparado de aperejo: %s%%", "menu.quit": "Fermi la ludon", "menu.reportBugs": "Raporti erarojn", "menu.resetdemo": "Reagordi demonstran mondon", "menu.respawning": "Reaperado", "menu.returnToGame": "Reiri al la ludo", "menu.returnToMenu": "Konservi kaj reiri al la ĉefa menuo", "menu.savingChunks": "Konservado de pecaroj", "menu.savingLevel": "Konservado de la mondo", "menu.sendFeedback": "Prikomenti", "menu.shareToLan": "Malfermi al LAN", "menu.singleplayer": "Unu ludanto", "menu.working": "Laborado...", "merchant.current_level": "Nuna vendista nivelo", "merchant.deprecated": "Vilaĝanoj restokas ĝis du fojoj por tago.", "merchant.level.1": "Komencanto", "merchant.level.2": "Metilernanto", "merchant.level.3": "Submajstro", "merchant.level.4": "Spertulo", "merchant.level.5": "Majstro", "merchant.next_level": "Sekvanta vendista nivelo", "merchant.trades": "Ofertoj", "mirror.front_back": "↑ ↓", "mirror.left_right": "← →", "mirror.none": "|", "mount.onboard": "Premu %[1]s por desalti", "multiplayer.applyingPack": "Aplikado de la resurspakaĵo", "multiplayer.disconnect.authservers_down": "Aŭtentikigalaj serviloj malfunkciiĝas. Bonvolu provi denove pliposte, pardonu!", "multiplayer.disconnect.banned": "Vi estas forbarita de ĉi tiu servilo", "multiplayer.disconnect.banned.expiration": "\nVia forbaro leviĝos je %s", "multiplayer.disconnect.banned.reason": "Vi estas forbarita de ĉi tiu servilo.\nKialo: %s", "multiplayer.disconnect.banned_ip.expiration": "\nVia forbaro leviĝos je %s", "multiplayer.disconnect.banned_ip.reason": "Via IP-adreso estas forbarita de ĉi tiu servilo.\nKialo: %s", "multiplayer.disconnect.duplicate_login": "Vi ensalutis de alia loko", "multiplayer.disconnect.flying": "Flugado ne estas ebligita en ĉi tiu servilo", "multiplayer.disconnect.generic": "Malkonektita", "multiplayer.disconnect.idling": "Vi estis senaga tro longe!", "multiplayer.disconnect.illegal_characters": "Nevalidaj signoj en babilejo", "multiplayer.disconnect.incompatible": "Malkongrua kliento! Bonvolu uzi %s", "multiplayer.disconnect.invalid_entity_attacked": "Provante ataki malvalidan enton", "multiplayer.disconnect.invalid_packet": "La servilo sendis nevalidan paketon", "multiplayer.disconnect.invalid_player_data": "Nevalidaj datumoj de ludanto", "multiplayer.disconnect.invalid_player_movement": "Ricevinte malvalidan paketon de ludanta moviĝo", "multiplayer.disconnect.invalid_vehicle_movement": "Ricevinte malvalidan paketon de veturila moviĝo", "multiplayer.disconnect.ip_banned": "Via IP-adreso estas forbarita de ĉi tiu servilo", "multiplayer.disconnect.kicked": "Forpelita de operacianto", "multiplayer.disconnect.missing_tags": "Nekompleta priskribilaro riceviĝis de servilo.\nBonvolu kontakti serviloperacianton.", "multiplayer.disconnect.name_taken": "Tiu nomo jam estas prenita", "multiplayer.disconnect.not_whitelisted": "Vi ne blanklistas en ĉi tiu servilo!", "multiplayer.disconnect.outdated_client": "Malkongrua kliento! Bonvolu uzi %s", "multiplayer.disconnect.outdated_server": "Malkongrua kliento! Bonvolu uzi %s", "multiplayer.disconnect.server_full": "La servilo plenas!", "multiplayer.disconnect.server_shutdown": "Servilo malfermiĝis", "multiplayer.disconnect.slow_login": "La ensaluto tro longis", "multiplayer.disconnect.unexpected_query_response": "Neatenditaj agorditaj datumoj de kliento", "multiplayer.disconnect.unverified_username": "Uzantnomo ne kontroleblis!", "multiplayer.downloadingStats": "Elŝutado de statistikoj...", "multiplayer.downloadingTerrain": "Ŝargado de la tereno...", "multiplayer.message_not_delivered": "La babila mesaĝo ne livereblis, konsultu servilajn protokolojn: %s", "multiplayer.player.joined": "%s eniris la ludon", "multiplayer.player.joined.renamed": "%s (antaŭe konata kiel %s) eniris la ludon", "multiplayer.player.left": "%s eliris la ludon", "multiplayer.requiredTexturePrompt.disconnect": "La servilo postulas agorditan resurspakaĵon", "multiplayer.requiredTexturePrompt.line1": "Tiu ĉi servilo postulas la uzon de agordita resurspakaĵo.", "multiplayer.requiredTexturePrompt.line2": "Rifuzo de tiu agordita resurspakaĵo malkonektos vin de ĉi tiu servilo.", "multiplayer.socialInteractions.not_available": "Sociaj interagoj estas nur eblaj en multludantaj mondoj", "multiplayer.status.and_more": "... kaj %s pli ...", "multiplayer.status.cancelled": "Nuligita", "multiplayer.status.cannot_connect": "Ne eblis konektiĝi al la servilo", "multiplayer.status.cannot_resolve": "Ne eblis trovi servilon ligitan al la adreso", "multiplayer.status.finished": "Finita", "multiplayer.status.incompatible": "Malkongrua versio!", "multiplayer.status.no_connection": "(sen konekto)", "multiplayer.status.old": "Malnova", "multiplayer.status.ping": "%s ms", "multiplayer.status.pinging": "Eĥosondado...", "multiplayer.status.quitting": "Elirado", "multiplayer.status.request_handled": "Statusa peto estis pritraktita", "multiplayer.status.unknown": "???", "multiplayer.status.unrequested": "Ricevis nepetitan staton", "multiplayer.stopSleeping": "Ellitiĝi", "multiplayer.texturePrompt.failure.line1": "La servila resurspakaĵo ne aplikeblis", "multiplayer.texturePrompt.failure.line2": "Funkcioj, postulantaj agorditajn resurspakaĵojn, eble ne funkcios ĝuste", "multiplayer.texturePrompt.line1": "Tiu servilo rekomendas la uzon de agordita resurspakaĵo.", "multiplayer.texturePrompt.line2": "Ĉu vi volas elŝuti kaj instali ĝin aŭtomate?", "multiplayer.texturePrompt.serverPrompt": "%s\n\nMesaĝo de la servilo:\n%s", "multiplayer.title": "Pluraj ludantoj", "multiplayerWarning.check": "Ne montri ĉi tiun avizon denove", "multiplayerWarning.header": "Atento: Eksterliveranta retludado", "multiplayerWarning.message": "Atentu: Enreta ludado estas provizita de eksteraj liverantoj, kiuj estas nehavataj, neoperaciataj kaj nesuperrigardataj de Mojang Studios aŭ Microsoft. Ludante enrete, oni videblas nekontrolatan babilon aŭ aliajn tipojn de enhavo kreita de uzanto, kiujn eble ne taŭgas por ĉiu.", "narration.button": "Butono: %s", "narration.button.usage.focused": "Premu la klavon enigo por aktivigi", "narration.button.usage.hovered": "Klaku maldekstre por aktivigi", "narration.checkbox": "Flago: %s", "narration.checkbox.usage.focused": "Klaku la klavon enigo por transŝalti", "narration.checkbox.usage.hovered": "Klaku maldekstre por transŝalti", "narration.component_list.usage": "Premu la taban klavon por navigi vin al sekva elemento", "narration.cycle_button.usage.focused": "Premu la klavon enigo por transiri al %s", "narration.cycle_button.usage.hovered": "Klaku maldekstre por transiri al %s", "narration.edit_box": "Entajpu: %s", "narration.recipe": "Recepto por %s", "narration.recipe.usage": "Klaku maldekstre por elekti", "narration.recipe.usage.more": "Klaku dekstre por vidi pli da receptoj", "narration.selection.usage": "Premu la klavojn supren kaj malsupren por navigi vin inter variantoj", "narration.slider.usage.focused": "Premu la klavojn dekstren kaj maldekstren por agordi la valoron", "narration.slider.usage.hovered": "Movu la ŝovilon por agordi la valoron", "narration.suggestion": "Propono %s el %s estas elektita: %s", "narration.suggestion.tooltip": "Propono %s el %s estas elektita: %s (%s)", "narrator.button.accessibility": "Alirebleco", "narrator.button.difficulty_lock": "Ŝloso de facilnivelo", "narrator.button.difficulty_lock.locked": "Blokite", "narrator.button.difficulty_lock.unlocked": "Malblokite", "narrator.button.language": "Lingvo", "narrator.controls.bound": "%s estas bindita al %s", "narrator.controls.reset": "Butono %s estas forbindita", "narrator.controls.unbound": "%s ne estas bindita", "narrator.joining": "Aliĝado", "narrator.loading": "Ŝargado: %s", "narrator.loading.done": "Prete", "narrator.position.list": "Linio de listo numero %s el %s estas elektita", "narrator.position.object_list": "Elemento de linio numero %s el %s estas elektita", "narrator.position.screen": "Ekrana elemento numero %s el %s", "narrator.screen.title": "Ĉefa menuo", "narrator.screen.usage": "Uzu la muskursoron aŭ la taban klavon por elekti elementon", "narrator.select": "Elektite: %s", "narrator.select.world": "%s estas elektita, laste ludita: %s, %s, %s, versio: %s", "narrator.toast.disabled": "Rakontanto estas malaktivigita", "narrator.toast.enabled": "Rakontanto estas aktivigita", "optimizeWorld.confirm.description": "Ĉi tio provos optimumigi vian mondon per certigi, ke ĉiuj datumoj estas konservitaj en la luda formato plej nova. Ĉi tio povas preni tre longan tempon dependante de via mondo. Kiam finita, via mondo eble ruliĝos pli rapide sed ne plu kongruos kun versioj pli malnovaj de la ludo. Ĉu vi certe volas pluiri?", "optimizeWorld.confirm.title": "Optimumigi mondon", "optimizeWorld.info.converted": "Altgradigitaj pecaroj: %s", "optimizeWorld.info.skipped": "Preterlasitaj pecaroj: %s", "optimizeWorld.info.total": "Totalaj pecaroj: %s", "optimizeWorld.stage.counting": "Kalkulado de pecaroj...", "optimizeWorld.stage.failed": "Malsukceso! :(", "optimizeWorld.stage.finished": "Finiĝado...", "optimizeWorld.stage.upgrading": "Altgradigado de ĉiuj pecaroj...", "optimizeWorld.title": "Optimumigado de mondo \"%s\"", "options.accessibility.link": "Gvidilo pri alirebleco", "options.accessibility.text_background": "Teksta fono", "options.accessibility.text_background.chat": "Babilejo", "options.accessibility.text_background.everywhere": "Ĉie", "options.accessibility.text_background_opacity": "Tekstfona opakeco", "options.accessibility.title": "Alireblecaj agordoj...", "options.ao": "Glata lumigo", "options.ao.max": "Maksimuma", "options.ao.min": "Minimuma", "options.ao.off": "Ne", "options.attack.crosshair": "Cellinio", "options.attack.hotbar": "Objektujaro", "options.attackIndicator": "Atakindikilo", "options.autoJump": "Memsalto", "options.autoSuggestCommands": "Proponi komandojn", "options.biomeBlendRadius": "Miksi biomojn", "options.biomeBlendRadius.1": "Elŝaltita (plej rapida)", "options.biomeBlendRadius.11": "11×11 (ekstrema)", "options.biomeBlendRadius.13": "13×13 (afektula)", "options.biomeBlendRadius.15": "15×15 (maksimuma)", "options.biomeBlendRadius.3": "3×3 (rapida)", "options.biomeBlendRadius.5": "5×5 (normala)", "options.biomeBlendRadius.7": "7×7 (alta)", "options.biomeBlendRadius.9": "9×9 (tre alta)", "options.chat.color": "Koloroj", "options.chat.delay": "Babila prokrasto: %s sek", "options.chat.delay_none": "Babila prokrasto: nula", "options.chat.height.focused": "Alteco (malfermita)", "options.chat.height.unfocused": "Alteco (fermita)", "options.chat.line_spacing": "Linia interspaco", "options.chat.links": "Retligiloj", "options.chat.links.prompt": "Konfirmi ligilojn", "options.chat.opacity": "Babila opakeco", "options.chat.scale": "Grandeco de teksto", "options.chat.title": "Babilaj agordoj…", "options.chat.visibility": "Babilejo", "options.chat.visibility.full": "Videbla", "options.chat.visibility.hidden": "Kaŝita", "options.chat.visibility.system": "Nur komandoj", "options.chat.width": "Larĝeco", "options.chunks": "%s pecaroj", "options.clouds.fancy": "Bela", "options.clouds.fast": "Rapida", "options.controls": "Regiloj...", "options.customizeTitle": "Agordi mondon", "options.darkMojangStudiosBackgroundColor": "Unukolora logotipo", "options.darkMojangStudiosBackgroundColor.tooltip": "Ŝanĝas la koloron de la fono de la ŝarga ekrano \"Mojang Studios\" al nigro.", "options.difficulty": "Facilnivelo", "options.difficulty.easy": "Facila", "options.difficulty.hard": "Malfacila", "options.difficulty.hardcore": "Malfacilega", "options.difficulty.normal": "Normala", "options.difficulty.peaceful": "Paca", "options.discrete_mouse_scroll": "Viciĝita rulumado", "options.entityDistanceScaling": "Ento-distanco", "options.entityShadows": "Entombroj", "options.forceUnicodeFont": "Devigi Unikodan tiparon", "options.fov": "Vidangulo", "options.fov.max": "Ekstrema", "options.fov.min": "Normala", "options.fovEffectScale": "Vidangulaj efikoj", "options.fovEffectScale.tooltip": "Regas kiom la vidangulo povas ŝanĝiĝi pro rapidefikoj.", "options.framerate": "%s k/s", "options.framerateLimit": "Maksimuma bildrapido", "options.framerateLimit.max": "Senfina", "options.fullscreen": "Tutekrano", "options.fullscreen.current": "Nuna", "options.fullscreen.resolution": "Plenakrana rezolucio", "options.fullscreen.unavailable": "Agordo nehavebla", "options.gamma": "Heleco", "options.gamma.max": "Hela", "options.gamma.min": "Malhela", "options.generic_value": "%s: %s", "options.graphics": "Grafiko", "options.graphics.fabulous": "Fabela!", "options.graphics.fabulous.tooltip": "%s grafiko uzas ekranombrigilojn por bildigi veteron, nubojn kaj partiklojn malantaŭ diafanaj objektoj.\nĈi tio eblas grave influadi rendimenton sur aparatoj porteblaj kaj uzantaj 4K-ekranojn.", "options.graphics.fancy": "Bela", "options.graphics.fancy.tooltip": "Bela grafiko balancas rendimenton kaj kvaliton por la plejparto da maŝinoj.\nVetero, nuboj kaj partikloj eble ne aperas malantaŭ diafanaj blokoj aŭ akvo.", "options.graphics.fast": "Rapida", "options.graphics.fast.tooltip": "Rapida grafiko reduktas la kvanton de videbla pluvo kaj neĝo.\nTransvideblecaj efikoj estas malebligitaj por pluraj blokoj kiel folioj.", "options.graphics.warning.accept": "Daŭri sensubtene", "options.graphics.warning.cancel": "Reiri", "options.graphics.warning.message": "Via grafika aparato ŝajne ne subtenatas por la %s grafika opcio.\n\nVi povas ignori tion kaj daŭri, tamen subteno ne estos provizata por via aparato se vi uzos opcion de %s grafiko.", "options.graphics.warning.renderer": "Trovita bildigilo: [%s]", "options.graphics.warning.title": "Grafika aparato ne subtenatas", "options.graphics.warning.vendor": "Trovita vendisto: [%s]", "options.graphics.warning.version": "Trovita OpenGL-versio: [%s]", "options.guiScale": "Interfacoskalo", "options.guiScale.auto": "Aŭtomata", "options.hidden": "Kaŝita", "options.hideMatchedNames": "Kaŝi kongruajn nomojn", "options.hideMatchedNames.tooltip": "Eksterliverantaj serviloj povas sendi babilejo-mesaĝojn en nestandardaj formoj.\nSe ebligita, kaŝitaj ludantoj estos konformigitaj laŭ la nomoj de sendintoj.", "options.invertMouse": "Inversigi muson", "options.key.hold": "Deteni", "options.key.toggle": "Baskuligi", "options.language": "Lingvo...", "options.languageWarning": "Tradukoj eble ne estas 100%% precizaj", "options.mainHand": "Ĉefa mano", "options.mainHand.left": "Maldekstra", "options.mainHand.right": "Dekstra", "options.mipmapLevels": "Mipmapaj niveloj", "options.modelPart.cape": "Mantelo", "options.modelPart.hat": "Ĉapelo", "options.modelPart.jacket": "Jako", "options.modelPart.left_pants_leg": "Pantalono maldekstre", "options.modelPart.left_sleeve": "Maldekstra maniko", "options.modelPart.right_pants_leg": "Pantalono dekstre", "options.modelPart.right_sleeve": "Dekstra maniko", "options.mouseWheelSensitivity": "Sentemeco de rulumado", "options.mouse_settings": "Musopcioj...", "options.mouse_settings.title": "Musopcioj", "options.multiplayer.title": "Agordoj pri multaj ludantoj...", "options.narrator": "Rakontanto", "options.narrator.all": "Rakontas ĉion", "options.narrator.chat": "Rakontas babilejon", "options.narrator.notavailable": "Ne uzebla", "options.narrator.off": "Neaktiva", "options.narrator.system": "Rakontas sistemon", "options.off": "Ne", "options.off.composed": "%s: Ne", "options.on": "Jes", "options.on.composed": "%s: Jes", "options.particles": "Partikloj", "options.particles.all": "Ĉiuj", "options.particles.decreased": "Malmultaj", "options.particles.minimal": "Plej malmultaj", "options.percent_add_value": "%s: +%s%%", "options.percent_value": "%s: %s%%", "options.pixel_value": "%s: %s bdr", "options.rawMouseInput": "Rekta enigo", "options.realmsNotifications": "Realms-sciigoj", "options.reducedDebugInfo": "Malpli da erarinformoj", "options.renderClouds": "Nuboj", "options.renderDistance": "Bildiga distanco", "options.resourcepack": "Rimedpakaĵoj...", "options.screenEffectScale": "Distordaj efikoj", "options.screenEffectScale.tooltip": "Forto de distordaj ekranefikoj de naŭzo kaj submondportalo.\nJe pli malaltaj valoroj, la naŭza efiko anstataŭiĝas per verda plustavolo.", "options.sensitivity": "Sentemeco", "options.sensitivity.max": "LUMRAPIDO!!!", "options.sensitivity.min": "*oscedo*", "options.showSubtitles": "Montri subtekstojn", "options.skinCustomisation": "Agordo de la haŭto...", "options.skinCustomisation.title": "Agordo de la haŭto", "options.snooper": "Permesi snifadon", "options.snooper.desc": "Ni ĉiam volas plibonigi Minecraft, kaj por helpi nin fari tion, ni volus kolekti kelkajn informojn pri vi. Tio permesas nin scii kiun aparataron ni devas subteni, kaj kie la grandaj problemoj estas. Ili ankaŭ donas al ni ideon de la grandeco de nia aktiva ludantobazo, do ni scias ĉu ni estas faranta bone nian laboron. Vi povas vidi malsupren ĉiujn informojn ke ni kolektas pri vi. Se vi ne volas kolektadon, vi povas simple malaktivigi ĝin en la agordoj!", "options.snooper.title": "Donu al ni datumon!", "options.snooper.view": "Snifopcioj...", "options.sounds": "Muziko kaj sonoj...", "options.sounds.title": "Opcioj pri muziko kaj sonoj", "options.title": "Opcioj", "options.touchscreen": "Tuŝekrana reĝimo", "options.video": "Grafikopcioj...", "options.videoTitle": "Grafikopcioj", "options.viewBobbing": "Kaptremo", "options.visible": "Videbla", "options.vsync": "VSync", "pack.available.title": "Disponeblaj", "pack.copyFailure": "Pakaĵoj ne kopieblis", "pack.dropConfirm": "Ĉu vi volas aldoni sekvantajn pakaĵojn al Minecraft?", "pack.dropInfo": "Ŝovmeti dosierojn en la fenestron por aldoni pakaĵojn", "pack.folderInfo": "(Metu pakaĵujojn ĉi tien)", "pack.incompatible": "Malkongrua", "pack.incompatible.confirm.new": "Ĉi tiu pakaĵo estas farita por pli nova versio de Minecraft kaj eble ne plu funkcias ĝuste.", "pack.incompatible.confirm.old": "Ĉi tiu pakaĵo estas farita por pli malnova versio de Minecraft kaj eble ne plu funkcias ĝuste.", "pack.incompatible.confirm.title": "Ĉu vi certe volas ŝargi ĉi tiun pakaĵon?", "pack.incompatible.new": "(Kreita por pli nova versio de Minecraft)", "pack.incompatible.old": "(Kreita por pli malnova versio de Minecraft)", "pack.nameAndSource": "%s (%s)", "pack.openFolder": "Malfermi pakaĵujon", "pack.selected.title": "Elektitaj", "pack.source.builtin": "integrita", "pack.source.local": "loka", "pack.source.server": "servila", "pack.source.world": "monda", "parsing.bool.expected": "Anticipis buleon", "parsing.bool.invalid": "Nevalida buleo, anticipis \"true\" aŭ \"false\" sed trovis \"%s\"", "parsing.double.expected": "Anticipis duoblon", "parsing.double.invalid": "Nevalida duoblo \"%s\"", "parsing.expected": "Anticipis \"%s\"", "parsing.float.expected": "Anticipis glitkomon", "parsing.float.invalid": "Nevalida glitkomo \"%s\"", "parsing.int.expected": "Anticipis entjeron", "parsing.int.invalid": "Nevalida entjero '%s'", "parsing.long.expected": "Anticipis longnombron", "parsing.long.invalid": "Nevalida longnombro \"%s\"", "parsing.quote.escape": "Malvalida eskapsekvenco \"\\%s\" en la citita signovico", "parsing.quote.expected.end": "Senfermita citita signovico", "parsing.quote.expected.start": "Anticipis cito por komenci signovicon", "particle.notFound": "Nekonata partiklo: %s", "permissions.requires.entity": "Ento bezoniĝas por lanĉi tiun konandon ĉi tie", "permissions.requires.player": "Ludanto bezoniĝas por lanĉi tiun konandon ĉi tie", "potion.potency.1": "II", "potion.potency.2": "III", "potion.potency.3": "IV", "potion.potency.4": "V", "potion.potency.5": "VI", "potion.whenDrank": "Kiam trinkita:", "potion.withAmplifier": "%s %s", "potion.withDuration": "%s (%s)", "predicate.unknown": "Nekonata predikato: %s", "realms.missing.module.error.text": "Realms ne malfermeblas nun, bonvolu reprovi poste", "realms.missing.snapshot.error.text": "Realms nuntempe ne estas subtenataj en provoversioj", "recipe.notFound": "Nekonata recepto: %s", "recipe.toast.description": "Vidu vian receptlibron", "recipe.toast.title": "Novaj uzeblaj receptoj!", "record.nowPlaying": "Nun ludas: %s", "resourcePack.broken_assets": "DIFEKTITAJ HAVAĴOJ ESTAS DETEKTITAJ", "resourcePack.load_fail": "Reŝargado de rimedoj malsukcesis", "resourcePack.server.name": "Mondspecifaj rimedoj", "resourcePack.title": "Elekti resurspakaĵojn", "resourcePack.vanilla.description": "La defaŭltaj rimedoj por Minecraft", "resourcepack.downloading": "Elŝutado de resurspakaĵo", "resourcepack.progress": "Elŝutado de dosiero (%s MB)...", "resourcepack.requesting": "Kreado de peto...", "screenshot.failure": "Ekranbildo ne konserveblis: %s", "screenshot.success": "La ekranbildo konserviĝis kiel %s", "selectServer.add": "Aldoni servilon", "selectServer.defaultName": "Minecraft-servilo", "selectServer.delete": "Forigi", "selectServer.deleteButton": "Forigi", "selectServer.deleteQuestion": "Ĉu vi certas, ke vi volas forigi ĉi tiun servilon?", "selectServer.deleteWarning": "'%s' estos perdita eterne! (Dum longa tempo!)", "selectServer.direct": "Rekta konekto", "selectServer.edit": "Redakti", "selectServer.hiddenAddress": "(Kaŝita)", "selectServer.refresh": "Aktualigi", "selectServer.select": "Eniri la servilon", "selectServer.title": "Elekto de servilo", "selectWorld.access_failure": "La mondo ne alireblis", "selectWorld.allowCommands": "Permesi trompaĵojn", "selectWorld.allowCommands.info": "Komandoj kiel /gamemode, /experience", "selectWorld.backupEraseCache": "Viŝi kaŝmemorigitajn datumojn", "selectWorld.backupJoinConfirmButton": "Krei sekurkopion kaj ŝargi", "selectWorld.backupJoinSkipButton": "Mi scias kion mi faras!", "selectWorld.backupQuestion.customized": "Agorditaj mondoj ne plu estas subtenataj", "selectWorld.backupQuestion.downgrade": "Ni ne subtenas konvertadon de mondo en pli malnovan version", "selectWorld.backupQuestion.experimental": "Mondoj uzantaj eksperimentajn agordojn ne subteniĝas", "selectWorld.backupQuestion.snapshot": "Ĉu vi vere volas ŝargi tiun ĉi mondon?", "selectWorld.backupWarning.customized": "Bedaŭrinde, ni ne subtenas agorditajn mondojn en ĉi tiu versio de Minecraft. Ni ankoraŭ povas ŝargi ĉi tiun mondon kaj lasi ĉion kiel antaŭe, sed ajna novkreita tereno ne plu estos agordita. Ni pardonpetas pro la ĝeno!", "selectWorld.backupWarning.downgrade": "Tiun mondon lastafoje oni ludis en la versio %s; vi uzas la version %s. Konvertado de mondo eble kaŭzos difekton - ni ne povas garantii, ke ĝi ŝargiĝos aŭ funkcios. Se vi malgraŭe volas daŭrigi, bonvolu fari sekurkopion!", "selectWorld.backupWarning.experimental": "Ĉi tiu mondo uzas eksperimentajn agordojn, kiuj eble ekmalfunkcios iam ajn. Ni ne povas garantii, ke ĝi ŝargos aŭ funkcios. Gardu vin!", "selectWorld.backupWarning.snapshot": "Ĉi-mondo estas laste konservita en versio %s, vi nun ludas versio %s. Bonvolu fari savkopion por protekti la mondon kontaŭ difektoj!", "selectWorld.bonusItems": "Donaca kofro", "selectWorld.cheats": "Trompaĵoj", "selectWorld.conversion": "Devas esti konvertita!", "selectWorld.create": "Krei novan mondon", "selectWorld.createDemo": "Ludi novan demonstran mondon", "selectWorld.customizeType": "Agordi", "selectWorld.dataPacks": "Datumpakaĵoj", "selectWorld.data_read": "Legado de mondo-datumoj...", "selectWorld.delete": "Forigi", "selectWorld.deleteButton": "Forigi", "selectWorld.deleteQuestion": "Ĉu vi certas, ke vi volas forigi ĉi tiun mondon?", "selectWorld.deleteWarning": "\"%s\" estos perdita eterne! (Dum longa tempo!)", "selectWorld.delete_failure": "La mondo ne forigeblis", "selectWorld.edit": "Redakti", "selectWorld.edit.backup": "Savkopii", "selectWorld.edit.backupCreated": "Savkopiis: %s", "selectWorld.edit.backupFailed": "Sekurkopio malsukcesis", "selectWorld.edit.backupFolder": "Malfermi la savdosierujon", "selectWorld.edit.backupSize": "Grandeco: %s MB", "selectWorld.edit.export_worldgen_settings": "Eksporti agordojn de mondgenerado", "selectWorld.edit.export_worldgen_settings.failure": "Eksportado malsukcesis", "selectWorld.edit.export_worldgen_settings.success": "Eksportite", "selectWorld.edit.openFolder": "Malfermi la mondan dosierujon", "selectWorld.edit.optimize": "Optimumigi mondon", "selectWorld.edit.resetIcon": "Nuligi la bildeton", "selectWorld.edit.save": "Konservi", "selectWorld.edit.title": "Redakti mondon", "selectWorld.enterName": "Nomo de la mondo", "selectWorld.enterSeed": "Semaĵo por la mondogenerilo", "selectWorld.futureworld.error.text": "Io misfunkciis dum provo ŝargi mondon el posta versio. Tio estis riska operacio, pardonu, ke ĝi ne sukcesis.", "selectWorld.futureworld.error.title": "Eraro okazis!", "selectWorld.gameMode": "Ludreĝimo", "selectWorld.gameMode.adventure": "Aventura", "selectWorld.gameMode.adventure.line1": "Same kiel la traviva reĝimo, sed ne eblas", "selectWorld.gameMode.adventure.line2": "meti aŭ forigi blokojn", "selectWorld.gameMode.creative": "Krea", "selectWorld.gameMode.creative.line1": "Senfinaj krudmaterialoj, flugado kaj", "selectWorld.gameMode.creative.line2": "tuja detruo de blokoj", "selectWorld.gameMode.hardcore": "Malfacilega", "selectWorld.gameMode.hardcore.line1": "Same kiel la traviva reĝimo, sed kun la pleja malfacileco,", "selectWorld.gameMode.hardcore.line2": "kaj la mondo detruiĝos post morto", "selectWorld.gameMode.spectator": "Spektanta", "selectWorld.gameMode.spectator.line1": "Vi povas rigardi sed ne tuŝi", "selectWorld.gameMode.survival": "Traviva", "selectWorld.gameMode.survival.line1": "Serĉu krudmaterialojn, konstruu ilojn,", "selectWorld.gameMode.survival.line2": "kolektu sperton kaj batalu por travivi", "selectWorld.gameRules": "Ludreguloj", "selectWorld.import_worldgen_settings": "Importi agordojn", "selectWorld.import_worldgen_settings.deprecated.question": "Iuj uzataj trajtoj estas evitindaj kaj ekmalfunkcios en la futuro. Ĉu pluiri?", "selectWorld.import_worldgen_settings.deprecated.title": "Averto! Ĉi tiuj agordoj uzas evitindajn trajtojn", "selectWorld.import_worldgen_settings.experimental.question": "Tiuj agordoj estas eksperimentaj kaj eble ekmalfunkcios iutage. Ĉu vi volas pluiri?", "selectWorld.import_worldgen_settings.experimental.title": "Averto! Tiuj agordoj uzas eksperimentajn trajtojn", "selectWorld.import_worldgen_settings.failure": "Eraro dum importado de agordoj", "selectWorld.import_worldgen_settings.select_file": "Elektu dosieron de agordoj (.json)", "selectWorld.load_folder_access": "Dosierujo de savitaj ludmondoj nek legeblas nek alireblas!", "selectWorld.locked": "Blokita de alia rulanta fenestro de Minecraft", "selectWorld.mapFeatures": "Generi strukturojn", "selectWorld.mapFeatures.info": "Vilaĝoj, karceroj, ktp.", "selectWorld.mapType": "Mondotipo", "selectWorld.mapType.normal": "Normala", "selectWorld.moreWorldOptions": "Pli da mondopcioj...", "selectWorld.newWorld": "Nova mondo", "selectWorld.pre_worldheight": "Ŝargado de mondoj kun pligrandigita alteco estas malebligita.", "selectWorld.recreate": "Rekrei", "selectWorld.recreate.customized.text": "Agorditaj mondoj ne plu estas subtenataj en ĉi tiu versio de Minecraft. Ni povas provi rekrei ĝin kun la samaj semaĵo kaj ecoj, sed ĉiuj terenaj agordoj estos perdita. Pardonu la malkomforton!", "selectWorld.recreate.customized.title": "Agorditaj mondoj ne plu estas subtenataj", "selectWorld.recreate.error.text": "Io malfunkciis kiam provi rekrei mondon.", "selectWorld.recreate.error.title": "Eraro okazis!", "selectWorld.resultFolder": "Konservote en:", "selectWorld.search": "serĉi mondojn", "selectWorld.seedInfo": "Lasi malplena por hazarda semaĵo", "selectWorld.select": "Ludi elektitan mondon", "selectWorld.title": "Elekti mondon", "selectWorld.tooltip.fromNewerVersion1": "La mondo estis konservita per pli nova versio,", "selectWorld.tooltip.fromNewerVersion2": "ŝargi tiun mondon eble povas kaŭzi problemojn!", "selectWorld.tooltip.snapshot1": "Ne forgesu sekurkopii ĉi tiun mondon", "selectWorld.tooltip.snapshot2": "antaŭ ol vi ŝargas ĝin per ĉi tiu provoversio.", "selectWorld.unable_to_load": "Mondoj ne ŝargeblas", "selectWorld.version": "Versio:", "selectWorld.versionJoinButton": "Ŝargi malgraŭe", "selectWorld.versionQuestion": "Ĉu vi vere volas ŝargi tiun ĉi mondon?", "selectWorld.versionUnknown": "nekonata", "selectWorld.versionWarning": "Ĉi tiu mondo estis laste ludata en versio %s kaj ŝargi ĝin en ĉi tiu versio povus difekti ĝin!", "selectWorld.world": "Mondo", "sign.edit": "Redakti ŝildetmesaĝon", "sleep.not_possible": "Neniom da ripozo povas pasigi la nokton", "sleep.players_sleeping": "%s/%s ludantoj dormas", "sleep.skipping_night": "Pasigado de la nokto", "slot.unknown": "Nekonata ujo '%s'", "soundCategory.ambient": "Ĉirkaŭaĵa/Biomedia", "soundCategory.block": "Blokoj", "soundCategory.hostile": "Malamikaj bestoj", "soundCategory.master": "Precipa laŭteco", "soundCategory.music": "Muziko", "soundCategory.neutral": "Amikaj bestoj", "soundCategory.player": "Ludantoj", "soundCategory.record": "Muzikaj blokoj", "soundCategory.voice": "Voĉo/Parolado", "soundCategory.weather": "Vetero", "spectatorMenu.close": "Fermi menuon", "spectatorMenu.next_page": "Sekvanta paĝo", "spectatorMenu.previous_page": "Antaŭa paĝo", "spectatorMenu.root.prompt": "Premu butonon por elekti komandon kaj denove por uzi ĝin.", "spectatorMenu.team_teleport": "Teleportiĝi al teamano", "spectatorMenu.team_teleport.prompt": "Elektu teamon, al kiu teleportiĝi", "spectatorMenu.teleport": "Teleportiĝi al ludanto", "spectatorMenu.teleport.prompt": "Elektu ludanton, al kiu teleportiĝi", "stat.generalButton": "Ĝeneraloj", "stat.itemsButton": "Aĵoj", "stat.minecraft.animals_bred": "Bestoj breditaj", "stat.minecraft.aviate_one_cm": "Distanco per elitroj", "stat.minecraft.bell_ring": "Sonoriloj sonitaj", "stat.minecraft.boat_one_cm": "Distanco per boato", "stat.minecraft.clean_armor": "Ekipaĵoj purigitaj", "stat.minecraft.clean_banner": "Purigitaj standardoj", "stat.minecraft.clean_shulker_box": "Purigitaj skatoloj de ŝulkroj", "stat.minecraft.climb_one_cm": "Grimpodistanco", "stat.minecraft.crouch_one_cm": "Kaŝirdistanco", "stat.minecraft.damage_absorbed": "Damaĝoj sorbitaj", "stat.minecraft.damage_blocked_by_shield": "Damaĝoj blokitaj per ŝildo", "stat.minecraft.damage_dealt": "Damaĝoj faritaj", "stat.minecraft.damage_dealt_absorbed": "Damaĝoj faritaj (sorbitaj)", "stat.minecraft.damage_dealt_resisted": "Damaĝoj faritaj (rezistitaj)", "stat.minecraft.damage_resisted": "Damaĝoj rezistitaj", "stat.minecraft.damage_taken": "Damaĝoj ricevitaj", "stat.minecraft.deaths": "Nombro da mortoj", "stat.minecraft.drop": "Ŝutitaj aĵoj", "stat.minecraft.eat_cake_slice": "Manĝitaj kuktranĉaĵoj", "stat.minecraft.enchant_item": "Sorĉitaj aĵoj", "stat.minecraft.fall_one_cm": "Faldistanco", "stat.minecraft.fill_cauldron": "Plenigitaj kaldronoj", "stat.minecraft.fish_caught": "Fiŝoj kaptitaj", "stat.minecraft.fly_one_cm": "Flugdistanco", "stat.minecraft.horse_one_cm": "Distanco per ĉevalo", "stat.minecraft.inspect_dispenser": "Ĵetiloj traserĉitaj", "stat.minecraft.inspect_dropper": "Doniloj traserĉitaj", "stat.minecraft.inspect_hopper": "Funeloj traserĉitaj", "stat.minecraft.interact_with_anvil": "Interagoj kun amboso", "stat.minecraft.interact_with_beacon": "Interagoj kun lumstriilo", "stat.minecraft.interact_with_blast_furnace": "Interagoj kun altforno", "stat.minecraft.interact_with_brewingstand": "Interagoj kun eliksira farilo", "stat.minecraft.interact_with_campfire": "Interagoj kun tendarfajro", "stat.minecraft.interact_with_cartography_table": "Interagoj kun kartografitablo", "stat.minecraft.interact_with_crafting_table": "Interagoj kun labortablo", "stat.minecraft.interact_with_furnace": "Interagoj kun forno", "stat.minecraft.interact_with_grindstone": "Interagoj kun akrigilo", "stat.minecraft.interact_with_lectern": "Interagoj kun libropupitro", "stat.minecraft.interact_with_loom": "Interagoj kun teksilo", "stat.minecraft.interact_with_smithing_table": "Interagoj kun fandtablo", "stat.minecraft.interact_with_smoker": "Interagoj kun fumilo", "stat.minecraft.interact_with_stonecutter": "Interagoj kun ŝtontranĉilo", "stat.minecraft.jump": "Saltoj", "stat.minecraft.junk_fished": "Rubaĵoj kaptitaj", "stat.minecraft.leave_game": "Ludoj forlasitaj", "stat.minecraft.minecart_one_cm": "Distanco per vagoneto", "stat.minecraft.mob_kills": "Moboj mortigitaj", "stat.minecraft.open_barrel": "Malfermitaj bareloj", "stat.minecraft.open_chest": "Malfermitaj kofroj", "stat.minecraft.open_enderchest": "Malfermitaj finejkofroj", "stat.minecraft.open_shulker_box": "Malfermitaj skatoloj de ŝulkro", "stat.minecraft.pig_one_cm": "Distanco per porko", "stat.minecraft.play_noteblock": "Ludigitaj notblokoj", "stat.minecraft.play_record": "Sondiskoj luditaj", "stat.minecraft.play_time": "Tempo ludita", "stat.minecraft.player_kills": "Ludantoj mortigitaj", "stat.minecraft.pot_flower": "Kreskaĵoj plantitaj en potojn", "stat.minecraft.raid_trigger": "Invadoj komencitaj", "stat.minecraft.raid_win": "Invadoj venkitaj", "stat.minecraft.ring_bell": "Sonoriloj sonitaj", "stat.minecraft.sleep_in_bed": "Dormoj en lito", "stat.minecraft.sneak_time": "Kaŭrotempo", "stat.minecraft.sprint_one_cm": "Kurdistanco", "stat.minecraft.strider_one_cm": "Distanco per lafpaŝanto", "stat.minecraft.swim_one_cm": "Naĝdistanco", "stat.minecraft.talked_to_villager": "Ekparoloj al vilaĝanoj", "stat.minecraft.target_hit": "Trafitaj pafceloj", "stat.minecraft.time_since_death": "Tempo ekde lasta morto", "stat.minecraft.time_since_rest": "Tempo ekde lasta dormeto", "stat.minecraft.total_world_time": "Tempo en la mondo", "stat.minecraft.traded_with_villager": "Negocoj kun vilaĝanoj", "stat.minecraft.treasure_fished": "Trezoroj kaptitaj", "stat.minecraft.trigger_trapped_chest": "Ekagigitaj baskulkofroj", "stat.minecraft.tune_noteblock": "Agorditaj notblokoj", "stat.minecraft.use_cauldron": "Akvo prenita de kaldronoj", "stat.minecraft.walk_on_water_one_cm": "Marŝdistanco sur akvo", "stat.minecraft.walk_one_cm": "Marŝdistanco", "stat.minecraft.walk_under_water_one_cm": "Marŝdistanco sub akvo", "stat.mobsButton": "Moboj", "stat_type.minecraft.broken": "Detruitaj", "stat_type.minecraft.crafted": "Kreitaj", "stat_type.minecraft.dropped": "Ŝutitaj", "stat_type.minecraft.killed": "Vi mortigis %s %s(j)n", "stat_type.minecraft.killed.none": "Vi neniam mortigis %sn", "stat_type.minecraft.killed_by": "%s mortigis vin %s-foje", "stat_type.minecraft.killed_by.none": "Vi neniam estis mortigita de %s", "stat_type.minecraft.mined": "Minitaj", "stat_type.minecraft.picked_up": "Prenitaj", "stat_type.minecraft.used": "Uzitaj", "stats.tooltip.type.statistic": "Statistiko", "structure_block.button.detect_size": "DETEKTI", "structure_block.button.load": "ŜARGI", "structure_block.button.save": "KONSERVI", "structure_block.custom_data": "Agordita nomo de datuma priskribilo", "structure_block.detect_size": "Detekti strukturo grandeco kaj pozicio:", "structure_block.hover.corner": "Angulo: %s", "structure_block.hover.data": "Datumoj: %s", "structure_block.hover.load": "Ŝargi: %s", "structure_block.hover.save": "Konservi: %s", "structure_block.include_entities": "Inkludi entojn:", "structure_block.integrity": "Struktura integreco kaj semaĵo", "structure_block.integrity.integrity": "Strukturintegreco", "structure_block.integrity.seed": "Struktursemaĵo", "structure_block.invalid_structure_name": "Nevalida strukturnomo \"%s\"", "structure_block.load_not_found": "Strukturo \"%s\" estas maldisponebla", "structure_block.load_prepare": "Pozicio de strukturo \"%s\" estas preta", "structure_block.load_success": "Strukturo ŝargita de \"%s\"", "structure_block.mode.corner": "Angulo", "structure_block.mode.data": "Datumoj", "structure_block.mode.load": "Ŝargi", "structure_block.mode.save": "Konservi", "structure_block.mode_info.corner": "Angula reĝimo – indikilo de allokigo kaj grandeco", "structure_block.mode_info.data": "Datuma reĝimo – indikilo de ludlogiko", "structure_block.mode_info.load": "Ŝarĝa reĝimo – ŝarĝi de dosiero", "structure_block.mode_info.save": "Konserva reĝimo – skribi al dosiero", "structure_block.position": "Relativa pozicio", "structure_block.position.x": "relativa pozicio x", "structure_block.position.y": "relativa pozicio y", "structure_block.position.z": "relativa pozicio z", "structure_block.save_failure": "La strukturo \"%s\" ne konserveblas", "structure_block.save_success": "La strukturo konserviĝis kiel \"%s\"", "structure_block.show_air": "Montri nevideblajn blokojn:", "structure_block.show_boundingbox": "Montri limigan kofron:", "structure_block.size": "Struktura grandeco", "structure_block.size.x": "strukturdimensio x", "structure_block.size.y": "strukturdimensio y", "structure_block.size.z": "strukturdimensio z", "structure_block.size_failure": "Dimensio de la strukturo ne eltroveblas. Aldonu angulojn kun akordantaj strukturnomoj", "structure_block.size_success": "Grando por \"%s\" estas detektita sukcese", "structure_block.structure_name": "Strukturnomo", "subtitles.ambient.cave": "Tremiga bruo", "subtitles.block.amethyst_block.chime": "Ametisto tintas", "subtitles.block.anvil.destroy": "Amboso detruiĝis", "subtitles.block.anvil.land": "Amboso alteriĝis", "subtitles.block.anvil.use": "Amboso uziĝis", "subtitles.block.barrel.close": "Barelo fermiĝas", "subtitles.block.barrel.open": "Barelo malfermiĝas", "subtitles.block.beacon.activate": "Lumstriilo aktiviĝas", "subtitles.block.beacon.ambient": "Lumstriilo zumas", "subtitles.block.beacon.deactivate": "Lumstriilo malaktiviĝas", "subtitles.block.beacon.power_select": "Lumstriilpovo elektiĝas", "subtitles.block.beehive.drip": "Mielo gutas", "subtitles.block.beehive.enter": "Abelo eniras abelujon", "subtitles.block.beehive.exit": "Abelo eliras abelujon", "subtitles.block.beehive.shear": "Tondilo skrapas", "subtitles.block.beehive.work": "Abeloj laboras", "subtitles.block.bell.resonate": "Sonorilo resonas", "subtitles.block.bell.use": "Sonorilo tintas", "subtitles.block.big_dripleaf.tilt_down": "Gutfolio kliniĝas", "subtitles.block.big_dripleaf.tilt_up": "Gutfolio releviĝas", "subtitles.block.blastfurnace.fire_crackle": "Altforno krakas", "subtitles.block.brewing_stand.brew": "Eliksira farilo bobelas", "subtitles.block.bubble_column.bubble_pop": "Bobeloj krevas", "subtitles.block.bubble_column.upwards_ambient": "Bobeloj fluas", "subtitles.block.bubble_column.upwards_inside": "Bobeloj susuras", "subtitles.block.bubble_column.whirlpool_ambient": "Bobeloj kirlas", "subtitles.block.bubble_column.whirlpool_inside": "Bobeloj malsuprentiras", "subtitles.block.button.click": "Butono klakas", "subtitles.block.cake.add_candle": "Kuko plaŭdas", "subtitles.block.campfire.crackle": "Tendarfajro krakas", "subtitles.block.candle.crackle": "Kandelo krakas", "subtitles.block.chest.close": "Kofro fermiĝas", "subtitles.block.chest.locked": "Kofro ŝlosiĝita", "subtitles.block.chest.open": "Kofro malfermiĝas", "subtitles.block.chorus_flower.death": "Refrena floro forvelkas", "subtitles.block.chorus_flower.grow": "Refrena floro kreskas", "subtitles.block.comparator.click": "Komparilo klakas", "subtitles.block.composter.empty": "Kompoŝtujo malpleniĝas", "subtitles.block.composter.fill": "Kompoŝtujo pleniĝas", "subtitles.block.composter.ready": "Kompoŝtujo kompoŝtas", "subtitles.block.conduit.activate": "Markondukto aktiviĝas", "subtitles.block.conduit.ambient": "Markondukto pulsas", "subtitles.block.conduit.attack.target": "Markondukto atakas", "subtitles.block.conduit.deactivate": "Markondukto malaktiviĝas", "subtitles.block.dispenser.dispense": "Objekto ĵetiĝis", "subtitles.block.dispenser.fail": "Ĵetilo malsukcesis", "subtitles.block.door.toggle": "Pordo knaras", "subtitles.block.enchantment_table.use": "Sorĉtablo uziĝis", "subtitles.block.end_portal.spawn": "Finejportalo malfermiĝas", "subtitles.block.end_portal_frame.fill": "Finejokulo almetiĝas", "subtitles.block.fence_gate.toggle": "Barilpordo knaras", "subtitles.block.fire.ambient": "Fajro krakas", "subtitles.block.fire.extinguish": "Fajro estingiĝis", "subtitles.block.furnace.fire_crackle": "Forno krakas", "subtitles.block.generic.break": "Bloko rompiĝis", "subtitles.block.generic.footsteps": "Paŝoj", "subtitles.block.generic.hit": "Bloko rompiĝas", "subtitles.block.generic.place": "Bloko metiĝis", "subtitles.block.grindstone.use": "Akrigilo uziĝis", "subtitles.block.honey_block.slide": "Glitado laŭ mielbloko", "subtitles.block.iron_trapdoor.close": "Klappordo fermiĝis", "subtitles.block.iron_trapdoor.open": "Klappordo malfermiĝis", "subtitles.block.lava.ambient": "Lafo bobelas", "subtitles.block.lava.extinguish": "Lafo siblas", "subtitles.block.lever.click": "Levilo klakas", "subtitles.block.note_block.note": "Notbloko ludas", "subtitles.block.piston.move": "Piŝto movas", "subtitles.block.pointed_dripstone.drip_lava": "Lafo gutas", "subtitles.block.pointed_dripstone.drip_lava_into_cauldron": "Lafo gutas en kaldronon", "subtitles.block.pointed_dripstone.drip_water": "Akvo gutas", "subtitles.block.pointed_dripstone.drip_water_into_cauldron": "Akvo gutas en kaldronon", "subtitles.block.pointed_dripstone.land": "Stalaktito falegas", "subtitles.block.portal.ambient": "Portalo susuras", "subtitles.block.portal.travel": "Portalbruo malplilaŭtiĝas", "subtitles.block.portal.trigger": "Portalbruo plilaŭtiĝas", "subtitles.block.pressure_plate.click": "Premplato klakas", "subtitles.block.pumpkin.carve": "Tondilo tajlas", "subtitles.block.redstone_torch.burnout": "Torĉo fuzas", "subtitles.block.respawn_anchor.ambient": "Portalo susuras", "subtitles.block.respawn_anchor.charge": "Reaperankro estas ŝargita", "subtitles.block.respawn_anchor.deplete": "Reaperankro elĉerpiĝas", "subtitles.block.respawn_anchor.set_spawn": "Reaperankro ŝanĝas aperejon", "subtitles.block.sculk_sensor.clicking": "Skulka sensoro komencas klaki", "subtitles.block.sculk_sensor.clicking_stop": "Skulka sensoro ĉesas klaki", "subtitles.block.shulker_box.close": "Ŝulkro fermiĝas", "subtitles.block.shulker_box.open": "Ŝulkro malfermiĝas", "subtitles.block.smithing_table.use": "Fandtablo uziĝis", "subtitles.block.smoker.smoke": "Fumilo fumaĵas", "subtitles.block.sweet_berry_bush.pick_berries": "Beroj kraketas", "subtitles.block.trapdoor.toggle": "Klappordo knaras", "subtitles.block.tripwire.attach": "Insiddrato alfiksas", "subtitles.block.tripwire.click": "Insiddrato klakas", "subtitles.block.tripwire.detach": "Insiddrato malfiksas", "subtitles.block.water.ambient": "Akvo fluas", "subtitles.enchant.thorns.hit": "Dornoj pikas", "subtitles.entity.armor_stand.fall": "Armaĵo falis", "subtitles.entity.arrow.hit": "Sago trafas", "subtitles.entity.arrow.hit_player": "Ludanto trafiĝis", "subtitles.entity.arrow.shoot": "Sago pafiĝis", "subtitles.entity.axolotl.attack": "Aksolotlo atakas", "subtitles.entity.axolotl.death": "Aksolotlo mortas", "subtitles.entity.axolotl.hurt": "Aksolotlo vundiĝas", "subtitles.entity.axolotl.idle_air": "Aksolotlo pepas", "subtitles.entity.axolotl.idle_water": "Aksolotlo pepas", "subtitles.entity.axolotl.splash": "Aksolotlo surŝprucigas", "subtitles.entity.axolotl.swim": "Aksolotlo naĝas", "subtitles.entity.bat.ambient": "Vesperto kriĉas", "subtitles.entity.bat.death": "Vesperto mortas", "subtitles.entity.bat.hurt": "Vesperto vundiĝas", "subtitles.entity.bat.takeoff": "Vesperto ekflugas", "subtitles.entity.bee.ambient": "Abelo zumas", "subtitles.entity.bee.death": "Abelo mortas", "subtitles.entity.bee.hurt": "Abelo vundiĝas", "subtitles.entity.bee.loop": "Abelo zumas", "subtitles.entity.bee.loop_aggressive": "Abelo zumas kolere", "subtitles.entity.bee.pollinate": "Abelo zumas ĝoje", "subtitles.entity.bee.sting": "Abelo pikas", "subtitles.entity.blaze.ambient": "Incendio spiras", "subtitles.entity.blaze.burn": "Incendio krakas", "subtitles.entity.blaze.death": "Incendio mortas", "subtitles.entity.blaze.hurt": "Incendio vundiĝas", "subtitles.entity.blaze.shoot": "Incendio pafas", "subtitles.entity.boat.paddle_land": "Remado", "subtitles.entity.boat.paddle_water": "Remado", "subtitles.entity.cat.ambient": "Kato miaŭas", "subtitles.entity.cat.beg_for_food": "Kato petas", "subtitles.entity.cat.death": "Kato mortas", "subtitles.entity.cat.eat": "Kato manĝas", "subtitles.entity.cat.hiss": "Kato siblas", "subtitles.entity.cat.hurt": "Kato vundiĝas", "subtitles.entity.cat.purr": "Kato ronronas", "subtitles.entity.chicken.ambient": "Koko klukas", "subtitles.entity.chicken.death": "Koko mortas", "subtitles.entity.chicken.egg": "Koko demetas ovon", "subtitles.entity.chicken.hurt": "Koko vundiĝas", "subtitles.entity.cod.death": "Moruo mortas", "subtitles.entity.cod.flop": "Moruo saltetas", "subtitles.entity.cod.hurt": "Moruo vundiĝas", "subtitles.entity.cow.ambient": "Bovo muĝas", "subtitles.entity.cow.death": "Bovo mortas", "subtitles.entity.cow.hurt": "Bovo vundiĝas", "subtitles.entity.cow.milk": "Bovo melkiĝas", "subtitles.entity.creeper.death": "Kripero mortas", "subtitles.entity.creeper.hurt": "Kripero vundiĝas", "subtitles.entity.creeper.primed": "Kripero siblas", "subtitles.entity.dolphin.ambient": "Delfeno pepas", "subtitles.entity.dolphin.ambient_water": "Delfeno fajfas", "subtitles.entity.dolphin.attack": "Delfeno atakas", "subtitles.entity.dolphin.death": "Delfeno mortas", "subtitles.entity.dolphin.eat": "Delfeno manĝas", "subtitles.entity.dolphin.hurt": "Delfeno vundiĝas", "subtitles.entity.dolphin.jump": "Delfeno saltas", "subtitles.entity.dolphin.play": "Delfeno ludas", "subtitles.entity.dolphin.splash": "Delfeno surŝprucigas", "subtitles.entity.dolphin.swim": "Delfeno naĝas", "subtitles.entity.donkey.ambient": "Azeno blekas", "subtitles.entity.donkey.angry": "Azeno henas", "subtitles.entity.donkey.chest": "Azenokofro ekipiĝas", "subtitles.entity.donkey.death": "Azeno mortas", "subtitles.entity.donkey.eat": "Azeno manĝas", "subtitles.entity.donkey.hurt": "Azeno vundiĝas", "subtitles.entity.drowned.ambient": "Droninto lirlas", "subtitles.entity.drowned.ambient_water": "Droninto lirlas", "subtitles.entity.drowned.death": "Droninto mortas", "subtitles.entity.drowned.hurt": "Droninto vundiĝas", "subtitles.entity.drowned.shoot": "Droninto ĵetas tridenton", "subtitles.entity.drowned.step": "Droninto paŝas", "subtitles.entity.drowned.swim": "Droninto naĝas", "subtitles.entity.egg.throw": "Ovo flugas", "subtitles.entity.elder_guardian.ambient": "Pragardisto ĝemas", "subtitles.entity.elder_guardian.ambient_land": "Pragardisto baraktas", "subtitles.entity.elder_guardian.curse": "Pragardisto malbenas", "subtitles.entity.elder_guardian.death": "Pragardisto mortas", "subtitles.entity.elder_guardian.flop": "Pragardisto saltetas", "subtitles.entity.elder_guardian.hurt": "Pragardisto vundiĝas", "subtitles.entity.ender_dragon.ambient": "Drako roras", "subtitles.entity.ender_dragon.death": "Drako mortas", "subtitles.entity.ender_dragon.flap": "Drako svingas", "subtitles.entity.ender_dragon.growl": "Drakko blekegas", "subtitles.entity.ender_dragon.hurt": "Drako vundiĝas", "subtitles.entity.ender_dragon.shoot": "Drako pafas", "subtitles.entity.ender_eye.death": "Finejokulo falas", "subtitles.entity.ender_eye.launch": "Finejokulo pafiĝas", "subtitles.entity.ender_pearl.throw": "Finejperlo flugas", "subtitles.entity.enderman.ambient": "Finejano vupas", "subtitles.entity.enderman.death": "Finejano mortas", "subtitles.entity.enderman.hurt": "Finejano vundiĝas", "subtitles.entity.enderman.stare": "Finejano krias", "subtitles.entity.enderman.teleport": "Finejano teleportiĝas", "subtitles.entity.endermite.ambient": "Finejmito rampetas", "subtitles.entity.endermite.death": "Finejmito mortas", "subtitles.entity.endermite.hurt": "Finejmito vundiĝas", "subtitles.entity.evoker.ambient": "Alvokisto murmuras", "subtitles.entity.evoker.cast_spell": "Alvokisto lanĉas sorĉon", "subtitles.entity.evoker.celebrate": "Alvokisto huraas", "subtitles.entity.evoker.death": "Alvokisto mortas", "subtitles.entity.evoker.hurt": "Alvokisto vundiĝas", "subtitles.entity.evoker.prepare_attack": "Alvokisto preparas atakon", "subtitles.entity.evoker.prepare_summon": "Alvokisto preparas alvokadon", "subtitles.entity.evoker.prepare_wololo": "Alvokisto preparas ĉarmadon", "subtitles.entity.evoker_fangs.attack": "Dentegoj klakas", "subtitles.entity.experience_orb.pickup": "Sperto riceviĝis", "subtitles.entity.firework_rocket.blast": "Artfajraĵo eksplodas", "subtitles.entity.firework_rocket.launch": "Artfajraĵo ekflugas", "subtitles.entity.firework_rocket.twinkle": "Artfajraĵo brilas", "subtitles.entity.fishing_bobber.retrieve": "Flosilo rekolektiĝis", "subtitles.entity.fishing_bobber.splash": "Fiŝflosilo plaŭdas", "subtitles.entity.fishing_bobber.throw": "Flosilo ĵetiĝis", "subtitles.entity.fox.aggro": "Vulpo koleriĝas", "subtitles.entity.fox.ambient": "Vulpo jelpas", "subtitles.entity.fox.bite": "Vulpo mordas", "subtitles.entity.fox.death": "Vulpo mortas", "subtitles.entity.fox.eat": "Vulpo manĝas", "subtitles.entity.fox.hurt": "Vulpo vundiĝas", "subtitles.entity.fox.screech": "Vulpo kriĉas", "subtitles.entity.fox.sleep": "Vulpo ronkas", "subtitles.entity.fox.sniff": "Vulpo enflaras", "subtitles.entity.fox.spit": "Vulpo elkraĉas", "subtitles.entity.fox.teleport": "Vulpo teleportiĝas", "subtitles.entity.generic.big_fall": "Io falis", "subtitles.entity.generic.burn": "Brulado", "subtitles.entity.generic.death": "Mortado", "subtitles.entity.generic.drink": "Sorbado", "subtitles.entity.generic.eat": "Manĝado", "subtitles.entity.generic.explode": "Eksplodado", "subtitles.entity.generic.extinguish_fire": "Fajro estingiĝas", "subtitles.entity.generic.hurt": "Io vundiĝas", "subtitles.entity.generic.small_fall": "Io faletas", "subtitles.entity.generic.splash": "Ŝprucado", "subtitles.entity.generic.swim": "Naĝado", "subtitles.entity.ghast.ambient": "Ĥasto ploras", "subtitles.entity.ghast.death": "Ĥasto mortas", "subtitles.entity.ghast.hurt": "Ĥasto vundiĝas", "subtitles.entity.ghast.shoot": "Ĥasto pafas", "subtitles.entity.glow_item_frame.add_item": "Luma kadro pleniĝas", "subtitles.entity.glow_item_frame.break": "Luma kadro rompiĝas", "subtitles.entity.glow_item_frame.place": "Luma kadro metiĝis", "subtitles.entity.glow_item_frame.remove_item": "Luma kadro malpleniĝas", "subtitles.entity.glow_item_frame.rotate_item": "Luma kadro klakas", "subtitles.entity.glow_squid.ambient": "Lumkalmaro naĝas", "subtitles.entity.glow_squid.death": "Lumkalmaro mortas", "subtitles.entity.glow_squid.hurt": "Lumkalmaro vundiĝas", "subtitles.entity.glow_squid.squirt": "Lumkalmaro pafas inkon", "subtitles.entity.goat.ambient": "Kapro blekas", "subtitles.entity.goat.death": "Kapro mortas", "subtitles.entity.goat.eat": "Kapro manĝas", "subtitles.entity.goat.hurt": "Kapro vundiĝas", "subtitles.entity.goat.long_jump": "Kapro saltas", "subtitles.entity.goat.milk": "Kapro melkiĝas", "subtitles.entity.goat.prepare_ram": "Kapro piedfrapas", "subtitles.entity.goat.ram_impact": "Kapro ramas", "subtitles.entity.goat.screaming.ambient": "Kapro blekegas", "subtitles.entity.goat.step": "Kapro paŝas", "subtitles.entity.guardian.ambient": "Gardisto ĝemas", "subtitles.entity.guardian.ambient_land": "Gardisto baraktas", "subtitles.entity.guardian.attack": "Gardisto pafas", "subtitles.entity.guardian.death": "Gardisto mortas", "subtitles.entity.guardian.flop": "Gardisto saltetas", "subtitles.entity.guardian.hurt": "Gardisto vundiĝas", "subtitles.entity.hoglin.ambient": "Hoglo graŭlas", "subtitles.entity.hoglin.angry": "Hoglo graŭlas kolere", "subtitles.entity.hoglin.attack": "Hoglo atakas", "subtitles.entity.hoglin.converted_to_zombified": "Hoglo zogliĝas", "subtitles.entity.hoglin.death": "Hoglo mortas", "subtitles.entity.hoglin.hurt": "Hoglo vundiĝas", "subtitles.entity.hoglin.retreat": "Hoglo retiriĝas", "subtitles.entity.hoglin.step": "Hoglo paŝas", "subtitles.entity.horse.ambient": "Ĉevalo henas", "subtitles.entity.horse.angry": "Ĉevalo henas", "subtitles.entity.horse.armor": "Ĉevala kiraso ekipiĝas", "subtitles.entity.horse.breathe": "Ĉevalo spiras", "subtitles.entity.horse.death": "Ĉevalo mortas", "subtitles.entity.horse.eat": "Ĉevalo manĝas", "subtitles.entity.horse.gallop": "Ĉevalo galopas", "subtitles.entity.horse.hurt": "Ĉevalo vundiĝas", "subtitles.entity.horse.jump": "Ĉevalo saltas", "subtitles.entity.horse.saddle": "Selo ekipiĝas", "subtitles.entity.husk.ambient": "Sekulo ĝemas", "subtitles.entity.husk.converted_to_zombie": "Sekulo zombiiĝas", "subtitles.entity.husk.death": "Sekulo mortas", "subtitles.entity.husk.hurt": "Sekulo vundiĝas", "subtitles.entity.illusioner.ambient": "Iluziisto murmuras", "subtitles.entity.illusioner.cast_spell": "Iluziisto lanĉas sorĉon", "subtitles.entity.illusioner.death": "Iluziisto mortas", "subtitles.entity.illusioner.hurt": "Iluziisto vundiĝas", "subtitles.entity.illusioner.mirror_move": "Iluziisto translokiĝas", "subtitles.entity.illusioner.prepare_blindness": "Iluziisto preparas blindecon", "subtitles.entity.illusioner.prepare_mirror": "Iluziisto preparas spegulan bildon", "subtitles.entity.iron_golem.attack": "Fergolemo atakas", "subtitles.entity.iron_golem.damage": "Fergolemo krakas", "subtitles.entity.iron_golem.death": "Fergolemo mortas", "subtitles.entity.iron_golem.hurt": "Fergolemo vundiĝas", "subtitles.entity.iron_golem.repair": "Fergolemo reboniĝis", "subtitles.entity.item.break": "Objekto rompiĝas", "subtitles.entity.item.pickup": "Objekto preniĝas", "subtitles.entity.item_frame.add_item": "Kadro pleniĝas", "subtitles.entity.item_frame.break": "Kadro rompiĝas", "subtitles.entity.item_frame.place": "Kadro metiĝis", "subtitles.entity.item_frame.remove_item": "Kadro malpleniĝas", "subtitles.entity.item_frame.rotate_item": "Kadro klakas", "subtitles.entity.leash_knot.break": "Gvidilnodo rompiĝas", "subtitles.entity.leash_knot.place": "Kondukilo ligiĝis", "subtitles.entity.lightning_bolt.impact": "Fulmo frapas", "subtitles.entity.lightning_bolt.thunder": "Tondro bruas", "subtitles.entity.llama.ambient": "Lamo blekas", "subtitles.entity.llama.angry": "Lamo blekas kolere", "subtitles.entity.llama.chest": "Lamkofro ekipiĝas", "subtitles.entity.llama.death": "Lamo mortas", "subtitles.entity.llama.eat": "Lamo manĝas", "subtitles.entity.llama.hurt": "Lamo vundiĝas", "subtitles.entity.llama.spit": "Lamo kraĉas", "subtitles.entity.llama.step": "Lamo paŝas", "subtitles.entity.llama.swag": "Lamo estas ornamiĝita", "subtitles.entity.magma_cube.death": "Magmokubo mortas", "subtitles.entity.magma_cube.hurt": "Magmokubo vundiĝas", "subtitles.entity.magma_cube.squish": "Magmokubo ŝmacas", "subtitles.entity.minecart.riding": "Vagoneto ruliĝas", "subtitles.entity.mooshroom.convert": "Fungobovo konvertas", "subtitles.entity.mooshroom.eat": "Fungobovo manĝas", "subtitles.entity.mooshroom.milk": "Fungobovo melkiĝas", "subtitles.entity.mooshroom.suspicious_milk": "Fungobovo melkiĝas suspektinde", "subtitles.entity.mule.ambient": "Mulo blekas", "subtitles.entity.mule.angry": "Mulo henas", "subtitles.entity.mule.chest": "Mulokofro ekipiĝas", "subtitles.entity.mule.death": "Mulo mortas", "subtitles.entity.mule.eat": "Mulo manĝas", "subtitles.entity.mule.hurt": "Mulo vundiĝas", "subtitles.entity.painting.break": "Pentraĵo rompiĝas", "subtitles.entity.painting.place": "Pentraĵo metiĝis", "subtitles.entity.panda.aggressive_ambient": "Pando grumblas", "subtitles.entity.panda.ambient": "Pando anhelas", "subtitles.entity.panda.bite": "Pando mordas", "subtitles.entity.panda.cant_breed": "Pando mekas", "subtitles.entity.panda.death": "Pando mortas", "subtitles.entity.panda.eat": "Pando manĝas", "subtitles.entity.panda.hurt": "Pando vundiĝas", "subtitles.entity.panda.pre_sneeze": "Pandon nazo jukas", "subtitles.entity.panda.sneeze": "Pando ternas", "subtitles.entity.panda.step": "Pando paŝas", "subtitles.entity.panda.worried_ambient": "Pando hurletas", "subtitles.entity.parrot.ambient": "Papago diras", "subtitles.entity.parrot.death": "Papago mortas", "subtitles.entity.parrot.eats": "Papago manĝas", "subtitles.entity.parrot.fly": "Papago flirtas", "subtitles.entity.parrot.hurts": "Papago vundiĝas", "subtitles.entity.parrot.imitate.blaze": "Papago spiras", "subtitles.entity.parrot.imitate.creeper": "Papago siblas", "subtitles.entity.parrot.imitate.drowned": "Papago lirlas", "subtitles.entity.parrot.imitate.elder_guardian": "Papago baraktas", "subtitles.entity.parrot.imitate.ender_dragon": "Papago roras", "subtitles.entity.parrot.imitate.endermite": "Papago rampetas", "subtitles.entity.parrot.imitate.evoker": "Papago murmuras", "subtitles.entity.parrot.imitate.ghast": "Papago ploras", "subtitles.entity.parrot.imitate.guardian": "Papago ĝemas", "subtitles.entity.parrot.imitate.hoglin": "Papago graŭlas", "subtitles.entity.parrot.imitate.husk": "Papago ĝemas", "subtitles.entity.parrot.imitate.illusioner": "Papago murmuras", "subtitles.entity.parrot.imitate.magma_cube": "Papago ŝmacas", "subtitles.entity.parrot.imitate.phantom": "Papago kriĉas", "subtitles.entity.parrot.imitate.piglin": "Papago snufaĉas", "subtitles.entity.parrot.imitate.piglin_brute": "Papago snufaĉas fortege", "subtitles.entity.parrot.imitate.pillager": "Papago murmuras", "subtitles.entity.parrot.imitate.ravager": "Papago gruntas", "subtitles.entity.parrot.imitate.shulker": "Papago embuskas", "subtitles.entity.parrot.imitate.silverfish": "Papago siblas", "subtitles.entity.parrot.imitate.skeleton": "Papago klakas", "subtitles.entity.parrot.imitate.slime": "Papago ŝmacas", "subtitles.entity.parrot.imitate.spider": "Papago siblas", "subtitles.entity.parrot.imitate.stray": "Papago klakas", "subtitles.entity.parrot.imitate.vex": "Papago veksas", "subtitles.entity.parrot.imitate.vindicator": "Papago grumblas", "subtitles.entity.parrot.imitate.witch": "Papago subridas", "subtitles.entity.parrot.imitate.wither": "Papago koleriĝas", "subtitles.entity.parrot.imitate.wither_skeleton": "Papago klakas", "subtitles.entity.parrot.imitate.zoglin": "Papago graŭlas", "subtitles.entity.parrot.imitate.zombie": "Papago ĝemas", "subtitles.entity.parrot.imitate.zombie_villager": "Papago ĝemas", "subtitles.entity.phantom.ambient": "Fantomo kriĉas", "subtitles.entity.phantom.bite": "Fantomo mordas", "subtitles.entity.phantom.death": "Fantomo mortas", "subtitles.entity.phantom.flap": "Fantomo flugas", "subtitles.entity.phantom.hurt": "Fantomo vundiĝas", "subtitles.entity.phantom.swoop": "Fantomo plonĝas", "subtitles.entity.pig.ambient": "Porko gruntas", "subtitles.entity.pig.death": "Porko mortas", "subtitles.entity.pig.hurt": "Porko vundiĝas", "subtitles.entity.pig.saddle": "Selo ekipiĝas", "subtitles.entity.piglin.admiring_item": "Piglino admiras objekton", "subtitles.entity.piglin.ambient": "Piglino snufaĉas", "subtitles.entity.piglin.angry": "Piglino snufaĉas kolere", "subtitles.entity.piglin.celebrate": "Piglino festas", "subtitles.entity.piglin.converted_to_zombified": "Piglino zombiiĝas", "subtitles.entity.piglin.death": "Piglino mortas", "subtitles.entity.piglin.hurt": "Piglino vundiĝas", "subtitles.entity.piglin.jealous": "Piglino snufaĉas envie", "subtitles.entity.piglin.retreat": "Piglino retiriĝas", "subtitles.entity.piglin.step": "Piglino paŝas", "subtitles.entity.piglin_brute.ambient": "Piglinbruto snufaĉas", "subtitles.entity.piglin_brute.angry": "Piglinbruto snufaĉas kolere", "subtitles.entity.piglin_brute.converted_to_zombified": "Piglinbruto zombiiĝas", "subtitles.entity.piglin_brute.death": "Piglinbruto mortas", "subtitles.entity.piglin_brute.hurt": "Piglinbruto vundiĝas", "subtitles.entity.piglin_brute.step": "Piglinbruto paŝas", "subtitles.entity.pillager.ambient": "Rabisto murmuras", "subtitles.entity.pillager.celebrate": "Rabisto huraas", "subtitles.entity.pillager.death": "Rabisto mortas", "subtitles.entity.pillager.hurt": "Rabisto vundiĝas", "subtitles.entity.player.attack.crit": "Grava atako", "subtitles.entity.player.attack.knockback": "Forpuŝa atako", "subtitles.entity.player.attack.strong": "Forta atako", "subtitles.entity.player.attack.sweep": "Eksvingita atako", "subtitles.entity.player.attack.weak": "Malforta atako", "subtitles.entity.player.burp": "Rukto", "subtitles.entity.player.death": "Ludanto mortas", "subtitles.entity.player.freeze_hurt": "Ludanto frostiĝas", "subtitles.entity.player.hurt": "Ludanto vundiĝas", "subtitles.entity.player.hurt_drown": "Ludanto dronas", "subtitles.entity.player.hurt_on_fire": "Ludanto brulas", "subtitles.entity.player.levelup": "Ludanto tintas", "subtitles.entity.polar_bear.ambient": "Blanka urso ĝemas", "subtitles.entity.polar_bear.ambient_baby": "Blanka urso zumas", "subtitles.entity.polar_bear.death": "Blanka urso mortas", "subtitles.entity.polar_bear.hurt": "Blanka urso vundiĝas", "subtitles.entity.polar_bear.warning": "Blanka urso muĝas", "subtitles.entity.potion.splash": "Botelo frakasas", "subtitles.entity.potion.throw": "Botelo ĵetiĝis", "subtitles.entity.puffer_fish.blow_out": "Pintfiŝo malŝvelas", "subtitles.entity.puffer_fish.blow_up": "Pintfiŝo ŝvelas", "subtitles.entity.puffer_fish.death": "Pintfiŝo mortas", "subtitles.entity.puffer_fish.flop": "Pintfiŝo saltetas", "subtitles.entity.puffer_fish.hurt": "Pintfiŝo vundiĝas", "subtitles.entity.puffer_fish.sting": "Pintfiŝo pikas", "subtitles.entity.rabbit.ambient": "Kuniklo cincas", "subtitles.entity.rabbit.attack": "Kuniklo atakas", "subtitles.entity.rabbit.death": "Kuniklo mortas", "subtitles.entity.rabbit.hurt": "Kuniklo vundiĝas", "subtitles.entity.rabbit.jump": "Kuniklo saltetas", "subtitles.entity.ravager.ambient": "Ruiniganto gruntas", "subtitles.entity.ravager.attack": "Ruiniganto mordas", "subtitles.entity.ravager.celebrate": "Ruiniganto huraas", "subtitles.entity.ravager.death": "Ruiniganto mortas", "subtitles.entity.ravager.hurt": "Ruiniganto vundiĝas", "subtitles.entity.ravager.roar": "Ruiniganto roras", "subtitles.entity.ravager.step": "Ruiniganto paŝas", "subtitles.entity.ravager.stunned": "Ruiniganto svenis", "subtitles.entity.salmon.death": "Salmo mortas", "subtitles.entity.salmon.flop": "Salmo saltetas", "subtitles.entity.salmon.hurt": "Salmo vundiĝas", "subtitles.entity.sheep.ambient": "Ŝafo beas", "subtitles.entity.sheep.death": "Ŝafo mortas", "subtitles.entity.sheep.hurt": "Ŝafo vundiĝas", "subtitles.entity.shulker.ambient": "Ŝulkro kaŭras", "subtitles.entity.shulker.close": "Ŝulkro fermiĝas", "subtitles.entity.shulker.death": "Ŝulkro mortas", "subtitles.entity.shulker.hurt": "Ŝulkro vundiĝas", "subtitles.entity.shulker.open": "Ŝulkro malfermiĝas", "subtitles.entity.shulker.shoot": "Ŝulkro pafas", "subtitles.entity.shulker.teleport": "Ŝulkro teleportiĝas", "subtitles.entity.shulker_bullet.hit": "Ŝulkra pafaĵo eksplodas", "subtitles.entity.shulker_bullet.hurt": "Ŝulkra pafaĵo rompiĝas", "subtitles.entity.silverfish.ambient": "Lepismo siblas", "subtitles.entity.silverfish.death": "Lepismo mortas", "subtitles.entity.silverfish.hurt": "Lepismo vundiĝas", "subtitles.entity.skeleton.ambient": "Skeleto klakas", "subtitles.entity.skeleton.converted_to_stray": "Skeleto iĝas devojiĝinto", "subtitles.entity.skeleton.death": "Skeleto mortas", "subtitles.entity.skeleton.hurt": "Skeleto vundiĝas", "subtitles.entity.skeleton.shoot": "Skeleto pafas", "subtitles.entity.skeleton_horse.ambient": "Skeleta ĉevalo krias", "subtitles.entity.skeleton_horse.death": "Skeleta ĉevalo mortas", "subtitles.entity.skeleton_horse.hurt": "Skeleta ĉevalo vundiĝas", "subtitles.entity.skeleton_horse.swim": "Skeleta ĉevalo naĝas", "subtitles.entity.slime.attack": "Mukokubo atakas", "subtitles.entity.slime.death": "Mukokubo mortas", "subtitles.entity.slime.hurt": "Mukokubo vundiĝas", "subtitles.entity.slime.squish": "Mukokubo ŝmacas", "subtitles.entity.snow_golem.death": "Neĝgolemo mortas", "subtitles.entity.snow_golem.hurt": "Neĝgolemo vundiĝas", "subtitles.entity.snowball.throw": "Neĝbulo flugas", "subtitles.entity.spider.ambient": "Araneo siblas", "subtitles.entity.spider.death": "Araneo mortas", "subtitles.entity.spider.hurt": "Araneo vundiĝas", "subtitles.entity.squid.ambient": "Kalmaro naĝas", "subtitles.entity.squid.death": "Kalmaro mortas", "subtitles.entity.squid.hurt": "Kalmaro vundiĝas", "subtitles.entity.squid.squirt": "Kalmaro pafas inkon", "subtitles.entity.stray.ambient": "Devojiĝanto klakas", "subtitles.entity.stray.death": "Devojiĝanto mortas", "subtitles.entity.stray.hurt": "Devojiĝanto vundiĝas", "subtitles.entity.strider.death": "Lafpaŝanto mortas", "subtitles.entity.strider.eat": "Lafpaŝanto manĝas", "subtitles.entity.strider.happy": "Lafpaŝanto trilas", "subtitles.entity.strider.hurt": "Lafpaŝanto vundiĝas", "subtitles.entity.strider.idle": "Lafpaŝanto pepas", "subtitles.entity.strider.retreat": "Lafpaŝanto retiriĝas", "subtitles.entity.tnt.primed": "TNT siblas", "subtitles.entity.tropical_fish.death": "Tropika fiŝo mortas", "subtitles.entity.tropical_fish.flop": "Tropika fiŝo plaŭdas", "subtitles.entity.tropical_fish.hurt": "Tropika fiŝo vundiĝas", "subtitles.entity.turtle.ambient_land": "Testudo pepas", "subtitles.entity.turtle.death": "Testudo mortas", "subtitles.entity.turtle.death_baby": "Testudido mortas", "subtitles.entity.turtle.egg_break": "Testudovo rompiĝas", "subtitles.entity.turtle.egg_crack": "Testudovo fendiĝas", "subtitles.entity.turtle.egg_hatch": "Testudido naskiĝas", "subtitles.entity.turtle.hurt": "Testudo vundiĝas", "subtitles.entity.turtle.hurt_baby": "Testudido vundiĝas", "subtitles.entity.turtle.lay_egg": "Testudo metas ovon", "subtitles.entity.turtle.shamble": "Testudo stumblas", "subtitles.entity.turtle.shamble_baby": "Testudido stumblas", "subtitles.entity.turtle.swim": "Testudo naĝas", "subtitles.entity.vex.ambient": "Vekso veksas", "subtitles.entity.vex.charge": "Vekso hojlas", "subtitles.entity.vex.death": "Vekso mortas", "subtitles.entity.vex.hurt": "Vekso vundiĝas", "subtitles.entity.villager.ambient": "Vilaĝano murmuras", "subtitles.entity.villager.celebrate": "Vilaĝano huraas", "subtitles.entity.villager.death": "Vilaĝano mortas", "subtitles.entity.villager.hurt": "Vilaĝano vundiĝas", "subtitles.entity.villager.no": "Vilaĝano malkonsentas", "subtitles.entity.villager.trade": "Vilaĝano komercas", "subtitles.entity.villager.work_armorer": "Armaĵforĝisto laboras", "subtitles.entity.villager.work_butcher": "Viandisto laboras", "subtitles.entity.villager.work_cartographer": "Mapisto laboras", "subtitles.entity.villager.work_cleric": "Kleriko laboras", "subtitles.entity.villager.work_farmer": "Farmisto laboras", "subtitles.entity.villager.work_fisherman": "Fiŝisto laboras", "subtitles.entity.villager.work_fletcher": "Sagisto laboras", "subtitles.entity.villager.work_leatherworker": "Ledlaboristo laboras", "subtitles.entity.villager.work_librarian": "Bibliotekisto laboras", "subtitles.entity.villager.work_mason": "Masonisto laboras", "subtitles.entity.villager.work_shepherd": "Ŝafisto laboras", "subtitles.entity.villager.work_toolsmith": "Iloforĝisto laboras", "subtitles.entity.villager.work_weaponsmith": "Armilforĝisto laboras", "subtitles.entity.villager.yes": "Vilaĝano konsentas", "subtitles.entity.vindicator.ambient": "Praviganto grumblas", "subtitles.entity.vindicator.celebrate": "Praviganto huraas", "subtitles.entity.vindicator.death": "Praviganto mortas", "subtitles.entity.vindicator.hurt": "Praviganto vundiĝas", "subtitles.entity.wandering_trader.ambient": "Vaganta vendisto murmuras", "subtitles.entity.wandering_trader.death": "Vaganta vendisto mortas", "subtitles.entity.wandering_trader.disappeared": "Vaganta vendisto malaperas", "subtitles.entity.wandering_trader.drink_milk": "Vaganta vendisto trinkas lakton", "subtitles.entity.wandering_trader.drink_potion": "Vaganta vendisto trinkas eliksiron", "subtitles.entity.wandering_trader.hurt": "Vaganta vendisto vundiĝas", "subtitles.entity.wandering_trader.no": "Vaganta vendisto malkonsentas", "subtitles.entity.wandering_trader.reappeared": "Vaganta vendisto aperas", "subtitles.entity.wandering_trader.trade": "Vaganta vendisto komercas", "subtitles.entity.wandering_trader.yes": "Vaganta vendisto konsentas", "subtitles.entity.witch.ambient": "Sorĉistino subridaĉas", "subtitles.entity.witch.celebrate": "Sorĉistino huraas", "subtitles.entity.witch.death": "Sorĉistino mortas", "subtitles.entity.witch.drink": "Sorĉistino trinkas", "subtitles.entity.witch.hurt": "Sorĉistino vundiĝas", "subtitles.entity.witch.throw": "Sorĉistino ĵetas", "subtitles.entity.wither.ambient": "Vizero koleriĝas", "subtitles.entity.wither.death": "Vizero mortas", "subtitles.entity.wither.hurt": "Vizero vundiĝas", "subtitles.entity.wither.shoot": "Vizero atakas", "subtitles.entity.wither.spawn": "Vizero aperas", "subtitles.entity.wither_skeleton.ambient": "Vizerskeleto klakas", "subtitles.entity.wither_skeleton.death": "Vizerskeleto mortas", "subtitles.entity.wither_skeleton.hurt": "Vizerskeleto vundiĝas", "subtitles.entity.wolf.ambient": "Lupo anhelas", "subtitles.entity.wolf.death": "Lupo mortas", "subtitles.entity.wolf.growl": "Lupo graŭlas", "subtitles.entity.wolf.hurt": "Lupo vundiĝas", "subtitles.entity.wolf.shake": "Lupo skuiĝas", "subtitles.entity.zoglin.ambient": "Zoglo graŭlas", "subtitles.entity.zoglin.angry": "Zoglo graŭlas kolere", "subtitles.entity.zoglin.attack": "Zoglo atakas", "subtitles.entity.zoglin.death": "Zoglo mortas", "subtitles.entity.zoglin.hurt": "Zoglo vundiĝas", "subtitles.entity.zoglin.step": "Zoglo paŝas", "subtitles.entity.zombie.ambient": "Zombio ĝemas", "subtitles.entity.zombie.attack_wooden_door": "Pordo skuiĝas", "subtitles.entity.zombie.break_wooden_door": "Pordo rompiĝas", "subtitles.entity.zombie.converted_to_drowned": "Zombio dronintiĝas", "subtitles.entity.zombie.death": "Zombio mortas", "subtitles.entity.zombie.destroy_egg": "Testudovo piedpremiĝis", "subtitles.entity.zombie.hurt": "Zombio vundiĝas", "subtitles.entity.zombie.infect": "Zombio infektas", "subtitles.entity.zombie_horse.ambient": "Zombia ĉevalo krias", "subtitles.entity.zombie_horse.death": "Zombia ĉevalo mortas", "subtitles.entity.zombie_horse.hurt": "Zombia ĉevalo vundiĝas", "subtitles.entity.zombie_villager.ambient": "Zombia vilaĝano ĝemas", "subtitles.entity.zombie_villager.converted": "Zombia vilaĝano kriaĉas", "subtitles.entity.zombie_villager.cure": "Zombia vilaĝano snufas", "subtitles.entity.zombie_villager.death": "Zombia vilaĝano mortas", "subtitles.entity.zombie_villager.hurt": "Zombia vilaĝano vundiĝas", "subtitles.entity.zombified_piglin.ambient": "Zombia piglo gruntas", "subtitles.entity.zombified_piglin.angry": "Zombia piglo gruntas kolere", "subtitles.entity.zombified_piglin.death": "Zombia piglo mortas", "subtitles.entity.zombified_piglin.hurt": "Zombia piglo vundiĝas", "subtitles.event.raid.horn": "Korno sonas malbonaŭgure", "subtitles.item.armor.equip": "Armaĵo ekipiĝas", "subtitles.item.armor.equip_chain": "Ĉena armaĵo tintas", "subtitles.item.armor.equip_diamond": "Diamanta armaĵo sonoras", "subtitles.item.armor.equip_elytra": "Elitro susuras", "subtitles.item.armor.equip_gold": "Ora armaĵo tintas", "subtitles.item.armor.equip_iron": "Fera armaĵo sonoras", "subtitles.item.armor.equip_leather": "Leda armaĵo grincas", "subtitles.item.armor.equip_netherite": "Subena armaĵo sonoras", "subtitles.item.armor.equip_turtle": "Testudŝelo ekipiĝas", "subtitles.item.axe.scrape": "Hakilo skrapas", "subtitles.item.axe.strip": "Hakilo skrapas", "subtitles.item.axe.wax_off": "Devaksado", "subtitles.item.bone_meal.use": "Osta faruno kraketas", "subtitles.item.book.page_turn": "Paĝo susuras", "subtitles.item.book.put": "Libro batas", "subtitles.item.bottle.empty": "Botelo malpleniĝas", "subtitles.item.bottle.fill": "Botelo pleniĝas", "subtitles.item.bucket.empty": "Sitelo malpleniĝas", "subtitles.item.bucket.fill": "Sitelo pleniĝas", "subtitles.item.bucket.fill_axolotl": "Aksolotlo ensiteliĝas", "subtitles.item.bucket.fill_fish": "Fiŝo kaptiĝis", "subtitles.item.chorus_fruit.teleport": "Ludanto teleportiĝas", "subtitles.item.crop.plant": "Planto semiĝis", "subtitles.item.crossbow.charge": "Arbalesto tensias", "subtitles.item.crossbow.hit": "Sago trafas", "subtitles.item.crossbow.load": "Arbalesto ŝargiĝas", "subtitles.item.crossbow.shoot": "Arbalesto pafas", "subtitles.item.dye.use": "Tinkturo farbas", "subtitles.item.firecharge.use": "Fajrobulo siblas", "subtitles.item.flintandsteel.use": "Fajrilo klakas", "subtitles.item.glow_ink_sac.use": "Sako da luminko makulas", "subtitles.item.hoe.till": "Sarkilo gratas", "subtitles.item.honey_bottle.drink": "Glutado", "subtitles.item.honeycomb.wax_on": "Vaksado", "subtitles.item.ink_sac.use": "Inksako makulas", "subtitles.item.lodestone_compass.lock": "Magnetŝtono magnetigas kompason", "subtitles.item.nether_wart.plant": "Veruko semiĝis", "subtitles.item.shears.shear": "Tondilo klakas", "subtitles.item.shield.block": "Ŝildo ŝirmas", "subtitles.item.shovel.flatten": "Fosilo glatigas", "subtitles.item.spyglass.stop_using": "Lorno mallongiĝas", "subtitles.item.spyglass.use": "Lorno etendiĝas", "subtitles.item.totem.use": "Totemo aktiviĝas", "subtitles.item.trident.hit": "Tridento ponardas", "subtitles.item.trident.hit_ground": "Tridento vibras", "subtitles.item.trident.return": "Tridento revenas", "subtitles.item.trident.riptide": "Tridento ekĵetiĝas", "subtitles.item.trident.throw": "Tridento sonoras", "subtitles.item.trident.thunder": "Tridenta tondro bruas", "subtitles.particle.soul_escape": "Animo eskapas", "subtitles.ui.cartography_table.take_result": "Mapo desegniĝis", "subtitles.ui.loom.take_result": "Teksilo uziĝis", "subtitles.ui.stonecutter.take_result": "Ŝtontranĉilo uziĝis", "subtitles.weather.rain": "Pluvas", "team.collision.always": "Ĉiam", "team.collision.never": "Neniam", "team.collision.pushOtherTeams": "Puŝi aliteamanojn", "team.collision.pushOwnTeam": "Puŝi samteamanojn", "team.notFound": "Nekonata teamo \"%s\"", "team.visibility.always": "Ĉiam", "team.visibility.hideForOtherTeams": "Kaŝi por teamoj aliaj", "team.visibility.hideForOwnTeam": "Kaŝi por propra teamo", "team.visibility.never": "Neniam", "title.multiplayer.disabled": "Plurludanta reĝimo estas malebligita. Bonvolu kontroli la agordojn de via Microsoft-konto.", "title.multiplayer.lan": "Pluraj ludantoj (loka reto)", "title.multiplayer.other": "Pluraj ludantoj (ekstera liveranto)", "title.multiplayer.realms": "Pluraj ludantoj (Realms)", "title.oldgl.deprecation.line1": "Detektis malnovan grafikkarton; tiu eble malebligas", "title.oldgl.deprecation.line2": "ludi en la futuro, ĉar OpelGL 3.2 necesos!", "title.oldgl.eol.line1": "Detektis malnovan grafikkarton; tiu CERTE malebligas", "title.oldgl.eol.line2": "ludi en la futuro, ĉar OpelGL 2.0 necesos!", "title.singleplayer": "Unu ludanto", "translation.test.args": "%s %s", "translation.test.complex": "Prefikso, %s%[2]s denove %s kaj %[1]s fine %s kaj denove %[1]s!", "translation.test.escape": "%%s %%%s %%%%s %%%%%s", "translation.test.invalid": "saluton %", "translation.test.invalid2": "saluton %s", "translation.test.none": "Saluton, mondo!", "translation.test.world": "mondo", "tutorial.bundleInsert.description": "Klaku dekstre por enmeti aĵojn", "tutorial.bundleInsert.title": "Uzu sakon", "tutorial.craft_planks.description": "La receptlibro povas helpi", "tutorial.craft_planks.title": "Faru lignajn tabulojn", "tutorial.find_tree.description": "Pugnofrapu ĝin por ligno", "tutorial.find_tree.title": "Trovu arbon", "tutorial.look.description": "Uzu vian muson por turniĝi", "tutorial.look.title": "Ĉirkaŭrigardu", "tutorial.move.description": "Uzu %s por salti", "tutorial.move.title": "Moviĝu per %s, %s, %s, %s", "tutorial.open_inventory.description": "Premu %s", "tutorial.open_inventory.title": "Vidu vian inventaron", "tutorial.punch_tree.description": "Premadu %s", "tutorial.punch_tree.title": "Detruu la arbon", "tutorial.socialInteractions.description": "Premu %s por malfermi", "tutorial.socialInteractions.title": "Sociaj interagoj"}
{ chat.SetLanguage(Map) }
test_text_encoders.py
import pytest import torch from ludwig.encoders import text_encoders @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_albert_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): albert_encoder = text_encoders.ALBERTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(albert_encoder.input_dtype) inputs = torch.rand((2, max_sequence_length)).type(albert_encoder.input_dtype) outputs = albert_encoder(inputs) assert outputs["encoder_output"].shape[1:] == albert_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "cls_pooled", "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_bert_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): bert = text_encoders.BERTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(bert.input_dtype) outputs = bert(inputs) assert outputs["encoder_output"].shape[1:] == bert.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", ["last", "sum", "mean"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_xlm_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): xlm_encoder = text_encoders.XLMEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(xlm_encoder.input_dtype)
@pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_gpt_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): gpt_encoder = text_encoders.GPTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(gpt_encoder.input_dtype) outputs = gpt_encoder(inputs) assert outputs["encoder_output"].shape[1:] == gpt_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", ["cls_pooled", "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_roberta_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): roberta_encoder = text_encoders.RoBERTaEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(roberta_encoder.input_dtype) outputs = roberta_encoder(inputs) assert outputs["encoder_output"].shape[1:] == roberta_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [True, False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_gpt2_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): gpt_encoder = text_encoders.GPT2Encoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(gpt_encoder.input_dtype) outputs = gpt_encoder(inputs) assert outputs["encoder_output"].shape[1:] == gpt_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_distil_bert(use_pretrained: bool, reduce_output: str, max_sequence_length: int): distil_bert_encoder = text_encoders.DistilBERTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(distil_bert_encoder.input_dtype) outputs = distil_bert_encoder(inputs) assert outputs["encoder_output"].shape[1:] == distil_bert_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_transfoxl_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): transfo = text_encoders.TransformerXLEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.randint(10, (2, max_sequence_length)).type(transfo.input_dtype) outputs = transfo(inputs) assert outputs["encoder_output"].shape[1:] == transfo.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_ctrl_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.CTRLEncoder( max_sequence_length, use_pretrained=use_pretrained, reduce_output=reduce_output, ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "cls_pooled"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_camembert_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.CamemBERTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "cls_pooled"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_longformer_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.LongformerEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_mt5_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): mt5_encoder = text_encoders.MT5Encoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(mt5_encoder.input_dtype) outputs = mt5_encoder(inputs) assert outputs["encoder_output"].shape[1:] == mt5_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_xlmroberta_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): xlmroberta_encoder = text_encoders.XLMRoBERTaEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(xlmroberta_encoder.input_dtype) outputs = xlmroberta_encoder(inputs) assert outputs["encoder_output"].shape[1:] == xlmroberta_encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "cls_pooled"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_longformer_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.LongformerEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_electra_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.ELECTRAEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("pretrained_model_name_or_path", ["bert-base-uncased"]) @pytest.mark.parametrize("reduce_output", [None, "sum", "cls_pooled"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_auto_transformer_encoder(pretrained_model_name_or_path: str, reduce_output: str, max_sequence_length: int): encoder = text_encoders.AutoTransformerEncoder( pretrained_model_name_or_path=pretrained_model_name_or_path, reduce_output=reduce_output, max_sequence_length=max_sequence_length, ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_flaubert_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.FlauBERTEncoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape @pytest.mark.parametrize("use_pretrained", [False]) @pytest.mark.parametrize("reduce_output", [None, "sum"]) @pytest.mark.parametrize("max_sequence_length", [20]) def test_t5_encoder(use_pretrained: bool, reduce_output: str, max_sequence_length: int): encoder = text_encoders.T5Encoder( use_pretrained=use_pretrained, reduce_output=reduce_output, max_sequence_length=max_sequence_length ) inputs = torch.rand((2, max_sequence_length)).type(encoder.input_dtype) outputs = encoder(inputs) assert outputs["encoder_output"].shape[1:] == encoder.output_shape
outputs = xlm_encoder(inputs) assert outputs["encoder_output"].shape[1:] == xlm_encoder.output_shape
process.go
package models import ( "fmt" "log" "os" "time" _ "github.com/go-sql-driver/mysql" "github.com/joho/godotenv" "github.com/rapando/hash-engine/utils" "github.com/streadway/amqp" ) var ( q *amqp.Connection qChan *amqp.Channel ) func
() { start := time.Now() defer func() { fmt.Printf("\nDONE : %s\n", time.Since(start)) }() var err error err = godotenv.Load() if err != nil { log.Printf("unable to load dotenv because %v", err) return } q, err = utils.QConnect(os.Getenv("Q_URI")) if err != nil { log.Printf("unable to connect to rabbitmq. exit") os.Exit(3) } qChan, err = q.Channel() if err != nil { log.Printf("unable to create a rabbitmq channel because %v", err) os.Exit(3) } var chars = "`1234567890-=\\][poiuytrewqasdfghjkl;'/.," + "mnbvcxz~!@#$%^&*()_+|}{POIUYTREWQASDFGHJKL:\"?><MNBVCXZ " chars = "randomcharacters" var n = int64(len(chars)) combinations := GetNoOfCombinations(n) log.Printf("a string with %d characters has %d combinations", n, combinations.Int64()) log.Println("getting combinations and pusblishing them to redis") GetCombinations(chars, combinations, qChan) }
Process
output.go
// Package output provides types related to formatted terminal output. package output import ( "fmt" "io" "sync" "github.com/mattn/go-runewidth" ) // Writer defines a common set of methods that can be used to output status // information. // // Note that the *f methods can accept Style instances in their arguments with // the %s format specifier: if given, the detected colour support will be // respected when outputting. type Writer interface { // These methods only write the given message if verbose mode is enabled. Verbose(s string) Verbosef(format string, args ...interface{}) VerboseLine(line FancyLine) // These methods write their messages unconditionally. Write(s string) Writef(format string, args ...interface{}) WriteLine(line FancyLine) } type Context interface { Writer Close() } // Output encapsulates a standard set of functionality for commands that need // to output human-readable data. // // Output is not appropriate for machine-readable data, such as JSON. type Output struct { w io.Writer caps capabilities opts OutputOpts // Unsurprisingly, it would be bad if multiple goroutines wrote at the same // time, so we have a basic mutex to guard against that. lock sync.Mutex } type OutputOpts struct { // ForceColor ignores all terminal detection and enabled coloured output. ForceColor bool // ForceTTY ignores all terminal detection and enables TTY output. ForceTTY bool // ForceHeight ignores all terminal detection and sets the height to this value. ForceHeight int // ForceWidth ignores all terminal detection and sets the width to this value. ForceWidth int Verbose bool } // newOutputPlatformQuirks provides a way for conditionally compiled code to // hook into NewOutput to perform any required setup. var newOutputPlatformQuirks func(o *Output) error func NewOutput(w io.Writer, opts OutputOpts) *Output
func (o *Output) Verbose(s string) { if o.opts.Verbose { o.Write(s) } } func (o *Output) Verbosef(format string, args ...interface{}) { if o.opts.Verbose { o.Writef(format, args...) } } func (o *Output) VerboseLine(line FancyLine) { if o.opts.Verbose { o.WriteLine(line) } } func (o *Output) Write(s string) { o.lock.Lock() defer o.lock.Unlock() fmt.Fprintln(o.w, s) } func (o *Output) Writef(format string, args ...interface{}) { o.lock.Lock() defer o.lock.Unlock() fmt.Fprintf(o.w, format, o.caps.formatArgs(args)...) fmt.Fprint(o.w, "\n") } func (o *Output) WriteLine(line FancyLine) { o.lock.Lock() defer o.lock.Unlock() line.write(o.w, o.caps) } // Block starts a new block context. This should not be invoked if there is an // active Pending or Progress context. func (o *Output) Block(summary FancyLine) *Block { o.WriteLine(summary) return newBlock(runewidth.StringWidth(summary.emoji)+1, o) } // Pending sets up a new pending context. This should not be invoked if there // is an active Block or Progress context. The emoji in the message will be // ignored, as Pending will render its own spinner. // // A Pending instance must be disposed of via the Complete or Destroy methods. func (o *Output) Pending(message FancyLine) Pending { return newPending(message, o) } // Progress sets up a new progress bar context. This should not be invoked if // there is an active Block or Pending context. // // A Progress instance must be disposed of via the Complete or Destroy methods. func (o *Output) Progress(bars []ProgressBar, opts *ProgressOpts) Progress { return newProgress(bars, o, opts) } // ProgressWithStatusBars sets up a new progress bar context with StatusBar // contexts. This should not be invoked if there is an active Block or Pending // context. // // A Progress instance must be disposed of via the Complete or Destroy methods. func (o *Output) ProgressWithStatusBars(bars []ProgressBar, statusBars []*StatusBar, opts *ProgressOpts) ProgressWithStatusBars { return newProgressWithStatusBars(bars, statusBars, o, opts) } // The utility functions below do not make checks for whether the terminal is a // TTY, and should only be invoked from behind appropriate guards. func (o *Output) clearCurrentLine() { fmt.Fprint(o.w, "\033[2K") } func (o *Output) moveDown(lines int) { fmt.Fprintf(o.w, "\033[%dB", lines) // Move the cursor to the leftmost column. fmt.Fprintf(o.w, "\033[%dD", o.caps.Width+1) } func (o *Output) moveUp(lines int) { fmt.Fprintf(o.w, "\033[%dA", lines) // Move the cursor to the leftmost column. fmt.Fprintf(o.w, "\033[%dD", o.caps.Width+1) } // writeStyle is a helper to write a style while respecting the terminal // capabilities. func (o *Output) writeStyle(style Style) { fmt.Fprintf(o.w, "%s", o.caps.formatArgs([]interface{}{style})...) }
{ caps := detectCapabilities() if opts.ForceColor { caps.Color = true } if opts.ForceTTY { caps.Isatty = true } if opts.ForceHeight != 0 { caps.Height = opts.ForceHeight } if opts.ForceWidth != 0 { caps.Width = opts.ForceWidth } o := &Output{caps: caps, opts: opts, w: w} if newOutputPlatformQuirks != nil { if err := newOutputPlatformQuirks(o); err != nil { o.Verbosef("Error handling platform quirks: %v", err) } } return o }
argParser.py
from mirage.libs import io import sys class ArgParser: ''' This class allows to easily parse parameters from command line. ''' def __init__(self,appInstance=None): ''' This constructor allows to keep a pointer on the main Application instance. :param appInstance: instance of the main Application (core.app.App) :type appInstance: core.app.App ''' self.appInstance = appInstance def debug(self): ''' This method checks if the debug parameter has been provided by the user on the command line. It will modify the attribute ``debugMode`` stored in the provided instance of core.app.App. ''' if "--debug" in sys.argv: self.appInstance.debugMode = True sys.argv.remove("--debug") def quiet(self): ''' This method checks if the quiet parameter has been provided by the user on the command line. It will modify the attribute ``quiet`` stored in the provided instance of core.app.App. ''' if "--quiet" in sys.argv: self.appInstance.quiet = True sys.argv.remove("--quiet") def verbosity(self): ''' This method checks if the verbosity parameter has been provided by the user on the command line. It will modify the variable ``VERBOSITY_LEVEL`` stored in libs.io. ''' verbosity = [arg for arg in sys.argv if "--verbosity=" in arg] if len(verbosity) > 0: (_,value) = verbosity[-1].split("--verbosity=") if value.upper() == "NONE" or value == "0": io.VERBOSITY_LEVEL = io.VerbosityLevels.NONE elif value.upper() == "NO_INFO_AND_WARNING" or value == "1": io.VERBOSITY_LEVEL = io.VerbosityLevels.NO_INFO_AND_WARNING elif value.upper() == "NO_INFO" or value=="2": io.VERBOSITY_LEVEL = io.VerbosityLevels.NO_INFO else: io.VERBOSITY_LEVEL = io.VerbosityLevels.ALL for arg in sys.argv: if "--verbosity=" in arg: sys.argv.remove(arg) def create_module(self): ''' This method checks if the create_module parameter has been provided by the user on the command line. It will call the method ``create_module`` of the main application instance (core.app.App). ''' if "--create_module" in sys.argv: self.appInstance.create_module() return True return False def create_scenario(self): ''' This method checks if the create_scenario parameter has been provided by the user on the command line. It will call the method ``create_scenario`` of the main application instance (core.app.App). ''' if "--create_scenario" in sys.argv: self.appInstance.create_scenario() return True return False def list(self): ''' This method checks if the list parameter has been provided by the user on the command line. It will call the method ``list`` of the main application instance (core.app.App). ''' if "--list" in sys.argv: self.appInstance.list() return True else: applist = [arg for arg in sys.argv if "--list=" in arg] if len(applist) > 0: (_,pattern) = applist[-1].split("--list=") self.appInstance.list(pattern=pattern) return True return False def launcher(self): ''' This method checks if a Mirage module to run has been provided by the user on the command line. It will load and run the corresponding module with the parameters provided by the user. :Example: ``./mirage.py moduleName PARAMETER1=value1 PARAMETER2=value2 PARAMETER3=value3`` ''' module = sys.argv[1] self.appInstance.load(module) if len(self.appInstance.modules) > 0: if "--args" in sys.argv or "--showargs" in sys.argv: self.appInstance.args() exit(1) else: for arg in sys.argv[2:]: arg = arg.split("=",1) if len(arg) == 2: (name,value) = arg self.appInstance.set(name,value) else: io.fail("Incorrect parameter : "+str(arg)) exit(1) self.appInstance.run() self.appInstance.exit() def
(self): ''' This method checks if Mirage has been launched with some parameters. - If no Mirage module has been provided by the user on the command line, it will launch the main application loop (method ``loop`` of core.app.App) - If a Mirage module has been provided by the user, it calls the method ``launcher`` of core.argParser.ArgParser. ''' self.debug() self.quiet() self.verbosity() if self.create_module() or self.create_scenario(): self.appInstance.exit() elif not self.list(): if len(sys.argv) == 1: self.appInstance.loop() else: self.launcher()
run
order_planner_without_copynet.py
''' This file generates the graph of the Model that we are going to use for the order planner for neural summary generator The function returns the graph object and some of the important handles of the tensors of the graph in a dictionary. Note, that all the possible tensor handles can be obtained by the tf.get_tensor_by_name() function. This is done to make things easy. ''' import tensorflow as tf # define the graph builder function: def get_computation_graph(seed_value, field_vocab_size, content_label_vocab_size, field_embedding_size, content_label_embedding_size, lstm_cell_state_size, hidden_state_size, rev_content_label_dict): ''' Function for building the graph for model 1: The architecture is same as defined in the base paper, except the copynet part ''' # reset the current graph in the session tf.reset_default_graph() graph = tf.Graph() # create a new graph object # define all the graph computations using the as_default function print("\n\n=============================================================================================================") print("Building the graph ... ") with graph.as_default(): # ======================================================================== # | Step 1: # ======================================================================== print("\nstep 1: Creating input placeholders for the computations ...") # Placeholders for the input data: with tf.variable_scope("Input_Data"): tf_field_encodings = tf.placeholder(tf.int32, shape=(None, None), name="input_field_encodings") tf_content_encodings = tf.placeholder(tf.int32, shape=(None, None), name="input_content_encodings") tf_label_encodings = tf.placeholder(tf.int32, shape=(None, None), name="input_label_encodings") # This is a placeholder for storing the lengths of the input sequences (they are padded to tensor) tf_input_seqs_lengths = tf.placeholder(tf.int32, shape=(None,), name="input_sequence_lengths") # This is a placeholder for storing the lengths of the decoder sequences (they are padded to tensor) tf_label_seqs_lengths = tf.placeholder(tf.int32, shape=(None,), name="decoder_sequence_lengths") # create the one-hot encoded values for the label_encodings with tf.variable_scope("One_hot_encoder"): tf_one_hot_label_encodings = tf.one_hot(tf_label_encodings, depth=content_label_vocab_size) # print all placeholders for the encodings generated in step 1 print("\tplaceholder for the field_encodings: ", tf_field_encodings) print("\tplaceholder for the content_encodings: ", tf_content_encodings) print("\tplaceholder for the label_encodings: ", tf_label_encodings) print("\tplaceholder for the input_sequence_lengths: ", tf_input_seqs_lengths) print("\tplaceholder for the label_sequence_lengths: ", tf_label_seqs_lengths) # ======================================================================== # | Step 2: # ======================================================================== print("\nstep 2: Creating Embeddings Mechanism for the input and the output words ...") # Scope for the shared Content_Label matrix with tf.variable_scope("Unified_Vocabulary_Matrix"): content_label_embedding_matrix = tf.get_variable("content_label_embedding_matrix", shape=(content_label_vocab_size, content_label_embedding_size), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), dtype=tf.float32) # Embeddings for the given input data: with tf.variable_scope("Input_Embedder"): # Embed the field encodings: field_embedding_matrix = tf.get_variable("field_embedding_matrix", shape=(field_vocab_size, field_embedding_size), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), dtype=tf.float32) tf_field_embedded = tf.nn.embedding_lookup(field_embedding_matrix, tf_field_encodings, name="field_embedder") # Embed the content encodings: tf_content_embedded = tf.nn.embedding_lookup(content_label_embedding_matrix, tf_content_encodings, name="content_embedder") print("\tEmbedded_Input_Tensors: ", tf_field_embedded, tf_content_embedded) # Embeddings for the label (summary sentences): with tf.variable_scope("Label_Embedder"): # embed the label encodings tf_label_embedded = tf.nn.embedding_lookup(content_label_embedding_matrix, tf_label_encodings, name="label_embedder") print("\tEmbedded_Label_Tensors: ", tf_label_embedded) # Concatenate the Input embeddings channel_wise and obtain the combined input tensor with tf.variable_scope("Input_Concatenator"): tf_field_content_embedded = tf.concat([tf_field_embedded, tf_content_embedded], axis=-1, name="concatenator") print("\tFinal_Input_to_the_Encoder: ", tf_field_content_embedded) # ======================================================================== # | Step 3: # ======================================================================== print("\nstep 3: Creating the encoder RNN to obtain the encoded input sequences. (The Encoder Module) ... ") with tf.variable_scope("Encoder"): encoded_input, encoder_final_state = tf.nn.dynamic_rnn ( cell = tf.nn.rnn_cell.LSTMCell(lstm_cell_state_size), # let all parameters to be default inputs = tf_field_content_embedded, sequence_length = tf_input_seqs_lengths, dtype = tf.float32 ) print("\tEncoded_vectors_bank for attention mechanism: ", encoded_input) # define the size parameter for the encoded_inputs encoded_inputs_embeddings_size = encoded_input.shape[-1] print("\tFinal_state obtained from the last step of encoder: ", encoder_final_state) # ======================================================================== # | Step 4: # ======================================================================== print("\nstep 4: defining the Attention Mechanism for the Model (The Dispatcher Module) ...") print("**step 4.1: defining the content based attention") with tf.variable_scope("Content_Based_Attention/trainable_weights"): ''' These weights and bias matrices must be compatible with the dimensions of the h_values and the f_values passed to the function below. If they are not, some exception might get thrown and it would be difficult to debug it. ''' # field weights for the content_based attention W_f = tf.get_variable("field_attention_weights", shape=(field_embedding_size, content_label_embedding_size), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value)) b_f = tf.get_variable("field_attention_biases", shape=(field_embedding_size, 1), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value)) # hidden states weights for the content_based attention W_c = tf.get_variable("content_attention_weights", shape=(encoded_inputs_embeddings_size, content_label_embedding_size), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value)) b_c = tf.get_variable("content_attention_biases", shape=(encoded_inputs_embeddings_size, 1), initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value)) # Define the summary_ops for all the weights: W_f_summary = tf.summary.histogram("Content_based_attention/field_weights", W_f) b_f_summary = tf.summary.histogram("Content_based_attention/field_biases", b_f) W_c_summary = tf.summary.histogram("Content_based_attention/content_weights", W_c) b_c_summary = tf.summary.histogram("Content_based_attention/content_weights", b_c) with tf.variable_scope("Content_Based_Attention"): def get_content_based_attention_vectors(query_vectors): ''' function that returns the alpha_content vector using the yt-1 (query vectors) ''' # use the W_f and b_f to transform the query_vectors to the shape of f_values f_trans_query_vectors = tf.matmul(W_f, tf.transpose(query_vectors)) + b_f # use the W_c and b_c to transform the query_vectors to the shape of h_values h_trans_query_vectors = tf.matmul(W_c, tf.transpose(query_vectors)) + b_c # transpose and expand the dims of the f_trans_query_vectors f_trans_query_matrices = tf.expand_dims(tf.transpose(f_trans_query_vectors), axis=-1) # obtain the field attention_values by using the matmul operation field_attention_values = tf.matmul(tf_field_embedded, f_trans_query_matrices) # perform the same process for the h_trans_query_vectors h_trans_query_matrices = tf.expand_dims(tf.transpose(h_trans_query_vectors), axis=-1) hidden_attention_values = tf.matmul(encoded_input, h_trans_query_matrices) # drop the last dimension (1 sized) field_attention_values = tf.squeeze(field_attention_values, axis=[-1]) hidden_attention_values = tf.squeeze(hidden_attention_values, axis=[-1]) # free up non_required resources: ret_value = tf.nn.softmax(field_attention_values * hidden_attention_values, name="softmax") # return the element wise multiplied values followed by softmax return ret_value print("**step 4.2: defining the link based attention") with tf.variable_scope("Link_Based_Attention/trainable_weights"): ''' The dimensions of the Link_Matrix must be properly compatible with the field_vocab_size. If they are not, some exception might get thrown and it would be difficult to debug it. ''' Link_Matrix = tf.get_variable("Link_Attention_Matrix", shape=(field_vocab_size, field_vocab_size), dtype=tf.float32, initializer=tf.random_normal_initializer(mean=0.5, stddev=0.5, seed=seed_value)) # Link_Matrix_summary = tf.summary.histogram("Link_based_attention", Link_Matrix) print("\tThe Link Matrix used for this attention: ", Link_Matrix) # define the function for obtaining the link based attention values. with tf.variable_scope("Link_Based_Attention"): def get_link_based_attention_vectors(prev_attention_vectors): ''' This function generates the link based attention vectors using the Link matrix and the ''' # carve out only the relevant values from the Link matrix matrix_all_values_from = tf.nn.embedding_lookup(Link_Matrix, tf_field_encodings) # // TODO: Calculate the matrix_relevant_values from matrix_all_values_from matrix_relevant_values = tf.map_fn(lambda u: tf.gather(u[0],u[1],axis=1), [matrix_all_values_from, tf_field_encodings], dtype=matrix_all_values_from.dtype) return tf.nn.softmax(tf.reduce_sum(tf.expand_dims(prev_attention_vectors, axis = -1) * matrix_relevant_values, axis=1),name="softmax") print("**step 4.3: defining the hybrid attention") # define the hybrid of the content based and the link based attention with tf.variable_scope("Hybrid_attention/trainable_weights"): # for now, this is just the content_based attention: Zt_weights = tf.get_variable("zt_gate_parameter_vector", dtype=tf.float32, initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), shape=(hidden_state_size + field_embedding_size + content_label_embedding_size, 1)) Zt_weights_summary = tf.summary.histogram("Hybrid_attention/zt_weights", Zt_weights) with tf.variable_scope("Hybrid_attention"): # define the hybrid_attention_calculator function: def get_hybrid_attention(h_values, y_values, content_attention, link_attention): ''' function to calcuate the hybrid attention using the content_attention and the link_attention ''' # calculate the e_f values e_t = tf.reduce_sum(tf.expand_dims(link_attention, axis=-1) * tf_field_embedded, axis=1) # create the concatenated vectors from h_values e_t and y_values input_to_zt_gate = tf.concat([h_values, e_t, y_values], axis=-1) # channel wise concatenation # perfrom the computations of the z gate: z_t = tf.nn.sigmoid(tf.matmul(input_to_zt_gate, Zt_weights)) # calculate z_t~ value using the empirical values = 0.2z_t + 0.5 z_t_tilde = (0.2 * z_t) + 0.5 # compute the final hybrid_attention_values using the z_t_tilde values over content and link based values hybrid_attention = (z_t_tilde * content_attention) + ((1 - z_t_tilde) * link_attention) # return the calculated hybrid attention: return hybrid_attention # ======================================================================== # | Step 5: # ======================================================================== print("\nstep 5: creating the decoder RNN to obtain the generated summary for the structured data (The Decoder Module) ...") with tf.variable_scope("Decoder/trainable_weights"): # define the weights for the output projection calculation W_output = tf.get_variable( "output_projector_matrix", dtype=tf.float32, initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), shape=(hidden_state_size, content_label_vocab_size)) b_output = tf.get_variable( "output_projector_biases", dtype=tf.float32, initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), shape=(content_label_vocab_size,))
"x_t_gate_matrix", dtype=tf.float32, initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), shape=((hidden_state_size + content_label_embedding_size), content_label_embedding_size)) b_d = tf.get_variable( "x_t_gate_biases", dtype=tf.float32, initializer=tf.random_uniform_initializer(minval=-1, maxval=1, seed=seed_value), shape=(content_label_embedding_size,)) # define the summary ops for the defined weights and biases W_output_summary = tf.summary.histogram("Decoder/W_output", W_output) b_output_summary = tf.summary.histogram("Decoder/b_output", b_output) W_d_summary = tf.summary.histogram("Decoder/W_d", W_d) b_d_summary = tf.summary.histogram("Decoder/b_d", b_d) # create the LSTM cell to be used for decoding purposes decoder_cell = tf.nn.rnn_cell.LSTMCell(lstm_cell_state_size) def decode(start_tokens, mode = "inference", decoder_lengths = None, w_reuse = True): ''' Function that defines the decoder op and returns the decoded sequence (the summary) @params: start_tokens = a tensor containing the start tokens (one for each sequence in the batch) mode = a value from "training" or "inference" to determine for how long the decoder rnn is to be unrolled. behaviour is as follows: "training" => The rnn will be unrolled until the max(decode_lengths). decode_lengths cannot be None. "inference" => decode_lengths is be ignored and unrolling will be done till <eos> is received ''' with tf.variable_scope("Decoder", reuse = w_reuse): # define the function to obtain the predictions out of the given hidden_state_values def get_predictions(h_t_values): ''' This function transforms the h_t_values into a one_hot_type probability vector ''' # apply the output_projection gate to obtain the predictions from the h_t_values predictions = tf.matmul(h_t_values, W_output) + b_output # return the predictions: return predictions # define a function to obtain the values for the next input to the LSTM_cell (y_t values) def get_y_t_values(pred_vals): ''' pred_vals = the tensor of shape [batch_size x content_label_vocab_size] ''' # calculate the next words to be predicted act_preds = tf.argmax(pred_vals, axis=-1) # perform embedding lookup for these act_preds y_t_values = tf.nn.embedding_lookup(content_label_embedding_matrix, act_preds) # return the calculated y_t_values return y_t_values # write the loop function for the raw_rnn: def decoder_loop_function(time, cell_output, cell_state, loop_state): ''' The decoder loop function for the raw_rnn @params compatible with -> https://www.tensorflow.org/api_docs/python/tf/nn/raw_rnn ''' if(cell_state is None): # initial call of the loop function finished = (time >= tf_label_seqs_lengths) next_input = start_tokens next_cell_state = encoder_final_state emit_output = tf.placeholder(tf.float32, shape=(content_label_vocab_size)) next_loop_state = tf.zeros_like(tf_field_encodings, dtype=tf.float32) else: # we define the loop_state as the prev_hybrid attention_vector! prev_attention_vectors = loop_state # extract the prev_attention_vector from the loop state # obtain the predictions for the cell_output preds = get_predictions(cell_output) # obtain the y_t_values from the cell_output values: y_t_values = get_y_t_values(preds) ''' Calculate the attention: ''' # calculate the content_based attention values using the defined module cont_attn = get_content_based_attention_vectors(y_t_values) # calculate the link based attention values link_attn = get_link_based_attention_vectors(prev_attention_vectors) # print "link_attention: ", link_attn # calculate the hybrid_attention hybrid_attn = get_hybrid_attention(cell_output, y_t_values, cont_attn, link_attn) ''' Calculate the x_t vector for next_input value''' # use the hybrid_attn to attend over the encoded_input (to calculate the a_t values) a_t_values = tf.reduce_sum(tf.expand_dims(hybrid_attn, axis=-1) * encoded_input, axis=1) # apply the x_t gate x_t = tf.tanh(tf.matmul(tf.concat([a_t_values, y_t_values], axis=-1), W_d) + b_d) ''' Calculate the finished vector for perfoming computations ''' # define the fninshed parameter for the loop to determine whether to continue or not. if(mode == "training"): finished = (time >= decoder_lengths) elif(mode == "inference"): temp = tf.argmax(preds, axis=-1) # obtain the output predictions in encoded form finished = (temp == rev_content_label_dict['<eos>']) ''' Copy mechanism is left (//TODO: change the following and implement copy mechanism)''' emit_output = preds # The next_input is the x_t vector so calculated: next_input = x_t # The next loop_state is the current content_based attention next_loop_state = hybrid_attn # The next_cell_state is going to be equal to the cell_state. (we_don't tweak it) next_cell_state = cell_state # In both the cases, the return value is same. # return all these created parameters return (finished, next_input, next_cell_state, emit_output, next_loop_state) # use the tf.nn.raw_rnn to define the decoder computations outputs, _, _ = tf.nn.raw_rnn(decoder_cell, decoder_loop_function) # return the outputs obtained from the raw_rnn: return tf.transpose(outputs.stack(), perm=[1, 0, 2]) # ======================================================================== # | Step 6: # ======================================================================== print("\nstep 6: defining the training computations ...") with tf.name_scope("Training_computations"): outputs = decode(tf_label_embedded[:, 0, :], mode="training", decoder_lengths=tf_label_seqs_lengths, w_reuse=None) # print the outputs: print("\tFinal Output_Tensor obtained from the decoder: ", outputs) # ======================================================================== # | Step 7: # ======================================================================== print("\nstep 7: defining the cost function for optimization ...") # define the loss (objective) function for minimization with tf.variable_scope("Loss"): loss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits_v2(logits=outputs, labels=tf_one_hot_label_encodings)) # record the loss summary: loss_summary = tf.summary.scalar("Objective_loss", loss) # ======================================================================== # | Step 8: # ======================================================================== print("\nstep 8: defining the computations for the inference mode ...") # define the computations for the inference mode with tf.variable_scope("inference_computations"): inf_outputs = decode(tf_label_embedded[:, 0, :]) print("\tInference outputs: ", inf_outputs) # ======================================================================== # | Step _: # ======================================================================== print("\nstep _ : setting up the errands for TensorFlow ...") with tf.variable_scope("Errands"): all_summaries = tf.summary.merge_all() print("=============================================================================================================\n\n") # Generate the interface dictionary object for this defined graph interface_dict = { # Tensors for input placeholders into the graph "input": { "field_encodings": tf_field_encodings, "content_encodings": tf_content_encodings, "label_encodings": tf_label_encodings, "input_sequence_lengths": tf_input_seqs_lengths, "label_sequence_lengths": tf_label_seqs_lengths }, # Tensors for embedding matrices: "field_embeddings": field_embedding_matrix, "content_label_embeddings": content_label_embedding_matrix, # Tensor for loass "loss": loss, # Tensor for the inference output: "inference": inf_outputs, # Tensor for training outputs "training_output": outputs, # Tensor for init and summary_ops "summary": all_summaries } # return the built graph object and it's interface dictionary: return graph, interface_dict
# define the weights and biases for the x_t calculation W_d = tf.get_variable(
client_providers.go
// Code generated by skv2. DO NOT EDIT. package v1beta1 import ( certificates_k8s_io_v1beta1 "github.com/solo-io/skv2/pkg/multicluster/internal/k8s/certificates.k8s.io/v1beta1" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" ) /* The intention of these providers are to be used for Mocking. They expose the Clients as interfaces, as well as factories to provide mocked versions
See package `github.com/solo-io/skv2/pkg/multicluster/register` for example */ // Provider for CertificateSigningRequestClient from Clientset func CertificateSigningRequestClientFromClientsetProvider(clients certificates_k8s_io_v1beta1.Clientset) certificates_k8s_io_v1beta1.CertificateSigningRequestClient { return clients.CertificateSigningRequests() } // Provider for CertificateSigningRequest Client from Client func CertificateSigningRequestClientProvider(client client.Client) certificates_k8s_io_v1beta1.CertificateSigningRequestClient { return certificates_k8s_io_v1beta1.NewCertificateSigningRequestClient(client) } type CertificateSigningRequestClientFactory func(client client.Client) certificates_k8s_io_v1beta1.CertificateSigningRequestClient func CertificateSigningRequestClientFactoryProvider() CertificateSigningRequestClientFactory { return CertificateSigningRequestClientProvider } type CertificateSigningRequestClientFromConfigFactory func(cfg *rest.Config) (certificates_k8s_io_v1beta1.CertificateSigningRequestClient, error) func CertificateSigningRequestClientFromConfigFactoryProvider() CertificateSigningRequestClientFromConfigFactory { return func(cfg *rest.Config) (certificates_k8s_io_v1beta1.CertificateSigningRequestClient, error) { clients, err := certificates_k8s_io_v1beta1.NewClientsetFromConfig(cfg) if err != nil { return nil, err } return clients.CertificateSigningRequests(), nil } }
of the clients when they require building within a component.
Notes.ts
/** * @file Notes 笔记 * @author Auto Generated by IconPark */ /* tslint:disable: max-line-length */ /* eslint-disable max-len */ import {ISvgIconProps, IconWrapper} from '../runtime'; export default IconWrapper('notes', (props: ISvgIconProps) => ( '<?xml version="1.0" encoding="UTF-8"?>' + '<svg width="' + props.size + '" height="' + props.size + '" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">' + '<rect width="48" height="48" fill="white" fill-opacity="0.01"/>' + '<path d="M8 6C8 4.89543 8.89543 4 10 4H30L40 14V42C40 43.1046 39.1046 44 38 44H10C8.89543 44 8 43.1046 8 42V6Z" fill="' + props.colors[1] + '" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linejoin="' + props.strokeLinejoin + '"/>' + '<path d="M16 20H32" stroke="' + props.colors[2] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M16 28H32" stroke="' + props.colors[2] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>' + '</svg>' ));
linux32.py
class Linux32:
pass
manage.py
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main():
if __name__ == '__main__': main()
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'smartcity.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv)
platform-style.js
export default function
(appStyle) { return { knob: { width: 38, height: 7, marginTop: 10, borderRadius: 3, backgroundColor: appStyle.agendaKnobColor }, weekdays: { position: 'absolute', left: 0, right: 0, top: 0, flexDirection: 'row', justifyContent: 'space-around', paddingLeft: 12, paddingRight: 12, paddingTop: 15, paddingBottom: 7, backgroundColor: appStyle.weeksBackgroudColor } }; }
platformStyles
teststream.py
# Copyright 2021 Torsten Mehnert # # 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 complatecpp import Stream class TestStream(Stream): __test__ = False def __init__(self, *args, **kwargs): # Don't use super() Stream.__init__(self, *args, **kwargs) self.data = str() def write(self, string, length): self.data += string[0:length] def writeln(self, string, length): self.data += string[0:length] self.data += '\n'
return self.data
def flush(self): pass def str(self):
serve_local.go
package serve import ( "context" "fmt" "github.com/zrepl/zrepl/config" "github.com/zrepl/zrepl/util/socketpair" "net" "sync" ) var localListeners struct { m map[string]*LocalListener // listenerName -> listener init sync.Once mtx sync.Mutex } func GetLocalListener(listenerName string) (*LocalListener) { localListeners.init.Do(func() { localListeners.m = make(map[string]*LocalListener) }) localListeners.mtx.Lock() defer localListeners.mtx.Unlock() l, ok := localListeners.m[listenerName] if !ok { l = newLocalListener() localListeners.m[listenerName] = l } return l } type connectRequest struct { clientIdentity string callback chan connectResult } type connectResult struct { conn net.Conn err error } type LocalListener struct { connects chan connectRequest } func newLocalListener() *LocalListener { return &LocalListener{ connects: make(chan connectRequest), } } // Connect to the LocalListener from a client with identity clientIdentity func (l *LocalListener) Connect(dialCtx context.Context, clientIdentity string) (conn net.Conn, err error) { // place request req := connectRequest{ clientIdentity: clientIdentity, callback: make(chan connectResult), } select { case l.connects <- req: case <-dialCtx.Done(): return nil, dialCtx.Err() } // wait for listener response select { case connRes := <- req.callback: conn, err = connRes.conn, connRes.err case <-dialCtx.Done(): close(req.callback) // sending to the channel afterwards will panic, the listener has to catch this conn, err = nil, dialCtx.Err() } return conn, err } type localAddr struct { S string } func (localAddr) Network() string { return "local" } func (a localAddr) String() string { return a.S } func (l *LocalListener) Addr() (net.Addr) { return localAddr{"<listening>"} } type localConn struct { net.Conn clientIdentity string } func (l localConn) ClientIdentity() string { return l.clientIdentity } func (l *LocalListener) Accept(ctx context.Context) (AuthenticatedConn, error) { respondToRequest := func(req connectRequest, res connectResult) (err error) { getLogger(ctx). WithField("res.conn", res.conn).WithField("res.err", res.err). Debug("responding to client request") defer func() { errv := recover() getLogger(ctx).WithField("recover_err", errv). Debug("panic on send to client callback, likely a legitimate client-side timeout") }() select { case req.callback <- res: err = nil default: err = fmt.Errorf("client-provided callback did block on send") } close(req.callback) return err } getLogger(ctx).Debug("waiting for local client connect requests") var req connectRequest select { case req = <-l.connects: case <-ctx.Done(): return nil, ctx.Err() } getLogger(ctx).WithField("client_identity", req.clientIdentity).Debug("got connect request") if req.clientIdentity == "" { res := connectResult{nil, fmt.Errorf("client identity must not be empty")}
return nil, err } return nil, fmt.Errorf("client connected with empty client identity") } getLogger(ctx).Debug("creating socketpair") left, right, err := socketpair.SocketPair() if err != nil { res := connectResult{nil, fmt.Errorf("server error: %s", err)} if respErr := respondToRequest(req, res); respErr != nil { // returning the socketpair error properly is more important than the error sent to the client getLogger(ctx).WithError(respErr).Error("error responding to client") } return nil, err } getLogger(ctx).Debug("responding with left side of socketpair") res := connectResult{left, nil} if err := respondToRequest(req, res); err != nil { getLogger(ctx).WithError(err).Error("error responding to client") if err := left.Close(); err != nil { getLogger(ctx).WithError(err).Error("cannot close left side of socketpair") } if err := right.Close(); err != nil { getLogger(ctx).WithError(err).Error("cannot close right side of socketpair") } return nil, err } return localConn{right, req.clientIdentity}, nil } func (l *LocalListener) Close() error { // FIXME: make sure concurrent Accepts return with error, and further Accepts return that error, too // Example impl: for each accept, do context.WithCancel, and store the cancel in a list // When closing, set a member variable to state=closed, make sure accept will exit early // and then call all cancels in the list // The code path from Accept entry over check if state=closed to list entry must be protected by a mutex. return nil } type LocalListenerFactory struct { listenerName string } func LocalListenerFactoryFromConfig(g *config.Global, in *config.LocalServe) (f *LocalListenerFactory, err error) { if in.ListenerName == "" { return nil, fmt.Errorf("ListenerName must not be empty") } return &LocalListenerFactory{listenerName: in.ListenerName}, nil } func (lf *LocalListenerFactory) Listen() (AuthenticatedListener, error) { return GetLocalListener(lf.listenerName), nil }
if err := respondToRequest(req, res); err != nil {
nofile.rs
use std::io::{Error, Result}; use libc::{rlimit, rlim_t, RLIMIT_NOFILE}; /// Set nofile limitation. /// /// `CAP_NET_ADMIN` privilege is required if exceeds hard limitation. /// /// Reference: /// - [man](https://man7.org/linux/man-pages/man2/setrlimit.2.html) /// - [shadowsocks-rust](https://github.com/shadowsocks/shadowsocks-rust/blob/master/crates/shadowsocks-service/src/sys/unix/mod.rs) #[cfg(all(unix, not(target_os = "android")))] pub fn set_nofile_limit(nofile: u64) -> Result<()> { let lim = rlimit { rlim_cur: nofile as rlim_t, rlim_max: nofile as rlim_t, }; if unsafe { libc::setrlimit(RLIMIT_NOFILE, &lim as *const _) } < 0 { Err(Error::last_os_error()) } else { Ok(()) } } /// Get current nofile limitation. /// /// Reference: [man](https://man7.org/linux/man-pages/man2/setrlimit.2.html). #[cfg(all(unix, not(target_os = "android")))] pub fn get_nofile_limit() -> Result<(u64, u64)> { let mut lim = rlimit { rlim_cur: 0, rlim_max: 0, }; if unsafe { libc::getrlimit(RLIMIT_NOFILE, &mut lim as *mut _) } < 0
else { Ok((lim.rlim_cur as u64, lim.rlim_max as u64)) } }
{ Err(Error::last_os_error()) }
ellipse.rs
use std::cell::RefCell; use std::collections::HashMap; use std::f32::consts::PI; use std::rc::Rc; use crate::common::context::Context; use crate::common::svg::{CX_ATTR, CY_ATTR, DrawType, ParsedStyle, RX_ATTR, RY_ATTR}; use crate::common::svg; use super::ViewBox; pub fn handle_ellipse<'a>(context: &mut Context, ellipse: roxmltree::Node, style: Rc<RefCell<ParsedStyle>>, parent_attributes: Option<HashMap<&str, &str>>, root: &'a roxmltree::Document<'a>)
{ let scale = context.device.density; let mut cx = "0"; let mut cy = "0"; let mut rx = "0"; let mut ry = "0"; if let Some(map) = parent_attributes { if let Some(cx_) = map.get("cx") { cx = &*cx_ } if let Some(cy_) = map.get("cy") { cy = &*cy_ } if let Some(rx_) = map.get("rx") { rx = &*rx_ } if let Some(ry_) = map.get("ry") { ry = &*ry_ } } if let Some(cx_) = ellipse.attribute(CX_ATTR) { cx = &*cx_ } if let Some(cy_) = ellipse.attribute(CY_ATTR) { cy = &*cy_ } if let Some(rx_) = ellipse.attribute(RX_ATTR) { rx = &*rx_ } if let Some(ry_) = ellipse.attribute(RY_ATTR) { ry = &*ry_ } let cx = cx.parse::<f32>().unwrap_or(0f32) * scale; let cy = cy.parse::<f32>().unwrap_or(0f32) * scale; let rx = rx.parse::<f32>().unwrap_or(0f32) * scale; let ry = ry.parse::<f32>().unwrap_or(0f32) * scale; context.save(); context.begin_path(); context.ellipse(cx, cy, rx, ry, 0f32, 0f32, 2f32 * PI, false); let view_box = ViewBox::new(cx - rx, cy - ry, cx + rx, cy + ry); svg::handle_drawing(context, style, None, DrawType::FillStroke, None, root, &view_box); context.restore(); }
policies-and-regulations.component.ts
import { Component, OnInit, ViewChild } from '@angular/core'; import { STColumn, STPage, STComponent } from '@delon/abc'; import { publicPageConfig, pageOnChange } from 'infrastructure/expression'; import { Router } from '@angular/router'; import { EventEmiter } from 'infrastructure/eventEmiter'; import { RegulationServiceProxy } from '@shared/service-proxies/service-proxies'; import { PublicModel } from 'infrastructure/public-model'; import { dateTrans } from 'infrastructure/regular-expression'; import { PublicFormComponent } from '../public/public-form.component'; @Component({ selector: 'app-policies-and-regulations', templateUrl: '../public/public-form.html', styleUrls: [] }) export class PoliciesAndRegulationsComponent extends PublicFormComponent implements OnInit { @ViewChild('treeCom') treeCom; @ViewChild('st') st: STComponent; params: any = { page: 1, size: 200, sort: "", isAsc: false, orderby: "", totalCount: 200, search: "", startTime: "", endTime: "", }; nzPlaceHolder = ['发布开始时间', '发布结束时间'] columns: STColumn[] = [ // { title: '法规编号', index: 'regulationCode' }, { title: '法规类型', index: 'regulationType' }, { title: '标题名称', index: 'title' }, { title: '颁布机关', index: 'issueOrg' }, { title: '发布时间', index: 'creationTime', type: 'date' }, { title: '生效日期', index: 'issueDate', type: 'date' }, // { // title: '内容存放路径', index: 'contentUrl' // }, { title: '最近修改时间', index: 'lastUpdateTime', type: 'date' }, { title: '最近操作人账号', index: 'lastUpdateUserCode' }, // { // title: '最近操作人名字', index: 'lastUpdateUserName' // }, { title: '浏览量', index: 'visitCount' }, // { // title: '删除人id', index: '删除人id' // }, { title: '操作', className: 'text-center', buttons: [ { text: '<font class="stButton">详情</font>', click: (record: any) => { this.router.navigate([`/app/content-manage/policiesAndRegulationsDetailsComponent/${record.id}`, { operate: 1 }]); } }, { text: '<font class="stButton">编辑</font>', click: (record: any) => { this.router.navigate([`/app/content-manage/policiesAndRegulationsDetailsComponent/${record.id}`, { operate: 2 }]); } }, { text: '<font class="stButton">删除</font>', click: (record: any) => { this._publicModel.isDeleteModal(() => { this._regulationServiceProxy.post_DeleteRegulationByIdAsync(record.id).subscribe(data => { this.init();
}); } }, ] } ]; pageConfig: STPage = publicPageConfig; constructor(private _eventEmiter: EventEmiter, private _publicModel: PublicModel, private _regulationServiceProxy: RegulationServiceProxy, private router: Router) { super(); } ngOnInit() { let _self = this; this.init(); this._eventEmiter.on('init', () => { _self.init(); }); } /** * 初始化 */ init() { this.workFlow_NodeAuditorRecords(this.params); } /** * 回车 */ onEnter(v) { if (v.which === 13) { this.query(); } } /** * 获取列表 */ workFlow_NodeAuditorRecords(params?: any) { this.formResultData = []; this.isSearchForm = true; if (params.startTime) { params.startTime = dateTrans(params.startTime) + " 00:00:00" } if (params.endTime) { params.endTime = dateTrans(params.endTime) + " 23:59:59" } this._regulationServiceProxy.regulationListAsync(params).subscribe(data => { this.isSearchForm = false; if (data.data) { this.formResultData = data.data; } }) } /** * 点击查询 */ query() { this.params.page = 1; if (this.rangeTime) { this.params.startTime = this.rangeTime[0]; this.params.endTime = this.rangeTime[1]; } this.params.search = this.searchKey; this.workFlow_NodeAuditorRecords(this.params); } change(v) { pageOnChange(v, this.params, () => { this.workFlow_NodeAuditorRecords(this.params); }) } refresh() { this.query(); } add() { this.router.navigate([`/app/content-manage/policiesAndRegulationsDetailsComponent/1`, { operate: 0 }]); } resetSearchFliterForm() { this.fliterForm.reset(); this.params = { page: 1, size: 200, sort: "", isAsc: false, orderby: "", totalCount: 200, search: "", startTime: "", endTime: "", }; this.query(); } }
})
bundle_mutable_mount.go
// Copyright © 2018 One Concern package cmd import ( "context" daemonizer "github.com/jacobsa/daemonize" "github.com/oneconcern/datamon/pkg/core" "github.com/spf13/cobra" ) // Mount a mutable view of a bundle var mutableMountBundleCmd = &cobra.Command{ Use: "new", Short: "Create a bundle incrementally with filesystem operations", Long: "Write directories and files to the mountpoint. Unmount or send SIGINT to this process to save.", Run: func(cmd *cobra.Command, args []string) { ctx := context.Background() contributor, err := paramsToContributor(datamonFlags) if err != nil { wrapFatalln("populate contributor struct", err) return } // cf. comments on runDaemonized in bundle_mount.go if datamonFlags.bundle.Daemonize { runDaemonized() return } remoteStores, err := paramsToDatamonContext(ctx, datamonFlags) if err != nil { onDaemonError("create remote stores", err) return } consumableStore, err := paramsToSrcStore(ctx, datamonFlags, true) if err != nil { onDaemonError("create source store", err) return } bd := core.NewBDescriptor( core.Message(datamonFlags.bundle.Message), core.Contributor(contributor), ) bundleOpts := paramsToBundleOpts(remoteStores) bundleOpts = append(bundleOpts, core.Repo(datamonFlags.repo.RepoName)) bundleOpts = append(bundleOpts, core.ConsumableStore(consumableStore)) bundleOpts = append(bundleOpts, core.BundleID(datamonFlags.bundle.ID)) bundle := core.NewBundle(bd, bundleOpts..., ) fs, err := core.NewMutableFS(bundle, datamonFlags.bundle.DataPath) if err != nil { onDaemonError("create mutable filesystem", err) return } err = fs.MountMutable(datamonFlags.bundle.MountPath) if err != nil { onDaemonError("mount mutable filesystem", err) return } registerSIGINTHandlerMount(datamonFlags.bundle.MountPath) if err = daemonizer.SignalOutcome(nil); err != nil { wrapFatalln("send event from possibly daemonized process", err) return } if err = fs.JoinMount(ctx); err != nil { wrapFatalln("block on os mount", err) return } if err = fs.Commit(); err != nil { wrapFatalln("upload bundle from mutable fs", err) return } infoLogger.Printf("bundle: %v", bundle.BundleID) }, PreRun: func(cmd *cobra.Command, args []string) { config.populateRemoteConfig(&datamonFlags) }, } func init() {
requiredFlags := []string{addRepoNameOptionFlag(mutableMountBundleCmd)} addDaemonizeFlag(mutableMountBundleCmd) addDataPathFlag(mutableMountBundleCmd) requiredFlags = append(requiredFlags, addMountPathFlag(mutableMountBundleCmd)) requiredFlags = append(requiredFlags, addCommitMessageFlag(mutableMountBundleCmd)) for _, flag := range requiredFlags { err := mutableMountBundleCmd.MarkFlagRequired(flag) if err != nil { wrapFatalln("mark required flag", err) return } } mountBundleCmd.AddCommand(mutableMountBundleCmd) }
index.js
import MoveDates from './move-dates'
sampleEventArray } from './sample-data' export { MoveDates, sampleDateAdjustments, sampleEventArray }
import { sampleDateAdjustments,
endpoint.py
from typing import cast, Generic, TypeVar, Union from intervals.infinity import Infinity from intervals.comparable import Comparable T = TypeVar('T', bound=Comparable) class Endpoint(Generic[T]): value: Union[T, Infinity] open: bool def __init__(self, value: Union[T, Infinity], *, open: bool=False) -> None: self.value = value self.open = open def __eq__(self, other: object) -> bool: if type(self) != type(other): return False other = cast(Endpoint[T], other) return all(( self.value == other.value, self.open == other.open, )) def __lt__(self, other: object) -> bool: if type(self) != type(other): other = Endpoint(cast(T, other)) else: other = cast(Endpoint[T], other) if isinstance(other.value, Infinity): return other.value > self.value return self.value < other.value
else: other = cast(Endpoint[T], other) if isinstance(other.value, Infinity): return other.value < self.value return self.value > other.value def __le__(self, other: object) -> bool: return not self > other def __ge__(self, other: object) -> bool: return not self < other
def __gt__(self, other: object) -> bool: if type(self) != type(other): other = Endpoint(cast(T, other))
server.py
from bottle import route, get, post from bottle import run, debug from bottle import request, response, redirect, template from bottle import static_file import dataset import json from bottle import default_app #http://localhost:8090 @route("/") def get_midterm(): todo_list_db = dataset.connect('sqlite:///todo_list.db') todo_table = todo_list_db.get_table('todo') items = todo_table.find() items = [ dict(x) for x in list(items) ] return template("Midterm", items=items) @route("/static/png/<filename:re:.*\.png") @route("/image/<filename:re:.*\.png") def get_picture(): return static_file(filename="the_boat.png", root="static", mimetype="image/png") @route("/static/<filename:path>") def get_static(filename): return static_file(filename=filename, root="static") @route("/delete/<id>") def get_delete(id): id = int(id) try: todo_list_db = dataset.connect('sqlite:///todo_list.db') todo_table = todo_list_db.get_table('todo') print(f"We need to delete id# {id}...") todo_table.delete(id=id) except Exception as e: response.status="409 Bad Request:"+str(e) return return template("deleted", id=id) @get("/insert") def get_insert(): return template("insert") @post("/insert") def post_insert(): course_number = request.forms.get('course_number') print("course_number=", course_number) course_name = request.forms.get('course_name') try: todo_list_db = dataset.connect('sqlite:///todo_list.db') todo_table = todo_list_db.get_table('todo') todo_table.insert({ 'course_number' : course_number.strip(), 'course_name' : course_name.strip(), 'done' : 1 }) except Exception as e: response.status="409 Bad Request:"+str(e) return return redirect('/') @get("/edit/<id>") def get_edit(id):
@post("/edit") def post_edit(): id = request.forms.get('id') id = int(id) course_number = request.forms.get('course_number') course_name = request.forms.get('course_name') print("course_number=", course_number) try: todo_list_db = dataset.connect('sqlite:///todo_list.db') todo_table = todo_list_db.get_table('todo') todo_table.update({ 'id' : id, 'course_number' : course_number.strip(), 'course_name' : course_name.strip() }, ['id']) except Exception as e: response.status="409 Bad Request:"+str(e) return return redirect('/') if __name__ == "__main__": debug(True) run(host="localhost", port=8090) else: application = default_app()
try: todo_list_db = dataset.connect('sqlite:///todo_list.db') todo_table = todo_list_db.get_table('todo') items = list(todo_table.find(id=id)) if len(items) != 1: response.status="404 Not Found:"+str(id) return items = [ dict(x) for x in items ] print(items) print(items[0]) except Exception as e: print(e) response.status="409 Bad Request:"+str(e) return return template("edit", item=items[0]) # put something here
synchronizer_test.go
package synchronizer_test import ( "context" "fmt" "testing" "time" iam_cnrm_cloud_google_com_v1beta1 "github.com/nais/liberator/pkg/apis/iam.cnrm.cloud.google.com/v1beta1" nais_io_v1 "github.com/nais/liberator/pkg/apis/nais.io/v1" nais_io_v1alpha1 "github.com/nais/liberator/pkg/apis/nais.io/v1alpha1" sql_cnrm_cloud_google_com_v1beta1 "github.com/nais/liberator/pkg/apis/sql.cnrm.cloud.google.com/v1beta1" "github.com/nais/liberator/pkg/crd" liberator_scheme "github.com/nais/liberator/pkg/scheme" "github.com/stretchr/testify/assert" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/nais/naiserator/pkg/controllers" "github.com/nais/naiserator/pkg/naiserator/config" "github.com/nais/naiserator/pkg/resourcecreator/google" "github.com/nais/naiserator/pkg/resourcecreator/ingress" "github.com/nais/naiserator/pkg/resourcecreator/resource" naiserator_scheme "github.com/nais/naiserator/pkg/scheme" "github.com/nais/naiserator/pkg/synchronizer" "github.com/nais/naiserator/pkg/test/fixtures" ) type testRig struct { kubernetes *envtest.Environment client client.Client manager ctrl.Manager synchronizer reconcile.Reconciler scheme *runtime.Scheme } func newTestRig(options resource.Options) (*testRig, error) { rig := &testRig{} crdPath := crd.YamlDirectory() rig.kubernetes = &envtest.Environment{ CRDDirectoryPaths: []string{crdPath}, } cfg, err := rig.kubernetes.Start() if err != nil { return nil, fmt.Errorf("setup Kubernetes test environment: %w", err) } rig.scheme, err = liberator_scheme.All() if err != nil { return nil, fmt.Errorf("setup scheme: %w", err)
Scheme: rig.scheme, }) if err != nil { return nil, fmt.Errorf("initialize Kubernetes client: %w", err) } rig.manager, err = ctrl.NewManager(rig.kubernetes.Config, ctrl.Options{ Scheme: rig.scheme, MetricsBindAddress: "0", }) if err != nil { return nil, fmt.Errorf("initialize manager: %w", err) } syncerConfig := config.Config{ Synchronizer: config.Synchronizer{ SynchronizationTimeout: 2 * time.Second, RolloutCheckInterval: 5 * time.Second, RolloutTimeout: 20 * time.Second, }, } listers := naiserator_scheme.GenericListers() if len(options.GoogleProjectId) > 0 { listers = append(listers, naiserator_scheme.GCPListers()...) } applicationReconciler := controllers.NewAppReconciler(synchronizer.Synchronizer{ Client: rig.client, Config: syncerConfig, ResourceOptions: options, RolloutMonitor: make(map[client.ObjectKey]synchronizer.RolloutMonitor), Scheme: rig.scheme, SimpleClient: rig.client, Listers: listers, }) err = applicationReconciler.SetupWithManager(rig.manager) if err != nil { return nil, fmt.Errorf("setup synchronizer with manager: %w", err) } rig.synchronizer = applicationReconciler return rig, nil } // This test sets up a complete in-memory Kubernetes rig, and tests the reconciler (Synchronizer) against it. // These tests ensure that resources are actually created or updated in the cluster, // and that orphaned resources are cleaned up properly. // The validity of resources generated are not tested here. func TestSynchronizer(t *testing.T) { resourceOptions := resource.NewOptions() rig, err := newTestRig(resourceOptions) if err != nil { t.Errorf("unable to run synchronizer integration tests: %s", err) t.FailNow() } defer rig.kubernetes.Stop() // Allow no more than 15 seconds for these tests to run ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) defer cancel() // Check that listing all resources work. // If this test fails, it might mean CRDs are not registered in the test rig. listers := naiserator_scheme.GenericListers() listers = append(listers, naiserator_scheme.GCPListers()...) for _, list := range listers { err = rig.client.List(ctx, list) assert.NoError(t, err) } // Create Application fixture app := fixtures.MinimalApplication() app.SetAnnotations(map[string]string{ nais_io_v1.DeploymentCorrelationIDAnnotation: "deploy-id", }) // Test that a resource has been created in the fake cluster testResource := func(resource client.Object, objectKey client.ObjectKey) { err := rig.client.Get(ctx, objectKey, resource) assert.NoError(t, err) assert.NotNil(t, resource) } // Test that a resource does not exist in the fake cluster testResourceNotExist := func(resource client.Object, objectKey client.ObjectKey) { err := rig.client.Get(ctx, objectKey, resource) assert.True(t, errors.IsNotFound(err), "the resource found in the cluster should not be there") } // Ensure that the application's namespace exists err = rig.client.Create(ctx, &corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ Name: app.GetNamespace(), }, }) assert.NoError(t, err) // Store the Application resource in the cluster before testing commences. // This simulates a deployment into the cluster which is then picked up by the // informer queue. err = rig.client.Create(ctx, app) if err != nil { t.Fatalf("Application resource cannot be persisted to fake Kubernetes: %s", err) } // Create an Ingress object that should be deleted once processing has run. ast := resource.NewAst() app.Spec.Ingresses = []nais_io_v1.Ingress{"https://foo.bar"} err = ingress.Create(app, ast, resourceOptions, app.Spec.Ingresses, app.Spec.Liveness.Path, app.Spec.Service.Protocol, app.Annotations) assert.NoError(t, err) ing := ast.Operations[0].Resource.(*networkingv1.Ingress) app.Spec.Ingresses = []nais_io_v1.Ingress{} err = rig.client.Create(ctx, ing) if err != nil || len(ing.Spec.Rules) == 0 { t.Fatalf("BUG: error creating ingress for testing: %s", err) } // Create an Ingress object with application label but without ownerReference. // This resource should persist in the cluster even after synchronization. app.Spec.Ingresses = []nais_io_v1.Ingress{"https://foo.bar"} err = ingress.Create(app, ast, resourceOptions, app.Spec.Ingresses, app.Spec.Liveness.Path, app.Spec.Service.Protocol, app.Annotations) assert.NoError(t, err) ing = ast.Operations[1].Resource.(*networkingv1.Ingress) ing.SetName("disowned-ingress") ing.SetOwnerReferences(nil) app.Spec.Ingresses = []nais_io_v1.Ingress{} err = rig.client.Create(ctx, ing) if err != nil || len(ing.Spec.Rules) == 0 { t.Fatalf("BUG: error creating ingress 2 for testing: %s", err) } // Run synchronization processing. // This will attempt to store numerous resources in Kubernetes. req := ctrl.Request{ NamespacedName: types.NamespacedName{ Namespace: app.Namespace, Name: app.Name, }, } result, err := rig.synchronizer.Reconcile(ctx, req) assert.NoError(t, err) assert.Equal(t, ctrl.Result{}, result) // Test that the Application was updated successfully after processing, // and that the hash is present. objectKey := client.ObjectKey{Name: app.Name, Namespace: app.Namespace} persistedApp := &nais_io_v1alpha1.Application{} err = rig.client.Get(ctx, objectKey, persistedApp) hash, _ := app.Hash() assert.NotNil(t, persistedApp) assert.NoError(t, err) assert.Equalf(t, hash, persistedApp.Status.SynchronizationHash, "Application resource hash in Kubernetes matches local version") // Test that the status field is set with RolloutComplete assert.Equalf(t, nais_io_v1.EventSynchronized, persistedApp.Status.SynchronizationState, "Synchronization state is set") assert.Equalf(t, "deploy-id", persistedApp.Status.CorrelationID, "Correlation ID is set") // Test that a base resource set was created successfully testResource(&appsv1.Deployment{}, objectKey) testResource(&corev1.Service{}, objectKey) testResource(&corev1.ServiceAccount{}, objectKey) // Test that the Ingress resource was removed testResourceNotExist(&networkingv1.Ingress{}, objectKey) // Test that a Synchronized event was generated and has the correct deployment correlation id eventList := &corev1.EventList{} err = rig.client.List(ctx, eventList) assert.NoError(t, err) assert.Len(t, eventList.Items, 1) assert.EqualValues(t, 1, eventList.Items[0].Count) assert.Equal(t, "deploy-id", eventList.Items[0].Annotations[nais_io_v1.DeploymentCorrelationIDAnnotation]) assert.Equal(t, nais_io_v1.EventSynchronized, eventList.Items[0].Reason) // Run synchronization processing again, and check that resources still exist. persistedApp.DeepCopyInto(app) app.Status.SynchronizationHash = "" app.Annotations[nais_io_v1.DeploymentCorrelationIDAnnotation] = "new-deploy-id" err = rig.client.Update(ctx, app) assert.NoError(t, err) result, err = rig.synchronizer.Reconcile(ctx, req) assert.NoError(t, err) assert.Equal(t, ctrl.Result{}, result) testResource(&appsv1.Deployment{}, objectKey) testResource(&corev1.Service{}, objectKey) testResource(&corev1.ServiceAccount{}, objectKey) testResource(&networkingv1.Ingress{}, client.ObjectKey{Name: "disowned-ingress", Namespace: app.Namespace}) // Test that the naiserator event was updated with increased count and new correlation id err = rig.client.List(ctx, eventList) assert.NoError(t, err) assert.Len(t, eventList.Items, 1) assert.EqualValues(t, 2, eventList.Items[0].Count) assert.Equal(t, "new-deploy-id", eventList.Items[0].Annotations[nais_io_v1.DeploymentCorrelationIDAnnotation]) assert.Equal(t, nais_io_v1.EventSynchronized, eventList.Items[0].Reason) } func TestSynchronizerResourceOptions(t *testing.T) { resourceOptions := resource.NewOptions() resourceOptions.CNRMEnabled = true resourceOptions.GoogleProjectId = "something" resourceOptions.GoogleCloudSQLProxyContainerImage = "cloudsqlproxy" rig, err := newTestRig(resourceOptions) if err != nil { t.Errorf("unable to run synchronizer integration tests: %s", err) t.FailNow() } defer rig.kubernetes.Stop() // Allow no more than 15 seconds for these tests to run ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) defer cancel() // Create Application fixture app := fixtures.MinimalApplication() app.Spec.GCP = &nais_io_v1.GCP{ SqlInstances: []nais_io_v1.CloudSqlInstance{ { Type: nais_io_v1.CloudSqlInstanceTypePostgres11, Databases: []nais_io_v1.CloudSqlDatabase{ { Name: app.Name, }, }, }, }, } // Test that the team project id is fetched from namespace annotation, and used to create the sql proxy sidecar testProjectId := "test-project-id" testNamespace := &corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ Name: app.GetNamespace(), }, } testNamespace.SetAnnotations(map[string]string{ google.ProjectIdAnnotation: testProjectId, }) err = rig.client.Create(ctx, testNamespace) assert.NoError(t, err) // Ensure that namespace for Google IAM service accounts exists err = rig.client.Create(ctx, &corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ Name: google.IAMServiceAccountNamespace, }, }) assert.NoError(t, err) // Store the Application resource in the cluster before testing commences. // This simulates a deployment into the cluster which is then picked up by the // informer queue. err = rig.client.Create(ctx, app) if err != nil { t.Fatalf("Application resource cannot be persisted to fake Kubernetes: %s", err) } req := ctrl.Request{ NamespacedName: types.NamespacedName{ Namespace: app.Namespace, Name: app.Name, }, } result, err := rig.synchronizer.Reconcile(ctx, req) assert.NoError(t, err) assert.Equal(t, ctrl.Result{}, result) deploy := &appsv1.Deployment{} sqlinstance := &sql_cnrm_cloud_google_com_v1beta1.SQLInstance{} sqluser := &sql_cnrm_cloud_google_com_v1beta1.SQLInstance{} sqldatabase := &sql_cnrm_cloud_google_com_v1beta1.SQLInstance{} iampolicymember := &iam_cnrm_cloud_google_com_v1beta1.IAMPolicyMember{} err = rig.client.Get(ctx, req.NamespacedName, deploy) assert.NoError(t, err) expectedInstanceName := fmt.Sprintf("-instances=%s:%s:%s=tcp:5432", testProjectId, google.Region, app.Name) assert.Equal(t, expectedInstanceName, deploy.Spec.Template.Spec.Containers[1].Command[2]) err = rig.client.Get(ctx, req.NamespacedName, sqlinstance) assert.NoError(t, err) assert.Equal(t, testProjectId, sqlinstance.Annotations[google.ProjectIdAnnotation]) err = rig.client.Get(ctx, req.NamespacedName, sqluser) assert.NoError(t, err) assert.Equal(t, testProjectId, sqluser.Annotations[google.ProjectIdAnnotation]) err = rig.client.Get(ctx, req.NamespacedName, sqldatabase) assert.NoError(t, err) assert.Equal(t, testProjectId, sqldatabase.Annotations[google.ProjectIdAnnotation]) err = rig.client.Get(ctx, req.NamespacedName, iampolicymember) assert.NoError(t, err) assert.Equal(t, testProjectId, iampolicymember.Annotations[google.ProjectIdAnnotation]) }
} rig.client, err = client.New(cfg, client.Options{
index.js
import CaBreadcrumb from './CaBreadcrumb.vue'; import CaBreadcrumbItem from './CaBreadcrumbItem.vue'; CaBreadcrumb.install = (Vue) => { Vue.component(CaBreadcrumb.name, CaBreadcrumb); Vue.component(CaBreadcrumbItem.name, CaBreadcrumbItem); };
export default CaBreadcrumb;
test_chop_chains_with_plotting.py
''' Make sure orbit plotting can still occur after chopping chains. ''' import orbitize from orbitize import driver, DATADIR import multiprocessing as mp def verify_results_data(res, sys): # Make data attribute from System is carried forward to Result class assert res.data is not None # Make sure the data tables are equivalent between Result and System class res_data = res.data.to_pandas() sys_data = sys.data_table.to_pandas() assert res_data.equals(sys_data) == True # Make sure no error results when making the final orbit plot try: epochs = sys.data_table['epoch'] res.plot_orbits( object_to_plot = 1, num_orbits_to_plot = 10, start_mjd = epochs[0] ) except: raise Exception("Plotting orbits failed.") def test_chop_chains(): ''' First run MCMC sampler to generate results object and make a call to 'chop_chains'
filename = "{}/HD4747.csv".format(DATADIR) num_secondary_bodies = 1 system_mass = 0.84 plx = 53.18 mass_err = 0.04 plx_err = 0.12 num_temps = 5 num_walkers = 40 num_threads = mp.cpu_count() total_orbits = 5000 burn_steps = 10 thin = 2 my_driver = driver.Driver( filename, 'MCMC', num_secondary_bodies, system_mass, plx, mass_err=mass_err, plx_err=plx_err, system_kwargs={'fit_secondary_mass':True, 'tau_ref_epoch':0}, mcmc_kwargs={'num_temps':num_temps, 'num_walkers':num_walkers, 'num_threads':num_threads}) my_driver.sampler.run_sampler(total_orbits, burn_steps=burn_steps, thin=thin) my_driver.sampler.chop_chains(burn=25, trim=25) mcmc_sys = my_driver.system mcmc_result = my_driver.sampler.results verify_results_data(mcmc_result, mcmc_sys) if __name__ == '__main__': test_chop_chains()
function afterwards. '''
city_spelling_matcher.py
import difflib import json def
(): """This opens the JSON obj for all the city names.""" with open('apps/data/spellcheck/spell_check_opject2.json', 'r') as myfile: data = myfile.read() obj = json.loads(data) return(obj) def check_spelling(data, words): """This function taks a city name and check for the closest match in a list of words.""" jsn = {} id_manager = [] for i in difflib.get_close_matches(words.lower(), list(data.keys()), n=15): if list(data[i].values())[0]['ID'] not in id_manager: id_manager.append(list(data[i].values())[0]['ID']) jsn[list(data[i].keys())[0]] = list(data[i].values())[0] else: pass if len(jsn) > 0 and len(jsn) <= 5: res = jsn elif len(jsn) > 5: short_dict = {} for i in list(jsn.keys())[0:5]: short_dict[i] = jsn[i] res = short_dict else: if len(words.split()) <= 1: res = {'No Data': f'Cannot find {words}, please include the State name along with the City you are searching for.'} else: res = {'No Data': f'Cannot find {words}, please check the spelling or search for another City.'} return(res) def force_id(data, words): """This funtion takes single word that you want to search for in a array and finds the most similarly spelled word. If there are no close matches it will return the city data for Seattle""" jsn = {} res = difflib.get_close_matches(words.lower(), list(data.keys()), n=1) if len(res) > 0: jsn['data'] = data[res[0]] jsn = jsn['data'][list(jsn['data'].keys())[0]]['ID'] else: jsn['data'] = data['Seattle WA'] jsn = jsn['data']['Seattle, WA']['ID'] return(jsn)
data_loader
colour.rs
use rgb_int::Rgba32; pub const CURSOR: Rgba32 = Rgba32::new(255, 255, 0, 64); pub const FLOOR_BACKGROUND: Rgba32 = Rgba32::new_grey(0); pub const FLOOR_FOREGROUND: Rgba32 = Rgba32::hex_rgb(0x8b602c); pub const WALL_FRONT: Rgba32 = Rgba32::new_rgb(0xD0, 0x8C, 0x15); pub const WINDOWS: Rgba32 = Rgba32::new_rgb(0xBE, 0xED, 0xFF); pub const DOOR: Rgba32 = Rgba32::hex_rgb(0x634015); pub const DOOR_BORDER: Rgba32 = Rgba32::hex_rgb(0x362d11); pub const PLAYER: Rgba32 = Rgba32::new_grey(255); pub const WOOD: Rgba32 = Rgba32::hex_rgb(0x362d11); pub const LEAF: Rgba32 = Rgba32::hex_rgb(0x376315); pub const RAIN: Rgba32 = Rgba32::new_rgb(50, 120, 150); pub const RAIN_REMEMBERED: Rgba32 = Rgba32::new_rgb(80, 90, 100); pub const RUINS_WALL_TOP: Rgba32 = Rgba32::new_rgb(31, 31, 31); pub const RUINS_WALL_FRONT_BACKGROUND: Rgba32 = Rgba32::new_rgb(63, 63, 63); pub const RUINS_WALL_FRONT_FOREGROUND: Rgba32 = Rgba32::new_rgb(95, 95, 95); pub const RUINS_FLOOR_BACKGROUND: Rgba32 = Rgba32::new_rgb(0, 0, 0); pub const RUINS_FLOOR_FOREGROUND: Rgba32 = Rgba32::new_rgb(127, 127, 127); pub const ALTAR_FOREGROUND: Rgba32 = Rgba32::new_rgb(185, 185, 185); pub const ALTAR_TOP_FOREGROUND: Rgba32 = Rgba32::new_rgb(185, 185, 185); pub const BULLETIN_TEXT: Rgba32 = Rgba32::new_rgb(0, 0, 0); pub const LAMP_BASE: Rgba32 = Rgba32::new_rgb(50, 50, 50); pub const LAMP_LIGHT: Rgba32 = Rgba32::new_rgb(185, 185, 0); pub const LAMP_OFF: Rgba32 = Rgba32::new_rgb(63, 63, 63); pub const PIER_FLOOR_BACKGROUND: Rgba32 = WOOD.saturating_scalar_mul_div(1, 2); pub const PIER_FLOOR_FOREGROUND: Rgba32 = WOOD; pub const GRASS: Rgba32 = Rgba32::hex_rgb(0x154712); pub const ROCK: Rgba32 = Rgba32::hex_rgb(0x2d1d16); pub const FLOWER: Rgba32 = Rgba32::new_rgb(255, 255, 255); pub const BED_MATRESS: Rgba32 = Rgba32::new_rgb(185, 0, 0); pub const BED_HEAD: Rgba32 = Rgba32::new_rgb(185, 185, 185); pub const BED_LEGS: Rgba32 = Rgba32::new_rgb(63, 63, 63); pub const CHAIR: Rgba32 = Rgba32::hex_rgb(0x0c3a44); pub const TEAPOT: Rgba32 = Rgba32::hex_rgb(0x8c0bcb); pub const TEA: Rgba32 = Rgba32::hex_rgb(0x2ec110); pub const GUMBOOTS: Rgba32 = Rgba32::new_rgb(255, 255, 0); pub const UMBRELLA: Rgba32 = Rgba32::new_rgb(185, 0, 255); pub const UMBRELLA_HANDLE: Rgba32 = Rgba32::new_rgb(63, 63, 63); pub const SHOVEL_BLADE: Rgba32 = Rgba32::new_grey(185); pub const SHOVEL_HANDLE: Rgba32 = WOOD; pub const MAP_BACKGROUND: Rgba32 = Rgba32::hex_rgb(0xceb168); pub const MAP_FOREGROUND: Rgba32 = Rgba32::new_rgb(0, 0, 0); pub const WEATHER_REPORT_BACKGROUND: Rgba32 = Rgba32::new_grey(185); pub const WEATHER_REPORT_FOREGROUND: Rgba32 = Rgba32::new_rgb(0, 0, 0); pub const LANTERN_HANDLE: Rgba32 = Rgba32::new_rgb(255, 255, 255); pub const LANTERN_LIGHT: Rgba32 = Rgba32::new_rgb(255, 255, 0);
pub const DITCH_FOREGROUND: Rgba32 = Rgba32::hex_rgb(0x372405); pub const DITCH_BACKGROUND: Rgba32 = Rgba32::hex_rgb(0x291b04);
pub const CROWBAR_SHAFT: Rgba32 = Rgba32::new_rgb(185, 63, 63); pub const CROWBAR_TIP: Rgba32 = Rgba32::new_rgb(127, 127, 127);
CollectionPage_20200530182134.js
import React, { useState } from 'react' import { useStaticQuery, graphql } from 'gatsby' import Image from '@components/Image' import DescriptionCard from '@components/DescriptionCard' import IndexCard from '@components/IndexCard' import Button from '@components/Button' import { Grid } from '@components/Grid' import './CollectionPage.css' import { pages as PAGES } from './collections.json' class CollectionPage { constructor() { this.myRef = React.createRef() const data = useStaticQuery(graphql` query { gridImages: allFile(filter: { name: { regex: "/page-1-grid-*/" }, extension: { regex: "/(jpeg|jpg|gif|png)/" }, sourceInstanceName: { eq: "images"}}) { edges { node { childImageSharp { fluid(maxWidth: 300) { ...GatsbyImageSharpFluid } } } } } allThumbImages: allFile(filter: { name: { regex: "/thumb/" }, extension: { regex: "/(jpeg|jpg|gif|png)/" }, sourceInstanceName: { eq: "images"}}) { edges { node { name childImageSharp { fluid(maxWidth: 300, maxHeight: 240) { ...GatsbyImageSharpFluid } } } } } allLargeImages: allFile(filter: { name: { regex: "/large/" }, extension: { regex: "/(jpeg|jpg|gif|png)/" }, sourceInstanceName: { eq: "images"}}) { edges { node { name childImageSharp { fluid(maxWidth: 300) { ...GatsbyImageSharpFluid } } } } } } `) const [page, setPage] = useState(0) function incrementPage() { if (page < PAGES.length - 1) setPage(page + 1) } function decrementPage() { if (page > 0) setPage(page - 1) } function getPage() { return page < PAGES.length ? PAGES[page] : 'dummy' } function getThumbImage() { return data.allThumbImages.edges.find((image) => { return image.node.name === `page-${page + 1}-thumb` }) || data.allThumbImages.edges.find((image) => { return image.node.name === `page-1-thumb` }) } function getLargeImage() { return data.allLargeImages.edges.find((image) => { return image.node.name === `page-${page + 1}-large` }) || data.allLargeImages.edges.find((image) => { return image.node.name === `page-1-large` }) } var prevScrollpos = window.pageYOffset window.onscroll = function () { var currentScrollPos = window.pageYOffset this.console.log(currentScrollPos) this.console.log(this.myRef.current) // if (currentScrollPos > 70) { // this.document.getElementsByClassName("btn-container").style.position = "fixed"; // if (currentScrollPos > 70 && prevScrollpos > currentScrollPos) { // this.document.getElementsByClassName("btn-container").style.top = "0"; // } else { // this.document.getElementsByClassName("btn-container").style.top = "-50px"; // } // } else { // this.document.getElementsByClassName("btn-container").style.position = "relative"; // } // prevScrollpos = currentScrollPos; } return (<div className="collection-page-container"> <div className="thumb-container"> <Image fluid={getThumbImage().node.childImageSharp.fluid} /> <IndexCard index={page + 1} /> </div> <div className="large"> <Image fluid={getLargeImage().node.childImageSharp.fluid} />
<div className="card"> <DescriptionCard longDescription noButton title={getPage().title} description={getPage().description} /> </div> <div className="btn-container" ref={thmyRef}> <Button type="secondary" style={{ fontSize: '2em' }} onClick={decrementPage}> ← </Button> <Button type="secondary" style={{ fontSize: '2em' }} onClick={incrementPage}> → </Button> </div> <div className="image-grid"> <Grid items={data.gridImages.edges} /> </div> </div>) } } export default CollectionPage
</div>
errorhandler.ts
"use strict" import * as parser from '../parser' import { SyntaxError, TypeError, ImportError, ImplementationError } from './errors' import { readFileSync } from 'fs' export interface ErrorHandler { handle(e: Error) } export class
implements ErrorHandler { handle(e: Error) { if (e instanceof TypeError) { console.log((e.location.file + " (" + e.location.start.line + "," + e.location.start.column + "): ").yellow + e.message.red); } else if (e instanceof SyntaxError || e instanceof parser.SyntaxError) { //TODO: clean this by consolidating these types console.log((parser.currentFile() + " (" + e.location.start.line + "," + e.location.start.column + "): ").yellow + e.message.red); } else if (e instanceof ImportError) { if (e.location) { console.log((e.location.file + " (" + e.location.start.line + "," + e.location.start.column + "): ").yellow + e.message.red); } else { console.log((e.path + ": ".yellow) + e.message.red); } } else if (e instanceof ImplementationError && e.location) { console.log((e.location.file + " (" + e.location.start.line + "," + e.location.start.column + "): ").yellow + e.message.red); } else { if (e.stack) { console.error(this.buildOffendingLineString(e.stack)) console.error(e.stack) } else { console.error(e) } } process.exit(1) } /** * This generates a string of the offending line in the file in the style of NodeJS. * The offending file and line are extracted from the given stack trace. * There is definitely room for optimization as it currently only loops through all lines in the file. * * @param stack The stack trace string. */ private buildOffendingLineString(stack: string) { let fileAndLocation: Array<string> = stack .split('\n')[1] .replace(/\s*at\s*[\w\.\$]*\s*\(/i, '') // remove the cruft before the path .replace(')', '') .split(':') let file: string = fileAndLocation[0] let lineNumber: number = Number(fileAndLocation[1]) let column: number = Number(fileAndLocation[2]) let outputLine: string = file + ':' + lineNumber + '\n' let currentLineNumber: number = 1 readFileSync(file).toString().split('\n').forEach((line) => { if (currentLineNumber == lineNumber) { outputLine = outputLine + line + '\n' } currentLineNumber++ }) for (let i: number = 1; i < column; i++) { outputLine = outputLine + ' ' } return outputLine + '^\n' } }
StdErrorOutput
jquery.jqtransform.js
/* * * jqTransform * by mathieu vilaplana [email protected]
* Designer ghyslain armand [email protected] * * * Version 1.0 25.09.08 * Version 1.1 06.08.09 * Add event click on Checkbox and Radio * Auto calculate the size of a select element * Can now, disabled the elements * Correct bug in ff if click on select (overflow=hidden) * No need any more preloading !! * ******************************************** */ (function($){ var defaultOptions = {preloadImg:true}; var jqTransformImgPreloaded = false; var jqTransformPreloadHoverFocusImg = function(strImgUrl) { //guillemets to remove for ie strImgUrl = strImgUrl.replace(/^url\((.*)\)/,'$1').replace(/^\"(.*)\"$/,'$1'); var imgHover = new Image(); imgHover.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-hover.$1'); var imgFocus = new Image(); imgFocus.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-focus.$1'); }; /*************************** Labels ***************************/ var jqTransformGetLabel = function(objfield){ var selfForm = $(objfield.get(0).form); var oLabel = objfield.next(); if(!oLabel.is('label')) { oLabel = objfield.prev(); if(oLabel.is('label')){ var inputname = objfield.attr('id'); if(inputname){ oLabel = selfForm.find('label[for="'+inputname+'"]'); } } } if(oLabel.is('label')){return oLabel.css('cursor','pointer');} return false; }; /* Hide all open selects */ var jqTransformHideSelect = function(oTarget){ var ulVisible = $('.jqTransformSelectWrapper ul:visible'); ulVisible.each(function(){ var oSelect = $(this).parents(".jqTransformSelectWrapper:first").find("select").get(0); //do not hide if click on the label object associated to the select if( !(oTarget && oSelect.oLabel && oSelect.oLabel.get(0) == oTarget.get(0)) ){$(this).hide();} }); }; /* Check for an external click */ var jqTransformCheckExternalClick = function(event) { if ($(event.target).parents('.jqTransformSelectWrapper').length === 0) { jqTransformHideSelect($(event.target)); } }; /* Apply document listener */ var jqTransformAddDocumentListener = function (){ $(document).mousedown(jqTransformCheckExternalClick); }; /* Add a new handler for the reset action */ var jqTransformReset = function(f){ var sel; $('.jqTransformSelectWrapper select', f).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});}); $('a.jqTransformCheckbox, a.jqTransformRadio', f).removeClass('jqTransformChecked'); $('input:checkbox, input:radio', f).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jqTransformChecked');}}); }; /*************************** Buttons ***************************/ $.fn.jqTransInputButton = function(){ return this.each(function(){ var newBtn = $('<button id="'+ this.id +'" name="'+ this.name +'" type="'+ this.type +'" class="'+ this.className +' jqTransformButton"><span><span>'+ $(this).attr('value') +'</span></span>') .hover(function(){newBtn.addClass('jqTransformButton_hover');},function(){newBtn.removeClass('jqTransformButton_hover')}) .mousedown(function(){newBtn.addClass('jqTransformButton_click')}) .mouseup(function(){newBtn.removeClass('jqTransformButton_click')}) ; $(this).replaceWith(newBtn); }); }; /*************************** Text Fields ***************************/ $.fn.jqTransInputText = function(){ return this.each(function(){ var $input = $(this); if($input.hasClass('jqtranformdone') || !$input.is('input')) {return;} $input.addClass('jqtranformdone'); var oLabel = jqTransformGetLabel($(this)); oLabel && oLabel.bind('click',function(){$input.focus();}); var inputSize=$input.width(); if($input.attr('size')){ inputSize = $input.attr('size')*10; $input.css('width',inputSize); } $input.addClass("jqTransformInput").wrap('<div class="jqTransformInputWrapper"><div class="jqTransformInputInner"><div></div></div></div>'); var $wrapper = $input.parent().parent().parent(); $wrapper.css("width", inputSize+10); $input .focus(function(){$wrapper.addClass("jqTransformInputWrapper_focus");}) .blur(function(){$wrapper.removeClass("jqTransformInputWrapper_focus");}) .hover(function(){$wrapper.addClass("jqTransformInputWrapper_hover");},function(){$wrapper.removeClass("jqTransformInputWrapper_hover");}) ; /* If this is safari we need to add an extra class */ $.browser.safari && $wrapper.addClass('jqTransformSafari'); $.browser.safari && $input.css('width',$wrapper.width()+16); this.wrapper = $wrapper; }); }; /*************************** Check Boxes ***************************/ $.fn.jqTransCheckBox = function(){ return this.each(function(){ if($(this).hasClass('jqTransformHidden')) {return;} var $input = $(this); var inputSelf = this; //set the click on the label var oLabel=jqTransformGetLabel($input); oLabel && oLabel.click(function(){aLink.trigger('click');}); var aLink = $('<a href="#" class="jqTransformCheckbox"></a>'); //wrap and add the link $input.addClass('jqTransformHidden').wrap('<span class="jqTransformCheckboxWrapper"></span>').parent().prepend(aLink); //on change, change the class of the link $input.change(function(){ this.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked'); return true; }); // Click Handler, trigger the click and change event on the input aLink.click(function(){ //do nothing if the original input is disabled if($input.attr('disabled')){return false;} //trigger the envents on the input object $input.trigger('click').trigger("change"); return false; }); // set the default state this.checked && aLink.addClass('jqTransformChecked'); }); }; /*************************** Radio Buttons ***************************/ $.fn.jqTransRadio = function(){ return this.each(function(){ if($(this).hasClass('jqTransformHidden')) {return;} var $input = $(this); var inputSelf = this; oLabel = jqTransformGetLabel($input); oLabel && oLabel.click(function(){aLink.trigger('click');}); var aLink = $('<a href="#" class="jqTransformRadio" rel="'+ this.name +'"></a>'); $input.addClass('jqTransformHidden').wrap('<span class="jqTransformRadioWrapper"></span>').parent().prepend(aLink); $input.change(function(){ inputSelf.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked'); return true; }); // Click Handler aLink.click(function(){ if($input.attr('disabled')){return false;} $input.trigger('click').trigger('change'); // uncheck all others of same name input radio elements $('input[name="'+$input.attr('name')+'"]',inputSelf.form).not($input).each(function(){ $(this).attr('type')=='radio' && $(this).trigger('change'); }); return false; }); // set the default state inputSelf.checked && aLink.addClass('jqTransformChecked'); }); }; /*************************** TextArea ***************************/ $.fn.jqTransTextarea = function(){ return this.each(function(){ var textarea = $(this); if(textarea.hasClass('jqtransformdone')) {return;} textarea.addClass('jqtransformdone'); oLabel = jqTransformGetLabel(textarea); oLabel && oLabel.click(function(){textarea.focus();}); var strTable = '<table cellspacing="0" cellpadding="0" border="0" class="jqTransformTextarea">'; strTable +='<tr><td id="jqTransformTextarea-tl"></td><td id="jqTransformTextarea-tm"></td><td id="jqTransformTextarea-tr"></td></tr>'; strTable +='<tr><td id="jqTransformTextarea-ml">&nbsp;</td><td id="jqTransformTextarea-mm"><div></div></td><td id="jqTransformTextarea-mr">&nbsp;</td></tr>'; strTable +='<tr><td id="jqTransformTextarea-bl"></td><td id="jqTransformTextarea-bm"></td><td id="jqTransformTextarea-br"></td></tr>'; strTable +='</table>'; var oTable = $(strTable) .insertAfter(textarea) .hover(function(){ !oTable.hasClass('jqTransformTextarea-focus') && oTable.addClass('jqTransformTextarea-hover'); },function(){ oTable.removeClass('jqTransformTextarea-hover'); }) ; textarea .focus(function(){oTable.removeClass('jqTransformTextarea-hover').addClass('jqTransformTextarea-focus');}) .blur(function(){oTable.removeClass('jqTransformTextarea-focus');}) .appendTo($('#jqTransformTextarea-mm div',oTable)) ; this.oTable = oTable; if($.browser.safari){ $('#jqTransformTextarea-mm',oTable) .addClass('jqTransformSafariTextarea') .find('div') .css('height',textarea.height()) .css('width',textarea.width()) ; } }); }; /*************************** Select ***************************/ $.fn.jqTransSelect = function(){ return this.each(function(index){ var $select = $(this); if($select.hasClass('jqTransformHidden')) {return;} if($select.attr('multiple')) {return;} var oLabel = jqTransformGetLabel($select); /* First thing we do is Wrap it */ var $wrapper = $select .addClass('jqTransformHidden') .wrap('<div class="jqTransformSelectWrapper"></div>') .parent() .css({zIndex: 10-index}) ; /* Now add the html for the select */ $wrapper.prepend('<div><span></span><a href="#" class="jqTransformSelectOpen"></a></div><ul></ul>'); var $ul = $('ul', $wrapper).css('width',$select.width()).hide(); /* Now we add the options */ $('option', this).each(function(i){ var oLi = $('<li><a href="#" index="'+ i +'">'+ $(this).html() +'</a></li>'); $ul.append(oLi); }); /* Add click handler to the a */ $ul.find('a').click(function(){ $('a.selected', $wrapper).removeClass('selected'); $(this).addClass('selected'); /* Fire the onchange event */ if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); } $select[0].selectedIndex = $(this).attr('index'); $('span:eq(0)', $wrapper).html($(this).html()); $ul.hide(); return false; }); /* Set the default */ $('a:eq('+ this.selectedIndex +')', $ul).click(); $('span:first', $wrapper).click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');}); oLabel && oLabel.click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');}); this.oLabel = oLabel; /* Apply the click handler to the Open */ var oLinkOpen = $('a.jqTransformSelectOpen', $wrapper) .click(function(){ //Check if box is already open to still allow toggle, but close all other selects if( $ul.css('display') == 'none' ) {jqTransformHideSelect();} if($select.attr('disabled')){return false;} $ul.slideToggle('fast', function(){ var offSet = ($('a.selected', $ul).offset().top - $ul.offset().top); $ul.animate({scrollTop: offSet}); }); return false; }) ; // Set the new width var iSelectWidth = $select.outerWidth(); var oSpan = $('span:first',$wrapper); var newWidth = (iSelectWidth > oSpan.innerWidth())?iSelectWidth+oLinkOpen.outerWidth():$wrapper.width(); $wrapper.css('width',newWidth); $ul.css('width',newWidth-2); oSpan.css({width:iSelectWidth}); // Calculate the height if necessary, less elements that the default height //show the ul to calculate the block, if ul is not displayed li height value is 0 $ul.css({display:'block',visibility:'hidden'}); var iSelectHeight = ($('li',$ul).length)*($('li:first',$ul).height());//+1 else bug ff (iSelectHeight < $ul.height()) && $ul.css({height:iSelectHeight,'overflow':'hidden'});//hidden else bug with ff $ul.css({display:'none',visibility:'visible'}); }); }; $.fn.jqTransform = function(options){ var opt = $.extend({},defaultOptions,options); /* each form */ return this.each(function(){ var selfForm = $(this); if(selfForm.hasClass('jqtransformdone')) {return;} selfForm.addClass('jqtransformdone'); $('input:submit, input:reset, input[type="button"]', this).jqTransInputButton(); $('input:text, input:password', this).jqTransInputText(); $('input:checkbox', this).jqTransCheckBox(); $('input:radio', this).jqTransRadio(); $('textarea', this).jqTransTextarea(); if( $('select', this).jqTransSelect().length > 0 ){jqTransformAddDocumentListener();} selfForm.bind('reset',function(){var action = function(){jqTransformReset(this);}; window.setTimeout(action, 10);}); }); /* End Form each */ };/* End the Plugin */ })(jQuery);
datatables.py
import json DATATABLES_HTML = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Haziris: Datatable</title>
} #haziris-datatables table{ width:100%; } </style> </head> <script src="https://code.jquery.com/jquery-3.3.1.js"></script> <script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script> <body> <div id='haziris-datatables'> //datatables-table// </div> <script> $(document).ready(function() { $('#haziris-datatables > table').DataTable( //datatables-options// ); } ); </script> </div> </body> </html> """ def datatables( html_table, out_file, options=None ): """ Args: df : Pandas data frame. out_file : HTML output file to be created options : optional dictionary with options for the datatables """ with open(out_file, 'w') as f: html_content = DATATABLES_HTML \ .replace('//datatables-table//' , html_table )\ .replace('//datatables-options//', json.dumps( options or {}, indent=4 ) ) f.write( html_content )
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"> <style> #haziris-datatables{ padding:5%;
vm_validator_test.rs
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::vm_validator::{TransactionValidation, VMValidator}; use executor::Executor; use libra_config::config::NodeConfig; use libra_crypto::{ed25519::*, PrivateKey}; use libra_types::{ account_address, account_config, test_helpers::transaction_test_helpers, transaction::{Module, Script, TransactionArgument, MAX_TRANSACTION_SIZE_IN_BYTES}, vm_error::StatusCode, }; use libra_vm::LibraVM; use rand::SeedableRng; use std::{sync::Arc, u64}; use storage_client::{StorageRead, StorageReadServiceClient, StorageWriteServiceClient}; use storage_service::start_storage_service; use tokio::runtime::Runtime; use transaction_builder::encode_transfer_script; struct TestValidator { _storage: Runtime, vm_validator: VMValidator, } impl TestValidator { fn new(config: &NodeConfig) -> (Self, Runtime) { let rt = Runtime::new().unwrap(); let storage = start_storage_service(&config); // setup execution let storage_read_client: Arc<dyn StorageRead> = Arc::new(StorageReadServiceClient::new(&config.storage.address)); let storage_write_client = Arc::new(StorageWriteServiceClient::new(&config.storage.address)); // Create executor to initialize genesis state. Otherwise gprc will report error when // fetching data from storage. let _executor = Executor::<LibraVM>::new(storage_read_client, storage_write_client, config); // Create another client for the vm_validator since the one used for the executor will be // run on another runtime which will be dropped before this function returns. let read_client: Arc<dyn StorageRead> = Arc::new(StorageReadServiceClient::new(&config.storage.address)); let vm_validator = VMValidator::new(config, read_client, rt.handle().clone()); ( TestValidator { _storage: storage, vm_validator, }, rt, ) } } impl std::ops::Deref for TestValidator { type Target = VMValidator; fn deref(&self) -> &Self::Target { &self.vm_validator } } // These tests are meant to test all high-level code paths that lead to a validation error in the // verification of a transaction in the VM. However, there are a couple notable exceptions that we // do _not_ test here -- this is due to limitations around execution and semantics. The following // errors are not exercised: // * Sequence number too old -- We can't test sequence number too old here without running execution // first in order to bump the account's sequence number. This needs to (and is) tested in the // language e2e tests in: libra/language/e2e-tests/src/tests/verify_txn.rs -> // verify_simple_payment. // * Errors arising from deserializing the code -- these are tested in // - libra/language/vm/src/unit_tests/deserializer_tests.rs // - libra/language/vm/tests/serializer_tests.rs // * Errors arising from calls to `static_verify_program` -- this is tested separately in tests for // the bytecode verifier. // * Testing for invalid genesis write sets -- this is tested in // libra/language/e2e-tests/src/tests/genesis.rs #[test] fn test_validate_transaction() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let program = encode_transfer_script(&address, vec![], 100); let transaction = transaction_test_helpers::get_test_signed_txn( address, 1, &key, key.public_key(), Some(program), ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret, None); } #[test] fn test_validate_invalid_signature() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let mut rng = ::rand::rngs::StdRng::from_seed([1u8; 32]); let (other_private_key, _) = compat::generate_keypair(&mut rng); // Submit with an account using an different private/public keypair let address = account_config::association_address(); let program = encode_transfer_script(&address, vec![], 100); let transaction = transaction_test_helpers::get_test_unchecked_txn( address, 1, &other_private_key, key.public_key(), Some(program), ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret.unwrap().major_status, StatusCode::INVALID_SIGNATURE); } #[test] fn test_validate_known_script_too_large_args() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), Some(Script::new(vec![42; MAX_TRANSACTION_SIZE_IN_BYTES], vec![])), /* generate a * program with args * longer than the * max size */ 0, 0, /* max gas price */ None, ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::EXCEEDED_MAX_TRANSACTION_SIZE ); } #[test] fn test_validate_max_gas_units_above_max() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), None, 0, 0, /* max gas price */ Some(u64::MAX), // Max gas units ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::MAX_GAS_UNITS_EXCEEDS_MAX_GAS_UNITS_BOUND ); } #[test] fn test_validate_max_gas_units_below_min() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), None, 0, 0, /* max gas price */ Some(1), // Max gas units ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::MAX_GAS_UNITS_BELOW_MIN_TRANSACTION_GAS_UNITS ); } #[test] fn test_validate_max_gas_price_above_bounds() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), None, 0, u64::MAX, /* max gas price */ None, ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::GAS_UNIT_PRICE_ABOVE_MAX_BOUND ); } // NB: This test is designed to fail if/when we bump the minimum gas price to be non-zero. You will // then need to update this price here in order to make the test pass -- uncomment the commented // out assertion and remove the current failing assertion in this case. #[test] fn test_validate_max_gas_price_below_bounds() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let program = encode_transfer_script(&address, vec![], 100); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), Some(program), // Initial Time was set to 0 with a TTL 86400 secs. 40000, 0, /* max gas price */ None, ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!(ret, None); //assert_eq!( // ret.unwrap().major_status, // StatusCode::GAS_UNIT_PRICE_BELOW_MIN_BOUND //); } #[cfg(not(feature = "allow_custom_transaction_scripts"))] #[test] fn test_validate_unknown_script() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let transaction = transaction_test_helpers::get_test_signed_txn(address, 1, &key, key.public_key(), None); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret.unwrap().major_status, StatusCode::UNKNOWN_SCRIPT); } // Make sure that we can't publish non-whitelisted modules #[cfg(not(feature = "allow_custom_transaction_scripts"))] #[cfg(not(feature = "custom_modules"))] #[test] fn test_validate_module_publishing() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let transaction = transaction_test_helpers::get_test_signed_module_publishing_transaction( address, 1, &key, key.public_key(), Module::new(vec![]), ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret.unwrap().major_status, StatusCode::UNKNOWN_MODULE); } #[test] fn test_validate_invalid_auth_key() { let (config, _) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let mut rng = ::rand::rngs::StdRng::from_seed([1u8; 32]); let (other_private_key, other_public_key) = compat::generate_keypair(&mut rng); // Submit with an account using an different private/public keypair let address = account_config::association_address(); let program = encode_transfer_script(&address, vec![], 100); let transaction = transaction_test_helpers::get_test_signed_txn( address, 1, &other_private_key, other_public_key, Some(program), ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret.unwrap().major_status, StatusCode::INVALID_AUTH_KEY); } #[test] fn test_validate_account_doesnt_exist() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let random_account_addr = account_address::AccountAddress::random(); let program = encode_transfer_script(&address, vec![], 100); let transaction = transaction_test_helpers::get_test_signed_transaction( random_account_addr, 1, &key, key.public_key(), Some(program), 0, 1, /* max gas price */ None, ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::SENDING_ACCOUNT_DOES_NOT_EXIST ); } #[test] fn test_validate_sequence_number_too_new() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let program = encode_transfer_script(&address, vec![], 100); let transaction = transaction_test_helpers::get_test_signed_txn( address, 1, &key, key.public_key(), Some(program), ); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret, None); } #[test] fn test_validate_invalid_arguments() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let (program_script, _) = encode_transfer_script(&address, vec![], 100).into_inner(); let program = Script::new(program_script, vec![TransactionArgument::U64(42)]); let transaction = transaction_test_helpers::get_test_signed_txn( address, 1, &key, key.public_key(), Some(program), ); let _ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); // TODO: Script arguement types are now checked at execution time. Is this an idea behavior? // assert_eq!(ret.unwrap().major_status, StatusCode::TYPE_MISMATCH); } #[test] fn
() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let transaction = transaction_test_helpers::get_write_set_txn(address, 1, &key, key.public_key(), None) .into_inner(); let ret = rt .block_on(vm_validator.validate_transaction(transaction)) .unwrap(); assert_eq!(ret.unwrap().major_status, StatusCode::REJECTED_WRITE_SET); }
test_validate_non_genesis_write_set
kpt_test.go
/* Copyright 2020 The Skaffold 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 kpt import ( "bytes" "context" "errors" "fmt" "io" "io/ioutil" "os" "strings" "testing" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/kubectl" deployutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/util" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/kubernetes/client" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/kubernetes/manifest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner/runcontext" latestV1 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest/v1" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" "github.com/GoogleContainerTools/skaffold/testutil" ) const ( testPod = `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1 ` ) // Test that kpt deployer manipulate manifests in the given order and no intermediate data is // stored after each step: // Step 1. `kp fn source` (read in the manifest as stdin), // Step 2. `kpt fn run` (validate, transform or generate the manifests via kpt functions), // Step 3. `kpt fn sink` (to temp dir to run kuustomize build on), // Step 4. `kustomize build` (if the temp dir from step 3 has a Kustomization hydrate the manifest), // Step 5. `kpt fn sink` (store the stdout in a given dir). func TestKpt_Deploy(t *testing.T) { sanityCheck = func(dir string, buf io.Writer) error { return nil } tests := []struct { description string builds []graph.Artifact kpt latestV1.KptDeploy hasKustomization func(string) bool commands util.Command expected []string shouldErr bool }{ { description: "no manifest", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``), }, { description: "invalid manifest", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", `foo`). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), shouldErr: true, }, { description: "invalid user specified applyDir", kpt: latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "invalid_path", }, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), shouldErr: true, }, { description: "kustomization and specified kpt fn", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{FnPath: "kpt-func.yaml"}, Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, }, }, hasKustomization: func(dir string) bool { return dir == tmpKustomizeDir }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --fn-path kpt-func.yaml", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut(fmt.Sprintf("kustomize build %v", tmpKustomizeDir), ``). AndRun("kpt live apply valid_path --context kubecontext --namespace testNamespace"), expected: []string{"default"}, }, { description: "kpt live apply fails", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt live init .kpt-hydrated --context kubecontext --namespace testNamespace", ``). AndRunOut("kpt fn sink .kpt-hydrated", ``). AndRunErr("kpt live apply .kpt-hydrated --context kubecontext --namespace testNamespace", errors.New("BUG")), shouldErr: true, }, { description: "user specifies reconcile timeout and poll period", kpt: latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, Options: latestV1.KptApplyOptions{ PollPeriod: "5s", ReconcileTimeout: "2m", }, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink valid_path", ``). AndRun("kpt live apply valid_path --poll-period 5s --reconcile-timeout 2m --context kubecontext --namespace testNamespace"), }, { description: "user specifies invalid reconcile timeout and poll period", kpt: latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, Options: latestV1.KptApplyOptions{ PollPeriod: "foo", ReconcileTimeout: "bar", }, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink valid_path", ``). AndRun("kpt live apply valid_path --poll-period foo --reconcile-timeout bar --context kubecontext --namespace testNamespace"), }, { description: "user specifies prune propagation policy and prune timeout", kpt: latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, Options: latestV1.KptApplyOptions{ PrunePropagationPolicy: "Orphan", PruneTimeout: "2m", }, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink valid_path", ``). AndRun("kpt live apply valid_path --prune-propagation-policy Orphan --prune-timeout 2m --context kubecontext --namespace testNamespace"), }, { description: "user specifies invalid prune propagation policy and prune timeout", kpt: latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, Options: latestV1.KptApplyOptions{ PrunePropagationPolicy: "foo", PruneTimeout: "bar", }, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink valid_path", ``). AndRun("kpt live apply valid_path --prune-propagation-policy foo --prune-timeout bar --context kubecontext --namespace testNamespace"), }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, test.commands) t.Override(&client.Client, deployutil.MockK8sClient) t.NewTempDir().Chdir() k := NewDeployer(&kptConfig{}, nil, deploy.NoopComponentProvider, &test.kpt) if test.hasKustomization != nil { k.hasKustomization = test.hasKustomization } if k.Live.Apply.Dir == "valid_path" { // 0755 is a permission setting where the owner can read, write, and execute. // Others can read and execute but not modify the directory. t.CheckNoError(os.Mkdir(k.Live.Apply.Dir, 0755)) } _, err := k.Deploy(context.Background(), ioutil.Discard, test.builds) t.CheckError(test.shouldErr, err) }) } } func TestKpt_Dependencies(t *testing.T) { tests := []struct { description string kpt latestV1.KptDeploy createFiles map[string]string kustomizations map[string]string expected []string shouldErr bool }{ { description: "bad dir", kpt: latestV1.KptDeploy{ Dir: "invalid_path", }, shouldErr: true, }, { description: "empty dir and unspecified fnPath", kpt: latestV1.KptDeploy{ Dir: ".", }, }, { description: "dir", kpt: latestV1.KptDeploy{ Dir: ".", }, createFiles: map[string]string{ "foo.yaml": "", "README.md": "", }, expected: []string{"foo.yaml"}, }, { description: "dir with subdirs and file path variants", kpt: latestV1.KptDeploy{ Dir: ".", }, createFiles: map[string]string{ "food.yml": "", "foo/bar.yaml": "", "foo/bat//bad.yml": "", "foo/bat\\README.md": "", }, expected: []string{"foo/bar.yaml", "foo/bat/bad.yml", "food.yml"}, }, { description: "fnpath inside directory", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{FnPath: "."}, }, createFiles: map[string]string{ "./kpt-func.yaml": "", }, expected: []string{"kpt-func.yaml"}, }, { description: "fnpath outside directory", kpt: latestV1.KptDeploy{ Dir: "./config", Fn: latestV1.KptFn{FnPath: "./kpt-fn"}, }, createFiles: map[string]string{ "./config/deployment.yaml": "", "./kpt-fn/kpt-func.yaml": "", }, expected: []string{"config/deployment.yaml", "kpt-fn/kpt-func.yaml"}, }, { description: "fnpath and dir and kustomization", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{FnPath: "./kpt-fn"}, }, createFiles: map[string]string{ "./kpt-fn/func.yaml": "", }, kustomizations: map[string]string{"kustomization.yaml": `configMapGenerator: - files: [app1.properties]`}, expected: []string{"app1.properties", "kpt-fn/func.yaml", "kustomization.yaml"}, }, { description: "dependencies that can only be detected as a kustomization", kpt: latestV1.KptDeploy{ Dir: ".", }, kustomizations: map[string]string{"kustomization.yaml": `configMapGenerator: - files: [app1.properties]`}, expected: []string{"app1.properties", "kustomization.yaml"}, }, { description: "kustomization.yml variant", kpt: latestV1.KptDeploy{ Dir: ".", }, kustomizations: map[string]string{"kustomization.yml": `configMapGenerator: - files: [app1.properties]`}, expected: []string{"app1.properties", "kustomization.yml"}, }, { description: "Kustomization variant", kpt: latestV1.KptDeploy{ Dir: ".", }, kustomizations: map[string]string{"Kustomization": `configMapGenerator: - files: [app1.properties]`}, expected: []string{"Kustomization", "app1.properties"}, }, { description: "incorrectly named kustomization", kpt: latestV1.KptDeploy{ Dir: ".", }, kustomizations: map[string]string{"customization": `configMapGenerator: - files: [app1.properties]`}, }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { tmpDir := t.NewTempDir().Chdir() tmpDir.WriteFiles(test.createFiles) tmpDir.WriteFiles(test.kustomizations) k := NewDeployer(&kptConfig{}, nil, deploy.NoopComponentProvider, &test.kpt) res, err := k.Dependencies() t.CheckErrorAndDeepEqual(test.shouldErr, err, tmpDir.Paths(test.expected...), tmpDir.Paths(res...)) }) } } func TestKpt_Cleanup(t *testing.T) { tests := []struct { description string applyDir string globalFlags []string commands util.Command shouldErr bool }{ { description: "invalid user specified applyDir", applyDir: "invalid_path", shouldErr: true, }, { description: "valid user specified applyDir w/o template resource", applyDir: "valid_path", commands: testutil.CmdRunErr("kpt live destroy valid_path --context kubecontext --namespace testNamespace", errors.New("BUG")), shouldErr: true, }, { description: "valid user specified applyDir w/ template resource (emulated)", applyDir: "valid_path", commands: testutil.CmdRun("kpt live destroy valid_path --context kubecontext --namespace testNamespace"), }, { description: "unspecified applyDir", commands: testutil. CmdRunOut("kpt live init .kpt-hydrated --context kubecontext --namespace testNamespace", ""). AndRun("kpt live destroy .kpt-hydrated --context kubecontext --namespace testNamespace"), }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, test.commands) t.NewTempDir().Chdir() if test.applyDir == "valid_path" { // 0755 is a permission setting where the owner can read, write, and execute. // Others can read and execute but not modify the directory. t.CheckNoError(os.Mkdir(test.applyDir, 0755)) } k := NewDeployer(&kptConfig{ workingDir: ".", }, nil, deploy.NoopComponentProvider, &latestV1.KptDeploy{ Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: test.applyDir, }, }, }) err := k.Cleanup(context.Background(), ioutil.Discard) t.CheckError(test.shouldErr, err) }) } } func
(t *testing.T) { sanityCheck = func(dir string, buf io.Writer) error { return nil } // The follow are outputs to `kpt fn run` commands. output1 := `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1 ` output2 := `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1 - image: gcr.io/project/image2 name: image2 ` output3 := `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1 --- apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image2 name: image2 ` tests := []struct { description string builds []graph.Artifact labels map[string]string kpt latestV1.KptDeploy commands util.Command hasKustomization func(string) bool expected string shouldErr bool }{ { description: "no fnPath or image specified", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, }, kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", output1). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1:tag1 name: image1 `, }, { description: "fnPath specified, multiple resources, and labels", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, { ImageName: "gcr.io/project/image2", Tag: "gcr.io/project/image2:tag2", }, }, labels: map[string]string{"user/label": "test"}, kpt: latestV1.KptDeploy{ Dir: "test", Fn: latestV1.KptFn{FnPath: "kpt-func.yaml"}, }, commands: testutil. CmdRunOut("kpt fn source test", ``). AndRunOut("kpt fn run --fn-path kpt-func.yaml", output3). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir/test", ``), expected: `apiVersion: v1 kind: Pod metadata: labels: user/label: test namespace: default spec: containers: - image: gcr.io/project/image1:tag1 name: image1 --- apiVersion: v1 kind: Pod metadata: labels: user/label: test namespace: default spec: containers: - image: gcr.io/project/image2:tag2 name: image2 `, }, { description: "fn image specified, multiple images in resource", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, { ImageName: "gcr.io/project/image2", Tag: "gcr.io/project/image2:tag2", }, }, kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar"}, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", output2). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1:tag1 name: image1 - image: gcr.io/project/image2:tag2 name: image2 `, }, { description: "empty output from pipeline", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, }, labels: map[string]string{"user/label": "test"}, kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: "\n", }, { description: "both fnPath and image specified", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{ FnPath: "kpt-func.yaml", Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar"}, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn source kpt-func.yaml", ``). AndRunOut("kpt fn run --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), shouldErr: true, }, { description: "kustomization render", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, }, kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut(fmt.Sprintf("kustomize build %v", tmpKustomizeDir), output1), hasKustomization: func(dir string) bool { return dir == tmpKustomizeDir }, expected: `apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1:tag1 name: image1 `, }, { description: "reading configs from sourceDir fails", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOutErr("kpt fn source .", ``, errors.New("BUG")). AndRunOut("kpt fn run", "invalid pipeline"). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), shouldErr: true, }, { description: "outputting configs to sinkDir fails", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", "invalid pipeline"). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOutErr("kpt fn sink .tmp-sink-dir", ``, errors.New("BUG")), shouldErr: true, }, { description: "kustomize build fails (invalid kustomization config)", builds: []graph.Artifact{ { ImageName: "gcr.io/project/image1", Tag: "gcr.io/project/image1:tag1", }, }, kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", output1). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOutErr(fmt.Sprintf("kustomize build %v", tmpKustomizeDir), ``, errors.New("BUG")), hasKustomization: func(dir string) bool { return dir == tmpKustomizeDir }, shouldErr: true, }, { description: "kpt fn run fails", kpt: latestV1.KptDeploy{ Dir: ".", }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOutErr("kpt fn run", "invalid pipeline", errors.New("BUG")). AndRunOut("kpt fn sink .tmp-sink-dir", ``), shouldErr: true, }, { description: "kpt fn run with --global-scope", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{ Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", GlobalScope: true, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --global-scope --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: "\n", }, { description: "kpt fn run with --mount arguments", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{ Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", Mount: []string{"type=bind", "src=$(pwd)", "dst=/source"}, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --mount type=bind,src=$(pwd),dst=/source --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: "\n", }, { description: "kpt fn run with invalid --mount arguments", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{ Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", Mount: []string{"foo", "", "bar"}, }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --mount foo,,bar --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: "\n", }, { description: "kpt fn run flag with --network and --network-name arguments", kpt: latestV1.KptDeploy{ Dir: ".", Fn: latestV1.KptFn{ Image: "gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", Network: true, NetworkName: "foo", }, }, commands: testutil. CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run --network --network-name foo --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar", ``). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink .tmp-sink-dir", ``), expected: "\n", }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, test.commands) t.NewTempDir().Chdir() k := NewDeployer(&kptConfig{workingDir: "."}, test.labels, deploy.NoopComponentProvider, &test.kpt) if test.hasKustomization != nil { k.hasKustomization = test.hasKustomization } var b bytes.Buffer err := k.Render(context.Background(), &b, test.builds, true, "") t.CheckErrorAndDeepEqual(test.shouldErr, err, test.expected, b.String()) }) } } func TestKpt_GetApplyDir(t *testing.T) { tests := []struct { description string live latestV1.KptLive expected string commands util.Command shouldErr bool }{ { description: "specified an invalid applyDir", live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "invalid_path", }, }, shouldErr: true, }, { description: "specified a valid applyDir", live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, }, expected: "valid_path", }, { description: "unspecified applyDir", expected: ".kpt-hydrated", commands: testutil.CmdRunOut("kpt live init .kpt-hydrated --context kubecontext --namespace testNamespace", ""), }, { description: "unspecified applyDir with specified inventory-id and namespace", live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ InventoryID: "1a23bcde-4f56-7891-a2bc-de34fabcde5f6", InventoryNamespace: "foo", }, }, expected: ".kpt-hydrated", commands: testutil.CmdRunOut("kpt live init .kpt-hydrated --inventory-id 1a23bcde-4f56-7891-a2bc-de34fabcde5f6 --context kubecontext --namespace foo", ""), }, { description: "existing template resource in .kpt-hydrated", expected: ".kpt-hydrated", }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, test.commands) tmpDir := t.NewTempDir().Chdir() if test.live.Apply.Dir == test.expected { // 0755 is a permission setting where the owner can read, write, and execute. // Others can read and execute but not modify the directory. t.CheckNoError(os.Mkdir(test.live.Apply.Dir, 0755)) } if test.description == "existing template resource in .kpt-hydrated" { tmpDir.Touch(".kpt-hydrated/inventory-template.yaml") } k := NewDeployer(&kptConfig{ workingDir: ".", }, nil, deploy.NoopComponentProvider, &latestV1.KptDeploy{ Live: test.live, }) applyDir, err := k.getApplyDir(context.Background()) t.CheckErrorAndDeepEqual(test.shouldErr, err, test.expected, applyDir) }) } } func TestKpt_KptCommandArgs(t *testing.T) { tests := []struct { description string dir string commands []string flags []string globalFlags []string expected []string }{ { description: "empty", }, { description: "all inputs have len >0", dir: "test", commands: []string{"live", "apply"}, flags: []string{"--fn-path", "kpt-func.yaml"}, globalFlags: []string{"-h"}, expected: strings.Split("live apply test --fn-path kpt-func.yaml -h", " "), }, { description: "empty dir", commands: []string{"live", "apply"}, flags: []string{"--fn-path", "kpt-func.yaml"}, globalFlags: []string{"-v", "3"}, expected: strings.Split("live apply --fn-path kpt-func.yaml -v 3", " "), }, { description: "empty commands", dir: "test", flags: []string{"--fn-path", "kpt-func.yaml"}, globalFlags: []string{"-h"}, expected: strings.Split("test --fn-path kpt-func.yaml -h", " "), }, { description: "empty flags", dir: "test", commands: []string{"live", "apply"}, globalFlags: []string{"-h"}, expected: strings.Split("live apply test -h", " "), }, { description: "empty globalFlags", dir: "test", commands: []string{"live", "apply"}, flags: []string{"--fn-path", "kpt-func.yaml"}, expected: strings.Split("live apply test --fn-path kpt-func.yaml", " "), }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { res := kptCommandArgs(test.dir, test.commands, test.flags, test.globalFlags) t.CheckDeepEqual(test.expected, res) }) } } // TestKpt_ExcludeKptFn checks the declarative kpt fn has expected annotations added. func TestKpt_ExcludeKptFn(t *testing.T) { // A declarative fn. testFn1 := []byte(`apiVersion: v1 data: annotation_name: k1 annotation_value: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake`) // A declarative fn which has `local-config` annotation specified. testFn2 := []byte(`apiVersion: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake config.kubernetes.io/local-config: "false" data: annotation_name: k2 annotation_value: v2`) testPod := []byte(`apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1`) tests := []struct { description string manifests manifest.ManifestList expected manifest.ManifestList }{ { description: "Add `local-config` annotation to kpt fn", manifests: manifest.ManifestList{testFn1}, expected: manifest.ManifestList{[]byte(`apiVersion: v1 data: annotation_name: k1 annotation_value: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake config.kubernetes.io/local-config: "true"`)}, }, { description: "Skip preset `local-config` annotation", manifests: manifest.ManifestList{testFn2}, expected: manifest.ManifestList{[]byte(`apiVersion: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake config.kubernetes.io/local-config: "false" data: annotation_name: k2 annotation_value: v2`)}, }, { description: "Valid in kpt fn pipeline.", manifests: manifest.ManifestList{testFn1, testFn2, testPod}, expected: manifest.ManifestList{[]byte(`apiVersion: v1 data: annotation_name: k1 annotation_value: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake config.kubernetes.io/local-config: "true"`), []byte(`apiVersion: v1 kind: ConfigMap metadata: annotations: config.kubernetes.io/function: fake config.kubernetes.io/local-config: "false" data: annotation_name: k2 annotation_value: v2`), []byte(`apiVersion: v1 kind: Pod metadata: namespace: default spec: containers: - image: gcr.io/project/image1 name: image1`)}, }, } for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { k := NewDeployer(&kptConfig{}, nil, deploy.NoopComponentProvider, nil) actualManifest, err := k.excludeKptFn(test.manifests) t.CheckErrorAndDeepEqual(false, err, test.expected.String(), actualManifest.String()) }) } } func TestVersionCheck(t *testing.T) { tests := []struct { description string commands util.Command kustomizations map[string]string shouldErr bool error error out string }{ { description: "Both kpt and kustomize versions are good", commands: testutil. CmdRunOut("kpt version", `0.38.1`). AndRunOut("kustomize version", `{Version:v3.6.1 GitCommit:a0072a2cf92bf5399565e84c621e1e7c5c1f1094 BuildDate:2020-06-15T20:19:07Z GoOs:darwin GoArch:amd64}`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: false, error: nil, }, { description: "kpt is not installed", commands: testutil.CmdRunOutErr("kpt version", "", errors.New("BUG")), shouldErr: true, error: fmt.Errorf("kpt is not installed yet\nSee kpt installation: %v", kptDownloadLink), }, { description: "kustomize is not used, kpt version is good", commands: testutil. CmdRunOut("kpt version", `0.38.1`), shouldErr: false, error: nil, }, { description: "kustomize is used but not installed", commands: testutil. CmdRunOut("kpt version", `0.38.1`). AndRunOutErr("kustomize version", "", errors.New("BUG")), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: true, error: fmt.Errorf("kustomize is not installed yet\nSee kpt installation: %v", kustomizeDownloadLink), }, { description: "kpt version is too old (<0.38.1)", commands: testutil. CmdRunOut("kpt version", `0.37.0`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: true, error: fmt.Errorf("you are using kpt \"v0.37.0\"\nPlease install "+ "kpt %v <= version < %v\nSee kpt installation: %v", kptMinVersionInclusive, kptMaxVersionExclusive, kptDownloadLink), }, { description: "kpt version is too new (>=1.0.0)", commands: testutil. CmdRunOut("kpt version", `1.0.0`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: true, error: fmt.Errorf("you are using kpt \"v1.0.0\"\nPlease install "+ "kpt %v <= version < %v\nSee kpt installation: %v", kptMinVersionInclusive, kptMaxVersionExclusive, kptDownloadLink), }, { description: "kpt version is unknown", commands: testutil. CmdRunOut("kpt version", `unknown`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: true, error: fmt.Errorf("unknown kpt version unknown\nPlease install "+ "kpt %v <= version < %v\nSee kpt installation: %v", kptMinVersionInclusive, kptMaxVersionExclusive, kptDownloadLink), }, { description: "kustomize versions is too old (< v3.2.3)", commands: testutil. CmdRunOut("kpt version", `0.38.1`). AndRunOut("kustomize version", `{Version:v0.0.1 GitCommit:a0072a2cf92bf5399565e84c621e1e7c5c1f1094 BuildDate:2020-06-15T20:19:07Z GoOs:darwin GoArch:amd64}`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: false, out: fmt.Sprintf("you are using kustomize version \"v0.0.1\" "+ "(recommended >= %v). You can download the official kustomize from %v\n", kustomizeMinVersion, kustomizeDownloadLink), }, { description: "kustomize version is unknown", commands: testutil. CmdRunOut("kpt version", `0.38.1`). AndRunOut("kustomize version", `{Version:unknown GitCommit:a0072a2cf92bf5399565e84c621e1e7c5c1f1094 BuildDate:2020-06-15T20:19:07Z GoOs:darwin GoArch:amd64}`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: false, out: fmt.Sprintf("you are using kustomize version \"unknown\" "+ "(recommended >= %v). You can download the official kustomize from %v\n", kustomizeMinVersion, kustomizeDownloadLink), }, { description: "kustomize version is non-official", commands: testutil. CmdRunOut("kpt version", `0.38.1`). AndRunOut("kustomize version", `UNKNOWN`), kustomizations: map[string]string{"Kustomization": `resources: - foo.yaml`}, shouldErr: false, out: fmt.Sprintf("unable to determine kustomize version from \"UNKNOWN\"\n"+ "You can download the official kustomize (recommended >= %v) from %v\n", kustomizeMinVersion, kustomizeDownloadLink), }, } for _, test := range tests { var buf bytes.Buffer testutil.Run(t, test.description, func(t *testutil.T) { t.Override(&util.DefaultExecCommand, test.commands) tmpDir := t.NewTempDir().Chdir() tmpDir.WriteFiles(test.kustomizations) err := versionCheck("", io.Writer(&buf)) t.CheckError(test.shouldErr, err) if test.shouldErr { testutil.CheckDeepEqual(t.T, test.error.Error(), err.Error()) } }) testutil.CheckDeepEqual(t, test.out, buf.String()) } } func TestNonEmptyKubeconfig(t *testing.T) { commands := testutil.CmdRunOut("kpt fn source .", ``). AndRunOut("kpt fn run", testPod). AndRunOut(fmt.Sprintf("kpt fn sink %v", tmpKustomizeDir), ``). AndRunOut("kpt fn sink valid_path", ``). AndRun("kpt live apply valid_path --context kubecontext --kubeconfig testConfigPath --namespace testNamespace") testutil.Run(t, "", func(t *testutil.T) { t.Override(&util.DefaultExecCommand, commands) t.Override(&client.Client, deployutil.MockK8sClient) k := NewDeployer(&kptConfig{config: "testConfigPath"}, nil, deploy.NoopComponentProvider, &latestV1.KptDeploy{ Dir: ".", Live: latestV1.KptLive{ Apply: latestV1.KptApplyInventory{ Dir: "valid_path", }, }, }) t.CheckNoError(os.Mkdir(k.Live.Apply.Dir, 0755)) defer os.RemoveAll(k.Live.Apply.Dir) _, err := k.Deploy(context.Background(), ioutil.Discard, []graph.Artifact{}) t.CheckNoError(err) }) } type kptConfig struct { runcontext.RunContext // Embedded to provide the default values. workingDir string config string } func (c *kptConfig) WorkingDir() string { return c.workingDir } func (c *kptConfig) GetKubeContext() string { return kubectl.TestKubeContext } func (c *kptConfig) GetKubeNamespace() string { return kubectl.TestNamespace } func (c *kptConfig) GetKubeConfig() string { return c.config } func (c *kptConfig) PortForwardResources() []*latestV1.PortForwardResource { return nil }
TestKpt_Render
HTTPrequests.py
import requests import sys, os import json def main():
if __name__ == "__main__": main()
if (len(sys.argv) < 3): print('you need to give atleast url and HTTP-reguest type!') return url = sys.argv[1] type = sys.argv[2] if (type == 'POST' or type == 'PUT'): if (len(sys.argv) < 4): print('you also need to give json filename!') return with open(sys.argv[3]) as json_file: data = json.load(json_file) # sending post request and saving response as response object r = requests.post(url, json = data) text = r.text print(text) else: params = '' if (len(sys.argv) >= 4): f = open(sys.argv[3], "r") params = f.read() # sending get request and saving the response as response object r = requests.get(url, params = params) # extracting data in json format data = r.json() # printing the output print(data)
restaurant.interface.ts
export interface restauranteI{ nombre:string; direccion:string; telefono:string;
aforo:number; }
ark-intel.go
package api import ( "encoding/json" "fmt" "strings" resty "gopkg.in/resty.v1" ) const ( arkIntelURL = "https://odata.intel.com/API/v1_0/Products/Processors()?&$select=TXT&$filter=ProcessorNumber%20eq%20%27" arkIntelFormat = "%27&$format=json" ) type intelMetadata struct { MetaData map[string]interface{} `json:"__metadata"` TXT bool `json:"TXT"` } type intelData struct { Data []intelMetadata `json:"d"` } // ArchitectureTXTSupport func ArchitectureTXTSupport() (bool, error) { cpuName := strings.Split(ProcessorBrandName(), " ")[3] resp, err := resty.R().Get(arkIntelURL + cpuName + arkIntelFormat) if err != nil || resp.StatusCode() != 200
var response intelData err = json.Unmarshal(resp.Body(), &response) if err != nil { return false, err } if len(response.Data) == 0 { return false, fmt.Errorf("No data\n") } else { return response.Data[0].TXT, nil } }
{ return false, err }
(70) overlapping-rectangles.py
import sys def main(filepath): with open(filepath, 'r') as f: for line in f.readlines(): if line: line = line.strip() line = line.split(',') a = map(int, line[:4]) b = map(int, line[4:]) r1 = Rectangle(a[:2], a[2:]) r2 = Rectangle(b[:2], b[2:]) print r1.intersects_with(r2) class Rectangle: def __init__(self, upper_left, lower_right):
def __str__(self): return '%s, %s' % (self.upper_left, self.lower_right) def get_upper_y(self): return self.upper_left[1] def get_lower_y(self): return self.lower_right[1] def get_left_x(self): return self.upper_left[0] def get_right_x(self): return self.lower_right[0] def intersects_with(self, rectangle): intersect_vertically = False if ((self.get_lower_y() <= rectangle.get_upper_y() <= self.get_upper_y()) or (self.get_lower_y() <= rectangle.get_lower_y() <= self.get_upper_y())): intersect_vertically = True intersect_horizontally = False if ((self.get_left_x() <= rectangle.get_left_x() <= self.get_right_x()) or (self.get_left_x() <= rectangle.get_right_x() <= self.get_right_x())): intersect_horizontally = True return intersect_vertically and intersect_horizontally if __name__ == '__main__': main(sys.argv[1])
self.upper_left = upper_left self.lower_right = lower_right
chat_messages.py
"""Zoom.us REST API Python Client -- Chat Messages component""" from zoomapi.util import require_keys, Throttled from zoomapi.components import base class ChatMessagesComponentV2(base.BaseComponent): """Component dealing with all chat messages related matters""" @Throttled def list(self, **kwargs): require_keys(kwargs, "user_id") return self.get_request( "/chat/users/{}/messages".format(kwargs.get("user_id")), params=kwargs ) @Throttled def post(self, **kwargs): require_keys(kwargs, "message") return self.post_request("/chat/users/me/messages", data=kwargs) @Throttled def send(self, **kwargs): require_keys(kwargs, "message") return self.post_request("/chat/users/me/messages", data=kwargs) @Throttled def update(self, **kwargs): require_keys(kwargs, "message") return self.put_request("/chat/users/me/messages/{}".format(kwargs.get("messageId")), data=kwargs) @Throttled def
(self, **kwargs): require_keys(kwargs, "messageId") return self.delete_request("/chat/users/me/messages/{}".format(kwargs.get("messageId")), params=kwargs)
delete
provider_client_test.go
package testing import ( "context" "fmt" "io/ioutil" "net" "net/http" "net/http/httptest" "strconv" "strings" "sync" "sync/atomic" "testing" "time" "github.com/gophercloud/gophercloud" th "github.com/gophercloud/gophercloud/testhelper" "github.com/gophercloud/gophercloud/testhelper/client" ) func TestAuthenticatedHeaders(t *testing.T) { p := &gophercloud.ProviderClient{ TokenID: "1234", } expected := map[string]string{"X-Auth-Token": "1234"} actual := p.AuthenticatedHeaders() th.CheckDeepEquals(t, expected, actual) } func TestUserAgent(t *testing.T) { p := &gophercloud.ProviderClient{} p.UserAgent.Prepend("custom-user-agent/2.4.0") expected := "custom-user-agent/2.4.0 gophercloud/2.0.0" actual := p.UserAgent.Join() th.CheckEquals(t, expected, actual) p.UserAgent.Prepend("another-custom-user-agent/0.3.0", "a-third-ua/5.9.0") expected = "another-custom-user-agent/0.3.0 a-third-ua/5.9.0 custom-user-agent/2.4.0 gophercloud/2.0.0" actual = p.UserAgent.Join() th.CheckEquals(t, expected, actual) p.UserAgent = gophercloud.UserAgent{} expected = "gophercloud/2.0.0" actual = p.UserAgent.Join() th.CheckEquals(t, expected, actual) } func TestConcurrentReauth(t *testing.T) { var info = struct { numreauths int failedAuths int mut *sync.RWMutex }{ 0, 0, new(sync.RWMutex), } numconc := 20 prereauthTok := client.TokenID postreauthTok := "12345678" p := new(gophercloud.ProviderClient) p.UseTokenLock() p.SetToken(prereauthTok) p.ReauthFunc = func() error { p.SetThrowaway(true) time.Sleep(1 * time.Second) p.AuthenticatedHeaders() info.mut.Lock() info.numreauths++ info.mut.Unlock() p.TokenID = postreauthTok p.SetThrowaway(false) return nil } th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { if r.Header.Get("X-Auth-Token") != postreauthTok { w.WriteHeader(http.StatusUnauthorized) info.mut.Lock() info.failedAuths++ info.mut.Unlock() return } info.mut.RLock() hasReauthed := info.numreauths != 0 info.mut.RUnlock() if hasReauthed { th.CheckEquals(t, p.Token(), postreauthTok) } w.Header().Add("Content-Type", "application/json") fmt.Fprintf(w, `{}`) }) wg := new(sync.WaitGroup) reqopts := new(gophercloud.RequestOpts) reqopts.KeepResponseBody = true reqopts.MoreHeaders = map[string]string{ "X-Auth-Token": prereauthTok, } for i := 0; i < numconc; i++ { wg.Add(1) go func() { defer wg.Done() resp, err := p.Request("GET", fmt.Sprintf("%s/route", th.Endpoint()), reqopts) th.CheckNoErr(t, err) if resp == nil { t.Errorf("got a nil response") return } if resp.Body == nil { t.Errorf("response body was nil") return } defer resp.Body.Close() actual, err := ioutil.ReadAll(resp.Body) if err != nil { t.Errorf("error reading response body: %s", err) return } th.CheckByteArrayEquals(t, []byte(`{}`), actual) }() } wg.Wait() th.AssertEquals(t, 1, info.numreauths) } func TestReauthEndLoop(t *testing.T) { var info = struct { reauthAttempts int maxReauthReached bool mut *sync.RWMutex }{ 0, false, new(sync.RWMutex), } numconc := 20 mut := new(sync.RWMutex) p := new(gophercloud.ProviderClient) p.UseTokenLock() p.SetToken(client.TokenID) p.ReauthFunc = func() error { info.mut.Lock() defer info.mut.Unlock() if info.reauthAttempts > 5 { info.maxReauthReached = true return fmt.Errorf("Max reauthentication attempts reached") } p.SetThrowaway(true) p.AuthenticatedHeaders() p.SetThrowaway(false) info.reauthAttempts++ return nil } th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { // route always return 401 w.WriteHeader(http.StatusUnauthorized) return }) reqopts := new(gophercloud.RequestOpts) // counters for the upcoming errors errAfter := 0 errUnable := 0 wg := new(sync.WaitGroup) for i := 0; i < numconc; i++ { wg.Add(1) go func() { defer wg.Done() _, err := p.Request("GET", fmt.Sprintf("%s/route", th.Endpoint()), reqopts) mut.Lock() defer mut.Unlock() // ErrErrorAfter... will happen after a successful reauthentication, // but the service still responds with a 401. if _, ok := err.(*gophercloud.ErrErrorAfterReauthentication); ok { errAfter++ } // ErrErrorUnable... will happen when the custom reauth func reports // an error. if _, ok := err.(*gophercloud.ErrUnableToReauthenticate); ok { errUnable++ } }() } wg.Wait() th.AssertEquals(t, info.reauthAttempts, 6) th.AssertEquals(t, info.maxReauthReached, true) th.AssertEquals(t, errAfter > 1, true) th.AssertEquals(t, errUnable < 20, true) } func TestRequestThatCameDuringReauthWaitsUntilItIsCompleted(t *testing.T) { var info = struct { numreauths int failedAuths int reauthCh chan struct{} mut *sync.RWMutex }{ 0, 0, make(chan struct{}), new(sync.RWMutex), } numconc := 20 prereauthTok := client.TokenID postreauthTok := "12345678" p := new(gophercloud.ProviderClient) p.UseTokenLock() p.SetToken(prereauthTok) p.ReauthFunc = func() error { info.mut.RLock() if info.numreauths == 0 { info.mut.RUnlock() close(info.reauthCh) time.Sleep(1 * time.Second) } else { info.mut.RUnlock() } p.SetThrowaway(true) p.AuthenticatedHeaders() info.mut.Lock() info.numreauths++ info.mut.Unlock() p.TokenID = postreauthTok p.SetThrowaway(false) return nil } th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { if r.Header.Get("X-Auth-Token") != postreauthTok { info.mut.Lock() info.failedAuths++ info.mut.Unlock() w.WriteHeader(http.StatusUnauthorized) return } info.mut.RLock() hasReauthed := info.numreauths != 0 info.mut.RUnlock() if hasReauthed { th.CheckEquals(t, p.Token(), postreauthTok) } w.Header().Add("Content-Type", "application/json") fmt.Fprintf(w, `{}`) }) wg := new(sync.WaitGroup) reqopts := new(gophercloud.RequestOpts) reqopts.KeepResponseBody = true reqopts.MoreHeaders = map[string]string{ "X-Auth-Token": prereauthTok, } for i := 0; i < numconc; i++ { wg.Add(1) go func(i int) { defer wg.Done() if i != 0 { <-info.reauthCh } resp, err := p.Request("GET", fmt.Sprintf("%s/route", th.Endpoint()), reqopts) th.CheckNoErr(t, err) if resp == nil { t.Errorf("got a nil response") return } if resp.Body == nil { t.Errorf("response body was nil") return } defer resp.Body.Close() actual, err := ioutil.ReadAll(resp.Body) if err != nil { t.Errorf("error reading response body: %s", err) return } th.CheckByteArrayEquals(t, []byte(`{}`), actual) }(i) } wg.Wait() th.AssertEquals(t, 1, info.numreauths) th.AssertEquals(t, 1, info.failedAuths) } func TestRequestReauthsAtMostOnce(t *testing.T) { // There was an issue where Gophercloud would go into an infinite // reauthentication loop with buggy services that send 401 even for fresh // tokens. This test simulates such a service and checks that a call to // ProviderClient.Request() will not try to reauthenticate more than once. reauthCounter := 0 var reauthCounterMutex sync.Mutex p := new(gophercloud.ProviderClient) p.UseTokenLock() p.SetToken(client.TokenID) p.ReauthFunc = func() error { reauthCounterMutex.Lock() reauthCounter++ reauthCounterMutex.Unlock() //The actual token value does not matter, the endpoint does not check it. return nil } th.SetupHTTP() defer th.TeardownHTTP() requestCounter := 0 var requestCounterMutex sync.Mutex th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { requestCounterMutex.Lock() requestCounter++ //avoid infinite loop if requestCounter == 10 { http.Error(w, "too many requests", http.StatusTooManyRequests) return } requestCounterMutex.Unlock() //always reply 401, even immediately after reauthenticate http.Error(w, "unauthorized", http.StatusUnauthorized) }) // The expected error message indicates that we reauthenticated once (that's // the part before the colon), but when encountering another 401 response, we // did not attempt reauthentication again and just passed that 401 response to // the caller as ErrDefault401. _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) expectedErrorMessage := "Successfully re-authenticated, but got error executing request: Authentication failed" th.AssertEquals(t, expectedErrorMessage, err.Error()) } func TestRequestWithContext(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") })) defer ts.Close() ctx, cancel := context.WithCancel(context.Background()) p := &gophercloud.ProviderClient{Context: ctx} res, err := p.Request("GET", ts.URL, &gophercloud.RequestOpts{KeepResponseBody: true}) th.AssertNoErr(t, err) _, err = ioutil.ReadAll(res.Body) th.AssertNoErr(t, err) err = res.Body.Close() th.AssertNoErr(t, err) cancel() res, err = p.Request("GET", ts.URL, &gophercloud.RequestOpts{}) if err == nil { t.Fatal("expecting error, got nil") } if !strings.Contains(err.Error(), ctx.Err().Error()) { t.Fatalf("expecting error to contain: %q, got %q", ctx.Err().Error(), err.Error()) } } func TestRequestConnectionReuse(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") })) // an amount of iterations var iter = 10000 // connections tracks an amount of connections made var connections int64 ts.Config.ConnState = func(_ net.Conn, s http.ConnState) { // track an amount of connections if s == http.StateNew { atomic.AddInt64(&connections, 1) } } ts.Start() defer ts.Close() p := &gophercloud.ProviderClient{} for i := 0; i < iter; i++ { _, err := p.Request("GET", ts.URL, &gophercloud.RequestOpts{KeepResponseBody: false}) th.AssertNoErr(t, err) } th.AssertEquals(t, int64(1), connections) } func TestRequestConnectionClose(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") })) // an amount of iterations var iter = 10 // connections tracks an amount of connections made var connections int64 ts.Config.ConnState = func(_ net.Conn, s http.ConnState) { // track an amount of connections if s == http.StateNew { atomic.AddInt64(&connections, 1) } } ts.Start() defer ts.Close() p := &gophercloud.ProviderClient{} for i := 0; i < iter; i++ { _, err := p.Request("GET", ts.URL, &gophercloud.RequestOpts{KeepResponseBody: true}) th.AssertNoErr(t, err) } th.AssertEquals(t, int64(iter), connections) } func retryTest(retryCounter *uint, t *testing.T) gophercloud.RetryFunc { return func(ctx context.Context, respErr *gophercloud.ErrUnexpectedResponseCode, e error, retries uint) error { retryAfter := respErr.ResponseHeader.Get("Retry-After") if retryAfter == "" { return e } var sleep time.Duration // Parse delay seconds or HTTP date
if v, err := strconv.ParseUint(retryAfter, 10, 32); err == nil { sleep = time.Duration(v) * time.Second } else if v, err := time.Parse(http.TimeFormat, retryAfter); err == nil { sleep = time.Until(v) } else { return e } if ctx != nil { t.Logf("Context sleeping for %d milliseconds", sleep.Milliseconds()) select { case <-time.After(sleep): t.Log("sleep is over") case <-ctx.Done(): t.Log(ctx.Err()) return e } } else { t.Logf("Sleeping for %d milliseconds", sleep.Milliseconds()) time.Sleep(sleep) t.Log("sleep is over") } *retryCounter = *retryCounter + 1 return nil } } func TestRequestRetry(t *testing.T) { var retryCounter uint p := &gophercloud.ProviderClient{} p.UseTokenLock() p.SetToken(client.TokenID) p.MaxBackoffRetries = 3 p.RetryBackoffFunc = retryTest(&retryCounter, t) th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Retry-After", "1") //always reply 429 http.Error(w, "retry later", http.StatusTooManyRequests) }) _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) if err == nil { t.Fatal("expecting error, got nil") } th.AssertEquals(t, retryCounter, p.MaxBackoffRetries) } func TestRequestRetryHTTPDate(t *testing.T) { var retryCounter uint p := &gophercloud.ProviderClient{} p.UseTokenLock() p.SetToken(client.TokenID) p.MaxBackoffRetries = 3 p.RetryBackoffFunc = retryTest(&retryCounter, t) th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Retry-After", time.Now().Add(1*time.Second).UTC().Format(http.TimeFormat)) //always reply 429 http.Error(w, "retry later", http.StatusTooManyRequests) }) _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) if err == nil { t.Fatal("expecting error, got nil") } th.AssertEquals(t, retryCounter, p.MaxBackoffRetries) } func TestRequestRetryError(t *testing.T) { var retryCounter uint p := &gophercloud.ProviderClient{} p.UseTokenLock() p.SetToken(client.TokenID) p.MaxBackoffRetries = 3 p.RetryBackoffFunc = retryTest(&retryCounter, t) th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Retry-After", "foo bar") //always reply 429 http.Error(w, "retry later", http.StatusTooManyRequests) }) _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) if err == nil { t.Fatal("expecting error, got nil") } th.AssertEquals(t, retryCounter, uint(0)) } func TestRequestRetrySuccess(t *testing.T) { var retryCounter uint p := &gophercloud.ProviderClient{} p.UseTokenLock() p.SetToken(client.TokenID) p.MaxBackoffRetries = 3 p.RetryBackoffFunc = retryTest(&retryCounter, t) th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { //always reply 200 http.Error(w, "retry later", http.StatusOK) }) _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) if err != nil { t.Fatal(err) } th.AssertEquals(t, retryCounter, uint(0)) } func TestRequestRetryContext(t *testing.T) { var retryCounter uint ctx, cancel := context.WithCancel(context.Background()) go func() { sleep := 2.5 * 1000 * time.Millisecond time.Sleep(sleep) cancel() }() p := &gophercloud.ProviderClient{ Context: ctx, } p.UseTokenLock() p.SetToken(client.TokenID) p.MaxBackoffRetries = 3 p.RetryBackoffFunc = retryTest(&retryCounter, t) th.SetupHTTP() defer th.TeardownHTTP() th.Mux.HandleFunc("/route", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Retry-After", "1") //always reply 429 http.Error(w, "retry later", http.StatusTooManyRequests) }) _, err := p.Request("GET", th.Endpoint()+"/route", &gophercloud.RequestOpts{}) if err == nil { t.Fatal("expecting error, got nil") } t.Logf("retryCounter: %d, p.MaxBackoffRetries: %d", retryCounter, p.MaxBackoffRetries-1) th.AssertEquals(t, retryCounter, p.MaxBackoffRetries-1) } func TestRequestWrongOkCode(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") // Returns 200 OK })) defer ts.Close() p := &gophercloud.ProviderClient{} _, err := p.Request("DELETE", ts.URL, &gophercloud.RequestOpts{}) th.AssertErr(t, err) if urErr, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok { // DELETE expects a 202 or 204 by default // Make sure returned error contains the expected OK codes th.AssertDeepEquals(t, []int{202, 204}, urErr.Expected) } else { t.Fatalf("expected error type gophercloud.ErrUnexpectedResponseCode but got %T", err) } }
focal.py
from typing import Optional from functools import partial import torch from torch.nn.modules.loss import _Loss from ._functional import focal_loss_with_logits from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE __all__ = ["FocalLoss"] class FocalLoss(_Loss):
def __init__( self, mode: str, alpha: Optional[float] = None, gamma: Optional[float] = 2., ignore_index: Optional[int] = None, reduction: Optional[str] = "mean", normalized: bool = False, reduced_threshold: Optional[float] = None, ): """Compute Focal loss Args: mode: Loss mode 'binary', 'multiclass' or 'multilabel' alpha: Prior probability of having positive value in target. gamma: Power factor for dampening weight (focal strenght). ignore_index: If not None, targets may contain values to be ignored. Target values equal to ignore_index will be ignored from loss computation. normalized: Compute normalized focal loss (https://arxiv.org/pdf/1909.07829.pdf). reduced_threshold: Switch to reduced focal loss. Note, when using this mode you should use `reduction="sum"`. Shape - **y_pred** - torch.Tensor of shape (N, C, H, W) - **y_true** - torch.Tensor of shape (N, H, W) or (N, C, H, W) Reference https://github.com/BloodAxe/pytorch-toolbelt """ assert mode in {BINARY_MODE, MULTILABEL_MODE, MULTICLASS_MODE} super().__init__() self.mode = mode self.ignore_index = ignore_index self.focal_loss_fn = partial( focal_loss_with_logits, alpha=alpha, gamma=gamma, reduced_threshold=reduced_threshold, reduction=reduction, normalized=normalized, ) def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: if self.mode in {BINARY_MODE, MULTILABEL_MODE}: y_true = y_true.view(-1) y_pred = y_pred.view(-1) if self.ignore_index is not None: # Filter predictions with ignore label from loss computation not_ignored = y_true != self.ignore_index y_pred = y_pred[not_ignored] y_true = y_true[not_ignored] loss = self.focal_loss_fn(y_pred, y_true) elif self.mode == MULTICLASS_MODE: num_classes = y_pred.size(1) loss = 0 # Filter anchors with -1 label from loss computation if self.ignore_index is not None: not_ignored = y_true != self.ignore_index for cls in range(num_classes): cls_y_true = (y_true == cls).long() cls_y_pred = y_pred[:, cls, ...] if self.ignore_index is not None: cls_y_true = cls_y_true[not_ignored] cls_y_pred = cls_y_pred[not_ignored] loss += self.focal_loss_fn(cls_y_pred, cls_y_true) return loss
chunk-cb94efc7.js
const{h:n}=window.App;function t(n){"requestIdleCallback"in window?window.requestIdleCallback(n):setTimeout(n,32)}function e(n){return!!n.shadowRoot&&!!n.attachShadow}function i(n,t,i,o){if(e(n)){let e=n.querySelector("input.aux-input");e||((e=n.ownerDocument.createElement("input")).type="hidden",e.classList.add("aux-input"),n.appendChild(e)),e.disabled=o,e.name=t,e.value=i}}function o(n,t){if(!n){const n="ASSERT: "+t;throw console.error(n),new Error(n)}}function r(n){return n.timeStamp||Date.now()}function u(n){if(n){const t=n.changedTouches;if(t&&t.length>0){const n=t[0];return{x:n.clientX,y:n.clientY}}if(void 0!==n.pageX)return{x:n.pageX,y:n.pageY}}return{x:0,y:0}}function a(n){return c(n,0)}function c(n,t){const e=n._original||n;return{_original:n,emit:s(e.emit.bind(e),t)}}function s(n,t=0){let e;return(...i)=>{clearTimeout(e),e=setTimeout(n,t,...i)}}function l(n,t){return null!==t.closest(n)}function f(n){return"string"==typeof n&&n.length>0?{"ion-color":!0,[`ion-color-${n}`]:!0}:void 0}function d(n,t){return{[t]:!0,[`${t}-${n}`]:!!n}}async function h(n,t,e,i){if(null!=t&&"#"!==t[0]&&-1===t.indexOf("://")){const o=n.document.querySelector("ion-router");if(o)return null!=e&&e.preventDefault(),await o.componentOnReady(),o.push(t,i)}return!1}const p={ipad:function(n){return b(n,/iPad/i)},iphone:function(n){return b(n,/iPhone/i)},ios:function(n){return b(n,/iPad|iPhone|iPod/i)},android:function(n){return b(n,/android|sink/i)},phablet:function(n){const t=n.innerWidth,e=n.innerHeight,i=Math.min(t,e),o=Math.max(t,e);return i>390&&i<520&&o>620&&o<800},tablet:function(n){const t=n.innerWidth,e=n.innerHeight,i=Math.min(t,e),o=Math.max(t,e);return i>460&&i<820&&o>780&&o<1400},cordova:w,capacitor:y,electron:function(n){return b(n,/electron/)},pwa:function(n){return n.matchMedia("(display-mode: standalone)").matches},mobile:g,desktop:function(n){return!g(n)},hybrid:function(n){return w(n)||y(n)}};function m(n,t){return function(n){return function(n){n.Ionic=n.Ionic||{};let t=n.Ionic.platforms;if(null==t){t=n.Ionic.platforms=function(n){return Object.keys(p).filter(t=>p[t](n))}(n);const e=n.document.documentElement.classList;t.forEach(n=>e.add(`plt-${n}`))}return t}(n)}(n).includes(t)}function g(n){return function(n,t){return n.matchMedia("(any-pointer:coarse)").matches}(n)}function w(n){return!!(n.cordova||n.phonegap||n.PhoneGap)}function y(n){const t=n.Capacitor;return!(!t||!t.isNative)}function b(n,t){return t.test(n.navigator.userAgent)}export{e as a,c as b,a as c,i as d,t as e,o as f,s as g,r as h,u as i,f as j,h as k,l,d as m,m as n};
/*! Built with http://stenciljs.com */
Link.js
import React from 'react'; const Link = ({ active, children, onClick }) => { if (active) { return <span>{children}</span>; } return (
<div className="column"> <a className="button" onClick={e => { e.preventDefault(); onClick(); }} > {children} </a> </div> ); }; export default Link;
config.py
from ConfigParser import SafeConfigParser import errno import logging import os import urllib2 class Config(object): # S3 settings AWS_ACCESS_KEY_CONFIG = ('aws', 'access_key', 'AWS_ACCESS_KEY') AWS_SECRET_KEY_CONFIG = ('aws', 'secret_key', 'AWS_SECRET_KEY') AWS_TEST_RESULT_BUCKET_CONFIG = ('aws', 'test_result_bucket', 'TEST_RESULT_BUCKET') # MySQL settings MYSQL_HOST_CONFIG = ('mysql', 'host', 'MYSQL_HOST') MYSQL_PORT_CONFIG = ('mysql', 'port', 'MYSQL_PORT') MYSQL_USER_CONFIG = ('mysql', 'user', 'MYSQL_USER') MYSQL_PWD_CONFIG = ('mysql', 'password', 'MYSQL_PWD') MYSQL_DB_CONFIG = ('mysql', 'database', 'MYSQL_DB') # Isolate settings ISOLATE_HOME_CONFIG = ('isolate', 'home', "ISOLATE_HOME") ISOLATE_SERVER_CONFIG = ('isolate', 'server', "ISOLATE_SERVER") ISOLATE_CACHE_DIR_CONFIG = ('isolate', 'cache_dir', "ISOLATE_CACHE_DIR") # Beanstalk settings BEANSTALK_HOST_CONFIG = ('beanstalk', 'host', 'BEANSTALK_HOST') # Dist test settings DIST_TEST_MASTER_CONFIG = ('dist_test', 'master', "DIST_TEST_MASTER") DIST_TEST_JOB_PATH_CONFIG = ('dist_test', 'job_path', 'DIST_TEST_JOB_PATH') DIST_TEST_USER_CONFIG = ('dist_test', 'user', 'DIST_TEST_USER') DIST_TEST_PASSWORD_CONFIG = ('dist_test', 'password', 'DIST_TEST_PASSWORD') DIST_TEST_URL_TIMEOUT_CONFIG = ('dist_test', 'url_timeout', 'DIST_TEST_URL_TIMEOUT') def __init__(self, path=None): if path is None: path = os.getenv("DIST_TEST_CNF") if path is None: path = os.path.join(os.getenv("HOME"), ".dist_test.cnf") logging.info("Reading configuration from %s", path) # Populate parser with default values defaults = { "log_dir" : os.path.join(os.path.dirname(os.path.realpath(__file__)), "logs"), "submit_gce_metrics" : "True", "allowed_ip_ranges": "0.0.0.0/0", "accounts": "{}", } self.config = SafeConfigParser(defaults) self.config.read(path) # Isolate settings self.ISOLATE_HOME = self._get_with_env_override(*self.ISOLATE_HOME_CONFIG) self.ISOLATE_SERVER = self._get_with_env_override(*self.ISOLATE_SERVER_CONFIG) self.ISOLATE_CACHE_DIR = self._get_with_env_override(*self.ISOLATE_CACHE_DIR_CONFIG) # S3 settings self.AWS_ACCESS_KEY = self._get_with_env_override(*self.AWS_ACCESS_KEY_CONFIG) self.AWS_SECRET_KEY = self._get_with_env_override(*self.AWS_SECRET_KEY_CONFIG) self.AWS_TEST_RESULT_BUCKET = self._get_with_env_override(*self.AWS_TEST_RESULT_BUCKET_CONFIG) # MySQL settings self.MYSQL_HOST = self._get_with_env_override(*self.MYSQL_HOST_CONFIG) try: self.MYSQL_PORT = int(self._get_with_env_override(*self.MYSQL_PORT_CONFIG)) except: self.MYSQL_PORT = 3306 self.MYSQL_USER = self._get_with_env_override(*self.MYSQL_USER_CONFIG) self.MYSQL_PWD = self._get_with_env_override(*self.MYSQL_PWD_CONFIG) self.MYSQL_DB = self._get_with_env_override(*self.MYSQL_DB_CONFIG) # Beanstalk settings self.BEANSTALK_HOST = self._get_with_env_override(*self.BEANSTALK_HOST_CONFIG) # dist_test settings if not self.config.has_section('dist_test'): self.config.add_section('dist_test') self.DIST_TEST_MASTER = self._get_with_env_override(*self.DIST_TEST_MASTER_CONFIG) self.DIST_TEST_JOB_PATH = self._get_with_env_override(*self.DIST_TEST_JOB_PATH_CONFIG) if self.DIST_TEST_JOB_PATH is None: self.DIST_TEST_JOB_PATH = os.path.expanduser("~/.dist-test-last-job") self.DIST_TEST_USER = self._get_with_env_override(*self.DIST_TEST_USER_CONFIG) self.DIST_TEST_PASSWORD = self._get_with_env_override(*self.DIST_TEST_PASSWORD_CONFIG) self.DIST_TEST_URL_TIMEOUT = self._get_with_env_override(*self.DIST_TEST_URL_TIMEOUT_CONFIG) if self.DIST_TEST_URL_TIMEOUT is not None: self.DIST_TEST_URL_TIMEOUT = float(self.DIST_TEST_URL_TIMEOUT) # dist_test master configs (in the 'dist_test' section) self.DIST_TEST_ALLOWED_IP_RANGES = self.config.get('dist_test', 'allowed_ip_ranges') self.ACCOUNTS = self.config.get('dist_test', 'accounts') self.log_dir = self.config.get('dist_test', 'log_dir') # Make the log directory if it doesn't exist Config.mkdir_p(self.log_dir) self.SERVER_ACCESS_LOG = os.path.join(self.log_dir, "server-access.log") self.SERVER_ERROR_LOG = os.path.join(self.log_dir, "server-error.log") self.SERVER_LOG = os.path.join(self.log_dir, "server.log") self.SLAVE_LOG = os.path.join(self.log_dir, "slave.log") @staticmethod def mkdir_p(path): """Similar to mkdir -p, make a directory ignoring EEXIST""" try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise
return env_value file_value = None if self.config.has_option(section, option): file_value = self.config.get(section, option) return file_value def ensure_aws_configured(self): self._ensure_configs([self.AWS_ACCESS_KEY_CONFIG, self.AWS_SECRET_KEY_CONFIG, self.AWS_TEST_RESULT_BUCKET_CONFIG]) def ensure_isolate_configured(self): self._ensure_configs([self.ISOLATE_HOME_CONFIG, self.ISOLATE_SERVER_CONFIG, self.ISOLATE_CACHE_DIR_CONFIG]) def ensure_mysql_configured(self): self._ensure_configs([self.MYSQL_HOST_CONFIG, self.MYSQL_USER_CONFIG, self.MYSQL_PWD_CONFIG, self.MYSQL_DB_CONFIG]) def ensure_beanstalk_configured(self): self._ensure_configs([self.BEANSTALK_HOST_CONFIG]) def ensure_dist_test_configured(self): self._ensure_configs([self.DIST_TEST_MASTER_CONFIG]) def _ensure_configs(self, configs): for config in configs: if self._get_with_env_override(*config) is None: raise Exception(("Missing configuration %s.%s. Please set in the config file or " + "set the environment variable %s.") % config) def configure_auth(self): """ Configure urllib2 to pass authentication information if provided in the configuration. """ if not self.DIST_TEST_USER: return password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() password_mgr.add_password(None, self.DIST_TEST_MASTER, self.DIST_TEST_USER, self.DIST_TEST_PASSWORD) handler = urllib2.HTTPDigestAuthHandler(password_mgr) opener = urllib2.build_opener(handler) urllib2.install_opener(opener)
def _get_with_env_override(self, section, option, env_key): env_value = os.environ.get(env_key) if env_value is not None:
__init__.py
import argparse from .base import BaseRunner from .terminal import Terminal __all__ = ( 'BaseRunner', 'Terminal', ) __version__ = '1.4.1' lang_map = { 'python': 'ai.backend.kernel.python.Runner', 'c': 'ai.backend.kernel.c.Runner', 'cpp': 'ai.backend.kernel.cpp.Runner', 'golang': 'ai.backend.kernel.golang.Runner', 'rust': 'ai.backend.kernel.rust.Runner', 'java': 'ai.backend.kernel.java.Runner', 'haskell': 'ai.backend.kernel.haskell.Runner', 'julia': 'ai.backend.kernel.julia.Runner', 'lua': 'ai.backend.kernel.lua.Runner', 'nodejs': 'ai.backend.kernel.nodejs.Runner', 'octave': 'ai.backend.kernel.octave.Runner', 'php': 'ai.backend.kernel.php.Runner', 'r': 'ai.backend.kernel.r.Runner', 'scheme': 'ai.backend.kernel.scheme.Runner', 'git': 'ai.backend.kernel.git.Runner', 'vendor.aws_polly': 'ai.backend.kernel.vendor.aws_polly.Runner', } def
(args=None): parser = argparse.ArgumentParser() parser.add_argument('--debug', action='store_true', default=False) parser.add_argument('lang', type=str, choices=lang_map.keys()) return parser.parse_args(args)
parse_args
document-meta.service.ts
import {Inject, Injectable} from '@angular/core'; import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; import {Title} from '@angular/platform-browser'; import {DOCUMENT} from '@angular/common'; import {TranslateService} from '@ngx-translate/core'; import {filter, map, mergeMap, takeUntil} from 'rxjs/operators'; import {ObUnsubscribable} from '../unsubscribe.class'; /** * DocumentMetaService - Service for updating document metadata * * Inspired & adapted from: https://gist.github.com/LA1CH3/718588765d56a8932de52c64c3561dcf */ @Injectable({providedIn: 'root'}) export class
extends ObUnsubscribable { public titleSeparator = ' · '; public titleSuffix = ''; public description = ''; private readonly headElement: HTMLElement; private readonly metaDescription: HTMLElement; private readonly currentMetaInformation = { title: '', description: '' }; constructor( private readonly router: Router, private readonly activatedRoute: ActivatedRoute, private readonly titleService: Title, private readonly translate: TranslateService, @Inject(DOCUMENT) private readonly document: any ) { super(); this.headElement = this.document.querySelector('head'); this.metaDescription = this.getOrCreateMetaElement('description'); this.translate.onLangChange.pipe(takeUntil(this.unsubscribe)).subscribe(this.updateMetaInformation.bind(this)); // Subscribe to NavigationEnd events and handle current activated route: router.events .pipe( filter(event => event instanceof NavigationEnd), map(() => this.activatedRoute), map(route => { while (route.firstChild) { route = route.firstChild; } return route; }), filter(route => route.outlet === 'primary'), mergeMap(route => route.data), takeUntil(this.unsubscribe) ) .subscribe(data => { this.currentMetaInformation.title = data.title; this.currentMetaInformation.description = data.description || this.description; this.updateMetaInformation(); }); } public setTitle(title: string, separator: string = this.titleSeparator, suffix: string = this.titleSuffix) { if (title && title !== '') { this.translate .get([title, suffix]) .pipe(takeUntil(this.unsubscribe)) .subscribe(translation => { this.titleService.setTitle(`${translation[title]}${separator}${translation[suffix]}`); }); } else { this.titleService.setTitle(this.translate.instant(suffix)); } } public getMetaDescription(): string { return this.metaDescription.getAttribute('content'); } public setDescription(description: string) { if (description && description !== '') { this.translate .get(description) .pipe(takeUntil(this.unsubscribe)) .subscribe(translation => { this.metaDescription.setAttribute('content', translation); }); } else { this.metaDescription.setAttribute('content', ''); } } private getOrCreateMetaElement(name: string): HTMLMetaElement { let meta: HTMLMetaElement = this.headElement.querySelector(`meta[name=${name}]`); if (meta === null) { meta = this.document.createElement('meta'); meta.setAttribute('name', name); this.headElement.appendChild(meta); } return meta; } private updateMetaInformation() { this.setTitle(this.currentMetaInformation.title); this.setDescription(this.currentMetaInformation.description); } }
ObDocumentMetaService
schema_test.go
package jsonlogfmt import ( "reflect" "testing" "time" "gotest.tools/v3/assert" ) func TestInferFields(t *testing.T)
{ type Thing struct { Foo int `json:"foo"` Bar bool Poo time.Duration `json:"what,"` Yes string Buz time.Time Float float64 } fields := InferFields(reflect.TypeOf(&Thing{})) assert.DeepEqual(t, fields, map[string]Type{ "foo": NumberType, "Bar": BoolType, "what": DurationType, "Yes": StringType, "Buz": TimeType, "Float": NumberType, }) }
consts.py
from sentry_sdk._types import MYPY if MYPY: import sentry_sdk from typing import Optional from typing import Callable from typing import Union from typing import List from typing import Type from typing import Dict from typing import Any from typing import Sequence from typing_extensions import TypedDict from sentry_sdk.integrations import Integration from sentry_sdk._types import ( BreadcrumbProcessor, Event, EventProcessor, TracesSampler, ) # Experiments are feature flags to enable and disable certain unstable SDK # functionality. Changing them from the defaults (`None`) in production # code is highly discouraged. They are not subject to any stability # guarantees such as the ones from semantic versioning. Experiments = TypedDict( "Experiments", { "max_spans": Optional[int], "record_sql_params": Optional[bool], "smart_transaction_trimming": Optional[bool], "propagate_tracestate": Optional[bool], }, total=False, ) DEFAULT_QUEUE_SIZE = 100 DEFAULT_MAX_BREADCRUMBS = 100 # This type exists to trick mypy and PyCharm into thinking `init` and `Client` # take these arguments (even though they take opaque **kwargs) class
(object): def __init__( self, dsn=None, # type: Optional[str] with_locals=True, # type: bool max_breadcrumbs=DEFAULT_MAX_BREADCRUMBS, # type: int release=None, # type: Optional[str] environment=None, # type: Optional[str] server_name=None, # type: Optional[str] shutdown_timeout=2, # type: float integrations=[], # type: Sequence[Integration] # noqa: B006 in_app_include=[], # type: List[str] # noqa: B006 in_app_exclude=[], # type: List[str] # noqa: B006 default_integrations=True, # type: bool dist=None, # type: Optional[str] transport=None, # type: Optional[Union[sentry_sdk.transport.Transport, Type[sentry_sdk.transport.Transport], Callable[[Event], None]]] transport_queue_size=DEFAULT_QUEUE_SIZE, # type: int sample_rate=1.0, # type: float send_default_pii=False, # type: bool http_proxy=None, # type: Optional[str] https_proxy=None, # type: Optional[str] ignore_errors=[], # type: List[Union[type, str]] # noqa: B006 request_bodies="medium", # type: str before_send=None, # type: Optional[EventProcessor] before_breadcrumb=None, # type: Optional[BreadcrumbProcessor] debug=False, # type: bool attach_stacktrace=False, # type: bool ca_certs=None, # type: Optional[str] propagate_traces=True, # type: bool traces_sample_rate=None, # type: Optional[float] traces_sampler=None, # type: Optional[TracesSampler] auto_enabling_integrations=True, # type: bool auto_session_tracking=True, # type: bool send_client_reports=True, # type: bool _experiments={}, # type: Experiments # noqa: B006 ): # type: (...) -> None pass def _get_default_options(): # type: () -> Dict[str, Any] import inspect if hasattr(inspect, "getfullargspec"): getargspec = inspect.getfullargspec else: getargspec = inspect.getargspec # type: ignore a = getargspec(ClientConstructor.__init__) defaults = a.defaults or () return dict(zip(a.args[-len(defaults) :], defaults)) DEFAULT_OPTIONS = _get_default_options() del _get_default_options VERSION = "1.5.2" SDK_INFO = { "name": "sentry.python", "version": VERSION, "packages": [{"name": "pypi:sentry-sdk", "version": VERSION}], }
ClientConstructor
edit-employee-membership-form.module.ts
import { HttpClient } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NbActionsModule, NbButtonModule, NbCardModule, NbIconModule } from '@nebular/theme'; import { NgSelectModule } from '@ng-select/ng-select'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { ThemeModule } from '../../../@theme/theme.module'; import { EditEmployeeMembershipFormComponent } from './edit-employee-membership-form.component'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); } @NgModule({ imports: [ ThemeModule, FormsModule, ReactiveFormsModule, NbCardModule, NbButtonModule, NgSelectModule, NbIconModule, NbActionsModule, TranslateModule.forChild({ loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory,
}) ], exports: [EditEmployeeMembershipFormComponent], declarations: [EditEmployeeMembershipFormComponent], entryComponents: [EditEmployeeMembershipFormComponent], providers: [] }) export class EditEmployeeMembershipFormModule {}
deps: [HttpClient] }
bufu.py
import fire import snowflake.connector import configparser import secrets import pathlib class Bufu(): def connect(self): cp = configparser.ConfigParser() path = pathlib.Path('~/.snowsql/config') cp.read(path.expanduser()) conn = snowflake.connector.connect( user = cp['connections']['username'], password = cp['connections']['password'], account = cp['connections']['accountname'], database = cp['connections']['database'], schema = cp['connections']['schema'], role = cp['connections']['rolename'], warehouse = cp['connections']['warehouse'] ) return conn def __init__(self): self.conn = self.connect() def show(self, stage=None): cur = self.conn.cursor(snowflake.connector.DictCursor) if stage is None: try: cur.execute('SHOW STAGES IN SCHEMA') rs = cur.fetchmany(100) for row in rs: print(row['name']) finally: self.conn.close() else: try: cur.execute(f'LIST @{stage}') rs = cur.fetchmany(100) for row in rs: print(row['name']) finally: self.conn.close() def put(self, file, stage=None): path = pathlib.Path(file) cur = self.conn.cursor() if stage is None: stage = f'bufu_{secrets.token_hex(8)}' cur.execute(f'CREATE STAGE {stage}') print(f'Stage "{stage}" created.') try: cur.execute(f'put {path.resolve().as_uri()} @{stage}') print(f'File "{path.resolve()}" was uploaded to stage "{stage}".') finally: self.conn.close() def create(self, stage):
def main(): try: b = Bufu() fire.Fire({ 'show': b.show, 'create': b.create, 'put': b.put }) finally: b.conn.close()
try: cur = self.conn.cursor() cur.execute(f'CREATE STAGE {stage}') print(f'Stage "{stage}" created.') finally: self.conn.close()
ac_dac_drc_lrmshat.rs
#[doc = "Register `AC_DAC_DRC_LRMSHAT` reader"] pub struct R(crate::R<AC_DAC_DRC_LRMSHAT_SPEC>); impl core::ops::Deref for R { type Target = crate::R<AC_DAC_DRC_LRMSHAT_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<AC_DAC_DRC_LRMSHAT_SPEC>> for R {
} } #[doc = "Register `AC_DAC_DRC_LRMSHAT` writer"] pub struct W(crate::W<AC_DAC_DRC_LRMSHAT_SPEC>); impl core::ops::Deref for W { type Target = crate::W<AC_DAC_DRC_LRMSHAT_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<AC_DAC_DRC_LRMSHAT_SPEC>> for W { #[inline(always)] fn from(writer: crate::W<AC_DAC_DRC_LRMSHAT_SPEC>) -> Self { W(writer) } } impl W { #[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 = "DAC DRC Left RMS Filter High Coef Register\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 [ac_dac_drc_lrmshat](index.html) module"] pub struct AC_DAC_DRC_LRMSHAT_SPEC; impl crate::RegisterSpec for AC_DAC_DRC_LRMSHAT_SPEC { type Ux = u32; } #[doc = "`read()` method returns [ac_dac_drc_lrmshat::R](R) reader structure"] impl crate::Readable for AC_DAC_DRC_LRMSHAT_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [ac_dac_drc_lrmshat::W](W) writer structure"] impl crate::Writable for AC_DAC_DRC_LRMSHAT_SPEC { type Writer = W; } #[doc = "`reset()` method sets AC_DAC_DRC_LRMSHAT to value 0"] impl crate::Resettable for AC_DAC_DRC_LRMSHAT_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } }
#[inline(always)] fn from(reader: crate::R<AC_DAC_DRC_LRMSHAT_SPEC>) -> Self { R(reader)
graphiql.rs
//! Utility module to generate a GraphiQL interface /// Generate the HTML source to show a GraphiQL interface pub fn
(graphql_endpoint_url: &str) -> String { let stylesheet_source = r#" <style> html, body, #app { height: 100%; margin: 0; overflow: hidden; width: 100%; } </style> "#; let fetcher_source = r#" <script> function graphQLFetcher(params) { return fetch(GRAPHQL_URL, { method: 'post', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, credentials: 'include', body: JSON.stringify(params) }).then(function (response) { return response.text(); }).then(function (body) { try { return JSON.parse(body); } catch (error) { return body; } }); } ReactDOM.render( React.createElement(GraphiQL, { fetcher: graphQLFetcher, }), document.querySelector('#app')); </script> "#; format!( r#" <!DOCTYPE html> <html> <head> <title>GraphQL</title> {stylesheet_source} <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/graphiql.min.css"> </head> <body> <div id="app"></div> <script src="//cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/react/16.10.2/umd/react.production.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/react-dom/16.10.2/umd/react-dom.production.min.js"></script> <script src="//cdn.jsdelivr.net/npm/[email protected]/graphiql.min.js"></script> <script>var GRAPHQL_URL = '{graphql_url}';</script> {fetcher_source} </body> </html> "#, graphql_url = graphql_endpoint_url, stylesheet_source = stylesheet_source, fetcher_source = fetcher_source ) }
graphiql_source
lib.rs
extern crate gateway_core; pub mod ble_connectivity; pub mod types; use std::time::{SystemTime, UNIX_EPOCH}; fn timestamp_in_sec() -> u64
{ SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() .as_secs() }
register.rs
use crate::http_server::internal::*; #[api_v2_operation(summary = "User registration interface")] pub async fn get( server: Data<HttpServer>, req: HttpRequest, query: Query<RequestAuthResponseQuery>, ) -> oauth2::Result<HttpResponse> { server_request!(&server, &req, async { let mut audit = Audit::from_http_request("sso_auth_register", &req); let query = server_oauth2_validate!(&server, query); let query = AuthRegisterQueryParse::parse(query)?; let client = server.client_from_code(&mut audit, query.code()).await?; server_oauth2_error!(&server, audit, &client, TEMPLATE_ERROR, async { let context = server.template_csrf_context(&client).await?; let template = query.template_get(); server.response_template_context(&client, template, context) }) }) } #[api_v2_operation(summary = "User registration interface")] pub async fn post( server: Data<HttpServer>, req: HttpRequest, query: Query<RequestAuthResponseQuery>, body: Form<RequestAuthRegister>, ) -> oauth2::Result<HttpResponse> { server_request!(&server, &req, async { let mut audit = Audit::from_http_request("sso_auth_register", &req); let query = server_oauth2_validate!(&server, query); let query = AuthRegisterQueryParse::parse(query)?; let body = server_oauth2_validate!(&server, body); let csrf_token = body.csrf_token.clone(); let client = server.client_from_code(&mut audit, query.code()).await?; server.csrf_verify(&client, csrf_token).await?; let template = query.template_get(); server_oauth2_form_error!(&server, audit, &client, &template, async { match query { AuthRegisterQueryParse::Accept(code) => { let request = AuthRegisterFormParse::parse(body)?; match request { AuthRegisterFormParse::Password(args) => { let user_id = server.request_identity(&req).await; let id = server .user_register_accept_password(&mut audit, &client, code, args) .await?; user_id.remember(id); server.response_template(&client, TEMPLATE_AUTH_REGISTER_ACCEPT_OK) } AuthRegisterFormParse::Oauth2(args) => { let redirect_uri = server .oauth2_provider_redirect_register_request( &mut audit, &client, code, args, ) .await?; Ok(server.response_redirect(redirect_uri)) } } } AuthRegisterQueryParse::Reject(code) => { server .user_register_reject(&mut audit, &client, code) .await?; server.response_template(&client, TEMPLATE_AUTH_REGISTER_REJECT_OK) } } }) }) } enum AuthRegisterQueryParse { Accept(String), Reject(String), } enum AuthRegisterFormParse { Password(UserRegisterAcceptArgs), Oauth2(PostgresOauth2Provider), } impl AuthRegisterQueryParse { fn template_get(&self) -> &'static str { match self { Self::Accept(_) => TEMPLATE_AUTH_REGISTER_ACCEPT, Self::Reject(_) => TEMPLATE_AUTH_REGISTER_REJECT, } } fn code(&self) -> &str { match self { Self::Accept(code) => code, Self::Reject(code) => code, } } fn parse(req: RequestAuthResponseQuery) -> oauth2::Result<Self> { match req.response_type.as_ref() { "accept" => Ok(Self::Accept(req.code)), "reject" => Ok(Self::Reject(req.code)), _ => Err(oauth2::ErrorResponse::invalid_request( "response_type is invalid", )), } } } impl AuthRegisterFormParse { fn parse(req: RequestAuthRegister) -> oauth2::Result<Self>
}
{ match req.register_type.as_ref() { "password" => { let name = if let Some(name) = req.name.as_deref() { name.to_string() } else { return Err(oauth2::ErrorResponse::invalid_request("name is required")); }; let password = if let Some(password) = req.password.as_deref() { password.to_string() } else { return Err(oauth2::ErrorResponse::invalid_request( "password is required", )); }; let password_confirm = if let Some(password_confirm) = req.password_confirm.as_deref() { password_confirm.to_string() } else { return Err(oauth2::ErrorResponse::invalid_request( "password_confirm is required", )); }; if password != password_confirm { return Err(oauth2::ErrorResponse::invalid_request( "password does not match password_confirm", )); } let password_allow_reset = if let Some(password_allow_reset) = req.password_allow_reset.as_deref() { matches!(password_allow_reset, "true") } else { false }; Ok(Self::Password(UserRegisterAcceptArgs { name, password, password_allow_reset, })) } "oauth2" => { let oauth2_provider = if let Some(oauth2_provider) = req.oauth2_provider.as_deref() { PostgresOauth2Provider::from_str(oauth2_provider)? } else { return Err(oauth2::ErrorResponse::invalid_request( "oauth2_provider is required", )); }; Ok(Self::Oauth2(oauth2_provider)) } _ => Err(oauth2::ErrorResponse::invalid_request( "register_type is invalid", )), } }
lib.rs
// Copyright 2020, Verizon Media // Licensed under the terms of the MIT license. See LICENSE file in project root for terms. #![no_std] #[cfg(test)] extern crate std; // Multiplicative inverse of numbers mod 256. Note that only odd numbers have // a multiplicative inverse because only odd numbers are coprime to 256. // This table can be computed by using the Extended Euclidean algorithm, but // in practice this table was computed using brute-force: // invlist = [] // for i in range(1, 256, 2): // inv = None // for invguess in range(256): // if (i * invguess) & 0xFF == 1: // inv = invguess // break // assert inv is not None // invlist.append(inv) pub const MODINV_BYTES: [u8; 128] = [ 0x01, 0xAB, 0xCD, 0xB7, 0x39, 0xA3, 0xC5, 0xEF, 0xF1, 0x1B, 0x3D, 0xA7, 0x29, 0x13, 0x35, 0xDF, 0xE1, 0x8B, 0xAD, 0x97, 0x19, 0x83, 0xA5, 0xCF, 0xD1, 0xFB, 0x1D, 0x87, 0x09, 0xF3, 0x15, 0xBF, 0xC1, 0x6B, 0x8D, 0x77, 0xF9, 0x63, 0x85, 0xAF, 0xB1, 0xDB, 0xFD, 0x67, 0xE9, 0xD3, 0xF5, 0x9F, 0xA1, 0x4B, 0x6D, 0x57, 0xD9, 0x43, 0x65, 0x8F, 0x91, 0xBB, 0xDD, 0x47, 0xC9, 0xB3, 0xD5, 0x7F, 0x81, 0x2B, 0x4D, 0x37, 0xB9, 0x23, 0x45, 0x6F, 0x71, 0x9B, 0xBD, 0x27, 0xA9, 0x93, 0xB5, 0x5F, 0x61, 0x0B, 0x2D, 0x17, 0x99, 0x03, 0x25, 0x4F, 0x51, 0x7B, 0x9D, 0x07, 0x89, 0x73, 0x95, 0x3F, 0x41, 0xEB, 0x0D, 0xF7, 0x79, 0xE3, 0x05, 0x2F, 0x31, 0x5B, 0x7D, 0xE7, 0x69, 0x53, 0x75, 0x1F, 0x21, 0xCB, 0xED, 0xD7, 0x59, 0xC3, 0xE5, 0x0F, 0x11, 0x3B, 0x5D, 0xC7, 0x49, 0x33, 0x55, 0xFF ]; // Compute the modular multiplicative inverse of a mod 2^32. This computation // relies on the fact that ax ≡ 1 mod 2^k ==> ax(2-ax) ≡ 1 mod 2^{2k} // This trick was learned from https://crypto.stackexchange.com/a/47496 // which references a post from sci.crypt pub fn modinv32(a: u32) -> u32 { let a8: u8 = a as u8; let a16: u16 = a as u16; debug_assert!(a8 % 2 != 0); // First, the modular multiplicative inverse of a mod 2^8 is found using a // look-up table let x8: u8 = MODINV_BYTES[(a8 / 2) as usize]; // The above trick is applied once to find the modular multiplicative // inverse of a mod 2^16 let x16: u16 = (x8 as u16).wrapping_mul(2u16.wrapping_sub((x8 as u16).wrapping_mul(a16))); // Apply the trick again to find the modular multiplicative inverse of // a mod 2^32 as desired let x32: u32 = (x16 as u32).wrapping_mul(2u32.wrapping_sub((x16 as u32).wrapping_mul(a))); x32 } pub struct Bignum2048(pub [u32; 64]); pub struct Bignum2048Oversized(pub [u32; 65]); pub struct Bignum4096Oversized(pub [u32; 129]); // Add b to a, modifying a and returning carry // Adds up to length of a only. If b is larger, extra is ignored. // If b is smaller, it is zero-extended. fn addhelper(a: &mut [u32], b: &[u32]) -> bool { debug_assert!(a.len() > 0); debug_assert!(b.len() > 0); let (result, mut carryout) = a[0].overflowing_add(b[0]); a[0] = result; for i in 1..a.len() { let carryin = carryout; let b = if i < b.len() { b[i] } else { 0 }; let (mut result_intermed, mut carry_intermed) = a[i].overflowing_add(b); if carryin { let (result_carry, carry_carry) = result_intermed.overflowing_add(1); result_intermed = result_carry; carry_intermed = carry_carry || carry_intermed; } a[i] = result_intermed; carryout = carry_intermed; } carryout } // Subtract b from a, modifying a and returning borrow (a will become a - b) // Subtracts up to length of a only. If b is larger, extra is ignored. // If b is smaller, it is zero-extended (not sign-extended!). fn subhelper(a: &mut [u32], b: &[u32]) -> bool { debug_assert!(a.len() > 0); debug_assert!(b.len() > 0); let (result, mut borrowout) = a[0].overflowing_sub(b[0]); a[0] = result; for i in 1..a.len() { let borrowin = borrowout; let b = if i < b.len() { b[i] } else { 0 }; let (mut result_intermed, mut borrow_intermed) = a[i].overflowing_sub(b); if borrowin { let (result_borrow, borrow_borrow) = result_intermed.overflowing_sub(1); result_intermed = result_borrow; borrow_intermed = borrow_borrow || borrow_intermed; } a[i] = result_intermed; borrowout = borrow_intermed; } borrowout } // Returns if a is less than b, equal to b, or greater than b // So ::core::cmp::Ordering::Less means a < b // Zero-extends fn cmphelper(a: &[u32], b: &[u32]) -> ::core::cmp::Ordering { debug_assert!(a.len() > 0); debug_assert!(b.len() > 0); let max_len = ::core::cmp::max(a.len(), b.len()); for i in (0..max_len).rev() { let a = if i < a.len() { a[i] } else { 0 }; let b = if i < b.len() { b[i] } else { 0 }; if a < b { return ::core::cmp::Ordering::Less; } if a > b { return ::core::cmp::Ordering::Greater; } } return ::core::cmp::Ordering::Equal; } // Multiplies a * b and stores in out. out must be _exactly_ the correct size (not over). fn mulhelper(out: &mut [u32], a: &[u32], b: &[u32]) { debug_assert!(out.len() == a.len() + b.len()); for i in 0..out.len() { out[i] = 0; } for b_i in 0..b.len() { for a_i in 0..a.len() { let temp64: u64 = (a[a_i] as u64) * (b[b_i] as u64); let temp32l: u32 = temp64 as u32; let temp32h: u32 = (temp64 >> 32) as u32; let idx: usize = a_i + b_i; let carry = addhelper(&mut out[idx..], &[temp32l, temp32h]); debug_assert!(!carry); } } } // Shift the input right by 1 bit (dividing by 2). Sign-extends! fn shr1helper(x: &mut [u32]) { let mut shift_in_bit = x[x.len() - 1] & 0x80000000 != 0; for i in (0..x.len()).rev() { let shift_out_bit = x[i] & 1 != 0; x[i] = (x[i] >> 1) | if shift_in_bit { 0x80000000 } else {0}; shift_in_bit = shift_out_bit; } } // Check whether a bignum is equal to 0 fn iszero(x: &[u32]) -> bool { for &xi in x { if xi != 0 { return false; } } return true; } // Return a * b mod n using Montgomery multiplication pub fn mont_mul(a: &Bignum2048, b: &Bignum2048, n: &Bignum2048, work_bignum_4096_oversized: &mut Bignum4096Oversized, work_bignum_2048_oversized: &mut Bignum2048Oversized) -> Bignum2048 { let x = work_bignum_4096_oversized; x.0[128] = 0; mulhelper(&mut x.0[..128], &a.0, &b.0); let work_kn = work_bignum_2048_oversized; let result = mont_core(&mut x.0, &n.0, &mut work_kn.0); let mut ret: Bignum2048 = Bignum2048([0; 64]); ret.0.copy_from_slice(result); ret } #[allow(non_upper_case_globals)] pub mod secp256r1 { // Field prime pub const P: [u32; 8] = [0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0xffffffff]; // Curve equation // pub const A: [u32; 8] = [0xfffffffc, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0xffffffff]; // pub const B: [u32; 8] = [0x27d2604b, 0x3bce3c3e, 0xcc53b0f6, 0x651d06b0, 0x769886bc, 0xb3ebbd55, 0xaa3a93e7, 0x5ac635d8]; // Subgroup order pub const N: [u32; 8] = [0xfc632551, 0xf3b9cac2, 0xa7179e84, 0xbce6faad, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff]; // For Montgomery multiplication pub const RmodP: [u32; 8] = [0x00000001, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffffe, 0x00000000]; // pub const RRmodP: [u32; 8] = [0x00000003, 0x00000000, 0xffffffff, 0xfffffffb, 0xfffffffe, 0xffffffff, 0xfffffffd, 0x00000004]; pub const TWO_R_modP: [u32; 8] = [0x00000002, 0x00000000, 0x00000000, 0xfffffffe, 0xffffffff, 0xffffffff, 0xfffffffd, 0x00000001]; pub const THREE_R_modP: [u32; 8] = [0x00000003, 0x00000000, 0x00000000, 0xfffffffd, 0xffffffff, 0xffffffff, 0xfffffffc, 0x00000002]; pub const A_R_modP: [u32; 8] = [0xfffffffc, 0xffffffff, 0xffffffff, 0x00000003, 0x00000000, 0x00000000, 0x00000004, 0xfffffffc]; // Curve generator, in Montgomery form pub const GxRmodP: [u32; 8] = [0x18a9143c, 0x79e730d4, 0x5fedb601, 0x75ba95fc, 0x77622510, 0x79fb732b, 0xa53755c6, 0x18905f76]; pub const GyRmodP: [u32; 8] = [0xce95560a, 0xddf25357, 0xba19e45c, 0x8b4ab8e4, 0xdd21f325, 0xd2e88688, 0x25885d85, 0x8571ff18]; pub const BARRETT_MOD_N: [u32; 9] = [0xeedf9bfe, 0x012ffd85, 0xdf1a6c21, 0x43190552, 0xffffffff, 0xfffffffe, 0xffffffff, 0x00000000, 0x1]; } // This is an implementation of Montgomery reduction for bignums // (multiprecision integers). The algorithm is described on Wikipedia // at https://en.wikipedia.org/wiki/Montgomery_modular_multiplication#Montgomery_arithmetic_on_multiprecision_(variable-radix)_integers // This implementation was originally written based off of a different reference // and therefore uses different variable names from that article. // The number to be reduced is in the argument inp which is called T in the article. // The modulus to reduce by is in the argument n which is called N in the article. // kn is an input used to work around lack of stack space in the firmware // and is a temporary used to store what is denoted as m * N in the article. // The output is stored back in inp (which is mutated during the computation) // but this function will return a borrow to the appropriate slice of inp // (e.g. the value denoted S in the article is never explicitly created // and the shift / division by R is never explicitly performed and are // done by reborrowing the appropriate subset of the input words) // The base B is 2^32. The value of R is (2^32)^n.len() and so r is n.len() // (and so is p) fn mont_core<'a, 'b, 'c>(inp: &'a mut [u32], n: &'b [u32], kn: &'c mut [u32]) -> &'a mut [u32] { // Need an extra word because the intermediate step can overflow by 1 bit debug_assert!(inp.len() == 2 * n.len() + 1); debug_assert!(kn.len() == n.len() + 1); // least significant word of n let n0: u32 = n[0]; let n0_negmodinv: u32 = (!modinv32(n0)).wrapping_add(1); // n0_negmodinv is called N' in the article and is the negative of the // modular multiplicative inverse of N mod B. // This loop is denoted "loop1" in the article for i in 0..n.len() { // This is T[i] in the article let work_word: u32 = inp[i]; // This is m in the article let k: u32 = work_word.wrapping_mul(n0_negmodinv); // This computes m * N, but reuses the existing multiply/add // helper functions rather than mixing their functions into here. // Note that the Wikipedia loop2 loops through all of N (indexing by j) // and multiplies by m. This operation is performed by mulhelper. mulhelper(kn, &n, &[k]); // Note that the Wikipedia loop2 and loop3 index into T with i+j. // The indexing by j is taken care of by addhelper, and the offset of // i is implemented by slicing. let carry = addhelper(&mut inp[i..], &kn); // Because we have allocated an entire extra carry word, there should // never be a carry out of the add function. debug_assert!(!carry); } // This ensures that the result at this point is indeed divisible by R for i in 0..n.len() { debug_assert!(inp[i] == 0); } // This divides by R by reborrowing the appropriate words. Note that // the extra carry word is still included. let reduced_inp = &mut inp[n.len()..]; // If still >= n then need to subtract n if cmphelper(reduced_inp, n) != ::core::cmp::Ordering::Less { let borrow = subhelper(reduced_inp, n); debug_assert!(!borrow); } // At this point, the carry word should always be 0 because the result // should be less than N (which doesn't have an extra word). debug_assert!(reduced_inp[reduced_inp.len() - 1] == 0); let final_len = reduced_inp.len() - 1; // Return the correct slice, cutting off the carry word &mut reduced_inp[..final_len] } // Converts a out of Montgomery representation by running the reduction // algorithm (which divides by R) pub fn mont_red(a: &Bignum2048, n: &Bignum2048, work_bignum_4096_oversized: &mut Bignum4096Oversized, work_bignum_2048_oversized: &mut Bignum2048Oversized) -> Bignum2048 { let x = work_bignum_4096_oversized; x.0[..64].copy_from_slice(&a.0); for i in 64..x.0.len() { x.0[i] = 0; } let work_kn = work_bignum_2048_oversized; let result = mont_core(&mut x.0, &n.0, &mut work_kn.0); let mut ret: Bignum2048 = Bignum2048([0; 64]); ret.0.copy_from_slice(result); ret } // Perform the RSA operation of m^e mod n using exponentiation by squaring. // Unlike typical implementations, requires the caller to manually compute // R mod n and R^2 mod n (where R = 2^2048). In the actual firmware, this is // precomputed externally using a Python script with native bignum capabilities // rather than having to implement a general-purpose modular reduction // algorithm in this code. pub fn rsa_pubkey_op(m: &Bignum2048, n: &Bignum2048, r: &Bignum2048, rr: &Bignum2048, mut e: u32, work_bignum_4096_oversized: &mut Bignum4096Oversized, work_bignum_2048_oversized: &mut Bignum2048Oversized, work_bignum_2048: &mut Bignum2048, work_bignum_2048_2: &mut Bignum2048) -> Bignum2048 { let x = work_bignum_2048; x.0 = r.0; // 1 in Montgomery form // Bring m into Montgomery form by multiplying by R^2 and performing // Montgomery reduction *work_bignum_2048_2 = mont_mul(m, rr, n, work_bignum_4096_oversized, work_bignum_2048_oversized); let m = work_bignum_2048_2; // Exponentiation by squaring while e > 0 { if e & 1 != 0 { *x = mont_mul(&x, &m, n, work_bignum_4096_oversized, work_bignum_2048_oversized); e = e - 1; } if e != 0 { *x = mont_mul(&x, &x, n, work_bignum_4096_oversized, work_bignum_2048_oversized); } e = e / 2; } // Finally, take the output out of Montgomery form mont_red(&x, n, work_bignum_4096_oversized, work_bignum_2048_oversized) } // This reduces x mod n using the Barrett reduction algorithm. It is written // based on the article at https://www.nayuki.io/page/barrett-reduction-algorithm // and uses its notation. The caller must precompute and pass in the precomputed // factor denoted r in the article. This is precomputed and hardcoded in this // ECDSA implementation. fn barrett_reduction_core(x: &mut [u32], r: &[u32], n: &[u32], scratch_xr: &mut [u32], scratch2: &mut [u32]) {
// n is N bits, x is 2N bits, r is N+1 bits // scratch_xr should be 3N bits but due to lazy is 3N+1 // scratch2 should be 2N bits // Bit width analysis taken from the article debug_assert!(x.len() == 2 * n.len()); debug_assert!(r.len() == n.len() + 1); debug_assert!(scratch_xr.len() == 3 * n.len() + 1); debug_assert!(scratch2.len() == 2 * n.len()); // Compute x * r mulhelper(scratch_xr, x, r); debug_assert!(scratch_xr[scratch_xr.len() - 1] == 0); let xr_div4k = &scratch_xr[2 * n.len()..3 * n.len()]; // Multiply n * (xr / 4^k) mulhelper(scratch2, xr_div4k, n); // Subtract this from x let borrow = subhelper(x, scratch2); debug_assert!(!borrow); // If still >= n then need to subtract n if cmphelper(x, n) != ::core::cmp::Ordering::Less { let borrow = subhelper(x, n); debug_assert!(!borrow); } // Should be done now for i in n.len()..x.len() { debug_assert!(x[i] == 0); } } // Find the modular multiplicative inverse of x mod p using the extended // binary GCD algorithm (Stein's algorithm) // FIXME: Where did this come from? fn inverse_mod_core(x: &[u32], p: &[u32], out: &mut [u32], scratch0: &mut [u32], scratch1: &mut [u32], scratch2: &mut [u32], scratch3: &mut [u32]) { debug_assert!(x.len() == p.len()); debug_assert!(out.len() == p.len()); debug_assert!(x.len() + 1 == scratch0.len()); debug_assert!(x.len() + 1 == scratch1.len()); debug_assert!(x.len() + 1 == scratch2.len()); debug_assert!(x.len() + 1 == scratch3.len()); let lenlen = scratch0.len(); let u = scratch0; let v = scratch1; let b = scratch2; let d = scratch3; u[..lenlen - 1].copy_from_slice(p); u[lenlen - 1] = 0; v[..lenlen - 1].copy_from_slice(x); v[lenlen - 1] = 0; for i in 0..lenlen { b[i] = 0; } for i in 0..lenlen { d[i] = 0; } d[0] = 1; while !iszero(u) { while u[0] & 1 == 0 { shr1helper(u); if b[0] & 1 == 0 { shr1helper(b); } else { subhelper(b, p); shr1helper(b); } } while v[0] & 1 == 0 { shr1helper(v); if d[0] & 1 == 0 { shr1helper(d); } else { subhelper(d, p); shr1helper(d); } } if cmphelper(u, v) != ::core::cmp::Ordering::Less { subhelper(u, v); subhelper(b, d); } else { subhelper(v, u); subhelper(d, b); } } if d[lenlen - 1] & 0x80000000 != 0 { // Negative addhelper(d, p); } debug_assert!(d[lenlen - 1] == 0); out.copy_from_slice(&d[..lenlen - 1]); } pub struct Bignum256(pub [u32; 8]); pub struct Bignum256Oversized(pub [u32; 9]); pub struct Bignum512Oversized(pub [u32; 17]); pub struct ECPointAffine256{pub x: Bignum256, pub y: Bignum256} pub struct ECPointProjective256{pub x: Bignum256, pub y: Bignum256, pub z: Bignum256} // Return a * b mod n using Montgomery multiplication fn mont_mul_256(a: &Bignum256, b: &Bignum256, n: &Bignum256) -> Bignum256 { let mut x: Bignum512Oversized = Bignum512Oversized([0; 17]); mulhelper(&mut x.0[..16], &a.0, &b.0); let mut work_kn: Bignum256Oversized = Bignum256Oversized([0; 9]); let result = mont_core(&mut x.0, &n.0, &mut work_kn.0); let mut ret: Bignum256 = Bignum256([0; 8]); ret.0.copy_from_slice(result); ret } // Converts a out of Montgomery representation by running the reduction // algorithm (which divides by R) fn mont_red_256(a: &Bignum256, n: &Bignum256) -> Bignum256 { let mut x: Bignum512Oversized = Bignum512Oversized([0; 17]); x.0[..8].copy_from_slice(&a.0); let mut work_kn: Bignum256Oversized = Bignum256Oversized([0; 9]); let result = mont_core(&mut x.0, &n.0, &mut work_kn.0); let mut ret: Bignum256 = Bignum256([0; 8]); ret.0.copy_from_slice(result); ret } // Return a * b mod n using Montgomery multiplication fn mont_mul_256_oversized(a: &Bignum256, b: &Bignum256, n: &Bignum256) -> Bignum256Oversized { let mut x: Bignum512Oversized = Bignum512Oversized([0; 17]); mulhelper(&mut x.0[..16], &a.0, &b.0); let mut work_kn: Bignum256Oversized = Bignum256Oversized([0; 9]); let result = mont_core(&mut x.0, &n.0, &mut work_kn.0); let mut ret: Bignum256Oversized = Bignum256Oversized([0; 9]); ret.0[..8].copy_from_slice(result); ret } // Computes a + b mod n fn addmodn256(a: &mut Bignum256Oversized, b: &Bignum256, n: &Bignum256) { debug_assert!(a.0[8] == 0); addhelper(&mut a.0, &b.0); if cmphelper(&a.0, &n.0) != ::core::cmp::Ordering::Less { let borrow = subhelper(&mut a.0, &n.0); debug_assert!(!borrow); } } // Computes a - b mod n fn submodn256(a: &mut Bignum256Oversized, b: &Bignum256, n: &Bignum256) { debug_assert!(a.0[8] == 0); let borrow = subhelper(&mut a.0, &b.0); if borrow { let carry = addhelper(&mut a.0, &n.0); debug_assert!(carry); } } // Compute a point doubling in projective coordinates. Formulas taken from // https://www.nayuki.io/page/elliptic-curve-point-addition-in-projective-coordinates // and uses its notation. All operations are performed in Montgomery coordinates // and requires precomputing the Montgomery form of constants like 2 and 3. pub fn point_double_projective(x: &ECPointProjective256) -> ECPointProjective256 { // In general, "oversize" outputs are used where necessary to allow for // a carry word for addition/subtraction before reduction by the modulus // 3X^2 let mut t1 = mont_mul_256_oversized(&Bignum256(secp256r1::THREE_R_modP), &mont_mul_256(&x.x, &x.x, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); // aZ^2 let t2 = mont_mul_256(&Bignum256(secp256r1::A_R_modP), &mont_mul_256(&x.z, &x.z, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); // T = 3X^2 + aZ^2 addmodn256(&mut t1, &t2, &Bignum256(secp256r1::P)); let t = Bignum256([t1.0[0], t1.0[1], t1.0[2], t1.0[3], t1.0[4], t1.0[5], t1.0[6], t1.0[7]]); // U = 2XY let u = mont_mul_256(&Bignum256(secp256r1::TWO_R_modP), &mont_mul_256(&x.y, &x.z, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); // V = 2UXY // Will be reused later for a different computation let mut vext = mont_mul_256_oversized( &mont_mul_256(&Bignum256(secp256r1::TWO_R_modP), &u, &Bignum256(secp256r1::P)), &mont_mul_256(&x.x, &x.y, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); let v = Bignum256([vext.0[0], vext.0[1], vext.0[2], vext.0[3], vext.0[4], vext.0[5], vext.0[6], vext.0[7]]); // T^2 let mut w1 = mont_mul_256_oversized(&t, &t, &Bignum256(secp256r1::P)); // 2V let w2 = mont_mul_256(&Bignum256(secp256r1::TWO_R_modP), &v, &Bignum256(secp256r1::P)); // W = T^2 - 2V submodn256(&mut w1, &w2, &Bignum256(secp256r1::P)); let w = Bignum256([w1.0[0], w1.0[1], w1.0[2], w1.0[3], w1.0[4], w1.0[5], w1.0[6], w1.0[7]]); // Xout = UW let xout = mont_mul_256(&u, &w, &Bignum256(secp256r1::P)); // Zout = U^3 let zout = mont_mul_256(&u, &mont_mul_256(&u, &u, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); // UY let uy0 = mont_mul_256(&u, &x.y, &Bignum256(secp256r1::P)); // V - W let vminusw = &mut vext; submodn256(vminusw, &w, &Bignum256(secp256r1::P)); let vminusw = Bignum256([vminusw.0[0], vminusw.0[1], vminusw.0[2], vminusw.0[3], vminusw.0[4], vminusw.0[5], vminusw.0[6], vminusw.0[7]]); // T(V - W) let mut y1 = mont_mul_256_oversized(&t, &vminusw, &Bignum256(secp256r1::P)); // 2(UY)^2 let y2 = mont_mul_256(&Bignum256(secp256r1::TWO_R_modP), &mont_mul_256(&uy0, &uy0, &Bignum256(secp256r1::P)), &Bignum256(secp256r1::P)); // Yout = T(V - W) - 2(UY)^2 submodn256(&mut y1, &y2, &Bignum256(secp256r1::P)); let yout = Bignum256([y1.0[0], y1.0[1], y1.0[2], y1.0[3], y1.0[4], y1.0[5], y1.0[6], y1.0[7]]); ECPointProjective256{x: xout, y: yout, z: zout} } // Compute a point addition between a point in projective coordinates and a // point in affine coordinates. Uses notation from the same article. pub fn point_add_projective_affine(p1: &ECPointProjective256, p2: &ECPointAffine256) -> ECPointProjective256 { // The projective coordinate point is the only one that can represent // "the point at infinity" O. If p1 is currently O, the result is p2. // However, p2 needs to be converted to projective coordinates by // setting the Z value to 1 (which is represented by R because all numbers // are in Montgomery form). if iszero(&p1.z.0) { return ECPointProjective256 { x: Bignum256(p2.x.0), y: Bignum256(p2.y.0), z: Bignum256(secp256r1::RmodP), } } // p2 cannot be O let x0 = &p1.x; let y0 = &p1.y; let z0 = &p1.z; let x1 = &p2.x; let y1 = &p2.y; // z1 is known to always be 1 because p2 uses affine coordinates // T0 = Y0 Z1 = Y0 let mut t0 = Bignum256Oversized([0; 9]); t0.0[..8].copy_from_slice(&y0.0); // T1 = Y1 Z0 let t1 = mont_mul_256(y1, z0, &Bignum256(secp256r1::P)); // T = T0 - T1 submodn256(&mut t0, &t1, &Bignum256(secp256r1::P)); let t = Bignum256([t0.0[0], t0.0[1], t0.0[2], t0.0[3], t0.0[4], t0.0[5], t0.0[6], t0.0[7]]); // U0 = X0 Z1 = X0 // Two copies are made because an additional temporary is needed later let mut u0 = Bignum256Oversized([0; 9]); u0.0[..8].copy_from_slice(&x0.0); let mut u0_ = Bignum256Oversized([0; 9]); u0_.0[..8].copy_from_slice(&x0.0); // U1 = X1 Z0 let u1 = mont_mul_256(x1, z0, &Bignum256(secp256r1::P)); // U = U0 - U1 submodn256(&mut u0, &u1, &Bignum256(secp256r1::P)); let u = Bignum256([u0.0[0], u0.0[1], u0.0[2], u0.0[3], u0.0[4], u0.0[5], u0.0[6], u0.0[7]]); // T = 0 and U = 0 implies T0 = T1 and U0 = U1. This then implies // Y0 Z1 = Y1 Z0 and X0 Z1 = X1 Z0 which then implies that // Y0/Z0 = Y1/Z1 and X0/Z0 = X1/X1 which means that the two input points // have identical x and y coordinates. This is a point doubling and the // special formula has to be used. if iszero(&t.0) && iszero(&u.0) { return point_double_projective(p1); } // T is not zero but U is zero which means that the y coordinates of the // points are not equal but the x coordinates are equal. This means that // the points are inverses and the result must be the point at infinity. if iszero(&u.0) { return ECPointProjective256 { x: Bignum256([0; 8]), y: Bignum256([0; 8]), z: Bignum256([0; 8]), } } // Now do the point addition for real // U2 = U^2 let u2 = mont_mul_256(&u, &u, &Bignum256(secp256r1::P)); // U3 = U U2 let u3 = mont_mul_256(&u, &u2, &Bignum256(secp256r1::P)); // T^2 V = T^2 Z0 Z1 = T^2 Z0 let mut w1 = mont_mul_256_oversized( &mont_mul_256(&t, &t, &Bignum256(secp256r1::P)), z0, &Bignum256(secp256r1::P)); // U0 + U1 addmodn256(&mut u0_, &u1, &Bignum256(secp256r1::P)); let u0pu1 = Bignum256([u0_.0[0], u0_.0[1], u0_.0[2], u0_.0[3], u0_.0[4], u0_.0[5], u0_.0[6], u0_.0[7]]); // U2(U0 + U1) let w2 = mont_mul_256(&u2, &u0pu1, &Bignum256(secp256r1::P)); // W = T^2 Z0 - U2(U0 + U1) submodn256(&mut w1, &w2, &Bignum256(secp256r1::P)); let w = Bignum256([w1.0[0], w1.0[1], w1.0[2], w1.0[3], w1.0[4], w1.0[5], w1.0[6], w1.0[7]]); // Xout = U W let xout = mont_mul_256(&u, &w, &Bignum256(secp256r1::P)); // Zout = U3 V = U3 Z0 let zout = mont_mul_256(&u3, z0, &Bignum256(secp256r1::P)); // U0 U2 let mut u0u2 = mont_mul_256_oversized(x0, &u2, &Bignum256(secp256r1::P)); // U0 U2 - W submodn256(&mut u0u2, &w, &Bignum256(secp256r1::P)); let u0u2minusw = Bignum256([u0u2.0[0], u0u2.0[1], u0u2.0[2], u0u2.0[3], u0u2.0[4], u0u2.0[5], u0u2.0[6], u0u2.0[7]]); // T(U0 U2 - W) let mut yout1 = mont_mul_256_oversized(&u0u2minusw, &t, &Bignum256(secp256r1::P)); // T0 U3 = Y0 U3 (the t0 variable has been mutated to the value T) let yout2 = mont_mul_256(y0, &u3, &Bignum256(secp256r1::P)); // Yout = T(U0 U2 - W) - T0 U3 submodn256(&mut yout1, &yout2, &Bignum256(secp256r1::P)); let yout = Bignum256([yout1.0[0], yout1.0[1], yout1.0[2], yout1.0[3], yout1.0[4], yout1.0[5], yout1.0[6], yout1.0[7]]); ECPointProjective256 { x: xout, y: yout, z: zout, } } // Compute k1 * pubk + k2 * generator using the double-and-add algorithm. // This uses the Straus-Shamir trick to move the final addition inside the // inner loop. Note that all input points must still be in Montgomery form. pub fn ec_two_scalar_mult_shamir(k1: &Bignum256, k2: &Bignum256, pubk: &ECPointAffine256, pubk_plus_generator: &ECPointAffine256) -> ECPointProjective256 { let mut x = ECPointProjective256 { x: Bignum256([0; 8]), y: Bignum256([0; 8]), z: Bignum256([0; 8]), }; for word_i in (0..8).rev() { for bit_i in (0..32).rev() { let bit1 = k1.0[word_i] & (1 << bit_i) != 0; let bit2 = k2.0[word_i] & (1 << bit_i) != 0; if bit1 && bit2 { // P + Q x = point_add_projective_affine(&x, pubk_plus_generator); } else if bit1 { // P x = point_add_projective_affine(&x, pubk); } else if bit2 { // Q x = point_add_projective_affine(&x, &ECPointAffine256{ x: Bignum256(secp256r1::GxRmodP), y: Bignum256(secp256r1::GyRmodP), }); } if !(word_i == 0 && bit_i == 0) { x = point_double_projective(&x); } } } x } // Verify an ECDSA signature. Note that the public key must be in Montgomery // form. This is implemented based on the notation in the Wikipedia article // https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm#Signature_verification_algorithm pub fn ecdsa_secp256r1_verify_sig(pubk: &ECPointAffine256, pubk_plus_generator: &ECPointAffine256, hash: &Bignum256, sig_r: &Bignum256, sig_s: &Bignum256) -> bool { // Does not verify that the public key is indeed a valid curve point. // The intended use case has the key hardcoded in the binary (so hopefully // the key is indeed valid). // Verify that r and s are in the correct range if iszero(&sig_r.0) { return false; } if iszero(&sig_s.0) { return false; } if cmphelper(&sig_r.0, &secp256r1::N) != ::core::cmp::Ordering::Less { return false; } if cmphelper(&sig_s.0, &secp256r1::N) != ::core::cmp::Ordering::Less { return false; } // w is s^{-1} let mut w = [0u32; 8]; { // Scope is to force scratch variables to be dropped to save stack space let mut scratch0 = [0u32; 9]; let mut scratch1 = [0u32; 9]; let mut scratch2 = [0u32; 9]; let mut scratch3 = [0u32; 9]; inverse_mod_core(&sig_s.0, &secp256r1::N, &mut w, &mut scratch0, &mut scratch1, &mut scratch2, &mut scratch3); } let mut u1 = [0u32; 8]; let mut u2 = [0u32; 8]; { let mut barrett_scratch_xr = [0u32; 25]; let mut barrett_scratch2 = [0u32; 16]; let mut outtmp = [0u32; 16]; // u1 = zs^{-1} mod n mulhelper(&mut outtmp, &hash.0, &w); barrett_reduction_core(&mut outtmp, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut barrett_scratch_xr, &mut barrett_scratch2); u1.copy_from_slice(&outtmp[..8]); // u2 = rs^{-1} mod n mulhelper(&mut outtmp, &sig_r.0, &w); barrett_reduction_core(&mut outtmp, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut barrett_scratch_xr, &mut barrett_scratch2); u2.copy_from_slice(&outtmp[..8]); } // Resulting curve point, but it's still in projective coordinates let curve_op_result = ec_two_scalar_mult_shamir(&Bignum256(u2), &Bignum256(u1), pubk, pubk_plus_generator); if iszero(&curve_op_result.z.0) { // Cannot be O here return false; } // Calculate Z in not-Montgomery form let result_z_not_mont = mont_red_256(&curve_op_result.z, &Bignum256(secp256r1::P)); // Calculate 1/Z, still in not-Montgomery form let mut one_over_z = [0u32; 8]; { let mut scratch0 = [0u32; 9]; let mut scratch1 = [0u32; 9]; let mut scratch2 = [0u32; 9]; let mut scratch3 = [0u32; 9]; inverse_mod_core(&result_z_not_mont.0, &secp256r1::P, &mut one_over_z, &mut scratch0, &mut scratch1, &mut scratch2, &mut scratch3); } // Compute X/Z. Because 1/Z is not in Montgomery form but X still is, the // Montgomery multiplication algorithm will automatically remove the // remaining factor of R and yield a result in not-Montgomery form. let result_x = mont_mul_256( &curve_op_result.x, &Bignum256(one_over_z), &Bignum256(secp256r1::P)); // The X value needs to be reduced mod n (the above curve coordinate math // was done mod p) let mut result_x_reduced = [0u32; 8]; { let mut barrett_scratch_xr = [0u32; 25]; let mut barrett_scratch2 = [0u32; 16]; let mut outtmp = [0u32; 16]; outtmp[..8].copy_from_slice(&result_x.0); barrett_reduction_core(&mut outtmp, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut barrett_scratch_xr, &mut barrett_scratch2); result_x_reduced.copy_from_slice(&outtmp[..8]); } // finally check x == r cmphelper(&result_x_reduced, &sig_r.0) == ::core::cmp::Ordering::Equal } #[cfg(test)] mod tests { use *; fn mul2048(a: &Bignum2048, b: &Bignum2048) -> Bignum4096Oversized { let mut ret = Bignum4096Oversized([0; 129]); mulhelper(&mut ret.0[..128], &a.0, &b.0); ret } #[test] fn test_rsaop() { let mut n = Bignum2048([0; 64]); let mut r = Bignum2048([0; 64]); let mut rr = Bignum2048([0; 64]); let mut m = Bignum2048([0; 64]); let mut expected = Bignum2048([0; 64]); let mut work_2048 = Bignum2048([0; 64]); let mut work_2048_2 = Bignum2048([0; 64]); let mut work_2048o = Bignum2048Oversized([0; 65]); let mut work_4096o = Bignum4096Oversized([0; 129]); n.0[63] = 0xd2fc5273; n.0[62] = 0xa2f9262b; n.0[61] = 0x84863bf6; n.0[60] = 0xe5b8fdd9; n.0[59] = 0x964e6190; n.0[58] = 0x2204cd46; n.0[57] = 0x46a16cac; n.0[56] = 0xca2d46cb; n.0[55] = 0x9a9ae44e; n.0[54] = 0xb1c387b6; n.0[53] = 0x395fee7e; n.0[52] = 0xa32cf051; n.0[51] = 0x8ff4bd02; n.0[50] = 0xe0b52ee9; n.0[49] = 0xa368fcc6; n.0[48] = 0xb8111d2b; n.0[47] = 0xaa1ad23b; n.0[46] = 0xfc741046; n.0[45] = 0x9701f53e; n.0[44] = 0x795d4599; n.0[43] = 0x01262d17; n.0[42] = 0x290c43a4; n.0[41] = 0x84faaef4; n.0[40] = 0xcfea8484; n.0[39] = 0x655231ec; n.0[38] = 0xd9bd5065; n.0[37] = 0xc35839ef; n.0[36] = 0x0b8dea96; n.0[35] = 0xe51bf71b; n.0[34] = 0xdcb821e8; n.0[33] = 0x57c3b561; n.0[32] = 0xf0ea71d9; n.0[31] = 0x57ac2755; n.0[30] = 0x4e1abc59; n.0[29] = 0x75897241; n.0[28] = 0x4c36c21b; n.0[27] = 0x6a402e4e; n.0[26] = 0x91b37aa9; n.0[25] = 0xf608ca52; n.0[24] = 0x9f60173d; n.0[23] = 0x8213f7fa; n.0[22] = 0x97ad73fa; n.0[21] = 0xab488831; n.0[20] = 0x757dc4b4; n.0[19] = 0x8f748958; n.0[18] = 0x2050589f; n.0[17] = 0xe265a540; n.0[16] = 0x526a7b3b; n.0[15] = 0xb2fa065c; n.0[14] = 0x0654f4b7; n.0[13] = 0x459bea90; n.0[12] = 0x544bae40; n.0[11] = 0x80da5f73; n.0[10] = 0x1e79b4d0; n.0[ 9] = 0x18426fdc; n.0[ 8] = 0xe7f15982; n.0[ 7] = 0x1ca1d21d; n.0[ 6] = 0xe3abf69b; n.0[ 5] = 0x738dd481; n.0[ 4] = 0x7f8e60de; n.0[ 3] = 0xe446e48c; n.0[ 2] = 0x8a986adb; n.0[ 1] = 0xfc4dbfe1; n.0[ 0] = 0xa3cec7a5; r.0[63] = 0x2d03ad8c; r.0[62] = 0x5d06d9d4; r.0[61] = 0x7b79c409; r.0[60] = 0x1a470226; r.0[59] = 0x69b19e6f; r.0[58] = 0xddfb32b9; r.0[57] = 0xb95e9353; r.0[56] = 0x35d2b934; r.0[55] = 0x65651bb1; r.0[54] = 0x4e3c7849; r.0[53] = 0xc6a01181; r.0[52] = 0x5cd30fae; r.0[51] = 0x700b42fd; r.0[50] = 0x1f4ad116; r.0[49] = 0x5c970339; r.0[48] = 0x47eee2d4; r.0[47] = 0x55e52dc4; r.0[46] = 0x038befb9; r.0[45] = 0x68fe0ac1; r.0[44] = 0x86a2ba66; r.0[43] = 0xfed9d2e8; r.0[42] = 0xd6f3bc5b; r.0[41] = 0x7b05510b; r.0[40] = 0x30157b7b; r.0[39] = 0x9aadce13; r.0[38] = 0x2642af9a; r.0[37] = 0x3ca7c610; r.0[36] = 0xf4721569; r.0[35] = 0x1ae408e4; r.0[34] = 0x2347de17; r.0[33] = 0xa83c4a9e; r.0[32] = 0x0f158e26; r.0[31] = 0xa853d8aa; r.0[30] = 0xb1e543a6; r.0[29] = 0x8a768dbe; r.0[28] = 0xb3c93de4; r.0[27] = 0x95bfd1b1; r.0[26] = 0x6e4c8556; r.0[25] = 0x09f735ad; r.0[24] = 0x609fe8c2; r.0[23] = 0x7dec0805; r.0[22] = 0x68528c05; r.0[21] = 0x54b777ce; r.0[20] = 0x8a823b4b; r.0[19] = 0x708b76a7; r.0[18] = 0xdfafa760; r.0[17] = 0x1d9a5abf; r.0[16] = 0xad9584c4; r.0[15] = 0x4d05f9a3; r.0[14] = 0xf9ab0b48; r.0[13] = 0xba64156f; r.0[12] = 0xabb451bf; r.0[11] = 0x7f25a08c; r.0[10] = 0xe1864b2f; r.0[ 9] = 0xe7bd9023; r.0[ 8] = 0x180ea67d; r.0[ 7] = 0xe35e2de2; r.0[ 6] = 0x1c540964; r.0[ 5] = 0x8c722b7e; r.0[ 4] = 0x80719f21; r.0[ 3] = 0x1bb91b73; r.0[ 2] = 0x75679524; r.0[ 1] = 0x03b2401e; r.0[ 0] = 0x5c31385b; rr.0[63] = 0xa6a8b5f9; rr.0[62] = 0xfc683183; rr.0[61] = 0x660732ec; rr.0[60] = 0x7fad3138; rr.0[59] = 0x74d59bd3; rr.0[58] = 0x8cc3374a; rr.0[57] = 0x924f6690; rr.0[56] = 0xde3a3b5b; rr.0[55] = 0x8f8a7a64; rr.0[54] = 0x2c099f91; rr.0[53] = 0x33a45313; rr.0[52] = 0xf4a30ae3; rr.0[51] = 0x1fd6b74c; rr.0[50] = 0x1e5142af; rr.0[49] = 0x1feadbee; rr.0[48] = 0xa948a5b7; rr.0[47] = 0x7ffc2af3; rr.0[46] = 0x7c9bfd18; rr.0[45] = 0x6f00c434; rr.0[44] = 0xf489b5c9; rr.0[43] = 0x08850474; rr.0[42] = 0xc0e56809; rr.0[41] = 0x8ddef55d; rr.0[40] = 0xd0dc4f59; rr.0[39] = 0x08eb029e; rr.0[38] = 0x10f5315c; rr.0[37] = 0xae0ed8a3; rr.0[36] = 0x406dc80a; rr.0[35] = 0xe9406846; rr.0[34] = 0x6f10a46c; rr.0[33] = 0x9a741f79; rr.0[32] = 0x5d3feb16; rr.0[31] = 0x010023d9; rr.0[30] = 0x84de714b; rr.0[29] = 0x0943a775; rr.0[28] = 0x6f052d38; rr.0[27] = 0x5c36b89e; rr.0[26] = 0x6e6927c5; rr.0[25] = 0xcce5c6ff; rr.0[24] = 0x5aa1335a; rr.0[23] = 0x89b543e7; rr.0[22] = 0x02a9b47a; rr.0[21] = 0x00213bb7; rr.0[20] = 0x57469a06; rr.0[19] = 0xaeb9d46a; rr.0[18] = 0xdadf900a; rr.0[17] = 0xd209bb8a; rr.0[16] = 0x813c6fff; rr.0[15] = 0xb8e55d10; rr.0[14] = 0x7857c562; rr.0[13] = 0x78d195b1; rr.0[12] = 0xdabd2ea8; rr.0[11] = 0x6d72be73; rr.0[10] = 0xf01e2f77; rr.0[ 9] = 0x261925c3; rr.0[ 8] = 0xab87c57b; rr.0[ 7] = 0xe93885d2; rr.0[ 6] = 0x85400f34; rr.0[ 5] = 0xd83910ab; rr.0[ 4] = 0x687a0524; rr.0[ 3] = 0xcc9af25b; rr.0[ 2] = 0x2537f2f4; rr.0[ 1] = 0xc381e66e; rr.0[ 0] = 0x761158e0; m.0[63] = 0x4550c186; m.0[62] = 0x7d0ec1b8; m.0[61] = 0x76e96174; m.0[60] = 0x4bfad3d3; m.0[59] = 0x529e665d; m.0[58] = 0x5dd8921e; m.0[57] = 0xb9b43d67; m.0[56] = 0xf489d402; m.0[55] = 0xca39d95a; m.0[54] = 0xa9595c14; m.0[53] = 0xd2aa0545; m.0[52] = 0xdf440b1c; m.0[51] = 0x1e0799d9; m.0[50] = 0x392c5bee; m.0[49] = 0x225ae8f3; m.0[48] = 0xf6e54455; m.0[47] = 0x7218fcca; m.0[46] = 0x6a0c1bd1; m.0[45] = 0x789b8124; m.0[44] = 0x1328436d; m.0[43] = 0x567d76e0; m.0[42] = 0xe2d3c1a2; m.0[41] = 0xe0785272; m.0[40] = 0xa26727ef; m.0[39] = 0xcca90453; m.0[38] = 0x099d36b9; m.0[37] = 0xcde87ef5; m.0[36] = 0xb8c1d522; m.0[35] = 0xe35e8e56; m.0[34] = 0x974e5084; m.0[33] = 0xdd42967c; m.0[32] = 0x8c0d54ff; m.0[31] = 0xb87ae6c7; m.0[30] = 0x9c7501b8; m.0[29] = 0x1503578c; m.0[28] = 0x796d0579; m.0[27] = 0xd1c26067; m.0[26] = 0x8f468122; m.0[25] = 0x8c158fd4; m.0[24] = 0xe64bf422; m.0[23] = 0xcab8b25a; m.0[22] = 0x87c3d76f; m.0[21] = 0x394c226a; m.0[20] = 0xa63332dd; m.0[19] = 0xba1884f7; m.0[18] = 0xe05ffbf4; m.0[17] = 0xde3b613e; m.0[16] = 0xca6325bd; m.0[15] = 0x060d24c9; m.0[14] = 0x023315b4; m.0[13] = 0x69bdd42f; m.0[12] = 0x8abf6a76; m.0[11] = 0x278fb6ce; m.0[10] = 0x00ee970f; m.0[ 9] = 0x324c6666; m.0[ 8] = 0x15747cd1; m.0[ 7] = 0xe94e1121; m.0[ 6] = 0xf90a2d3f; m.0[ 5] = 0x61303967; m.0[ 4] = 0x855fda2d; m.0[ 3] = 0x06901735; m.0[ 2] = 0xa0f1f2cc; m.0[ 1] = 0x0aa5a665; m.0[ 0] = 0xc6a6909b; expected.0[63] = 0x0001ffff; expected.0[62] = 0xffffffff; expected.0[61] = 0xffffffff; expected.0[60] = 0xffffffff; expected.0[59] = 0xffffffff; expected.0[58] = 0xffffffff; expected.0[57] = 0xffffffff; expected.0[56] = 0xffffffff; expected.0[55] = 0xffffffff; expected.0[54] = 0xffffffff; expected.0[53] = 0xffffffff; expected.0[52] = 0xffffffff; expected.0[51] = 0xffffffff; expected.0[50] = 0xffffffff; expected.0[49] = 0xffffffff; expected.0[48] = 0xffffffff; expected.0[47] = 0xffffffff; expected.0[46] = 0xffffffff; expected.0[45] = 0xffffffff; expected.0[44] = 0xffffffff; expected.0[43] = 0xffffffff; expected.0[42] = 0xffffffff; expected.0[41] = 0xffffffff; expected.0[40] = 0xffffffff; expected.0[39] = 0xffffffff; expected.0[38] = 0xffffffff; expected.0[37] = 0xffffffff; expected.0[36] = 0xffffffff; expected.0[35] = 0xffffffff; expected.0[34] = 0xffffffff; expected.0[33] = 0xffffffff; expected.0[32] = 0xffffffff; expected.0[31] = 0xffffffff; expected.0[30] = 0xffffffff; expected.0[29] = 0xffffffff; expected.0[28] = 0xffffffff; expected.0[27] = 0xffffffff; expected.0[26] = 0xffffffff; expected.0[25] = 0xffffffff; expected.0[24] = 0xffffffff; expected.0[23] = 0xffffffff; expected.0[22] = 0xffffffff; expected.0[21] = 0xffffffff; expected.0[20] = 0xffffffff; expected.0[19] = 0xffffffff; expected.0[18] = 0xffffffff; expected.0[17] = 0xffffffff; expected.0[16] = 0xffffffff; expected.0[15] = 0xffffffff; expected.0[14] = 0xffffffff; expected.0[13] = 0xffffffff; expected.0[12] = 0x00303130; expected.0[11] = 0x0d060960; expected.0[10] = 0x86480165; expected.0[ 9] = 0x03040201; expected.0[ 8] = 0x05000420; expected.0[ 7] = 0x6daab02d; expected.0[ 6] = 0x35b47372; expected.0[ 5] = 0x03ba497d; expected.0[ 4] = 0x5cf4ce40; expected.0[ 3] = 0x115ce41c; expected.0[ 2] = 0x3ab4fd12; expected.0[ 1] = 0x61d4f575; expected.0[ 0] = 0x3503242d; let result = rsa_pubkey_op(&m, &n, &r, &rr, 65537, &mut work_4096o, &mut work_2048o, &mut work_2048, &mut work_2048_2); assert_eq!(result.0[..], expected.0[..]); } #[test] fn test_montmul() { let mut n = Bignum2048([0; 64]); let mut rr = Bignum2048([0; 64]); let mut a = Bignum2048([0; 64]); let mut b = Bignum2048([0; 64]); let mut expected = Bignum2048([0; 64]); let mut work_2048o = Bignum2048Oversized([0; 65]); let mut work_4096o = Bignum4096Oversized([0; 129]); n.0[63] = 0xd2fc5273; n.0[62] = 0xa2f9262b; n.0[61] = 0x84863bf6; n.0[60] = 0xe5b8fdd9; n.0[59] = 0x964e6190; n.0[58] = 0x2204cd46; n.0[57] = 0x46a16cac; n.0[56] = 0xca2d46cb; n.0[55] = 0x9a9ae44e; n.0[54] = 0xb1c387b6; n.0[53] = 0x395fee7e; n.0[52] = 0xa32cf051; n.0[51] = 0x8ff4bd02; n.0[50] = 0xe0b52ee9; n.0[49] = 0xa368fcc6; n.0[48] = 0xb8111d2b; n.0[47] = 0xaa1ad23b; n.0[46] = 0xfc741046; n.0[45] = 0x9701f53e; n.0[44] = 0x795d4599; n.0[43] = 0x01262d17; n.0[42] = 0x290c43a4; n.0[41] = 0x84faaef4; n.0[40] = 0xcfea8484; n.0[39] = 0x655231ec; n.0[38] = 0xd9bd5065; n.0[37] = 0xc35839ef; n.0[36] = 0x0b8dea96; n.0[35] = 0xe51bf71b; n.0[34] = 0xdcb821e8; n.0[33] = 0x57c3b561; n.0[32] = 0xf0ea71d9; n.0[31] = 0x57ac2755; n.0[30] = 0x4e1abc59; n.0[29] = 0x75897241; n.0[28] = 0x4c36c21b; n.0[27] = 0x6a402e4e; n.0[26] = 0x91b37aa9; n.0[25] = 0xf608ca52; n.0[24] = 0x9f60173d; n.0[23] = 0x8213f7fa; n.0[22] = 0x97ad73fa; n.0[21] = 0xab488831; n.0[20] = 0x757dc4b4; n.0[19] = 0x8f748958; n.0[18] = 0x2050589f; n.0[17] = 0xe265a540; n.0[16] = 0x526a7b3b; n.0[15] = 0xb2fa065c; n.0[14] = 0x0654f4b7; n.0[13] = 0x459bea90; n.0[12] = 0x544bae40; n.0[11] = 0x80da5f73; n.0[10] = 0x1e79b4d0; n.0[ 9] = 0x18426fdc; n.0[ 8] = 0xe7f15982; n.0[ 7] = 0x1ca1d21d; n.0[ 6] = 0xe3abf69b; n.0[ 5] = 0x738dd481; n.0[ 4] = 0x7f8e60de; n.0[ 3] = 0xe446e48c; n.0[ 2] = 0x8a986adb; n.0[ 1] = 0xfc4dbfe1; n.0[ 0] = 0xa3cec7a5; rr.0[63] = 0xa6a8b5f9; rr.0[62] = 0xfc683183; rr.0[61] = 0x660732ec; rr.0[60] = 0x7fad3138; rr.0[59] = 0x74d59bd3; rr.0[58] = 0x8cc3374a; rr.0[57] = 0x924f6690; rr.0[56] = 0xde3a3b5b; rr.0[55] = 0x8f8a7a64; rr.0[54] = 0x2c099f91; rr.0[53] = 0x33a45313; rr.0[52] = 0xf4a30ae3; rr.0[51] = 0x1fd6b74c; rr.0[50] = 0x1e5142af; rr.0[49] = 0x1feadbee; rr.0[48] = 0xa948a5b7; rr.0[47] = 0x7ffc2af3; rr.0[46] = 0x7c9bfd18; rr.0[45] = 0x6f00c434; rr.0[44] = 0xf489b5c9; rr.0[43] = 0x08850474; rr.0[42] = 0xc0e56809; rr.0[41] = 0x8ddef55d; rr.0[40] = 0xd0dc4f59; rr.0[39] = 0x08eb029e; rr.0[38] = 0x10f5315c; rr.0[37] = 0xae0ed8a3; rr.0[36] = 0x406dc80a; rr.0[35] = 0xe9406846; rr.0[34] = 0x6f10a46c; rr.0[33] = 0x9a741f79; rr.0[32] = 0x5d3feb16; rr.0[31] = 0x010023d9; rr.0[30] = 0x84de714b; rr.0[29] = 0x0943a775; rr.0[28] = 0x6f052d38; rr.0[27] = 0x5c36b89e; rr.0[26] = 0x6e6927c5; rr.0[25] = 0xcce5c6ff; rr.0[24] = 0x5aa1335a; rr.0[23] = 0x89b543e7; rr.0[22] = 0x02a9b47a; rr.0[21] = 0x00213bb7; rr.0[20] = 0x57469a06; rr.0[19] = 0xaeb9d46a; rr.0[18] = 0xdadf900a; rr.0[17] = 0xd209bb8a; rr.0[16] = 0x813c6fff; rr.0[15] = 0xb8e55d10; rr.0[14] = 0x7857c562; rr.0[13] = 0x78d195b1; rr.0[12] = 0xdabd2ea8; rr.0[11] = 0x6d72be73; rr.0[10] = 0xf01e2f77; rr.0[ 9] = 0x261925c3; rr.0[ 8] = 0xab87c57b; rr.0[ 7] = 0xe93885d2; rr.0[ 6] = 0x85400f34; rr.0[ 5] = 0xd83910ab; rr.0[ 4] = 0x687a0524; rr.0[ 3] = 0xcc9af25b; rr.0[ 2] = 0x2537f2f4; rr.0[ 1] = 0xc381e66e; rr.0[ 0] = 0x761158e0; a.0[0] = 123; b.0[0] = 456; expected.0[0] = 123 * 456; let a_mont = mont_mul(&a, &rr, &n, &mut work_4096o, &mut work_2048o); let b_mont = mont_mul(&b, &rr, &n, &mut work_4096o, &mut work_2048o); let result_mont = mont_mul(&a_mont, &b_mont, &n, &mut work_4096o, &mut work_2048o); let result = mont_red(&result_mont, &n, &mut work_4096o, &mut work_2048o); assert_eq!(result.0[..], expected.0[..]); } #[test] fn test_addhelper() { let mut x = [1, 2, 3]; let cout = addhelper(&mut x, &[4, 5, 6]); assert_eq!(x, [5, 7, 9]); assert!(!cout); let mut x = [1, 2, 3]; let cout = addhelper(&mut x, &[4, 5]); assert_eq!(x, [5, 7, 3]); assert!(!cout); let mut x = [4, 5, 6]; let cout = addhelper(&mut x, &[1, 2]); assert_eq!(x, [5, 7, 6]); assert!(!cout); // Carry once let mut x = [3, 5, 6]; let cout = addhelper(&mut x, &[0xFFFFFFFE, 2]); assert_eq!(x, [1, 8, 6]); assert!(!cout); let mut x = [3, 5, 6]; let cout = addhelper(&mut x, &[2, 0xFFFFFFFE]); assert_eq!(x, [5, 3, 7]); assert!(!cout); // Carry twice let mut x = [3, 0xFFFFFFFE, 6]; let cout = addhelper(&mut x, &[0xFFFFFFFE, 2]); assert_eq!(x, [1, 1, 7]); assert!(!cout); // Carry out let mut x = [3, 0xFFFFFFFE, 0xFFFFFFFF]; let cout = addhelper(&mut x, &[0xFFFFFFFE, 2]); assert_eq!(x, [1, 1, 0]); assert!(cout); } #[test] fn test_mul2048() { let mut a = Bignum2048([0; 64]); let mut b = Bignum2048([0; 64]); let mut expected = Bignum4096Oversized([0; 129]); a.0[0] = 123; b.0[0] = 456; expected.0[0] = 123 * 456; let result = mul2048(&a, &b); assert_eq!(result.0[..], expected.0[..]); let mut a = Bignum2048([0; 64]); let mut b = Bignum2048([0; 64]); let mut expected = Bignum4096Oversized([0; 129]); a.0[0] = 123; b.0[0] = 456; b.0[1] = 789; expected.0[0] = 123 * 456; expected.0[1] = 123 * 789; let result = mul2048(&a, &b); assert_eq!(result.0[..], expected.0[..]); let mut a = Bignum2048([0; 64]); let mut b = Bignum2048([0; 64]); let mut expected = Bignum4096Oversized([0; 129]); a.0[31] = 0xf47b3353; a.0[30] = 0xb9e4b5dc; a.0[29] = 0x8d220eca; a.0[28] = 0xe5d1d5c8; a.0[27] = 0xaab639e9; a.0[26] = 0xd868b8b3; a.0[25] = 0x68c351dd; a.0[24] = 0x676a3327; a.0[23] = 0x81768a34; a.0[22] = 0x8146421e; a.0[21] = 0x284bd69d; a.0[20] = 0xcd5746ea; a.0[19] = 0xd78fefbe; a.0[18] = 0xaee85391; a.0[17] = 0x227363af; a.0[16] = 0xcaafa9ae; a.0[15] = 0x54cde700; a.0[14] = 0xb20526c2; a.0[13] = 0xb8c9dc7b; a.0[12] = 0x41e69ac1; a.0[11] = 0xd5618c4f; a.0[10] = 0x5e3bb9f6; a.0[ 9] = 0x174b7ed0; a.0[ 8] = 0x78f7ee71; a.0[ 7] = 0xaa30ea8d; a.0[ 6] = 0xd51025b0; a.0[ 5] = 0xb9ea8596; a.0[ 4] = 0x15f6c82d; a.0[ 3] = 0x80551ece; a.0[ 2] = 0xb4d62b5d; a.0[ 1] = 0x9b9fce43; a.0[ 0] = 0x4ebcdfe1; b.0[31] = 0xdced1d9e; b.0[30] = 0x55b6a74f; b.0[29] = 0xea14d9c8; b.0[28] = 0xda6c76f0; b.0[27] = 0x1de12b69; b.0[26] = 0x9db9e138; b.0[25] = 0x0cbad8f9; b.0[24] = 0xbaa327e5; b.0[23] = 0xdb667bb5; b.0[22] = 0xc7c23333; b.0[21] = 0x17639447; b.0[20] = 0xc1c56d03; b.0[19] = 0x8861dfd1; b.0[18] = 0x17b23e6a; b.0[17] = 0x480d8a51; b.0[16] = 0xe2e6e80c; b.0[15] = 0xbf221e26; b.0[14] = 0xde17284c; b.0[13] = 0x22c4cd49; b.0[12] = 0x2d53b717; b.0[11] = 0x28de8e05; b.0[10] = 0xf09cd610; b.0[ 9] = 0xfa0752ff; b.0[ 8] = 0x7ce6a82a; b.0[ 7] = 0xd25fddef; b.0[ 6] = 0xb57832ee; b.0[ 5] = 0xc6d2752b; b.0[ 4] = 0x22cd763b; b.0[ 3] = 0xdb57f82c; b.0[ 2] = 0x6eb6e8a4; b.0[ 1] = 0x8785d71c; b.0[ 0] = 0x37747045; expected.0[63] = 0xd2fc5273; expected.0[62] = 0xa2f9262b; expected.0[61] = 0x84863bf6; expected.0[60] = 0xe5b8fdd9; expected.0[59] = 0x964e6190; expected.0[58] = 0x2204cd46; expected.0[57] = 0x46a16cac; expected.0[56] = 0xca2d46cb; expected.0[55] = 0x9a9ae44e; expected.0[54] = 0xb1c387b6; expected.0[53] = 0x395fee7e; expected.0[52] = 0xa32cf051; expected.0[51] = 0x8ff4bd02; expected.0[50] = 0xe0b52ee9; expected.0[49] = 0xa368fcc6; expected.0[48] = 0xb8111d2b; expected.0[47] = 0xaa1ad23b; expected.0[46] = 0xfc741046; expected.0[45] = 0x9701f53e; expected.0[44] = 0x795d4599; expected.0[43] = 0x01262d17; expected.0[42] = 0x290c43a4; expected.0[41] = 0x84faaef4; expected.0[40] = 0xcfea8484; expected.0[39] = 0x655231ec; expected.0[38] = 0xd9bd5065; expected.0[37] = 0xc35839ef; expected.0[36] = 0x0b8dea96; expected.0[35] = 0xe51bf71b; expected.0[34] = 0xdcb821e8; expected.0[33] = 0x57c3b561; expected.0[32] = 0xf0ea71d9; expected.0[31] = 0x57ac2755; expected.0[30] = 0x4e1abc59; expected.0[29] = 0x75897241; expected.0[28] = 0x4c36c21b; expected.0[27] = 0x6a402e4e; expected.0[26] = 0x91b37aa9; expected.0[25] = 0xf608ca52; expected.0[24] = 0x9f60173d; expected.0[23] = 0x8213f7fa; expected.0[22] = 0x97ad73fa; expected.0[21] = 0xab488831; expected.0[20] = 0x757dc4b4; expected.0[19] = 0x8f748958; expected.0[18] = 0x2050589f; expected.0[17] = 0xe265a540; expected.0[16] = 0x526a7b3b; expected.0[15] = 0xb2fa065c; expected.0[14] = 0x0654f4b7; expected.0[13] = 0x459bea90; expected.0[12] = 0x544bae40; expected.0[11] = 0x80da5f73; expected.0[10] = 0x1e79b4d0; expected.0[ 9] = 0x18426fdc; expected.0[ 8] = 0xe7f15982; expected.0[ 7] = 0x1ca1d21d; expected.0[ 6] = 0xe3abf69b; expected.0[ 5] = 0x738dd481; expected.0[ 4] = 0x7f8e60de; expected.0[ 3] = 0xe446e48c; expected.0[ 2] = 0x8a986adb; expected.0[ 1] = 0xfc4dbfe1; expected.0[ 0] = 0xa3cec7a5; let result = mul2048(&a, &b); assert_eq!(result.0[..], expected.0[..]); } #[test] fn test_barrett() { let mut scratch_xr = [0u32; 25]; let mut scratch2 = [0u32; 16]; let mut x: [u32; 16] = [1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; barrett_reduction_core(&mut x, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut scratch_xr, &mut scratch2); assert_eq!(x, [1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); let mut x: [u32; 16] = [0xfc632551 + 1234, 0xf3b9cac2, 0xa7179e84, 0xbce6faad, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0, 0, 0, 0, 0, 0, 0, 0]; barrett_reduction_core(&mut x, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut scratch_xr, &mut scratch2); assert_eq!(x, [1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); let mut x: [u32; 16] = [0xfc632551 + 1234, 0xf3b9cac2 + 5678, 0xa7179e84 + 666, 0xbce6faad, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0, 0, 0, 0, 0, 0, 0, 0]; barrett_reduction_core(&mut x, &secp256r1::BARRETT_MOD_N, &secp256r1::N, &mut scratch_xr, &mut scratch2); assert_eq!(x, [1234, 5678, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); } #[test] fn test_inversemod() { let mut scratch0 = [0u32; 2]; let mut scratch1 = [0u32; 2]; let mut scratch2 = [0u32; 2]; let mut scratch3 = [0u32; 2]; let mut out = [0u32]; inverse_mod_core(&[271], &[383], &mut out, &mut scratch0, &mut scratch1, &mut scratch2, &mut scratch3); assert_eq!(out, [106]); } #[test] fn test_pointdouble() { let result = point_double_projective( &ECPointProjective256{ x: Bignum256(secp256r1::GxRmodP), y: Bignum256(secp256r1::GyRmodP), z: Bignum256(secp256r1::RmodP), }); assert_eq!(result.x.0, [0x030756dd, 0x9396981f, 0x2a125983, 0x04e0f755, 0x3274ad78, 0x93bbc1aa, 0xd1eeeb17, 0x3216acbf]); assert_eq!(result.y.0, [0x3ccc950d, 0xdab96712, 0xaa13daa3, 0xcf48a95e, 0xce880027, 0xda98128d, 0x77bd1fde, 0xf9f84f1f]); assert_eq!(result.z.0, [0x90d6dc01, 0x1babad15, 0xa54a1d50, 0x8f93fb09, 0x1d7ebb0f, 0x6b812357, 0x3d1a282d, 0xc976e698]); } #[test] fn test_pointadd() { let result = point_add_projective_affine( &ECPointProjective256{ x: Bignum256(secp256r1::GxRmodP), y: Bignum256(secp256r1::GyRmodP), z: Bignum256(secp256r1::RmodP), }, &ECPointAffine256{ x: Bignum256(secp256r1::GxRmodP), y: Bignum256(secp256r1::GyRmodP), }); assert_eq!(result.x.0, [0x030756dd, 0x9396981f, 0x2a125983, 0x04e0f755, 0x3274ad78, 0x93bbc1aa, 0xd1eeeb17, 0x3216acbf]); assert_eq!(result.y.0, [0x3ccc950d, 0xdab96712, 0xaa13daa3, 0xcf48a95e, 0xce880027, 0xda98128d, 0x77bd1fde, 0xf9f84f1f]); assert_eq!(result.z.0, [0x90d6dc01, 0x1babad15, 0xa54a1d50, 0x8f93fb09, 0x1d7ebb0f, 0x6b812357, 0x3d1a282d, 0xc976e698]); let result = point_add_projective_affine( &result, &ECPointAffine256{ x: Bignum256(secp256r1::GxRmodP), y: Bignum256(secp256r1::GyRmodP), }); assert_eq!(result.x.0, [0x950ca643, 0x451e0d5f, 0xd94ab1ba, 0x7fe9955c, 0xad684b8a, 0xc0e844b0, 0xc4f66773, 0x2dcb9402]); assert_eq!(result.y.0, [0xb44fa0bb, 0xa82aff58, 0xd3be6cee, 0xad252196, 0x68972739, 0xe9e0aab0, 0x88dba91f, 0xf89113fc]); assert_eq!(result.z.0, [0x50cdca81, 0xa0e7b097, 0x0ae3b2ac, 0xba93bdaa, 0x210fd88a, 0xb6d954ca, 0x4b520bc0, 0x0f8bea77]); } #[test] fn test_shamir_trick() { let pubk = ECPointAffine256 { x: Bignum256([0x4f33f883, 0xffdc3ff2, 0x836af311, 0x38b3c0c0, 0xe34e8a8d, 0x919b1318, 0x57bc232f, 0x91c89152]), y: Bignum256([0x375c37c9, 0x8e1e4703, 0xf91b2e47, 0x09788b02, 0x724d2c63, 0x23f98d7a, 0xbc3c93e6, 0x94cee68f]), }; let pubk_plus_g = ECPointAffine256 { x: Bignum256([0xffa047e9, 0x8a97f91b, 0x9904be31, 0x3cc60dfb, 0x036b51ff, 0x94b25916, 0xf796d136, 0x19e17ade]), y: Bignum256([0x086d4036, 0x89cdf37b, 0x66f59ea6, 0x8eb771b3, 0x008da49c, 0x8a63633a, 0xc8705153, 0x7487e759]), }; let k1 = Bignum256([123, 0, 0, 0, 0, 0, 0, 0]); let k2 = Bignum256([456, 0, 0, 0, 0, 0, 0, 0]); let result = ec_two_scalar_mult_shamir(&k1, &k2, &pubk, &pubk_plus_g); assert_eq!(result.x.0, [0xaa784b77, 0x9e13406c, 0x618f4728, 0xc4c955a3, 0xd81442c7, 0x2cefb714, 0xe3e7a23d, 0x9cde435d]); assert_eq!(result.y.0, [0x02b674eb, 0x492bb57c, 0x83bb9494, 0x09f4f4ff, 0x055cf766, 0xda69ef7d, 0xfe60d1bb, 0xde94ef02]); assert_eq!(result.z.0, [0x8659f4a9, 0xb9dc8532, 0x7b0423b7, 0x4e3f9445, 0xa9ecc47b, 0x8823677b, 0x6077dbbb, 0x33c923c8]); } #[test] fn test_ecdsa() { let pubk = ECPointAffine256 { x: Bignum256([0x4f33f883, 0xffdc3ff2, 0x836af311, 0x38b3c0c0, 0xe34e8a8d, 0x919b1318, 0x57bc232f, 0x91c89152]), y: Bignum256([0x375c37c9, 0x8e1e4703, 0xf91b2e47, 0x09788b02, 0x724d2c63, 0x23f98d7a, 0xbc3c93e6, 0x94cee68f]), }; let pubk_plus_g = ECPointAffine256 { x: Bignum256([0xffa047e9, 0x8a97f91b, 0x9904be31, 0x3cc60dfb, 0x036b51ff, 0x94b25916, 0xf796d136, 0x19e17ade]), y: Bignum256([0x086d4036, 0x89cdf37b, 0x66f59ea6, 0x8eb771b3, 0x008da49c, 0x8a63633a, 0xc8705153, 0x7487e759]), }; let hash = Bignum256([0xa0674d33, 0xfd873996, 0x6eb811f9, 0x124cf236, 0xd0f1f9d1, 0x01239f7e, 0xb86cfa0e, 0x403dee8c]); let sig_r = Bignum256([0xe99aac39, 0x7c2b237b, 0xb0024f02, 0x19e7c3f9, 0x97fec477, 0xdd847472, 0xd2a547d0, 0x811a6c2b]); let sig_s = Bignum256([0xb5a1d63c, 0x7393a694, 0x9daa5595, 0xcb2ba405, 0xf7f668a7, 0xb41a7db0, 0xf29c820c, 0xb428639a]); assert!(ecdsa_secp256r1_verify_sig(&pubk, &pubk_plus_g, &hash, &sig_r, &sig_s)); } #[test] #[ignore] fn test_modinv32() { for x in 0..2147483647 { let x = 2 * x + 1; // Odd numbers only let res = modinv32(x); assert_eq!(x.wrapping_mul(res), 1); } } }
Account.py
from recip.network.messages.extensions.ExtMessage import ExtMessage from recip.network.messages.extensions import ExtMessageType from recip.core.Account import Account as CoreAccount from recip.core import AccountType from recip.storage import Accounts from recip.util import Address from recip.util import Crypto from recip.util import DataType from recip.util import JSONRPC from recip.util import Validator from recip.util import Units class Account(ExtMessage): def __init__(self): super().__init__() self.publicKeys = [] self.address = [] def validate(self): if self.address == None or self.publicKeys == None: return False for publicKey in self.publicKeys: if not Validator.public(publicKey): return False for addr in self.address: if not Validator.address(addr): return False return True def deserialize(self, payload): if self.validatePayload(payload): self.deserializePayload(payload) if self.validateParameters(): if self.isMultiSig(): for publicKey in self.params:
self.publicKeys.append(publicKey) else: for addr in self.params: addr = Address.toAddressBytes(addr) self.address.append(addr) if self.validate(): return True return False def onSuccess(self, callback = None): if ExtMessageType.CREATE_ATOMIC_SWAP_ACCOUNT == self.method: self.createAtomicSwapAccount(callback) elif ExtMessageType.CREATE_MULTISIG_ACCOUNT == self.method: self.createMultiSigAccount(callback) elif ExtMessageType.GET_ACCOUNTS == self.method: self.get(callback) elif ExtMessageType.GET_NEW_ACCOUNT == self.method: self.add(callback) elif ExtMessageType.DELETE_ACCOUNTS == self.method: self.remove(callback) else: self.onFailure(callback) def isMultiSig(self): if ExtMessageType.CREATE_MULTISIG_ACCOUNT == self.method: return True if ExtMessageType.CREATE_ATOMIC_SWAP_ACCOUNT == self.method: return True return False def createAtomicSwapAccount(self, callback = None): _address, _public, _private = Crypto.generateKeys() privateBytes = bytearray() privateBytes.extend(_address) privateBytes.extend(_public) privateBytes.extend(_private) privateKey = Crypto.generateHash(privateBytes) self.createNewMultiSigAccountType(AccountType.ATOMIC_SWAP, privateKey, callback) def createMultiSigAccount(self, callback = None): self.createNewMultiSigAccountType(AccountType.MULTISIGNATURE, None, callback) def createNewMultiSigAccountType(self, accountType, privateKey, callback = None): multiSigAddressBytes = bytearray() for publicKey in self.publicKeys: multiSigAddressBytes.extend(publicKey) multiSigAddress = Crypto.generateAddress(multiSigAddressBytes) account = CoreAccount(multiSigAddress, self.publicKeys, privateKey, accountType) Accounts.addAccount(account) multiSigAddress = Address.to0xAddress(multiSigAddress) callback( JSONRPC.createResultObject(multiSigAddress, self.id) ) def get(self, callback = None): accounts = [] # Account Types standard = [] multisig = [] atomicswap = [] for account in Accounts.getAccounts(): confirmedBalance = Accounts.getConfirmedBalanceByAddress(account.address) confirmedBalance = Units.toValue(confirmedBalance) confirmedBalance = DataType.asFloat(confirmedBalance) address = Address.to0xAddress(account.address) accountInfo = { 'address': address, 'type': account.type, 'balance': confirmedBalance } if account.type == AccountType.STANDARD: standard.append(accountInfo) elif account.type == AccountType.MULTISIGNATURE: multisig.append(accountInfo) elif account.type == AccountType.ATOMIC_SWAP: atomicswap.append(accountInfo) accounts.extend(standard) accounts.extend(multisig) accounts.extend(atomicswap) callback( JSONRPC.createResultObject(accounts, self.id) ) def add(self, callback = None): account = CoreAccount() Accounts.addAccount(account) address = Address.to0xAddress(account.address) callback( JSONRPC.createResultObject(address, self.id) ) def remove(self, callback = None): removed = False for addr in self.address: removed = Accounts.removeAccount(addr) if not removed: break if removed: callback( JSONRPC.createResultObject('accounts removed', self.id) ) else: callback( JSONRPC.createErrorObject(-32003, 'delete failed', 'failed to remove accounts', self.id) ) def onFailure(self, callback = None): callback( JSONRPC.createErrorObject(-32000, 'invalid message', 'invalid account request', self.id) )
publicKey = DataType.fromHex(publicKey)
Label.js
// COPYRIGHT © 2018 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
// Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: [email protected] // // See http://js.arcgis.com/4.10/esri/copyright.txt for details. define(["require","exports","../../../../overlay/LineOverlayItem","../../../../overlay/TextOverlayItem"],function(t,e,i,o){return function(){function t(t){this._textItem=new o({visible:!1}),this._calloutItem=new i({visible:!1,width:2}),this._visible=!1,this._calloutVisible=!0,t&&(this.fontSize=t)}return Object.defineProperty(t.prototype,"textItem",{get:function(){return this._textItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"calloutItem",{get:function(){return this._calloutItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._textItem.text},set:function(t){this._textItem.text=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._textItem.fontSize},set:function(t){this._textItem.fontSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this._updateVisibility()},enumerable:!0,configurable:!0}),t.prototype.addToView=function(t){t.overlay.items.addMany([this._textItem,this._calloutItem])},t.prototype.removeFromView=function(t){t.overlay&&!t.overlay.destroyed&&t.overlay.items.removeMany([this._textItem,this._calloutItem])},t.prototype.updatePosition=function(t,e){if(e){var i=e[0]-t[0],o=e[1]-t[1];this._textItem.position=[e[0],e[1]],this._textItem.anchor=Math.abs(i)>Math.abs(o)?i>0?"left":"right":o>0?"top":"bottom",this._calloutItem.startPosition=[t[0],t[1]],this._calloutItem.endPosition=[e[0],e[1]],this._calloutVisible=!0}else this._textItem.position=[t[0],t[1]],this._textItem.anchor="center",this._calloutVisible=!1},t.prototype._updateVisibility=function(){this._textItem.visible=this._visible,this._calloutItem.visible=this._visible&&this._calloutVisible},t}()});
// // For additional information, contact:
io.py
import copy import os import torch from . import geom from .cell import WaveCell from .probe import WaveIntensityProbe from .rnn import WaveRNN from .source import WaveSource from .utils import set_dtype def save_model(model, name, savedir='./study/', history=None, history_geom_state=None, cfg=None, verbose=True): """Save the model state and history to a file """ str_filename = name + '.pt' if not os.path.exists(savedir): os.makedirs(savedir) str_savepath = savedir + str_filename if history_geom_state is None: history_geom_state = [model.cell.geom.state_reconstruction_args()] data = {'model_geom_class_str': model.cell.geom.__class__.__name__, # Class name so we know which constructor to call in load() 'model_state': model.state_dict(), # For now just store model state without history (only geom is likely to change) 'history': history, 'history_geom_state': history_geom_state, # Full history of the geometry state, 'cfg': cfg} if verbose: print("Saving model to %s" % str_savepath) torch.save(data, str_savepath) def new_geometry(class_str, state): WaveGeometryClass = getattr(geom, class_str) geom_state = copy.deepcopy(state) return WaveGeometryClass(**geom_state) def
(str_filename, which_iteration=-1): """Load a previously saved model and its history from a file """ print("Loading model from %s" % str_filename) data = torch.load(str_filename) # Set the type for floats from the save set_dtype(data['cfg']['dtype']) # Reconstruct Geometry new_geom = new_geometry(data['model_geom_class_str'], data['history_geom_state'][which_iteration]) # Get model state to recreate probes and sources model_state = copy.deepcopy(data['model_state']) # Parse out the probe and source coords px = [model_state[k].item() for k in model_state if 'probes' in k and 'x' in k] py = [model_state[k].item() for k in model_state if 'probes' in k and 'y' in k] sx = [model_state[k].item() for k in model_state if 'sources' in k and 'x' in k] sy = [model_state[k].item() for k in model_state if 'sources' in k and 'y' in k] # Manually add the probes and sources new_probes = [] for (x, y) in zip(px, py): new_probes.append(WaveIntensityProbe(x, y)) # TODO(ian): here we should actually try to infer the type of probe (e.g. intensity or not) new_sources = [] for (x, y) in zip(sx, sy): new_sources.append(WaveSource(x, y)) new_cell = WaveCell(model_state['cell.dt'].item(), new_geom) new_model = WaveRNN(new_cell, new_sources, new_probes) # Put into eval mode (doesn't really matter for us but whatever) new_model.eval() return new_model, data['history'], data['history_geom_state'], data['cfg']
load_model
access_rule.py
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities from . import outputs from ._inputs import * __all__ = ['AccessRuleArgs', 'AccessRule'] @pulumi.input_type class AccessRuleArgs: def __init__(__self__, *, configuration: pulumi.Input['AccessRuleConfigurationArgs'], mode: pulumi.Input[str], notes: Optional[pulumi.Input[str]] = None, zone_id: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a AccessRule resource. :param pulumi.Input['AccessRuleConfigurationArgs'] configuration: Rule configuration to apply to a matched request. It's a complex value. See description below. :param pulumi.Input[str] mode: The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" :param pulumi.Input[str] notes: A personal note about the rule. Typically used as a reminder or explanation for the rule. :param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. """ pulumi.set(__self__, "configuration", configuration) pulumi.set(__self__, "mode", mode) if notes is not None: pulumi.set(__self__, "notes", notes) if zone_id is not None: pulumi.set(__self__, "zone_id", zone_id) @property @pulumi.getter def configuration(self) -> pulumi.Input['AccessRuleConfigurationArgs']: """ Rule configuration to apply to a matched request. It's a complex value. See description below. """ return pulumi.get(self, "configuration") @configuration.setter def configuration(self, value: pulumi.Input['AccessRuleConfigurationArgs']): pulumi.set(self, "configuration", value) @property @pulumi.getter def mode(self) -> pulumi.Input[str]: """ The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" """ return pulumi.get(self, "mode") @mode.setter def mode(self, value: pulumi.Input[str]): pulumi.set(self, "mode", value) @property @pulumi.getter def notes(self) -> Optional[pulumi.Input[str]]: """ A personal note about the rule. Typically used as a reminder or explanation for the rule. """ return pulumi.get(self, "notes") @notes.setter def notes(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "notes", value) @property @pulumi.getter(name="zoneId") def zone_id(self) -> Optional[pulumi.Input[str]]: """ The DNS zone to which the access rule should be added. """ return pulumi.get(self, "zone_id") @zone_id.setter def zone_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "zone_id", value) @pulumi.input_type class _AccessRuleState: def __init__(__self__, *, configuration: Optional[pulumi.Input['AccessRuleConfigurationArgs']] = None, mode: Optional[pulumi.Input[str]] = None, notes: Optional[pulumi.Input[str]] = None, zone_id: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering AccessRule resources. :param pulumi.Input['AccessRuleConfigurationArgs'] configuration: Rule configuration to apply to a matched request. It's a complex value. See description below. :param pulumi.Input[str] mode: The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" :param pulumi.Input[str] notes: A personal note about the rule. Typically used as a reminder or explanation for the rule. :param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. """ if configuration is not None: pulumi.set(__self__, "configuration", configuration) if mode is not None: pulumi.set(__self__, "mode", mode) if notes is not None: pulumi.set(__self__, "notes", notes) if zone_id is not None: pulumi.set(__self__, "zone_id", zone_id) @property @pulumi.getter def configuration(self) -> Optional[pulumi.Input['AccessRuleConfigurationArgs']]: """ Rule configuration to apply to a matched request. It's a complex value. See description below. """ return pulumi.get(self, "configuration") @configuration.setter def configuration(self, value: Optional[pulumi.Input['AccessRuleConfigurationArgs']]): pulumi.set(self, "configuration", value) @property @pulumi.getter def mode(self) -> Optional[pulumi.Input[str]]: """ The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" """ return pulumi.get(self, "mode") @mode.setter def mode(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "mode", value) @property @pulumi.getter def notes(self) -> Optional[pulumi.Input[str]]: """ A personal note about the rule. Typically used as a reminder or explanation for the rule. """ return pulumi.get(self, "notes") @notes.setter def notes(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "notes", value) @property @pulumi.getter(name="zoneId") def zone_id(self) -> Optional[pulumi.Input[str]]: """ The DNS zone to which the access rule should be added. """ return pulumi.get(self, "zone_id") @zone_id.setter def zone_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "zone_id", value) class AccessRule(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, configuration: Optional[pulumi.Input[pulumi.InputType['AccessRuleConfigurationArgs']]] = None, mode: Optional[pulumi.Input[str]] = None, notes: Optional[pulumi.Input[str]] = None, zone_id: Optional[pulumi.Input[str]] = None, __props__=None): """ Provides a Cloudflare IP Firewall Access Rule resource. Access control can be applied on basis of IP addresses, IP ranges, AS numbers or countries. ## Import Records can be imported using a composite ID formed of access rule type, access rule type identifier and identifer value, e.g. ```sh $ pulumi import cloudflare:index/accessRule:AccessRule default zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e ``` where* `zone` - access rule type (`account`, `zone` or `user`) * `cb029e245cfdd66dc8d2e570d5dd3322` - access rule type ID (i.e the zone ID or account ID you wish to target) * `d41d8cd98f00b204e9800998ecf8427e` - access rule ID as returned by respective API endpoint for the type you are attempting to import. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['AccessRuleConfigurationArgs']] configuration: Rule configuration to apply to a matched request. It's a complex value. See description below. :param pulumi.Input[str] mode: The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" :param pulumi.Input[str] notes: A personal note about the rule. Typically used as a reminder or explanation for the rule. :param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. """ ... @overload def __init__(__self__, resource_name: str, args: AccessRuleArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Provides a Cloudflare IP Firewall Access Rule resource. Access control can be applied on basis of IP addresses, IP ranges, AS numbers or countries. ## Import Records can be imported using a composite ID formed of access rule type, access rule type identifier and identifer value, e.g. ```sh $ pulumi import cloudflare:index/accessRule:AccessRule default zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e ``` where* `zone` - access rule type (`account`, `zone` or `user`) * `cb029e245cfdd66dc8d2e570d5dd3322` - access rule type ID (i.e the zone ID or account ID you wish to target) * `d41d8cd98f00b204e9800998ecf8427e` - access rule ID as returned by respective API endpoint for the type you are attempting to import. :param str resource_name: The name of the resource. :param AccessRuleArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(AccessRuleArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, configuration: Optional[pulumi.Input[pulumi.InputType['AccessRuleConfigurationArgs']]] = None, mode: Optional[pulumi.Input[str]] = None, notes: Optional[pulumi.Input[str]] = None, zone_id: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = AccessRuleArgs.__new__(AccessRuleArgs) if configuration is None and not opts.urn: raise TypeError("Missing required property 'configuration'") __props__.__dict__["configuration"] = configuration if mode is None and not opts.urn: raise TypeError("Missing required property 'mode'") __props__.__dict__["mode"] = mode __props__.__dict__["notes"] = notes __props__.__dict__["zone_id"] = zone_id super(AccessRule, __self__).__init__( 'cloudflare:index/accessRule:AccessRule', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, configuration: Optional[pulumi.Input[pulumi.InputType['AccessRuleConfigurationArgs']]] = None, mode: Optional[pulumi.Input[str]] = None, notes: Optional[pulumi.Input[str]] = None, zone_id: Optional[pulumi.Input[str]] = None) -> 'AccessRule': """ Get an existing AccessRule resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['AccessRuleConfigurationArgs']] configuration: Rule configuration to apply to a matched request. It's a complex value. See description below. :param pulumi.Input[str] mode: The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" :param pulumi.Input[str] notes: A personal note about the rule. Typically used as a reminder or explanation for the rule. :param pulumi.Input[str] zone_id: The DNS zone to which the access rule should be added. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _AccessRuleState.__new__(_AccessRuleState) __props__.__dict__["configuration"] = configuration __props__.__dict__["mode"] = mode __props__.__dict__["notes"] = notes __props__.__dict__["zone_id"] = zone_id return AccessRule(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def configuration(self) -> pulumi.Output['outputs.AccessRuleConfiguration']: """ Rule configuration to apply to a matched request. It's a complex value. See description below. """ return pulumi.get(self, "configuration") @property @pulumi.getter def mode(self) -> pulumi.Output[str]: """ The action to apply to a matched request. Allowed values: "block", "challenge", "whitelist", "js_challenge" """ return pulumi.get(self, "mode") @property @pulumi.getter def notes(self) -> pulumi.Output[Optional[str]]:
@property @pulumi.getter(name="zoneId") def zone_id(self) -> pulumi.Output[str]: """ The DNS zone to which the access rule should be added. """ return pulumi.get(self, "zone_id")
""" A personal note about the rule. Typically used as a reminder or explanation for the rule. """ return pulumi.get(self, "notes")
simple_threads.py
# Simple Threads Pool from multiprocessing.dummy import Pool as ThreadPool from datetime import date from datetime import datetime import time multiply_results = [] def squareNumber(n): multiply_results.append(n ** 2) dt_string = datetime.now().strftime("%H:%M:%S") millis = int(round(time.time() * 1000)) print("Each Thread Time - %d" % millis) time.sleep(n)
pool = ThreadPool(threads) results = pool.map(squareNumber, numbers) pool.close() #pool.join() return results if __name__ == "__main__": numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] squaredNumbers = calculateParallel(numbers, 15) for n in multiply_results: print(n) print("Results Length - %d" % len(multiply_results))
return n ** 2 # function to be mapped over def calculateParallel(numbers, threads=10):
terminal.ts
import { element, state, render } from '@mkenzo_8/puffin' import { Button } from '@mkenzo_8/puffin-drac' import { css as style } from 'emotion' import { Terminal } from 'xterm' import { FitAddon } from 'xterm-addon-fit' import * as XtermWebfont from 'xterm-webfont' import { getProperty, ThemeProvider } from 'ThemeProvider' import RunningConfig from 'RunningConfig' import StaticConfig from 'StaticConfig' import AddTermIcon from './icons/add_term' import ButtonIcon from './button_icon' import '../../../node_modules/xterm/css/xterm.css' let sessionsCount = 0 const styled = style` box-shadow: inset 0 -1px 10px rgba(0,0,0,0.25); max-width: 100%; margin: 0; position: relative; width: auto; max-height: 100%; min-height: 100%; overflow: hidden; & p{ color: var(--textColor); font-size: 13px; } & select { padding: 7px 5px; background: transparent; border:0; color: var(--textColor); border-bottom: 2px solid var(--textColor); & option { color: var(--contextmenuButtonText); background: var(--contextmenuButtonBackground); } } & .bar { height: 30px; padding: 5px; display: flex; & button { flex: 1; min-width: 40px; max-width: 40px; } & select { flex: 1; min-width: 35px; width: auto; max-width: 100px; } & div{ flex: 1; min-width: 0px; max-width: 100%; } } & .terminal_container{ overflow: auto; max-width: 100%; margin: 0; position: relative; width: auto; max-height: calc(100% - 40px); min-height: calc(100% - 40px); } & .xterm { padding: 0px; & > * {
& .shell_selector{ display: flex; justify-content: center; align-items: center; text-align: center; height: calc(100% - 40px); } & #terms_stack{ padding: 10px; } ` const shells: any = {} if (process.platform === 'win32') { shells.cmd = process.env['COMSPEC'] } else { shells.bash = process.env['SHELL'] } const TerminalState = new state({ shells, terminals: [], terminal: null, }) const getConfig = () => { return { fontFamily: 'JetBrainsMono', theme: { background: getProp('terminalBackground'), foreground: getProp('terminalForeground'), selection: getProp('terminalSelection'), }, cursorStyle: 'bar' as 'bar', cursorBlink: true, fontSize: 13, lineHeight: 1.4, letterSpacing: -2, windowsMode: process.platform === 'win32', } } export default function TerminalComp() { function mountedTerminal() { this.state = TerminalState } return element({ components: { TerminalBar, }, })` <div mounted="${mountedTerminal}" class="${styled}"> <TerminalBar/> <div id="terms_stack"> <p>Press the + to create a session</p> </div> </div> ` } function XtermTerminal() { sessionsCount++ const xtermState = new state({ shell: null, name: `Session ${sessionsCount}`, }) TerminalState.data.terminals.push({ name: xtermState.data.name, }) TerminalState.data.terminal = xtermState.data.name TerminalState.emit('newTerminal') function createProcess() { const pty = window.require('node-pty') return pty.spawn(xtermState.data.shell, [], { cwd: process.env.HOMEPATH, env: process.env, }) } const refreshOptions = term => { const newConfig = getConfig() Object.keys(newConfig).forEach(key => { term.setOption(key, newConfig[key]) }) } function bindTheme(term) { StaticConfig.keyChanged('appTheme', () => { refreshOptions(term) }) } async function mounted() { TerminalState.keyChanged('terminal', name => { if (name != xtermState.data.name) { this.style.display = 'none' } else { this.style.display = 'block' } }) await xtermState.on('shellSelected') setTimeout(() => { const spawnProcess = createProcess() const xtermInstance = new Terminal(getConfig()) const fit = new FitAddon() bindTheme(xtermInstance) xtermInstance.loadAddon(fit) xtermInstance.loadAddon(new XtermWebfont()) xtermInstance.open(this) xtermInstance.onData(data => { spawnProcess.write(data) }) spawnProcess.on('data', function (data: any) { xtermInstance.write(data) }) window.addEventListener('resize', () => { fit.fit() }) TerminalState.on('resize', () => { fit.fit() }) setTimeout(() => { xtermInstance.refresh(0, 0) xtermInstance.focus() fit.fit() refreshOptions(xtermInstance) }, 500) }, 300) } function onChange() { const selectedOption = this.options[this.selectedIndex].innerText xtermState.data.shell = shells[selectedOption] this.parentElement.parentElement.remove() xtermState.emit('shellSelected') } return element` <div class="terminal_container" mounted="${mounted}"> <div class="shell_selector"> <div> <p>Select a shell</p> <select :change="${onChange}"> <option></option> ${Object.keys(shells).map(shell => { return element`<option>${shell}</option>` })} </select> </div> <div> </div> ` } function TerminalBar() { function onChange() { const selectedOption = this.options[this.selectedIndex].innerText TerminalState.data.terminal = selectedOption } function mountedSelect() { TerminalState.on('newTerminal', () => { this.update() }) } function createTerminal() { const container = document.getElementById('terms_stack') if (container.innerText !== '') container.innerText = '' render(XtermTerminal(), container) } return element({ components: { Button, AddTermIcon, ButtonIcon, }, })` <div class="bar"> <select :change="${onChange}" mounted="${mountedSelect}"> ${() => TerminalState.data.terminals.map(({ name }) => element`<option selected="${name === TerminalState.data.terminal}">${name}</option>`)} </select> <div/> <ButtonIcon :click="${createTerminal}"> <AddTermIcon/> </ButtonIcon> </div> ` } function getProp(prop) { return getProperty(prop, ThemeProvider.data) }
z-index: 0 !important; } }
dept.js
layui.use(['table', 'admin', 'ax', 'ztree', 'func', 'tree'], function () { var $ = layui.$; var table = layui.table; var $ax = layui.ax; var admin = layui.admin; var $ZTree = layui.ztree; var func = layui.func; var tree = layui.tree; /** * 系统管理--部门管理 */ var Dept = { tableId: "deptTable", condition: { deptId: "" } }; /** * 初始化表格的列 */ Dept.initColumn = function () { return [[ {type: 'checkbox'}, {field: 'deptId', hide: true, sort: true, title: 'id'}, {field: 'simpleName', align: "center", sort: true, title: '部门简称'}, {field: 'fullName', align: "center", sort: true, title: '部门全称'}, {field: 'sort', align: "center", sort: true, title: '排序'}, {field: 'description', align: "center", sort: true, title: '备注'}, {align: 'center', toolbar: '#tableBar', title: '操作', minWidth: 200} ]]; }; /** * 点击查询按钮 */ Dept.search = function () { var queryData = {}; queryData['condition'] = $("#name").val(); queryData['deptId'] = Dept.condition.deptId; table.reload(Dept.tableId, { where: queryData, page: {curr: 1} }); }; /** * 选择部门时 */ Dept.onClickDept = function (obj) { Dept.condition.deptId = obj.data.id; Dept.search(); }; /** * 弹出添加 */ Dept.openAddDept = function () { func.open({ height: 530, title: '添加部门', content: Feng.ctxPath + '/dept/dept_add', tableId: Dept.tableId, endCallback: function () { Dept.loadDeptTree(); } }); }; /** * 点击编辑部门 * * @param data 点击按钮时候的行数据 */ Dept.onEditDept = function (data) { func.open({ height: 530, title: '编辑部门', content: Feng.ctxPath + "/dept/dept_update?deptId=" + data.deptId, tableId: Dept.tableId, endCallback: function () { Dept.loadDeptTree(); } }); }; /** * 导出excel按钮 */ Dept.exportExcel = function () { var checkRows = table.checkStatus(Dept.tableId); if (checkRows.data.length === 0) { Feng.error("请选择要导出的数据"); } else { table.exportFile(tableResult.config.id, checkRows.data, 'xls'); } }; /** * 点击删除部门 * * @param data 点击按钮时候的行数据 */ Dept.onDeleteDept = function (data) { var operation = function () { var ajax = new $ax(Feng.ctxPath + "/dept/delete", function () { Feng.success("删除成功!"); table.reload(Dept.tableId); //左侧树加载 Dept.loadDeptTree();
}, function (data) { Feng.error("删除失败!" + data.responseJSON.message + "!"); }); ajax.set("deptId", data.deptId); ajax.start(); }; Feng.confirm("是否删除部门 " + data.simpleName + "?", operation); }; /** * 左侧树加载 */ Dept.loadDeptTree = function () { var ajax = new $ax(Feng.ctxPath + "/dept/layuiTree", function (data) { tree.render({ elem: '#deptTree', data: data, click: Dept.onClickDept, onlyIconControl: true }); }, function (data) { }); ajax.start(); }; // 渲染表格 var tableResult = table.render({ elem: '#' + Dept.tableId, url: Feng.ctxPath + '/dept/list', page: true, height: "full-98", cellMinWidth: 100, cols: Dept.initColumn() }); //初始化左侧部门树 Dept.loadDeptTree(); // 搜索按钮点击事件 $('#btnSearch').click(function () { Dept.search(); }); // 添加按钮点击事件 $('#btnAdd').click(function () { Dept.openAddDept(); }); // 导出excel $('#btnExp').click(function () { Dept.exportExcel(); }); // 工具条点击事件 table.on('tool(' + Dept.tableId + ')', function (obj) { var data = obj.data; var layEvent = obj.event; if (layEvent === 'edit') { Dept.onEditDept(data); } else if (layEvent === 'delete') { Dept.onDeleteDept(data); } }); }); $(function () { var panehHidden = false; if ($(this).width() < 769) { panehHidden = true; } $('#myContiner').layout({initClosed: panehHidden, west__size: 260}); });
as_constant.rs
//! See docs in build/expr/mod.rs use crate::build::Builder; use crate::thir::*; use rustc_middle::mir::*; use rustc_middle::ty::CanonicalUserTypeAnnotation; impl<'a, 'tcx> Builder<'a, 'tcx> { /// Compile `expr`, yielding a compile-time constant. Assumes that /// `expr` is a valid compile-time constant! crate fn
(&mut self, expr: &Expr<'tcx>) -> Constant<'tcx> { let this = self; let Expr { ty, temp_lifetime: _, span, ref kind } = *expr; match *kind { ExprKind::Scope { region_scope: _, lint_level: _, value } => { this.as_constant(&this.thir[value]) } ExprKind::Literal { literal, user_ty, const_id: _ } => { let user_ty = user_ty.map(|user_ty| { this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation { span, user_ty, inferred_ty: ty, }) }); assert_eq!(literal.ty, ty); Constant { span, user_ty, literal: literal.into() } } ExprKind::StaticRef { literal, .. } => { Constant { span, user_ty: None, literal: literal.into() } } ExprKind::ConstBlock { value } => { Constant { span: span, user_ty: None, literal: value.into() } } _ => span_bug!(span, "expression is not a valid constant {:?}", kind), } } }
as_constant
txst_app.go
package txst import ( "os" "testing" "github.com/flxtilla/app" "github.com/flxtilla/cxre/log" ) func txstLogger() app.Config
func txstingApp(t *testing.T, name string, conf ...app.Config) *app.App { conf = append(conf, app.Mode("Testing", true)) a := app.New(name, conf...) err := a.Configure() if err != nil { t.Errorf("Error in app configuration: %s", err.Error()) } return a } func TxstingApp(t *testing.T, name string, conf ...app.Config) *app.App { conf = append(conf, txstLogger()) return txstingApp(t, name, conf...) } func VerboseTxstingApp(t *testing.T, name string, conf ...app.Config) *app.App { return txstingApp(t, name, conf...) }
{ return app.DefaultConfig( func(a *app.App) error { a.SwapLogger(log.New(os.Stderr, log.LInfo, log.DefaultNullFormatter())) return nil }, ) }
create_content.rs
//! [POST /_matrix/media/r0/upload](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-media-r0-upload) use ruma_api::ruma_api; use ruma_identifiers::MxcUri; ruma_api! { metadata: { description: "Upload content to the media store.", method: POST, name: "create_media_content", path: "/_matrix/media/r0/upload", rate_limited: true, authentication: AccessToken, } request: { /// The file contents to upload. #[ruma_api(raw_body)] pub file: &'a [u8], /// The name of the file being uploaded. #[ruma_api(query)] #[serde(skip_serializing_if = "Option::is_none")] pub filename: Option<&'a str>, /// The content type of the file being uploaded. #[ruma_api(header = CONTENT_TYPE)] pub content_type: Option<&'a str>, /// Should the server return a blurhash or not. /// /// This uses the unstable prefix in /// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448). #[ruma_api(query)] #[cfg(feature = "unstable-pre-spec")] #[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))] #[serde(rename = "xyz.amorgan.blurhash")] pub generate_blurhash: bool, } response: { /// The MXC URI for the uploaded content. pub content_uri: MxcUri, /// The [BlurHash](https://blurha.sh) for the uploaded content. /// /// This uses the unstable prefix in /// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448). #[cfg(feature = "unstable-pre-spec")] #[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))] #[serde(rename = "xyz.amorgan.blurhash")] #[serde(skip_serializing_if = "Option::is_none")] pub blurhash: Option<String>, } error: crate::Error } impl<'a> Request<'a> { /// Creates a new `Request` with the given file contents. pub fn
(file: &'a [u8]) -> Self { Self { file, filename: None, content_type: None, #[cfg(feature = "unstable-pre-spec")] generate_blurhash: false, } } } impl Response { /// Creates a new `Response` with the given MXC URI. pub fn new(content_uri: MxcUri) -> Self { Self { content_uri, #[cfg(feature = "unstable-pre-spec")] blurhash: None, } } }
new
parse.rs
use AnyAction; use error::*; use libflo_std::{ Input, Libflo, Output }; use number_or_string::NumberOrString; use std::mem; use string; pub unsafe fn parse(libflo: &Libflo, arg: (&NumberOrString, &str)) -> Result<Option<Box<AnyAction>>>
{ let event_mapper = libflo.get_event_mapper(); let parse_event = event_mapper.get_by_module_name(string::module(), string::parse_event())?; let (number_or_string, _) = arg; let static_arg: (&'static NumberOrString, &'static str) = mem::transmute(arg); let results = parse_event .call(Input::Any(&static_arg))? .into_iter() .map( |result_output| { if let Output::Any(mut result_option_any) = result_output { if let Some(result_option) = result_option_any.downcast_mut::<Option<Box<AnyAction>>>() { Ok(mem::replace(result_option, None)) } else { Err(ErrorKind::DowncastFailure("Option<Box<AnyAction>>".to_string()).into()) } } else { Err(ErrorKind::ParserReturnedIncorrectType(number_or_string.clone()).into()) } } ); let mut errors = Vec::new(); let mut oks = Vec::new(); for result in results { match result { Ok(Some(item)) => oks.push(item), Ok(None) => { }, Err(err) => errors.push(err), } } if errors.len() > 0 { Err(ErrorKind::ParserError(errors).into()) } else if oks.len() > 1 { Err(ErrorKind::ParserReturnedMultipleActions(number_or_string.clone()).into()) } else { Ok(oks.pop()) } }
server.rs
//! # sso_server //! //! ## Configuration //! //! See [Config](../sso/struct.Config.html). //! #[macro_use] extern crate clap; #[macro_use] extern crate log; use clap::{App, Arg}; const ARG_CONFIG: &str = "config"; #[tokio::main] async fn main() { let matches = App::new("sso-server") .version(crate_version!()) .author("Sam Ward <[email protected]>") .arg( Arg::with_name(ARG_CONFIG) .long("config") .alias("c") .takes_value(true) .required(false), ) .get_matches(); let config_name = matches.value_of(ARG_CONFIG).unwrap_or(".config/sso"); let config = sso::config::from_env(config_name).expect("parse configuration from environment failure"); let config = config .load_templates() .await .expect("load template files failure"); sso::util::init_panic(config.log.pretty); sso::util::init_log(config.log.pretty); let local = tokio::task::LocalSet::new(); let sys = actix_rt::System::run_in_tokio("server", &local); local .run_until(async move { debug!("start"); let server = sso::http_server::from_config(config) .await .expect("create server from environment failure"); let http_public = server .public_service() .expect("create http public server failure"); let http_private = server .private_service() .expect("create http private server failure"); tokio::task::spawn_local(async move { signal_int_term().await; debug!("stop"); http_public.stop(true).await; http_private.stop(true).await; actix_rt::System::current().stop(); }); info!( "public interface listening on http://{}", server.config().http.public.bind ); info!( "private interface listening on http://{}", server.config().http.private.bind ); sys.await.expect("actix system failure"); }) .await; } async fn signal_int_term()
{ use tokio::signal::unix::{signal, SignalKind}; let mut int = signal(SignalKind::interrupt()).expect("SIGINT stream failure"); let mut term = signal(SignalKind::terminate()).expect("SIGTERM stream failure"); loop { tokio::select! { _ = int.recv() => { debug!("SIGINT signal"); break; } _ = term.recv() => { debug!("SIGTERM signal"); break; } }; } }
CountdownContext.tsx
import {createContext, ReactNode, useContext, useEffect, useState} from 'react' import {ChallengesContext} from "./ChallengesContext"; interface CountdownProviderProps { children: ReactNode; } interface CountdownContextData { minutes: number; seconds: number; hasFinished: boolean; countdownStarted: boolean; startCountdown: () => void; resetCountdown: () => void; } export const CountdownContext = createContext({} as CountdownContextData)
export function CountdownProvider({ children }: CountdownProviderProps) { const { startNewChallenge } = useContext(ChallengesContext) const [time, setTime] = useState(0.05 * 60) const [countdownStarted, setCountdownStarted] = useState(false) const [hasFinished, setHasFinished] = useState(false) const minutes = Math.floor(time / 60) const seconds = time % 60 function startCountdown() { setCountdownStarted(true) } function resetCountdown() { clearTimeout(countdownTimeout) setCountdownStarted(false) setTime(0.05 * 60) setHasFinished(false) } // useEffect - quando alguma coisa acontecer deve disparar uma acao // primeiro parametro: funcao // segundo parametro: quando a funcao será executada. será executada sempre q o valor de active mudar useEffect(() => { // se o countdown está ativo e o time não chegou em zero if (countdownStarted && time > 0) { // executa a função que está dentro de setTimeout depois de 1 segundo (1000) countdownTimeout = setTimeout(() => { // reduz o time em um segundo setTime(time - 1) }, 1000) } else if (countdownStarted && time === 0) { setHasFinished(true) setCountdownStarted(false) startNewChallenge() } }, [countdownStarted, time]) // executa toda vez q o active ou o time muda return ( <CountdownContext.Provider value={{ minutes, seconds, hasFinished, countdownStarted, startCountdown, resetCountdown }}> { children } </CountdownContext.Provider> ) }
// let hasAType: boolean = true ==> set a type (boolean) and assigned it a value // use the colon to set the type of our variable let countdownTimeout: NodeJS.Timeout
options.py
from . import ffi
def set_option(name, option): """ Set the given LLVM "command-line" option. For example set_option("test", "-debug-pass=Structure") would display all optimization passes when generating code. """ ffi.lib.LLVMPY_SetCommandLine(_encode_string(name), _encode_string(option)) ffi.lib.LLVMPY_SetCommandLine.argtypes = [c_char_p, c_char_p]
from .common import _encode_string from ctypes import c_char_p
list0.go
// cmd/9l/list.c from Vita Nuova. // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth ([email protected]) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) // Portions Copyright © 2004,2006 Bruce Ellis // Portions Copyright © 2005-2007 C H Forsyth ([email protected]) // Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others // Portions Copyright © 2009 The Go Authors. All rights reserved. // // 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 mips import ( "cmd/internal/obj" "fmt" ) func init() { obj.RegisterRegister(obj.RBaseMIPS, REG_LAST+1, rconv) obj.RegisterOpcode(obj.ABaseMIPS, Anames) } func rconv(r int) string { if r
Rconv(a int) string { s := "C_??" if a >= C_NONE && a <= C_NCLASS { s = cnames0[a] } var fp string fp += s return fp }
== 0 { return "NONE" } if r == REGG { // Special case. return "g" } if REG_R0 <= r && r <= REG_R31 { return fmt.Sprintf("R%d", r-REG_R0) } if REG_F0 <= r && r <= REG_F31 { return fmt.Sprintf("F%d", r-REG_F0) } if REG_M0 <= r && r <= REG_M31 { return fmt.Sprintf("M%d", r-REG_M0) } if REG_FCR0 <= r && r <= REG_FCR31 { return fmt.Sprintf("FCR%d", r-REG_FCR0) } if REG_W0 <= r && r <= REG_W31 { return fmt.Sprintf("W%d", r-REG_W0) } if r == REG_HI { return "HI" } if r == REG_LO { return "LO" } return fmt.Sprintf("Rgok(%d)", r-obj.RBaseMIPS) } func D
parser.py
import urllib.request import json import requests from data.config import * def youtube_get_information(channel_id): api_key = YOUTUBE_API_KEY base_search_url = "https://www.googleapis.com/youtube/v3/search?" base_video_link = "https://www.youtube.com/watch?v=" first_url = base_search_url + f"key={api_key}&channelId={channel_id}&part=snippet,id&order=date&maxResults=1" inp = urllib.request.urlopen(first_url) resp = json.load(inp) for i in resp["items"]: print(i) if i["id"]["kind"] == "youtube#video": video_link = base_video_link + i["id"]["videoId"] video_title = i["snippet"]["title"] return video_title, video_link def twitch_get_information(channel_name):
URL = f'https://api.twitch.tv/helix/streams?user_login={channel_name}' auth_url = 'https://id.twitch.tv/oauth2/token' aut_params = {'client_id': CLIENT_ID, 'client_secret': SECRET, 'grant_type': 'client_credentials' } aut_call = requests.post(url=auth_url, params=aut_params) access_token = aut_call.json()['access_token'] head = { 'Client-ID' : CLIENT_ID, 'Authorization' : "Bearer " + access_token } r = requests.get(URL, headers = head).json()['data'] if r: if r[0]['type'] == 'live': return True return False
api_linter.go
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package generators import ( "bytes" "fmt" "io" "io/ioutil" "os" "sort" "k8s.io/kube-openapi/pkg/generators/rules" "k8s.io/gengo/generator" "k8s.io/gengo/types" "k8s.io/klog" ) const apiViolationFileType = "api-violation" type apiViolationFile struct { // Since our file actually is unrelated to the package structure, use a // path that hasn't been mangled by the framework. unmangledPath string } func (a apiViolationFile) AssembleFile(f *generator.File, path string) error { path = a.unmangledPath klog.V(2).Infof("Assembling file %q", path) if path == "-" { _, err := io.Copy(os.Stdout, &f.Body) return err } output, err := os.Create(path) if err != nil { return err } defer output.Close() _, err = io.Copy(output, &f.Body) return err } func (a apiViolationFile) VerifyFile(f *generator.File, path string) error { if path == "-" { // Nothing to verify against. return nil } path = a.unmangledPath formatted := f.Body.Bytes() existing, err := ioutil.ReadFile(path) if err != nil { return fmt.Errorf("unable to read file %q for comparison: %v", path, err) } if bytes.Compare(formatted, existing) == 0 { return nil } // Be nice and find the first place where they differ // (Copied from gengo's default file type) i := 0 for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { i++ } eDiff, fDiff := existing[i:], formatted[i:] if len(eDiff) > 100 { eDiff = eDiff[:100] } if len(fDiff) > 100 { fDiff = fDiff[:100] } return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", path, string(eDiff), string(fDiff)) } func newAPIViolationGen() *apiViolationGen
type apiViolationGen struct { generator.DefaultGen linter *apiLinter } func (v *apiViolationGen) FileType() string { return apiViolationFileType } func (v *apiViolationGen) Filename() string { return "this file is ignored by the file assembler" } func (v *apiViolationGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { klog.V(5).Infof("validating API rules for type %v", t) if err := v.linter.validate(t); err != nil { return err } return nil } // Finalize prints the API rule violations to report file (if specified from // arguments) or stdout (default) func (v *apiViolationGen) Finalize(c *generator.Context, w io.Writer) error { // NOTE: we don't return error here because we assume that the report file will // get evaluated afterwards to determine if error should be raised. For example, // you can have make rules that compare the report file with existing known // violations (whitelist) and determine no error if no change is detected. v.linter.report(w) return nil } // apiLinter is the framework hosting multiple API rules and recording API rule // violations type apiLinter struct { // API rules that implement APIRule interface and output API rule violations rules []APIRule violations []apiViolation } // newAPILinter creates an apiLinter object with API rules in package rules. Please // add APIRule here when new API rule is implemented. func newAPILinter() *apiLinter { return &apiLinter{ rules: []APIRule{ &rules.NamesMatch{}, &rules.OmitEmptyMatchCase{}, }, } } // apiViolation uniquely identifies single API rule violation type apiViolation struct { // Name of rule from APIRule.Name() rule string packageName string typeName string // Optional: name of field that violates API rule. Empty fieldName implies that // the entire type violates the rule. field string } // apiViolations implements sort.Interface for []apiViolation based on the fields: rule, // packageName, typeName and field. type apiViolations []apiViolation func (a apiViolations) Len() int { return len(a) } func (a apiViolations) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a apiViolations) Less(i, j int) bool { if a[i].rule != a[j].rule { return a[i].rule < a[j].rule } if a[i].packageName != a[j].packageName { return a[i].packageName < a[j].packageName } if a[i].typeName != a[j].typeName { return a[i].typeName < a[j].typeName } return a[i].field < a[j].field } // APIRule is the interface for validating API rule on Go types type APIRule interface { // Validate evaluates API rule on type t and returns a list of field names in // the type that violate the rule. Empty field name [""] implies the entire // type violates the rule. Validate(t *types.Type) ([]string, error) // Name returns the name of APIRule Name() string } // validate runs all API rules on type t and records any API rule violation func (l *apiLinter) validate(t *types.Type) error { for _, r := range l.rules { klog.V(5).Infof("validating API rule %v for type %v", r.Name(), t) fields, err := r.Validate(t) if err != nil { return err } for _, field := range fields { l.violations = append(l.violations, apiViolation{ rule: r.Name(), packageName: t.Name.Package, typeName: t.Name.Name, field: field, }) } } return nil } // report prints any API rule violation to writer w and returns error if violation exists func (l *apiLinter) report(w io.Writer) error { sort.Sort(apiViolations(l.violations)) for _, v := range l.violations { fmt.Fprintf(w, "API rule violation: %s,%s,%s,%s\n", v.rule, v.packageName, v.typeName, v.field) } if len(l.violations) > 0 { return fmt.Errorf("API rule violations exist") } return nil }
{ return &apiViolationGen{ linter: newAPILinter(), } }
app.js
/** * @file: app.js * @author: Leonid Vinikov <[email protected]> * @description: Main File */ import "@babel/polyfill" import * as core from 'CORE' import * as api from 'API'; import * as modules from 'MODULES'; import * as services from 'SERVICES'; import * as components from 'COMPONENTS'; import * as pages from 'PAGES'; class App { /** * Function constructor() : Create App */ constructor() { services.Terminal.initialize(); this.logger = new modules.Logger( this, true ); this.logger.setOutputHandler( services.Terminal.onOutput ); this.logger.startEmpty(); // window.location.href.substring( 0, window.location.href.lastIndexOf( "/" ) ) + '/../api/?cmd=' const remoteAddress = 'http://localhost:3000/', http = new api.Http( remoteAddress ); this.apis = { catalog: new api.Catalog( http ), cart: new api.Cart( http ), }; this.elements = { header: { logo: core.Factory.createElement( 'header #logo' ), toggle: core.Factory.createElement( 'header #toggle' ), cart: core.Factory.createElement( 'header #toggle .cart' ), amount: core.Factory.createElement( 'header #toggle .amount' ), spinner: core.Factory.createElement( 'header #toggle .spinner' ) }, sidebar: { self: core.Factory.createElement( '#sidebar' ), // Self should not be exist, if you use self, it should be component. closeButton: core.Factory.createElement( '#sidebar #close' ), }, overlay: core.Factory.createElement( '#overlay' ), sections: { main: core.Factory.createElement( "section.main" ) } }; this.container = new core.Container( this.elements.sections.main, '<div class="page container"></div>' ); this.pages = { catalog: new pages.Catalog( this.container, '<div class="pages catalog"></div>', { api: this.apis.catalog, } ), checkout: new pages.Checkout( this.container, '<div class="pages checkout">' + ' <h1>Check OUT.</h1>' + '</div>' ), } } /** * Function initialize() : Initialize App */ initialize() { this.logger.startEmpty(); const { header, overlay, sidebar } = this.elements; this.container.on( 'render:after', this._onContainerRender.bind( this ) ); overlay.click( () => this.sidebarToggle( false ) ); header.toggle.click( () => this.sidebarToggle( true ) ); header.logo.click( () => { this.container.set( this.pages.catalog ); this.container.render(); } ); sidebar.closeButton.click( () => this.sidebarToggle( false ) ); this.container.set( this.pages.catalog ); this.container.render(); } /** * Function _onContainerReady() : Called when container ready. * * @param {modules.Page} pageModule */ _onContainerRender( pageModule ) { this.logger.startWith( { pageModule: pageModule.constructor.name } ); if ( pageModule instanceof pages.Catalog ) { this.pages.catalog.on( 'productAdd', this._onCatalogProductAdd.bind( this ) ); if ( !this.cart ) { this.cart = new components.Cart( this.apis.cart, this.apis.catalog ); this.cart.on( 'get', this._onCartGet.bind( this ) ); this.cart.on( 'received', this._onCartReceived.bind( this ) ); this.cart.on( 'amountChange', this._onCartAmountChange.bind( this ) ); this.cart.on( 'emptyState', this._onCartEmptyState.bind( this ) ); this.cart.on( 'checkout', this._onCartCheckout.bind( this ) ); // TODO: should use 'this.elements.sidebar.self' instead of 'this.elements.sidebar.self.element' // TODO: FIX ASAP. this.cart.render( this.elements.sidebar.self.element ); } } } /** * Function _onCartGet() : Called on request cart from the server */ _onCartGet() { this.logger.startEmpty(); const { spinner } = this.elements.header; spinner.show(); } /** * Function _onCartReceived() : Called after cart received */ _onCartReceived() { this.logger.startEmpty(); const { cart, spinner } = this.elements.header; cart.show(); spinner.hide(); } /** * Function _onCartAmountChange() : Called on cart amount change. * * @param {Number} count */ _onCartAmountChange( count ) { this.logger.startWith( { count } ); const { amount } = this.elements.header; amount.html( count ); } /** * Function _onCartEmptyState() : Called on cart empty state change (cart have items|cart does have items) * * @param {Boolean} state */ _onCartEmptyState( state ) { this.logger.startWith( { state } ); const { amount } = this.elements.header; state ? amount.show() : amount.hide(); } /** * Function _onCartCheckout() : Called on cart checkout */ _onCartCheckout() { this.logger.startEmpty(); this.sidebarToggle( false ); this.container.set( this.pages.checkout ); this.pages.checkout.on( 'render:after', () => { console.log( 'onCartCheckout this.page.checkout rendered' ); } ); this.container.render(); } /** * Function _onCatalogProductAdd() : Called on catalog item add */ _onCatalogProductAdd( product ) { this.logger.startWith( { product } ); this.cart.itemAdd( product, () => { if ( components.Cart.openCartOnUpdate ) { this.sidebarToggle( true ); } } ); } /** * Function sidebarToggle() : Change the sidebar state * * @param {boolean} state */ sidebarToggle( state ) { this.logger.startWith( { state } ); const { sidebar, overlay } = this.elements; if ( state ) { overlay.fadeIn(); sidebar.self.addClass( 'show' ); this.cart.open(); } else { overlay.fadeOut(); sidebar.self.removeClass( 'show' ); this.cart.close(); } } }
(new App().initialize());
datasource.go
package appsync import ( "fmt" "log" "regexp" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) func ResourceDataSource() *schema.Resource { return &schema.Resource{ Create: resourceDataSourceCreate, Read: resourceDataSourceRead, Update: resourceDataSourceUpdate, Delete: resourceDataSourceDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, Schema: map[string]*schema.Schema{ "api_id": { Type: schema.TypeString, Required: true, }, "name": { Type: schema.TypeString, Required: true, ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { value := v.(string) if !regexp.MustCompile(`[_A-Za-z][_0-9A-Za-z]*`).MatchString(value) { errors = append(errors, fmt.Errorf("%q must match [_A-Za-z][_0-9A-Za-z]*", k)) } return }, }, "type": { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ appsync.DataSourceTypeAwsLambda, appsync.DataSourceTypeAmazonDynamodb, appsync.DataSourceTypeAmazonElasticsearch, appsync.DataSourceTypeHttp, appsync.DataSourceTypeNone, }, true), StateFunc: func(v interface{}) string { return strings.ToUpper(v.(string)) }, }, "description": { Type: schema.TypeString, Optional: true, }, "dynamodb_config": { Type: schema.TypeList, Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "region": { Type: schema.TypeString, Optional: true, Computed: true, }, "table_name": { Type: schema.TypeString, Required: true, }, "use_caller_credentials": { Type: schema.TypeBool, Optional: true, }, }, }, ConflictsWith: []string{"elasticsearch_config", "http_config", "lambda_config"}, }, "elasticsearch_config": { Type: schema.TypeList, Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "region": { Type: schema.TypeString, Optional: true, Computed: true, }, "endpoint": { Type: schema.TypeString, Required: true, }, }, }, ConflictsWith: []string{"dynamodb_config", "http_config", "lambda_config"}, }, "http_config": { Type: schema.TypeList, Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "endpoint": { Type: schema.TypeString, Required: true, }, }, }, ConflictsWith: []string{"dynamodb_config", "elasticsearch_config", "lambda_config"}, }, "lambda_config": { Type: schema.TypeList, Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "function_arn": { Type: schema.TypeString, Required: true, }, }, }, ConflictsWith: []string{"dynamodb_config", "elasticsearch_config", "http_config"}, }, "service_role_arn": { Type: schema.TypeString, Optional: true, }, "arn": { Type: schema.TypeString, Computed: true, }, }, } } func resourceDataSourceCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*conns.AWSClient).AppSyncConn region := meta.(*conns.AWSClient).Region input := &appsync.CreateDataSourceInput{ ApiId: aws.String(d.Get("api_id").(string)), Name: aws.String(d.Get("name").(string)), Type: aws.String(d.Get("type").(string)), } if v, ok := d.GetOk("description"); ok { input.Description = aws.String(v.(string)) } if v, ok := d.GetOk("dynamodb_config"); ok { input.DynamodbConfig = expandAppsyncDynamodbDataSourceConfig(v.([]interface{}), region) } if v, ok := d.GetOk("elasticsearch_config"); ok { input.ElasticsearchConfig = expandAppsyncElasticsearchDataSourceConfig(v.([]interface{}), region) } if v, ok := d.GetOk("http_config"); ok { input.HttpConfig = expandAppsyncHTTPDataSourceConfig(v.([]interface{})) } if v, ok := d.GetOk("lambda_config"); ok { input.LambdaConfig = expandAppsyncLambdaDataSourceConfig(v.([]interface{})) } if v, ok := d.GetOk("service_role_arn"); ok { input.ServiceRoleArn = aws.String(v.(string)) } _, err := conn.CreateDataSource(input) if err != nil { return err } d.SetId(d.Get("api_id").(string) + "-" + d.Get("name").(string)) return resourceDataSourceRead(d, meta) } func resourceDataSourceRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*conns.AWSClient).AppSyncConn apiID, name, err := DecodeID(d.Id()) if err != nil { return err } input := &appsync.GetDataSourceInput{ ApiId: aws.String(apiID), Name: aws.String(name), } resp, err := conn.GetDataSource(input) if err != nil { if tfawserr.ErrCodeEquals(err, appsync.ErrCodeNotFoundException) && !d.IsNewResource() { log.Printf("[WARN] AppSync Datasource %q not found, removing from state", d.Id()) d.SetId("") return nil } return err } d.Set("api_id", apiID) d.Set("arn", resp.DataSource.DataSourceArn) d.Set("description", resp.DataSource.Description) if err := d.Set("dynamodb_config", flattenAppsyncDynamodbDataSourceConfig(resp.DataSource.DynamodbConfig)); err != nil { return fmt.Errorf("error setting dynamodb_config: %s", err) } if err := d.Set("elasticsearch_config", flattenAppsyncElasticsearchDataSourceConfig(resp.DataSource.ElasticsearchConfig)); err != nil { return fmt.Errorf("error setting elasticsearch_config: %s", err) } if err := d.Set("http_config", flattenAppsyncHTTPDataSourceConfig(resp.DataSource.HttpConfig)); err != nil { return fmt.Errorf("error setting http_config: %s", err) } if err := d.Set("lambda_config", flattenAppsyncLambdaDataSourceConfig(resp.DataSource.LambdaConfig)); err != nil { return fmt.Errorf("error setting lambda_config: %s", err) } d.Set("name", resp.DataSource.Name) d.Set("service_role_arn", resp.DataSource.ServiceRoleArn) d.Set("type", resp.DataSource.Type) return nil } func resourceDataSourceUpdate(d *schema.ResourceData, meta interface{}) error
func resourceDataSourceDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*conns.AWSClient).AppSyncConn apiID, name, err := DecodeID(d.Id()) if err != nil { return err } input := &appsync.DeleteDataSourceInput{ ApiId: aws.String(apiID), Name: aws.String(name), } _, err = conn.DeleteDataSource(input) if err != nil { if tfawserr.ErrCodeEquals(err, appsync.ErrCodeNotFoundException) { return nil } return err } return nil } func DecodeID(id string) (string, string, error) { idParts := strings.SplitN(id, "-", 2) if len(idParts) != 2 { return "", "", fmt.Errorf("expected ID in format ApiID-DataSourceName, received: %s", id) } return idParts[0], idParts[1], nil } func expandAppsyncDynamodbDataSourceConfig(l []interface{}, currentRegion string) *appsync.DynamodbDataSourceConfig { if len(l) == 0 || l[0] == nil { return nil } configured := l[0].(map[string]interface{}) result := &appsync.DynamodbDataSourceConfig{ AwsRegion: aws.String(currentRegion), TableName: aws.String(configured["table_name"].(string)), } if v, ok := configured["region"]; ok && v.(string) != "" { result.AwsRegion = aws.String(v.(string)) } if v, ok := configured["use_caller_credentials"]; ok { result.UseCallerCredentials = aws.Bool(v.(bool)) } return result } func flattenAppsyncDynamodbDataSourceConfig(config *appsync.DynamodbDataSourceConfig) []map[string]interface{} { if config == nil { return nil } result := map[string]interface{}{ "region": aws.StringValue(config.AwsRegion), "table_name": aws.StringValue(config.TableName), } if config.UseCallerCredentials != nil { result["use_caller_credentials"] = aws.BoolValue(config.UseCallerCredentials) } return []map[string]interface{}{result} } func expandAppsyncElasticsearchDataSourceConfig(l []interface{}, currentRegion string) *appsync.ElasticsearchDataSourceConfig { if len(l) == 0 || l[0] == nil { return nil } configured := l[0].(map[string]interface{}) result := &appsync.ElasticsearchDataSourceConfig{ AwsRegion: aws.String(currentRegion), Endpoint: aws.String(configured["endpoint"].(string)), } if v, ok := configured["region"]; ok && v.(string) != "" { result.AwsRegion = aws.String(v.(string)) } return result } func flattenAppsyncElasticsearchDataSourceConfig(config *appsync.ElasticsearchDataSourceConfig) []map[string]interface{} { if config == nil { return nil } result := map[string]interface{}{ "endpoint": aws.StringValue(config.Endpoint), "region": aws.StringValue(config.AwsRegion), } return []map[string]interface{}{result} } func expandAppsyncHTTPDataSourceConfig(l []interface{}) *appsync.HttpDataSourceConfig { if len(l) == 0 || l[0] == nil { return nil } configured := l[0].(map[string]interface{}) result := &appsync.HttpDataSourceConfig{ Endpoint: aws.String(configured["endpoint"].(string)), } return result } func flattenAppsyncHTTPDataSourceConfig(config *appsync.HttpDataSourceConfig) []map[string]interface{} { if config == nil { return nil } result := map[string]interface{}{ "endpoint": aws.StringValue(config.Endpoint), } return []map[string]interface{}{result} } func expandAppsyncLambdaDataSourceConfig(l []interface{}) *appsync.LambdaDataSourceConfig { if len(l) == 0 || l[0] == nil { return nil } configured := l[0].(map[string]interface{}) result := &appsync.LambdaDataSourceConfig{ LambdaFunctionArn: aws.String(configured["function_arn"].(string)), } return result } func flattenAppsyncLambdaDataSourceConfig(config *appsync.LambdaDataSourceConfig) []map[string]interface{} { if config == nil { return nil } result := map[string]interface{}{ "function_arn": aws.StringValue(config.LambdaFunctionArn), } return []map[string]interface{}{result} }
{ conn := meta.(*conns.AWSClient).AppSyncConn region := meta.(*conns.AWSClient).Region apiID, name, err := DecodeID(d.Id()) if err != nil { return err } input := &appsync.UpdateDataSourceInput{ ApiId: aws.String(apiID), Name: aws.String(name), Type: aws.String(d.Get("type").(string)), } if v, ok := d.GetOk("description"); ok { input.Description = aws.String(v.(string)) } if v, ok := d.GetOk("dynamodb_config"); ok { input.DynamodbConfig = expandAppsyncDynamodbDataSourceConfig(v.([]interface{}), region) } if v, ok := d.GetOk("elasticsearch_config"); ok { input.ElasticsearchConfig = expandAppsyncElasticsearchDataSourceConfig(v.([]interface{}), region) } if v, ok := d.GetOk("http_config"); ok { input.HttpConfig = expandAppsyncHTTPDataSourceConfig(v.([]interface{})) } if v, ok := d.GetOk("lambda_config"); ok { input.LambdaConfig = expandAppsyncLambdaDataSourceConfig(v.([]interface{})) } if v, ok := d.GetOk("service_role_arn"); ok { input.ServiceRoleArn = aws.String(v.(string)) } _, err = conn.UpdateDataSource(input) if err != nil { return err } return resourceDataSourceRead(d, meta) }
init.go
// Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. package linux import ( "runtime" "github.com/google/syzkaller/prog" "github.com/google/syzkaller/sys/targets" ) func InitTarget(target *prog.Target)
var ( // This should not be here, but for now we expose this for syz-fuzzer. KCOV_INIT_TRACE uintptr KCOV_ENABLE uintptr KCOV_REMOTE_ENABLE uintptr KCOV_DISABLE uintptr KCOV_TRACE_PC uintptr KCOV_TRACE_CMP uintptr ) type arch struct { unix *targets.UnixNeutralizer clockGettimeSyscall *prog.Syscall MREMAP_MAYMOVE uint64 MREMAP_FIXED uint64 SYSLOG_ACTION_CONSOLE_OFF uint64 SYSLOG_ACTION_CONSOLE_ON uint64 SYSLOG_ACTION_CONSOLE_LEVEL uint64 SYSLOG_ACTION_CLEAR uint64 SYSLOG_ACTION_SIZE_UNREAD uint64 FIFREEZE uint64 FITHAW uint64 SNAPSHOT_FREEZE uint64 EXT4_IOC_SHUTDOWN uint64 EXT4_IOC_RESIZE_FS uint64 EXT4_IOC_MIGRATE uint64 FAN_OPEN_PERM uint64 FAN_ACCESS_PERM uint64 FAN_OPEN_EXEC_PERM uint64 PTRACE_TRACEME uint64 CLOCK_REALTIME uint64 ARCH_SET_FS uint64 ARCH_SET_GS uint64 AF_NFC uint64 AF_LLC uint64 AF_BLUETOOTH uint64 AF_X25 uint64 AF_AX25 uint64 AF_NETROM uint64 AF_ROSE uint64 USB_MAJOR uint64 TIOCSSERIAL uint64 TIOCGSERIAL uint64 } func (arch *arch) neutralize(c *prog.Call) { arch.unix.Neutralize(c) switch c.Meta.CallName { case "mremap": // Add MREMAP_FIXED flag, otherwise it produces non-deterministic results. flags := c.Args[3].(*prog.ConstArg) if flags.Val&arch.MREMAP_MAYMOVE != 0 { flags.Val |= arch.MREMAP_FIXED } case "syslog": cmd := c.Args[0].(*prog.ConstArg) cmd.Val = uint64(uint32(cmd.Val)) // These disable console output, but we need it. if cmd.Val == arch.SYSLOG_ACTION_CONSOLE_OFF || cmd.Val == arch.SYSLOG_ACTION_CONSOLE_ON || cmd.Val == arch.SYSLOG_ACTION_CONSOLE_LEVEL || cmd.Val == arch.SYSLOG_ACTION_CLEAR { cmd.Val = arch.SYSLOG_ACTION_SIZE_UNREAD } case "ioctl": arch.neutralizeIoctl(c) case "fanotify_mark": // FAN_*_PERM require the program to reply to open requests. // If that does not happen, the program will hang in an unkillable state forever. // See the following bug for details: // https://groups.google.com/d/msg/syzkaller-bugs/pD-vbqJu6U0/kGH30p3lBgAJ mask := c.Args[2].(*prog.ConstArg) mask.Val &^= arch.FAN_OPEN_PERM | arch.FAN_ACCESS_PERM | arch.FAN_OPEN_EXEC_PERM case "ptrace": req := c.Args[0].(*prog.ConstArg) // PTRACE_TRACEME leads to unkillable processes, see: // https://groups.google.com/forum/#!topic/syzkaller/uGzwvhlCXAw if uint64(uint32(req.Val)) == arch.PTRACE_TRACEME { req.Val = ^uint64(0) } case "arch_prctl": // fs holds address of tls, if a program messes it at least signal // handling will break. This also allows a program to do writes // at arbitrary addresses, which usually leads to machine outbreak. cmd := c.Args[0].(*prog.ConstArg) if uint64(uint32(cmd.Val)) == arch.ARCH_SET_FS { cmd.Val = arch.ARCH_SET_GS } case "init_module": // Kernel tries to vmalloc whatever we pass as size and it's not accounted against memcg. // As the result it can lead to massive OOM kills of everything running on the machine. // Strictly saying, the same applies to finit_module with a sparse file too, // but there is no simple way to handle that. sz := c.Args[1].(*prog.ConstArg) sz.Val %= 1 << 20 case "syz_init_net_socket": // Don't let it mess with arbitrary sockets in init namespace. family := c.Args[0].(*prog.ConstArg) switch uint64(uint32(family.Val)) { case arch.AF_NFC, arch.AF_LLC, arch.AF_BLUETOOTH, arch.AF_X25, arch.AF_AX25, arch.AF_NETROM, arch.AF_ROSE: default: family.Val = ^uint64(0) } case "syz_open_dev": enforceIntArg(c.Args[0]) enforceIntArg(c.Args[1]) enforceIntArg(c.Args[2]) } switch c.Meta.Name { case "setsockopt$EBT_SO_SET_ENTRIES": arch.neutralizeEbtables(c) } } func enforceIntArg(a prog.Arg) { arg, ok := a.(*prog.ConstArg) if !ok { return } switch typ := arg.Type().(type) { case *prog.ConstType: arg.Val = typ.Val case *prog.IntType: if typ.Kind == prog.IntRange && (arg.Val < typ.RangeBegin || arg.Val > typ.RangeEnd) { arg.Val = typ.RangeBegin } } } func (arch *arch) neutralizeIoctl(c *prog.Call) { cmd := c.Args[1].(*prog.ConstArg) switch uint64(uint32(cmd.Val)) { case arch.FIFREEZE: // Freeze kills machine. Though, it is an interesting functions, // so we need to test it somehow. // TODO: not required if executor drops privileges. // Fortunately, the value does not conflict with any other ioctl commands for now. cmd.Val = arch.FITHAW case arch.SNAPSHOT_FREEZE: // SNAPSHOT_FREEZE freezes all processes and leaves the machine dead. cmd.Val = arch.FITHAW case arch.EXT4_IOC_SHUTDOWN: // EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways. // Fortunately, the value does not conflict with any other ioctl commands for now. cmd.Val = arch.EXT4_IOC_MIGRATE case arch.EXT4_IOC_RESIZE_FS: // EXT4_IOC_RESIZE_FS on root fs can shrink it to 0 (or whatever is the minimum size) // and then creation of new temp dirs for tests will fail. // TODO: not necessary for sandbox=namespace as it tests in a tmpfs // and/or if we mount tmpfs for sandbox=none (#971). cmd.Val = arch.EXT4_IOC_MIGRATE case arch.TIOCSSERIAL: // TIOCSSERIAL can do nasty things under root, like causing writes to random memory // pretty much like /dev/mem, but this is also working as intended. // For details see: // https://groups.google.com/g/syzkaller-bugs/c/1rVENJf9P4U/m/QtGpapRxAgAJ // https://syzkaller.appspot.com/bug?extid=f4f1e871965064ae689e // TODO: TIOCSSERIAL does some other things that are not dangerous // and would be nice to test, if/when we can neutralize based on sandbox value // we could prohibit it only under sandbox=none. cmd.Val = arch.TIOCGSERIAL } } func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, dir prog.Dir, old prog.Arg) ( arg prog.Arg, calls []*prog.Call) { typ := typ0.(*prog.StructType) // We need to generate timespec/timeval that are either // (1) definitely in the past, or // (2) definitely in unreachable fututre, or // (3) few ms ahead of now. // Note: timespec/timeval can be absolute or relative to now. // Note: executor has blocking syscall timeout of 45 ms, // so we generate both 10ms and 60ms. const ( timeout1 = uint64(10) timeout2 = uint64(60) ) usec := typ.Name() == "timeval" switch { case g.NOutOf(1, 4): // Now for relative, past for absolute. arg = prog.MakeGroupArg(typ, dir, []prog.Arg{ prog.MakeResultArg(typ.Fields[0].Type, dir, nil, 0), prog.MakeResultArg(typ.Fields[1].Type, dir, nil, 0), }) case g.NOutOf(1, 3): // Few ms ahead for relative, past for absolute. nsec := timeout1 * 1e6 if g.NOutOf(1, 2) { nsec = timeout2 * 1e6 } if usec { nsec /= 1e3 } arg = prog.MakeGroupArg(typ, dir, []prog.Arg{ prog.MakeResultArg(typ.Fields[0].Type, dir, nil, 0), prog.MakeResultArg(typ.Fields[1].Type, dir, nil, nsec), }) case g.NOutOf(1, 2): // Unreachable fututre for both relative and absolute. arg = prog.MakeGroupArg(typ, dir, []prog.Arg{ prog.MakeResultArg(typ.Fields[0].Type, dir, nil, 2e9), prog.MakeResultArg(typ.Fields[1].Type, dir, nil, 0), }) default: // Few ms ahead for absolute. meta := arch.clockGettimeSyscall ptrArgType := meta.Args[1].Type.(*prog.PtrType) argType := ptrArgType.Elem.(*prog.StructType) tp := prog.MakeGroupArg(argType, prog.DirOut, []prog.Arg{ prog.MakeResultArg(argType.Fields[0].Type, prog.DirOut, nil, 0), prog.MakeResultArg(argType.Fields[1].Type, prog.DirOut, nil, 0), }) var tpaddr prog.Arg tpaddr, calls = g.Alloc(ptrArgType, prog.DirIn, tp) gettime := &prog.Call{ Meta: meta, Args: []prog.Arg{ prog.MakeConstArg(meta.Args[0].Type, prog.DirIn, arch.CLOCK_REALTIME), tpaddr, }, Ret: prog.MakeReturnArg(meta.Ret), } calls = append(calls, gettime) sec := prog.MakeResultArg(typ.Fields[0].Type, dir, tp.Inner[0].(*prog.ResultArg), 0) nsec := prog.MakeResultArg(typ.Fields[1].Type, dir, tp.Inner[1].(*prog.ResultArg), 0) msec := timeout1 if g.NOutOf(1, 2) { msec = timeout2 } if usec { nsec.OpDiv = 1e3 nsec.OpAdd = msec * 1e3 } else { nsec.OpAdd = msec * 1e6 } arg = prog.MakeGroupArg(typ, dir, []prog.Arg{sec, nsec}) } return }
{ arch := &arch{ unix: targets.MakeUnixNeutralizer(target), clockGettimeSyscall: target.SyscallMap["clock_gettime"], MREMAP_MAYMOVE: target.GetConst("MREMAP_MAYMOVE"), MREMAP_FIXED: target.GetConst("MREMAP_FIXED"), SYSLOG_ACTION_CONSOLE_OFF: target.GetConst("SYSLOG_ACTION_CONSOLE_OFF"), SYSLOG_ACTION_CONSOLE_ON: target.GetConst("SYSLOG_ACTION_CONSOLE_ON"), SYSLOG_ACTION_CONSOLE_LEVEL: target.GetConst("SYSLOG_ACTION_CONSOLE_LEVEL"), SYSLOG_ACTION_CLEAR: target.GetConst("SYSLOG_ACTION_CLEAR"), SYSLOG_ACTION_SIZE_UNREAD: target.GetConst("SYSLOG_ACTION_SIZE_UNREAD"), FIFREEZE: target.GetConst("FIFREEZE"), FITHAW: target.GetConst("FITHAW"), SNAPSHOT_FREEZE: target.GetConst("SNAPSHOT_FREEZE"), EXT4_IOC_SHUTDOWN: target.GetConst("EXT4_IOC_SHUTDOWN"), EXT4_IOC_RESIZE_FS: target.GetConst("EXT4_IOC_RESIZE_FS"), EXT4_IOC_MIGRATE: target.GetConst("EXT4_IOC_MIGRATE"), FAN_OPEN_PERM: target.GetConst("FAN_OPEN_PERM"), FAN_ACCESS_PERM: target.GetConst("FAN_ACCESS_PERM"), FAN_OPEN_EXEC_PERM: target.GetConst("FAN_OPEN_EXEC_PERM"), PTRACE_TRACEME: target.GetConst("PTRACE_TRACEME"), CLOCK_REALTIME: target.GetConst("CLOCK_REALTIME"), AF_NFC: target.GetConst("AF_NFC"), AF_LLC: target.GetConst("AF_LLC"), AF_BLUETOOTH: target.GetConst("AF_BLUETOOTH"), AF_X25: target.GetConst("AF_X25"), AF_AX25: target.GetConst("AF_AX25"), AF_NETROM: target.GetConst("AF_NETROM"), AF_ROSE: target.GetConst("AF_ROSE"), USB_MAJOR: target.GetConst("USB_MAJOR"), TIOCSSERIAL: target.GetConst("TIOCSSERIAL"), TIOCGSERIAL: target.GetConst("TIOCGSERIAL"), // These are not present on all arches. ARCH_SET_FS: target.ConstMap["ARCH_SET_FS"], ARCH_SET_GS: target.ConstMap["ARCH_SET_GS"], } target.MakeDataMmap = targets.MakePosixMmap(target, true, true) target.Neutralize = arch.neutralize target.SpecialTypes = map[string]func(g *prog.Gen, typ prog.Type, dir prog.Dir, old prog.Arg) ( prog.Arg, []*prog.Call){ "timespec": arch.generateTimespec, "timeval": arch.generateTimespec, "sockaddr_alg": arch.generateSockaddrAlg, "alg_name": arch.generateAlgName, "alg_aead_name": arch.generateAlgAeadName, "alg_hash_name": arch.generateAlgHashName, "alg_skcipher_name": arch.generateAlgSkcipherhName, "ipt_replace": arch.generateIptables, "ip6t_replace": arch.generateIptables, "arpt_replace": arch.generateArptables, "ebt_replace": arch.generateEbtables, "usb_device_descriptor": arch.generateUsbDeviceDescriptor, "usb_device_descriptor_hid": arch.generateUsbHidDeviceDescriptor, } target.AuxResources = map[string]bool{ "uid": true, "pid": true, "gid": true, "timespec": true, "timeval": true, "time_sec": true, "time_usec": true, "time_nsec": true, } switch target.Arch { case "amd64": target.SpecialPointers = []uint64{ 0xffffffff81000000, // kernel text } case "386", "arm64", "arm", "ppc64le", "mips64le", "s390x", "riscv64": default: panic("unknown arch") } if target.Arch == runtime.GOARCH { KCOV_INIT_TRACE = uintptr(target.GetConst("KCOV_INIT_TRACE")) KCOV_ENABLE = uintptr(target.GetConst("KCOV_ENABLE")) KCOV_REMOTE_ENABLE = uintptr(target.GetConst("KCOV_REMOTE_ENABLE")) KCOV_DISABLE = uintptr(target.GetConst("KCOV_DISABLE")) KCOV_TRACE_PC = uintptr(target.GetConst("KCOV_TRACE_PC")) KCOV_TRACE_CMP = uintptr(target.GetConst("KCOV_TRACE_CMP")) } }
problem_1765.py
"""1765. Map of Highest Peak https://leetcode.com/problems/map-of-highest-peak/ """ from typing import List class Solution:
def highest_peak(self, is_water: List[List[int]]) -> List[List[int]]: m, n = len(is_water), len(is_water[0]) ans = [[-1] * n for _ in range(m)] q = [] for i in range(m): for j in range(n): if is_water[i][j]: ans[i][j] = 0 q.append([i, j]) while q: i, j = q.pop(0) for x, y in [[i - 1, j], [i + 1, j], [i, j - 1], [i, j + 1]]: if 0 <= x < m and 0 <= y < n and ans[x][y] == -1: ans[x][y] = ans[i][j] + 1 q.append([x, y]) return ans
setting.rs
use crate::font::{Font, LigaturesFlag}; /// How to make changes to an app. /// /// The state of having neither a font nor a ligatures flag is not possible. /// This type makes that state unrepresentable, avoiding needing to do awkward /// error handling for a state that can't happen. #[derive(Clone, Copy, Debug)] pub enum Setting<'a> { /// Only set the font. Font(Font<'a>), /// Only set orthographic ligatures. Ligatures(LigaturesFlag), /// Set both the font and orthographic ligatures. Both { font: Font<'a>, ligatures: LigaturesFlag, }, } impl<'a> Setting<'a> { pub fn new( font: Option<Font<'a>>, ligatures: Option<LigaturesFlag>, ) -> Option<Self> { match (font, ligatures) { (Some(font), Some(ligatures)) => { Some(Self::Both { font, ligatures }) } (Some(font), None) => Some(Self::Font(font)), (None, Some(ligatures)) => Some(Self::Ligatures(ligatures)), (None, None) => None, } } pub fn font(&self) -> Option<&Font<'a>> { match self { Self::Font(font) | Self::Both { font, .. } => Some(font), _ => None, } } pub fn ligatures(&self) -> Option<LigaturesFlag>
}
{ match *self { Self::Ligatures(ligatures) | Self::Both { ligatures, .. } => { Some(ligatures) } _ => None, } }
FinancialStatements.js
/** * Finnhub API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ import ApiClient from '../ApiClient'; /** * The FinancialStatements model module. * @module model/FinancialStatements * @version 1.2.7 */ class FinancialStatements { /** * Constructs a new <code>FinancialStatements</code>. * @alias module:model/FinancialStatements */ constructor() { FinancialStatements.initialize(this); } /** * Initializes the fields of this object. * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ static initialize(obj) { } /** * Constructs a <code>FinancialStatements</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {module:model/FinancialStatements} obj Optional instance to populate. * @return {module:model/FinancialStatements} The populated <code>FinancialStatements</code> instance.
if (data) { obj = obj || new FinancialStatements(); if (data.hasOwnProperty('symbol')) { obj['symbol'] = ApiClient.convertToType(data['symbol'], 'String'); } if (data.hasOwnProperty('financials')) { obj['financials'] = ApiClient.convertToType(data['financials'], [Object]); } } return obj; } } /** * Symbol of the company. * @member {String} symbol */ FinancialStatements.prototype['symbol'] = undefined; /** * An array of map of key, value pairs containing the data for each period. * @member {Array.<Object>} financials */ FinancialStatements.prototype['financials'] = undefined; export default FinancialStatements;
*/ static constructFromObject(data, obj) {