text:
/* Include files */

#include <stddef.h>
#include "blas.h"
#include "CSE1_Oculus_gesture_sfun.h"
#include "c26_CSE1_Oculus_gesture.h"
#define CHARTINSTANCE_CHARTNUMBER      (chartInstance->chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER   (chartInstance->instanceNumber)
#include "CSE1_Oculus_gesture_sfun_debug_macros.h"
#define _SF_MEX_LISTEN_FOR_CTRL_C(S)   sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S);

/* Type Definitions */

/* Named Constants */
#define CALL_EVENT                     (-1)

/* Variable Declarations */

/* Variable Definitions */
static real_T _sfTime_;
static const char * c26_debug_family_names[4] = { "nargin", "nargout", "u", "y"
};

/* Function Declarations */
static void initialize_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void initialize_params_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void enable_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void disable_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void c26_update_debugger_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static const mxArray *get_sim_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void set_sim_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance, const mxArray *c26_st);
static void finalize_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void sf_gateway_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void initSimStructsc26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance);
static void init_script_number_translation(uint32_T c26_machineNumber, uint32_T
  c26_chartNumber, uint32_T c26_instanceNumber);
static const mxArray *c26_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData);
static void c26_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_y, const char_T *c26_identifier, real_T
  c26_b_y[3]);
static void c26_b_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId,
  real_T c26_y[3]);
static void c26_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData);
static const mxArray *c26_b_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData);
static const mxArray *c26_c_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData);
static real_T c26_c_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId);
static void c26_b_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData);
static const mxArray *c26_d_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData);
static int32_T c26_d_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId);
static void c26_c_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData);
static uint8_T c26_e_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_b_is_active_c26_CSE1_Oculus_gesture, const
  char_T *c26_identifier);
static uint8_T c26_f_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId);
static void init_dsm_address_info(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance);

/* Function Definitions */
static void initialize_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  chartInstance->c26_sfEvent = CALL_EVENT;
  _sfTime_ = sf_get_time(chartInstance->S);
  chartInstance->c26_is_active_c26_CSE1_Oculus_gesture = 0U;
}

static void initialize_params_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  (void)chartInstance;
}

static void enable_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  _sfTime_ = sf_get_time(chartInstance->S);
}

static void disable_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  _sfTime_ = sf_get_time(chartInstance->S);
}

static void c26_update_debugger_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  (void)chartInstance;
}

static const mxArray *get_sim_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  const mxArray *c26_st;
  const mxArray *c26_y = NULL;
  int32_T c26_i0;
  real_T c26_u[3];
  const mxArray *c26_b_y = NULL;
  uint8_T c26_hoistedGlobal;
  uint8_T c26_b_u;
  const mxArray *c26_c_y = NULL;
  real_T (*c26_d_y)[3];
  c26_d_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c26_st = NULL;
  c26_st = NULL;
  c26_y = NULL;
  sf_mex_assign(&c26_y, sf_mex_createcellmatrix(2, 1), false);
  for (c26_i0 = 0; c26_i0 < 3; c26_i0++) {
    c26_u[c26_i0] = (*c26_d_y)[c26_i0];
  }

  c26_b_y = NULL;
  sf_mex_assign(&c26_b_y, sf_mex_create("y", c26_u, 0, 0U, 1U, 0U, 1, 3), false);
  sf_mex_setcell(c26_y, 0, c26_b_y);
  c26_hoistedGlobal = chartInstance->c26_is_active_c26_CSE1_Oculus_gesture;
  c26_b_u = c26_hoistedGlobal;
  c26_c_y = NULL;
  sf_mex_assign(&c26_c_y, sf_mex_create("y", &c26_b_u, 3, 0U, 0U, 0U, 0), false);
  sf_mex_setcell(c26_y, 1, c26_c_y);
  sf_mex_assign(&c26_st, c26_y, false);
  return c26_st;
}

static void set_sim_state_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance, const mxArray *c26_st)
{
  const mxArray *c26_u;
  real_T c26_dv0[3];
  int32_T c26_i1;
  real_T (*c26_y)[3];
  c26_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  chartInstance->c26_doneDoubleBufferReInit = true;
  c26_u = sf_mex_dup(c26_st);
  c26_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c26_u, 0)), "y",
                       c26_dv0);
  for (c26_i1 = 0; c26_i1 < 3; c26_i1++) {
    (*c26_y)[c26_i1] = c26_dv0[c26_i1];
  }

  chartInstance->c26_is_active_c26_CSE1_Oculus_gesture = c26_e_emlrt_marshallIn
    (chartInstance, sf_mex_dup(sf_mex_getcell(c26_u, 1)),
     "is_active_c26_CSE1_Oculus_gesture");
  sf_mex_destroy(&c26_u);
  c26_update_debugger_state_c26_CSE1_Oculus_gesture(chartInstance);
  sf_mex_destroy(&c26_st);
}

static void finalize_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  (void)chartInstance;
}

static void sf_gateway_c26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  int32_T c26_i2;
  int32_T c26_i3;
  real_T c26_u[9];
  uint32_T c26_debug_family_var_map[4];
  real_T c26_nargin = 1.0;
  real_T c26_nargout = 1.0;
  real_T c26_y[3];
  real_T c26_b_u[3];
  int32_T c26_i4;
  int32_T c26_i5;
  int32_T c26_i6;
  real_T (*c26_b_y)[3];
  real_T (*c26_c_u)[9];
  c26_b_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c26_c_u = (real_T (*)[9])ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 17U, chartInstance->c26_sfEvent);
  for (c26_i2 = 0; c26_i2 < 9; c26_i2++) {
    _SFD_DATA_RANGE_CHECK((*c26_c_u)[c26_i2], 0U);
  }

  chartInstance->c26_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 17U, chartInstance->c26_sfEvent);
  for (c26_i3 = 0; c26_i3 < 9; c26_i3++) {
    c26_u[c26_i3] = (*c26_c_u)[c26_i3];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c26_debug_family_names,
    c26_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c26_nargin, 0U, c26_c_sf_marshallOut,
    c26_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c26_nargout, 1U, c26_c_sf_marshallOut,
    c26_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c26_u, 2U, c26_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c26_y, 3U, c26_sf_marshallOut,
    c26_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c26_sfEvent, 4);
  c26_b_u[0] = c26_u[0];
  c26_b_u[1] = c26_u[4];
  c26_b_u[2] = c26_u[8];
  for (c26_i4 = 0; c26_i4 < 3; c26_i4++) {
    c26_y[c26_i4] = c26_b_u[c26_i4];
  }

  _SFD_EML_CALL(0U, chartInstance->c26_sfEvent, -4);
  _SFD_SYMBOL_SCOPE_POP();
  for (c26_i5 = 0; c26_i5 < 3; c26_i5++) {
    (*c26_b_y)[c26_i5] = c26_y[c26_i5];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 17U, chartInstance->c26_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CSE1_Oculus_gestureMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  for (c26_i6 = 0; c26_i6 < 3; c26_i6++) {
    _SFD_DATA_RANGE_CHECK((*c26_b_y)[c26_i6], 1U);
  }
}

static void initSimStructsc26_CSE1_Oculus_gesture
  (SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  (void)chartInstance;
}

static void init_script_number_translation(uint32_T c26_machineNumber, uint32_T
  c26_chartNumber, uint32_T c26_instanceNumber)
{
  (void)c26_machineNumber;
  (void)c26_chartNumber;
  (void)c26_instanceNumber;
}

static const mxArray *c26_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData)
{
  const mxArray *c26_mxArrayOutData = NULL;
  int32_T c26_i7;
  real_T c26_b_inData[3];
  int32_T c26_i8;
  real_T c26_u[3];
  const mxArray *c26_y = NULL;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_mxArrayOutData = NULL;
  for (c26_i7 = 0; c26_i7 < 3; c26_i7++) {
    c26_b_inData[c26_i7] = (*(real_T (*)[3])c26_inData)[c26_i7];
  }

  for (c26_i8 = 0; c26_i8 < 3; c26_i8++) {
    c26_u[c26_i8] = c26_b_inData[c26_i8];
  }

  c26_y = NULL;
  sf_mex_assign(&c26_y, sf_mex_create("y", c26_u, 0, 0U, 1U, 0U, 1, 3), false);
  sf_mex_assign(&c26_mxArrayOutData, c26_y, false);
  return c26_mxArrayOutData;
}

static void c26_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_y, const char_T *c26_identifier, real_T
  c26_b_y[3])
{
  emlrtMsgIdentifier c26_thisId;
  c26_thisId.fIdentifier = c26_identifier;
  c26_thisId.fParent = NULL;
  c26_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c26_y), &c26_thisId, c26_b_y);
  sf_mex_destroy(&c26_y);
}

static void c26_b_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId,
  real_T c26_y[3])
{
  real_T c26_dv1[3];
  int32_T c26_i9;
  (void)chartInstance;
  sf_mex_import(c26_parentId, sf_mex_dup(c26_u), c26_dv1, 1, 0, 0U, 1, 0U, 1, 3);
  for (c26_i9 = 0; c26_i9 < 3; c26_i9++) {
    c26_y[c26_i9] = c26_dv1[c26_i9];
  }

  sf_mex_destroy(&c26_u);
}

static void c26_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData)
{
  const mxArray *c26_y;
  const char_T *c26_identifier;
  emlrtMsgIdentifier c26_thisId;
  real_T c26_b_y[3];
  int32_T c26_i10;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_y = sf_mex_dup(c26_mxArrayInData);
  c26_identifier = c26_varName;
  c26_thisId.fIdentifier = c26_identifier;
  c26_thisId.fParent = NULL;
  c26_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c26_y), &c26_thisId, c26_b_y);
  sf_mex_destroy(&c26_y);
  for (c26_i10 = 0; c26_i10 < 3; c26_i10++) {
    (*(real_T (*)[3])c26_outData)[c26_i10] = c26_b_y[c26_i10];
  }

  sf_mex_destroy(&c26_mxArrayInData);
}

static const mxArray *c26_b_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData)
{
  const mxArray *c26_mxArrayOutData = NULL;
  int32_T c26_i11;
  int32_T c26_i12;
  int32_T c26_i13;
  real_T c26_b_inData[9];
  int32_T c26_i14;
  int32_T c26_i15;
  int32_T c26_i16;
  real_T c26_u[9];
  const mxArray *c26_y = NULL;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_mxArrayOutData = NULL;
  c26_i11 = 0;
  for (c26_i12 = 0; c26_i12 < 3; c26_i12++) {
    for (c26_i13 = 0; c26_i13 < 3; c26_i13++) {
      c26_b_inData[c26_i13 + c26_i11] = (*(real_T (*)[9])c26_inData)[c26_i13 +
        c26_i11];
    }

    c26_i11 += 3;
  }

  c26_i14 = 0;
  for (c26_i15 = 0; c26_i15 < 3; c26_i15++) {
    for (c26_i16 = 0; c26_i16 < 3; c26_i16++) {
      c26_u[c26_i16 + c26_i14] = c26_b_inData[c26_i16 + c26_i14];
    }

    c26_i14 += 3;
  }

  c26_y = NULL;
  sf_mex_assign(&c26_y, sf_mex_create("y", c26_u, 0, 0U, 1U, 0U, 2, 3, 3), false);
  sf_mex_assign(&c26_mxArrayOutData, c26_y, false);
  return c26_mxArrayOutData;
}

static const mxArray *c26_c_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData)
{
  const mxArray *c26_mxArrayOutData = NULL;
  real_T c26_u;
  const mxArray *c26_y = NULL;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_mxArrayOutData = NULL;
  c26_u = *(real_T *)c26_inData;
  c26_y = NULL;
  sf_mex_assign(&c26_y, sf_mex_create("y", &c26_u, 0, 0U, 0U, 0U, 0), false);
  sf_mex_assign(&c26_mxArrayOutData, c26_y, false);
  return c26_mxArrayOutData;
}

static real_T c26_c_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId)
{
  real_T c26_y;
  real_T c26_d0;
  (void)chartInstance;
  sf_mex_import(c26_parentId, sf_mex_dup(c26_u), &c26_d0, 1, 0, 0U, 0, 0U, 0);
  c26_y = c26_d0;
  sf_mex_destroy(&c26_u);
  return c26_y;
}

static void c26_b_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData)
{
  const mxArray *c26_nargout;
  const char_T *c26_identifier;
  emlrtMsgIdentifier c26_thisId;
  real_T c26_y;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_nargout = sf_mex_dup(c26_mxArrayInData);
  c26_identifier = c26_varName;
  c26_thisId.fIdentifier = c26_identifier;
  c26_thisId.fParent = NULL;
  c26_y = c26_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c26_nargout),
    &c26_thisId);
  sf_mex_destroy(&c26_nargout);
  *(real_T *)c26_outData = c26_y;
  sf_mex_destroy(&c26_mxArrayInData);
}

const mxArray *sf_c26_CSE1_Oculus_gesture_get_eml_resolved_functions_info(void)
{
  const mxArray *c26_nameCaptureInfo = NULL;
  c26_nameCaptureInfo = NULL;
  sf_mex_assign(&c26_nameCaptureInfo, sf_mex_create("nameCaptureInfo", NULL, 0,
    0U, 1U, 0U, 2, 0, 1), false);
  return c26_nameCaptureInfo;
}

static const mxArray *c26_d_sf_marshallOut(void *chartInstanceVoid, void
  *c26_inData)
{
  const mxArray *c26_mxArrayOutData = NULL;
  int32_T c26_u;
  const mxArray *c26_y = NULL;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_mxArrayOutData = NULL;
  c26_u = *(int32_T *)c26_inData;
  c26_y = NULL;
  sf_mex_assign(&c26_y, sf_mex_create("y", &c26_u, 6, 0U, 0U, 0U, 0), false);
  sf_mex_assign(&c26_mxArrayOutData, c26_y, false);
  return c26_mxArrayOutData;
}

static int32_T c26_d_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId)
{
  int32_T c26_y;
  int32_T c26_i17;
  (void)chartInstance;
  sf_mex_import(c26_parentId, sf_mex_dup(c26_u), &c26_i17, 1, 6, 0U, 0, 0U, 0);
  c26_y = c26_i17;
  sf_mex_destroy(&c26_u);
  return c26_y;
}

static void c26_c_sf_marshallIn(void *chartInstanceVoid, const mxArray
  *c26_mxArrayInData, const char_T *c26_varName, void *c26_outData)
{
  const mxArray *c26_b_sfEvent;
  const char_T *c26_identifier;
  emlrtMsgIdentifier c26_thisId;
  int32_T c26_y;
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)chartInstanceVoid;
  c26_b_sfEvent = sf_mex_dup(c26_mxArrayInData);
  c26_identifier = c26_varName;
  c26_thisId.fIdentifier = c26_identifier;
  c26_thisId.fParent = NULL;
  c26_y = c26_d_emlrt_marshallIn(chartInstance, sf_mex_dup(c26_b_sfEvent),
    &c26_thisId);
  sf_mex_destroy(&c26_b_sfEvent);
  *(int32_T *)c26_outData = c26_y;
  sf_mex_destroy(&c26_mxArrayInData);
}

static uint8_T c26_e_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_b_is_active_c26_CSE1_Oculus_gesture, const
  char_T *c26_identifier)
{
  uint8_T c26_y;
  emlrtMsgIdentifier c26_thisId;
  c26_thisId.fIdentifier = c26_identifier;
  c26_thisId.fParent = NULL;
  c26_y = c26_f_emlrt_marshallIn(chartInstance, sf_mex_dup
    (c26_b_is_active_c26_CSE1_Oculus_gesture), &c26_thisId);
  sf_mex_destroy(&c26_b_is_active_c26_CSE1_Oculus_gesture);
  return c26_y;
}

static uint8_T c26_f_emlrt_marshallIn(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance, const mxArray *c26_u, const emlrtMsgIdentifier *c26_parentId)
{
  uint8_T c26_y;
  uint8_T c26_u0;
  (void)chartInstance;
  sf_mex_import(c26_parentId, sf_mex_dup(c26_u), &c26_u0, 1, 3, 0U, 0, 0U, 0);
  c26_y = c26_u0;
  sf_mex_destroy(&c26_u);
  return c26_y;
}

static void init_dsm_address_info(SFc26_CSE1_Oculus_gestureInstanceStruct
  *chartInstance)
{
  (void)chartInstance;
}

/* SFunction Glue Code */
#ifdef utFree
#undef utFree
#endif

#ifdef utMalloc
#undef utMalloc
#endif

#ifdef __cplusplus

extern "C" void *utMalloc(size_t size);
extern "C" void utFree(void*);

#else

extern void *utMalloc(size_t size);
extern void utFree(void*);

#endif

void sf_c26_CSE1_Oculus_gesture_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1015263013U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3205539371U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1790276243U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3434160899U);
}

mxArray *sf_c26_CSE1_Oculus_gesture_get_autoinheritance_info(void)
{
  const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
    "outputs", "locals" };

  mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5,
    autoinheritanceFields);

  {
    mxArray *mxChecksum = mxCreateString("wGDWcrDPoP6upYHC6H790F");
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
  }

  {
    mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
                mxREAL));
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
  }

  {
    mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL));
  }

  return(mxAutoinheritanceInfo);
}

mxArray *sf_c26_CSE1_Oculus_gesture_third_party_uses_info(void)
{
  mxArray * mxcell3p = mxCreateCellMatrix(1,0);
  return(mxcell3p);
}

mxArray *sf_c26_CSE1_Oculus_gesture_updateBuildInfo_args_info(void)
{
  mxArray *mxBIArgs = mxCreateCellMatrix(1,0);
  return mxBIArgs;
}

static const mxArray *sf_get_sim_state_info_c26_CSE1_Oculus_gesture(void)
{
  const char *infoFields[] = { "chartChecksum", "varInfo" };

  mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields);
  const char *infoEncStr[] = {
    "100 S1x2'type','srcId','name','auxInfo'{{M[1],M[5],T\"y\",},{M[8],M[0],T\"is_active_c26_CSE1_Oculus_gesture\",}}"
  };

  mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 2, 10);
  mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL);
  sf_c26_CSE1_Oculus_gesture_get_check_sum(&mxChecksum);
  mxSetField(mxInfo, 0, infoFields[0], mxChecksum);
  mxSetField(mxInfo, 0, infoFields[1], mxVarInfo);
  return mxInfo;
}

static void chart_debug_initialization(SimStruct *S, unsigned int
  fullDebuggerInitialization)
{
  if (!sim_mode_is_rtw_gen(S)) {
    SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
    ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
    ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
    chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)
      chartInfo->chartInstance;
    if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
      /* do this only if simulation is starting */
      {
        unsigned int chartAlreadyPresent;
        chartAlreadyPresent = sf_debug_initialize_chart
          (sfGlobalDebugInstanceStruct,
           _CSE1_Oculus_gestureMachineNumber_,
           26,
           1,
           1,
           0,
           2,
           0,
           0,
           0,
           0,
           0,
           &(chartInstance->chartNumber),
           &(chartInstance->instanceNumber),
           (void *)S);

        /* Each instance must initialize ist own list of scripts */
        init_script_number_translation(_CSE1_Oculus_gestureMachineNumber_,
          chartInstance->chartNumber,chartInstance->instanceNumber);
        if (chartAlreadyPresent==0) {
          /* this is the first instance */
          sf_debug_set_chart_disable_implicit_casting
            (sfGlobalDebugInstanceStruct,_CSE1_Oculus_gestureMachineNumber_,
             chartInstance->chartNumber,1);
          sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct,
            _CSE1_Oculus_gestureMachineNumber_,
            chartInstance->chartNumber,
            0,
            0,
            0);
          _SFD_SET_DATA_PROPS(0,1,1,0,"u");
          _SFD_SET_DATA_PROPS(1,2,0,1,"y");
          _SFD_STATE_INFO(0,0,2);
          _SFD_CH_SUBSTATE_COUNT(0);
          _SFD_CH_SUBSTATE_DECOMP(0);
        }

        _SFD_CV_INIT_CHART(0,0,0,0);

        {
          _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
        }

        _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);

        /* Initialization of MATLAB Function Model Coverage */
        _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0);
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,59);

        {
          unsigned int dimVector[2];
          dimVector[0]= 3;
          dimVector[1]= 3;
          _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c26_b_sf_marshallOut,(MexInFcnForType)NULL);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 3;
          _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c26_sf_marshallOut,(MexInFcnForType)
            c26_sf_marshallIn);
        }

        {
          real_T (*c26_u)[9];
          real_T (*c26_y)[3];
          c26_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
          c26_u = (real_T (*)[9])ssGetInputPortSignal(chartInstance->S, 0);
          _SFD_SET_DATA_VALUE_PTR(0U, *c26_u);
          _SFD_SET_DATA_VALUE_PTR(1U, *c26_y);
        }
      }
    } else {
      sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct,
        _CSE1_Oculus_gestureMachineNumber_,chartInstance->chartNumber,
        chartInstance->instanceNumber);
    }
  }
}

static const char* sf_get_instance_specialization(void)
{
  return "gTLrfa3gzmKOIRVgKqxP3E";
}

static void sf_opaque_initialize_c26_CSE1_Oculus_gesture(void *chartInstanceVar)
{
  chart_debug_initialization(((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar)->S,0);
  initialize_params_c26_CSE1_Oculus_gesture
    ((SFc26_CSE1_Oculus_gestureInstanceStruct*) chartInstanceVar);
  initialize_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar);
}

static void sf_opaque_enable_c26_CSE1_Oculus_gesture(void *chartInstanceVar)
{
  enable_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar);
}

static void sf_opaque_disable_c26_CSE1_Oculus_gesture(void *chartInstanceVar)
{
  disable_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar);
}

static void sf_opaque_gateway_c26_CSE1_Oculus_gesture(void *chartInstanceVar)
{
  sf_gateway_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar);
}

extern const mxArray* sf_internal_get_sim_state_c26_CSE1_Oculus_gesture
  (SimStruct* S)
{
  ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
  ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[4];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_raw2high");
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
  prhs[2] = (mxArray*) get_sim_state_c26_CSE1_Oculus_gesture
    ((SFc26_CSE1_Oculus_gestureInstanceStruct*)chartInfo->chartInstance);/* raw sim ctx */
  prhs[3] = (mxArray*) sf_get_sim_state_info_c26_CSE1_Oculus_gesture();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  mxDestroyArray(prhs[3]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n");
  }

  return plhs[0];
}

extern void sf_internal_set_sim_state_c26_CSE1_Oculus_gesture(SimStruct* S,
  const mxArray *st)
{
  ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
  ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[3];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_high2raw");
  prhs[1] = mxDuplicateArray(st);      /* high level simctx */
  prhs[2] = (mxArray*) sf_get_sim_state_info_c26_CSE1_Oculus_gesture();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 3, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n");
  }

  set_sim_state_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInfo->chartInstance, mxDuplicateArray(plhs[0]));
  mxDestroyArray(plhs[0]);
}

static const mxArray* sf_opaque_get_sim_state_c26_CSE1_Oculus_gesture(SimStruct*
  S)
{
  return sf_internal_get_sim_state_c26_CSE1_Oculus_gesture(S);
}

static void sf_opaque_set_sim_state_c26_CSE1_Oculus_gesture(SimStruct* S, const
  mxArray *st)
{
  sf_internal_set_sim_state_c26_CSE1_Oculus_gesture(S, st);
}

static void sf_opaque_terminate_c26_CSE1_Oculus_gesture(void *chartInstanceVar)
{
  if (chartInstanceVar!=NULL) {
    SimStruct *S = ((SFc26_CSE1_Oculus_gestureInstanceStruct*) chartInstanceVar
      )->S;
    ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
    if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
      sf_clear_rtw_identifier(S);
      unload_CSE1_Oculus_gesture_optimization_info();
    }

    finalize_c26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
      chartInstanceVar);
    utFree((void *)chartInstanceVar);
    if (crtInfo != NULL) {
      utFree((void *)crtInfo);
    }

    ssSetUserData(S,NULL);
  }
}

static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar)
{
  initSimStructsc26_CSE1_Oculus_gesture((SFc26_CSE1_Oculus_gestureInstanceStruct*)
    chartInstanceVar);
}

extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c26_CSE1_Oculus_gesture(SimStruct *S)
{
  int i;
  for (i=0;i<ssGetNumRunTimeParams(S);i++) {
    if (ssGetSFcnParamTunable(S,i)) {
      ssUpdateDlgParamAsRunTimeParam(S,i);
    }
  }

  if (sf_machine_global_initializer_called()) {
    ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
    ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
    initialize_params_c26_CSE1_Oculus_gesture
      ((SFc26_CSE1_Oculus_gestureInstanceStruct*)(chartInfo->chartInstance));
  }
}

static void mdlSetWorkWidths_c26_CSE1_Oculus_gesture(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
    mxArray *infoStruct = load_CSE1_Oculus_gesture_optimization_info();
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable(sf_get_instance_specialization(),infoStruct,
      26);
    ssSetStateflowIsInlinable(S,chartIsInlinable);
    ssSetRTWCG(S,sf_rtw_info_uint_prop(sf_get_instance_specialization(),
                infoStruct,26,"RTWCG"));
    ssSetEnableFcnIsTrivial(S,1);
    ssSetDisableFcnIsTrivial(S,1);
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop
      (sf_get_instance_specialization(),infoStruct,26,
       "gatewayCannotBeInlinedMultipleTimes"));
    sf_update_buildInfo(sf_get_instance_specialization(),infoStruct,26);
    if (chartIsInlinable) {
      ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
      sf_mark_chart_expressionable_inputs(S,sf_get_instance_specialization(),
        infoStruct,26,1);
      sf_mark_chart_reusable_outputs(S,sf_get_instance_specialization(),
        infoStruct,26,1);
    }

    {
      unsigned int outPortIdx;
      for (outPortIdx=1; outPortIdx<=1; ++outPortIdx) {
        ssSetOutputPortOptimizeInIR(S, outPortIdx, 1U);
      }
    }

    {
      unsigned int inPortIdx;
      for (inPortIdx=0; inPortIdx < 1; ++inPortIdx) {
        ssSetInputPortOptimizeInIR(S, inPortIdx, 1U);
      }
    }

    sf_set_rtw_dwork_info(S,sf_get_instance_specialization(),infoStruct,26);
    ssSetHasSubFunctions(S,!(chartIsInlinable));
  } else {
  }

  ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
  ssSetChecksum0(S,(299400708U));
  ssSetChecksum1(S,(3858039242U));
  ssSetChecksum2(S,(231537238U));
  ssSetChecksum3(S,(1109977696U));
  ssSetmdlDerivatives(S, NULL);
  ssSetExplicitFCSSCtrl(S,1);
  ssSupportsMultipleExecInstances(S,1);
}

static void mdlRTW_c26_CSE1_Oculus_gesture(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S)) {
    ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
  }
}

static void mdlStart_c26_CSE1_Oculus_gesture(SimStruct *S)
{
  SFc26_CSE1_Oculus_gestureInstanceStruct *chartInstance;
  ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)utMalloc(sizeof
    (ChartRunTimeInfo));
  chartInstance = (SFc26_CSE1_Oculus_gestureInstanceStruct *)utMalloc(sizeof
    (SFc26_CSE1_Oculus_gestureInstanceStruct));
  memset(chartInstance, 0, sizeof(SFc26_CSE1_Oculus_gestureInstanceStruct));
  if (chartInstance==NULL) {
    sf_mex_error_message("Could not allocate memory for chart instance.");
  }

  chartInstance->chartInfo.chartInstance = chartInstance;
  chartInstance->chartInfo.isEMLChart = 1;
  chartInstance->chartInfo.chartInitialized = 0;
  chartInstance->chartInfo.sFunctionGateway =
    sf_opaque_gateway_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.initializeChart =
    sf_opaque_initialize_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.terminateChart =
    sf_opaque_terminate_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.enableChart =
    sf_opaque_enable_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.disableChart =
    sf_opaque_disable_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.getSimState =
    sf_opaque_get_sim_state_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.setSimState =
    sf_opaque_set_sim_state_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.getSimStateInfo =
    sf_get_sim_state_info_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.zeroCrossings = NULL;
  chartInstance->chartInfo.outputs = NULL;
  chartInstance->chartInfo.derivatives = NULL;
  chartInstance->chartInfo.mdlRTW = mdlRTW_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.mdlStart = mdlStart_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.mdlSetWorkWidths =
    mdlSetWorkWidths_c26_CSE1_Oculus_gesture;
  chartInstance->chartInfo.extModeExec = NULL;
  chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.storeCurrentConfiguration = NULL;
  chartInstance->chartInfo.debugInstance = sfGlobalDebugInstanceStruct;
  chartInstance->S = S;
  crtInfo->instanceInfo = (&(chartInstance->chartInfo));
  crtInfo->isJITEnabled = false;
  ssSetUserData(S,(void *)(crtInfo));  /* register the chart instance with simstruct */
  init_dsm_address_info(chartInstance);
  if (!sim_mode_is_rtw_gen(S)) {
  }

  sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance);
  chart_debug_initialization(S,1);
}

void c26_CSE1_Oculus_gesture_method_dispatcher(SimStruct *S, int_T method, void *
  data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c26_CSE1_Oculus_gesture(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c26_CSE1_Oculus_gesture(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c26_CSE1_Oculus_gesture(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c26_CSE1_Oculus_gesture_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}


text:
export { activateAMPWithMode, setAMPMode } from './activate-amp-and-set-mode';
export { activatePlugins, deactivatePlugins } from './activate-plugins';
export { clearSessionStorage } from './clear-session-storage';
export { createWaitForFetchRequests } from './create-wait-for-fetch-requests';
export { deactivateUtilityPlugins } from './deactivate-utility-plugins';
export { evalWithWPData } from './eval-with-wp-data';
export { fetchPageContent } from './fetch-page-content';
export { getWPVersion } from './get-wp-version';
export { logoutUser } from './logout-user';
export { pageWait } from './page-wait';
export { pasteText } from './paste-text';
export { resetSiteKit } from './reset';
export { safeLoginUser } from './safe-login-user';
export { setAnalyticsExistingPropertyID } from './set-analytics-existing-property-id';
export { setAuthToken } from './set-auth-token';
export { setClientConfig } from './set-client-config';
export { setEditPostFeature } from './set-edit-post-feature';
export { setSearchConsoleProperty } from './set-search-console-property';
export { setSiteVerification } from './set-site-verification';
export { setupAdSense } from './setup-adsense';
export { setupAnalytics } from './setup-analytics';
export { setupSiteKit } from './setup-site-kit';
export { switchDateRange } from './switch-date-range';
export { testClientConfig } from './test-client-config';
export { testSiteNotification } from './test-site-notification';
export { useRequestInterception } from './use-request-interception';
export { wpApiFetch } from './wp-api-fetch';
export * from './features';
export * from './step-and-screenshot';

redpajama_set_name: RedPajamaGithub


text:
package gobgpapi

import (
	"fmt"
	"net"
	"time"

	"github.com/osrg/gobgp/config"
	"github.com/osrg/gobgp/packet/bgp"
	"github.com/osrg/gobgp/table"
)

type ToNativeOption struct {
	LocalAS                 uint32
	LocalID                 net.IP
	RouteReflectorClient    bool
	RouteReflectorClusterID net.IP
	NLRI                    bgp.AddrPrefixInterface
}

func (t *Table) ToNativeTable(option ...ToNativeOption) (*table.Table, error) {
	dsts := make([]*table.Destination, 0, len(t.Destinations))
	for _, d := range t.Destinations {
		dst, err := d.ToNativeDestination(option...)
		if err != nil {
			return nil, err
		}
		dsts = append(dsts, dst)
	}
	return table.NewTable(bgp.RouteFamily(t.Family), dsts...), nil
}

func getNLRI(family bgp.RouteFamily, buf []byte) (bgp.AddrPrefixInterface, error) {
	afi, safi := bgp.RouteFamilyToAfiSafi(family)
	nlri, err := bgp.NewPrefixFromRouteFamily(afi, safi)
	if err != nil {
		return nil, err
	}
	if err := nlri.DecodeFromBytes(buf); err != nil {
		return nil, err
	}
	return nlri, nil
}

func (d *Destination) ToNativeDestination(option ...ToNativeOption) (*table.Destination, error) {
	if len(d.Paths) == 0 {
		return nil, fmt.Errorf("no path in destination")
	}
	nlri, err := getNLRI(bgp.RouteFamily(d.Paths[0].Family), d.Paths[0].Nlri)
	if err != nil {
		return nil, err
	}
	option = append(option, ToNativeOption{
		NLRI: nlri,
	})
	paths := make([]*table.Path, 0, len(d.Paths))
	for _, p := range d.Paths {
		var path *table.Path
		var err error
		if p.Identifier > 0 {
			path, err = p.ToNativePath()
		} else {
			path, err = p.ToNativePath(option...)
		}
		if err != nil {
			return nil, err
		}
		paths = append(paths, path)
	}
	return table.NewDestination(nlri, 0, paths...), nil
}

func (p *Path) GetNativeNlri() (bgp.AddrPrefixInterface, error) {
	return getNLRI(bgp.RouteFamily(p.Family), p.Nlri)
}

func (p *Path) ToNativePath(option ...ToNativeOption) (*table.Path, error) {
	info := &table.PeerInfo{
		AS:      p.SourceAsn,
		ID:      net.ParseIP(p.SourceId),
		Address: net.ParseIP(p.NeighborIp),
	}
	var nlri bgp.AddrPrefixInterface
	for _, o := range option {
		info.LocalAS = o.LocalAS
		info.LocalID = o.LocalID
		info.RouteReflectorClient = o.RouteReflectorClient
		info.RouteReflectorClusterID = o.RouteReflectorClusterID
		nlri = o.NLRI
	}
	if nlri == nil {
		var err error
		nlri, err = getNLRI(bgp.RouteFamily(p.Family), p.Nlri)
		if err != nil {
			return nil, err
		}
	}
	pattr := make([]bgp.PathAttributeInterface, 0, len(p.Pattrs))
	for _, attr := range p.Pattrs {
		p, err := bgp.GetPathAttribute(attr)
		if err != nil {
			return nil, err
		}
		err = p.DecodeFromBytes(attr)
		if err != nil {
			return nil, err
		}
		pattr = append(pattr, p)
	}
	t := time.Unix(p.Age, 0)
	nlri.SetPathIdentifier(p.Identifier)
	nlri.SetPathLocalIdentifier(p.LocalIdentifier)
	path := table.NewPath(info, nlri, p.IsWithdraw, pattr, t, false)
	path.SetValidation(&table.Validation{
		Status:          config.IntToRpkiValidationResultTypeMap[int(p.Validation)],
		Reason:          table.IntToRpkiValidationReasonTypeMap[int(p.ValidationDetail.Reason)],
		Matched:         NewROAListFromApiStructList(p.ValidationDetail.Matched),
		UnmatchedAs:     NewROAListFromApiStructList(p.ValidationDetail.UnmatchedAs),
		UnmatchedLength: NewROAListFromApiStructList(p.ValidationDetail.UnmatchedLength),
	})
	path.MarkStale(p.Stale)
	path.IsNexthopInvalid = p.IsNexthopInvalid
	return path, nil
}

func NewROAListFromApiStructList(l []*Roa) []*table.ROA {
	roas := make([]*table.ROA, 0, len(l))
	for _, r := range l {
		ip := net.ParseIP(r.Prefix)
		rf := func(prefix string) bgp.RouteFamily {
			a, _, _ := net.ParseCIDR(prefix)
			if a.To4() != nil {
				return bgp.RF_IPv4_UC
			} else {
				return bgp.RF_IPv6_UC
			}
		}(r.Prefix)
		afi, _ := bgp.RouteFamilyToAfiSafi(rf)
		roa := table.NewROA(int(afi), []byte(ip), uint8(r.Prefixlen), uint8(r.Maxlen), r.As, net.JoinHostPort(r.Conf.Address, r.Conf.RemotePort))
		roas = append(roas, roa)
	}
	return roas
}

func extractFamilyFromConfigAfiSafi(c *config.AfiSafi) uint32 {
	if c == nil {
		return 0
	}
	// If address family value is already stored in AfiSafiState structure,
	// we prefer to use this value.
	if c.State.Family != 0 {
		return uint32(c.State.Family)
	}
	// In case that Neighbor structure came from CLI or gRPC, address family
	// value in AfiSafiState structure can be omitted.
	// Here extracts value from AfiSafiName field in AfiSafiConfig structure.
	if rf, err := bgp.GetRouteFamily(string(c.Config.AfiSafiName)); err == nil {
		return uint32(rf)
	}
	// Ignores invalid address family name
	return 0
}


text:
namespace JoinRpg.Dal.Impl.Migrations;

using System.Data.Entity.Migrations;

public partial class FieldProgrammaticValue : DbMigration
{
    public override void Up() => AddColumn("dbo.ProjectFields", "ProgrammaticValue", c => c.String());

    public override void Down() => DropColumn("dbo.ProjectFields", "ProgrammaticValue");
}


text:
"""
Implementación de los clientes TagFS.
"""

import random
import threading

import Zeroconf
import Pyro.core

from tagfs.common import ZEROCONF_SERVICE_TYPE
from tagfs.server import TagFSServer

class TagFSClient(object):
    """
    Clase base de los clientes de TagFS.
    """

    def __init__(self, address, data_dir, capacity, ntp_server=None):
        """
        Inicializa una instancia de un cliente TagFS.

        @type address: C{str}
        @param address: Dirección IP de la interfaz de red que se debe utilizar
           para comunicarse con los servidores TagFS y en la que debe escuchar
           el servidor que se ejecutará en este cliente.

        @type data_dir: C{str}
        @param data_dir: Ruta absoluta al directorio utilizado para almacenar
            los archivos y otros datos relacionados con el funcionamiento
            del servidor.

        @type capacity: C{int}
        @param capacity: Capacidad de almacenamiento en bytes de este servidor.
            TagFS garantizará que la capacidad utilizada por todos los
            archivos almacenados en este servidor no sobrepasará esta
            capacidad.

        @type ntp_server: C{str}
        @para ntp_server: Host del servidor NTP que se utilizará para obtener
            el tiempo durante el proceso de sincronización de los servidores.
            Si no se especifica este parámetro el servidor utilizará la hora
            del sistema durante la sincronización.
        """
        self._address = address
        self._data_dir = data_dir
        self._capacity = capacity
        self._ntp_server = ntp_server
        self.init_server()
        self.init_autodiscovery()

    def init_server(self):
        """
        Inicializa el servidor ejecutado por este cliente.
        """
        self._server = TagFSServer(self._address, self._data_dir, self._capacity, self._ntp_server)
        self._server_thread = threading.Thread(target=self._server.start)
        self._server_thread.start()

    def init_autodiscovery(self):
        """
        Inicializa el descubrimiento automático de los servidores.
        """
        self._servers = {}
        self._servers_mutex = threading.Lock()
        self.addService = self.server_added
        self.removeService = self.server_removed
        self._zeroconf = Zeroconf.Zeroconf(self._address)
        self._zeroconf_browser = Zeroconf.ServiceBrowser(self._zeroconf, ZEROCONF_SERVICE_TYPE, self)

    def terminate(self):
        """
        Termina la ejecución del client TagFS. Después de ejecutado este método
        no se debe hacer ningún llamado a los métodos de esta instancia.
        """
        self._server.stop()
        self._server_thread.join()
        self._zeroconf.close()

    def server_added(self, zeroconf, service_type, service_name):
        """
        Método ejecutado cuando se descubre un nuevo servidor TagFS.

        @type zeroconf: C{Zeroconf}
        @param zeroconf: Instancia del servidor implementando la comunicación
            mediante Zeroconf Multicast DNS Service Discovery.

        @type service_type: C{str}
        @param service_type: Nombre completamente calificado del tipo
            de servicio que fue descubierto.

        @type service_name: C{str}
        @param service_name: Nombre completamente calificado del nombre
            del servicio que fue descubierto.
        """
        with self._servers_mutex:
            pyro_uri = service_name[:-(len(service_type) + 1)]
            pyro_proxy = Pyro.core.getProxyForURI(pyro_uri)
            self._servers[pyro_uri] = pyro_proxy

    def server_removed(self, zeroconf, service_type, service_name):
        """
        Método ejecutado cuando un servidor TagFS deja de estar disponible.

        @type zeroconf: C{Zeroconf}
        @param zeroconf: Instancia del servidor implementando la comunicación
            mediante Zeroconf Multicast DNS Service Discovery.

        @type service_type: C{str}
        @param service_type: Nombre completamente calificado del tipo
            de servicio que fue descubierto.

        @type service_name: C{str}
        @param service_name: Nombre completamente calificado del nombre
            del servicio que fue descubierto.
        """
        with self._servers_mutex:
            pyro_uri = service_name[:-(len(service_type) + 1)]
            del self._servers[pyro_uri]

    def put(self, name, description, tags, owner, group, perms, data, replication):
        """
        Añade un nuevo archivo al sistema de ficheros distribuido.

        @type name: C{str}
        @param name: Nombre del archivo que se quiere añadir al sistema de
            ficheros distribuido. Es nombre se utilizará para crear el archivo
            en un sistema de ficheros local cuando se obtenga del sistema de
            ficheros distribuido. Será posible realizar búsquedas en el sistema
            distribuido introduciendo términos incluídos en el nombre.

        @type description: C{str}
        @param description: Descripción del archivo que se quiere añadir al
            sistema de ficheros distribuido. Será posible realizar búsquedas
            en el sistema distribuido introduciendo términos incluídos en la
            descripción.

        @type tags: C{set}
        @param tags: Conjunto de tags que se deben asociar a este archivo. Cada
            tag debe ser una palabra y no debe contener espacios. Será posible
            relizar búsquedas en el sistema distribuido introduciendo tags.

        @type owner: C{str}
        @param owner: Usuario que va a ser el dueño del fichero.

        @type group: C{str}
        @param group: Grupo del fichero.

        @type perms: C{int}
        @param perms: Permisos del fichero.

        @type data: C{str}
        @param data: Contenido del archivo.

        @type replication: C{int}
        @param replication: Porciento de replicación que se debe utillizar para
            este archivo. El cliente intentará que este archivo se almacene
            en un número de nodos correspondiente al porciento indicado del
            total de nodos disponibles en el momento en que se añade el archivo.

        @rtype: C{bool}
        @return: Este método retornará C{True} si el archivo se logró almacenar
            en al menos un servidor del sistema distribuido o C{False} en caso
            contrario. Es posible que aunque existan servidores conectados
            no se pueda almacenar el archivo porque estos no tengan la
            capacidad de almacenamiento necesaria.
        """
        with self._servers_mutex:
            size = len(data)

            # Servers where the file should be saved.
            num_servers = max(1, int((replication * len(self._servers)) / 100.0))
            servers = [server for server in self._servers.values()
                       if (server.status()['empty_space'] >= size)]
            servers = random.sample(servers, min(len(servers), num_servers))

            # Collect the metadata of the file.
            info = {}
            info['tags'] = tags
            info['description'] = description
            info['name'] = name
            info['size'] = str(size)
            info['owner'] = owner
            info['group'] = group
            info['perms'] = str(perms)

            # Save the file in each selected server.
            saved = False
            for server in servers:
                try:
                    server.put(data, info)
                except Exception:
                    # Ignoring any exception here. If the server is not accesible
                    # it will be eventually removed from the server list when is
                    # detected by Zeroconf.
                    pass
                else:
                    saved = True
        return saved

    def get(self, file_hash):
        """
        Obtiene el contenido del archivo identificado por C{file_hash}

        @type file_hash: C{str}
        @param file_hash: Hash del contenido del archivo cuyos datos
            se quiere obtener. Este hash identifica al archivo únicamente
            dentro del sistema de ficheros distribuidos.

        @rtype: C{str}
        @return: Contenido del archivo identificado por C{file_hash} si
            este archivo existe, C{None} si no hay almacenado en el
            sistema de ficheros distribuido un archivo identificado
            por el hash dado.
        """
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    data = server.get(file_hash)
                    if data is not None:
                        return data
                except Exception:
                    # Ignoring any exception here.
                    pass
        return None

    def remove(self, file_hash):
        """
        Elimina un archivo almacenado en el sistema de ficheros distribuido.
        Si el sistema de ficheros no tiene almacenado un archivo identificado
        con el hash dado no se realizará ninguna acción.

        @type file_hash: C{str}
        @param file_hash: Hash del contenido del archivo que se quiere
            eliminar. Este hash identifica al archivo únicamente
            dentro del sistema de ficheros distribuido.
        """
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    server.remove(file_hash)
                except Exception:
                    # Ignoring any exception here.
                    pass

    def list(self, tags):
        """
        Lista los archivos almacenados en el sistema de ficheros distribuido
        que tienen todos los tags especificados en el conjunto C{tags}.

        @type tags: C{set}
        @param tags: Conjunto de tags que deben tener los archivos.

        @rtype: C{set}
        @return: Conjunto con los hash de los archivos que tienen los tags
            especificados mediante el conjunto C{tags}.
        """
        all_results = set()
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    server_results = server.list(tags)
                    all_results |= server_results
                except Exception:
                    # Ignoring any exception here.
                    pass
        return all_results

    def search(self, text):
        """
        Realiza una búsqueda de texto libre en los tags, la descripción y el
        nombre de los archivos almacenados en el sistema de ficheros
        distribuido.

        @type text: C{str}
        @param text: Texto de la búsqueda que se quiere realizar.

        @rtype: C{set}
        @return: Conjunto con los hash de los archivos que son relevantes
            para la búsqueda de texto libre C{text}.
        """
        all_results = set()
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    server_results = server.search(text)
                    all_results |= server_results
                except Exception:
                    # Ignoring any exception here.
                    pass
        return all_results

    def info(self, file_hash):
        """
        Obtiene información a partir del hash de un archivo.

        @type file_hash: C{str}
        @param file_hash: Hash del contenido del archivo cuya información
            se quiere obtener. Este hash identifica al archivo únicamente
            dentro del sistema de ficheros distribuidos.

        @rtype: C{dict}
        @return: Diccionario con los metadatos del archivo si el sistema
            de ficheros distribuido tiene almacenado un archivo identificado
            por el hash dado, C{None} en caso contrario.
        """
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    info = server.info(file_hash)
                    if info is not None:
                        return info
                except Exception:
                    # Ignoring any exception here.
                    pass
        return None

    def get_all_tags(self):
        """
        Permite obtener un conjunto con todas los tags en el sistema.

        @rtype: C{set}
        @return: Conjunto con los nombres de las etiquetas del sistema.
        """
        all_results = set()
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    server_results = server.get_all_tags()
                    all_results |= server_results
                except Exception:
                    # Ignoring any exception here.
                    pass
        return all_results

    def get_popular_tags(self, number):
        """
        Permite obtener un conjunto con los tags más populares del sistema.

        @type number: C{int}
        @param number: Cantidad de tags populares deseadas.

        @rtype: C{set}
        @return: Conjunto con los nombres de las etiquetas del sistema.
        """
        all_results = {}
        with self._servers_mutex:
            for server in self._servers.itervalues():
                try:
                    server_results = server.get_popular_tags(number)
                    for frequency, tag in server_results:
                        if tag in all_results:
                            all_results[tag].append(frequency)
                        else:
                            all_results[tag] = [frequency]
                except Exception:
                    # Ignoring any exception here.
                    pass
        result = []
        for tag, freqs in all_results.iteritems():
            mean = (sum(freqs) / len(freqs), tag)
            result.append(mean)
        result.sort()
        return set([tag for (_, tag) in result[:number]])


text:
package pl.newicom.dddd.persistence

import akka.persistence.journal.{Tagged, WriteEventAdapter}
import com.typesafe.config.{Config, ConfigFactory, ConfigList}
import pl.newicom.dddd.messaging.event.EventMessage
import pl.newicom.dddd.persistence.TaggingEventAdapter.tagsByEvent

import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.util.Try

object TaggingEventAdapter {

  def config: Option[Config] = Try(ConfigFactory.parseResourcesAnySyntax("tags")).toOption

  val tagsByEvent: Map[String, List[String]] = {
    val map = new mutable.HashMap[String, mutable.Set[String]] with mutable.MultiMap[String, String]
    config.foreach { c =>
      c.root().entrySet().asScala.foreach { entry =>
        entry.getValue.asInstanceOf[ConfigList].unwrapped().asScala.foreach { v =>
          map.addBinding(entry.getKey, v.asInstanceOf[String])
        }
      }
    }
    reverseMultimap(map.toMap)
  }

  private def reverseMultimap[T1, T2](myMap: Map[T1, mutable.Set[T2]]): Map[T2, List[T1]] = {
    val instances = for {
      keyValue <- myMap.toList
      value <- keyValue._2
    } yield (value, keyValue._1)
    instances.groupBy(_._1).map(kv => kv._1 -> kv._2.map(_._2))
  }
}

class TaggingEventAdapter extends WriteEventAdapter {

  def toJournal(msg: Any): Any = msg match {
    case em: EventMessage =>
      val tags = em.tags ++ getTags(em)
      if (tags.isEmpty) em else Tagged(em.withTags(tags.toSeq :_*), tags)
    case _ => msg
  }

  private def getTags(em: EventMessage): Set[String] = {
    if (em.reused.contains(true)) {
      Set()
    } else {
      tagsByEvent.getOrElse(em.payloadFullName, List()).toSet
    }
  }

  def manifest(event: Any): String = ""
}


text:
package gov.samhsa.consent2share.web.controller;

import gov.samhsa.consent2share.common.AuthenticatedUser;
import gov.samhsa.consent2share.common.UserContext;
import gov.samhsa.consent2share.service.audit.AuditService;
import gov.samhsa.consent2share.service.dto.HistoryDto;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * The Class AuditTrailController.
 */
@Controller
@RequestMapping("/patients")
public class AuditTrailController extends AbstractController {

	/** The patient audit service. */
	@Autowired
	AuditService patientAuditService;

	/** The user context. */
	@Autowired
	UserContext userContext;

	/**
	 * Activity history.
	 *
	 * @param model the model
	 * @return the string
	 * @throws ClassNotFoundException the class not found exception
	 */
	@RequestMapping(value = "activityHistory.html")
	public String activityHistory(Model model) throws ClassNotFoundException {
		AuthenticatedUser currentUser = userContext.getCurrentUser();
		List<HistoryDto> historyListDtos = patientAuditService
				.findAllHistory(currentUser.getUsername());

		model.addAttribute("historys", historyListDtos);

		return "views/patients/activityHistory";
	}

}


text:
package seedu.task.model.task;

import java.time.LocalDate;
import java.time.LocalTime;

import seedu.task.model.tag.UniqueTagList;

/**
 * A read-only immutable interface for a Task in the task manager. Implementations should guarantee:
 * details are present and not null, field values are validated.
 */
public interface ReadOnlyTask {

    TaskName getTaskName();

    TaskDate getTaskDate();

    TaskTime getTaskStartTime();

    TaskTime getTaskEndTime();

    String getTaskDescription();

    TaskStatus getTaskStatus();

    LocalTime getLocalTime();

    LocalDate getLocalDate();

    /**
     * The returned TagList is a deep copy of the internal TagList, changes on the returned list
     * will not affect the task's internal tags.
     */
    UniqueTagList getTags();

    /**
     * Returns true if both have the same state. (interfaces cannot override .equals)
     */
    default boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other != null // this is first to avoid NPE below
                        && other.getTaskName() != null
                        && other.getTaskName().equals(this.getTaskName()) // state
                        // checks
                        // here
                        // onwards
                        && other.getTaskDate() != null
                        && other.getTaskDate().equals(this.getTaskDate())
                        && other.getTaskStartTime() != null
                        && other.getTaskStartTime().equals(this.getTaskStartTime())
                        && other.getTaskEndTime() != null
                        && other.getTaskEndTime().equals(this.getTaskEndTime()))
                        && other.getTaskDescription() != null
                        && other.getTaskDescription().equals(this.getTaskDescription())
                        && other.getTaskStatus() != null
                        && other.getTaskStatus().equals(this.getTaskStatus());
    }

    // @@author A0146757R
    /**
     * Formats the task as text, showing all task details.
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getTaskName());
        if (getTaskDate() != null) {
            builder.append(" Date: ").append(getTaskDate().toString());
        }
        if (getTaskStartTime() != null) {
            builder.append(" Start time: ").append(getTaskStartTime());
        }
        if (getTaskEndTime() != null) {
            builder.append(" End Time: ").append(getTaskEndTime());
        }
        builder.append(" Description: " + getTaskDescription());

        getTags().forEach(builder::append);
        return builder.toString();
    }
    // @@author
}


text:
package net.sf.maven.plugin.autotools;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;

import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

public class SymlinkUtilsTest {

    private File root;

    @Before
    public void setUp()
    throws Exception {
        root = makeTestRoot();
    }

    @After
    public void tearDown()
    throws Exception {
        if (root != null) {
            try {
                SymlinkUtils.deleteSymlinks(root);
            } finally {
                FileUtils.deleteDirectory(root);
            }
        }
        root = null;
    }

    @Test
    public void createSimpleSymlink()
    throws Exception {
        File targetDirectory = createDirectory(root, "a/b1/c1/d1/e1");
        File target = createFile(targetDirectory, "target.txt", "Simple");
        File linkDirectory = createDirectory(root, "a/b2/c2/d2/e2/f2");
        File link = new File(linkDirectory, "link");
        SymlinkUtils.createSymlink(link, target);
        File resolved = SymlinkUtils.resolveSymlink(link);
        String content = FileUtils.fileRead(resolved);
        assertEquals("Simple", content);
        assertEquals(target.getCanonicalFile(), resolved);
    }

    @Test
    public void createNastySymlink()
    throws Exception {
        File targetDirectory = createDirectory(root, "a/x[$y]/(z)/-/u v/_");
        File target = createFile(targetDirectory, "target.txt", "Nasty");
        File linkDirectory = createDirectory(root, "a/b2/c2/d2/e2/f2/g2");
        File link = new File(linkDirectory, "link");
        SymlinkUtils.createSymlink(link, target);
        File resolved = SymlinkUtils.resolveSymlink(link);
        String content = FileUtils.fileRead(resolved);
        assertEquals("Nasty", content);
        assertEquals(target.getCanonicalFile(), resolved);
    }

    @Test
    public void createDotdotSymlink()
    throws Exception {
        createDirectory(root, "a/x/y/z");
        File targetDirectory = createDirectory(root, "a/x/y/_");
        createFile(targetDirectory, "target.txt", "Dotdot");
        File target = new File(root, "a/x/y/z/../_/target.txt");
        File linkDirectory = createDirectory(root, "a/b2/c2/d2/e2/f2/g2");
        File link = new File(linkDirectory, "link");
        SymlinkUtils.createSymlink(link, target);
        File resolved = SymlinkUtils.resolveSymlink(link);
        String content = FileUtils.fileRead(resolved);
        assertEquals("Dotdot", content);
        assertEquals(target.getCanonicalFile(), resolved);
    }

    @Test
    public void createSymlinkWithUnicodeCharacters()
    throws Exception {
        // FIXME: Found no way to fix this on Windows...
        Assume.assumeTrue(Environment.getBuildEnvironment().isWindows() == false);
        File targetDirectory = createDirectory(root, "a/b/c/\u00f6/\u0153");
        File target = createFile(targetDirectory, "target.txt", "Woowoo");
        File linkDirectory = createDirectory(root, "a/b2/c2/d2/e2");
        File link = new File(linkDirectory, "link");
        SymlinkUtils.createSymlink(link, target);
        File resolved = SymlinkUtils.resolveSymlink(link);
        String content = FileUtils.fileRead(resolved);
        assertEquals("Woowoo", content);
        assertEquals(target.getCanonicalFile(), resolved);
    }

    @Test
    public void failCreateSymlinkWithSingleQuote()
    throws Exception {
        File linkDirectory = createDirectory(root, "a/b2/c2/d2");
        File target = new File(root, "a/single'quote.txt");
        File link = new File(linkDirectory, "link");
        IOException exception = null;
        try {
            SymlinkUtils.createSymlink(link, target);
        } catch (IOException ex) {
            exception = ex;
        }
        assertNotNull(exception);
        assertTrue(exception.getMessage().contains("contains single quotes"));
    }

    private File createDirectory(File root, String path) {
        File directory = new File(root, path);
        directory.mkdirs();
        return directory;
    }

    private File createFile(File targetDirectory, String name, String content)
    throws FileNotFoundException,
            IOException, UnsupportedEncodingException {
        File target = new File(targetDirectory, name);
        OutputStream ostream = new FileOutputStream(target);
        try {
            ostream.write(content.getBytes("ASCII"));
        } finally {
            ostream.close();
        }
        return target;
    }

    private static File makeTestRoot()
    throws IOException {
        File directory = File.createTempFile("symlinkutils-", "");
        directory.delete();
        directory.mkdir();
        return directory.getCanonicalFile();
    }

}


text:
<!DOCTYPE html>

  <title>Lemonade Stand</title>
  <base href="{{baseUrl}}" />

Lemonade Stand

Invoice

Please send {{amount}} BTC to {{address}}

Transactions Received


text:
"""
Word Embedding Module

@author: Ruchika Chhabra
"""

#!/usr/bin/python
import csv
import gensim
import numpy
import sys
import re
import operator

class WordEmbedding():
	'''
	This class has the following functionality:
	1. Reads the input text file, containing sentences to be clustered.
	2. Loads the word2vec pre-trained model.
	3. Finds vector corresponding to each input sentence.
	4. Creates an output CSV file containing input sentence and
	   corresponding vector representation.

	Attributes:
	-----------
	1. input_file_path: Input text file containing sentences, which
			    are to be represented in vector format.
	2. word2vec_model : Path of word2vec pre-trained model.
	3. word_vector_dim: Dimension of vector to be generated for input
			    sentence.
	'''

	def __init__(self, input_file_path, word2vec_model, word_vector_dim):
		'''
		This method is called to create an instance of this class.

		Parameters
		----------
		1. input_file_path: Path of Input text file containing sentences,
                	            which are to be represented in vector format.
        	2. word2vec_model : Path of word2vec pre-trained model.
        	3. word_vector_dim: Dimension of vector to be generated for input
				    sentence.
		'''
		self.input_file_path = input_file_path
		self.word2vec_model  = word2vec_model
		self.word_vector_dim = word_vector_dim

	def sentence_to_vector(self):
		'''
		1. This method creates vector for each input sentence read from input
		   text file.
		2. Sentence vector is generated by average of word vectors corresponding
		   to each word in the input sentence.
		'''

		# Write an output CSV file containing sentences and
		# corresponding vector representation.
		out_file   = open('sentence_vectors.csv','wb+')
		csv_writer = csv.writer(out_file)

		# Load pre-trained word2vec model in binary format.
		print '-LOADING WORD2VEC MODEL'
		word_model = gensim.models.KeyedVectors.load_word2vec_format(self.word2vec_model, binary= True)
		print '-LOADING COMPLETED'

		# Read Input Text File line by line
		print '-CONVERTING INPUT SENTENCES => VECTORS'
		for sentence in open(self.input_file_path):
			# sum of vectors corresponding to each word of sentence.
			sum_of_word_vectors = numpy.zeros(int(self.word_vector_dim))
			no_of_words = 0
			sentence    = re.sub('[^a-zA-Z0-9]', ' ', sentence)
			for word in sentence.split():
				no_of_words += 1
				try:
					# Find Vector corresponding to each word of sentence.
					sum_of_word_vectors = sum_of_word_vectors + word_model[word]
				except:
					# If vector corresponding to a word does not exist,
					# then skip that word.
					empty_vector = numpy.zeros(int(self.word_vector_dim))
					sum_of_word_vectors = sum_of_word_vectors + empty_vector
					no_of_words -=1
			avg_of_word_vec = (sum_of_word_vectors/no_of_words)

			# Write sentence and corresponding vector in output CSV file.
			csv_row = [sentence]
			csv_row.extend(avg_of_word_vec)
			csv_writer.writerow(csv_row)
		out_file.close()
		return 'sentence_vectors.csv'


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Blueprint41 Neo4j Driver v4")]
[assembly: AssemblyDescription("An Object Graph Mapper for CSharp and Neo4j. It has support for defining the object model as a schema. It support refactor scripts written in CSharp, which you can add to your project. When you run your program and the graph is of an older version, the upgrade script will automatically be executed against the graph. It also support generation of type-safe data objects, so you know at compile time if your code is compatible with the latest upgrades.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CIRCLES ARROWS LIMITED")]
[assembly: AssemblyProduct("Blueprint41 Neo4j Driver v4")]
[assembly: AssemblyCopyright("Copyright ©  2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.20.0")]
[assembly: AssemblyFileVersion("1.0.20.0")]


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright 2015 "Henry Tao <hi@henrytao.me>"
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="me.henrytao.bootstrapandroidlibrarydemo.activity.InfoActivity">

  <android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    app:navigationIcon="@drawable/ic_toolbar_arrow_back"
    style="@style/AppStyle.MdToolbar" />

  <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/toolbar">

    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:gravity="center"
      android:paddingBottom="?attr/mdLayout_spacing_md"
      android:paddingLeft="?attr/mdLayout_spacing_md"
      android:paddingRight="?attr/mdLayout_spacing_md"
      android:paddingTop="?attr/mdLayout_spacing_md">

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:text="@string/app_code"
        style="@style/MdText.Headline" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:gravity="center"
        android:text="@string/app_description"
        style="@style/MdText.Body1" />

      <View
        android:layout_width="match_parent"
        android:layout_height="?attr/mdLayout_spacing_lg" />

      <ImageView
        android:layout_width="?attr/mdIcon_xlg"
        android:layout_height="?attr/mdIcon_xlg"
        android:layout_marginBottom="?attr/mdLayout_spacing_md"
        android:src="@drawable/ic_logo" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:gravity="center"
        android:text="@string/app_copyright"
        style="@style/MdText.Body1" />

      <View
        android:layout_width="match_parent"
        android:layout_height="?attr/mdLayout_spacing_xlg" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:gravity="center"
        android:text="@string/text_fork"
        style="@style/MdText.Body1" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:autoLink="web"
        android:gravity="center"
        android:text="@string/app_repo"
        style="@style/MdText.Body1" />

      <View
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        style="@style/MdDivider" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:text="@string/text_license"
        style="@style/MdText.Headline" />

      <TextView
        android:layout_marginBottom="?attr/mdLayout_spacing_sm"
        android:text="@string/app_license"
        style="@style/MdText.Body1" />
    </LinearLayout>
  </ScrollView>
</RelativeLayout>


text:
// coding: utf-8

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

#ifndef XPCC_HD44780_HPP
	#error	"Don't include this file directly, use 'hd44780.hpp' instead!"
#endif

// ----------------------------------------------------------------------------
template <typename DATA, typename RW, typename RS, typename E>
xpcc::Hd44780<DATA, RW, RS, E>::Hd44780(uint8_t width, uint8_t height) :
	CharacterDisplay(width, height)
{
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::initialize()
{
	driver::initialize(this->lineCount == 1 ?
			driver::LineMode::OneLine :
			driver::LineMode::TwoLines);
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::writeRaw(char c)
{
	while(!driver::writeRAM(static_cast<uint8_t>(c)))
		;
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::setCursor(uint8_t column, uint8_t line)
{
	this->column = (column <= this->lineWidth ? column : this->lineWidth);
	this->line   = (line   <= this->lineCount ? line   : this->lineCount);

	uint8_t address = this->column + 0x40 * this->line;
	if (this->line >= 2) {
		address += 20;
	}
	while(!driver::writeAddress(address))
		;
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::execute(Command command)
{
	while(!driver::writeCommand(command))
		;
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::writeCGRAM(uint8_t character, uint8_t *cg)
{
	// There are only 8 characters in CGRAM
	if (character > 8) {
		return;
	}
	while(not driver::writeCGRAM(character, cg))
			;
}

template <typename DATA, typename RW, typename RS, typename E>
void
xpcc::Hd44780<DATA, RW, RS, E>::clear()
{
	while(!driver::clear())
		;
	while(!driver::resetCursor())
		;
}

// ----------------------------------------------------------------------------
template <typename DATA, typename RW, typename RS, typename E1, typename E2>
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::Hd44780Dual(uint8_t width, uint8_t height) :
	CharacterDisplay(width, height)
{
}

template <typename DATA, typename RW, typename RS, typename E1, typename E2>
void
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::initialize()
{
	driver1::initialize(driver1::LineMode::TwoLines);
	driver2::initialize(driver2::LineMode::TwoLines);
}

template <typename DATA, typename RW, typename RS, typename E1, typename E2>
void
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::writeRaw(char c)
{
	if (this->line < 2) {
		while(!driver1::writeRAM(static_cast<uint8_t>(c)))
			;
	} else {
		while(!driver2::writeRAM(static_cast<uint8_t>(c)))
			;
	}
}

template <typename DATA, typename RW, typename RS, typename E1, typename E2>
void
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::setCursor(uint8_t column, uint8_t line)
{
	this->column = (column <= this->lineWidth ? column : this->lineWidth);
	this->line = (line <= this->lineCount ? line : this->lineCount);

	uint8_t address = this->column;
	if (this->line & 0x01) {
		address += 0x40;
	}

	if (this->line < 2) {
		while(!driver1::writeAddress(address))
			;
	} else {
		while(!driver2::writeAddress(address))
			;
	}
}

template <typename DATA, typename RW, typename RS, typename E1, typename E2>
void
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::execute(Command command)
{
	while(!driver1::writeCommand(command))
		;
	while(!driver2::writeCommand(command))
		;
}

template <typename DATA, typename RW, typename RS, typename E1, typename E2>
void
xpcc::Hd44780Dual<DATA, RW, RS, E1, E2>::clear()
{
	while(!driver1::clear())
		;
	while(!driver1::resetCursor())
		;
	while(!driver2::clear())
		;
	while(!driver2::resetCursor())
		;
}


text:
'use strict';

// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var randu = require( '@stdlib/random/iter/mt19937' );
var array2iterator = require( '@stdlib/array/to-iterator' );
var iteratorSymbol = require( '@stdlib/symbol/iterator' );
var noop = require( '@stdlib/utils/noop' );
var iterUniqueBy = require( './../lib' );

// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof iterUniqueBy, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function throws an error if provided an iterator argument which is not an iterator protocol-compliant object', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		5,
		NaN,
		true,
		false,
		null,
		void 0,
		{},
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			iterUniqueBy( value, noop );
		};
	}
});

tape( 'the function throws an error if provided a second argument which is not a function', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		5,
		NaN,
		true,
		false,
		null,
		void 0,
		{},
		[]
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			iterUniqueBy( array2iterator( [ 1, 2, 3 ] ), value );
		};
	}
});

tape( 'the function returns an iterator protocol-compliant object (infinite iterator)', function test( t ) {
	var it;
	var v;
	var i;

	it = iterUniqueBy( randu(), predicate );
	t.equal( it.next.length, 0, 'has zero arity' );

	for ( i = 0; i < 100; i++ ) {
		v = it.next();
		t.equal( typeof v.value, 'number', 'returns expected value' );
		t.equal( v.done, false, 'returns expected value' );
	}
	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'the function returns an iterator protocol-compliant object (finite iterator)', function test( t ) {
	var expected;
	var values;
	var actual;
	var it;
	var i;

	values = [ 2, 1, 4, 3 ];
	expected = [
		{
			'value': 2,
			'done': false
		},
		{
			'value': 1,
			'done': false
		},
		{
			'value': 4,
			'done': false
		},
		{
			'value': 3,
			'done': false
		},
		{
			'done': true
		}
	];

	it = iterUniqueBy( array2iterator( values ), predicate );
	t.equal( it.next.length, 0, 'has zero arity' );

	actual = [];
	for ( i = 0; i < values.length; i++ ) {
		actual.push( it.next() );
	}
	actual.push( it.next() );

	t.deepEqual( actual, expected, 'returns expected values' );
	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'the function returns an iterator protocol-compliant object (empty iterator)', function test( t ) {
	var expected;
	var values;
	var actual;
	var it;

	values = [];
	expected = [
		{
			'done': true
		}
	];

	it = iterUniqueBy( array2iterator( values ), predicate );
	t.equal( it.next.length, 0, 'has zero arity' );

	actual = [];
	actual.push( it.next() );

	t.deepEqual( actual, expected, 'returns expected values' );
	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'the function returns an iterator which returns unique values', function test( t ) {
	var expected;
	var values;
	var actual;
	var it;
	var i;

	values = [ 2, 1, 2, 1, 1, 4, 4, 4, 3, 2, 1 ];
	expected = [
		{
			'value': 2,
			'done': false
		},
		{
			'value': 1,
			'done': false
		},
		{
			'value': 4,
			'done': false
		},
		{
			'value': 3,
			'done': false
		},
		{
			'done': true
		}
	];

	it = iterUniqueBy( array2iterator( values ), predicate );
	t.equal( it.next.length, 0, 'has zero arity' );

	actual = [];
	for ( i = 0; i < expected.length; i++ ) {
		actual.push( it.next() );
	}
	t.deepEqual( actual, expected, 'returns expected values' );
	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'the function returns an iterator which returns unique values (objects)', function test( t ) {
	var expected;
	var values;
	var actual;
	var it;
	var i;

	values = [
		{
			'v': 2
		},
		{
			'v': 1
		},
		{
			'v': 2
		},
		{
			'v': 4
		},
		{
			'v': 1
		},
		{
			'v': 4
		},
		{
			'v': 3
		}
	];
	expected = [
		{
			'value': {
				'v': 2
			},
			'done': false
		},
		{
			'value': {
				'v': 1
			},
			'done': false
		},
		{
			'value': {
				'v': 4
			},
			'done': false
		},
		{
			'value': {
				'v': 3
			},
			'done': false
		},
		{
			'done': true
		}
	];

	it = iterUniqueBy( array2iterator( values ), predicate );
	t.equal( it.next.length, 0, 'has zero arity' );

	actual = [];
	for ( i = 0; i < expected.length; i++ ) {
		actual.push( it.next() );
	}
	t.deepEqual( actual, expected, 'returns expected values' );
	t.end();

	function predicate( a, b ) {
		return ( a.v !== b.v );
	}
});

tape( 'the function supports providing a function evaluation context', function test( t ) {
	var expected;
	var values;
	var actual;
	var ctx;
	var it;
	var i;

	values = [ 2, 1, 4, 3 ];
	ctx = {
		'count': 0
	};
	expected = [
		{
			'value': 2,
			'done': false
		},
		{
			'value': 1,
			'done': false
		},
		{
			'value': 4,
			'done': false
		},
		{
			'value': 3,
			'done': false
		},
		{
			'done': true
		}
	];

	it = iterUniqueBy( array2iterator( values ), predicate, ctx );
	t.equal( it.next.length, 0, 'has zero arity' );

	actual = [];
	for ( i = 0; i < values.length; i++ ) {
		actual.push( it.next() );
	}
	actual.push( it.next() );

	t.deepEqual( actual, expected, 'returns expected values' );
	t.equal( ctx.count, 6, 'returns expected value' ); // calls per iterated value: 0+1+2+3
	t.end();

	function predicate( a, b ) {
		this.count += 1; // eslint-disable-line no-invalid-this
		return ( a !== b );
	}
});

tape( 'the returned iterator has a `return` method for closing an iterator (no argument)', function test( t ) {
	var it;
	var r;

	it = iterUniqueBy( randu(), predicate );

	r = it.next();
	t.equal( typeof r.value, 'number', 'returns a number' );
	t.equal( r.done, false, 'returns expected value' );

	r = it.next();
	t.equal( typeof r.value, 'number', 'returns a number' );
	t.equal( r.done, false, 'returns expected value' );

	r = it.return();
	t.equal( r.value, void 0, 'returns expected value' );
	t.equal( r.done, true, 'returns expected value' );

	r = it.next();
	t.equal( r.value, void 0, 'returns expected value' );
	t.equal( r.done, true, 'returns expected value' );

	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'the returned iterator has a `return` method for closing an iterator (argument)', function test( t ) {
	var it;
	var r;

	it = iterUniqueBy( randu(), predicate );

	r = it.next();
	t.equal( typeof r.value, 'number', 'returns a number' );
	t.equal( r.done, false, 'returns expected value' );

	r = it.next();
	t.equal( typeof r.value, 'number', 'returns a number' );
	t.equal( r.done, false, 'returns expected value' );

	r = it.return( 'finished' );
	t.equal( r.value, 'finished', 'returns expected value' );
	t.equal( r.done, true, 'returns expected value' );

	r = it.next();
	t.equal( r.value, void 0, 'returns expected value' );
	t.equal( r.done, true, 'returns expected value' );

	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'if an environment supports `Symbol.iterator` and the provided iterator is iterable, the returned iterator is iterable', function test( t ) {
	var iterUniqueBy;
	var opts;
	var rand;
	var it1;
	var it2;
	var i;

	iterUniqueBy = proxyquire( './../lib/main.js', {
		'@stdlib/symbol/iterator': '__ITERATOR_SYMBOL__'
	});

	opts = {
		'seed': 12345
	};
	rand = randu( opts );
	rand[ '__ITERATOR_SYMBOL__' ] = factory;

	it1 = iterUniqueBy( rand, predicate );
	t.equal( typeof it1[ '__ITERATOR_SYMBOL__' ], 'function', 'has method' );
	t.equal( it1[ '__ITERATOR_SYMBOL__' ].length, 0, 'has zero arity' );

	it2 = it1[ '__ITERATOR_SYMBOL__' ]();
	t.equal( typeof it2, 'object', 'returns an object' );
	t.equal( typeof it2.next, 'function', 'has method' );
	t.equal( typeof it2.return, 'function', 'has method' );

	for ( i = 0; i < 100; i++ ) {
		t.equal( it2.next().value, it1.next().value, 'returns expected value' );
	}
	t.end();

	function factory() {
		return randu( opts );
	}

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'if an environment does not support `Symbol.iterator`, the returned iterator is not "iterable"', function test( t ) {
	var iterUniqueBy;
	var it;

	iterUniqueBy = proxyquire( './../lib/main.js', {
		'@stdlib/symbol/iterator': false
	});

	it = iterUniqueBy( randu(), predicate );
	t.equal( it[ iteratorSymbol ], void 0, 'does not have property' );

	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});

tape( 'if a provided iterator is not iterable, the returned iterator is not iterable', function test( t ) {
	var iterUniqueBy;
	var rand;
	var it;

	iterUniqueBy = proxyquire( './../lib/main.js', {
		'@stdlib/symbol/iterator': '__ITERATOR_SYMBOL__'
	});

	rand = randu();
	rand[ '__ITERATOR_SYMBOL__' ] = null;

	it = iterUniqueBy( rand, predicate );
	t.equal( it[ iteratorSymbol ], void 0, 'does not have property' );

	t.end();

	function predicate( a, b ) {
		return ( a !== b );
	}
});


text:
    <form id="form-reportFilter" action="report/showEmployeeWorkingReport" method="post" target="iframe-report">

                <input type="text" name="Search" class="header-search-input z-depth-2" placeholder="Explore Materialize">

รายงานการปฏิบัติงาน
ของพนักงาน

                                <input type="text" id="truckNo" name="truckNo" placeholder="" readonly required="">
                                เบอร์รถ

                                <input type="text" id="licenseNo" name="licenseNo" placeholder="" readonly required="">
                                ทะเบียนรถ

                                <input type="text" id="branchName" name="branchName" placeholder="" readonly>
                                สาขา

                            <?php
                                if(!isset($fuelUsageInfo)){
                                    ?>

                                    เลือกรถเก็บขยะ
                                    search

                                    <?php
                                }
                            ?>

                <input type="hidden" id="displayType" name="displayType" value="print">
                <input type="hidden" name="truckID" id="truckID" value="">
                <input type="hidden" name="method" value="<?=$this->router->fetch_method()?>">

                                <input type="text" name="startDate" id="startDate" placeholder="ตั้งแต่" required="">
                                ช่วงเวลา

                                <input type="text" name="endDate" id="endDate" placeholder="ถึง" required="">

                                <button id="button-submit" class="btn waves-effect waves-light right green" type="submit" style="width: 50%;">
                                    ออกรายงาน
                                </button>
                                <button id="button-fullScreen" class="btn waves-effect waves-light right blue" type="button" style="margin-right: 5px;width: calc(50% - 5px)">
                                    ขยายหน้าจอ
                                </button>

    </form>

<?php
    require_once MODAL_DIR.'/browseTruck.php';
    require_once MODAL_DIR.'/chartPreview.php';
?>

<?php
    if(isset($truckInfo)){
        if($monNum=="all"){
            $monNum=12;
            $startDate = date('Y-m-d',strtotime('first day of 01-01-'.$yearNum));
            $lastDay = cal_days_in_month(CAL_GREGORIAN, $monNum, $yearNum);
            $endDate = $yearNum."-".$monNum."-".$lastDay;
        }else{
            $startDate = date('Y-m-d',strtotime('first day of 01-'.$monNum.'-'.$yearNum));
            $lastDay = cal_days_in_month(CAL_GREGORIAN, $monNum, $yearNum);
            $endDate = $yearNum."-".$monNum."-".$lastDay;
        }

        ?>

        <?php
    }
?>


text:
require 'spec_helper'

describe Scopeater::Base do
  let(:eater_class) { Scopeater::Base }
  let(:object) { "a string" }
  let(:eater) { eater_class.new object }

  it 'uses object class as taste by convention' do
    eater.taste.should == object.class
  end

  it 'contains given object' do
    eater.content.should == object
  end

  it 'likes same object class' do
    eater.like?("another string").should == true
  end

  it 'dislikes different object class' do
    eater.like?(666).should == false
  end

  describe 'method call returning matching taste' do
    let(:call_result) { eater.capitalize }
    before(:each) { call_result }

    it 'returns eater' do
      call_result.should be_a(eater_class)
    end

    it 'replaced eater content by new one' do
      call_result.content.should == object.capitalize
    end
  end

  describe 'method call returning unmatching taste' do
    let(:call_result) { eater.split(' ') }
    before(:each) { call_result }

    it 'returns content' do
      call_result.should == object.split(' ')
    end

    it "didn't change eater content" do
      eater.content.should == object
    end
  end

  context 'for specific taste' do
    let(:taste) { Float }
    let(:eater) { eater_class.new object, taste }

    it 'keeps this taste' do
      eater.taste.should == taste
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>statsmodels.nonparametric.kernel_density.KDEMultivariate.pdf — statsmodels 0.6.1 documentation</title>

    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="top" title="statsmodels 0.6.1 documentation" href="../index.html" />
    <link rel="up" title="statsmodels.nonparametric.kernel_density.KDEMultivariate" href="statsmodels.nonparametric.kernel_density.KDEMultivariate.html" />
    <link rel="next" title="statsmodels.nonparametric.kernel_density.KDEMultivariateConditional" href="statsmodels.nonparametric.kernel_density.KDEMultivariateConditional.html" />
    <link rel="prev" title="statsmodels.nonparametric.kernel_density.KDEMultivariate.loo_likelihood" href="statsmodels.nonparametric.kernel_density.KDEMultivariate.loo_likelihood.html" />
<link rel="stylesheet" href="../../_static/facebox.css" type="text/css" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />

Navigation

          index

          next |

          previous |

Install
  |

Support
  |

Bugs
  |

Develop
  |

Examples
  |

FAQ
  |

Nonparametric Methods nonparametric |

statsmodels.nonparametric.kernel_density.KDEMultivariate |

statsmodels.nonparametric.kernel_density.KDEMultivariate.pdf¶

KDEMultivariate.pdf(data_predict=None)[source]¶

Evaluate the probability density function.

<col class="field-name" />
<col class="field-body" />

Parameters:
data_predict: array_like, optional

Points to evaluate at.  If unspecified, the training data is used.

Returns:
pdf_est: array_like

Probability density function evaluated at data_predict.

Notes

The probability density is given by the generalized product kernel
estimator:

Previous topic

statsmodels.nonparametric.kernel_density.KDEMultivariate.loo_likelihood

Next topic

statsmodels.nonparametric.kernel_density.KDEMultivariateConditional

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

        © Copyright 2009-2013, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
      Created using Sphinx 1.3.1.