text:
require 'erb'
require 'yaml'
require 'set'
require 'active_support/dependencies'
require 'active_record/errors'
require_relative "fixation/version"
require_relative "fixation/fixture_table"
require_relative "fixation/fixtures"

module Fixation
  # The list of paths to look in to find fixture files.
  cattr_accessor :paths
  self.paths = %w(test/fixtures spec/fixtures)

  # The list of extensions to look for in fixture directories.
  cattr_accessor :extensions
  self.extensions = %w(.yml .yml.erb)

  # Set to true to clear any tables found in the database that do *not* have a fixture file.
  cattr_accessor :clear_other_tables

  # Set to the list of tables you don't want to clear (if clear_other_tables is turned on).
  # Defaults to just schema_migrations and ar_internal_metadata.
  cattr_accessor :tables_not_to_clear
  self.tables_not_to_clear = %w(schema_migrations ar_internal_metadata)

  # Set to true to log some debugging information to stdout.
  cattr_accessor :trace

  def self.build_fixtures
    @fixtures = Fixtures.new
    @fixtures.compile_fixture_files
  end

  def self.apply_fixtures
    build_fixtures unless @fixtures
    @fixtures.apply_fixtures
  end

  def self.fixture_methods
    build_fixtures unless @fixtures
    @fixtures.fixture_methods
  end

  def self.add_fixture(fixture_for, name, attributes)
    @fixtures.add_fixture(fixture_for, name, attributes)
  end

  # Returns a consistent, platform-independent identifier for +label+.
  # Integer identifiers are values less than 2^30. UUIDs are RFC 4122 version 5 SHA-1 hashes.
  #
  # Uses the ActiveRecord fixtures method for compatibility.
  if ActiveRecord::FixtureSet.method(:identify).arity == 1
    def self.identify(label, _column_type = :integer)
      ActiveRecord::FixtureSet.identify(label)
    end
  else
    def self.identify(label, column_type = :integer)
      ActiveRecord::FixtureSet.identify(label, column_type)
    end
  end

  def self.running_under_spring?
    defined?(Spring::Application)
  end

  def self.preload_for_spring
    build_fixtures
    unload_models!
    watch_paths
  end

  def self.watch_paths
    paths.each do |path|
      Spring.watch(path)
    end
  end

  # reloads Rails (using the code from Spring) in order to unload the model classes that get
  # auto-loaded when we read the fixture definitions.
  def self.unload_models!
    # Rails 5.1 forward-compat. AD::R is deprecated to AS::R in Rails 5.
    if defined? ActiveSupport::Reloader
      Rails.application.reloader.reload!
    else
      ActionDispatch::Reloader.cleanup!
      ActionDispatch::Reloader.prepare!
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package opennlp.tools.namefind;

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

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import opennlp.tools.tokenize.WhitespaceTokenizer;
import opennlp.tools.util.Span;

public class RegexNameFinderFactoryTest {

  private static RegexNameFinder regexNameFinder;

  private static String text = "my email is opennlp@gmail.com and my phone num is" +
      " 123-234-5678 and i like" +
      " https://www.google.com and I visited MGRS  11sku528111 AKA  11S KU 528 111 and" +
      " DMS 45N 123W AKA" +
      "  +45.1234, -123.12 AKA  45.1234N 123.12W AKA 45 30 N 50 30 W";

  @Before
  public void setUp() {
    regexNameFinder = RegexNameFinderFactory.getDefaultRegexNameFinders(
        RegexNameFinderFactory.DEFAULT_REGEX_NAME_FINDER.DEGREES_MIN_SEC_LAT_LON,
        RegexNameFinderFactory.DEFAULT_REGEX_NAME_FINDER.EMAIL,
        RegexNameFinderFactory.DEFAULT_REGEX_NAME_FINDER.MGRS,
        RegexNameFinderFactory.DEFAULT_REGEX_NAME_FINDER.USA_PHONE_NUM,
        RegexNameFinderFactory.DEFAULT_REGEX_NAME_FINDER.URL);
  }

  @Test
  public void testEmail() throws Exception {
    String[] tokens = WhitespaceTokenizer.INSTANCE.tokenize(text);
    Span[] find = regexNameFinder.find(tokens);
    List<Span> spanList = Arrays.asList(find);
    Assert.assertTrue(spanList.contains(new Span(3, 4, "EMAIL")));
    Span emailSpan = new Span(3, 4, "EMAIL");
    Assert.assertEquals("opennlp@gmail.com", tokens[emailSpan.getStart()]);
  }

  @Test
  public void testPhoneNumber() throws Exception {
    String[] tokens = WhitespaceTokenizer.INSTANCE.tokenize(text);
    Span[] find = regexNameFinder.find(tokens);
    List<Span> spanList = Arrays.asList(find);
    Span phoneSpan = new Span(9, 10, "PHONE_NUM");
    Assert.assertTrue(spanList.contains(phoneSpan));
    Assert.assertEquals("123-234-5678", tokens[phoneSpan.getStart()]);
  }

  @Test
  public void testURL() throws Exception {
    String[] tokens = WhitespaceTokenizer.INSTANCE.tokenize(text);
    Span[] find = regexNameFinder.find(tokens);
    List<Span> spanList = Arrays.asList(find);
    Span urlSpan = new Span(13, 14, "URL");
    Assert.assertTrue(spanList.contains(urlSpan));
    Assert.assertEquals("https://www.google.com", tokens[urlSpan.getStart()]);
  }

  @Test
  public void testLatLong() throws Exception {
    String[] tokens = WhitespaceTokenizer.INSTANCE.tokenize(text);
    Span[] find = regexNameFinder.find(tokens);
    List<Span> spanList = Arrays.asList(find);
    Span latLongSpan1 = new Span(22, 24, "DEGREES_MIN_SEC_LAT_LON");
    Span latLongSpan2 = new Span(35, 41, "DEGREES_MIN_SEC_LAT_LON");
    Assert.assertTrue(spanList.contains(latLongSpan1));
    Assert.assertTrue(spanList.contains(latLongSpan2));
    Assert.assertEquals("528", tokens[latLongSpan1.getStart()]);
    Assert.assertEquals("45", tokens[latLongSpan2.getStart()]);
  }

  @Test
  public void testMgrs() throws Exception {
    String[] tokens = WhitespaceTokenizer.INSTANCE.tokenize(text);
    Span[] find = regexNameFinder.find(tokens);
    List<Span> spanList = Arrays.asList(find);
    Span mgrsSpan1 = new Span(18, 19, "MGRS");
    Span mgrsSpan2 = new Span(20, 24, "MGRS");
    Assert.assertTrue(spanList.contains(mgrsSpan1));
    Assert.assertTrue(spanList.contains(mgrsSpan2));
    Assert.assertEquals("11SKU528111".toLowerCase(), tokens[mgrsSpan1.getStart()]);
    Assert.assertEquals("11S", tokens[mgrsSpan2.getStart()]);
  }
}


text:
module CloudFormer
  module RDS
    class DBSecurityGroup
      class Ingress < ResourceProperty
        aws_attribute :cidr_ip, type: String, name: 'CIDRIP'
        aws_attribute :ec2_security_group_id, type: String, name: 'EC2SecurityGroupId'
        aws_attribute :ec2_security_group_name, type: String, name: 'EC2SecurityGroupName'
        aws_attribute :ec2_security_group_owner_id, type: String, name: 'EC2SecurityGroupOwnerId'
      end
    end
  end
end


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

Row 1
<input type="checkbox">
More info
<button>Do something</button>

This tests that a link element present inside a label element is accessible when label has more than one child.


text:
wget -c http://data.dmlc.ml/mxnet/data/Inception.zip
unzip Inception.zip


text:
package bookingsystem;

/**
 * Created by law on 9/24/15.
 */
public class Reservation {
    /*
    In this class, Julius & Patience will implement bus reservation logic
     */

    public void reserveSeat(){
    	System.out.println("Select from the following available seats: ");
    	System.out.println("1A, 1B, 2C, 2D");
    }
}


text:
#ifndef LayoutSVGInlineText_h
#define LayoutSVGInlineText_h

#include "core/layout/LayoutText.h"
#include "core/layout/svg/SVGCharacterData.h"
#include "core/layout/svg/SVGTextMetrics.h"
#include "wtf/Vector.h"

namespace blink {

class LayoutSVGInlineText final : public LayoutText {
 public:
  LayoutSVGInlineText(Node*, PassRefPtr<StringImpl>);

  bool characterStartsNewTextChunk(int position) const;
  SVGCharacterDataMap& characterDataMap() { return m_characterDataMap; }
  const SVGCharacterDataMap& characterDataMap() const {
    return m_characterDataMap;
  }

  const Vector<SVGTextMetrics>& metricsList() const { return m_metrics; }

  float scalingFactor() const { return m_scalingFactor; }
  const Font& scaledFont() const { return m_scaledFont; }
  void updateScaledFont();
  void updateMetricsList(bool& lastCharacterWasWhiteSpace);
  static void computeNewScaledFontForStyle(LayoutObject*,
                                           float& scalingFactor,
                                           Font& scaledFont);

  // Preserves floating point precision for the use in DRT. It knows how to
  // round and does a better job than enclosingIntRect.
  FloatRect floatLinesBoundingBox() const;

  PassRefPtr<StringImpl> originalText() const override;

  const char* name() const override { return "LayoutSVGInlineText"; }

 private:
  void setTextInternal(PassRefPtr<StringImpl>) override;
  void styleDidChange(StyleDifference, const ComputedStyle*) override;

  void addMetricsFromRun(const TextRun&, bool& lastCharacterWasWhiteSpace);

  FloatRect objectBoundingBox() const override {
    return floatLinesBoundingBox();
  }

  bool isOfType(LayoutObjectType type) const override {
    return type == LayoutObjectSVG || type == LayoutObjectSVGInlineText ||
           LayoutText::isOfType(type);
  }

  PositionWithAffinity positionForPoint(const LayoutPoint&) override;
  LayoutRect localCaretRect(
      InlineBox*,
      int caretOffset,
      LayoutUnit* extraWidthToEndOfLine = nullptr) override;
  LayoutRect linesBoundingBox() const override;
  InlineTextBox* createTextBox(int start, unsigned short length) override;

  LayoutRect absoluteClippedOverflowRect() const final;
  FloatRect paintInvalidationRectInLocalSVGCoordinates() const final;

  float m_scalingFactor;
  Font m_scaledFont;
  SVGCharacterDataMap m_characterDataMap;
  Vector<SVGTextMetrics> m_metrics;
};

DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInlineText, isSVGInlineText());

}  // namespace blink

#endif  // LayoutSVGInlineText_h


text:
<BroadcastMonitor>
  <updated>2015-08-05T16:32:43</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-05T16:32:33</startTime>
    <itemId>1000080541:1241407</itemId>
    <titleId>216135253</titleId>
    <itemCode>10083</itemCode>
    <itemReference></itemReference>
    <titleName>Life Is Good</titleName>
    <artistName>Ephemerals</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>251</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-05T16:36:45</startTime>
    <itemId>1000080541:1241408</itemId>
    <titleId>190148138</titleId>
    <itemCode>HDX2574-0049</itemCode>
    <itemReference>HDX2574-0049</itemReference>
    <titleName>That's Life</titleName>
    <artistName>Frank Sinatra</artistName>
    <albumName></albumName>
    <CategoryCode>737</CategoryCode>
    <CategoryName>JAZZ</CategoryName>
    <itemDuration>188</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
import seabreeze.backends
# get the backend and add some functions/classes to this module
lib = seabreeze.backends.get_backend()

list_devices = lib.device_list_devices
SeaBreezeError = lib.SeaBreezeError
SeaBreezeDevice = lib.SeaBreezeDevice

import numpy

class _HelperFeatureAdder(object):

    def __init__(self, other):
        self._other = other

    def add(self, feature):
        ffunc = getattr(lib, "device_get_%s_feature_id" % feature)
        fids = ffunc(self._other._dev)
        if fids:
            return fids[0]
        else:
            return -1 # It seems as if negative numbers are not used for featureIDs

class LightSource(object):

    def __init__(self, device, featureId, index):
        ident = device, featureId, index
        self._ident = ident
        self._has_enable = lib.light_source_has_enable(*ident)
        self._has_varint = lib.light_source_has_variable_intensity(*ident)

    def set_enable(self, enable):
        if self._has_enable:
            d, f, i = self._ident
            lib.light_source_set_enable(d, f, i, enable)
        else:
            raise SeaBreezeError("Light source #%d can't be enabled or disabled.")

    def set_intensity(self, intensity):
        if self._has_varint:
            d, f, i = self._ident
            lib.light_source_set_intensity(d, f, i, intensity)
        else:
            raise SeaBreezeError("Light source #%d intensity can't be set.")

    def get_intensity(self):
        try:
            return lib.light_source_get_intensity(*self._ident)
        except SeaBreezeError:
            raise

    def __repr__(self):
        d, f, i = self._ident
        return "<LightSource #%d at %s:%s>" % (i, d.model, d.serial)

class Spectrometer(object):

    def __init__(self, device):
        self._open_device(device)

    @classmethod
    def from_serial_number(cls, serial=None):
        if serial is None:  # pick first spectrometer
            for dev in lib.device_list_devices():
                if not lib.device_is_open(dev):
                    return cls(dev)
            else:
                raise SeaBreezeError("No unopened device found.")
        else:  # pick spectrometer with correct serial
            for dev in lib.device_list_devices():
                if dev.serial == str(serial):
                    if lib.device_is_open(dev):
                        raise SeaBreezeError("Device already opened.")
                    else:
                        return cls(dev)
            else:
                raise SeaBreezeError("No device attached with serial number '%s'." % serial)

    def _open_device(self, device):
        if not isinstance(device, SeaBreezeDevice):
            raise SeaBreezeError("Not a SeaBreezeDevice")
        if lib.device_is_open(device):
            raise SeaBreezeError("Device already opened.")
        if hasattr(self, '_dev') and lib.device_is_open(getattr(self, '_dev')):
            lib.device_close(getattr(self, '_dev'))
        self._dev = device
        lib.device_open(self._dev)
        # get default information
        self._serial = self._dev.serial
        self._model = self._dev.model
        # get features
        feature = _HelperFeatureAdder(self)
        self._fidsp = feature.add('spectrometer')
        self._fidsh = feature.add('shutter')
        self._fidls = feature.add('light_source')
        self._fidcs = feature.add('continuous_strobe')
        self._fidee = feature.add('eeprom')
        self._fidic = feature.add('irrad_calibration')
        self._fidla = feature.add('lamp')
        self._fidte = feature.add('tec')
        self._fidnc = feature.add('nonlinearity_coeffs')  # Added
        self._fidsl = feature.add('stray_light_coeffs')
        self._fidspp = feature.add('spectrum_processing') # Not implemented in pyseabreeze
        # get additional information
        self._pixels = lib.spectrometer_get_formatted_spectrum_length(self._dev, self._fidsp)
        self._minimum_integration_time_micros = (
                lib.spectrometer_get_minimum_integration_time_micros(self._dev, self._fidsp))
        # get wavelengths
        self._wavelengths = numpy.zeros((self._pixels,), dtype=numpy.double)
        transfered_N = 0
        while True:
            transfered_N += lib.spectrometer_get_wavelengths(self._dev, self._fidsp,
                                                            self._wavelengths[transfered_N:])
            if transfered_N >= self._pixels:
                break
        # get dark pixel indices
        self._dark = lib.spectrometer_get_electric_dark_pixel_indices(self._dev, self._fidsp)
        self._has_dark_pixels = True if len(self._dark) > 0 else False
        # get nonlinearity coefficients
        try:
            sbnc = lib.nonlinearity_coeffs_get(self._dev, self._fidnc)
            self._nc = numpy.poly1d(sbnc[::-1])
            self._has_nonlinearity_coeffs = True
        except SeaBreezeError:
            self._has_nonlinearity_coeffs = False
        # if lightsources
        try:
            N_light_sources = lib.light_source_get_count(self._dev, self._fidls)
            self._light_sources = tuple(LightSource(self._dev, self._fidls, i)
                                                    for i in range(N_light_sources))
        except SeaBreezeError:
            self._light_sources = tuple()

    def wavelengths(self):
        return self._wavelengths

    def intensities(self, correct_dark_counts=False, correct_nonlinearity=False):
        if correct_dark_counts and not self._has_dark_pixels:
            raise SeaBreezeError("This device does not support dark count correction.")
        if correct_nonlinearity and not self._has_nonlinearity_coeffs:
            raise SeaBreezeError("This device does not support nonlinearity correction.")
        # Get the intensities
        out = numpy.empty((self._pixels,), dtype=numpy.double)
        transfered_N = 0
        while True:
            transfered_N += lib.spectrometer_get_formatted_spectrum(self._dev, self._fidsp,
                                                                    out[transfered_N:])
            if transfered_N >= self._pixels:
                break
        # Do corrections if requested
        if (correct_nonlinearity or correct_dark_counts):
            dark_offset = numpy.mean(out[self._dark]) if self._has_dark_pixels else 0.
            out -= dark_offset
        if (correct_nonlinearity):
            out = out / numpy.polyval(self._nc, out)
        if correct_nonlinearity and (not correct_dark_counts):
            out += dark_offset
        return out

    def spectrum(self, correct_dark_counts=False, correct_nonlinearity=False):
        return numpy.vstack((self._wavelengths,
                             self.intensities(correct_dark_counts, correct_nonlinearity)))

    def integration_time_micros(self, integration_time_micros):
        # Protect against a bug in libseabreeze:
        # If integration time is out of bounds, libseabreeze returns Undefined Error
        # (Probably only for devices with a non micro second time base...)
        try:
            lib.spectrometer_set_integration_time_micros(self._dev,
                                                         self._fidsp, integration_time_micros)
        except SeaBreezeError as e:
            if getattr(e, 'error_code', None) == 1:
                # Only replace if 'Undefined Error'
                raise SeaBreezeError("FIX: Specified integration time is out of range.")
            else:
                raise e

    def trigger_mode(self, mode):
        lib.spectrometer_set_trigger_mode(self._dev, self._fidsp, mode)

    def boxcar_width(self, boxcar_width):
        lib.spectrum_processing_set_boxcar_width(self._dev, self._fidspp, boxcar_width) # Not implemented in pyseabreeze

    def scans_to_average(self, scans_to_average):
        lib.spectrum_processing_set_scans_to_average(self._dev, self._fidspp, scans_to_average) # Not implemented in pyseabreeze

    def get_boxcar_width(self):
        lib.spectrum_processing_get_boxcar_width(self._dev, self._fidspp) # Not implemented in pyseabreeze

    def get_scans_to_average(self):
        lib.spectrum_processing_get_scans_to_average(self._dev, self._fidspp) # Not implemented in pyseabreeze

    @property
    def serial_number(self):
        return self._serial

    @property
    def model(self):
        return self._model

    @property
    def pixels(self):
        return self._pixels

    @property
    def minimum_integration_time_micros(self):
        return self._minimum_integration_time_micros

    @property
    def light_sources(self):
        return self._light_sources

    def eeprom_read_slot(self, slot):
        return lib.eeprom_read_slot(self._dev, self._fidee, slot)

    def tec_set_enable(self, enable):
        lib.tec_set_enable(self._dev, self._fidte, enable)

    def tec_set_temperature_C(self, set_point_C):
        lib.tec_set_temperature_setpoint_degrees_C(self._dev, self._fidte, set_point_C)

    def tec_get_temperature_C(self):
        return lib.tec_read_temperature_degrees_C(self._dev, self._fidte)

    def lamp_set_enable(self, enable):
        lib.lamp_set_lamp_enable(self._dev, self._fidla, enable)

    def shutter_set_open(self, state):
        lib.shutter_set_shutter_open(self._dev, self._fidsh, state)

    def stray_light_coeffs(self):
        return lib.stray_light_coeffs_get(self._dev, self._fidsl)

    def irrad_calibration(self):
        out = numpy.empty((self._pixels,), dtype=numpy.float32)
        lib.irrad_calibration_read(self._dev, self._fidic, out)
        return out

    def irrad_calibration_collection_area(self):
        if lib.irrad_calibration_has_collection_area(self._dev, self._fidic):
            return lib.irrad_calibration_read_collection_area(self._dev, self._fidic)
        else:
            raise SeaBreezeError("Device does not store irrad calibration area.")

    def continuous_strobe_set_enable(self, enable):
        lib.continuous_strobe_set_enable(self._dev, self._fidcs, enable)

    def continuous_strobe_set_period_micros(self, period_micros):
        lib.continuous_strobe_set_period_micros(self._dev, self._fidcs, period_micros)

    def close(self):
        lib.device_close(self._dev)

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()

    def __repr__(self):
        return "<Spectrometer %s:%s>" % (self.model, self.serial_number)


text:
import Immutable from 'immutable';

const initialState = Immutable.fromJS({
  isLoading: false
});

export default function app(state = initialState, action) {
  switch (action.type) {
    default:
      return state;
  }
}


text:
/* ***********************************************************
 * This file was automatically generated on 2016-02-10.      *
 *                                                           *
 * C/C++ Bindings Version 2.1.10                             *
 *                                                           *
 * If you have a bugfix for this file and want to commit it, *
 * please fix the bug in the generator. You can find a link  *
 * to the generators git repository on tinkerforge.com       *
 *************************************************************/

#ifndef BRICKLET_OLED_128X64_H
#define BRICKLET_OLED_128X64_H

#include "ip_connection.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \defgroup BrickletOLED128x64 OLED 128x64 Bricklet
 */

/**
 * \ingroup BrickletOLED128x64
 *
 * 3.3cm (1.3") OLED with 128x64 pixels
 */
typedef Device OLED128x64;

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_WRITE 1

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_NEW_WINDOW 2

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_CLEAR_DISPLAY 3

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_SET_DISPLAY_CONFIGURATION 4

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_GET_DISPLAY_CONFIGURATION 5

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_WRITE_LINE 6

/**
 * \ingroup BrickletOLED128x64
 */
#define OLED_128X64_FUNCTION_GET_IDENTITY 255

/**
 * \ingroup BrickletOLED128x64
 *
 * This constant is used to identify a OLED 128x64 Bricklet.
 *
 * The {@link oled_128x64_get_identity} function and the
 * {@link IPCON_CALLBACK_ENUMERATE} callback of the IP Connection have a
 * \c device_identifier parameter to specify the Brick's or Bricklet's type.
 */
#define OLED_128X64_DEVICE_IDENTIFIER 263

/**
 * \ingroup BrickletOLED128x64
 *
 * This constant represents the display name of a OLED 128x64 Bricklet.
 */
#define OLED_128X64_DEVICE_DISPLAY_NAME "OLED 128x64 Bricklet"

/**
 * \ingroup BrickletOLED128x64
 *
 * Creates the device object \c oled_128x64 with the unique device ID \c uid and adds
 * it to the IPConnection \c ipcon.
 */
void oled_128x64_create(OLED128x64 *oled_128x64, const char *uid, IPConnection *ipcon);

/**
 * \ingroup BrickletOLED128x64
 *
 * Removes the device object \c oled_128x64 from its IPConnection and destroys it.
 * The device object cannot be used anymore afterwards.
 */
void oled_128x64_destroy(OLED128x64 *oled_128x64);

/**
 * \ingroup BrickletOLED128x64
 *
 * Returns the response expected flag for the function specified by the
 * \c function_id parameter. It is *true* if the function is expected to
 * send a response, *false* otherwise.
 *
 * For getter functions this is enabled by default and cannot be disabled,
 * because those functions will always send a response. For callback
 * configuration functions it is enabled by default too, but can be disabled
 * via the oled_128x64_set_response_expected function. For setter functions it is
 * disabled by default and can be enabled.
 *
 * Enabling the response expected flag for a setter function allows to
 * detect timeouts and other error conditions calls of this setter as well.
 * The device will then send a response for this purpose. If this flag is
 * disabled for a setter function then no response is send and errors are
 * silently ignored, because they cannot be detected.
 */
int oled_128x64_get_response_expected(OLED128x64 *oled_128x64, uint8_t function_id, bool *ret_response_expected);

/**
 * \ingroup BrickletOLED128x64
 *
 * Changes the response expected flag of the function specified by the
 * \c function_id parameter. This flag can only be changed for setter
 * (default value: *false*) and callback configuration functions
 * (default value: *true*). For getter functions it is always enabled and
 * callbacks it is always disabled.
 *
 * Enabling the response expected flag for a setter function allows to detect
 * timeouts and other error conditions calls of this setter as well. The device
 * will then send a response for this purpose. If this flag is disabled for a
 * setter function then no response is send and errors are silently ignored,
 * because they cannot be detected.
 */
int oled_128x64_set_response_expected(OLED128x64 *oled_128x64, uint8_t function_id, bool response_expected);

/**
 * \ingroup BrickletOLED128x64
 *
 * Changes the response expected flag for all setter and callback configuration
 * functions of this device at once.
 */
int oled_128x64_set_response_expected_all(OLED128x64 *oled_128x64, bool response_expected);

/**
 * \ingroup BrickletOLED128x64
 *
 * Returns the API version (major, minor, release) of the bindings for this
 * device.
 */
int oled_128x64_get_api_version(OLED128x64 *oled_128x64, uint8_t ret_api_version[3]);

/**
 * \ingroup BrickletOLED128x64
 *
 * Appends 64 byte of data to the window as set by {@link oled_128x64_new_window}.
 *
 * Each row has a height of 8 pixels which corresponds to one byte of data.
 *
 * Example: if you call {@link oled_128x64_new_window} with column from 0 to 127 and row
 * from 0 to 7 (the whole display) each call of {@link oled_128x64_write} (red arrow) will
 * write half of a row.
 *
 * .. image:: /Images/Bricklets/bricklet_oled_128x64_display.png
 *    :scale: 100 %
 *    :alt: Display pixel order
 *    :align: center
 *    :target: ../../_images/Bricklets/bricklet_oled_128x64_display.png
 *
 * The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
 * bottom of the row.
 *
 * The next call of {@link oled_128x64_write} will write the second half of the row
 * and the next two the second row and so on. To fill the whole display
 * you need to call {@link oled_128x64_write} 16 times.
 */
int oled_128x64_write(OLED128x64 *oled_128x64, uint8_t data[64]);

/**
 * \ingroup BrickletOLED128x64
 *
 * Sets the window in which you can write with {@link oled_128x64_write}. One row
 * has a height of 8 pixels.
 *
 * The columns have a range of 0 to 127 and the rows have a range of 0 to 7.
 */
int oled_128x64_new_window(OLED128x64 *oled_128x64, uint8_t column_from, uint8_t column_to, uint8_t row_from, uint8_t row_to);

/**
 * \ingroup BrickletOLED128x64
 *
 * Clears the current content of the window as set by {@link oled_128x64_new_window}.
 */
int oled_128x64_clear_display(OLED128x64 *oled_128x64);

/**
 * \ingroup BrickletOLED128x64
 *
 * Sets the configuration of the display.
 *
 * You can set a contrast value from 0 to 255 and you can invert the color
 * (black/white) of the display.
 *
 * The default values are contrast 143 and inverting off.
 */
int oled_128x64_set_display_configuration(OLED128x64 *oled_128x64, uint8_t contrast, bool invert);

/**
 * \ingroup BrickletOLED128x64
 *
 * Returns the configuration as set by {@link oled_128x64_set_display_configuration}.
 */
int oled_128x64_get_display_configuration(OLED128x64 *oled_128x64, uint8_t *ret_contrast, bool *ret_invert);

/**
 * \ingroup BrickletOLED128x64
 *
 * Writes text to a specific line (0 to 7) with a specific position
 * (0 to 25). The text can have a maximum of 26 characters.
 *
 * For example: (1, 10, "Hello") will write *Hello* in the middle of the
 * second line of the display.
 *
 * You can draw to the display with {@link oled_128x64_write} and then add text to it
 * afterwards.
 *
 * The display uses a special 5x7 pixel charset. You can view the characters
 * of the charset in Brick Viewer.
 */
int oled_128x64_write_line(OLED128x64 *oled_128x64, uint8_t line, uint8_t position, const char text[26]);

/**
 * \ingroup BrickletOLED128x64
 *
 * Returns the UID, the UID where the Bricklet is connected to,
 * the position, the hardware and firmware version as well as the
 * device identifier.
 *
 * The position can be 'a', 'b', 'c' or 'd'.
 *
 * The device identifier numbers can be found :ref:`here <device_identifier>`.
 * |device_identifier_constant|
 */
int oled_128x64_get_identity(OLED128x64 *oled_128x64, char ret_uid[8], char ret_connected_uid[8], char *ret_position, uint8_t ret_hardware_version[3], uint8_t ret_firmware_version[3], uint16_t *ret_device_identifier);

#ifdef __cplusplus
}
#endif

#endif


text:
"""profiler python module provides APIs to profile TensorFlow models.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

# pylint: disable=unused-import
from tensorflow.core.profiler.tfprof_log_pb2 import OpLogProto
from tensorflow.core.profiler.tfprof_output_pb2 import AdviceProto
from tensorflow.core.profiler.tfprof_output_pb2 import GraphNodeProto
from tensorflow.core.profiler.tfprof_output_pb2 import MultiGraphNodeProto

from tensorflow.python.profiler.model_analyzer import advise
from tensorflow.python.profiler.model_analyzer import profile
from tensorflow.python.profiler.model_analyzer import Profiler
from tensorflow.python.profiler.option_builder import ProfileOptionBuilder
from tensorflow.python.profiler.tfprof_logger import write_op_log

from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = [
    'Profiler',
    'profile',
    'ProfileOptionBuilder',
    'advise',
    'write_op_log',
]

_allowed_symbols.extend([
    'GraphNodeProto',
    'MultiGraphNodeProto',
    'AdviceProto',
    'OpLogProto',
])

remove_undocumented(__name__, _allowed_symbols, [
    Profiler,
    profile,
    ProfileOptionBuilder,
    advise,
    write_op_log,
])


text:
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
from testtools import testcase as tc

from manila_tempest_tests.tests.api import base

class ShareTypesNegativeTest(base.BaseSharesMixedTest):

    @classmethod
    def _create_share_type(cls):
        name = data_utils.rand_name("unique_st_name")
        extra_specs = cls.add_extra_specs_to_dict()
        return cls.create_share_type(
            name, extra_specs=extra_specs,
            client=cls.admin_client)

    @classmethod
    def resource_setup(cls):
        super(ShareTypesNegativeTest, cls).resource_setup()
        cls.admin_client = cls.admin_shares_v2_client
        cls.st = cls._create_share_type()

    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
    def test_try_create_share_type_with_user(self):
        self.assertRaises(lib_exc.Forbidden,
                          self.create_share_type,
                          data_utils.rand_name("used_user_creds"),
                          client=self.shares_client)

    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
    def test_try_delete_share_type_with_user(self):
        self.assertRaises(lib_exc.Forbidden,
                          self.shares_client.delete_share_type,
                          self.st["share_type"]["id"])

    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
    def test_try_add_access_to_share_type_with_user(self):
        self.assertRaises(lib_exc.Forbidden,
                          self.shares_client.add_access_to_share_type,
                          self.st['share_type']['id'],
                          self.shares_client.tenant_id)

    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
    def test_try_remove_access_from_share_type_with_user(self):
        self.assertRaises(lib_exc.Forbidden,
                          self.shares_client.remove_access_from_share_type,
                          self.st['share_type']['id'],
                          self.shares_client.tenant_id)


text:
<?php

namespace DoctrineORMModule\Service;

use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Events;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
use DoctrineModule\Service\AbstractFactory;
use Zend\ServiceManager\ServiceLocatorInterface;

class EntityResolverFactory extends AbstractFactory
{
    /**
     * {@inheritDoc}
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /* @var $options \DoctrineORMModule\Options\EntityResolver */
        $options      = $this->getOptions($serviceLocator, 'entity_resolver');
        $eventManager = $serviceLocator->get($options->getEventManager());
        $resolvers    = $options->getResolvers();

        $targetEntityListener = new ResolveTargetEntityListener();

        foreach ($resolvers as $oldEntity => $newEntity) {
            $targetEntityListener->addResolveTargetEntity($oldEntity, $newEntity, array());
        }

        // Starting from Doctrine ORM 2.5, the listener implements EventSubscriber
        if ($targetEntityListener instanceof EventSubscriber) {
            $eventManager->addEventSubscriber($targetEntityListener);
        } else {
            $eventManager->addEventListener(Events::loadClassMetadata, $targetEntityListener);
        }

        return $eventManager;
    }

    /**
     * Get the class name of the options associated with this factory.
     *
     * @return string
     */
    public function getOptionsClass()
    {
        return 'DoctrineORMModule\Options\EntityResolver';
    }
}