text:
import requests

class mattermark:
    COMPANIES_URL = "https://api.mattermark.com/companies"
    INVESTOR_URL = "https://api.mattermark.com/investors"
    SEARCH_URL = "https://api.mattermark.com/search"
    FUNDING_URL = "https://api.mattermark.com/fundings"
    queries = 0

    #
    # Initialization function
    #
    def __init__(self, api_key):
        self.api_key = api_key
        payload = {"key": self.api_key}
        if(requests.get(self.COMPANIES_URL, params=payload).status_code == 403):
            raise ValueError("Invalid API key")
        else:
            self.queries += 1

    #
    # Searches for a company and returns a dictionary of results
    #
    def companySearch(self, company):
        payload = {"key": self.api_key, "term": company, "object_types": "company"}
        result = requests.get(self.SEARCH_URL, params=payload)
        self.queries += 1
        return result.json()

    #
    # Searches for an investor and returns a dictionary of results
    #
    def investorSearch(self, investor):
        payload = {"key": self.api_key, "term": investor, "object_types": "investor"}
        result = requests.get(self.SEARCH_URL, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a list of companies that match the given parameters
    #
    def companiesList(self, parameters, Pages=1):
        company_list = []
        parameters["key"] = self.api_key
        result = requests.get(self.COMPANIES_URL, params=parameters)
        self.queries += 1
        results_p1 = result.json()
        # Add companies to master list
        for company in results_p1["companies"]:
            company_list.append(company)
        # Deal with paging if specified
        if(results_p1["meta"]["total_pages"] > 1 and Pages > 1):
            if(Pages < results_p1["meta"]["total_pages"]):
                Pages = results_p1["meta"]["total_pages"]
            for i in range(2, Pages+1):
                parameters["page"] = i
                result = requests.get(self.COMPANIES_URL, params=parameters)
                self.queries += 1
                results = result.json()
                for company in results["companies"]:
                    company_list.append(company)
        return company_list

    #
    # Returns a dictionary of basic mattermark metadata for a list company by domain
    # 'https://api.mattermark.com/companies/?key=[YOUR KEY]&domain=facebook.com'
    #
    def companyBussinessNamebyDomain(self, domain):
        company_url = self.COMPANIES_URL
        payload = {"key": self.api_key, "domain": domain}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a dictionary of basic mattermark metadata for a list company by company name
    # 'https://api.mattermark.com/companies/?key=[YOUR KEY]&company_name=facebook'
    #
    def companyBussinessNamebyName(self, company_name):
        company_url = self.COMPANIES_URL
        payload = {"key": self.api_key, "company_name": company_name}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a dictionary of details about a company given the ID
    #
    def companyDetails(self, companyID):
        company_url = self.COMPANIES_URL + "/" + str(companyID)
        payload = {"key": self.api_key}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a dictionary of news stories about a company
    #
    def companyNews(self, companyID):
        company_url = self.COMPANIES_URL + "/" + str(companyID) + "/stories"
        payload = {"key": self.api_key}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a list of 20 most similar companies
    #
    def similarCompanies(self, companyID):
        company_url = self.COMPANIES_URL + "/" + str(companyID) + "/similar"
        payload = {"key": self.api_key}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Returns a dictionary of important people at the company
    #
    def companyPersonnel(self, companyID):
        company_url = self.COMPANIES_URL + "/" + str(companyID) + "/people"
        payload = {"key": self.api_key}
        result = requests.get(company_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Gets all of the funding events from a certain day
    #
    def fundingEvents(self, Pages=1):
        funding_list = []
        payload = {"key": self.api_key}
        result = requests.get(self.FUNDING_URL, params=payload)
        self.queries += 1
        results_p1 = result.json()
        # Add the fundings to a master list
        for funding in results_p1["fundings"]:
            funding_list.append(funding)
        # Deal with paging
        if(results_p1["meta"]["total_pages"] > 1 and Pages > 1):
            if(Pages > results_p1["meta"]["total_pages"]):
                Pages = results_p1["meta"]["total_pages"]
            for i in range(2, Pages+1):
                payload["page"] = i
                result = requests.get(self.FUNDING_URL, params=payload)
                self.queries += 1
                results = result.json()
                for funding in results["fundings"]:
                    funding_list.append(funding)
        return funding_list

    #
    # Returns the details about an investor given their id as a dictionary
    #
    def investorDetails(self, investorID):
        investor_url = self.INVESTOR_URL + "/" + str(investorID)
        payload = {"key": self.api_key}
        result = requests.get(investor_url, params=payload)
        self.queries += 1
        return result.json()

    #
    # Return a list of the companies in the investor's portfolio
    #
    def investorPortfolio(self, investorID, Paging=True):
        company_list = []
        url = self.INVESTOR_URL + "/" + str(investorID) + "/portfolio"
        payload = {"key": self.api_key}
        result = requests.get(url, params=payload)
        self.queries += 1
        results_p1 = result.json()
        # Add each company to the list
        for company in results_p1["companies"]:
            company_list.append(company)
        # Deal with paging
        if(results_p1["meta"]["total_pages"] > 1 and Paging == True):
            for i in range(2, results_p1["meta"]["total_pages"]+1):
                payload = {"key": self.api_key, "page": i}
                result = requests.get(url, params=payload)
                self.queries += 1
                results = result.json()
                for company in results["companies"]:
                    company_list.append(company)
        return company_list


text:
package com.hazelcast.core;

import com.hazelcast.instance.AbstractOutOfMemoryHandlerTest;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertTrue;

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelTest.class})
public class OutOfMemoryHandlerTest extends AbstractOutOfMemoryHandlerTest {

    TestOutOfMemoryHandler outOfMemoryHandler;

    @Before
    public void setUp() throws Exception {
        initHazelcastInstances();

        outOfMemoryHandler = new TestOutOfMemoryHandler();
    }

    @Test
    public void testShouldHandle() throws Exception {
        assertTrue(outOfMemoryHandler.shouldHandle(new OutOfMemoryError()));
    }

    @Test
    public void testTryCloseConnections() {
        outOfMemoryHandler.closeConnections(hazelcastInstance);
    }

    @Test
    public void testTryCloseConnections_shouldDoNothingWithNullInstance() {
        outOfMemoryHandler.closeConnections(null);
    }

    @Test
    public void testTryCloseConnections_shouldDoNothingWhenThrowableIsThrown() {
        outOfMemoryHandler.closeConnections(hazelcastInstanceThrowsException);
    }

    @Test
    public void testTryShutdown() {
        outOfMemoryHandler.shutdown(hazelcastInstance);
    }

    @Test
    public void testTryShutdown_shouldDoNothingWithNullInstance() {
        outOfMemoryHandler.shutdown(null);
    }

    @Test
    public void testTryShutdown_shouldDoNothingWhenThrowableIsThrown() {
        outOfMemoryHandler.shutdown(hazelcastInstanceThrowsException);
    }

    @Test
    public void testTryStopThreads() {
        outOfMemoryHandler.stopThreads(hazelcastInstance);
    }

    @Test
    public void testTryStopThreads_shouldDoNothingWithNullInstance() {
        outOfMemoryHandler.stopThreads(null);
    }

    static class TestOutOfMemoryHandler extends OutOfMemoryHandler {

        void closeConnections(HazelcastInstance hazelcastInstance) {
            tryCloseConnections(hazelcastInstance);
        }

        void shutdown(HazelcastInstance hazelcastInstance) {
            tryShutdown(hazelcastInstance);
        }

        void stopThreads(HazelcastInstance hazelcastInstance) {
            tryStopThreads(hazelcastInstance);
        }

        @Override
        public void onOutOfMemory(OutOfMemoryError oome, HazelcastInstance[] hazelcastInstances) {
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict'

const NullFactory = require('./null')

class ValueFactory extends NullFactory {
  constructor (value) {
    super()

    this.value = value
  }

  createInstance () {
    return this.value
  }
}

module.exports = ValueFactory


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/temperature_image"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_marginLeft="5dp"
        android:layout_gravity="center_vertical"
        />

    <TextView
        android:id="@+id/city_name"
        android:layout_width="40dp"
        android:layout_height="20dp"
        android:layout_toRightOf="@id/temperature_image"
        android:layout_gravity="center_vertical"
        android:gravity="center"
        />
    <TextView
        android:id="@+id/min_max_temperature"
        android:layout_width="wrap_content"
        android:layout_height="20dp"
        android:layout_gravity="center_vertical"
        android:layout_alignParentRight="true"
        android:layout_marginRight="5dp"
        android:gravity="center"
        />

</RelativeLayout>


text:
module Spree
  module StoreHelper

    # helper to determine if its appropriate to show the store menu
    def store_menu?
      %w{thank_you}.exclude? params[:action]
    end

    def cache_key_for_taxons
      max_updated_at = @taxons.maximum(:updated_at).to_i
      parts = [@taxon.try(:id), max_updated_at].compact.join("-")
      "taxons/#{parts}"
    end
  end
end


text:
import warnings

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

from ._core import (
    VectorPlotter,
)
from .utils import (
    locator_to_legend_entries,
    adjust_legend_subtitles,
    _default_color,
    _deprecate_ci,
)
from ._statistics import EstimateAggregator
from .axisgrid import FacetGrid, _facet_docs
from ._decorators import _deprecate_positional_args
from ._docstrings import (
    DocstringComponents,
    _core_docs,
)

__all__ = ["relplot", "scatterplot", "lineplot"]

_relational_narrative = DocstringComponents(dict(

    # ---  Introductory prose
    main_api="""
The relationship between ``x`` and ``y`` can be shown for different subsets
of the data using the ``hue``, ``size``, and ``style`` parameters. These
parameters control what visual semantics are used to identify the different
subsets. It is possible to show up to three dimensions independently by
using all three semantic types, but this style of plot can be hard to
interpret and is often ineffective. Using redundant semantics (i.e. both
``hue`` and ``style`` for the same variable) can be helpful for making
graphics more accessible.

See the :ref:`tutorial <relational_tutorial>` for more information.
    """,

    relational_semantic="""
The default treatment of the ``hue`` (and to a lesser extent, ``size``)
semantic, if present, depends on whether the variable is inferred to
represent "numeric" or "categorical" data. In particular, numeric variables
are represented with a sequential colormap by default, and the legend
entries show regular "ticks" with values that may or may not exist in the
data. This behavior can be controlled through various parameters, as
described and illustrated below.
    """,
))

_relational_docs = dict(

    # --- Shared function parameters
    data_vars="""
x, y : names of variables in ``data`` or vector data
    Input data variables; must be numeric. Can pass data directly or
    reference columns in ``data``.
    """,
    data="""
data : DataFrame, array, or list of arrays
    Input data structure. If ``x`` and ``y`` are specified as names, this
    should be a "long-form" DataFrame containing those columns. Otherwise
    it is treated as "wide-form" data and grouping variables are ignored.
    See the examples for the various ways this parameter can be specified
    and the different effects of each.
    """,
    palette="""
palette : string, list, dict, or matplotlib colormap
    An object that determines how colors are chosen when ``hue`` is used.
    It can be the name of a seaborn palette or matplotlib colormap, a list
    of colors (anything matplotlib understands), a dict mapping levels
    of the ``hue`` variable to colors, or a matplotlib colormap object.
    """,
    hue_order="""
hue_order : list
    Specified order for the appearance of the ``hue`` variable levels,
    otherwise they are determined from the data. Not relevant when the
    ``hue`` variable is numeric.
    """,
    hue_norm="""
hue_norm : tuple or :class:`matplotlib.colors.Normalize` object
    Normalization in data units for colormap applied to the ``hue``
    variable when it is numeric. Not relevant if it is categorical.
    """,
    sizes="""
sizes : list, dict, or tuple
    An object that determines how sizes are chosen when ``size`` is used.
    It can always be a list of size values or a dict mapping levels of the
    ``size`` variable to sizes. When ``size``  is numeric, it can also be
    a tuple specifying the minimum and maximum size to use such that other
    values are normalized within this range.
    """,
    size_order="""
size_order : list
    Specified order for appearance of the ``size`` variable levels,
    otherwise they are determined from the data. Not relevant when the
    ``size`` variable is numeric.
    """,
    size_norm="""
size_norm : tuple or Normalize object
    Normalization in data units for scaling plot objects when the
    ``size`` variable is numeric.
    """,
    dashes="""
dashes : boolean, list, or dictionary
    Object determining how to draw the lines for different levels of the
    ``style`` variable. Setting to ``True`` will use default dash codes, or
    you can pass a list of dash codes or a dictionary mapping levels of the
    ``style`` variable to dash codes. Setting to ``False`` will use solid
    lines for all subsets. Dashes are specified as in matplotlib: a tuple
    of ``(segment, gap)`` lengths, or an empty string to draw a solid line.
    """,
    markers="""
markers : boolean, list, or dictionary
    Object determining how to draw the markers for different levels of the
    ``style`` variable. Setting to ``True`` will use default markers, or
    you can pass a list of markers or a dictionary mapping levels of the
    ``style`` variable to markers. Setting to ``False`` will draw
    marker-less lines.  Markers are specified as in matplotlib.
    """,
    style_order="""
style_order : list
    Specified order for appearance of the ``style`` variable levels
    otherwise they are determined from the data. Not relevant when the
    ``style`` variable is numeric.
    """,
    units="""
units : vector or key in ``data``
    Grouping variable identifying sampling units. When used, a separate
    line will be drawn for each unit with appropriate semantics, but no
    legend entry will be added. Useful for showing distribution of
    experimental replicates when exact identities are not needed.
    """,
    estimator="""
estimator : name of pandas method or callable or None
    Method for aggregating across multiple observations of the ``y``
    variable at the same ``x`` level. If ``None``, all observations will
    be drawn.
    """,
    ci="""
ci : int or "sd" or None
    Size of the confidence interval to draw when aggregating.

    .. deprecated:: 0.12.0
        Use the new `errorbar` parameter for more flexibility.

    """,
    n_boot="""
n_boot : int
    Number of bootstraps to use for computing the confidence interval.
    """,
    seed="""
seed : int, numpy.random.Generator, or numpy.random.RandomState
    Seed or random number generator for reproducible bootstrapping.
    """,
    legend="""
legend : "auto", "brief", "full", or False
    How to draw the legend. If "brief", numeric ``hue`` and ``size``
    variables will be represented with a sample of evenly spaced values.
    If "full", every group will get an entry in the legend. If "auto",
    choose between brief or full representation based on number of levels.
    If ``False``, no legend data is added and no legend is drawn.
    """,
    ax_in="""
ax : matplotlib Axes
    Axes object to draw the plot onto, otherwise uses the current Axes.
    """,
    ax_out="""
ax : matplotlib Axes
    Returns the Axes object with the plot drawn onto it.
    """,

)

_param_docs = DocstringComponents.from_nested_components(
    core=_core_docs["params"],
    facets=DocstringComponents(_facet_docs),
    rel=DocstringComponents(_relational_docs),
    stat=DocstringComponents.from_function_params(EstimateAggregator.__init__),
)

class _RelationalPlotter(VectorPlotter):

    wide_structure = {
        "x": "@index", "y": "@values", "hue": "@columns", "style": "@columns",
    }

    # TODO where best to define default parameters?
    sort = True

    def add_legend_data(self, ax):
        """Add labeled artists to represent the different plot semantics."""
        verbosity = self.legend
        if isinstance(verbosity, str) and verbosity not in ["auto", "brief", "full"]:
            err = "`legend` must be 'auto', 'brief', 'full', or a boolean."
            raise ValueError(err)
        elif verbosity is True:
            verbosity = "auto"

        legend_kwargs = {}
        keys = []

        # Assign a legend title if there is only going to be one sub-legend,
        # otherwise, subtitles will be inserted into the texts list with an
        # invisible handle (which is a hack)
        titles = {
            title for title in
            (self.variables.get(v, None) for v in ["hue", "size", "style"])
            if title is not None
        }
        if len(titles) == 1:
            legend_title = titles.pop()
        else:
            legend_title = ""

        title_kws = dict(
            visible=False, color="w", s=0, linewidth=0, marker="", dashes=""
        )

        def update(var_name, val_name, **kws):

            key = var_name, val_name
            if key in legend_kwargs:
                legend_kwargs[key].update(**kws)
            else:
                keys.append(key)

                legend_kwargs[key] = dict(**kws)

        # Define the maximum number of ticks to use for "brief" legends
        brief_ticks = 6

        # -- Add a legend for hue semantics
        brief_hue = self._hue_map.map_type == "numeric" and (
            verbosity == "brief"
            or (verbosity == "auto" and len(self._hue_map.levels) > brief_ticks)
        )
        if brief_hue:
            if isinstance(self._hue_map.norm, mpl.colors.LogNorm):
                locator = mpl.ticker.LogLocator(numticks=brief_ticks)
            else:
                locator = mpl.ticker.MaxNLocator(nbins=brief_ticks)
            limits = min(self._hue_map.levels), max(self._hue_map.levels)
            hue_levels, hue_formatted_levels = locator_to_legend_entries(
                locator, limits, self.plot_data["hue"].infer_objects().dtype
            )
        elif self._hue_map.levels is None:
            hue_levels = hue_formatted_levels = []
        else:
            hue_levels = hue_formatted_levels = self._hue_map.levels

        # Add the hue semantic subtitle
        if not legend_title and self.variables.get("hue", None) is not None:
            update((self.variables["hue"], "title"),
                   self.variables["hue"], **title_kws)

        # Add the hue semantic labels
        for level, formatted_level in zip(hue_levels, hue_formatted_levels):
            if level is not None:
                color = self._hue_map(level)
                update(self.variables["hue"], formatted_level, color=color)

        # -- Add a legend for size semantics
        brief_size = self._size_map.map_type == "numeric" and (
            verbosity == "brief"
            or (verbosity == "auto" and len(self._size_map.levels) > brief_ticks)
        )
        if brief_size:
            # Define how ticks will interpolate between the min/max data values
            if isinstance(self._size_map.norm, mpl.colors.LogNorm):
                locator = mpl.ticker.LogLocator(numticks=brief_ticks)
            else:
                locator = mpl.ticker.MaxNLocator(nbins=brief_ticks)
            # Define the min/max data values
            limits = min(self._size_map.levels), max(self._size_map.levels)
            size_levels, size_formatted_levels = locator_to_legend_entries(
                locator, limits, self.plot_data["size"].infer_objects().dtype
            )
        elif self._size_map.levels is None:
            size_levels = size_formatted_levels = []
        else:
            size_levels = size_formatted_levels = self._size_map.levels

        # Add the size semantic subtitle
        if not legend_title and self.variables.get("size", None) is not None:
            update((self.variables["size"], "title"),
                   self.variables["size"], **title_kws)

        # Add the size semantic labels
        for level, formatted_level in zip(size_levels, size_formatted_levels):
            if level is not None:
                size = self._size_map(level)
                update(
                    self.variables["size"],
                    formatted_level,
                    linewidth=size,
                    s=size,
                )

        # -- Add a legend for style semantics

        # Add the style semantic title
        if not legend_title and self.variables.get("style", None) is not None:
            update((self.variables["style"], "title"),
                   self.variables["style"], **title_kws)

        # Add the style semantic labels
        if self._style_map.levels is not None:
            for level in self._style_map.levels:
                if level is not None:
                    attrs = self._style_map(level)
                    update(
                        self.variables["style"],
                        level,
                        marker=attrs.get("marker", ""),
                        dashes=attrs.get("dashes", ""),
                    )

        func = getattr(ax, self._legend_func)

        legend_data = {}
        legend_order = []

        for key in keys:

            _, label = key
            kws = legend_kwargs[key]
            kws.setdefault("color", ".2")
            use_kws = {}
            for attr in self._legend_attributes + ["visible"]:
                if attr in kws:
                    use_kws[attr] = kws[attr]
            artist = func([], [], label=label, **use_kws)
            if self._legend_func == "plot":
                artist = artist[0]
            legend_data[key] = artist
            legend_order.append(key)

        self.legend_title = legend_title
        self.legend_data = legend_data
        self.legend_order = legend_order

class _LinePlotter(_RelationalPlotter):

    _legend_attributes = ["color", "linewidth", "marker", "dashes"]
    _legend_func = "plot"

    def __init__(
        self, *,
        data=None, variables={},
        estimator=None, ci=None, n_boot=None, seed=None,
        sort=True, err_style=None, err_kws=None, legend=None,
        errorbar=None,
    ):

        # TODO this is messy, we want the mapping to be agnostic about
        # the kind of plot to draw, but for the time being we need to set
        # this information so the SizeMapping can use it
        self._default_size_range = (
            np.r_[.5, 2] * mpl.rcParams["lines.linewidth"]
        )

        super().__init__(data=data, variables=variables)

        self.estimator = estimator
        self.errorbar = errorbar
        self.ci = ci
        self.n_boot = n_boot
        self.seed = seed
        self.sort = sort
        self.err_style = err_style
        self.err_kws = {} if err_kws is None else err_kws

        self.legend = legend

    def plot(self, ax, kws):
        """Draw the plot onto an axes, passing matplotlib kwargs."""

        # Draw a test plot, using the passed in kwargs. The goal here is to
        # honor both (a) the current state of the plot cycler and (b) the
        # specified kwargs on all the lines we will draw, overriding when
        # relevant with the data semantics. Note that we won't cycle
        # internally; in other words, if ``hue`` is not used, all elements will
        # have the same color, but they will have the color that you would have
        # gotten from the corresponding matplotlib function, and calling the
        # function will advance the axes property cycle.

        kws.setdefault("markeredgewidth", kws.pop("mew", .75))
        kws.setdefault("markeredgecolor", kws.pop("mec", "w"))

        # Set default error kwargs
        err_kws = self.err_kws.copy()
        if self.err_style == "band":
            err_kws.setdefault("alpha", .2)
        elif self.err_style == "bars":
            pass
        elif self.err_style is not None:
            err = "`err_style` must be 'band' or 'bars', not {}"
            raise ValueError(err.format(self.err_style))

        # Initialize the aggregation object
        agg = EstimateAggregator(
            self.estimator, self.errorbar, n_boot=self.n_boot, seed=self.seed,
        )

        # TODO abstract variable to aggregate over here-ish. Better name?
        agg_var = "y"
        grouper = ["x"]

        # TODO How to handle NA? We don't want NA to propagate through to the
        # estimate/CI when some values are present, but we would also like
        # matplotlib to show "gaps" in the line when all values are missing.
        # This is straightforward absent aggregation, but complicated with it.
        # If we want to use nas, we need to conditionalize dropna in iter_data.

        # Loop over the semantic subsets and add to the plot
        grouping_vars = "hue", "size", "style"
        for sub_vars, sub_data in self.iter_data(grouping_vars, from_comp_data=True):

            if self.sort:
                sort_vars = ["units", "x", "y"]
                sort_cols = [var for var in sort_vars if var in self.variables]
                sub_data = sub_data.sort_values(sort_cols)

            if self.estimator is not None:
                if "units" in self.variables:
                    # TODO eventually relax this constraint
                    err = "estimator must be None when specifying units"
                    raise ValueError(err)
                grouped = sub_data.groupby(grouper, sort=self.sort)
                # Could pass as_index=False instead of reset_index,
                # but that fails on a corner case with older pandas.
                sub_data = grouped.apply(agg, agg_var).reset_index()

            # TODO this is pretty ad hoc ; see GH2409
            for var in "xy":
                if self._log_scaled(var):
                    for col in sub_data.filter(regex=f"^{var}"):
                        sub_data[col] = np.power(10, sub_data[col])

            # --- Draw the main line(s)

            if "units" in self.variables:   # XXX why not add to grouping variables?
                lines = []
                for _, unit_data in sub_data.groupby("units"):
                    lines.extend(ax.plot(unit_data["x"], unit_data["y"], **kws))
            else:
                lines = ax.plot(sub_data["x"], sub_data["y"], **kws)

            for line in lines:

                if "hue" in sub_vars:
                    line.set_color(self._hue_map(sub_vars["hue"]))

                if "size" in sub_vars:
                    line.set_linewidth(self._size_map(sub_vars["size"]))

                if "style" in sub_vars:
                    attributes = self._style_map(sub_vars["style"])
                    if "dashes" in attributes:
                        line.set_dashes(attributes["dashes"])
                    if "marker" in attributes:
                        line.set_marker(attributes["marker"])

            line_color = line.get_color()
            line_alpha = line.get_alpha()
            line_capstyle = line.get_solid_capstyle()

            # --- Draw the confidence intervals

            if self.estimator is not None and self.errorbar is not None:

                # TODO handling of orientation will need to happen here

                if self.err_style == "band":

                    ax.fill_between(
                        sub_data["x"], sub_data["ymin"], sub_data["ymax"],
                        color=line_color, **err_kws
                    )

                elif self.err_style == "bars":

                    error_deltas = (
                        sub_data["y"] - sub_data["ymin"],
                        sub_data["ymax"] - sub_data["y"],
                    )
                    ebars = ax.errorbar(
                        sub_data["x"], sub_data["y"], error_deltas,
                        linestyle="", color=line_color, alpha=line_alpha,
                        **err_kws
                    )

                    # Set the capstyle properly on the error bars
                    for obj in ebars.get_children():
                        if isinstance(obj, mpl.collections.LineCollection):
                            obj.set_capstyle(line_capstyle)

        # Finalize the axes details
        self._add_axis_labels(ax)
        if self.legend:
            self.add_legend_data(ax)
            handles, _ = ax.get_legend_handles_labels()
            if handles:
                legend = ax.legend(title=self.legend_title)
                adjust_legend_subtitles(legend)

class _ScatterPlotter(_RelationalPlotter):

    _legend_attributes = ["color", "s", "marker"]
    _legend_func = "scatter"

    def __init__(
        self, *,
        data=None, variables={},
        x_bins=None, y_bins=None,
        estimator=None, ci=None, n_boot=None,
        alpha=None, x_jitter=None, y_jitter=None,
        legend=None
    ):

        # TODO this is messy, we want the mapping to be agnoistic about
        # the kind of plot to draw, but for the time being we need to set
        # this information so the SizeMapping can use it
        self._default_size_range = (
            np.r_[.5, 2] * np.square(mpl.rcParams["lines.markersize"])
        )

        super().__init__(data=data, variables=variables)

        self.alpha = alpha
        self.legend = legend

    def plot(self, ax, kws):

        # --- Determine the visual attributes of the plot

        data = self.plot_data.dropna()
        if data.empty:
            return

        # Define the vectors of x and y positions
        empty = np.full(len(data), np.nan)
        x = data.get("x", empty)
        y = data.get("y", empty)

        # Set defaults for other visual attributes
        kws.setdefault("edgecolor", "w")

        if "style" in self.variables:
            # Use a representative marker so scatter sets the edgecolor
            # properly for line art markers. We currently enforce either
            # all or none line art so this works.
            example_level = self._style_map.levels[0]
            example_marker = self._style_map(example_level, "marker")
            kws.setdefault("marker", example_marker)

        # TODO this makes it impossible to vary alpha with hue which might
        # otherwise be useful? Should we just pass None?
        kws["alpha"] = 1 if self.alpha == "auto" else self.alpha

        # Draw the scatter plot
        points = ax.scatter(x=x, y=y, **kws)

        # Apply the mapping from semantic variables to artist attributes

        if "hue" in self.variables:
            points.set_facecolors(self._hue_map(data["hue"]))

        if "size" in self.variables:
            points.set_sizes(self._size_map(data["size"]))

        if "style" in self.variables:
            p = [self._style_map(val, "path") for val in data["style"]]
            points.set_paths(p)

        # Apply dependant default attributes

        if "linewidth" not in kws:
            sizes = points.get_sizes()
            points.set_linewidths(.08 * np.sqrt(np.percentile(sizes, 10)))

        # Finalize the axes details
        self._add_axis_labels(ax)
        if self.legend:
            self.add_legend_data(ax)
            handles, _ = ax.get_legend_handles_labels()
            if handles:
                legend = ax.legend(title=self.legend_title)
                adjust_legend_subtitles(legend)

@_deprecate_positional_args
def lineplot(
    *,
    x=None, y=None,
    hue=None, size=None, style=None,
    data=None,
    palette=None, hue_order=None, hue_norm=None,
    sizes=None, size_order=None, size_norm=None,
    dashes=True, markers=None, style_order=None,
    units=None, estimator="mean", ci="deprecated", n_boot=1000, seed=None,
    sort=True, err_style="band", err_kws=None,
    legend="auto",
    errorbar=("ci", 95),
    ax=None, **kwargs
):

    # Handle deprecation of ci parameter
    errorbar = _deprecate_ci(errorbar, ci)

    variables = _LinePlotter.get_semantics(locals())
    p = _LinePlotter(
        data=data, variables=variables,
        estimator=estimator, ci=ci, n_boot=n_boot, seed=seed,
        sort=sort, err_style=err_style, err_kws=err_kws, legend=legend,
        errorbar=errorbar,
    )

    p.map_hue(palette=palette, order=hue_order, norm=hue_norm)
    p.map_size(sizes=sizes, order=size_order, norm=size_norm)
    p.map_style(markers=markers, dashes=dashes, order=style_order)

    if ax is None:
        ax = plt.gca()

    if style is None and not {"ls", "linestyle"} & set(kwargs):  # XXX
        kwargs["dashes"] = "" if dashes is None or isinstance(dashes, bool) else dashes

    if not p.has_xy_data:
        return ax

    p._attach(ax)

    # Other functions have color as an explicit param,
    # and we should probably do that here too
    color = kwargs.pop("color", kwargs.pop("c", None))
    kwargs["color"] = _default_color(ax.plot, hue, color, kwargs)

    p.plot(ax, kwargs)
    return ax

lineplot.__doc__ = """\
Draw a line plot with possibility of several semantic groupings.

{narrative.main_api}

{narrative.relational_semantic}

By default, the plot aggregates over multiple ``y`` values at each value of
``x`` and shows an estimate of the central tendency and a confidence
interval for that estimate.

Parameters
----------
{params.core.xy}
hue : vector or key in ``data``
    Grouping variable that will produce lines with different colors.
    Can be either categorical or numeric, although color mapping will
    behave differently in latter case.
size : vector or key in ``data``
    Grouping variable that will produce lines with different widths.
    Can be either categorical or numeric, although size mapping will
    behave differently in latter case.
style : vector or key in ``data``
    Grouping variable that will produce lines with different dashes
    and/or markers. Can have a numeric dtype but will always be treated
    as categorical.
{params.core.data}
{params.core.palette}
{params.core.hue_order}
{params.core.hue_norm}
{params.rel.sizes}
{params.rel.size_order}
{params.rel.size_norm}
{params.rel.dashes}
{params.rel.markers}
{params.rel.style_order}
{params.rel.units}
{params.rel.estimator}
{params.rel.ci}
{params.rel.n_boot}
{params.rel.seed}
sort : boolean
    If True, the data will be sorted by the x and y variables, otherwise
    lines will connect points in the order they appear in the dataset.
err_style : "band" or "bars"
    Whether to draw the confidence intervals with translucent error bands
    or discrete error bars.
err_kws : dict of keyword arguments
    Additional paramters to control the aesthetics of the error bars. The
    kwargs are passed either to :meth:`matplotlib.axes.Axes.fill_between`
    or :meth:`matplotlib.axes.Axes.errorbar`, depending on ``err_style``.
{params.rel.legend}
{params.stat.errorbar}
{params.core.ax}
kwargs : key, value mappings
    Other keyword arguments are passed down to
    :meth:`matplotlib.axes.Axes.plot`.

Returns
-------
{returns.ax}

See Also
--------
{seealso.scatterplot}
{seealso.pointplot}

Examples
--------

.. include:: ../docstrings/lineplot.rst

""".format(
    narrative=_relational_narrative,
    params=_param_docs,
    returns=_core_docs["returns"],
    seealso=_core_docs["seealso"],
)

@_deprecate_positional_args
def scatterplot(
    *,
    x=None, y=None,
    hue=None, style=None, size=None, data=None,
    palette=None, hue_order=None, hue_norm=None,
    sizes=None, size_order=None, size_norm=None,
    markers=True, style_order=None,
    x_bins=None, y_bins=None,
    units=None, estimator=None, ci=95, n_boot=1000,
    alpha=None, x_jitter=None, y_jitter=None,
    legend="auto", ax=None,
    **kwargs
):

    variables = _ScatterPlotter.get_semantics(locals())
    p = _ScatterPlotter(
        data=data, variables=variables,
        x_bins=x_bins, y_bins=y_bins,
        estimator=estimator, ci=ci, n_boot=n_boot,
        alpha=alpha, x_jitter=x_jitter, y_jitter=y_jitter, legend=legend,
    )

    p.map_hue(palette=palette, order=hue_order, norm=hue_norm)
    p.map_size(sizes=sizes, order=size_order, norm=size_norm)
    p.map_style(markers=markers, order=style_order)

    if ax is None:
        ax = plt.gca()

    if not p.has_xy_data:
        return ax

    p._attach(ax)

    # Other functions have color as an explicit param,
    # and we should probably do that here too
    color = kwargs.pop("color", None)
    kwargs["color"] = _default_color(ax.scatter, hue, color, kwargs)

    p.plot(ax, kwargs)

    return ax

scatterplot.__doc__ = """\
Draw a scatter plot with possibility of several semantic groupings.

{narrative.main_api}

{narrative.relational_semantic}

Parameters
----------
{params.core.xy}
hue : vector or key in ``data``
    Grouping variable that will produce points with different colors.
    Can be either categorical or numeric, although color mapping will
    behave differently in latter case.
size : vector or key in ``data``
    Grouping variable that will produce points with different sizes.
    Can be either categorical or numeric, although size mapping will
    behave differently in latter case.
style : vector or key in ``data``
    Grouping variable that will produce points with different markers.
    Can have a numeric dtype but will always be treated as categorical.
{params.core.data}
{params.core.palette}
{params.core.hue_order}
{params.core.hue_norm}
{params.rel.sizes}
{params.rel.size_order}
{params.rel.size_norm}
{params.rel.markers}
{params.rel.style_order}
{{x,y}}_bins : lists or arrays or functions
    *Currently non-functional.*
{params.rel.units}
    *Currently non-functional.*
{params.rel.estimator}
    *Currently non-functional.*
{params.rel.ci}
    *Currently non-functional.*
{params.rel.n_boot}
    *Currently non-functional.*
alpha : float
    Proportional opacity of the points.
{{x,y}}_jitter : booleans or floats
    *Currently non-functional.*
{params.rel.legend}
{params.core.ax}
kwargs : key, value mappings
    Other keyword arguments are passed down to
    :meth:`matplotlib.axes.Axes.scatter`.

Returns
-------
{returns.ax}

See Also
--------
{seealso.lineplot}
{seealso.stripplot}
{seealso.swarmplot}

Examples
--------

.. include:: ../docstrings/scatterplot.rst

""".format(
    narrative=_relational_narrative,
    params=_param_docs,
    returns=_core_docs["returns"],
    seealso=_core_docs["seealso"],
)

@_deprecate_positional_args
def relplot(
    *,
    x=None, y=None,
    hue=None, size=None, style=None, data=None,
    row=None, col=None,
    col_wrap=None, row_order=None, col_order=None,
    palette=None, hue_order=None, hue_norm=None,
    sizes=None, size_order=None, size_norm=None,
    markers=None, dashes=None, style_order=None,
    legend="auto", kind="scatter",
    height=5, aspect=1, facet_kws=None,
    units=None,
    **kwargs
):

    if kind == "scatter":

        plotter = _ScatterPlotter
        func = scatterplot
        markers = True if markers is None else markers

    elif kind == "line":

        plotter = _LinePlotter
        func = lineplot
        dashes = True if dashes is None else dashes

    else:
        err = "Plot kind {} not recognized".format(kind)
        raise ValueError(err)

    # Check for attempt to plot onto specific axes and warn
    if "ax" in kwargs:
        msg = (
            "relplot is a figure-level function and does not accept "
            "the `ax` parameter. You may wish to try {}".format(kind + "plot")
        )
        warnings.warn(msg, UserWarning)
        kwargs.pop("ax")

    # Use the full dataset to map the semantics
    p = plotter(
        data=data,
        variables=plotter.get_semantics(locals()),
        legend=legend,
    )
    p.map_hue(palette=palette, order=hue_order, norm=hue_norm)
    p.map_size(sizes=sizes, order=size_order, norm=size_norm)
    p.map_style(markers=markers, dashes=dashes, order=style_order)

    # Extract the semantic mappings
    if "hue" in p.variables:
        palette = p._hue_map.lookup_table
        hue_order = p._hue_map.levels
        hue_norm = p._hue_map.norm
    else:
        palette = hue_order = hue_norm = None

    if "size" in p.variables:
        sizes = p._size_map.lookup_table
        size_order = p._size_map.levels
        size_norm = p._size_map.norm

    if "style" in p.variables:
        style_order = p._style_map.levels
        if markers:
            markers = {k: p._style_map(k, "marker") for k in style_order}
        else:
            markers = None
        if dashes:
            dashes = {k: p._style_map(k, "dashes") for k in style_order}
        else:
            dashes = None
    else:
        markers = dashes = style_order = None

    # Now extract the data that would be used to draw a single plot
    variables = p.variables
    plot_data = p.plot_data
    plot_semantics = p.semantics

    # Define the common plotting parameters
    plot_kws = dict(
        palette=palette, hue_order=hue_order, hue_norm=hue_norm,
        sizes=sizes, size_order=size_order, size_norm=size_norm,
        markers=markers, dashes=dashes, style_order=style_order,
        legend=False,
    )
    plot_kws.update(kwargs)
    if kind == "scatter":
        plot_kws.pop("dashes")

    # Add the grid semantics onto the plotter
    grid_semantics = "row", "col"
    p.semantics = plot_semantics + grid_semantics
    p.assign_variables(
        data=data,
        variables=dict(
            x=x, y=y,
            hue=hue, size=size, style=style, units=units,
            row=row, col=col,
        ),
    )

    # Define the named variables for plotting on each facet
    # Rename the variables with a leading underscore to avoid
    # collisions with faceting variable names
    plot_variables = {v: f"_{v}" for v in variables}
    plot_kws.update(plot_variables)

    # Pass the row/col variables to FacetGrid with their original
    # names so that the axes titles render correctly
    grid_kws = {v: p.variables.get(v, None) for v in grid_semantics}

    # Rename the columns of the plot_data structure appropriately
    new_cols = plot_variables.copy()
    new_cols.update(grid_kws)
    full_data = p.plot_data.rename(columns=new_cols)

    # Set up the FacetGrid object
    facet_kws = {} if facet_kws is None else facet_kws.copy()
    g = FacetGrid(
        data=full_data.dropna(axis=1, how="all"),
        **grid_kws,
        col_wrap=col_wrap, row_order=row_order, col_order=col_order,
        height=height, aspect=aspect, dropna=False,
        **facet_kws
    )

    # Draw the plot
    g.map_dataframe(func, **plot_kws)

    # Label the axes
    g.set_axis_labels(
        variables.get("x", None), variables.get("y", None)
    )

    # Show the legend
    if legend:
        # Replace the original plot data so the legend uses
        # numeric data with the correct type
        p.plot_data = plot_data
        p.add_legend_data(g.axes.flat[0])
        if p.legend_data:
            g.add_legend(legend_data=p.legend_data,
                         label_order=p.legend_order,
                         title=p.legend_title,
                         adjust_subtitles=True)

    # Rename the columns of the FacetGrid's `data` attribute
    # to match the original column names
    orig_cols = {
        f"_{k}": f"_{k}_" if v is None else v for k, v in variables.items()
    }
    g.data = g.data.rename(columns=orig_cols)

    return g

relplot.__doc__ = """\
Figure-level interface for drawing relational plots onto a FacetGrid.

This function provides access to several different axes-level functions
that show the relationship between two variables with semantic mappings
of subsets. The ``kind`` parameter selects the underlying axes-level
function to use:

- :func:`scatterplot` (with ``kind="scatter"``; the default)
- :func:`lineplot` (with ``kind="line"``)

Extra keyword arguments are passed to the underlying function, so you
should refer to the documentation for each to see kind-specific options.

{narrative.main_api}

{narrative.relational_semantic}

After plotting, the :class:`FacetGrid` with the plot is returned and can
be used directly to tweak supporting plot details or add other layers.

Note that, unlike when using the underlying plotting functions directly,
data must be passed in a long-form DataFrame with variables specified by
passing strings to ``x``, ``y``, and other parameters.

Parameters
----------
{params.core.xy}
hue : vector or key in ``data``
    Grouping variable that will produce elements with different colors.
    Can be either categorical or numeric, although color mapping will
    behave differently in latter case.
size : vector or key in ``data``
    Grouping variable that will produce elements with different sizes.
    Can be either categorical or numeric, although size mapping will
    behave differently in latter case.
style : vector or key in ``data``
    Grouping variable that will produce elements with different styles.
    Can have a numeric dtype but will always be treated as categorical.
{params.core.data}
{params.facets.rowcol}
{params.facets.col_wrap}
row_order, col_order : lists of strings
    Order to organize the rows and/or columns of the grid in, otherwise the
    orders are inferred from the data objects.
{params.core.palette}
{params.core.hue_order}
{params.core.hue_norm}
{params.rel.sizes}
{params.rel.size_order}
{params.rel.size_norm}
{params.rel.style_order}
{params.rel.dashes}
{params.rel.markers}
{params.rel.legend}
kind : string
    Kind of plot to draw, corresponding to a seaborn relational plot.
    Options are {{``scatter`` and ``line``}}.
{params.facets.height}
{params.facets.aspect}
facet_kws : dict
    Dictionary of other keyword arguments to pass to :class:`FacetGrid`.
{params.rel.units}
kwargs : key, value pairings
    Other keyword arguments are passed through to the underlying plotting
    function.

Returns
-------
{returns.facetgrid}

Examples
--------

.. include:: ../docstrings/relplot.rst

""".format(
    narrative=_relational_narrative,
    params=_param_docs,
    returns=_core_docs["returns"],
    seealso=_core_docs["seealso"],
)


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
           xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
           tools:ignore="MissingTranslation,TypographyDashes">

    <string name="danish_dictionary">Danish</string>

    <string name="danish_keyboard">Danish</string>
    <string name="danish_keyboard_description">QWERTY layout</string>
    <string name="danish_keyboard_dvorak">Danish</string>
    <string name="danish_keyboard_dvorak_description">Dvorak layout, implemented by snkfxx</string>
</resources>


text:
Shape Attributes for Binary Image
=================================

.. index::
   single: LabelImageToShapeLabelMapFilter

Synopsis
--------

Compute shape attributes for a binary image.

Results
-------
Output::

  File "Generated image" has 2 labels.
  Label: 1
  BoundingBox: ImageRegion (0x7fab2f0003b8)
  Dimension: 2
  Index: [20, 30]
  Size: [60, 70]

    NumberOfPixels: 4200
    PhysicalSize: 4200
    Centroid: [49.5, 64.5]
    NumberOfPixelsOnBorder: 0
    PerimeterOnBorder: 0
    FeretDiameter: 0
    PrincipalMoments: [299.917, 408.25]
    PrincipalAxes: 1 0
    0 1

    Elongation: 1.16671
    Perimeter: 245.385
    Roundness: 0.936229
    EquivalentSphericalRadius: 36.5637
    EquivalentSphericalPerimeter: 229.736
    EquivalentEllipsoidDiameter: [67.7015, 78.988]
    Flatness: 1.16671
    PerimeterOnBorderRatio: 0
  Label: 2
  BoundingBox: ImageRegion (0x7fab2ef00308)
  Dimension: 2
  Index: [100, 115]
  Size: [30, 45]

    NumberOfPixels: 1350
    PhysicalSize: 1350
    Centroid: [114.5, 137]
    NumberOfPixelsOnBorder: 0
    PerimeterOnBorder: 0
    FeretDiameter: 0
    PrincipalMoments: [74.9167, 168.667]
    PrincipalAxes: 1 0
    0 1

    Elongation: 1.50046
    Perimeter: 141.098
    Roundness: 0.923103
    EquivalentSphericalRadius: 20.7296
    EquivalentSphericalPerimeter: 130.248
    EquivalentEllipsoidDiameter: [33.8461, 50.7849]
    Flatness: 1.50046
    PerimeterOnBorderRatio: 0

Code
----

C++
...

.. literalinclude:: Code.cxx
   :lines: 18-

Classes demonstrated
--------------------

.. breathelink:: itk::LabelImageToShapeLabelMapFilter


text:
package com.intellij.openapi.vfs.newvfs.impl;

import com.intellij.diagnostic.telemetry.TraceManager;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.newvfs.persistent.FSRecords;
import com.intellij.util.IntSLRUCache;
import com.intellij.util.containers.IntObjectLRUMap;
import com.intellij.util.io.URLUtil;
import io.opentelemetry.api.metrics.Meter;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;

public final class FileNameCache {
  @SuppressWarnings("unchecked") private static final IntSLRUCache<CharSequence>[] ourNameCache = new IntSLRUCache[16];

  static {
    initialize();
  }

  public static void drop() {
    Arrays.fill(ourArrayCache, null);
    initialize();
  }

  private static void initialize() {
    final int protectedSize = 40000 / ourNameCache.length;
    final int probationalSize = 20000 / ourNameCache.length;
    for (int i = 0; i < ourNameCache.length; ++i) {
      ourNameCache[i] = new IntSLRUCache<>(protectedSize, probationalSize);
    }
  }

  private static final String FS_SEPARATORS = "/" + (File.separatorChar == '/' ? "" : File.separatorChar);

  public static int storeName(@NotNull String name) {
    assertShortFileName(name);
    final int idx = FSRecords.getNameId(name);
    cacheData(name, idx, calcStripeIdFromNameId(idx));
    return idx;
  }

  private static void assertShortFileName(@NotNull String name) {
    if (name.length() <= 1) return;
    int start = 0;
    int end = name.length();
    if (SystemInfo.isWindows && name.startsWith("//")) {  // Windows UNC: //Network/Ubuntu
      final int idx = name.indexOf('/', 2);
      start = idx == -1 ? 2 : idx + 1;
    }
    else if (name.charAt(0) == '/') {
      start = 1;
    }
    if (name.endsWith(URLUtil.SCHEME_SEPARATOR)) {
      end -= URLUtil.SCHEME_SEPARATOR.length();
    }
    if (StringUtil.containsAnyChar(name, FS_SEPARATORS, start, end)) {
      throw new IllegalArgumentException("Must not intern long path: '" + name + "'");
    }
  }

  @NotNull
  private static IntObjectLRUMap.MapEntry<CharSequence> cacheData(CharSequence name, int id, int stripe) {
    if (name == null) {
      FSRecords.handleError(new RuntimeException("VFS name enumerator corrupted"));
    }

    IntSLRUCache<CharSequence> cache = ourNameCache[stripe];
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (cache) {
      return cache.cacheEntry(id, name);
    }
  }

  private static int calcStripeIdFromNameId(int id) {
    int h = id;
    h -= h << 6;
    h ^= h >> 17;
    h -= h << 9;
    h ^= h << 4;
    h -= h << 3;
    h ^= h << 10;
    h ^= h >> 15;
    return h % ourNameCache.length;
  }

  private static final int ourLOneSize = 1024;
  @SuppressWarnings("unchecked")
  private static final IntObjectLRUMap.MapEntry<CharSequence>[] ourArrayCache = new IntObjectLRUMap.MapEntry[ourLOneSize];

  private static final boolean ourTrackStats = true;
  private static final AtomicInteger ourQueries = new AtomicInteger();
  private static final AtomicInteger ourFastCacheMisses = new AtomicInteger();
  private static final AtomicInteger ourTotalCacheMisses = new AtomicInteger();

  static {
    if (ourTrackStats) {
      setupReportingToOpenTelemetry();
    }
  }

  @FunctionalInterface
  public interface NameComputer {
    CharSequence compute(int id) throws IOException;
  }

  @NotNull
  private static CharSequence getVFileName(int nameId, @NotNull NameComputer computeName) throws IOException {
    assert nameId > 0 : nameId;

    if (ourTrackStats) {
      ourQueries.incrementAndGet();
    }

    int l1 = nameId % ourLOneSize;
    IntObjectLRUMap.MapEntry<CharSequence> entry = ourArrayCache[l1];
    if (entry != null && entry.key == nameId) {
      return entry.value;
    }

    if (ourTrackStats) {
      ourFastCacheMisses.incrementAndGet();
    }

    final int stripe = calcStripeIdFromNameId(nameId);
    IntSLRUCache<CharSequence> cache = ourNameCache[stripe];
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (cache) {
      entry = cache.getCachedEntry(nameId);
    }
    if (entry == null) {
      if (ourTrackStats) {
        ourTotalCacheMisses.incrementAndGet();
      }
      entry = cacheData(computeName.compute(nameId), nameId, stripe);
    }
    ourArrayCache[l1] = entry;
    return entry.value;
  }

  @NotNull
  public static CharSequence getVFileName(int nameId) {
    try {
      return getVFileName(nameId, FSRecords::getNameByNameId);
    }
    catch (IOException e) {
      throw new RuntimeException(e); // actually will be caught in getNameByNameId
    }
  }

  private static void setupReportingToOpenTelemetry() {
    final Meter meter = TraceManager.INSTANCE.getMeter("vfs");

    var queriesCounter = meter.counterBuilder("FileNameCache.queries").buildObserver();
    var fastMissesCounter = meter.counterBuilder("FileNameCache.fastMisses").buildObserver();
    var totalMissesCounter = meter.counterBuilder("FileNameCache.totalMisses").buildObserver();

    meter.batchCallback(() -> {
      queriesCounter.record(ourQueries.longValue());
      fastMissesCounter.record(ourFastCacheMisses.longValue());
      totalMissesCounter.record(ourTotalCacheMisses.longValue());
    }, queriesCounter, fastMissesCounter, totalMissesCounter);
  }
}


text:
#include <errno.h>

/*
 * Source file that declares the space for the global variable errno.
 *
 * We also declare the space for __argv, which is used by the err*
 * functions, and __environ, which is used by getenv(). Since these
 * are set by crt0, they are always referenced in every program;
 * putting them here prevents gratuitously linking all the err* and
 * warn* functions (and thus printf) into every program.
 */

char **__argv;
char **__environ;

int errno;


text:
package org.apache.zookeeper.test;

import static org.apache.zookeeper.test.ClientBase.CONNECTION_TIMEOUT;

import java.io.IOException;
import java.util.LinkedList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZKTestCase;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.AsyncCallback.DataCallback;
import org.apache.zookeeper.AsyncCallback.StringCallback;
import org.apache.zookeeper.AsyncCallback.VoidCallback;
import org.apache.zookeeper.KeeperException.Code;
import org.apache.zookeeper.Watcher.Event.KeeperState;
import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.data.Stat;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class AsyncTest extends ZKTestCase
    implements StringCallback, VoidCallback, DataCallback
{
    private static final Logger LOG = LoggerFactory.getLogger(AsyncTest.class);

    private QuorumBase qb = new QuorumBase();

    @Before
    public void setUp() throws Exception {
        qb.setUp();
    }

    public void restart() throws Exception {
        JMXEnv.setUp();
        qb.startServers();
    }

    @After
    public void tearDown() throws Exception {
        LOG.info("Test clients shutting down");
        qb.tearDown();
    }

    private static class CountdownWatcher implements Watcher {
        volatile CountDownLatch clientConnected = new CountDownLatch(1);

        public void process(WatchedEvent event) {
            if (event.getState() == KeeperState.SyncConnected) {
                clientConnected.countDown();
            }
        }
    }

    private ZooKeeper createClient() throws IOException,InterruptedException {
        return createClient(qb.hostPort);
    }

    private ZooKeeper createClient(String hp)
        throws IOException, InterruptedException
    {
        CountdownWatcher watcher = new CountdownWatcher();
        ZooKeeper zk = new ZooKeeper(hp, CONNECTION_TIMEOUT, watcher);
        if(!watcher.clientConnected.await(CONNECTION_TIMEOUT,
                TimeUnit.MILLISECONDS))
        {
            Assert.fail("Unable to connect to server");
        }
        return zk;
    }

    LinkedList<Integer> results = new LinkedList<Integer>();
    @Test
    public void testAsync()
        throws IOException, InterruptedException, KeeperException
    {
        ZooKeeper zk = null;
        zk = createClient();
        try {
            zk.addAuthInfo("digest", "ben:passwd".getBytes());
            zk.create("/ben", new byte[0], Ids.READ_ACL_UNSAFE, CreateMode.PERSISTENT, this, results);
            zk.create("/ben/2", new byte[0], Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, this, results);
            zk.delete("/ben", -1, this, results);
            zk.create("/ben2", new byte[0], Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT, this, results);
            zk.getData("/ben2", false, this, results);
            synchronized (results) {
                while (results.size() < 5) {
                    results.wait();
                }
            }
            Assert.assertEquals(0, (int) results.get(0));
            Assert.assertEquals(Code.NOAUTH, Code.get(results.get(1)));
            Assert.assertEquals(0, (int) results.get(2));
            Assert.assertEquals(0, (int) results.get(3));
            Assert.assertEquals(0, (int) results.get(4));
        } finally {
            zk.close();
        }

        zk = createClient();
        try {
            zk.addAuthInfo("digest", "ben:passwd2".getBytes());
            try {
                zk.getData("/ben2", false, new Stat());
                Assert.fail("Should have received a permission error");
            } catch (KeeperException e) {
                Assert.assertEquals(Code.NOAUTH, e.code());
            }
        } finally {
            zk.close();
        }

        zk = createClient();
        try {
            zk.addAuthInfo("digest", "ben:passwd".getBytes());
            zk.getData("/ben2", false, new Stat());
        } finally {
            zk.close();
        }
    }

    @SuppressWarnings("unchecked")
    public void processResult(int rc, String path, Object ctx, String name) {
        synchronized(ctx) {
            ((LinkedList<Integer>)ctx).add(rc);
            ctx.notifyAll();
        }
    }

    @SuppressWarnings("unchecked")
    public void processResult(int rc, String path, Object ctx) {
        synchronized(ctx) {
            ((LinkedList<Integer>)ctx).add(rc);
            ctx.notifyAll();
        }
    }

    @SuppressWarnings("unchecked")
    public void processResult(int rc, String path, Object ctx, byte[] data,
            Stat stat) {
        synchronized(ctx) {
            ((LinkedList<Integer>)ctx).add(rc);
            ctx.notifyAll();
        }
    }
}


text:
package example;

class A {}


text:
// AUTO-GENERATED: do not modify this file directly.
// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:
// npm run fp

import _ = require("../index");

interface PullAll {
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    (): PullAll;
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    <T>(values: _.List<T>): PullAll1x1<T>;
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    <T>(values: _.List<T>, array: ReadonlyArray<T>): T[];
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    <T>(values: _.List<T>, array: _.List<T>): _.List<T>;
}
interface PullAll1x1<T> {
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    (): PullAll1x1<T>;
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    (array: ReadonlyArray<T>): T[];
    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @category Array
     * @param array The array to modify.
     * @param values The values to remove.
     * @returns Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, [2, 3]);
     * console.log(array);
     * // => [1, 1]
     */
    (array: _.List<T>): _.List<T>;
}

declare const pullAll: PullAll;
export = pullAll;


text:
namespace CookingService.Model
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    internal class CourseType
    {
        public int Id { get; set; }

        public string Name { get; set; }
    }
}


text:
layout: post
title:  Air Force SSC Officer  Meteorological Branch last date 25th July-2015
date: 2015-07-03 18:39
comments: true
tags: AirForce Commission Officer
archive: false
---
Applications are invited for Short Service Commission (SSC) Officer in Air Force in Meteorological Branch for the Courses commencing July - 2016

Indian Air Force invites applications  from Male and Female candidates to join in the Air Force for grant of Short Service Commission / Permanent Service Commission in Meteorological Branch for the course commencing July 2016 :

- Meteorological Branch Permanent Commission (PSC) Men
- Meteorological Branch Short Service Commission (SSC) Men
- Meteorological Branch Short Service Commission (SSC) Women

Age : 20-26  years as on 01/07/2016

Pay Scale : Rs.15600-39100 Grade Pay Rs.5400 plus Rs.6000/- MSP and other allowances

**How to Apply** :  If you meet the requirements, apply on plain A4 size paper (typed or hand written) in English in the prescribed format and post the application to the address Post Bag No. 001,  Nirman Bhawan Post Office, New Delhi - 110106 by ordinary post to reach latest by 25/07/2015.  (01/08/2015 for the candidates from far-flung areas)

Please visit at Indian Air Force website at <http://careerairforce.nic.in>  for details and application format.


text:
/*
 * Flip! jQuery Plugin (http://lab.smashup.it/flip/)
 * @author Luca Manno (luca@smashup.it) [http://i.smashup.it]
 * 		[Original idea by Nicola Rizzo (thanks!)]
 *
 * @version 0.5
 *
 * @changelog
 * v 0.5	->  Added patch to make it work with Opera (thanks to Peter Siewert), Added callbacks [Feb. 1, 2008]
 * v 0.4.1 	->	Fixed a regression in Chrome and Safari caused by getTransparent [Oct. 1, 2008]
 * v 0.4 	->	Fixed some bugs with transparent color. Now Flip! works on non-white backgrounds | Update: jquery.color.js plugin or jqueryUI still needed :( [Sept. 29, 2008]
 * v 0.3 	->	Now is possibile to define the content after the animation.
 * 				(jQuery object or text/html is allowed) [Sept. 25, 2008]
 * v 0.2 	->	Fixed chainability and buggy innertext rendering (xNephilimx thanks!)
 * v 0.1 	->	Starting release [Sept. 11, 2008]
 *
 */
(function($) {
    var getTransparent, parent, pBg;
    getTransparent = function(el){
        for(var n=0;n<el.parents().length;n++){
            parent = el.parents().get(n);
            pBg = $.browser.safari ? $(parent).css("background") : $(parent).css("background-color");
            if(pBg!='' && pBg!='transparent'){
                return pBg;
            }
        }
    }

    function int_prop(fx){
        fx.elem.style[ fx.prop ] = parseInt(fx.now) + fx.unit;
    }
    jQuery.extend( jQuery.fx.step, {
        borderTopWidth : int_prop,
        borderBottomWidth : int_prop,
        borderLeftWidth: int_prop,
        borderRightWidth: int_prop
    });

    jQuery.fn.flip = function(settings){
        return this.each( function() {

            var $this, flipObj, cloneId, dirOptions, _self, newContent;

            $this = $(this);
            if($this.data('flipLock')){
                return false;
            } else {
                $this.data('flipLock',1);
            }
            flipObj = {
                width: $this.width(),
                height: $this.height(),
                bgColor: settings.bgColor || $this.css("background-color"),
                fontSize: $this.css("font-size") || "12px",
                direction: settings.direction || "tb",
                toColor: settings.color || "#f00",
                speed: settings.speed || 500,
                top: $this.offset().top,
                left: $this.offset().left,
                target: settings.content || null,
                transparent: getTransparent($this) || '#fff',
                onBefore: settings.onBefore || function(){},
                onEnd: settings.onEnd || function(){},
                onAnimation: settings.onAnimation || function(){}
            };

            cloneId = "flipClone_"+(new Date()).getTime();

            $this
            .css("visibility","hidden")
            .clone(true)
            .appendTo("body")
            .html("")
            .css({
                visibility:"visible",
                position:"absolute",
                left:flipObj.left,
                top:flipObj.top,
                margin:0,
                zIndex:9999
            }).attr("id",cloneId);

            dirOptions = {
                "tb": {
                    "start": {
                        fontSize:'0px',
                        lineHeight:'0px',
                        borderTopWidth:flipObj.height,
                        borderLeftWidth:'0px',
                        borderRightWidth:'0px',
                        borderBottomWidth:'0px',
                        borderTopColor:flipObj.bgColor,
                        borderBottomColor:flipObj.transparent,
                        borderLeftColor:flipObj.transparent,
                        borderRightColor:flipObj.transparent,
                        borderStyle:'solid',
                        height:'0px',
                        width:flipObj.width
                        },
                    "first": {
                        borderTopWidth: '0px',
                        borderLeftWidth: (flipObj.height/100)*15,
                        borderRightWidth: (flipObj.height/100)*15,
                        borderBottomWidth: '0px',
                        borderTopColor: '#999',
                        borderBottomColor: '#999',
                        borderLeftColor: flipObj.transparent,
                        borderRightColor: flipObj.transparent,
                        top: (flipObj.top+(flipObj.height/2)),
                        left: (flipObj.left-(flipObj.height/100)*15)
                        },
                    "second": {
                        borderBottomWidth: flipObj.height,
                        borderTopWidth: '0px',
                        borderLeftWidth: '0px',
                        borderRightWidth: '0px',
                        borderTopColor: flipObj.transparent,
                        borderBottomColor: flipObj.toColor,
                        borderLeftColor: flipObj.transparent,
                        borderRightColor: flipObj.transparent,
                        top: flipObj.top,
                        left: flipObj.left
                        }
                },
                "bt": {
                    "start": {
                        fontSize:'0px',
                        lineHeight:'0px',
                        borderTopWidth:'0px',
                        borderLeftWidth:'0px',
                        borderRightWidth:'0px',
                        borderBottomWidth:flipObj.height,
                        borderTopColor:flipObj.transparent,
                        borderBottomColor:flipObj.bgColor,
                        borderLeftColor:flipObj.transparent,
                        borderRightColor:flipObj.transparent,
                        borderStyle:'solid',
                        height:'0px',
                        width:flipObj.width
                        },
                    "first": {
                        borderTopWidth: '0px',
                        borderLeftWidth: (flipObj.height/100)*15,
                        borderRightWidth: (flipObj.height/100)*15,
                        borderBottomWidth: '0px',
                        borderTopColor: '#999',
                        borderBottomColor: '#999',
                        borderLeftColor: flipObj.transparent,
                        borderRightColor: flipObj.transparent,
                        top: (flipObj.top+(flipObj.height/2)),
                        left: (flipObj.left-(flipObj.height/100)*15)
                        },
                    "second": {
                        borderTopWidth: flipObj.height,
                        borderLeftWidth: '0px',
                        borderRightWidth: '0px',
                        borderBottomWidth: '0px',
                        borderTopColor: flipObj.toColor,
                        borderBottomColor: flipObj.transparent,
                        borderLeftColor: flipObj.transparent,
                        borderRightColor: flipObj.transparent,
                        top: flipObj.top,
                        left: flipObj.left
                    }
                },
                "lr": {
                    "start": {
                        width:'0px',
                        fontSize:'0px',
                        lineHeight:'0px',
                        borderTopWidth:'0px',
                        borderLeftWidth:flipObj.width,
                        borderRightWidth:'0px',
                        borderBottomWidth:'0px',
                        borderTopColor:flipObj.transparent,
                        borderBottomColor:flipObj.transparent,
                        borderLeftColor:flipObj.bgColor,
                        borderRightColor:flipObj.transparent,
                        borderStyle:'solid',
                        height:flipObj.height
                        },
                    "first": {
                        borderTopWidth: (flipObj.height/100)*10,
                        borderLeftWidth: '0px',
                        borderRightWidth: '0px',
                        borderBottomWidth: (flipObj.height/100)*10,
                        borderTopColor: flipObj.transparent,
                        borderBottomColor: flipObj.transparent,
                        borderLeftColor: '#999',
                        borderRightColor: '#999',
                        top: flipObj.top-(flipObj.height/100)*10,
                        left: flipObj.left+(flipObj.width/2)
                        },
                    "second": {
                        borderTopWidth: '0px',
                        borderLeftWidth: '0px',
                        borderRightWidth: flipObj.width,
                        borderBottomWidth: '0px',
                        borderTopColor: flipObj.transparent,
                        borderBottomColor: flipObj.transparent,
                        borderLeftColor: flipObj.transparent,
                        borderRightColor: flipObj.toColor,
                        top: flipObj.top,
                        left: flipObj.left
                        }
                },
                "rl": {
                    "start": {
                        width:'0px',
                        fontSize:'0px',
                        lineHeight:'0px',
                        borderTopWidth:'0px',
                        borderLeftWidth:'0px',
                        borderRightWidth:flipObj.width,
                        borderBottomWidth:'0px',
                        borderTopColor:flipObj.transparent,
                        borderBottomColor:flipObj.transparent,
                        borderLeftColor:flipObj.transparent,
                        borderRightColor:flipObj.bgColor,
                        borderStyle:'solid',
                        height:flipObj.height
                        },
                    "first": {
                        borderTopWidth: (flipObj.height/100)*10,
                        borderLeftWidth: '0px',
                        borderRightWidth: '0px',
                        borderBottomWidth: (flipObj.height/100)*10,
                        borderTopColor: flipObj.transparent,
                        borderBottomColor: flipObj.transparent,
                        borderLeftColor: '#999',
                        borderRightColor: '#999',
                        top: flipObj.top-(flipObj.height/100)*10,
                        left: flipObj.left+(flipObj.width/2)
                        },
                    "second": {
                        borderTopWidth: '0px',
                        borderLeftWidth: flipObj.width,
                        borderRightWidth: '0px',
                        borderBottomWidth: '0px',
                        borderTopColor: flipObj.transparent,
                        borderBottomColor: flipObj.transparent,
                        borderLeftColor: flipObj.toColor,
                        borderRightColor: flipObj.transparent,
                        top: flipObj.top,
                        left: flipObj.left
                        }
                }
            };

            _self = $this;

            newContent = function(){
                var target = flipObj.target;
                return target && target.jquery ? target.html() : target;
            }

            function queue(_this,_self){
                _this.queue(function(){
                    flipObj.onBefore();
                    _this.html('').css(dirOptions[flipObj.direction].start);
                    _this.dequeue();
                });
                _this.animate(dirOptions[flipObj.direction].first,flipObj.speed);
                _this.queue(function(){
                    flipObj.onAnimation();
                    _this.dequeue();
                });
                _this.animate(dirOptions[flipObj.direction].second,flipObj.speed);
                _this.queue(function(){
                    _self.css({
                        backgroundColor: flipObj.toColor,
                        visibility: "visible"
                    });
                    var nC = newContent();
                    if(nC){
                        _self.html(nC);
                    }
                    _this.remove();
                    flipObj.onEnd();
                    _self.removeData('flipLock');
                    _this.dequeue();
                });
            }
            queue($("#"+cloneId),_self);

        });
    };
})(jQuery);

//
//  function to draw out 120 divs
//
//
function wrap(n) {
    var z = '
' + n + '
';
    return z;
}
var a = []; //start with a regular empty object
// add properties to make it array like
var i = 1;
var s = '';
while (i < 121) {
    a[i] = wrap(i);
    s += wrap(i);
    i++;
}

$('.cell').click(function() {
    $(this).addClass('prime');
});
$('#msg5').html(s);

// namespace our application
var MYAPP = {};
    MYAPP.dom = function() {
    // private variable
    var _getElement = document.getElementById(el);
    var _setText = function(msg) {
        $('msg5').text('msg');
        return this
    };
    return {
        element: _getElement,
        setText: _setText
    }
};

var obj = new MYAPP.dom.element('span');
obj.dom.setText('hello');
//obj.dom.setStyle('color','red');
//obj.setStyle('font', 'verdana');
//document.element.appendChild(obj);


text:
"""
This is the base file for ci_testing
"""

from .add import *


text:
package allsimplebridges;

import static com.google.j2cl.integration.testing.Asserts.assertTrue;

public class Tester897 {
  @SuppressWarnings("unchecked")
  static class C1 {
    C1() {}
    @SuppressWarnings("MissingOverride")
    public String get(Object value) {
      return "C1.get";
    }

    @SuppressWarnings("MissingOverride")
    public String get(String value) {
      return "C1.get";
    }
  }

  @SuppressWarnings("unchecked")
  public static void test() {
    C1 s = new C1();
    assertTrue(s.get(new Object()).equals("C1.get"));
    assertTrue(s.get("").equals("C1.get"));
  }
}


text:
using namespace ABI::Windows::Foundation::Collections;

namespace rx
{
CoreWindowNativeWindow::~CoreWindowNativeWindow()
{
    unregisterForSizeChangeEvents();
}

bool CoreWindowNativeWindow::initialize(EGLNativeWindowType window, IPropertySet *propertySet)
{
    ComPtr<IPropertySet> props = propertySet;
    ComPtr<IInspectable> win = window;
    SIZE swapChainSize = {};
    bool swapChainSizeSpecified = false;
    HRESULT result = S_OK;

    // IPropertySet is an optional parameter and can be null.
    // If one is specified, cache as an IMap and read the properties
    // used for initial host initialization.
    if (propertySet)
    {
        result = props.As(&mPropertyMap);
        if (SUCCEEDED(result))
        {
            // The EGLRenderSurfaceSizeProperty is optional and may be missing.  The IPropertySet
            // was prevalidated to contain the EGLNativeWindowType before being passed to
            // this host.
            result = GetOptionalSizePropertyValue(mPropertyMap, EGLRenderSurfaceSizeProperty, &swapChainSize, &swapChainSizeSpecified);
        }
    }

    if (SUCCEEDED(result))
    {
        result = win.As(&mCoreWindow);
    }

    if (SUCCEEDED(result))
    {
        // If a swapchain size is specfied, then the automatic resize
        // behaviors implemented by the host should be disabled.  The swapchain
        // will be still be scaled when being rendered to fit the bounds
        // of the host.
        // Scaling of the swapchain output occurs automatically because if
        // the scaling mode setting DXGI_SCALING_STRETCH on the swapchain.
        if (swapChainSizeSpecified)
        {
            mClientRect = { 0, 0, swapChainSize.cx, swapChainSize.cy };
            mSupportsSwapChainResize = false;
        }
        else
        {
            result = GetCoreWindowSizeInPixels(mCoreWindow, &mClientRect);
        }
    }

    if (SUCCEEDED(result))
    {
        mNewClientRect = mClientRect;
        mClientRectChanged = false;
        return registerForSizeChangeEvents();
    }

    return false;
}

bool CoreWindowNativeWindow::registerForSizeChangeEvents()
{
    ComPtr<IWindowSizeChangedEventHandler> sizeChangedHandler;
    HRESULT result = Microsoft::WRL::MakeAndInitialize<CoreWindowSizeChangedHandler>(sizeChangedHandler.ReleaseAndGetAddressOf(), this->shared_from_this());
    if (SUCCEEDED(result))
    {
        result = mCoreWindow->add_SizeChanged(sizeChangedHandler.Get(), &mSizeChangedEventToken);
    }

    if (SUCCEEDED(result))
    {
        return true;
    }

    return false;
}

void CoreWindowNativeWindow::unregisterForSizeChangeEvents()
{
    if (mCoreWindow)
    {
        (void)mCoreWindow->remove_SizeChanged(mSizeChangedEventToken);
    }
    mSizeChangedEventToken.value = 0;
}

HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain)
{
    if (device == NULL || factory == NULL || swapChain == NULL || width == 0 || height == 0)
    {
        return E_INVALIDARG;
    }

    DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };
    swapChainDesc.Width = width;
    swapChainDesc.Height = height;
    swapChainDesc.Format = format;
    swapChainDesc.Stereo = FALSE;
    swapChainDesc.SampleDesc.Count = 1;
    swapChainDesc.SampleDesc.Quality = 0;
    swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER;
    swapChainDesc.BufferCount = 2;
    swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
    swapChainDesc.Scaling = DXGI_SCALING_STRETCH;

    *swapChain = nullptr;

    ComPtr<IDXGISwapChain1> newSwapChain;
    HRESULT result = factory->CreateSwapChainForCoreWindow(device, mCoreWindow.Get(), &swapChainDesc, nullptr, newSwapChain.ReleaseAndGetAddressOf());
    if (SUCCEEDED(result))
    {

#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
        // Test if swapchain supports resize.  On Windows Phone devices, this will return DXGI_ERROR_UNSUPPORTED.  On
        // other devices DXGI_ERROR_INVALID_CALL should be returned because the combination of flags passed
        // (DXGI_SWAP_CHAIN_FLAG_NONPREROTATED | DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE) are invalid flag combinations.
        if (newSwapChain->ResizeBuffers(swapChainDesc.BufferCount, swapChainDesc.Width, swapChainDesc.Height, swapChainDesc.Format, DXGI_SWAP_CHAIN_FLAG_NONPREROTATED | DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE) == DXGI_ERROR_UNSUPPORTED)
        {
            mSupportsSwapChainResize = false;
        }
#endif // (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)

        result = newSwapChain.CopyTo(swapChain);
    }

    if (SUCCEEDED(result))
    {
        // If automatic swapchain resize behaviors have been disabled, then
        // unregister for the resize change events.
        if (mSupportsSwapChainResize == false)
        {
            unregisterForSizeChangeEvents();
        }
    }

    return result;
}

HRESULT GetCoreWindowSizeInPixels(const ComPtr<ABI::Windows::UI::Core::ICoreWindow>& coreWindow, RECT *windowSize)
{
    ABI::Windows::Foundation::Rect bounds;
    HRESULT result = coreWindow->get_Bounds(&bounds);
    if (SUCCEEDED(result))
    {
        *windowSize = { 0, 0, ConvertDipsToPixels(bounds.Width), ConvertDipsToPixels(bounds.Height) };
    }

    return result;
}

static float GetLogicalDpi()
{
    ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
    float dpi = 96.0f;

    if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
    {
        if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
        {
            return dpi;
        }
    }
    return dpi;
}

long ConvertDipsToPixels(float dips)
{
    static const float dipsPerInch = 96.0f;
    return lround((dips * GetLogicalDpi() / dipsPerInch));
}
}


text:
var FormRegionController = function(region, $scope, $location, formUtils, stringUtils, locationUtils, divisionService) {

    var getDivisions = function() {
        divisionService.getDivisions()
            .then(function(result) {
                $scope.divisions = result;
            });
    };

    $scope.region = region;

    $scope.props = [
        { name: 'name', type: 'text', required: true, maxLength: 45 }
    ];

    $scope.labelize = stringUtils.labelize;

    $scope.viewPhysLocations = function() {
        $location.path($location.path() + '/phys-locations');
    };

    $scope.navigateToPath = locationUtils.navigateToPath;

    $scope.hasError = formUtils.hasError;

    $scope.hasPropertyError = formUtils.hasPropertyError;

    var init = function () {
        getDivisions();
    };
    init();

};

FormRegionController.$inject = ['region', '$scope', '$location', 'formUtils', 'stringUtils', 'locationUtils', 'divisionService'];
module.exports = FormRegionController;


text:
import { test } from 'ember-qunit';
import moduleForComponent from 'open-event-frontend/tests/helpers/component-helper';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ui-table/cell/cell-input-number', 'Integration | Component | ui table/cell/cell input number');

test('it renders', function(assert) {
  this.render(hbs`{{ui-table/cell/cell-input-number}}`);
  assert.ok(this.$().html().trim().includes(''));
});


text:
/* $Id: ClC.cc,v 1.22 1999/08/27 00:06:27 gjb Exp $
 * Cassowary Incremental Constraint Solver
 * Original Smalltalk Implementation by Alan Borning
 * This C++ Implementation by Greg J. Badros, <gjb@cs.washington.edu>
 * http://www.cs.washington.edu/homes/gjb
 * (C) 1998, 1999 Greg J. Badros and Alan Borning
 * See ../LICENSE for legal details regarding this software
 *
 * ClC.c
 * C wrapper for most important Cassowary functionality
 * (Originally developed for the Amaya CCSS extensions)
 */

#define CLC_IMPL
#include "ClC.h"

#include "Cl.h"
#include <strstream.h>
#include <stdio.h>
#include <limits.h>

#ifdef HAVE_CONFIG_H
#include <cassowary/config.h>
#define CONFIG_H_INCLUDED
#endif

#define FDN_EOL LONG_MIN

#define boolean int

extern "C" {

typedef StringToVarMap *CL_VarMap;

CL_VarMap varmap = NULL;

/* Functions unique to the C interface */
void
CL_Init()
{
}

void
CL_Shutdown()
{
  /* empty */
}

CL_VarMap CL_VarMapNew()
{
  return new StringToVarMap();
}

CL_VarMap CL_SetVarMap(CL_VarMap varmap_)
{
  if (varmap_ == NULL)
    varmap_ = CL_VarMapNew();
  varmap = varmap_;
  ClVariable::SetVarMap(varmap);
  return varmap;
}

CL_VarMap CL_GetVarMap()
{
  return varmap;
}

/* return true iff the variable did exist
   in the current global varmap, else return false */
boolean
CL_VarMapDelete(const char *sz)
{
  const string s(sz);
  StringToVarMap::iterator it = varmap->find(s);
  if (it != varmap->end()) {
    varmap->erase(it);
    return true;
  }
  return false;
}

/* Return a new ClVariable with name and initial Value */
CLV CL_ClvNew(const char *szName, double Value, CL_SimplexSolver solver)
{
  ClVariable *pclv = new ClVariable(szName,Value);
  if (solver)
    solver->AddStay(*pclv);
#if 0
  fprintf(stderr,"Created var %s @ %p\n",szName,pclv->get_pclv());
#endif
  return pclv;
}

void CL_VariableSetPv(CLV var, void *pv)
{ var->SetPv(pv); }

void *CL_VariablePv(CLV var)
{ return var->Pv(); }

const char *
CL_VariableName(CLV var)
{ return var->Name().c_str(); }

/* Return a new ClSimplexSolver object */
CL_SimplexSolver CL_SimplexSolverNew()
{
  ClSimplexSolver *psolver = new ClSimplexSolver();
  return psolver;
}

/* Print the ClVariable out to the given FILE * */
void
CL_ClvPrint(CLV var, FILE *out)
{
  strstream xo;
  xo << *var << ends;
  fprintf(out,"%s",xo.str());
}

/* Print the ClSolver object out to the given FILE * */
void
CL_SolverPrint(CL_Solver solver, FILE *out)
{
  strstream xo;
  xo << *solver << ends;
  fprintf(out,"%s",xo.str());
}

/* Print the constraint object out to the given FILE * */
void
CL_ConstraintPrint(CL_Constraint pcn, FILE *out)
{
  strstream xo;
  xo << *pcn << ends;
  fprintf(out,"%s",xo.str());
}

void
CL_TableauPrintExternalVariables(CL_Tableau tableau, FILE *out)
{
  strstream xo;
  tableau->printExternalVariablesTo(xo);
  xo << ends;
  fprintf(out,"%s",xo.str());
}

void
CL_SolverSetChangeClvCallback(CL_Solver solver, PfnChangeClvCallback pfn)
{
  solver->SetChangeClvCallback(pfn);
}

void
CL_SimplexSolverAddStrongStay(CL_SimplexSolver solver, CLV var, double weight)
{
  solver->AddStay(*var,ClsMedium(),weight);
}

void
CL_SimplexSolverAddStay(CL_SimplexSolver solver, CLV var, double weight)
{
  solver->AddStay(*var,ClsWeak(),weight);
}

/* Return a clvariable with the given name, or NULL if not found;
   be forgiving about leading/trailing whitespace in szNameConst,
   and also stopping once a non-id character is seen.*/
CLV CL_ClvLookupTrim(const char *szNameConst)
{
  char *szName = const_cast<char *>(szNameConst);
  // skip leading ws
  while (szName && *szName && *szName == ' ' || *szName == '\t')
    ++szName;
  char *pchEnd = szName + strcspn(szName," \t\n;:<>,./?~!@#$%^&*()+=|\\{}[]\"`'");
  char ch = '\0';
  if (pchEnd) {
    ch = *pchEnd;        // save the character
    *pchEnd = '\0';      // and terminate the string
  }
  CLV answer = CL_ClvLookup(szName);
  if (pchEnd) *pchEnd = ch; // restore the character
  return answer;
}

/* Return a clvariable with the given name, or NULL if not found */
CLV CL_ClvLookup(const char *szName)
{
  if (!varmap)
    return NULL;
  StringToVarMap::iterator it = varmap->find(szName);
  if (it == varmap->end())
    return NULL;
  ClVariable *pclv = new ClVariable(it->second);
  return pclv;
}

/* Return the Value of clv */
double CL_ClvValue(const CLV var)
{
  return var->Value();
}

boolean
CL_ClvIsNil(const CLV var)
{
  return var->IsNil();
}

/* Return a new constraint (or NULL) from parsing the strings */
CL_Constraint CL_ParseConstraint(const char *szConstraintRule, const char *szConstraintStrength)
{
  try {
    istrstream xiLine(szConstraintRule);
    ClConstraint *pcn = PcnParseConstraint(xiLine,ClVarLookupInMap(varmap,false),
                                           ClsFromSz(szConstraintStrength));
    return pcn;
  } catch (ExCLError &e) {
    fprintf(stderr,"%s\n",e.description().c_str());
    return NULL;
  }
}

boolean CL_FIsSatisfied(ClConstraint *pcn)
{
  return pcn->FIsSatisfied();
}

/* Add a constraint to the solver; return 1 on success, 0 on failure */
boolean CL_AddConstraint(CL_Solver solver, CL_Constraint cn)
{
  try {
    return (solver->AddConstraintNoException(cn)?1:0);
  } catch (...) {
    return 0;
  }
}

/* Add a constraint to the solver; return 1 on success, 0 on failure */
boolean CL_RemoveConstraint(CL_Solver solver, CL_Constraint cn)
{
  try {
    return (solver->RemoveConstraintNoException(cn)?1:0);
  } catch (...) {
    return 0;
  }
}

void CL_Solve(CL_Solver solver)
{
  solver->Solve();
}

void CL_Resolve(CL_Solver solver)
{
  solver->Resolve();
}

void CL_SimplexSolverSetEditedValue(CL_SimplexSolver solver, CLV var, double n)
{
  solver->SetEditedValue(*var,n);
}

#if defined(CL_HAVE_GTL) && defined(CL_BUILD_FD_SOLVER)

#include <stdarg.h>

/* Return a new ClVariable containing an FD variable with name and
   varargs domain_values as its initial domain, terminated with FDN_EOL */
CLV CL_CldvNew(const char *szName, ...)
{
  va_list ap;
  va_start(ap, szName);
  list<FDNumber> l;
  FDNumber n;
  while ( (n = va_arg(ap, FDNumber)) != FDN_EOL) {
    l.push_back(n);
  }
  va_end(ap);

  ClVariable *pclv = new ClVariable(new ClFDVariable(szName,0.0,l));
#if 0
  fprintf(stderr,"Created fd var %s @ %p\n",szName,pclv->get_pclv());
#endif
  return pclv;
}

CL_FDSolver CL_FDSolverNew()
{
  ClFDSolver *psolver = new ClFDSolver();
  return psolver;
}

boolean CL_ClvIsFD(const CLV var)
{
  return var->IsFDVariable();
}

boolean CL_FDCanConvertCn(CL_Constraint cn)
{
  return ClFDBinaryOneWayConstraint::FCanConvertCn(*cn);
}

CL_Constraint CL_FDCnFromCn(CL_Constraint cn)
{
  try {
    return new ClFDBinaryOneWayConstraint(*cn);
  } catch (...) {
    return NULL;
  }
}

boolean CL_FCnOkayForSimplexSolver(CL_Constraint cn)
{
  return cn->FIsOkayForSimplexSolver();
}

#endif

} /* extern "C" */


text:
/* global jest expect */

import React from 'react';
import { shallow } from 'enzyme';
import { UserDocuments } from '../../components/documents/UserDocuments';

describe('Users component', () => {
  const props = {
    currentUser: {},
    myDocuments: jest.fn(() => Promise.resolve()),
    deleteDocuments: jest.fn(() => Promise.resolve()),
    documentList: {}
  };
  const nextProps = {
    documentList: {},
    pagination: { pageCount: 3 }
  };
  const page = {
    selected: 3,
  };

  const wrapper = shallow(<UserDocuments {...props} />);
  it('renders as a div', () => {
    expect(wrapper.node.type).toEqual('div');
  });

  it('should call the method componentDidMount', () => {
    const componentDidMountSpy =
    jest.spyOn(wrapper.instance(), 'componentDidMount');
    wrapper.instance().componentDidMount();
    expect(componentDidMountSpy).toHaveBeenCalledTimes(1);
  });

  it('should contain the method componentWillReceiveProps', () => {
    const componentWillReceivePropsSpy =
    jest.spyOn(wrapper.instance(), 'componentWillReceiveProps');
    wrapper.instance().componentWillReceiveProps(nextProps);
    expect(componentWillReceivePropsSpy).toHaveBeenCalledTimes(1);
  });

  it('should contain the method handlePageClick', () => {
    const handlePageClickSpy =
    jest.spyOn(wrapper.instance(), 'handlePageClick');
    wrapper.instance().handlePageClick(page);
    expect(handlePageClickSpy).toHaveBeenCalledTimes(1);
  });
  it('should contain the method deleteDocument', () => {
    const deleteDocumentSpy =
    jest.spyOn(wrapper.instance(), 'deleteDocument');
    wrapper.instance().deleteDocument(2);
    expect(deleteDocumentSpy).toHaveBeenCalledTimes(1);
  });
});


text:
import os
PACKAGEDIR = os.path.abspath(os.path.dirname(__file__))

from .version import __version__
from .kadenza import *


text:
@implementation LinkedinAuthorizationNavBar

- (instancetype)init {
    self = [super init];
    if (self) {

    }
    return self;
}

#pragma mark - Appearence Setters

- (void)setAuthBarTitleTextAttributes:(NSDictionary<NSAttributedStringKey,id> *)authBarTitleTextAttributes {

    _authBarTitleTextAttributes = authBarTitleTextAttributes;
    [self setTitleTextAttributes:authBarTitleTextAttributes];
}

- (void)setAuthCancelButtonTitleTextAttributes:(NSDictionary<NSAttributedStringKey,id> *)authCancelButtonTitleTextAttributes {

    _authCancelButtonTitleTextAttributes = authCancelButtonTitleTextAttributes;
    [self.topItem.leftBarButtonItem setTitleTextAttributes:authCancelButtonTitleTextAttributes forState:UIControlStateNormal];
}

- (void)setAuthBarTintColor:(UIColor *)authBarTintColor {

    _authBarTintColor = authBarTintColor;
    [self setBarTintColor:authBarTintColor];
}

- (void)setAuthBarIsTranslucent:(BOOL)authBarIsTranslucent {

    _authBarIsTranslucent = authBarIsTranslucent;
    [self setTranslucent:authBarIsTranslucent];
}

- (void)setAuthTintColor:(UIColor *)authTintColor {

    _authTintColor = authTintColor;
    [self setTintColor:authTintColor];
}

- (void)setAuthTitle:(NSString *)authTitle {

    _authTitle = authTitle;
    [self.topItem setTitle:authTitle];
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 2: 847 (1891)

#### Original name
Cyphella chromospora Pat.

### Remarks
null


text:
module Azure::Network::Mgmt::V2019_02_01
  module Models
    #
    # Defines values for VirtualNetworkGatewayType
    #
    module VirtualNetworkGatewayType
      Vpn = "Vpn"
      ExpressRoute = "ExpressRoute"
    end
  end
end