text:
struct NotSwappable {};
void swap(NotSwappable &, NotSwappable &) = delete;

struct NotCopyable {
  NotCopyable() = default;
  NotCopyable(const NotCopyable &) = delete;
  NotCopyable &operator=(const NotCopyable &) = delete;
};

struct NotCopyableWithSwap {
  NotCopyableWithSwap() = default;
  NotCopyableWithSwap(const NotCopyableWithSwap &) = delete;
  NotCopyableWithSwap &operator=(const NotCopyableWithSwap &) = delete;
};
void swap(NotCopyableWithSwap &, NotCopyableWithSwap) {}

struct NotMoveAssignable {
  NotMoveAssignable() = default;
  NotMoveAssignable(NotMoveAssignable &&) = default;
  NotMoveAssignable &operator=(NotMoveAssignable &&) = delete;
};

struct NotMoveAssignableWithSwap {
  NotMoveAssignableWithSwap() = default;
  NotMoveAssignableWithSwap(NotMoveAssignableWithSwap &&) = default;
  NotMoveAssignableWithSwap &operator=(NotMoveAssignableWithSwap &&) = delete;
};
void swap(NotMoveAssignableWithSwap &, NotMoveAssignableWithSwap &) noexcept {}

template <bool Throws> void do_throw() {}

template <> void do_throw<true>() {
#ifndef TEST_HAS_NO_EXCEPTIONS
  throw 42;
#else
  std::abort();
#endif
}

template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
          bool NT_Swap, bool EnableSwap = true>
struct NothrowTypeImp {
  static int move_called;
  static int move_assign_called;
  static int swap_called;
  static void reset() { move_called = move_assign_called = swap_called = 0; }
  NothrowTypeImp() = default;
  explicit NothrowTypeImp(int v) : value(v) {}
  NothrowTypeImp(const NothrowTypeImp &o) noexcept(NT_Copy) : value(o.value) {
    assert(false);
  } // never called by test
  NothrowTypeImp(NothrowTypeImp &&o) noexcept(NT_Move) : value(o.value) {
    ++move_called;
    do_throw<!NT_Move>();
    o.value = -1;
  }
  NothrowTypeImp &operator=(const NothrowTypeImp &) noexcept(NT_CopyAssign) {
    assert(false);
    return *this;
  } // never called by the tests
  NothrowTypeImp &operator=(NothrowTypeImp &&o) noexcept(NT_MoveAssign) {
    ++move_assign_called;
    do_throw<!NT_MoveAssign>();
    value = o.value;
    o.value = -1;
    return *this;
  }
  int value;
};
template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
          bool NT_Swap, bool EnableSwap>
int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
                   EnableSwap>::move_called = 0;
template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
          bool NT_Swap, bool EnableSwap>
int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
                   EnableSwap>::move_assign_called = 0;
template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
          bool NT_Swap, bool EnableSwap>
int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
                   EnableSwap>::swap_called = 0;

template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
          bool NT_Swap>
void swap(NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign,
                         NT_Swap, true> &lhs,
          NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign,
                         NT_Swap, true> &rhs) noexcept(NT_Swap) {
  lhs.swap_called++;
  do_throw<!NT_Swap>();
  int tmp = lhs.value;
  lhs.value = rhs.value;
  rhs.value = tmp;
}

// throwing copy, nothrow move ctor/assign, no swap provided
using NothrowMoveable = NothrowTypeImp<false, true, false, true, false, false>;
// throwing copy and move assign, nothrow move ctor, no swap provided
using NothrowMoveCtor = NothrowTypeImp<false, true, false, false, false, false>;
// nothrow move ctor, throwing move assignment, swap provided
using NothrowMoveCtorWithThrowingSwap =
    NothrowTypeImp<false, true, false, false, false, true>;
// throwing move ctor, nothrow move assignment, no swap provided
using ThrowingMoveCtor =
    NothrowTypeImp<false, false, false, true, false, false>;
// throwing special members, nothrowing swap
using ThrowingTypeWithNothrowSwap =
    NothrowTypeImp<false, false, false, false, true, true>;
using NothrowTypeWithThrowingSwap =
    NothrowTypeImp<true, true, true, true, false, true>;
// throwing move assign with nothrow move and nothrow swap
using ThrowingMoveAssignNothrowMoveCtorWithSwap =
    NothrowTypeImp<false, true, false, false, true, true>;
// throwing move assign with nothrow move but no swap.
using ThrowingMoveAssignNothrowMoveCtor =
    NothrowTypeImp<false, true, false, false, false, false>;

struct NonThrowingNonNoexceptType {
  static int move_called;
  static void reset() { move_called = 0; }
  NonThrowingNonNoexceptType() = default;
  NonThrowingNonNoexceptType(int v) : value(v) {}
  NonThrowingNonNoexceptType(NonThrowingNonNoexceptType &&o) noexcept(false)
      : value(o.value) {
    ++move_called;
    o.value = -1;
  }
  NonThrowingNonNoexceptType &
  operator=(NonThrowingNonNoexceptType &&) noexcept(false) {
    assert(false); // never called by the tests.
    return *this;
  }
  int value;
};
int NonThrowingNonNoexceptType::move_called = 0;

struct ThrowsOnSecondMove {
  int value;
  int move_count;
  ThrowsOnSecondMove(int v) : value(v), move_count(0) {}
  ThrowsOnSecondMove(ThrowsOnSecondMove &&o) noexcept(false)
      : value(o.value), move_count(o.move_count + 1) {
    if (move_count == 2)
      do_throw<true>();
    o.value = -1;
  }
  ThrowsOnSecondMove &operator=(ThrowsOnSecondMove &&) {
    assert(false); // not called by test
    return *this;
  }
};

void test_swap_valueless_by_exception() {
#ifndef TEST_HAS_NO_EXCEPTIONS
  using V = std::variant<int, MakeEmptyT>;
  { // both empty
    V v1;
    makeEmpty(v1);
    V v2;
    makeEmpty(v2);
    assert(MakeEmptyT::alive == 0);
    { // member swap
      v1.swap(v2);
      assert(v1.valueless_by_exception());
      assert(v2.valueless_by_exception());
      assert(MakeEmptyT::alive == 0);
    }
    { // non-member swap
      swap(v1, v2);
      assert(v1.valueless_by_exception());
      assert(v2.valueless_by_exception());
      assert(MakeEmptyT::alive == 0);
    }
  }
  { // only one empty
    V v1(42);
    V v2;
    makeEmpty(v2);
    { // member swap
      v1.swap(v2);
      assert(v1.valueless_by_exception());
      assert(std::get<0>(v2) == 42);
      // swap again
      v2.swap(v1);
      assert(v2.valueless_by_exception());
      assert(std::get<0>(v1) == 42);
    }
    { // non-member swap
      swap(v1, v2);
      assert(v1.valueless_by_exception());
      assert(std::get<0>(v2) == 42);
      // swap again
      swap(v1, v2);
      assert(v2.valueless_by_exception());
      assert(std::get<0>(v1) == 42);
    }
  }
#endif
}

void test_swap_same_alternative() {
  {
    using T = ThrowingTypeWithNothrowSwap;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<0>, 100);
    v1.swap(v2);
    assert(T::swap_called == 1);
    assert(std::get<0>(v1).value == 100);
    assert(std::get<0>(v2).value == 42);
    swap(v1, v2);
    assert(T::swap_called == 2);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<0>(v2).value == 100);
  }
  {
    using T = NothrowMoveable;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<0>, 100);
    v1.swap(v2);
    assert(T::swap_called == 0);
    assert(T::move_called == 1);
    assert(T::move_assign_called == 2);
    assert(std::get<0>(v1).value == 100);
    assert(std::get<0>(v2).value == 42);
    T::reset();
    swap(v1, v2);
    assert(T::swap_called == 0);
    assert(T::move_called == 1);
    assert(T::move_assign_called == 2);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<0>(v2).value == 100);
  }
#ifndef TEST_HAS_NO_EXCEPTIONS
  {
    using T = NothrowTypeWithThrowingSwap;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<0>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T::swap_called == 1);
    assert(T::move_called == 0);
    assert(T::move_assign_called == 0);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<0>(v2).value == 100);
  }
  {
    using T = ThrowingMoveCtor;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<0>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T::move_called == 1); // call threw
    assert(T::move_assign_called == 0);
    assert(std::get<0>(v1).value ==
           42); // throw happened before v1 was moved from
    assert(std::get<0>(v2).value == 100);
  }
  {
    using T = ThrowingMoveAssignNothrowMoveCtor;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<0>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T::move_called == 1);
    assert(T::move_assign_called == 1);  // call threw and didn't complete
    assert(std::get<0>(v1).value == -1); // v1 was moved from
    assert(std::get<0>(v2).value == 100);
  }
#endif
}

void test_swap_different_alternatives() {
  {
    using T = NothrowMoveCtorWithThrowingSwap;
    using V = std::variant<T, int>;
    T::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    v1.swap(v2);
    assert(T::swap_called == 0);
    // The libc++ implementation double copies the argument, and not
    // the variant swap is called on.
    LIBCPP_ASSERT(T::move_called == 1);
    assert(T::move_called <= 2);
    assert(T::move_assign_called == 0);
    assert(std::get<1>(v1) == 100);
    assert(std::get<0>(v2).value == 42);
    T::reset();
    swap(v1, v2);
    assert(T::swap_called == 0);
    LIBCPP_ASSERT(T::move_called == 2);
    assert(T::move_called <= 2);
    assert(T::move_assign_called == 0);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<1>(v2) == 100);
  }
#ifndef TEST_HAS_NO_EXCEPTIONS
  {
    using T1 = ThrowingTypeWithNothrowSwap;
    using T2 = NonThrowingNonNoexceptType;
    using V = std::variant<T1, T2>;
    T1::reset();
    T2::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T1::swap_called == 0);
    assert(T1::move_called == 1); // throws
    assert(T1::move_assign_called == 0);
    // FIXME: libc++ shouldn't move from T2 here.
    LIBCPP_ASSERT(T2::move_called == 1);
    assert(T2::move_called <= 1);
    assert(std::get<0>(v1).value == 42);
    if (T2::move_called != 0)
      assert(v2.valueless_by_exception());
    else
      assert(std::get<1>(v2).value == 100);
  }
  {
    using T1 = NonThrowingNonNoexceptType;
    using T2 = ThrowingTypeWithNothrowSwap;
    using V = std::variant<T1, T2>;
    T1::reset();
    T2::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    LIBCPP_ASSERT(T1::move_called == 0);
    assert(T1::move_called <= 1);
    assert(T2::swap_called == 0);
    assert(T2::move_called == 1); // throws
    assert(T2::move_assign_called == 0);
    if (T1::move_called != 0)
      assert(v1.valueless_by_exception());
    else
      assert(std::get<0>(v1).value == 42);
    assert(std::get<1>(v2).value == 100);
  }
// FIXME: The tests below are just very libc++ specific
#ifdef _LIBCPP_VERSION
  {
    using T1 = ThrowsOnSecondMove;
    using T2 = NonThrowingNonNoexceptType;
    using V = std::variant<T1, T2>;
    T2::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    v1.swap(v2);
    assert(T2::move_called == 2);
    assert(std::get<1>(v1).value == 100);
    assert(std::get<0>(v2).value == 42);
    assert(std::get<0>(v2).move_count == 1);
  }
  {
    using T1 = NonThrowingNonNoexceptType;
    using T2 = ThrowsOnSecondMove;
    using V = std::variant<T1, T2>;
    T1::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T1::move_called == 1);
    assert(v1.valueless_by_exception());
    assert(std::get<0>(v2).value == 42);
  }
#endif
// testing libc++ extension. If either variant stores a nothrow move
// constructible type v1.swap(v2) provides the strong exception safety
// guarantee.
#ifdef _LIBCPP_VERSION
  {

    using T1 = ThrowingTypeWithNothrowSwap;
    using T2 = NothrowMoveable;
    using V = std::variant<T1, T2>;
    T1::reset();
    T2::reset();
    V v1(std::in_place_index<0>, 42);
    V v2(std::in_place_index<1>, 100);
    try {
      v1.swap(v2);
      assert(false);
    } catch (int) {
    }
    assert(T1::swap_called == 0);
    assert(T1::move_called == 1);
    assert(T1::move_assign_called == 0);
    assert(T2::swap_called == 0);
    assert(T2::move_called == 2);
    assert(T2::move_assign_called == 0);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<1>(v2).value == 100);
    // swap again, but call v2's swap.
    T1::reset();
    T2::reset();
    try {
      v2.swap(v1);
      assert(false);
    } catch (int) {
    }
    assert(T1::swap_called == 0);
    assert(T1::move_called == 1);
    assert(T1::move_assign_called == 0);
    assert(T2::swap_called == 0);
    assert(T2::move_called == 2);
    assert(T2::move_assign_called == 0);
    assert(std::get<0>(v1).value == 42);
    assert(std::get<1>(v2).value == 100);
  }
#endif // _LIBCPP_VERSION
#endif
}

template <class Var>
constexpr auto has_swap_member_imp(int)
    -> decltype(std::declval<Var &>().swap(std::declval<Var &>()), true) {
  return true;
}

template <class Var> constexpr auto has_swap_member_imp(long) -> bool {
  return false;
}

template <class Var> constexpr bool has_swap_member() {
  return has_swap_member_imp<Var>(0);
}

void test_swap_sfinae() {
  {
    // This variant type does not provide either a member or non-member swap
    // but is still swappable via the generic swap algorithm, since the
    // variant is move constructible and move assignable.
    using V = std::variant<int, NotSwappable>;
    LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
    static_assert(std::is_swappable_v<V>, "");
  }
  {
    using V = std::variant<int, NotCopyable>;
    LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
    static_assert(!std::is_swappable_v<V>, "");
  }
  {
    using V = std::variant<int, NotCopyableWithSwap>;
    LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
    static_assert(!std::is_swappable_v<V>, "");
  }
  {
    using V = std::variant<int, NotMoveAssignable>;
    LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
    static_assert(!std::is_swappable_v<V>, "");
  }
}

void test_swap_noexcept() {
  {
    using V = std::variant<int, NothrowMoveable>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    using V = std::variant<int, NothrowMoveCtor>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(!std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    using V = std::variant<int, ThrowingTypeWithNothrowSwap>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(!std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    using V = std::variant<int, ThrowingMoveAssignNothrowMoveCtor>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(!std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    using V = std::variant<int, ThrowingMoveAssignNothrowMoveCtorWithSwap>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    using V = std::variant<int, NotMoveAssignableWithSwap>;
    static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
    static_assert(std::is_nothrow_swappable_v<V>, "");
    // instantiate swap
    V v1, v2;
    v1.swap(v2);
    swap(v1, v2);
  }
  {
    // This variant type does not provide either a member or non-member swap
    // but is still swappable via the generic swap algorithm, since the
    // variant is move constructible and move assignable.
    using V = std::variant<int, NotSwappable>;
    LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
    static_assert(std::is_swappable_v<V>, "");
    static_assert(std::is_nothrow_swappable_v<V>, "");
    V v1, v2;
    swap(v1, v2);
  }
}

#ifdef _LIBCPP_VERSION
// This is why variant should SFINAE member swap. :-)
template class std::variant<int, NotSwappable>;
#endif

int main(int, char**) {
  test_swap_valueless_by_exception();
  test_swap_same_alternative();
  test_swap_different_alternatives();
  test_swap_sfinae();
  test_swap_noexcept();

  return 0;
}


text:
require 'spec_helper'

describe "facility_notices", type: :feature, dbscope: :example, js: true do
  let(:site) { cms_site }
  let(:node) { create_once :facility_node_page, name: "facility" }
  let(:item) { create(:facility_notice, cur_node: node) }

  let(:index_path) { facility_notices_path site, node }
  let(:new_path) { new_facility_notice_path site, node }
  let(:show_path) { facility_notice_path site, node, item }
  let(:edit_path) { edit_facility_notice_path site, node, item }
  let(:delete_path) { delete_facility_notice_path site, node, item }

  context "basic crud" do
    before { login_cms_user }

    it "#index" do
      visit index_path
      expect(current_path).not_to eq sns_login_path
    end

    it "#new" do
      visit new_path
      within "form#item-form" do
        fill_in "item[name]", with: "sample"
        click_on I18n.t("ss.links.input")
        fill_in "item[basename]", with: "sample"
        click_on I18n.t("ss.buttons.draft_save")
      end
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))

      expect(page).to have_css("#workflow_route", text: I18n.t("mongoid.attributes.workflow/model/route.my_group"))
    end

    it "#show" do
      visit show_path
      expect(page).to have_css("#addon-basic", text: item.name)
    end

    it "#edit" do
      visit edit_path
      within "form#item-form" do
        fill_in "item[name]", with: "modify"
        click_on I18n.t("ss.buttons.publish_save")
      end
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))
    end

    it "#delete" do
      visit delete_path
      within "form" do
        click_on I18n.t("ss.buttons.delete")
      end
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.deleted'))
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
Guide for GILDAS-CLASS users
============================

Reading Files
~~~~~~~~~~~~~
PySpecKit can read many file types including CLASS .cls files.

For example, a typical single-dish observing file will consist of a large number of
individual spectra.  These may be on-the-fly spectra or multiple integrations on a single source;
either way the pointing and spectral information for each individual data point should be
incorporated in the data file.

The spectra are recorded from the data file into an
:class:`pyspeckit.classes.ObsBlock` object.   An ObsBlock (Observation Block) is simply a container
for many spectra; in most regards it behaves the same way as a :class:`pyspeckit.Spectrum` object,
but it has a few extra attributes built-in (e.g., spectral averaging).

A file can be loaded as a named object.
The data is filtered as it is read in.  The following line will ensure that the spectra in the
`n2hp` ObsBlock contain only data from the F1M spectrometer with lines labeled 'N2HP(3-2)'
or 'N2H+(3-2)'::

    from pyspeckit.spectrum.readers.read_class import class_to_obsblocks
    n2hp = class_to_obsblocks(filename,
        telescope=['SMT-F1M-HU','SMT-F1M-VU'],
        line=['N2HP(3-2)','N2H+(3-2)'])

Working with the data
~~~~~~~~~~~~~~~~~~~~~
You can treat an ObsBlock like any other `pyspeckit.Spectrum` object, but there
are a few unique features.

The 'smooth' function will smooth each individual spectrum in the ObsBlock, which
can be useful if you want to smooth before averaging.

The 'average' function averages spectra.  Weights for the averaging can be specified.
The error is also computed either by taking the RMS of the averaged spectra or by
averaging the error spectra.

You can plot each spectrum in an individual window with the `ploteach` function, or all
overlaid simultaneously with the 'plotter' function.  If you want to loop through each
spectrum, waiting for user input after displaying, you can do something like::

    ax = pylab.gca()
    for sp in n2hp:
        sp.plotter(axis=ax)
        input("Waiting for input...")

You can also fit a line profile to *each* spectrum in the observation block using the 'fiteach'
command.

Selecting Spectra
~~~~~~~~~~~~~~~~~

There are 3 keywords that can be used to select spectra when reading in a file.  The
`line` and `telescope` keywords are required in order to make an observation block, otherwise
the spectral axes will not be common to all spectra.::

    n2hp = class_to_obsblocks(filename,
        telescope=['SMT-F1M-HU','SMT-F1M-VU'],
        line=['N2HP(3-2)','N2H+(3-2)'])

If you want to read in all of the data and don't care about the line or telescope, you can instead use::

    all_data = class_to_spectra(filename)

You can select data after they are read in by matching header keywords::

    g10 = pyspeckit.ObsBlock([sp for sp in all_data if sp.specname == 'g10'])

Fitting Data
~~~~~~~~~~~~
In CLASS, you would specify the data range with individual commands on the command line, e.g.::

    [this isn't quite right]
    xrange 5 25

In pyspeckit, you can specify the range in multiple ways, but the default is to
use the plotted window.  For example::

    sp.plotter(xmin=5, xmax=25)
    sp.baseline()
    sp.specfit()

will perform a baseline fit and spectrum fit over the range 5-25 km/s (the
units of xmin, xmax are the plotted units).  More intricate specifications
are possible::

    sp.plotter()
    # Fit a baseline over the region 5-25 km/s, excluding 7-10 km/s and 15-18 km/s
    sp.baseline.selectregion(xmin=5,xmax=25,exclude=[7,10,15,18])
    sp.baseline()
    sp.specfit()


text:
<?php

namespace Minsal\Sipernes\AplicacionesBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
//use Sonata\AdminBundle\Controller\CRUDController as Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Minsal\Metodos\Funciones;
use Minsal\SipernesBundle\Entity\EnfDosisEsquemaVacAdmin;
use Symfony\Component\HttpFoundation\Session\Session;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\Response;
class EnfDosisEsquemaVacController extends Controller
{

    /**
     *@Route("/recibir/tipoaplicaciones/todos/", name="get_TipoAplicacion", options={"expose"=true})
     */
    public function getTipoaplicacionAction() {
        $em = $this->getDoctrine()->getManager();

        $dql = "SELECT o
                FROM MinsalSipernesBundle:EnfCtlTipoComponente o
                WHERE o.estadoTclTComp = true
                ";
        $tipoaplicacion['tipoaplicacion'] = $em->createQuery($dql)
                ->getArrayResult();

        return new Response(json_encode($tipoaplicacion));
    }

   /**
     *@Route("/recibir/fasess/{id}", name="get_Aplicacion", options={"expose"=true})
     */
    public function getAplicacionesAction($id) {
        $em = $this->getDoctrine()->getManager();

        $dql = "SELECT o
                FROM MinsalSipernesBundle:EnfEsquemaVac o
                 WHERE o.idTipoAplicacion = :id AND o.estadoVac = true";
        $fases['fases'] = $em->createQuery($dql)->setParameter('id', $id)->getArrayResult();

        return new Response(json_encode($fases));

    }

    /**
     *@Route("/recibir/tipocomponentes/{id}", name="get_TipoComponente", options={"expose"=true})
     */
    public function getTipocomponentesAction($id) {
        $em = $this->getDoctrine()->getManager();

        $dql = "SELECT o
                FROM MinsalSipernesBundle:EnfTipoEsquemaVac o
                WHERE o.idEsquemaVac= :id AND o.estadoTipoVac = true
                ";
         $tipocomponente['tipocomponente'] = $em->createQuery($dql)->setParameter('id', $id)->getArrayResult();

        return new Response(json_encode($tipocomponente));
    }

}

?>


text:
package ext.sample;

import ext.extensions.typeface.Font;

/**
 * Created by evelina on 15/09/14.
 */
public enum LobsterFont implements Font {
	LOBSTER_NORMAL("fonts/Lobster.ttf");

	private String mName;

	LobsterFont(String name) {
		mName = name;
	}

	@Override
	public String getName() {
		return mName;
	}
}


text:
namespace Swensen.Ior.Forms
{
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;

    [Serializable()]public class CustomChoices : ArrayList
	{
		public CustomChoices(ArrayList array, bool IsSorted)
		{
			this.AddRange(array);
			if (IsSorted)
			{
				this.Sort();
			}
		}

		public CustomChoices(ArrayList array)
		{
			this.AddRange(array);
		}

		public CustomChoices(string[] array, bool IsSorted)
		{
			this.AddRange(array);
			if (IsSorted)
			{
				this.Sort();
			}
		}

		public CustomChoices(string[] array)
		{
			this.AddRange(array);
		}

		public CustomChoices(int[] array, bool IsSorted)
		{
			this.AddRange(array);
			if (IsSorted)
			{
				this.Sort();
			}
		}

		public CustomChoices(int[] array)
		{
			this.AddRange(array);
		}

		public CustomChoices(double[] array, bool IsSorted)
		{
			this.AddRange(array);
			if (IsSorted)
			{
				this.Sort();
			}
		}

		public CustomChoices(double[] array)
		{
			this.AddRange(array);
		}

		public CustomChoices(object[] array, bool IsSorted)
		{
			this.AddRange(array);
			if (IsSorted)
			{
				this.Sort();
			}
		}

		public CustomChoices(object[] array)
		{
			this.AddRange(array);
		}

		public ArrayList Items
		{
			get
			{
				return this;
			}
		}

		public class CustomChoicesTypeConverter : TypeConverter
		{

			private CustomChoicesAttributeList oChoices = null;
			public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context)
			{
				bool returnValue;
				CustomChoicesAttributeList Choices =  (CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)];
				if (oChoices != null)
				{
					return true;
				}
				if (Choices != null)
				{
					oChoices = Choices;
					returnValue = true;
				}
				else
				{
					returnValue = false;
				}
				return returnValue;
			}
			public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context)
			{
				bool returnValue;
				CustomChoicesAttributeList Choices =  (CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)];
				if (oChoices != null)
				{
					return true;
				}
				if (Choices != null)
				{
					oChoices = Choices;
					returnValue = true;
				}
				else
				{
					returnValue = false;
				}
				return returnValue;
			}
			public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context)
			{
				CustomChoicesAttributeList Choices =  (CustomChoices.CustomChoicesAttributeList) context.PropertyDescriptor.Attributes[typeof(CustomChoicesAttributeList)];
				if (oChoices != null)
				{
					return oChoices.Values;
				}
				return base.GetStandardValues(context);
			}
		}

		public class CustomChoicesAttributeList : Attribute
		{

			private ArrayList oList = new ArrayList();

			public ArrayList Item
			{
				get
				{
					return this.oList;
				}
			}

			public TypeConverter.StandardValuesCollection Values
			{
				get
				{
					return new TypeConverter.StandardValuesCollection(this.oList);
				}
			}

			public CustomChoicesAttributeList(string[] List)
			{
				oList.AddRange(List);
			}

			public CustomChoicesAttributeList(ArrayList List)
			{
				oList.AddRange(List);
			}

			public CustomChoicesAttributeList(ListBox.ObjectCollection List)
			{
				oList.AddRange(List);
			}
		}
	}
}


text:
package org.usfirst.frc.team4453.robot.commands;

import org.usfirst.frc.team4453.robot.Robot;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 */
public class CmdAutoLowerChiliChoppers extends Command {

	private double angle;

    public CmdAutoLowerChiliChoppers() {
        // Use requires() here to declare subsystem dependencies
        requires(Robot.shooter);
       	angle   = SmartDashboard.getNumber("ccDnAngle", -28.6);	// degrees
    }

    // Called just before this Command runs the first time
    protected void initialize() {
       	System.out.println("AutoLowerChiliChoppers");
    	Robot.shooter.tiltSetAngle(angle);
       	System.out.println("ccDnAngle: "+angle);
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
//        return Robot.shooter.onTarget();
        return (Math.abs(Robot.shooter.getSetpoint() - Robot.shooter.tiltGetDist()) < 0.25);
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
<?php

declare(strict_types=1);

namespace EmagTechLabs\AnnotationCacheBundle\Tests\Functional;

use EmagTechLabs\AnnotationCacheBundle\ProxyManager\Factory\ProxyCachingObjectFactory;
use EmagTechLabs\AnnotationCacheBundle\Tests\Functional\App\TestKernel;
use EmagTechLabs\AnnotationCacheBundle\Tests\Functional\Utils\PublicServiceForTestsCompilerCompilerPass;
use ProxyManager\Inflector\ClassNameInflector;
use ProxyManager\Version;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

abstract class AnnotationCacheTestCase extends KernelTestCase
{
    /**
     * @var CompilerPassInterface[]
     */
    protected static $compilerPasses = [];

    /**
     * @param string $filename
     * @param string $message
     */
    protected function assertFileNotCreated(string $filename, string $message = ''): void
    {
        if (method_exists($this, 'assertFileDoesNotExist')) {
            $this->assertFileDoesNotExist($filename, $message);
        } else {
            $this->assertFileNotExists($filename, $message);
        }
    }

    protected static function getKernelClass()
    {
        return TestKernel::class;
    }

    protected static function createKernel(array $options = [])
    {
        $kernel = parent::createKernel($options);
        $kernel->addCompilerPasses(static::$compilerPasses);

        return $kernel;
    }

    protected function setUp(): void
    {
        parent::setUp();

        static::$class = null;
        static::addCompilerPass(new PublicServiceForTestsCompilerCompilerPass());
    }

    /**
     * @param CompilerPassInterface $compilerPass
     */
    protected static function addCompilerPass(CompilerPassInterface $compilerPass)
    {
        static::$compilerPasses[] = $compilerPass;
    }

    protected function tearDown(): void
    {
        parent::tearDown();
        static::$class = null;
    }

    protected function getCacheFileName(string $cachePath, string $className, ClassNameInflector $classNameInflector)
    {
        return sprintf(
            '%s%s.php',
            $cachePath,
            str_replace(
                "\\",
                '',
                $classNameInflector->getProxyClassName(
                    $className,
                    [
                        'className' => $className,
                        'factory' => ProxyCachingObjectFactory::class,
                        'proxyManagerVersion' => Version::getVersion(),
                        'proxyOptions' => [],
                    ]
                )
            )
        );
    }
}


text:
PORTNAME=	System.Numerics.Vectors
PORTVERSION=	1.0.0.0

DOTNET_RESOURCE_COMMAND=@cd ${WRKSRC}/src/${PORTNAME}/src/Resources && ${DOTNET_RESGEN} Strings.resx,FxResources.${PORTNAME}.SR.resources

DOTNET_RESOURCES+=      ${DOTNET_RES}:${WRKSRC}/src/${PORTNAME}/src/Resources/FxResources.${PORTNAME}.SR.resources

DOTNET_FILES+=	${WRKSRC}/src/Common/src/System/SR.cs

.include <../../dotnet/coreclr/corefx.common>


text: export * from "./SlideShow";


text:
namespace SharedWeekends.MVC
{
    using System.Web;
    using System.Web.Mvc;
    using System.Web.Optimization;
    using System.Web.Routing;

    using SharedWeekends.MVC.Infrastructure.Mapping;
    using System.Data.Entity;
    using SharedWeekends.Data.Migrations;
    using SharedWeekends.Data;

    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<WeekendsDbContext, Configuration>());
            ViewEnginesConfiguration.RegisterViewEngine(ViewEngines.Engines);
            AutoMapperConfig.Execute();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}


text:
<?php

use common\models\User;

class UserTest extends \Codeception\TestCase\Test
{
    /**
     * @var \UnitTester
     */
    protected $tester;

    protected function _before()
    {
	//parent::setUp();
	//$this->loadFixtures(['user']);
    }

    protected function _after()
    {
    }

    // tests
    public function testUsername()
    {
        $user = new User();

        $user->username = null;
        $this->assertFalse($user->validate(['username']));

        $user->username = 'toolooooongnaaaaaaameeee';
        $this->assertFalse($user->validate(['username']));

        $user->username = 'dave%009$#rt';
        $this->assertFalse($user->validate(['username']));

        $user->username = 'dave';
        $this->assertTrue($user->validate(['username']));
    }

    public function testEmail()
    {
        $user = new User();

        $user->email = null;
        $this->assertFalse($user->validate(['email']));

        $user->email = 'toolooooongnaaaaaaameeee';
        $this->assertFalse($user->validate(['email']));

        $user->email = 'dave%009$#rt';
        $this->assertFalse($user->validate(['email']));

        $user->email = 'dap3065@yahoo.com';
        $this->assertTrue($user->validate(['email']));
    }

    public function testPassword() {
        $user = new User();

        $user->email = 'dap3065@yahoo.com';
	$user->username = 'dap3065';
	$user->setPassword('dap3065Password');
	$user->status = 10;
        $this->assertTrue($user->validate());

	$password = 'wrong';
	$this->assertFalse($user->validatePassword($password));
	$user->save();

	$password = 'dap3065Password';
	$this->assertTrue($user->validatePassword($password));
	$user->delete();
    }

    public function testFindByUsername()
    {
        $user = new User();

        $user->email = 'dap3065@yahoo.com';
	$user->username = 'dap3065';
	$user->setPassword('dap3065Password');
	$user->status = 10;
        $user->save();
	$user2 = User::findByUsername('dap3065');
	$this->assertEquals($user->id, $user2->id);
        $user->delete();
    }

    public function testDelete()
    {
        $user = new User();

        $user->email = 'dap3065@yahoo.com';
	$user->username = 'dap3065';
	$user->setPassword('dap3065Password');
	$user->status = 10;
    }

    public function testUpdate()
    {
        $user = new User();

        $user->email = 'dap3065@yahoo.com';
	$user->username = 'dap3065';
	$user->setPassword('dap3065Password');
	$user->status = 10;
    }

}


text:
using PocketSharp.Models;
using System.Threading;
using System.Threading.Tasks;

namespace PocketSharp
{
  /// <summary>
  /// PocketClient
  /// </summary>
  public partial class PocketClient
  {
    /// <summary>
    /// Adds the specified tags to an item.
    /// </summary>
    /// <param name="itemID">The item ID.</param>
    /// <param name="tags">The tags.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> AddTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await SendTags(cancellationToken, itemID, "tags_add", tags);
    }

    /// <summary>
    /// Adds the specified tags to an item.
    /// </summary>
    /// <param name="item">The item.</param>
    /// <param name="tags">The tags.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> AddTags(PocketItem item, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await AddTags(item.ID, tags, cancellationToken);
    }

    /// <summary>
    /// Removes the specified tags from an item.
    /// </summary>
    /// <param name="itemID">The item ID.</param>
    /// <param name="tags">The tags.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await SendTags(cancellationToken, itemID, "tags_remove", tags);
    }

    /// <summary>
    /// Removes the specified tags from an item.
    /// </summary>
    /// <param name="item">The item.</param>
    /// <param name="tags">The tag.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTags(PocketItem item, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await RemoveTags(item.ID, tags, cancellationToken);
    }

    /// <summary>
    /// Removes a tag from an item.
    /// </summary>
    /// <param name="itemID">The item ID.</param>
    /// <param name="tag">The tag.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTag(string itemID, string tag, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await SendTags(cancellationToken, itemID, "tags_remove", new string[] { tag });
    }

    /// <summary>
    /// Removes a tag from an item.
    /// </summary>
    /// <param name="item">The item.</param>
    /// <param name="tag">The tag.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTag(PocketItem item, string tag, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await RemoveTag(item.ID, tag, cancellationToken);
    }

    /// <summary>
    /// Clears all tags from an item.
    /// </summary>
    /// <param name="itemID">The item ID.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTags(string itemID, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await SendDefault(cancellationToken, itemID, "tags_clear");
    }

    /// <summary>
    /// Clears all tags from an item.
    /// </summary>
    /// <param name="item">The item.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RemoveTags(PocketItem item, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await RemoveTags(item.ID, cancellationToken);
    }

    /// <summary>
    /// Deletes a tag. This will remove it from all affected items too.
    /// </summary>
    /// <param name="tag">The tag.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> DeleteTag(string tag, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await Send(new PocketAction()
      {
        Action = "tag_delete",
        Tag = tag
      }, cancellationToken);
    }

    /// <summary>
    /// Replaces all existing tags with the given tags in an item.
    /// </summary>
    /// <param name="itemID">The item ID.</param>
    /// <param name="tags">The tags.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> ReplaceTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await SendTags(cancellationToken, itemID, "tags_replace", tags);
    }

    /// <summary>
    /// Replaces all existing tags with the given new ones in an item.
    /// </summary>
    /// <param name="item">The item.</param>
    /// <param name="tags">The tags.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> ReplaceTags(PocketItem item, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await ReplaceTags(item.ID, tags, cancellationToken);
    }

    /// <summary>
    /// Renames a tag. This affects all items with this tag.
    /// </summary>
    /// <param name="oldTag">The old tag.</param>
    /// <param name="newTag">The new tag name.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    /// <exception cref="PocketException"></exception>
    public async Task<bool> RenameTag(string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken))
    {
      return await Send(new PocketAction()
      {
        Action = "tag_rename",
        OldTag = oldTag,
        NewTag = newTag
      }, cancellationToken);
    }

    /// <summary>
    /// Puts the send action for tags.
    /// </summary>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <param name="itemID">The item ID.</param>
    /// <param name="action">The action.</param>
    /// <param name="tags">The tags.</param>
    /// <returns></returns>
    protected async Task<bool> SendTags(CancellationToken cancellationToken, string itemID, string action, string[] tags)
    {
      return await Send(new PocketAction()
      {
        Action = action,
        ID = itemID,
        Tags = tags
      }, cancellationToken);
    }
  }
}


text:
package fr.lteconsulting.hexa.databinding.test;

import java.util.HashMap;
import java.util.List;

import fr.lteconsulting.hexa.databinding.gwt.annotation.Observable;

@Observable
public class SampleDTO2
{
	String tata;
	int toto;
	boolean tutu;
	long l;
	float f;
	byte b;

	String[] tatas;
	int[] totos;
	boolean[] tutus;
	long[] ls;
	float fs[];
	byte bs[];

	List<Object> os;

	HashMap<String, List<ObservableSampleDTO1>> map;

	// self reference
	SampleDTO2 titi2;

	SampleDTO1 titi;

	List<SampleDTO1> titis;

	List<SampleDTO1> totos4;

	// does not work, give <any>
	//ObservableSampleDTO3<Integer> toto2;

	// does not work, give List<<any>>
	//List<ObservableSampleDTO3<Integer>> totos2;

	// does not work, give List<<any>>
	//List<ObservableSampleDTO3<Integer>> totos3;
}


text:
package uk.org.cowgill.james.jircd;

import uk.org.cowgill.james.jircd.util.PushbackLineInputStream;

/**
 * Exception which is thrown when an error is encountered parsing a config file
 *
 * @author James
 */
public class ConfigException extends Exception
{
	private static final long serialVersionUID = 1L;

	/**
	 * The line number the exception was generated at in the file
	 *
	 * If lineNo <= 0, no line or character was specified
	 */
	public final int lineNo;

	/**
	 * The character number the exception was generated at in the file
	 *
	 * If charNo <= 0, no character is unknown
	 */
	public final int charNo;

	public ConfigException()
	{
		this.lineNo = 0;
		this.charNo = 0;
	}

	public ConfigException(String str)
	{
		super(str);
		this.lineNo = 0;
		this.charNo = 0;
	}

	public ConfigException(String str, Throwable err)
	{
		super(str, err);
		this.lineNo = 0;
		this.charNo = 0;
	}

	public ConfigException(Throwable err)
	{
		super(err);
		this.lineNo = 0;
		this.charNo = 0;
	}

	public ConfigException(String str, int lineNo, int charNo)
	{
		super(str);
		this.lineNo = lineNo;
		this.charNo = charNo;
	}

	ConfigException(String str, PushbackLineInputStream stream)
	{
		super(str);
		this.lineNo = stream.getLineNo();
		this.charNo = stream.getCharNo();
	}

	@Override
	public String toString()
	{
		return super.toString() + ", at line " + lineNo + " col " + charNo;
	}
}


text:
using yche::Cis;
using yche::Edge;
using Vertex=Cis::Vertex;
using Graph=Cis::Graph;
using namespace std;

unique_ptr<Graph> ConstructGraph(map<int, Vertex> &vertex_dict, map<int, int> &name_dict, vector<Edge> &edges_vec) {
    auto graph_ptr = make_unique<Graph>();
    auto edge_weight_map = boost::get(boost::edge_weight, *graph_ptr);
    for (auto &my_edge : edges_vec) {
        if (vertex_dict.find(my_edge.src_index_) == vertex_dict.end()) {
            Vertex vertex = boost::add_vertex(*graph_ptr);
            vertex_dict.emplace(my_edge.src_index_, vertex);
        }
        if (vertex_dict.find(my_edge.dst_index_) == vertex_dict.end()) {
            Vertex vertex = boost::add_vertex(*graph_ptr);
            vertex_dict.emplace(my_edge.dst_index_, vertex);
        }
        auto edge_flag_pair = add_edge(vertex_dict[my_edge.src_index_], vertex_dict[my_edge.dst_index_], *graph_ptr);
        if (edge_flag_pair.second) {
            edge_weight_map[edge_flag_pair.first] = my_edge.edge_weight_;
            //cout << my_edge;
        }
    }

    auto vertex_index_map = boost::get(boost::vertex_index, *graph_ptr);
    for (auto iter = vertex_dict.begin(); iter != vertex_dict.end(); ++iter) {
        name_dict.emplace(vertex_index_map[iter->second], iter->first);
    }
    return graph_ptr;

}

int main(int argc, char *argv[]) {
    auto edges_vec = yche::ReadWeightedEdgeList(argv[1]);

    auto vertex_dict = map<int, Vertex>();
    auto name_dict = map<int, int>();
    auto cis = Cis(ConstructGraph(vertex_dict, name_dict, edges_vec), 0);

    using namespace std::chrono;
    auto start = high_resolution_clock::now();
    auto arr_2d = cis.ExecuteCis();
    auto end = high_resolution_clock::now();
    cout << "whole execution time:" << duration_cast<milliseconds>(end - start).count() << " ms"<<endl;
    auto name_arr_2d = yche::Map2DArrWithDict(arr_2d, name_dict);

    cout << "idx result:" << arr_2d << endl;
    cout << "name result:" << name_arr_2d << endl;
    cout << "comm size:" << name_arr_2d.size() << endl;
    return 0;
}


text:
namespace pomdog::detail::emscripten {

class TimeSourceEmscripten final : public TimeSource {
public:
    [[nodiscard]] TimePoint Now() const noexcept override;
};

} // namespace pomdog::detail::emscripten


text:
<?php

namespace MusicBrainz\Relation\Type\Label;

use MusicBrainz\Value\EntityType;

/**
 * A relation between a recording and another recording
 *
 * @link https://musicbrainz.org/relationships/label-recording
 */
abstract class Recording extends \MusicBrainz\Relation\Type\Label
{
    /**
     * Returns the entity type of the related entity.
     *
     * @return EntityType
     */
    final public static function getRelatedEntityType(): EntityType
    {
        return new EntityType(EntityType::RECORDING);
    }
}


text:
<template name="Help">

Getting Started

In order to use the website, students must log in using their UH username and password.  Upon logging in, a basic profile will be created for them.  Students may edit their own profile by adding their first and last name, username, and profile picture.  They can also indicate whether or not they want to contacted by email.

          Topics

          Textbook

          Buy Offer

          Sell Offer

Textbook

The Textbook page is where students can view all of the ICS textbooks that are used in ICS courses.  The title, textbook cover, author, ISBN, and condition of each textbook can be viewed.

Buy Offer

The Buy Offer page is where students can make an offer to buy an ICS textbook at a given price.  To do this, students will click on the Add button and pick the textbook they wish to purchase.  They will then be taken to a page that will list all sell offers of the chosen textbook.  From this list, students can choose an offer they want to take and contact the person who made the sell offer.  If there are no sell offers of the chosen textbook or there are no offers they wish to take, they can then make their buy offer and post it to the list of offers.  All buy offers have a deadline in which the offer must be made by.  If the deadline passes, the offer will be taken down from the list of buy offers.  Students may add their offer back onto the list if they wish.

Students may also edit or delete their buy offer.  To do this, students will click on the Edit button and edit or delete any buy offers they had made.  Students can only edit or delete their own offers.

If students wish to view all buy offers made, they can click on the List button.

Sell Offer

 The Sell Offer page is where students can make an offer to sell an ICS textbook at a given price.  To do this, students will click on the Add button and pick the textbook they wish to sell.  They will then be taken to a page that will list all buy offers of the chosen textbook.  From this list, students can choose an offer they want to take and contact the person who made the buy offer.  If there are no buy offers of the chosen textbook or there are no offers they wish to take, they can then make their sell offer and post it to the list of offers.  All sell offers have a deadline in which the offer must be made by.  If the deadline passes, the offer will be taken down from the list of sell offers.  Students may add their offer back onto the list if they wish.

Students may also edit or delete their sell offer.  To do this, students will click on the Edit button and edit or delete any sell offers they had made.  Students can only edit or delete their own offers.

If students wish to view all sell offers made, they can click on the List button.

</template>


text:
package sample.jpa.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

@Entity
public class Tag {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	private String name;

	@ManyToMany(mappedBy = "tags")
	private List<Note> notes;

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Note> getNotes() {
		return this.notes;
	}

	public void setNotes(List<Note> notes) {
		this.notes = notes;
	}

}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using Tests.Mocks;

namespace Tests
{
    public class BaseSystemTests : BaseUnitTests
    {
        #region Convert

        public void StringAndObjectBindingAssert(string path, INotifyPropertyChanged source,
    Action sourcePropertySetter1, string targetValue1, object objTargetValue1,
    Action sourcePropertySetter2, string targetValue2, object objTargetValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            StringBindingAssert(path, source, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
            ObjectBindingAssert(path, source, sourcePropertySetter1, objTargetValue1, sourcePropertySetter2, objTargetValue2, resolvedTypes);
        }

        public void StringAndObjectBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
    Action sourcePropertySetter1, string targetValue1, object objTargetValue1,
    Action sourcePropertySetter2, string targetValue2, object objTargetValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            StringBindingAssert(calcBinding, source, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
            ObjectBindingAssert(calcBinding, source, sourcePropertySetter1, objTargetValue1, sourcePropertySetter2, objTargetValue2, resolvedTypes);
        }

        public void BrushBindingAssert(string path, INotifyPropertyChanged source,
    Action sourcePropertySetter1, Brush targetValue1,
    Action sourcePropertySetter2, Brush targetValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var button = new Button();

            BindingAssert(path, source, button, Button.BackgroundProperty, () => button.Background, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);

        }

        public void StringBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
            Action sourcePropertySetter1, string targetValue1,
            Action sourcePropertySetter2, string targetValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var textBox = new TextBox();
            BindingAssert(calcBinding, source, textBox, TextBox.TextProperty, () => textBox.Text, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void StringBindingAssert(string path, INotifyPropertyChanged source,
            Action sourcePropertySetter1, string targetValue1,
            Action sourcePropertySetter2, string targetValue2,
            Dictionary<string, Type> resolvedTypes = null,
            object fallbackValue = null)
        {
            var textBox = new TextBox();
            BindingAssert(path, source, textBox, TextBox.TextProperty, () => textBox.Text, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes, fallbackValue);
        }

        public void ObjectBindingAssert(string path, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, object targetValue1,
                    Action sourcePropertySetter2, object targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
        )
        {
            LabelBindingAssert(path, source, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void ObjectBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, object targetValue1,
                    Action sourcePropertySetter2, object targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
        )
        {
            LabelBindingAssert(calcBinding, source, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void LabelBindingAssert(string path, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, object targetValue1,
                    Action sourcePropertySetter2, object targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var label = new Label();
            BindingAssert(path, source, label, Label.ContentProperty, () => label.Content, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void LabelBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, object targetValue1,
                    Action sourcePropertySetter2, object targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var label = new Label();
            BindingAssert(calcBinding, source, label, Label.ContentProperty, () => label.Content, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void VisibilityBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, Visibility targetValue1,
                    Action sourcePropertySetter2, Visibility targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var label = new Label();
            BindingAssert(calcBinding, source, label, Label.VisibilityProperty, () => label.Visibility, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void VisibilityBindingAssert(string path, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, Visibility targetValue1,
                    Action sourcePropertySetter2, Visibility targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var label = new Label();
            BindingAssert(path, source, label, Label.VisibilityProperty, () => label.Visibility, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void BoolBindingAssert(CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, bool targetValue1,
                    Action sourcePropertySetter2, bool targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var checkbox = new CheckBox();
            BindingAssert(calcBinding, source, checkbox, CheckBox.IsCheckedProperty, () => checkbox.IsChecked, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void BoolBindingAssert(string path, INotifyPropertyChanged source,
                    Action sourcePropertySetter1, bool targetValue1,
                    Action sourcePropertySetter2, bool targetValue2,
                    Dictionary<string, Type> resolvedTypes = null
            )
        {
            var checkbox = new CheckBox();
            BindingAssert(path, source, checkbox, CheckBox.IsCheckedProperty, () => checkbox.IsChecked, sourcePropertySetter1, targetValue1, sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void BindingAssert<TTargetProperty>(
            string path, INotifyPropertyChanged source,
            FrameworkElement targetObject, DependencyProperty targetProperty,
            Func<TTargetProperty> targetPropertyGetter,
            Action sourcePropertySetter1, TTargetProperty targetValue1,
            Action sourcePropertySetter2, TTargetProperty targetValue2,
            Dictionary<string, Type> resolvedTypes = null,
            object fallbackValue = null
            )
        {
            var calcBinding = new CalcBinding.Binding(path);
            if (fallbackValue != null)
            {
                calcBinding.FallbackValue = fallbackValue;
            }

            BindingAssert(calcBinding, source, targetObject, targetProperty, targetPropertyGetter,
                sourcePropertySetter1, targetValue1,
                sourcePropertySetter2, targetValue2, resolvedTypes);
        }

        public void BindingAssert<TTargetProperty>(
            CalcBinding.Binding calcBinding, INotifyPropertyChanged source,
            FrameworkElement targetObject, DependencyProperty targetProperty,
            Func<TTargetProperty> targetPropertyGetter,
            Action sourcePropertySetter1, TTargetProperty targetValue1,
            Action sourcePropertySetter2, TTargetProperty targetValue2,
            Dictionary<string, Type> resolvedTypes = null
            )
        {
            targetObject.DataContext = source;

            var bindingExpression = calcBinding.ProvideValue(new ServiceProviderMock(targetObject, targetProperty, resolvedTypes));

            targetObject.SetValue(targetProperty, bindingExpression);

            //act
            sourcePropertySetter1();

            //assert
            var realValue1 = targetPropertyGetter();
            Assert.AreEqual(targetValue1, realValue1);

            //act
            sourcePropertySetter2();

            //assert
            var realValue2 = targetPropertyGetter();
            Assert.AreEqual(targetValue2, realValue2);
        }

        #endregion

        #region ConvertBack

        public void StringAndObjectBindingBackAssert(string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
            String stringTargetValue1, String stringTargetValue2,
            object objTargetValue1, object objTargetValue2,
            object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            StringBindingBackAssert(path, source, sourcePropertyGetter, stringTargetValue1, stringTargetValue2, sourcePropertyValue1, sourcePropertyValue2, resolvedTypes);
            ObjectBindingBackAssert(path, source, sourcePropertyGetter, objTargetValue1, objTargetValue2, sourcePropertyValue1, sourcePropertyValue2, resolvedTypes);
        }

        public void VisibilityBindingBackAssert(string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
            Visibility targetValue1, Visibility targetValue2,
            object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var obj = new Label();
            BindingBackAssert(path, source, sourcePropertyGetter,
                obj, Label.VisibilityProperty,
                (targetValue) => obj.Visibility = targetValue,
                targetValue1, targetValue2,
                sourcePropertyValue1, sourcePropertyValue2, BindingMode.TwoWay,
                resolvedTypes);
        }

        public void BoolBindingBackAssert(string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
            bool targetValue1, bool targetValue2,
            object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var obj = new CheckBox();
            BindingBackAssert(path, source, sourcePropertyGetter,
                obj, CheckBox.IsCheckedProperty,
                (targetValue) => obj.IsChecked = targetValue,
                targetValue1, targetValue2,
                sourcePropertyValue1, sourcePropertyValue2, BindingMode.Default,
                resolvedTypes);
        }

        public void ObjectBindingBackAssert(string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
            object targetValue1, object targetValue2,
            object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var obj = new Button();
            BindingBackAssert(path, source, sourcePropertyGetter,
                obj, Button.ContentProperty,
                (targetValue) => obj.Content = targetValue,
                targetValue1, targetValue2,
                sourcePropertyValue1, sourcePropertyValue2, BindingMode.TwoWay,
                resolvedTypes);
        }

        public void StringBindingBackAssert(string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
            String targetValue1, String targetValue2,
            object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var obj = new TextBox();
            BindingBackAssert(path, source, sourcePropertyGetter,
                obj, TextBox.TextProperty,
                (targetValue) => obj.Text = targetValue,
                targetValue1, targetValue2,
                sourcePropertyValue1, sourcePropertyValue2, BindingMode.Default,
                resolvedTypes);
        }

        public void BindingBackAssert<TTargetProperty>(
    string path, INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
    FrameworkElement targetObject, DependencyProperty targetProperty,
    Action<TTargetProperty> targetPropertySetter,
    TTargetProperty targetPropertyValue1, TTargetProperty targetPropertyValue2,
    object sourcePropertyValue1, object sourcePropertyValue2, BindingMode mode,
            Dictionary<string, Type> resolvedTypes = null)
        {
            var calcBinding = new CalcBinding.Binding(path)
            {
                UpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged,
                Mode = mode
            };

            BindingBackAssert(calcBinding, source, sourcePropertyGetter,
                targetObject, targetProperty, targetPropertySetter,
                targetPropertyValue1, targetPropertyValue2,
                sourcePropertyValue1, sourcePropertyValue2,
                resolvedTypes);
        }

        public void BindingBackAssert<TTargetProperty>(
    CalcBinding.Binding calcBinding,
    INotifyPropertyChanged source, Func<object> sourcePropertyGetter,
    FrameworkElement targetObject, DependencyProperty targetProperty,
    Action<TTargetProperty> targetPropertySetter,
    TTargetProperty targetPropertyValue1, TTargetProperty targetPropertyValue2,
    object sourcePropertyValue1, object sourcePropertyValue2,
            Dictionary<string, Type> resolvedTypes = null)
        {
            targetObject.DataContext = source;

            var bindingExpression = calcBinding.ProvideValue(new ServiceProviderMock(targetObject, targetProperty, resolvedTypes));

            targetObject.SetValue(targetProperty, bindingExpression);

            //act
            targetPropertySetter(targetPropertyValue1);

            //assert
            var realSourcePropertyValue1 = sourcePropertyGetter();
            Assert.AreEqual(sourcePropertyValue1, realSourcePropertyValue1);

            //act
            targetPropertySetter(targetPropertyValue2);

            //assert
            var realSourcePropertyValue2 = sourcePropertyGetter();
            Assert.AreEqual(sourcePropertyValue2, realSourcePropertyValue2);
        }

        #endregion
    }
}


text:
- Fixed an issue with timestamp parsing when fetching incidents.
- Updated the Docker image to: *demisto/python3:3.9.6.22912*.


text:
#ifndef OCT_NODE_INCLUDED
#define OCT_NODE_INCLUDED

#include "Allocator.h"
#include "BinaryNode.h"
#include "MarchingCubes.h"

#define DIMENSION 3

template< class NodeData >
class OctNode
{
private:
	static int UseAlloc;
	unsigned long long _depthAndOffset;

	class AdjacencyCountFunction
	{
	public:
		int count;
		void Function( const OctNode< NodeData >* node1 , const OctNode< NodeData >* node2 );
	};
	template<class NodeAdjacencyFunction>
	void __processNodeFaces(OctNode* node,NodeAdjacencyFunction* F,int cIndex1,int cIndex2,int cIndex3,int cIndex4);
	template< class NodeAdjacencyFunction >
	void __processNodeFaces( const OctNode* node , NodeAdjacencyFunction* F , int cIndex1 , int cIndex2 , int cIndex3 , int cIndex4 ) const;
	template<class NodeAdjacencyFunction>
	void __processNodeEdges(OctNode* node,NodeAdjacencyFunction* F,int cIndex1,int cIndex2);
	template<class NodeAdjacencyFunction>
	void __processNodeNodes(OctNode* node,NodeAdjacencyFunction* F);
	template<class NodeAdjacencyFunction>
	static void __ProcessNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int cWidth2,NodeAdjacencyFunction* F);
	template<class TerminatingNodeAdjacencyFunction>
	static void __ProcessTerminatingNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int cWidth2,TerminatingNodeAdjacencyFunction* F);
	template<class PointAdjacencyFunction>
	static void __ProcessPointAdjacentNodes(int dx,int dy,int dz,OctNode* node2,int radius2,int cWidth2,PointAdjacencyFunction* F);
	template<class NodeAdjacencyFunction>
	static void __ProcessFixedDepthNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int cWidth2,int depth,NodeAdjacencyFunction* F);
	template<class NodeAdjacencyFunction>
	static void __ProcessMaxDepthNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int cWidth2,int depth,NodeAdjacencyFunction* F);

	// This is made private because the division by two has been pulled out.
	static inline int Overlap(int c1,int c2,int c3,int dWidth);
	inline static int ChildOverlap(int dx,int dy,int dz,int d,int cRadius2);

	const OctNode* __faceNeighbor(int dir,int off) const;
	const OctNode* __edgeNeighbor(int o,const int i[2],const int idx[2]) const;
	OctNode* __faceNeighbor(int dir,int off,int forceChildren);
	OctNode* __edgeNeighbor(int o,const int i[2],const int idx[2],int forceChildren);
public:
	static const int DepthShift,OffsetShift,OffsetShift1,OffsetShift2,OffsetShift3;
	static const int DepthMask,OffsetMask;

	static Allocator< OctNode > NodeAllocator;
	static int UseAllocator( void );
	static void SetAllocator( int blockSize );

	OctNode* parent;
	OctNode* children;
	NodeData nodeData;

	OctNode(void);
	~OctNode(void);
	int initChildren( void );

	void depthAndOffset( int& depth , int offset[DIMENSION] ) const;
	void centerIndex( int index[DIMENSION] ) const;
	int depth( void ) const;
	static inline void DepthAndOffset( const long long& index , int& depth , int offset[DIMENSION] );
	template< class Real > static inline void CenterAndWidth( const long long& index , Point3D< Real >& center , Real& width );
	static inline int Depth( const long long& index );
	static inline void Index( int depth , const int offset[3] , short& d , short off[DIMENSION] );
	static inline unsigned long long Index( int depth , const int offset[3] );
	template< class Real > void centerAndWidth( Point3D<Real>& center , Real& width ) const;
	template< class Real > bool isInside( Point3D< Real > p ) const;

	size_t leaves( void ) const;
	size_t maxDepthLeaves( int maxDepth ) const;
	size_t nodes( void ) const;
	int maxDepth( void ) const;

	const OctNode* root( void ) const;

	const OctNode* nextLeaf(const OctNode* currentLeaf=NULL) const;
	OctNode* nextLeaf(OctNode* currentLeaf=NULL);
	const OctNode* nextNode(const OctNode* currentNode=NULL) const;
	OctNode* nextNode(OctNode* currentNode=NULL);
	const OctNode* nextBranch(const OctNode* current) const;
	OctNode* nextBranch(OctNode* current);
	const OctNode* prevBranch(const OctNode* current) const;
	OctNode* prevBranch(OctNode* current);

	void setFullDepth(int maxDepth);

	void printLeaves(void) const;
	void printRange(void) const;

	template<class NodeAdjacencyFunction>
	void processNodeFaces(OctNode* node,NodeAdjacencyFunction* F,int fIndex,int processCurrent=1);
	template< class NodeAdjacencyFunction >
	void processNodeFaces( const OctNode* node , NodeAdjacencyFunction* F , int fIndex , int processCurrent=1 ) const;
	template<class NodeAdjacencyFunction>
	void processNodeEdges(OctNode* node,NodeAdjacencyFunction* F,int eIndex,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	void processNodeCorners(OctNode* node,NodeAdjacencyFunction* F,int cIndex,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	void processNodeNodes(OctNode* node,NodeAdjacencyFunction* F,int processCurrent=1);

	template<class NodeAdjacencyFunction>
	static void ProcessNodeAdjacentNodes(int maxDepth,OctNode* node1,int width1,OctNode* node2,int width2,NodeAdjacencyFunction* F,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	static void ProcessNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int width2,NodeAdjacencyFunction* F,int processCurrent=1);
	template<class TerminatingNodeAdjacencyFunction>
	static void ProcessTerminatingNodeAdjacentNodes(int maxDepth,OctNode* node1,int width1,OctNode* node2,int width2,TerminatingNodeAdjacencyFunction* F,int processCurrent=1);
	template<class TerminatingNodeAdjacencyFunction>
	static void ProcessTerminatingNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int width2,TerminatingNodeAdjacencyFunction* F,int processCurrent=1);
	template<class PointAdjacencyFunction>
	static void ProcessPointAdjacentNodes(int maxDepth,const int center1[3],OctNode* node2,int width2,PointAdjacencyFunction* F,int processCurrent=1);
	template<class PointAdjacencyFunction>
	static void ProcessPointAdjacentNodes(int dx,int dy,int dz,OctNode* node2,int radius2,int width2,PointAdjacencyFunction* F,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	static void ProcessFixedDepthNodeAdjacentNodes(int maxDepth,OctNode* node1,int width1,OctNode* node2,int width2,int depth,NodeAdjacencyFunction* F,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	static void ProcessFixedDepthNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int width2,int depth,NodeAdjacencyFunction* F,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	static void ProcessMaxDepthNodeAdjacentNodes(int maxDepth,OctNode* node1,int width1,OctNode* node2,int width2,int depth,NodeAdjacencyFunction* F,int processCurrent=1);
	template<class NodeAdjacencyFunction>
	static void ProcessMaxDepthNodeAdjacentNodes(int dx,int dy,int dz,OctNode* node1,int radius1,OctNode* node2,int radius2,int width2,int depth,NodeAdjacencyFunction* F,int processCurrent=1);

	template< class Real > static int CornerIndex( const Point3D<Real>& center , const Point3D<Real> &p );

	OctNode* faceNeighbor(int faceIndex,int forceChildren=0);
	const OctNode* faceNeighbor(int faceIndex) const;
	OctNode* edgeNeighbor(int edgeIndex,int forceChildren=0);
	const OctNode* edgeNeighbor(int edgeIndex) const;
	OctNode* cornerNeighbor(int cornerIndex,int forceChildren=0);
	const OctNode* cornerNeighbor(int cornerIndex) const;

	template< class Real > OctNode* getNearestLeaf(const Point3D<Real>& p);
	template< class Real > const OctNode* getNearestLeaf(const Point3D<Real>& p) const;

	static int CommonEdge(const OctNode* node1,int eIndex1,const OctNode* node2,int eIndex2);
	static int CompareForwardDepths(const void* v1,const void* v2);
	static int CompareByDepthAndXYZ( const void* v1 , const void* v2 );
	static int CompareByDepthAndZIndex( const void* v1 , const void* v2 );
	static int CompareForwardPointerDepths(const void* v1,const void* v2);
	static int CompareBackwardDepths(const void* v1,const void* v2);
	static int CompareBackwardPointerDepths(const void* v1,const void* v2);

	template<class NodeData2>
	OctNode& operator = ( const OctNode< NodeData2 >& node );

	template< class Real >
	static inline int Overlap2(const int &depth1,const int offSet1[DIMENSION],const Real& multiplier1,const int &depth2,const int offSet2[DIMENSION],const Real& multiplier2);

	int write(const char* fileName) const;
	int write(FILE* fp) const;
	int read(const char* fileName);
	int read(FILE* fp);

	class Neighbors5
	{
	public:
		OctNode* neighbors[5][5][5];
		Neighbors5( void );
		void clear( void );
	};
	class ConstNeighbors5
	{
	public:
		const OctNode* neighbors[5][5][5];
		ConstNeighbors5( void );
		void clear( void );
	};

	class NeighborKey5
	{
		int _depth;
	public:
		Neighbors5* neighbors;

		NeighborKey5( void );
		~NeighborKey5( void );

		void set( int depth );
		Neighbors5& getNeighbors( OctNode* node );
		Neighbors5& setNeighbors( OctNode* node ,  int xStart=0 , int xEnd=5 , int yStart=0 , int yEnd=5 , int zStart=0 , int zEnd=5 );
	};
	class ConstNeighborKey5
	{
		int _depth;
	public:
		ConstNeighbors5* neighbors;

		ConstNeighborKey5( void );
		~ConstNeighborKey5( void );

		void set( int depth );
		ConstNeighbors5& getNeighbors( const OctNode* node );
	};

	class Neighbors3
	{
	public:
		OctNode* neighbors[3][3][3];
		Neighbors3( void );
		void clear( void );
	};
	class ConstNeighbors3
	{
	public:
		const OctNode* neighbors[3][3][3];
		ConstNeighbors3( void );
		void clear( void );
	};
	class NeighborKey3
	{
		int _depth;
	public:
		Neighbors3* neighbors;

		NeighborKey3( void );
		NeighborKey3( const NeighborKey3& key3 );
		~NeighborKey3( void );
		int depth( void ) const { return _depth; }

		void set( int depth );
		template< class Real > Neighbors3& setNeighbors( OctNode* root , Point3D< Real > p , int d );
		template< class Real > Neighbors3& getNeighbors( OctNode* root , Point3D< Real > p , int d );
		Neighbors3& setNeighbors( OctNode* node , bool flags[3][3][3] );
		Neighbors3& setNeighbors( OctNode* node );
		Neighbors3& getNeighbors( OctNode* node );
		void setNeighbors( OctNode* node , typename OctNode< NodeData >::Neighbors5& neighbors );
		void getNeighbors( OctNode* node , typename OctNode< NodeData >::Neighbors5& neighbors );

		template< class Real > bool setChildNeighbors( Point3D< Real > p , int d , Neighbors3& childNeighbors ) const;
		template< class Real > bool getChildNeighbors( Point3D< Real > p , int d , Neighbors3& childNeighbors ) const;
	};
	class ConstNeighborKey3
	{
		int _depth;
	public:
		ConstNeighbors3* neighbors;

		ConstNeighborKey3( void );
		ConstNeighborKey3( const ConstNeighborKey3& key3 );
		~ConstNeighborKey3( void );
		int depth( void ) const { return _depth; }

		void set( int depth );
		ConstNeighbors3& getNeighbors( const OctNode* node );
		ConstNeighbors3& getNeighbors( const OctNode* node , int minDepth );
		void getNeighbors( const OctNode* node , typename OctNode< NodeData >::ConstNeighbors5& neighbors );
	};

	void centerIndex(int maxDepth,int index[DIMENSION]) const;
	int width(int maxDepth) const;
};

#include "Octree.inl"

#endif // OCT_NODE


text:
import macro from 'vtk.js/Sources/macros';

import vtkColorMaps from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps';
import vtkColorTransferFunction from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction';

import Constants from './Constants';

const { Mode, Defaults } = Constants;

// ----------------------------------------------------------------------------
// vtkLookupTableProxy methods
// ----------------------------------------------------------------------------

function vtkLookupTableProxy(publicAPI, model) {
  // Set our className
  model.classHierarchy.push('vtkLookupTableProxy');

  model.lookupTable =
    model.lookupTable || vtkColorTransferFunction.newInstance();

  // Initialize lookup table
  model.lookupTable.setVectorModeToMagnitude();

  // Takes a preset colormap name
  publicAPI.setPresetName = (presetName) => {
    if (model.presetName !== presetName) {
      model.presetName = presetName;
      model.mode = Mode.Preset;
      publicAPI.applyMode();
    }
  };

  // Takes an array of points [x, r, g, b, m=0.5, s=0.0]
  publicAPI.setRGBPoints = (rgbPoints) => {
    if (model.rgbPoints !== rgbPoints) {
      model.rgbPoints = (rgbPoints || Defaults.RGBPoints).slice();
      publicAPI.applyMode();
    }
  };

  // Takes an array of points [x, h, s, v, m=0.5, s=0.0]
  publicAPI.setHSVPoints = (hsvPoints) => {
    if (model.hsvPoints !== hsvPoints) {
      model.hsvPoints = (hsvPoints || Defaults.HSVPoints).slice();
      publicAPI.applyMode();
    }
  };

  // Takes an array of ColorTransferFunction nodes
  publicAPI.setNodes = (nodes) => {
    if (model.nodes !== nodes) {
      model.nodes = (nodes || Defaults.Nodes).slice();
      publicAPI.applyMode();
    }
  };

  publicAPI.setMode = (mode) => {
    if (model.mode !== mode) {
      model.mode = mode;
      publicAPI.applyMode();
    }
  };

  publicAPI.applyMode = () => {
    switch (model.mode) {
      case Mode.Preset:
        {
          const preset = vtkColorMaps.getPresetByName(model.presetName);
          if (preset) {
            model.lookupTable.applyColorMap(preset);
          }
        }
        break;

      case Mode.RGBPoints:
        model.lookupTable.removeAllPoints();
        model.rgbPoints.forEach((point) =>
          model.lookupTable.addRGBPointLong(...point)
        );
        break;

      case Mode.HSVPoints:
        model.lookupTable.removeAllPoints();
        model.hsvPoints.forEach((point) =>
          model.lookupTable.addHSVPointLong(...point)
        );
        break;

      case Mode.Nodes:
        model.lookupTable.setNodes(model.nodes);
        break;

      default:
      // noop
    }

    model.lookupTable.setMappingRange(model.dataRange[0], model.dataRange[1]);
    model.lookupTable.updateRange();
    publicAPI.modified();
  };

  publicAPI.setDataRange = (min, max) => {
    if (model.dataRange[0] !== min || model.dataRange[1] !== max) {
      model.dataRange[0] = min;
      model.dataRange[1] = max;

      model.lookupTable.setMappingRange(model.dataRange[0], model.dataRange[1]);
      model.lookupTable.updateRange();

      publicAPI.applyMode();
    }
  };

  // Initialization ------------------------------------------------------------

  publicAPI.applyMode();
}

// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {
  mode: Mode.Preset,
  presetName: Defaults.Preset,
  rgbPoints: Defaults.RGBPoints,
  hsvPoints: Defaults.HSVPoints,
  nodes: Defaults.Nodes,
  arrayName: 'No array associated',
  arrayLocation: 'pointData',
  dataRange: [0, 1],
};

// ----------------------------------------------------------------------------

function extend(publicAPI, model, initialValues = {}) {
  Object.assign(model, DEFAULT_VALUES, initialValues);

  macro.obj(publicAPI, model);
  macro.setGet(publicAPI, model, ['arrayName']);
  macro.get(publicAPI, model, [
    'mode',
    'lookupTable',
    'presetName',
    'rgbPoints',
    'hsvPoints',
    'nodes',
    'dataRange',
  ]);

  // Object specific methods
  vtkLookupTableProxy(publicAPI, model);

  // Proxy handling
  macro.proxy(publicAPI, model);
}

// ----------------------------------------------------------------------------

export const newInstance = macro.newInstance(extend, 'vtkLookupTableProxy');

// ----------------------------------------------------------------------------

export default { newInstance, extend, Mode, Defaults };


text:
describe('[Regression](GH-2205)', function () {
    it('Should type in div if it has an invisible child with contententeditable=false', function () {
        return runTests('testcafe-fixtures/index.js');
    });
});


text:
package com.aries.template.impl;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;

import com.aries.library.fast.i.FastObserverControl;
import com.aries.library.fast.i.FastRecyclerViewControl;
import com.aries.library.fast.i.IFastRefreshLoadView;
import com.aries.library.fast.i.LoadMoreFoot;
import com.aries.library.fast.i.LoadingDialog;
import com.aries.library.fast.i.MultiStatusView;
import com.aries.library.fast.i.QuitAppControl;
import com.aries.library.fast.i.TitleBarViewControl;
import com.aries.library.fast.i.ToastControl;
import com.aries.library.fast.manager.LoggerManager;
import com.aries.library.fast.retrofit.FastNullException;
import com.aries.library.fast.retrofit.FastObserver;
import com.aries.library.fast.util.FastStackUtil;
import com.aries.library.fast.util.SizeUtil;
import com.aries.library.fast.util.ToastUtil;
import com.aries.library.fast.widget.FastLoadDialog;
import com.aries.library.fast.widget.FastLoadMoreView;
import com.aries.template.R;
import com.aries.ui.util.DrawableUtil;
import com.aries.ui.util.StatusBarUtil;
import com.aries.ui.view.radius.RadiusTextView;
import com.aries.ui.view.title.TitleBarView;
import com.aries.ui.widget.progress.UIProgressDialog;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.animation.ScaleInAnimation;
import com.chad.library.adapter.base.loadmore.BaseLoadMoreView;
import com.scwang.smart.refresh.header.MaterialHeader;
import com.scwang.smart.refresh.layout.api.RefreshHeader;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator;

import me.bakumon.statuslayoutmanager.library.StatusLayoutManager;

/**
 * @Author: AriesHoo on 2018/7/30 11:34
 * @E-Mail: AriesHoo@126.com
 * Function: 应用全局配置管理实现
 * Description:
 * 1、新增友盟统计功能对接
 */
public class AppImpl implements DefaultRefreshHeaderCreator, LoadMoreFoot,
        FastRecyclerViewControl, MultiStatusView, LoadingDialog,
        TitleBarViewControl, QuitAppControl, ToastControl, FastObserverControl {

    private Context mContext;
    private String TAG = this.getClass().getSimpleName();

    public AppImpl(@Nullable Context context) {
        this.mContext = context;
    }

    /**
     * 下拉刷新头配置
     *
     * @param context
     * @param layout
     * @return
     */
    @NonNull
    @Override
    public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
        layout.setEnableHeaderTranslationContent(false)
                .setPrimaryColorsId(R.color.colorAccent)
                .setEnableOverScrollDrag(false);
        MaterialHeader materialHeader = new MaterialHeader(mContext);
        materialHeader.setColorSchemeColors(ContextCompat.getColor(mContext, R.color.colorTextBlack),
                ContextCompat.getColor(mContext, R.color.colorTextBlackLight));
        return materialHeader;
    }

    /**
     * Adapter加载更多配置
     *
     * @param adapter
     * @return
     */
    @Nullable
    @Override
    public BaseLoadMoreView createDefaultLoadMoreView(BaseQuickAdapter adapter) {
        if (adapter != null) {
            //设置动画是否一直开启
            adapter.setAnimationFirstOnly(false);
            //设置动画
            adapter.setAdapterAnimation(new ScaleInAnimation());
            adapter.setAnimationEnable(true);
        }
        //方式一:设置FastLoadMoreView--可参考FastLoadMoreView.Builder相应set方法
        //默认配置请参考FastLoadMoreView.Builder(mContext)里初始化
        return new FastLoadMoreView.Builder(mContext)
                .setLoadingTextFakeBold(true)
                .setLoadingSize(SizeUtil.dp2px(20))
//                                .setLoadTextColor(Color.MAGENTA)
//                                //设置Loading 颜色-5.0以上有效
//                                .setLoadingProgressColor(Color.MAGENTA)
//                                //设置Loading drawable--会使Loading颜色失效
//                                .setLoadingProgressDrawable(R.drawable.dialog_loading_wei_bo)
//                                //设置全局TextView颜色
//                                .setLoadTextColor(Color.MAGENTA)
//                                //设置全局TextView文字字号
//                                .setLoadTextSize(SizeUtil.dp2px(14))
//                                .setLoadingText("努力加载中...")
//                                .setLoadingTextColor(Color.GREEN)
//                                .setLoadingTextSize(SizeUtil.dp2px(14))
//                                .setLoadEndText("我是有底线的")
//                                .setLoadEndTextColor(Color.GREEN)
//                                .setLoadEndTextSize(SizeUtil.dp2px(14))
//                                .setLoadFailText("哇哦!出错了")
//                                .setLoadFailTextColor(Color.RED)
//                                .setLoadFailTextSize(SizeUtil.dp2px(14))
                .build();
        //方式二:使用adapter自带--其实我默认设置的和这个基本一致只是提供了相应设置方法
//                        return new SimpleLoadMoreView();
        //方式三:参考SimpleLoadMoreView或FastLoadMoreView完全自定义自己的LoadMoreView
//                        return MyLoadMoreView();
    }

    /**
     * 全局设置
     *
     * @param recyclerView
     * @param cls
     */
    @Override
    public void setRecyclerView(RecyclerView recyclerView, Class<?> cls) {
        LoggerManager.i(TAG, "setRecyclerView-" + cls.getSimpleName() + "context:" + recyclerView.getContext() + ";:" + (Activity.class.isAssignableFrom(recyclerView.getContext().getClass())) + ";:" + (recyclerView.getContext() instanceof Activity));
    }

    @Override
    public void setMultiStatusView(StatusLayoutManager.Builder statusView, IFastRefreshLoadView iFastRefreshLoadView) {
    }

    /**
     * 这里将局部设置的FastLoadDialog 抛至该处用于全局设置,在局部使用{@link com.aries.library.fast.retrofit.FastLoadingObserver}
     *
     * @param activity
     * @return
     */
    @Nullable
    @Override
    public FastLoadDialog createLoadingDialog(@Nullable Activity activity) {
        return new FastLoadDialog(activity,
                new UIProgressDialog.WeBoBuilder(activity)
                        .setMessage("加载中")
                        .create())
                .setCanceledOnTouchOutside(false)
                .setMessage("请求数据中,请稍候...");
        //注意使用UIProgressDialog时最好在Builder里设置提示文字setMessage不然后续再设置文字信息也不会显示
//        return new FastLoadDialog(activity, new UIProgressDialog.WeChatBuilder(activity)
//                .setBackgroundColor(Color.parseColor("#FCFCFC"))
////                .setMinHeight(SizeUtil.dp2px(140))
////                .setMinWidth(SizeUtil.dp2px(270))
//                .setTextSizeUnit(TypedValue.COMPLEX_UNIT_PX)
//                .setMessage(R.string.fast_loading)
//                .setLoadingSize(SizeUtil.dp2px(30))
//                .setTextSize(SizeUtil.dp2px(16f))
//                .setTextPadding(SizeUtil.dp2px(10))
//                .setTextColorResource(R.color.colorTextGray)
//                .setIndeterminateDrawable(FastUtil.getTintDrawable(ContextCompat.getDrawable(mContext, R.drawable.dialog_loading), ContextCompat.getColor(mContext, R.color.colorTitleText)))
//                .setBackgroundRadius(SizeUtil.dp2px(6f))
//                .create());
//        Dialog dialog = new PictureDialog(activity);
//        return new FastLoadDialog(activity, dialog)
//                .setCancelable(true)
//                .setCanceledOnTouchOutside(true);
    }

    /**
     * 控制全局TitleBarView
     *
     * @param titleBar
     * @return
     */
    @Override
    public boolean createTitleBarViewControl(TitleBarView titleBar, Class<?> cls) {
        //默认的MD风格返回箭头icon如使用该风格可以不用设置
        Drawable mDrawable = DrawableUtil.setTintDrawable(ContextCompat.getDrawable(mContext, R.drawable.fast_ic_back),
                ContextCompat.getColor(mContext, R.color.colorTitleText));
        //是否支持状态栏白色
        boolean isSupport = StatusBarUtil.isSupportStatusBarFontChange();
        boolean isActivity = Activity.class.isAssignableFrom(cls);
        Activity activity = FastStackUtil.getInstance().getActivity(cls);
        //设置TitleBarView 所有TextView颜色
        titleBar.setStatusBarLightMode(isSupport)
                //不支持黑字的设置白透明
                .setStatusAlpha(isSupport ? 0 : 102)
                .setLeftTextDrawable(isActivity ? mDrawable : null)
                .setDividerHeight(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ? SizeUtil.dp2px(0.5f) : 0);
        if (activity != null) {
            titleBar.setTitleMainText(activity.getTitle())
                    .setOnLeftTextClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            activity.finish();
                        }
                    });
        }
        return false;
    }

    /**
     * @param isFirst  是否首次提示
     * @param activity 操作的Activity
     * @return 延迟间隔--如不需要设置两次提示可设置0--最佳方式是直接在回调中执行你想要的操作
     */
    @Override
    public long quipApp(boolean isFirst, Activity activity) {
        //默认配置
        if (isFirst) {
            ToastUtil.show(R.string.fast_quit_app);
        } else {
            FastStackUtil.getInstance().exit(false);
        }
        return 2000;
    }

    @Override
    public Toast getToast() {
        return null;
    }

    @Override
    public void setToast(Toast toast, RadiusTextView textView) {

    }

    /**
     * @param o {@link FastObserver} 对象用于后续事件逻辑
     * @param e 原始错误
     * @return true 拦截操作不进行原始{@link FastObserver#onError(Throwable)}后续逻辑
     * false 不拦截继续后续逻辑
     * {@link FastNullException} 已在{@link FastObserver#onError} }处理如果为该类型Exception可不用管,参考
     */
    @Override
    public boolean onError(FastObserver o, Throwable e) {
        return false;
    }
}


text:
Edit '{{poll.name}}'

{% load uni_form_tags %}

<form action="{% url poll.views.edit_poll poll.pk %}" method="post" class="uniForm">
<fieldset>
{{form|as_uni_form}}

    Cancel

    Save Poll Details

</fieldset>
</form>


text:
@charset "utf-16";
#È { visibility:hidden }