text:
package io.cdap.functions;

import io.cdap.wrangler.dq.TypeInference;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Period;
import org.joda.time.Seconds;

import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.TimeZone;

import static java.time.temporal.ChronoField.ERA;
import static java.time.temporal.ChronoUnit.DAYS;

/**
 * Collection of useful expression functions made available in the context
 * of an expression.
 *
 * set-column column <expression>
 */
public final class Dates {
  /**
   * Converts a date to long -- unix timestamp in milli-seconds.
   *
   * @param date to be converted to unix timestamp.
   * @return unixtimestamp of the date.
   */
  public static long UNIXTIMESTAMP_MILLIS(ZonedDateTime date) {
    validate(date, "UNIXTIMESTAMP_MILLIS");
    return date.toInstant().toEpochMilli();
  }

  /**
   * Converts a date to long -- unix timestamp in seconds.
   *
   * @param date to be converted to unix timestamp.
   * @return unixtimestamp of the date.
   */
  public static long UNIXTIMESTAMP_SECONDS(ZonedDateTime date) {
    validate(date, "UNIXTIMESTAMP_SECONDS");
    return date.toEpochSecond();
  }

  /**
   * Converts a {@link ZonedDateTime} to Month in year.
   * <p>
   *   January is 1, February is 2, and so on.
   * </p>
   * @param date to extract month.
   * @return month.
   */
  public static int MONTH(ZonedDateTime date) {
    validate(date, "MONTH");
    return date.getMonthValue();
  }

  /**
    * Extracts a short month description from Date.
   *
   * @param date to extract short month description.
   * @return short month description.
   */
  public static String MONTH_SHORT(ZonedDateTime date) {
    validate(date, "MONTH_SHORT");
    DateTime dt = getDateTime(date);
    DateTime.Property pMoY = dt.monthOfYear();
    return pMoY.getAsShortText();
  }

  /**
   * Extracts a long month description from Date.
   *
   * @param date to extract long month description.
   * @return long month description.
   */
  public static String MONTH_LONG(ZonedDateTime date) {
    validate(date, "MONTH_LONG");
    DateTime dt = getDateTime(date);
    DateTime.Property pMoY = dt.monthOfYear();
    return pMoY.getAsText();
  }

  /**
   * Extracts only year from Date.
   *
   * @param date to extract year from.
   * @return year as integer.
   */
  public static int YEAR(ZonedDateTime date) {
    validate(date, "YEAR");
    return date.getYear();
  }

  /**
   * Extracts day of the week from the date.
   *
   * @param date to extract date of the week.
   * @return day of the week.
   */
  public static int DAY_OF_WEEK(ZonedDateTime date) {
    validate(date, "DAY_OF_WEEK");
    return date.getDayOfWeek().getValue();
  }

  /**
   * Extracts day of the week from the date.
   *
   * @param date to extract date of the week.
   * @return day of the week.
   */
  public static String DAY_OF_WEEK_SHORT(ZonedDateTime date) {
    validate(date, "DAY_OF_WEEK_SHORT");
    DateTime dt = getDateTime(date);
    DateTime.Property value = dt.dayOfWeek();
    return value.getAsShortText();
  }

  /**
   * Extracts day of the week from the date.
   *
   * @param date to extract date of the week.
   * @return day of the week.
   */
  public static String DAY_OF_WEEK_LONG(ZonedDateTime date) {
    validate(date, "DAY_OF_WEEK_LONG");
    DateTime dt = getDateTime(date);
    DateTime.Property value = dt.dayOfWeek();
    return value.getAsText();
  }

  /**
   * Extracts Day of the year from the date.
   *
   * @param date to extract date of the year.
   * @return date of the year.
   */
  public static int DAY_OF_YEAR(ZonedDateTime date) {
    validate(date, "DAY_OF_YEAR");
    return date.getDayOfYear();
  }

  /**
   * Extracts Era from the date.
   *
   * @param date to extract era.
   * @return era.
   */
  public static int ERA(ZonedDateTime date) {
    validate(date, "ERA");
    return date.get(ERA);
  }

  /**
   * Extracts Era from the date as short text.
   *
   * @param date to extract era.
   * @return era.
   */
  public static String ERA_SHORT(ZonedDateTime date) {
    validate(date, "ERA_SHORT");
    DateTime dt = getDateTime(date);
    DateTime.Property value = dt.era();
    return value.getAsShortText();
  }

  /**
   * Extracts Era from the date as long text.
   *
   * @param date to extract era.
   * @return era.
   */
  public static String ERA_LONG(ZonedDateTime date) {
    validate(date, "ERA_LONG");
    DateTime dt = getDateTime(date);
    DateTime.Property value = dt.era();
    return value.getAsText();
  }

  /**
   * Return number of dates between two days.
   *
   * @param date1 First date.
   * @param date2 Second date.
   * @return Number of days.
   */
  public static int DAYS_BETWEEN(ZonedDateTime date1, ZonedDateTime date2) {
    validate(date1, "ERA_LONG");
    validate(date2, "ERA_LONG");
    return (int) DAYS.between(date1, date2);
  }

  /**
   * Return number of dates between now and date days.
   *
   * @param date Now - this date.
   * @return Number of days.
   */
  public static int DAYS_BETWEEN_NOW(ZonedDateTime date) {
    validate(date, "DAYS_BETWEEN_NOW");
    ZonedDateTime now = ZonedDateTime.now(ZoneId.ofOffset("UTC", ZoneOffset.UTC));
    // returns number of days between date and now, date being lower.
    return (int) DAYS.between(date, now);
  }

  /**
   * Converts seconds to days.
   *
   * @param seconds to be converted.
   * @return days equivalent of seconds
   */
  public static int SECONDS_TO_DAYS(int seconds) {
    Period period = new Period(Seconds.seconds(seconds));
    return period.toStandardDays().getDays();
  }

  /**
   * Converts seconds to hours.
   *
   * @param seconds to be converted.
   * @return hours equivalent of seconds
   */
  public static int SECONDS_TO_HOURS(int seconds) {
    Period period = new Period(Seconds.seconds(seconds));
    return period.toStandardHours().getHours();
  }

  /**
   * Converts seconds to mins.
   *
   * @param seconds to be converted.
   * @return mins equivalent of seconds
   */
  public static int SECONDS_TO_MINUTES(int seconds) {
    Period period = new Period(Seconds.seconds(seconds));
    return period.toStandardMinutes().getMinutes();
  }

  /**
   * Converts seconds to weeks.
   *
   * @param seconds to be converted.
   * @return weeks equivalent of seconds
   */
  public static int SECONDS_TO_WEEKS(int seconds) {
    Period period = new Period(Seconds.seconds(seconds));
    return period.toStandardWeeks().getWeeks();
  }

  /**
   * Checks if a column is a date column or not.
   *
   * @param value representing a date.
   * @return true if it's date, false if not.
   */
  public static boolean isDate(String value) {
    return TypeInference.isDate(value);
  }

  /**
   * Checks if the value passed is a date time.
   *
   * @param value representing date time.
   * @return true if it's datetime, false if not.
   */
  public static boolean isTime(String value) {
    return TypeInference.isTime(value);
  }

  private static DateTime getDateTime(ZonedDateTime zonedDateTime) {
    return new DateTime(
      zonedDateTime.toInstant().toEpochMilli(),
      DateTimeZone.forTimeZone(TimeZone.getTimeZone(zonedDateTime.getZone())));
  }

  private static void validate(ZonedDateTime date, String method) {
    if (date == null) {
      throw new IllegalArgumentException(String.format("Date can not be null for %s", method));
    }
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">

<title>

    Wall of browser bugs · Bootstrap

</title>

<link href="../dist/css/bootstrap.css" rel="stylesheet">

<link href="../assets/css/src/pygments-manni.css" rel="stylesheet">
<link href="../assets/css/src/anchor.css" rel="stylesheet">
<link href="../assets/css/src/docs.css" rel="stylesheet">

<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="icon" href="/favicon.ico">

Skip to main content

      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        Toggle navigation

      </button>
      Bootstrap

          Getting started

          CSS

          Components

          JavaScript

          Customize

Expo

Blog

Wall of browser bugs

A list of the browser bugs that Bootstrap is currently grappling with.

Browser bugs

Bootstrap currently works around several outstanding browser bugs in major browsers to deliver the best cross-browser experience possible. Some bugs, like those listed below, cannot be solved by us.

We publicly list browser bugs that are impacting us here, in the hopes of expediting the process of fixing them. For information on Bootstrap's browser compatibility, see our browser compatibility docs.

          Browser(s)
          Summary of bug
          Upstream bug(s)
          Bootstrap issue(s)

          Internet Explorer 11

Hovered element still remains in :hover state after scrolling away.

          IE bug #926665

          #14211

          Internet Explorer 11

When hovering over a <select> menu item, the cursor for the element underneath the menu is displayed.

          IE bug #963961

          #14528

          Firefox

.table-bordered with an empty <tbody> is missing borders.

          Mozilla bug #1023761

          #13453

          Firefox

max-width: 100%; doesn't work inside tables.

          Mozilla bug #975632

          #10690

          Firefox (Windows)

Java applets that are descendants of elements with forced hardware acceleration using translate3d(0,0,0) are invisible.

          Mozilla bug #1048279

          #14124

          Firefox

Button elements with width: 100% become cropped in long tables.

          Mozilla bug #1060131

          #14320

          Firefox

If the disabled state of a form control is changed via JavaScript, the normal state doesn't return after refreshing the page.

          Mozilla bug #654072

          #793

          Chrome (OS X)

Clicking above <input type="number"> increment button flashes the decrement button.

          Chromium issue #419108

          Offshoot of #8350 & Chromium issue #337668

          Chrome (OS X)

Caps Lock indicator not shown in <input type="password"> with display: block

          Chromium issue #460200

          #15832

          Chrome

display: table; within display: block; forces sibling content to new line.

          Chromium issue #309483

          #9950

          Chrome

Incorrect viewport size used for media queries when printing.

          Chromium issue #273306

          #12078

          Chrome

CSS infinite linear animation with alpha transparency leaks memory.

          Chromium issue #429375

          #14409

          Chrome

:focus outline style causes cursor to not be displayed when toggling a readonly <input> to read-write.

          Chromium issue #465274

          #16022

          Chrome (Windows & Linux)

Animation glitch when returning to inactive tab after animations occurred while tab was hidden.

          Chromium issue #449180

          #15298

          Safari (OS X)

Scrollbar clipped in select[multiple] with padding.

          WebKit bug #128489, Apple Safari Radar #19208483

          #12536

          Safari (OS X)

Weird button behavior with some <input type="number"> elements.

          WebKit bug #137269, Apple Safari Radar #18834768

          #8350, Normalize #283, Chromium issue #337668

          Safari (OS X)

display: table-cell; within media query renders incorrectly when resizing the window.

          WebKit bug #138167, Apple Safari Radar #18987206

          #9774

          Safari (OS X)

Small font size when printing webpage with fixed-width .container.

          WebKit bug #138192, Apple Safari Radar #19435018

          #14868

          Safari (OS X)

Alpha linear-gradient has dark line at its edge.

          WebKit bug #139803, Apple Safari Radar #19434933

          #15205

          Safari (OS X)

Caps Lock indicator not shown in <input type="password"> with display: block

          WebKit bug #141804, Apple Safari Radar #19892433

          #15832

          Safari (iOS)

transform: translate3d(0,0,0); rendering bug.

          WebKit bug #138162, Apple Safari Radar #18804973

          #14603

          Safari (iOS)

Text input's cursor doesn't move while scrolling the page.

          WebKit bug #138201, Apple Safari Radar #18819624

          #14708

          Safari (iOS)

display: block causes text of temporal <input>s to become vertically misaligned

          WebKit bug #139848, Apple Safari Radar #19434878

          #11266, #13098

      Follow @getbootstrap

      Tweet

Designed and built with all the love in the world by @mdo and @fat.

Maintained by the core team with the help of our contributors.

Code licensed under MIT, documentation under CC BY 3.0.

Currently v3.3.4

·

GitHub

·

Examples

·

v2.3.2 docs

·

About

·

Expo

·

Blog

·

Issues

·

Releases

redpajama_set_name: RedPajamaGithub


text:
<#
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
#>

param(
    [Parameter(Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)]
    [string] $platformRoot
)

Write-Host "Applying Platform Config..."

Function UpdateManifest ($manifestFile)
{
  [xml]$manifest = Get-Content $manifestFile -Encoding UTF8

  # Replace app start page with config.xml setting.

  $startPage = $config.widget.content.src
  if (-not $startPage) {
    # If not specified, set default value
    # http://cordova.apache.org/docs/en/edge/config_ref_index.md.html#The%20config.xml%20File
    $startPage = "index.html"
  }
  $manifest.Package.Applications.Application.StartPage = "www/$startpage"

  # Update app name & version

  # update identity name
  $identityname = $config.widget.id
  if ($identityname) {
    $manifest.Package.Identity.Name = $identityname
    $manifest.Package.Applications.Application.Id = $identityname
  }

  # update app display name
  $displayname = $config.widget.name

  $manifestDisplayName = $manifest.Package.Properties.DisplayName
  if ($displayname -and $manifestDisplayName) {
    $manifestDisplayName = $displayname
  }

  $visualelems = $manifest.Package.Applications.Application.VisualElements
  if ($displayname -and $visualelems) {
    $visualelems.DisplayName = $displayname
  }

  # update publisher display name
  $publisher = $config.widget.author.InnerText
  $manifestPublisher = $manifest.Package.Properties.PublisherDisplayName
  if ($publisher -and $manifestPublisher) {
    $manifestPublisher = $publisher.InnerText
  }

  # Adjust version number as per CB-5337 Windows8 build fails due to invalid app version
  $version = $config.widget.version
  if ($version -and $version -match "\." ) {
      while ($version.Split(".").Length -lt 4) {
          $version = $version + ".0"
      }
      $manifest.Package.Identity.Version = $version
  }

  # Sort capabilities elements
  $capabilities = $manifest.Package.Capabilities
  if ($capabilities) {
    # Get sorted list of elements
    $sorted = $capabilities.ChildNodes | sort
    # Remove parent node
    $manifest.Package.RemoveChild($capabilities) | Out-Null
    # Create new node
    $capabilities = $manifest.CreateElement("Capabilities", $manifest.DocumentElement.NamespaceURI)
    # Then add sorted children
    $sorted | foreach {
        $Capabilities.AppendChild($_) | Out-Null
    }
    $manifest.Package.AppendChild($capabilities) | Out-Null
  }

  # Add domain whitelist rules
  $rules = $manifest.Package.Applications.Application.ApplicationContentUriRules

  # Remove existing rules from manifest
  if ($rules) {
    $manifest.Package.Applications.Application.RemoveChild($rules) | Out-Null
  }
  if ($acls -and ($acls -notcontains "*")) {
    $rules = $manifest.CreateElement("ApplicationContentUriRules", $manifest.DocumentElement.NamespaceURI)
    $manifest.Package.Applications.Application.AppendChild($rules) | Out-Null
    $acls | foreach {
      $elem = $manifest.CreateElement("Rule", $manifest.DocumentElement.NamespaceURI)
      $elem.SetAttribute("Match", $_)
      $elem.SetAttribute("Type", "include")
      $rules.AppendChild($elem) | Out-Null
    }
  }

  # Format splash screen background color to windows8 format
  $configSplashScreenBGColor = $config.SelectNodes('//*[local-name()="preference"][@name="SplashScreenBackgroundColor"]').value
  if($configSplashScreenBGColor)
  {
    "Setting SplashScreenBackgroundColor = $configSplashScreenBGColor"

    $bgColor = ($configSplashScreenBGColor -replace "0x", "") -replace "#", ""

    # Double all bytes if color specified as "fff"
    if ($bgColor.Length -eq 3) {
      $bgColor = $bgColor[0] + $bgColor[0] + $bgColor[1] + $bgColor[1] + $bgColor[2] + $bgColor[2]
    }

    # Parse hex representation to array of color bytes [b, g, r, a]
    $colorBytes = [System.BitConverter]::GetBytes(
      [int]::Parse($bgColor,
      [System.Globalization.NumberStyles]::HexNumber))

    Add-Type -AssemblyName PresentationCore

    # Create new Color object ignoring alpha, because windows 8 doesn't support it
    # see http://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
    $color = ([System.Windows.Media.Color]::FromRgb(
      $colorBytes[2], $colorBytes[1], $colorBytes[0]
      # FromRGB method add 100% alpha, so we remove it from resulting string
      ).ToString()) -replace "#FF", "#"

    $manifest.Package.Applications.Application.VisualElements.SplashScreen.BackgroundColor = [string]$color
  }

  # Format background color to windows format

  $configBgColor = $config.SelectNodes('//*[local-name()="preference"][@name="BackgroundColor"]').value
  if ($configBgColor) {
    $bgColor = ($configBgColor -replace "0x", "") -replace "#", ""

    # Double all bytes if color specified as "fff"
    if ($bgColor.Length -eq 3) {
      $bgColor = $bgColor[0] + $bgColor[0] + $bgColor[1] + $bgColor[1] + $bgColor[2] + $bgColor[2]
    }

    # Parse hex representation to array of color bytes [b, g, r, a]
    $colorBytes = [System.BitConverter]::GetBytes(
      [int]::Parse($bgColor, [System.Globalization.NumberStyles]::HexNumber)
    )

    Add-Type -AssemblyName PresentationCore

    # Create new Color object ignoring alpha, because windows doesn't support it
    # see http://msdn.microsoft.com/en-us/library/windows/apps/dn423310.aspx
    $color = ([System.Windows.Media.Color]::FromRgb(
      $colorBytes[2], $colorBytes[1], $colorBytes[0]
      # FromRGB method add 100% alpha, so we remove it from resulting string
      ).ToString()) -replace "#FF", "#"

    $manifest.Package.Applications.Application.VisualElements.BackgroundColor = [string]$color
  }

  # Write out manifest file

  $xmlWriter = New-Object System.Xml.XmlTextWriter($manifestFile, $null)
  $xmlWriter.Formatting = "Indented"
  $xmlWriter.Indentation = 4
  $manifest.WriteContentTo($xmlWriter)
  $xmlWriter.Close()
}

Function CopyImage($src, $dest)
{
  $resolvedPath = $null;

  # do search relative to platform and app folders
  foreach ($testPath in @($src, "..\..\$src"))
  {
    $testPath = join-path $platformRoot $testPath
    if (Test-Path -PathType Leaf $testPath)
    {
      $resolvedPath = $testPath;
      break
    }
  }

  if ($resolvedPath -eq $null)
  {
      Write-Host "Image doesn't exist: $src"
      return
  }
  Copy-Item $resolvedPath -Destination (join-path $platformRoot $dest)
}

Function Get-Access-Rules ()
{
  $aclsAll = ([string[]]$config.widget.access.origin)
  if ($aclsAll -eq $null) {
    return @();
  }

  $acls = @()

  $aclsAll | foreach {
      if ($_.StartsWith("https://","CurrentCultureIgnoreCase") -or ($_ -eq "*")) {
        $acls += $_
      } else {
        Write-Host "Access rules must begin with 'https://', the following rule is ignored: $_"
      }
    }
  return $acls
}

Function UpdateAssets ()
{
  $configFile = "$platformRoot\config.xml"
  [xml]$config = Get-Content $configFile

  # Splash screen images
  $splashScreens = $config.SelectNodes('//*[local-name()="splash"]')

  foreach ($splash in $splashScreens)
  {
    $width = $splash.getAttribute("width")
    $height= $splash.getAttribute("height")
    $src = $splash.getAttribute("src")
    if ($width -eq 620 -and $height -eq 300) {
      CopyImage $src "images/splashscreen.png"
      continue
    }
    if ($width -eq 1152 -and $height -eq 1920) {
      CopyImage $src "images/SplashScreen.scale-240.png"
      continue
    }
     Write-Host "Unknown image ($src) size, skip"
  }

  # App icons
  $configIcons= $config.SelectNodes('//*[local-name()="icon"]')

  foreach ($icon in $configIcons)
  {
    $width = $icon.getAttribute("width")
    $height= $icon.getAttribute("height")
    $src = $icon.getAttribute("src")

    if ($width -eq 150) {
      CopyImage $src "images/logo.png"
      continue
    }
    if ($width -eq 30) {
      CopyImage $src "images/smalllogo.png"
      continue
    }
    if ($width -eq 50) {
      CopyImage $src "images/storelogo.png"
      continue
    }
    if ($width -eq 120) {
      CopyImage $src "images/StoreLogo.scale-240.png"
      continue
    }

    if ($width -eq 106) {
      CopyImage $src "images/Square44x44Logo.scale-240.png"
      continue
    }
    if ($width -eq 170) {
      CopyImage $src "images/Square71x71Logo.scale-240.png"
      continue
    }
    if ($width -eq 360) {
      CopyImage $src "images/Square150x150Logo.scale-240.png"
      continue
    }
    if ($width -eq 744 -and $height -eq 360) {
      CopyImage $src "images/Wide310x150Logo.scale-240.png"
      continue
    }

     Write-Host "Unknown image ($src) size, skip"
  }

}

$configFile = "$platformRoot\config.xml"
[xml]$config = Get-Content $configFile -Encoding UTF8

# Domain whitelist rules defined in configuration file
$acls = Get-Access-Rules $config

UpdateManifest "$platformRoot\package.windows.appxmanifest"
UpdateManifest "$platformRoot\package.windows80.appxmanifest"
UpdateManifest "$platformRoot\package.phone.appxmanifest"

# replace splash screen images and icons
UpdateAssets


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Acaul. blue violets N. Amer. 39. 1992

#### Original name
Viola affinis Leconte

### Remarks
null


text:
namespace parquet {

// ----------------------------------------------------------------------
// SerializedPageReader deserializes Thrift metadata and pages that have been
// assembled in a serialized stream for storing in a Parquet files

SerializedPageReader::SerializedPageReader(std::unique_ptr<InputStream> stream,
    Compression::type codec_type, MemoryAllocator* allocator)
    : stream_(std::move(stream)), decompression_buffer_(0, allocator) {
  max_page_header_size_ = DEFAULT_MAX_PAGE_HEADER_SIZE;
  decompressor_ = Codec::Create(codec_type);
}

std::shared_ptr<Page> SerializedPageReader::NextPage() {
  // Loop here because there may be unhandled page types that we skip until
  // finding a page that we do know what to do with
  while (true) {
    int64_t bytes_read = 0;
    int64_t bytes_available = 0;
    uint32_t header_size = 0;
    const uint8_t* buffer;
    uint32_t allowed_page_size = DEFAULT_PAGE_HEADER_SIZE;

    // Page headers can be very large because of page statistics
    // We try to deserialize a larger buffer progressively
    // until a maximum allowed header limit
    while (true) {
      buffer = stream_->Peek(allowed_page_size, &bytes_available);
      if (bytes_available == 0) { return std::shared_ptr<Page>(nullptr); }

      // This gets used, then set by DeserializeThriftMsg
      header_size = bytes_available;
      try {
        DeserializeThriftMsg(buffer, &header_size, &current_page_header_);
        break;
      } catch (std::exception& e) {
        // Failed to deserialize. Double the allowed page header size and try again
        std::stringstream ss;
        ss << e.what();
        allowed_page_size *= 2;
        if (allowed_page_size > max_page_header_size_) {
          ss << "Deserializing page header failed.\n";
          throw ParquetException(ss.str());
        }
      }
    }
    // Advance the stream offset
    stream_->Advance(header_size);

    int compressed_len = current_page_header_.compressed_page_size;
    int uncompressed_len = current_page_header_.uncompressed_page_size;

    // Read the compressed data page.
    buffer = stream_->Read(compressed_len, &bytes_read);
    if (bytes_read != compressed_len) ParquetException::EofException();

    // Uncompress it if we need to
    if (decompressor_ != NULL) {
      // Grow the uncompressed buffer if we need to.
      if (uncompressed_len > static_cast<int>(decompression_buffer_.size())) {
        decompression_buffer_.Resize(uncompressed_len);
      }
      decompressor_->Decompress(
          compressed_len, buffer, uncompressed_len, &decompression_buffer_[0]);
      buffer = &decompression_buffer_[0];
    }

    auto page_buffer = std::make_shared<Buffer>(buffer, uncompressed_len);

    if (current_page_header_.type == format::PageType::DICTIONARY_PAGE) {
      const format::DictionaryPageHeader& dict_header =
          current_page_header_.dictionary_page_header;

      bool is_sorted = dict_header.__isset.is_sorted ? dict_header.is_sorted : false;

      return std::make_shared<DictionaryPage>(page_buffer, dict_header.num_values,
          FromThrift(dict_header.encoding), is_sorted);
    } else if (current_page_header_.type == format::PageType::DATA_PAGE) {
      const format::DataPageHeader& header = current_page_header_.data_page_header;

      auto page = std::make_shared<DataPage>(page_buffer, header.num_values,
          FromThrift(header.encoding), FromThrift(header.definition_level_encoding),
          FromThrift(header.repetition_level_encoding));

      if (header.__isset.statistics) {
        const format::Statistics stats = header.statistics;
        if (stats.__isset.max) { page->max_ = stats.max; }
        if (stats.__isset.min) { page->min_ = stats.min; }
      }
      return page;
    } else if (current_page_header_.type == format::PageType::DATA_PAGE_V2) {
      const format::DataPageHeaderV2& header = current_page_header_.data_page_header_v2;
      bool is_compressed = header.__isset.is_compressed ? header.is_compressed : false;
      return std::make_shared<DataPageV2>(page_buffer, header.num_values,
          header.num_nulls, header.num_rows, FromThrift(header.encoding),
          header.definition_levels_byte_length, header.repetition_levels_byte_length,
          is_compressed);
    } else {
      // We don't know what this page type is. We're allowed to skip non-data
      // pages.
      continue;
    }
  }
  return std::shared_ptr<Page>(nullptr);
}

const RowGroupMetaData* SerializedRowGroup::metadata() const {
  return row_group_metadata_.get();
}

std::unique_ptr<PageReader> SerializedRowGroup::GetColumnPageReader(int i) {
  // Read column chunk from the file
  auto col = row_group_metadata_->ColumnChunk(i);

  int64_t col_start = col->data_page_offset();
  if (col->has_dictionary_page() && col_start > col->dictionary_page_offset()) {
    col_start = col->dictionary_page_offset();
  }

  int64_t bytes_to_read = col->total_compressed_size();
  std::unique_ptr<InputStream> stream;

  stream = properties_.GetStream(source_, col_start, bytes_to_read);

  return std::unique_ptr<PageReader>(new SerializedPageReader(
      std::move(stream), col->compression(), properties_.allocator()));
}

// ----------------------------------------------------------------------
// SerializedFile: Parquet on-disk layout

static constexpr uint32_t FOOTER_SIZE = 8;
static constexpr uint8_t PARQUET_MAGIC[4] = {'P', 'A', 'R', '1'};

std::unique_ptr<ParquetFileReader::Contents> SerializedFile::Open(
    std::unique_ptr<RandomAccessSource> source, ReaderProperties props) {
  std::unique_ptr<ParquetFileReader::Contents> result(
      new SerializedFile(std::move(source), props));

  // Access private methods here, but otherwise unavailable
  SerializedFile* file = static_cast<SerializedFile*>(result.get());

  // Validates magic bytes, parses metadata, and initializes the SchemaDescriptor
  file->ParseMetaData();

  return result;
}

void SerializedFile::Close() {
  source_->Close();
}

SerializedFile::~SerializedFile() {
  Close();
}

std::shared_ptr<RowGroupReader> SerializedFile::GetRowGroup(int i) {
  std::unique_ptr<SerializedRowGroup> contents(new SerializedRowGroup(
      source_.get(), std::move(file_metadata_->RowGroup(i)), properties_));

  return std::make_shared<RowGroupReader>(
      file_metadata_->schema_descriptor(), std::move(contents), properties_.allocator());
}

const FileMetaData* SerializedFile::metadata() const {
  return file_metadata_.get();
}

SerializedFile::SerializedFile(std::unique_ptr<RandomAccessSource> source,
    ReaderProperties props = default_reader_properties())
    : source_(std::move(source)), properties_(props) {}

void SerializedFile::ParseMetaData() {
  int64_t filesize = source_->Size();

  if (filesize < FOOTER_SIZE) {
    throw ParquetException("Corrupted file, smaller than file footer");
  }

  uint8_t footer_buffer[FOOTER_SIZE];
  source_->Seek(filesize - FOOTER_SIZE);
  int64_t bytes_read = source_->Read(FOOTER_SIZE, footer_buffer);
  if (bytes_read != FOOTER_SIZE || memcmp(footer_buffer + 4, PARQUET_MAGIC, 4) != 0) {
    throw ParquetException("Invalid parquet file. Corrupt footer.");
  }

  uint32_t metadata_len = *reinterpret_cast<uint32_t*>(footer_buffer);
  int64_t metadata_start = filesize - FOOTER_SIZE - metadata_len;
  if (FOOTER_SIZE + metadata_len > filesize) {
    throw ParquetException(
        "Invalid parquet file. File is less than "
        "file metadata size.");
  }
  source_->Seek(metadata_start);

  OwnedMutableBuffer metadata_buffer(metadata_len, properties_.allocator());
  bytes_read = source_->Read(metadata_len, &metadata_buffer[0]);
  if (bytes_read != metadata_len) {
    throw ParquetException("Invalid parquet file. Could not read metadata bytes.");
  }

  file_metadata_ = FileMetaData::Make(&metadata_buffer[0], &metadata_len);
}

}  // namespace parquet


text:
package severity

import (
	sl "github.com/goharbor/harbor/src/lib/selector"
)

const (
	// Kind of this selector
	Kind = "severity"
	// Gte decoration: Severity of candidate should be greater than or equal to the expected severity.
	Gte = "gte"
	// Gt decoration: Severity of candidate should be greater than the expected severity.
	Gt = "gt"
	// Equal decoration: Severity of candidate should be equal to the expected severity.
	Equal = "equal"
	// Lte decoration: Severity of candidate should be less than or equal to the expected severity.
	Lte = "lte"
	// Lt decoration: Severity of candidate should be less than the expected severity.
	Lt = "lt"
)

// selector filters the candidates by comparing the vulnerability severity
type selector struct {
	// Pre defined pattern decorations
	// "gte", "gt", "equal", "lte" or "lt"
	decoration string

	// expected severity value
	severity uint
}

// Select candidates by comparing the vulnerability severity of the candidate
func (s *selector) Select(artifacts []*sl.Candidate) (selected []*sl.Candidate, err error) {
	for _, a := range artifacts {
		matched := false

		switch s.decoration {
		case Gte:
			if a.VulnerabilitySeverity >= s.severity {
				matched = true
			}
		case Gt:
			if a.VulnerabilitySeverity > s.severity {
				matched = true
			}
		case Equal:
			if a.VulnerabilitySeverity == s.severity {
				matched = true
			}
		case Lte:
			if a.VulnerabilitySeverity <= s.severity {
				matched = true
			}
		case Lt:
			if a.VulnerabilitySeverity < s.severity {
				matched = true
			}
		default:
			break
		}

		if matched {
			selected = append(selected, a)
		}
	}

	return selected, nil
}

// New is factory method for vulnerability severity selector
func New(decoration string, pattern interface{}, extras string) sl.Selector {
	var sev int
	if pattern != nil {
		sev, _ = pattern.(int)
	}

	return &selector{
		decoration: decoration,
		severity:   (uint)(sev),
	}
}


text:
from .common import DistributedOperatorImplContainer
from .common import DistributedOperatorImpl
from .common import register_distributed_operator_impl_container
from .common import gradient_synchronization
from .common import register_distributed_operator_impl, is_parameter_related
from ..utils import is_prim_op
from ..utils import compute_compatible_dim_mapping
from ..utils import set_dist_op_desc_original_id
from ..dist_attribute import OperatorDistributedAttribute
from paddle.distributed.fleet.meta_optimizers.common import OP_ROLE_KEY, OpRole
from ..process_group import new_process_group
from ..utils import _get_comm_group, _get_corresponding_rank
from ..cost import _g_op_cost_factory
from ..cost import build_comp_desc_from_dist_op, build_dp_costs
from ..cost import build_comp_costs_from_descs

__op_not_need_param_init__ = ["while", "cond"]

def prim_operator_data_parallel_functor(ctx, src_op):
    dist_op_context = ctx.dist_op_context
    main_block = dist_op_context.work_block
    startup_block = dist_op_context.startup_block

    var_name = src_op.output_arg_names[0]
    if var_name in ctx.grads_params:
        assert (
            var_name not in ctx.synced_gradient
        ), "in primtive mode, grad is already {} synced".format(var_name)
        ctx.synced_gradient.add(var_name)
        sync_group = new_process_group(ctx.data_parallel_group)

        allreduce_op = main_block.append_op(
            type='c_allreduce_sum',
            inputs={'X': [var_name]},
            outputs={'Out': [var_name]},
            attrs={
                'ring_id': sync_group.id,
                'use_calc_stream': True,
                OP_ROLE_KEY: OpRole.Backward,
            },
        )

        param = ctx.grads_params[var_name]
        startup_block = dist_op_context.startup_block
        new_op = startup_block.append_op(
            type='c_broadcast',
            inputs={'X': [param]},
            outputs={'Out': [param]},
            attrs={
                'ring_id': sync_group.id,
                'root': 0,
                'use_calc_stream': True,
                OP_ROLE_KEY: OpRole.Forward,
            },
        )

        grad_var = main_block._var_recursive(var_name)
        dims_mapping = ctx.get_tensor_dist_attr_for_program(
            grad_var
        ).dims_mapping
        dist_attr = ctx.get_op_dist_attr_for_program(src_op)
        process_mesh = dist_attr.process_mesh
        op_attr = OperatorDistributedAttribute()
        op_attr.process_mesh = process_mesh
        op_attr.set_output_dims_mapping(grad_var.name, dims_mapping)
        op_attr.set_input_dims_mapping(grad_var.name, dims_mapping)
        ctx.set_op_dist_attr_for_program(allreduce_op, op_attr)

    return

class DistributedDefault(DistributedOperatorImplContainer):
    def __init__(self, op_type):
        super().__init__(op_type)

register_distributed_operator_impl_container(DistributedDefault("default"))

# Replicated Default
class DistributedDefaultImpl0(DistributedOperatorImpl):
    def __init__(self, name):
        super().__init__(name)
        self._forward_implemented = True
        self._backward_implemented = True

    def calc_cost(self, op_role, dist_op, ctx, cluster):
        """Calculate the cost by the op role."""
        cost = None
        if int(op_role) == int(OpRole.Backward):
            cost = self.calc_bwd_cost(dist_op, ctx, cluster)
        else:
            cost = self.calc_fwd_cost(dist_op, ctx, cluster)
        assert cost is not None
        return cost

    def calc_fwd_cost(self, dist_op, ctx, cluster):
        # calc comp op cost
        desc_mapping = build_comp_desc_from_dist_op(
            dist_op=dist_op, dist_context=ctx
        )
        processes = dist_op.dist_attr.process_mesh.processes
        op_type = dist_op.serial_op.type
        cost_mapping = build_comp_costs_from_descs(
            _g_op_cost_factory[op_type], ctx, processes, desc_mapping, cluster
        )
        res_cost = [cost_mapping]

        return res_cost

    def calc_bwd_cost(self, dist_op, ctx, cluster):
        # calc comp op cost
        res = []
        desc_mapping = build_comp_desc_from_dist_op(
            dist_op=dist_op, dist_context=ctx
        )
        dist_attr = dist_op.dist_attr
        process_mesh = dist_attr.process_mesh
        processes = process_mesh.processes
        backward_op = dist_op.serial_op
        op_type = backward_op.type
        cost_mapping = build_comp_costs_from_descs(
            _g_op_cost_factory[op_type], ctx, processes, desc_mapping, cluster
        )
        res.append(cost_mapping)

        main_block = backward_op.block
        need_gradient_allreduce = False
        for input_name in backward_op.desc.input_names():
            for varname in backward_op.desc.input(input_name):
                if "@GRAD" not in varname and not is_parameter_related(
                    varname, main_block
                ):
                    var_dim_mapping = dist_attr.get_input_dims_mapping(varname)
                    mesh_shape = process_mesh.topology
                    batch_size_axis = var_dim_mapping[0]
                    if batch_size_axis > -1 and mesh_shape[batch_size_axis] > 1:
                        need_gradient_allreduce = True
                        break

        if need_gradient_allreduce:
            for input_name in backward_op.desc.input_names():
                for varname in backward_op.desc.input(input_name):
                    if "@GRAD" not in varname and is_parameter_related(
                        varname, main_block
                    ):
                        var_dim_mapping = dist_attr.get_input_dims_mapping(
                            varname
                        )
                        mesh_shape = process_mesh.topology
                        batch_size_axis = var_dim_mapping[0]
                        parallel_axis = batch_size_axis
                        attrs = {"use_calc_stream": True}
                        var_names = [varname + "@GRAD"]
                        build_dp_costs(
                            res,
                            dist_op,
                            ctx,
                            var_names,
                            attrs,
                            parallel_axis,
                            cluster,
                        )
        return res

    def is_input_compatible(self, dist_op):
        op_desc = dist_op.serial_op.desc
        op_dist_attr = dist_op.dist_attr
        batch_dim_mappings = []
        input_names = op_desc.input_names()
        xshape_arg_names = []
        if "XShape" in input_names:
            xshape_arg_names = op_desc.input("XShape")
        for arg_name in op_desc.input_arg_names():
            serial_tensor = dist_op.get_serial_input(arg_name)
            dims_mapping = op_dist_attr.get_input_dims_mapping(arg_name)
            if serial_tensor.is_parameter:
                for mapping in dims_mapping:
                    if mapping != -1:
                        return False
                continue
            if arg_name not in xshape_arg_names:
                if len(dims_mapping) > 1:
                    for mapping in dims_mapping[1:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                if dims_mapping[0] != -1:
                    return False
                if len(dims_mapping) > 2:
                    for mapping in dims_mapping[2:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 2:
                    batch_dim_mappings.append(dims_mapping[1])

        if compute_compatible_dim_mapping(batch_dim_mappings) is None:
            return False

        return True

    def is_output_compatible(self, dist_op):
        op_desc = dist_op.serial_op.desc
        op_dist_attr = dist_op.dist_attr
        output_names = op_desc.output_names()
        batch_dim_mappings = []
        xshape_arg_names = []
        if "XShape" in output_names:
            xshape_arg_names = op_desc.output("XShape")
        for arg_name in op_desc.output_arg_names():
            serial_tensor = dist_op.get_serial_output(arg_name)
            dims_mapping = op_dist_attr.get_output_dims_mapping(arg_name)
            if serial_tensor.is_parameter:
                for mapping in dims_mapping:
                    if mapping != -1:
                        return False
                continue
            if arg_name not in xshape_arg_names:
                if len(dims_mapping) > 1:
                    for mapping in dims_mapping[1:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                if dims_mapping[0] != -1:
                    return False
                if len(dims_mapping) > 2:
                    for mapping in dims_mapping[2:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 2:
                    batch_dim_mappings.append(dims_mapping[1])

        if compute_compatible_dim_mapping(batch_dim_mappings) is None:
            return False

        return True

    def is_auto_compatible(self, dist_op):
        op_desc = dist_op.serial_op.desc
        op_dist_attr = dist_op.dist_attr
        batch_dim_mappings = []
        # Check input compatibility
        input_names = op_desc.input_names()
        xshape_arg_names = []
        if "XShape" in input_names:
            xshape_arg_names = op_desc.input("XShape")
        for arg_name in op_desc.input_arg_names():
            serial_tensor = dist_op.get_serial_input(arg_name)
            dims_mapping = op_dist_attr.get_input_dims_mapping(arg_name)
            if serial_tensor is not None and serial_tensor.is_parameter:
                for mapping in dims_mapping:
                    if mapping != -1:
                        return False
                continue
            if arg_name not in xshape_arg_names:
                if len(dims_mapping) > 1:
                    for mapping in dims_mapping[1:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                if dims_mapping[0] != -1:
                    return False
                if len(dims_mapping) > 2:
                    for mapping in dims_mapping[2:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 2:
                    batch_dim_mappings.append(dims_mapping[1])

        # Check output compatibility
        output_names = op_desc.output_names()
        xshape_arg_names = []
        if "XShape" in output_names:
            xshape_arg_names = op_desc.output("XShape")
        for arg_name in op_desc.output_arg_names():
            serial_tensor = dist_op.get_serial_output(arg_name)
            dims_mapping = op_dist_attr.get_output_dims_mapping(arg_name)
            if serial_tensor is not None and serial_tensor.is_parameter:
                for mapping in dims_mapping:
                    if mapping != -1:
                        return False
                continue
            if arg_name not in xshape_arg_names:
                if len(dims_mapping) > 1:
                    for mapping in dims_mapping[1:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                if dims_mapping[0] != -1:
                    return False
                if len(dims_mapping) > 2:
                    for mapping in dims_mapping[2:]:
                        if mapping != -1:
                            return False
                if len(dims_mapping) >= 2:
                    batch_dim_mappings.append(dims_mapping[1])

        # Check batch dim mapping compatibility
        if not all(
            batch_dim_mappings[0] == dim_mapping
            for dim_mapping in batch_dim_mappings
        ):
            return False

        return True

    def update_dims_mapping(self, dist_op):
        changed = False
        op_desc = dist_op.serial_op.desc
        op_dist_attr = dist_op.dist_attr

        if op_desc.type() == "while":
            return False

        input_names = op_desc.input_names()
        input_xshape_arg_names = []
        if "XShape" in input_names:
            input_xshape_arg_names = op_desc.input("XShape")

        output_names = op_desc.output_names()
        output_xshape_arg_names = []
        if "XShape" in output_names:
            output_xshape_arg_names = op_desc.output("XShape")

        batch_dim_mappings = []
        for arg_name in op_desc.input_arg_names():
            serial_tensor = dist_op.get_serial_input(arg_name)
            if serial_tensor.is_parameter:
                continue
            dims_mapping = op_dist_attr.get_input_dims_mapping(arg_name)
            if arg_name not in input_xshape_arg_names:
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                batch_dim_mappings.append(dims_mapping[1])
        for arg_name in op_desc.output_arg_names():
            if op_desc.type() == 'fill_any_like':
                input_tensor = dist_op.get_serial_input(
                    op_desc.input_arg_names()[0]
                )
                if input_tensor.is_parameter:
                    continue
            serial_tensor = dist_op.get_serial_output(arg_name)
            if serial_tensor.is_parameter:
                continue
            dims_mapping = op_dist_attr.get_output_dims_mapping(arg_name)
            if arg_name not in output_xshape_arg_names:
                if len(dims_mapping) >= 1:
                    batch_dim_mappings.append(dims_mapping[0])
            else:
                batch_dim_mappings.append(dims_mapping[1])

        if not batch_dim_mappings:
            return changed

        compatible_dim_mapping = compute_compatible_dim_mapping(
            batch_dim_mappings
        )
        if compatible_dim_mapping is None:
            return False

        for arg_name in op_desc.input_arg_names():
            serial_tensor = dist_op.get_serial_input(arg_name)
            if serial_tensor.is_parameter:
                continue
            dims_mapping = op_dist_attr.get_input_dims_mapping(arg_name)
            if arg_name not in input_xshape_arg_names:
                if (
                    len(dims_mapping) >= 1
                    and compatible_dim_mapping != dims_mapping[0]
                ):
                    dims_mapping[0] = compatible_dim_mapping
                    changed = True
            else:
                if (
                    len(dims_mapping) >= 2
                    and compatible_dim_mapping != dims_mapping[1]
                ):
                    dims_mapping[1] = compatible_dim_mapping
                    changed = True
        for arg_name in op_desc.output_arg_names():
            if op_desc.type() == 'fill_any_like':
                input_tensor = dist_op.get_serial_input(
                    op_desc.input_arg_names()[0]
                )
                if input_tensor.is_parameter:
                    continue
            if op_desc.type() in ["shape", "slice"]:
                continue
            serial_tensor = dist_op.get_serial_output(arg_name)
            if serial_tensor.is_parameter:
                continue
            dims_mapping = op_dist_attr.get_output_dims_mapping(arg_name)
            if arg_name not in output_xshape_arg_names:
                if (
                    len(dims_mapping) >= 1
                    and compatible_dim_mapping != dims_mapping[0]
                ):
                    dims_mapping[0] = compatible_dim_mapping
                    changed = True
            else:
                if (
                    len(dims_mapping) >= 2
                    and compatible_dim_mapping != dims_mapping[1]
                ):
                    dims_mapping[1] = compatible_dim_mapping
                    changed = True

        return changed

    @staticmethod
    def forward(ctx, *args, **kwargs):
        dist_op_context = ctx.dist_op_context
        main_block = dist_op_context.work_block
        startup_block = dist_op_context.startup_block
        src_op = dist_op_context.cur_src_op
        rank_id = dist_op_context.rank_id

        # check validation of inputs / outputs
        for input_name in src_op.desc.input_names():
            assert input_name in kwargs, "input [{}] is not given".format(
                input_name
            )
            assert len(kwargs[input_name]) == len(
                src_op.desc.input(input_name)
            ), "number of tensor for input [{}] is not match".format(input_name)
        for output_name in src_op.desc.output_names():
            assert output_name in kwargs, "input [{}] is not given".format(
                output_name
            )
            assert len(kwargs[output_name]) == len(
                src_op.desc.output(output_name)
            ), "number of tensor for input [{}] is not match".format(
                output_name
            )

        # replicate op in dist program
        dist_op_desc = main_block.append_op(type='nop').desc
        dist_op_desc.copy_from(src_op.desc)
        set_dist_op_desc_original_id(dist_op_desc, src_op.desc, ctx)
        for input_name in src_op.desc.input_names():
            dist_op_desc.set_input(input_name, kwargs[input_name])
        for output_name in src_op.desc.output_names():
            dist_op_desc.set_output(output_name, kwargs[output_name])

        # data parallel synchronization for primtive operators
        from paddle.incubate.autograd import prim_enabled

        if prim_enabled():
            assert is_prim_op(src_op)
            prim_operator_data_parallel_functor(ctx, src_op)
            return

        # param initialization sync
        if src_op.type in __op_not_need_param_init__:
            return

        for varname in dist_op_desc.input_arg_names():
            if (
                startup_block.has_var(varname)
                and startup_block.var(varname).is_parameter
                and varname not in dist_op_context.already_init_sync_vars
            ):
                dist_op_context.already_init_sync_vars.add(varname)
                param = startup_block.var(varname)
                param_dist_attr = ctx.get_tensor_dist_attr_for_program(param)
                process_mesh = param_dist_attr.process_mesh
                dims_mapping = param_dist_attr.dims_mapping

                # FIXME (JZ-LIANG) Remove this hack to support any op mesh group for Pipeline Parallelism
                if rank_id not in process_mesh.processes:
                    rank_id = _get_corresponding_rank(
                        ctx, process_mesh, rank_id
                    )

                # NOTE all not splited axis should be presented in mesh
                for axis, size in enumerate(process_mesh.topology):
                    if size <= 1 or axis in dims_mapping:
                        pass
                    else:
                        group_ranks = _get_comm_group(
                            process_mesh.processes,
                            process_mesh.topology,
                            axis,
                            rank_id,
                        )
                        sync_group = new_process_group(group_ranks)

                        new_op = startup_block.append_op(
                            type='c_broadcast',
                            inputs={'X': param},
                            outputs={'Out': param},
                            attrs={
                                'ring_id': sync_group.id,
                                'root': 0,
                                'use_calc_stream': True,
                                OP_ROLE_KEY: OpRole.Forward,
                            },
                        )

                        # set distributed attribute
                        op_attr = OperatorDistributedAttribute()
                        op_attr.process_mesh = process_mesh
                        op_attr.set_output_dims_mapping(
                            param.name, dims_mapping
                        )
                        op_attr.set_input_dims_mapping(param.name, dims_mapping)
                        ctx.set_op_dist_attr_for_program(new_op, op_attr)

    @staticmethod
    def backward(ctx, *args, **kwargs):

        # by now the backward function only insert the gradient allreduce for dist op itself
        dist_op_context = ctx.dist_op_context
        main_block = dist_op_context.work_block
        backward_op = dist_op_context.cur_src_op
        dist_attr = ctx.get_op_dist_attr_for_program(backward_op)
        assert (
            dist_attr is not None
        ), "backward op [{}] don't have dist attribute !".format(
            str(backward_op)
        )
        rank_id = dist_op_context.rank_id

        # check validation of inputs / outputs
        for input_name in backward_op.desc.input_names():
            assert input_name in kwargs, "input [{}] is not given".format(
                input_name
            )
            assert len(kwargs[input_name]) == len(
                backward_op.desc.input(input_name)
            ), "number of tensor for input [{}] is not match".format(input_name)
        for output_name in backward_op.desc.output_names():
            assert output_name in kwargs, "input [{}] is not given".format(
                output_name
            )
            assert len(kwargs[output_name]) == len(
                backward_op.desc.output(output_name)
            ), "number of tensor for input [{}] is not match".format(
                output_name
            )

        # replicate op in dist program
        dist_op_desc = main_block.append_op(type='nop').desc
        dist_op_desc.copy_from(backward_op.desc)
        # Refer to the related dist op
        set_dist_op_desc_original_id(dist_op_desc, backward_op.desc, ctx)
        for input_name in backward_op.desc.input_names():
            dist_op_desc.set_input(input_name, kwargs[input_name])
        for output_name in backward_op.desc.output_names():
            dist_op_desc.set_output(output_name, kwargs[output_name])

        # data parallel gradient synchronization
        act_grad_names = []
        for input_name in backward_op.desc.input_names():
            for varname in backward_op.desc.input(input_name):
                if "@GRAD" not in varname and not is_parameter_related(
                    varname, main_block
                ):
                    act_grad_names.append(varname)

        out_grad_names = []
        for output_name in backward_op.desc.output_names():
            for varname in backward_op.desc.output(output_name):
                if varname in kwargs["grad_var_to_var"]:
                    fwd_name = kwargs["grad_var_to_var"][varname]
                    if not main_block._find_var_recursive(fwd_name):
                        continue
                    if is_parameter_related(fwd_name, main_block):
                        out_grad_names.append(varname)

        gradient_synchronization(
            ctx, backward_op, act_grad_names, out_grad_names, rank_id
        )

register_distributed_operator_impl(
    "default", DistributedDefaultImpl0("replicate_parallel")
)


text:
queries = {
    "column": {
        "head": "select top {n} {column} from {table};",
        "all": "select {column} from {table};",
        "unique": "select distinct {column} from {table};",
        "sample": "select top {n} {column} from {table} order by rand();"
    },
    "table": {
        "select": "select {columns} from {table};",
        "head": "select top {n} * from {table};",
        "all": "select * from {table};",
        "unique": "select distinct {columns} from {table};",
        "sample": "select top {n} * from {table} order by rand();"
    },
    "system": {
        "schema_no_system": """
                select
                    table_name
                    , column_name
                    , data_type
                from
                    information_schema.columns
                where
                    table_schema not in ('information_schema', 'sys')
                """,
        "schema_with_system": """
                select
                    table_name
                    , column_name
                    , data_type
                from
                    information_schema.columns;
                """,
        "schema_specified": """
                select
                    table_name
                    , column_name
                    , data_type
                from
                    information_schema.columns
                where table_schema in (%s);
                """,
        "foreign_keys_for_table": """
            SELECT
                parent_col.name AS foreign_key,
                object_name(referenced_object_id) AS referenced_table,
                col.name AS referenced_column
            FROM sys.foreign_key_columns
            INNER JOIN sys.columns col
                ON col.column_id = referenced_column_id
                    AND col.object_id = referenced_object_id
            INNER JOIN sys.columns parent_col
                ON parent_col.column_id = parent_column_id
                   AND parent_col.object_id = parent_object_id
            WHERE parent_object_id = object_id('%s');
        """,
        "foreign_keys_for_column": """
            SELECT
                object_name(constraint_object_id) AS foreign_key,
                object_name(referenced_object_id) AS referenced_table,
                col.name AS referenced_column
            FROM sys.foreign_key_columns
            INNER JOIN sys.columns col
                ON col.column_id = referenced_column_id
                    AND col.object_id = referenced_object_id
            WHERE parent_object_id = object_id('%s')
                AND constraint_object_id = object_id('%s');
        """,
        "ref_keys_for_table": """
            SELECT
                ref_col.name,
                object_name(parent_object_id),
                col.name as column_name
            FROM sys.foreign_key_columns
            INNER JOIN sys.columns col
               ON col.column_id = parent_column_id
                   AND col.object_id = parent_object_id
            INNER JOIN sys.columns ref_col
                ON ref_col.column_id = referenced_column_id
                   AND ref_col.object_id = referenced_object_id
            WHERE referenced_object_id = object_id('%s');
        """
    }
}


text:
package org.effectivejava.chapter05.item27;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class RecursiveTypeBound {
	// Returns the maximum value in a list - uses recursive type bound
	public static <T extends Comparable<T>> T max(List<T> list) {
		Iterator<T> i = list.iterator();
		T result = i.next();
		while (i.hasNext()) {
			T t = i.next();
			if (t.compareTo(result) > 0)
				result = t;
		}
		return result;
	}

	public static void main(String[] args) {
		List<String> argList = Arrays.asList(args);
		System.out.println(max(argList));
	}
}


text:
from .websockets import UWebSocket, UWSMiddleware, UWSApp

class AsyncWebSocket(UWebSocket):
    def receive(self):
        while True:
            uwsgi.wait_fd_read(self.fd, self.timeout)
            uwsgi.suspend()
            fd = uwsgi.ready_fd()
            if uwsgi.ready_fd() == self.fd:
                return uwsgi.websocket_recv_nb()

class AsyncWSMiddleware(UWSMiddleware):
    client = AsyncWebSocket

class AsyncApp(UWSApp):
    middleware = AsyncWSMiddleware


text:
require 'json'
require 'trollop'
require 'uri'
require 'webmachine'
require 'webmachine/sprockets'

require File.expand_path('../../lib/shared_config', __FILE__)
require File.expand_path('../log_actors', __FILE__)
require File.expand_path('../resources/dashboard', __FILE__)
require File.expand_path('../resources/feed', __FILE__)
require File.expand_path('../resources/pipeline', __FILE__)
require File.expand_path('../resources/recent', __FILE__)
require File.expand_path('../resources/ignores', __FILE__)

opts = Trollop.options do
  opt :url, 'URL to bind to', :default => 'http://localhost:4567'
  opt :redis, 'URL of Redis server', :default => ENV['REDIS_URL'] || 'redis://localhost:6379/0'
end

bind_uri = URI.parse(opts[:url])

R = Redis.new(:url => opts[:redis], :driver => :hiredis)

Pipeline.redis = R
Ignores.redis = R
Recent.redis = R
Feed.redis = R

App = Webmachine::Application.new do |app|
  sprockets = Sprockets::Environment.new
  sprockets.append_path(File.expand_path('../assets/images', __FILE__))
  sprockets.append_path(File.expand_path('../assets/scripts', __FILE__))

  resource = Webmachine::Sprockets.resource_for(sprockets)

  app.configure do |config|
    config.ip = bind_uri.host
    config.port = bind_uri.port
    config.adapter = :Reel
    config.adapter_options[:websocket_handler] = proc do |ws|
      if ws.url == '/stream'
        LogClient.new(ws)
      else
        ws.close
      end
    end
  end

  app.routes do
    add [], Dashboard
    add ['beta'], DashboardBeta
    add ['3'], DashboardBeta
    add ['logs', 'recent'], Recent
    add ['ignores', '*'], Ignores
    add ['pipelines', '*'], Pipeline
    add ['assets', '*'], resource
    add ['feed', 'archivebot.rss'], RssFeed
    add ['feed', 'archivebot.atom'], AtomFeed
    add ['feed'], Feed
  end
end

at_exit do
  # dead code: log_receiver isn't set anywhere
  # Celluloid::Actor[:log_receiver].stop
end

class Broadcaster
  include Celluloid
  include Celluloid::Notifications

  def initialize(channel, input)
    @channel = channel
    @input = input

    async.slurp
  end

  def broadcast(msg)
    publish(@channel, msg)
  end

  def slurp
    @input.each_line { |l| broadcast(l.chomp) }
  end
end

Broadcaster.supervise_as :broadcaster, SharedConfig.log_channel, $stdin

App.run


text:
int p = 2; // CHECK: note: other definition here
int p = 2; // CHECK: error: multiple definitions of "p"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using CodeModel.Graphs;
using NUnit.Framework;
using Tests.EntryPointTests;

namespace Tests.GraphTests
{
    public class FindCyclesTest : IHaveGraph<FindCyclesTest.SampleNode, FindCyclesTest.SampleLink>
    {
        public Graph<FindCyclesTest.SampleNode, FindCyclesTest.SampleLink> Result { get; private set; }

        [Test]
        [TestCase("AB,BA", new[] { "A,B" })]
        [TestCase("AB,BC,CA", new[] { "A,B,C" })]
        [TestCase("AB,BC,CA,DE,EF,FD", new[] { "A,B,C", "D,E,F" })]
        [TestCase("AB,BC,CA,DE,EF,FD,BD", new[] { "A,B,C", "D,E,F" })]
        [TestCase("AB,BC,CD,DE", new string[0])]
        [TestCase("AB,BC,CA,BD,DE,EF,FC", new[] { "A,B,C", "A,B,D,E,F,C" })]
        //[TestCase("AB,AC,CF,BF,FA,AG,FD,BG,BD,GD,GE,EB,DH,EH,HA,GC,CJ,KC,KJ,IK,JI,IG,HI,HG",
        //    new[] { "A,B,F", "A,B,D,F,A", "B,D,H,E", "A,B,D,H,G", "A,F,C", "A,G,C,F", "C,J,I,G" }
        //)] // nice try ;)
        public void ShouldFindProperCycles(string graphSpec, string[] expectedCycles)
        {
            // arrange
            this.Result = new Graph<SampleNode, SampleLink>();
            var nodes = graphSpec.Where(x => x != ',').Distinct().ToDictionary(x => x.ToString(), x => new SampleNode(x.ToString()));

            foreach (var node in nodes)
            {
                this.Result.AddNode(node.Value);
            }

            foreach (var linkSpec in graphSpec.Split(','))
            {
                var source = nodes[linkSpec[0].ToString()];
                var target = nodes[linkSpec[1].ToString()];

                this.Result.AddLink(source, target, new SampleLink());
            }

            var finder = new FindCycles<SampleNode, SampleLink>();

            // act
            var foundCycles = finder.Find(this.Result);

            // assert
            Assert.That(foundCycles.Select(x => x.Select(y => y.Id)), Is
                .EquivalentTo(expectedCycles.Select(x => x.Split(',')))
                );
        }

        public class SampleNode : Node
        {
            public SampleNode(string nodeId)
                : base(nodeId)
            {
            }
        }

        public class SampleLink : Link
        {
        }
    }
}


text:
<?= Yii::t('webuploader', 'Or Drag photos here, a single optional up to 300') ?>

                0%

<?= Yii::t('webuploader', 'Start upload') ?>


text:
package xyz.zimuju.master.util;

import android.content.Context;
import android.text.InputType;
import android.text.TextUtils;
import android.view.View;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;

import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
import xyz.zimuju.master.R;
import xyz.zimuju.master.component.SettingCenter;
import xyz.zimuju.master.entity.bomb.Feedback;

/*
 * @description ApplicationUtils : App 相关的工具类
 * @author Nathaniel
 * @time 2017/8/5 - 13:11
 * @version 1.0.0
 */
public class ApplicationUtils {

    public static boolean isFirstRun() {
        return SharedPreferencesUtils.getInstance().getBoolean("isFirstRun", true);
    }

    public static void setFirstRun(boolean isFirstRun) {
        SharedPreferencesUtils.getInstance().putBoolean("isFirstRun", isFirstRun);
    }

    public static boolean shakePicture() {
        return SharedPreferencesUtils.getInstance().getBoolean("shakePicture", true);
    }

    public static void setShakePicture(boolean isEnable) {
        SharedPreferencesUtils.getInstance().putBoolean("shakePicture", isEnable);
    }

    public static void feedBack(final Context context, final View view) {
        new MaterialDialog.Builder(context)
                .title(R.string.feedback_dialog_title)
                .inputType(InputType.TYPE_CLASS_TEXT)
                .input(R.string.feedback_input_hint, R.string.feedback_input_prefill, new MaterialDialog.InputCallback() {
                    @SuppressWarnings("unchecked")
                    @Override
                    public void onInput(MaterialDialog dialog, CharSequence input) {

                        if (TextUtils.isEmpty(input)) {
                            return;
                        }

                        Feedback feedBack = new Feedback();
                        feedBack.setContent(input.toString());
                        feedBack.setAppVersion(SystemUtils.getAppVersion(context));
                        feedBack.setDeviceName(SystemUtils.getDeviceName());
                        feedBack.setSystemVersion(SystemUtils.getSystemVersion());
                        feedBack.setUsername(AuthorityUtils.getUserName());
                        feedBack.save(new SaveListener() {
                            @Override
                            public void done(Object o, BmobException e) {
                                if (e == null) {
                                    SnackBarUtils.makeShort(view, context.getResources().getString(R.string.feedback_success)).success();
                                } else {
                                    SnackBarUtils.makeShort(view, context.getResources().getString(R.string.feedback_failed)).danger();
                                }
                            }
                        });

                    }
                }).show();
    }

    public static void logout(final Context context, final OnSuccessListener listener) {
        if (!AuthorityUtils.isLogin()) return;
        MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
                .title("提示")
                .content("确定注销吗?")
                .positiveText("确定")
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(MaterialDialog dialog, DialogAction which) {
                        AuthorityUtils.logout();
                        listener.onSuccess();
                    }
                }).negativeText("取消")
                .onNegative(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(MaterialDialog dialog, DialogAction which) {

                    }
                });

        MaterialDialog dialog = builder.build();
        dialog.show();
    }

    public static void clearCache(Context context, final SettingCenter.ClearCacheListener listener) {
        MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
                .title("温馨提示")
                .content("确定清空缓存吗?如果你使用的是移动网络不建议清空缓存哦")
                .positiveText("确定")
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(MaterialDialog dialog, DialogAction which) {
                        SettingCenter.clearAppCache(listener);
                    }
                }).negativeText("取消");

        MaterialDialog dialog = builder.build();
        dialog.show();
    }

    public static String getPackageName() {
        return "xyz.zimuju.master";
    }

    public interface OnSuccessListener {
        void onSuccess();
    }
}


text:
from enum import Enum, auto

class PaymentMethod(Enum):
    Check = auto()
    Card = auto()


text:
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt">
    <aapt:attr name="android:drawable">
        <vector xmlns:android="http://schemas.android.com/apk/res/android"
            android:width="24dp"
            android:height="24dp"
            android:viewportHeight="24"
            android:viewportWidth="24">
            <group
                android:name="group0"
                android:translateX="11"
                android:translateY="7">
                <path
                    android:name="path0"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="group1"
                android:translateX="12"
                android:translateY="7">
                <path
                    android:name="path1"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="group2"
                android:translateX="11"
                android:translateY="11">
                <path
                    android:name="path2"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="group3"
                android:translateX="12"
                android:translateY="11">
                <path
                    android:name="path3"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="group4"
                android:translateX="11"
                android:translateY="14">
                <path
                    android:name="path4"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="group5"
                android:translateX="12"
                android:translateY="14">
                <path
                    android:name="path5"
                    android:fillColor="@color/white"
                    android:pathData="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="0.2" />
            </group>
            <group
                android:name="frame_1"
                android:translateX="3"
                android:translateY="3">
                <path
                    android:name="frame"
                    android:pathData="M 0 9 C 0 4.029 4.029 0 9 0 L 9 0 C 13.971 0 18 4.029 18 9 L 18 9 C 18 13.971 13.971 18 9 18 L 9 18 C 4.029 18 0 13.971 0 9 L 0 9 Z"
                    android:strokeColor="@color/white"
                    android:strokeWidth="2" />
            </group>
        </vector>
    </aapt:attr>
    <target android:name="path0">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 4 0 L 4 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 4 0 L 4 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="path1">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 6 0 L 6 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 6 0 L 6 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 2 L 0 2 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="path2">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueTo="M 0 0 L 6 0 L 6 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 6 0 L 6 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="path3">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueTo="M 0 0 L 4 0 L 4 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 4 0 L 4 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="path4">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueTo="M 0 0 L 2 0 L 2 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 2 0 L 2 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="path5">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueTo="M 0 0 L 8 0 L 8 2 L 0 2 Z"
                    android:valueType="pathType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 0 L 8 0 L 8 2 L 0 2 Z"
                    android:valueTo="M 0 0 L 1 0 L 1 3 L 0 3 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="group0">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="translateX"
                    android:valueFrom="11"
                    android:valueTo="6"
                    android:valueType="floatType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="translateX"
                    android:valueFrom="6"
                    android:valueTo="11"
                    android:valueType="floatType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="group2">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="translateX"
                    android:valueFrom="11"
                    android:valueTo="6"
                    android:valueType="floatType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="translateX"
                    android:valueFrom="6"
                    android:valueTo="11"
                    android:valueType="floatType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="group3">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="translateX"
                    android:valueFrom="12"
                    android:valueTo="14"
                    android:valueType="floatType" />
                <objectAnimator
                    android:duration="100"
                    android:propertyName="translateX"
                    android:valueFrom="14"
                    android:valueTo="12"
                    android:valueType="floatType" />
            </set>
        </aapt:attr>
    </target>
    <target android:name="group4">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <set>
                    <objectAnimator
                        android:duration="300"
                        android:interpolator="@android:interpolator/fast_out_slow_in"
                        android:propertyName="translateX"
                        android:valueFrom="11"
                        android:valueTo="6"
                        android:valueType="floatType" />
                    <objectAnimator
                        android:duration="300"
                        android:interpolator="@android:interpolator/fast_out_slow_in"
                        android:propertyName="translateY"
                        android:valueFrom="14"
                        android:valueTo="15"
                        android:valueType="floatType" />
                </set>
                <set>
                    <objectAnimator
                        android:duration="100"
                        android:propertyName="translateX"
                        android:valueFrom="6"
                        android:valueTo="11"
                        android:valueType="floatType" />
                    <objectAnimator
                        android:duration="100"
                        android:propertyName="translateY"
                        android:valueFrom="15"
                        android:valueTo="14"
                        android:valueType="floatType" />
                </set>
            </set>
        </aapt:attr>
    </target>
    <target android:name="group5">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <set>
                    <objectAnimator
                        android:duration="300"
                        android:interpolator="@android:interpolator/fast_out_slow_in"
                        android:propertyName="translateX"
                        android:valueFrom="12"
                        android:valueTo="10"
                        android:valueType="floatType" />
                    <objectAnimator
                        android:duration="300"
                        android:interpolator="@android:interpolator/fast_out_slow_in"
                        android:propertyName="translateY"
                        android:valueFrom="14"
                        android:valueTo="15"
                        android:valueType="floatType" />
                </set>
                <set>
                    <objectAnimator
                        android:duration="100"
                        android:propertyName="translateX"
                        android:valueFrom="10"
                        android:valueTo="12"
                        android:valueType="floatType" />
                    <objectAnimator
                        android:duration="100"
                        android:propertyName="translateY"
                        android:valueFrom="15"
                        android:valueTo="14"
                        android:valueType="floatType" />
                </set>
            </set>
        </aapt:attr>
    </target>
    <target android:name="frame">
        <aapt:attr name="android:animation">
            <set xmlns:android="http://schemas.android.com/apk/res/android"
                android:ordering="sequentially">
                <objectAnimator
                    android:duration="300"
                    android:interpolator="@android:interpolator/fast_out_slow_in"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 9 C 0 4.029 4.029 0 9 0 L 9 0 C 13.971 0 18 4.029 18 9 L 18 9 C 18 13.971 13.971 18 9 18 L 9 18 C 4.029 18 0 13.971 0 9 L 0 9 Z"
                    android:valueTo="M 0 2 C 0 0.895 0.895 0 2 0 L 16 0 C 17.105 0 18 0.895 18 2 L 18 16 C 18 17.105 17.105 18 16 18 L 2 18 C 0.895 18 0 17.105 0 16 L 0 2 Z"
                    android:valueType="pathType" />

                <objectAnimator
                    android:duration="100"
                    android:propertyName="pathData"
                    android:valueFrom="M 0 2 C 0 0.895 0.895 0 2 0 L 16 0 C 17.105 0 18 0.895 18 2 L 18 16 C 18 17.105 17.105 18 16 18 L 2 18 C 0.895 18 0 17.105 0 16 L 0 2 Z"
                    android:valueTo="M 0 9 C 0 4.029 4.029 0 9 0 L 9 0 C 13.971 0 18 4.029 18 9 L 18 9 C 18 13.971 13.971 18 9 18 L 9 18 C 4.029 18 0 13.971 0 9 L 0 9 Z"
                    android:valueType="pathType" />
            </set>
        </aapt:attr>
    </target>
</animated-vector>


text:
namespace Microsoft.Azure.Management.Compute.Models
{
    using Azure;
    using Management;
    using Compute;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Describes an Operating System disk.
    /// </summary>
    public partial class OSDisk
    {
        /// <summary>
        /// Initializes a new instance of the OSDisk class.
        /// </summary>
        public OSDisk() { }

        /// <summary>
        /// Initializes a new instance of the OSDisk class.
        /// </summary>
        /// <param name="createOption">The create option. Possible values
        /// include: 'fromImage', 'empty', 'attach'</param>
        /// <param name="osType">The Operating System type. Possible values
        /// include: 'Windows', 'Linux'</param>
        /// <param name="encryptionSettings">The disk encryption
        /// settings.</param>
        /// <param name="name">The disk name.</param>
        /// <param name="vhd">The virtual hard disk.</param>
        /// <param name="image">The source user image virtual hard disk. The
        /// virtual hard disk will be copied before using it to attach to the
        /// virtual machine. If SourceImage is provided, the destination
        /// virtual hard disk must not exist.</param>
        /// <param name="caching">The caching type. Possible values include:
        /// 'None', 'ReadOnly', 'ReadWrite'</param>
        /// <param name="diskSizeGB">The initial disk size, in GB, for blank
        /// data disks, and the new desired size for resizing existing OS and
        /// data disks.</param>
        /// <param name="managedDisk">The managed disk parameters.</param>
        public OSDisk(DiskCreateOptionTypes createOption, OperatingSystemTypes? osType = default(OperatingSystemTypes?), DiskEncryptionSettings encryptionSettings = default(DiskEncryptionSettings), string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters))
        {
            OsType = osType;
            EncryptionSettings = encryptionSettings;
            Name = name;
            Vhd = vhd;
            Image = image;
            Caching = caching;
            CreateOption = createOption;
            DiskSizeGB = diskSizeGB;
            ManagedDisk = managedDisk;
        }

        /// <summary>
        /// Gets or sets the Operating System type. Possible values include:
        /// 'Windows', 'Linux'
        /// </summary>
        [JsonProperty(PropertyName = "osType")]
        public OperatingSystemTypes? OsType { get; set; }

        /// <summary>
        /// Gets or sets the disk encryption settings.
        /// </summary>
        [JsonProperty(PropertyName = "encryptionSettings")]
        public DiskEncryptionSettings EncryptionSettings { get; set; }

        /// <summary>
        /// Gets or sets the disk name.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the virtual hard disk.
        /// </summary>
        [JsonProperty(PropertyName = "vhd")]
        public VirtualHardDisk Vhd { get; set; }

        /// <summary>
        /// Gets or sets the source user image virtual hard disk. The virtual
        /// hard disk will be copied before using it to attach to the virtual
        /// machine. If SourceImage is provided, the destination virtual hard
        /// disk must not exist.
        /// </summary>
        [JsonProperty(PropertyName = "image")]
        public VirtualHardDisk Image { get; set; }

        /// <summary>
        /// Gets or sets the caching type. Possible values include: 'None',
        /// 'ReadOnly', 'ReadWrite'
        /// </summary>
        [JsonProperty(PropertyName = "caching")]
        public CachingTypes? Caching { get; set; }

        /// <summary>
        /// Gets or sets the create option. Possible values include:
        /// 'fromImage', 'empty', 'attach'
        /// </summary>
        [JsonProperty(PropertyName = "createOption")]
        public DiskCreateOptionTypes CreateOption { get; set; }

        /// <summary>
        /// Gets or sets the initial disk size, in GB, for blank data disks,
        /// and the new desired size for resizing existing OS and data disks.
        /// </summary>
        [JsonProperty(PropertyName = "diskSizeGB")]
        public int? DiskSizeGB { get; set; }

        /// <summary>
        /// Gets or sets the managed disk parameters.
        /// </summary>
        [JsonProperty(PropertyName = "managedDisk")]
        public ManagedDiskParameters ManagedDisk { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (EncryptionSettings != null)
            {
                EncryptionSettings.Validate();
            }
        }
    }
}


text:
/*
 * Created on Feb 12, 2005
 * by Christopher Bradford
 *
 */
package org.cfeclipse.cfml.wizards.templatefilewizard;

import java.io.File;
import java.io.FileFilter;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;

import org.cfeclipse.cfml.views.snips.SnipTreeViewContentProvider;
import org.cfeclipse.snipex.SnipEx;
import org.cfeclipse.snipex.Library;
import org.cfeclipse.snipex.Snippet;

/**
 * @author Christopher Bradford
 *
 */
public class TemplateSnipTreeViewContentProvider extends SnipTreeViewContentProvider {

	protected static FileFilter snippetfilter = new TemplateSnippetFileFilter(false);

	/**
     * @param root
     */
    public TemplateSnipTreeViewContentProvider(File root) {
        super(root);
    }

    public Object[] getElements(Object inputElement) {
        // return super.getElements(inputElement);
		if(inputElement instanceof File) {
			if(((File)inputElement).isDirectory()) {
				//return getFlattenedElements((File)inputElement).toArray();
				Object[] files = getFlattenedElements((File)inputElement).toArray();

				// Also get snippets from snipex locations
				/* TODO: When we can handle file snippets, put this back in
				try {
					URL url = new URL("http://localhost/eclipse/snipex/web/SnipEx.cfc");
					files = appendArrays(files, getFlattenedElements( new SnipEx( url ) ).toArray());
				} catch(MalformedURLException e) {
					System.err.println("Snipex URL failed:"+e);
					return files;
				} catch(Exception e) {
					System.err.println("Snipex failed to load:"+e);
					return files;
				}
				*/

				return files;
			}
		}

		return EMPTY_ARRAY;
    }

    private ArrayList getFlattenedElements(Object inputElement) {
        ArrayList allFiles = new ArrayList();
        if (inputElement instanceof File) {
            File currentFile = ((File)inputElement);
            if (currentFile.isDirectory()) {
                File[] templateSnips = currentFile.listFiles(snippetfilter);
                for (int i=0;i<templateSnips.length;i++) {
                    allFiles.add(templateSnips[i]);
                }
                File[] childDirs = currentFile.listFiles(new FileFilter() {
                    public boolean accept(File f) {
                        if (f.isDirectory()) {
                            return true;
                        }
                        return false;
                    }
                });
                for (int i=0;i<childDirs.length;i++) {
                    allFiles.addAll(getFlattenedElements(childDirs[i]));
                }
            }
            //return getFlattenedElements
        } else if(inputElement instanceof SnipEx || inputElement instanceof Library) {
        	Library lib = ((Library)inputElement);
        	Iterator it = lib.getSnippets().iterator();

        	while( it.hasNext() ) {
        		Snippet snip = (Snippet)it.next();
        		if( snip.isTemplate() ) {
        			allFiles.add(snip);
        		}
        	}

        }
        return allFiles; // temporary
    }

    /**
     * Utility method to append two arrays
     * @param array1 First array to append
     * @param array2 Second array to append
     * @return A new array which is a combination of the two arrays
     */
	public static Object[] appendArrays(Object[] array1, Object[] array2) {
		Object[] newArray = new Object[array1.length + array2.length];
		System.arraycopy(array1, 0, newArray, 0, array1.length);
		System.arraycopy(array2, 0, newArray, array1.length, array2.length);
		return newArray;
	}
}


text:
{-# htermination delListFromFM :: FiniteMap Bool b -> [Bool] -> FiniteMap Bool b #-}
import FiniteMap