text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra.Data.Linq;
#pragma warning disable 618

namespace Cassandra.Tests.Mapping.Pocos
{
    [Table(CaseSensitive=false, Name="tbl1")]
    public class LinqDecoratedCaseInsensitiveEntity
    {
        [Column("i_id"), PartitionKey]
        public long LongValue { get; set; }

        [Column("val1")]
        public string StringValue { get; set; }

        [Column("val2")]
        [SecondaryIndex]
        public string AnotherStringValue { get; set; }

        public DateTimeOffset Date { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef __DEBUGGER_SRC_STM32L4XX_STM32L4_NVIC_H__
#define __DEBUGGER_SRC_STM32L4XX_STM32L4_NVIC_H__

#include "iclass.h"
#include "iservice.h"
#include "coreservices/imemop.h"
#include "generic/mapreg.h"
#include "generic/rmembank_gen1.h"

namespace debugger {

class STM32L4_NVIC : public IService {
 public:
    explicit STM32L4_NVIC(const char *name);
    virtual ~STM32L4_NVIC();

    /** IService interface */
    virtual void postinitService() override;

    /** Common methods */
    void enableInterrupt(int idx);
    void disableInterrupt(int idx);

 protected:
    class ONEBITS_TYPE : public MappedReg32Type {
     public:
        ONEBITS_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    MappedReg32Type(parent, name, addr) {
            startidx_ = startidx;
        }
     protected:
        int startidx_;
    };

    // Interrupt set-enable
    class ISER_TYPE : public ONEBITS_TYPE {
     public:
        ISER_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    ONEBITS_TYPE(parent, name, addr, startidx) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    // Interrupt clear-enable
    class ICER_TYPE : public ONEBITS_TYPE {
     public:
        ICER_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    ONEBITS_TYPE(parent, name, addr, startidx) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    // Interrupt set-pending
    class ISPR_TYPE : public ONEBITS_TYPE {
     public:
        ISPR_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    ONEBITS_TYPE(parent, name, addr, startidx) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    // Interrupt clear-pending
    class ICPR_TYPE : public ONEBITS_TYPE {
     public:
        ICPR_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    ONEBITS_TYPE(parent, name, addr, startidx) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    // Interrupt active
    class IABR_TYPE : public ONEBITS_TYPE {
     public:
        IABR_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) :
                    ONEBITS_TYPE(parent, name, addr, startidx) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    // Interrupt Priority. 8 bits per one interrupt (255 priorities)
    class IPR_TYPE : public MappedReg32Type {
     public:
        IPR_TYPE(IService *parent, const char *name, uint64_t addr,
                    int startidx) : MappedReg32Type(parent, name, addr) {
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
     protected:
        int startidx_;
    };

    // Software trigger interrupt
    class STIR_TYPE : public MappedReg32Type {
     public:
        STIR_TYPE(IService *parent, const char *name, uint64_t addr) :
                    MappedReg32Type(parent, name, addr) {
            hard_reset_value_ = 0x00000000;
            value_.val = hard_reset_value_;
        }

        union value_type {
            uint32_t v;
            struct bits_type {
                uint32_t INTID : 9;         // [8:0] w. SW generated Interrupt ID
                uint32_t res31_9: 23;       // [31:7]
            } b;
        };

        STIR_TYPE::value_type getTyped() {
            value_type ret;
            ret.v =  value_.val;
            return ret;
        }
     protected:
        virtual uint32_t aboutToWrite(uint32_t cur_val) override;
    };

    ISER_TYPE *NVIC_ISERx[8];     // interrupt 0 to 239
    ICER_TYPE *NVIC_ICERx[8];     // interrupt 0 to 239
    ISPR_TYPE *NVIC_ISPRx[8];     // interrupt 0 to 239
    ICPR_TYPE *NVIC_ICPRx[8];     // interrupt 0 to 239
    IABR_TYPE *NVIC_IABRx[8];     // interrupt 0 to 239
    IPR_TYPE * NVIC_IPRx[61];
    STIR_TYPE NVIC_STIR;
};

DECLARE_CLASS(STM32L4_NVIC)

}  // namespace debugger

#endif  // __DEBUGGER_SRC_STM32L4XX_STM32L4_NVIC_H__


text:
/* eslint-env mocha */
import { expect } from 'chai';
import getPercentage from '../../src/internal/get-percentage';

describe('getPercentage', () => {
  it('should return 0 if percentage isNaN', () => {
    const percentage = getPercentage();

    expect(percentage).to.equal(0);
  });

  it('should return percentage', () => {
    const percentage = getPercentage(5, 0, 10);

    expect(percentage).to.equal(0.5);
  });
});


text:
'use strict';

const fs = require('fs');

const _ = require('lodash');
const yaml = require('node-yaml');

const display = require('../cmds/lib/display')();

const defaultConfigData = {
    clusters: {
        localhost: { host: 'http://localhost:5678' }
    }
};

class Aliases {
    constructor(aliasesFile) {
        this.aliasesFile = aliasesFile;
        this.config = this._getConfig();
    }

    _getConfig() {
        let config;

        if (!fs.existsSync(this.aliasesFile)) {
            yaml.writeSync(this.aliasesFile, defaultConfigData);
        }

        try {
            config = yaml.readSync(this.aliasesFile);
        } catch (err) {
            throw new Error(`Failed to load ${this.aliasesFile}: ${err}`);
        }
        return config;
    }

    // FIXME: we need to ensure newClusterUrl is valid
    //   1: a valid URL
    //   2: an actual cluster that responds
    add(newClusterAlias, newClusterUrl) {
        if (_.has(this.config.clusters, newClusterAlias)) {
            throw new Error(`${newClusterAlias} already exists`);
        } else {
            this.config.clusters[newClusterAlias] = {
                host: newClusterUrl,
            };
            yaml.writeSync(this.aliasesFile, this.config);
        }
    }

    list(output = 'txt') {
        const header = ['cluster', 'host'];
        const clusters = _.map(
            _.mapValues(this.config.clusters, o => o.host),
            (value, key) => ({ cluster: key, host: value })
        );
        display.display(header, clusters, output);
    }

    present(alias) {
        return _.has(this.config.clusters, alias);
    }

    remove(clusterAlias) {
        if (_.has(this.config.clusters, clusterAlias)) {
            delete this.config.clusters[clusterAlias];
            yaml.writeSync(this.aliasesFile, this.config);
        } else {
            throw new Error(`${clusterAlias} not in aliases list`);
        }
    }

    update(clusterAlias, newClusterUrl) {
        if (_.has(this.config.clusters, clusterAlias)) {
            this.config.clusters[clusterAlias] = {
                host: newClusterUrl,
            };
            yaml.writeSync(this.aliasesFile, this.config);
        } else {
            throw new Error(`${clusterAlias} not in aliases list`);
        }
    }
}

module.exports = Aliases;


text:
module FixedWidth

  class Column
    attr_accessor :id
    attr_accessor :length

    def initialize( id, length )
      @id = id
      @length = length
    end

    def format( value )
      return value
    end
  end

end


text:
using System;

namespace BuildRevisionCounter.Web.Security
{
	public class BasicAuthenticationAttribute : Attribute
	{
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<project>
  <buildWrappers>
    <org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
      <bindings>
        <org.jenkinsci.plugins.credentialsbinding.impl.ZipFileBinding>
          <variable>CONFIG_ZIP</variable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caa6</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.ZipFileBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.FileBinding>
          <variable>config_file</variable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caab</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.FileBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordBinding>
          <variable>config_username_password</variable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caac</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>config_text</variable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caad</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.docker.commons.credentials.DockerServerCredentialsBinding>
          <variable>config_docker_server</variable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caae</credentialsId>
        </org.jenkinsci.plugins.docker.commons.credentials.DockerServerCredentialsBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding>
          <usernameVariable>myUsername</usernameVariable>
          <passwordVariable>myPassword</passwordVariable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caag</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding>
        <com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding>
          <accessKeyVariable>AWS_ACCESS_KEY_ID</accessKeyVariable>
          <secretKeyVariable>AWS_SECRET_ACCESS_KEY</secretKeyVariable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caaf</credentialsId>
        </com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.SSHUserPrivateKeyBinding>
          <keyFileVariable>KEY_FILE_VARIABLE</keyFileVariable>
          <usernameVariable>USER_NAME_VARIABLE</usernameVariable>
          <passphraseVariable>PASSPHRASE_VARIABLE</passphraseVariable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caah</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.SSHUserPrivateKeyBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.CertificateMultiBinding>
          <keystoreVariable>KEYSTORE_VARIABLE</keystoreVariable>
          <passwordVariable>PASSWORD_VARIABLE</passwordVariable>
          <aliasVariable>ALIAS_VARIABLE</aliasVariable>
          <credentialsId>b3e6f337-5d44-4f57-921c-1632d796caaj</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.CertificateMultiBinding>
      </bindings>
    </org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
  </buildWrappers>
</project>


text:
"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var React = _interopRequireWildcard(require("react"));

/**
 * @ignore - internal component.
 */
const TableContext = /*#__PURE__*/React.createContext();

if (process.env.NODE_ENV !== 'production') {
  TableContext.displayName = 'TableContext';
}

var _default = TableContext;
exports.default = _default;


text:
#include "_encoder_buffer.h"

static void encoder_data_init (EncodedData * data, PyObject *self, int max_depth, bool use_hook)
{
    data->depth     = 0;
    data->max_depth = max_depth;
    data->self      = self;
    data->use_hook  = use_hook;

    _encoder_buffer_allocate(data, DEFAULT_BUFFER_SIZE);

    data->buffer_free = data->buffer;
}

static bool _encoder_buffer_allocate (EncodedData * data, Py_ssize_t size)
// current allocation is ignored
{
    //printf(" [Buffer: %lld chars] ",(long long)size); fflush(stdout);

    data->buffer      = (BUFFERTYPE*) PyMem_Malloc (size);

    if (data->buffer == NULL)
    {
        PyErr_SetString(PyExc_MemoryError, "Unable to allocate memory for internal buffer");
        encoder_data_set_error(data);
        return false;
    }

    data->buffer_size = size;
    data->buffer_end  = data->buffer + size;

    return true;
}

static bool _encoder_buffer_grow (EncodedData * data, Py_ssize_t new_size)
// current data is saved (if present)
{
    if (new_size <= data->buffer_size) return true;

    BUFFERTYPE * old_buffer      = data->buffer;
    Py_ssize_t   old_buffer_size = data->buffer_size;
    BUFFERTYPE * old_buffer_free = data->buffer_free;

    if (! _encoder_buffer_allocate(data, new_size)) return false;

    if (old_buffer != NULL)
    {
        memcpy(data->buffer, old_buffer, old_buffer_size);
        PyMem_Free(old_buffer);
        data->buffer_free = data->buffer + (old_buffer_free - old_buffer);
    }

    return true;
}

static void encoder_data_destruct (EncodedData * data)
{
    PyMem_Free(data->buffer);
}

static Py_ssize_t encoder_data_get_size (EncodedData * data)
{
    return (data->buffer_free - data->buffer);
}

static bool encoder_data_reserve_space (EncodedData * data, Py_ssize_t size)
{
    if (data->buffer_free + size >= data->buffer_end)
    {
        if (encoder_data_has_error(data)) return false;

        // try to allocate twice the size of currently used space + size
        Py_ssize_t need_size = data->buffer_size > size? data->buffer_size*2 : size*2;

        // limit the size of extra unused buffer to MAX_EXTRA_ALLOCATION_SIZE
        if (need_size > data->buffer_size + MAX_EXTRA_ALLOCATION_SIZE)
            need_size = encoder_data_get_size(data) + size + MAX_EXTRA_ALLOCATION_SIZE;

        // make requested size a multiple of DEFAULT_BUFFER_SIZE
        // (in theory shoudl improve memory fragmentation in the OS)
        Py_ssize_t alloc_size = need_size + (DEFAULT_BUFFER_SIZE - need_size % DEFAULT_BUFFER_SIZE);

        if (! _encoder_buffer_grow(data, alloc_size)) return false;
    }
    // else: do nothing, already have enough space in currently allocated buffer

    return true;
}

static bool encoder_data_has_error (EncodedData * data)
{
    return data->buffer_size == -1;
}

static void encoder_data_set_error (EncodedData * data)
{
    data->buffer_size = -1;
}

static void encoder_data_append (EncodedData * data, const BUFFERTYPE* str, Py_ssize_t str_length)
{
    if (!encoder_data_reserve_space(data, str_length)) return;

    memcpy(data->buffer_free, str, str_length);

    data->buffer_free += str_length;
}

static void encoder_data_append_char (EncodedData * data, const BUFFERTYPE ch)
{
    if(!encoder_data_reserve_space(data, 1)) return;

    *data->buffer_free++ = ch;
}

static void encoder_data_append_ch_nocheck (EncodedData * data, const BUFFERTYPE ch)
{
    *data->buffer_free++ = ch;
}

static void encoder_data_place_ch_nocheck (EncodedData * data, const BUFFERTYPE ch, int offset)
{
    data->buffer_free[offset] = ch;
}

static void encoder_data_append_cstr (EncodedData * data, const char * cstr, Py_ssize_t max_size)
{
    if(!encoder_data_reserve_space(data, max_size)) return;

    char ch;
    Py_ssize_t i = 0;

    while ( (ch = cstr[i++]) )
    {
        encoder_data_append_ch_nocheck(data, ch);
    }
}


text:
package io.cdap.functions;

import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.gson.JsonElement;
import io.cdap.cdap.api.data.format.StructuredRecord;
import io.cdap.cdap.api.data.schema.Schema;
import io.cdap.wrangler.utils.StructuredRecordJsonConverter;

import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;

/**
 * Structured Row and Schema DDL.
 */
public final class DDL {
  private DDL() {
  }

  /**
   * Given a JSON representation of schema, returns a {@link Schema} object.
   *
   * @param json string representation of schema.
   * @return instance of {@link Schema} representing JSON string.
   * @throws IOException thrown when there is issue parsing the data.
   */
  public static Schema parse(String json) throws IOException {
    return Schema.parseJson(json);
  }

  /**
   * Given a SQL DDL, returns the {@link Schema} representation of the SQL.
   *
   * @param sql to be converted to {@link Schema}.
   * @return instance of {@link Schema}.
   * @throws IOException throw when there is issue parsing the sql.
   */
  public static Schema parsesql(String sql) throws IOException {
    return Schema.parseSQL(sql);
  }

  /**
   * Identity parse method to extract {@link Schema}.
   *
   * This method is added if a user makes a mistake of parsing the schema again.
   *
   * @param schema to be returned.
   * @return above schema object.
   */
  public static Schema parse(Schema schema) {
    return schema;
  }

  /**
   * Given a {@link StructuredRecord} returns the same {@link StructuredRecord}.
   */
  public static StructuredRecord parse(StructuredRecord record) {
    return record;
  }

  /**
   * Converts a {@link StructuredRecord} to JSON string.
   *
   * @param record to be converted to JSON
   * @return JSON string representation of structured record.
   * @throws IOException thrown if there are any issues with parsing.
   */
  public static JsonElement toJson(StructuredRecord record) throws IOException {
    return JsonFunctions.Parse(StructuredRecordJsonConverter.toJsonString(record));
  }

  /**
   * Given a {@link StructuredRecord} and the name of the field, it checks, if the
   * field exists in the {@link StructuredRecord}.
   *
   * @param record in which the field needs to be checked.
   * @param name of the field to be checked.
   * @return true if present and it's a record, else false.
   */
  public static boolean hasField(StructuredRecord record, String name) {
    Schema.Field field = record.getSchema().getField(name);
    if (field == null) {
      return false;
    }
    return true;
  }

  /**
   * Drops a path from the schema to generate a new {@link Schema}.
   *
   * @param schema to be modified.
   * @param path to be removed from {@link Schema}.
   * @return modified {@link Schema}
   */
  public static Schema drop(Schema schema, String path) {
    return drop(schema, path, path);
  }

  public static Schema drop(Schema schema, String path, String ... paths) {
    Schema mutatedSchema = drop(schema, path, path);
    for (String otherPath : paths) {
      mutatedSchema = drop(mutatedSchema, otherPath, otherPath);
    }
    return mutatedSchema;
  }

  private static Schema drop(Schema schema, @Nullable String path, String fullPath) {
    if (path == null) {
      return schema;
    }

    // TODO: Need to handle union type
    if (schema.getType() != Schema.Type.RECORD) {
      return schema;
    }

    int dotIndex = path.indexOf('.');
    String recordField = dotIndex > 0 ? path.substring(0, dotIndex) : path;
    String nextPath = dotIndex > 0 ? path.substring(dotIndex + 1) : null;

    int arrayIndex = -1;
    int bracketIndex = recordField.indexOf('[');
    if (bracketIndex > 0) {
      if (!recordField.endsWith("]")) {
        throw new IllegalArgumentException(
          String.format("Invalid field '%s' in path '%s'. An array index start with '[' and must end with a ']'",
                        recordField, fullPath));
      }
      String indexStr = recordField.substring(bracketIndex + 1, recordField.length() - 1);
      try {
        arrayIndex = Integer.parseInt(indexStr);
      } catch (NumberFormatException e) {
        throw new IllegalArgumentException(
          String.format("Invalid array index '%s' for field '%s' in path '%s'. Must be a valid integer.",
                        indexStr, recordField, fullPath));
      }
      recordField = recordField.substring(0, bracketIndex);
    }

    List<Schema.Field> fields = new ArrayList<>();
    for (Schema.Field field : schema.getFields()) {
      if (field.getName().equals(recordField)) {
        if (nextPath == null) {
          continue;
        }
        Schema fieldSchema = field.getSchema();
        boolean isNullable = fieldSchema.isNullable();
        Schema.Type fieldtype = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();
        if (arrayIndex >= 0) {
          if (fieldtype != Schema.Type.ARRAY) {
            throw new IllegalArgumentException(
              String.format("Array syntax for nested field '%s' in path '%s' was specified, but '%s' is of type %s.",
                            recordField, fullPath, recordField, fieldtype));
          }
          Schema componentSchema =
            isNullable ? fieldSchema.getNonNullable().getComponentSchema() : fieldSchema.getComponentSchema();
          boolean componentNullable = componentSchema.isNullable();
          Schema.Type componentType = componentNullable ?
            componentSchema.getNonNullable().getType() : componentSchema.getType();
          if (nextPath != null && componentType != Schema.Type.RECORD) {
            throw new IllegalArgumentException(
              String.format("Nested field '%s' in path '%s' must be of type '%s', but is '%s'.",
                            recordField, fullPath, Schema.Type.RECORD, componentType));
          }

          Schema componentSchemaWithout =
            drop(componentNullable ? componentSchema.getNonNullable() : fieldSchema, nextPath, fullPath);
          componentSchemaWithout =
            componentNullable ? Schema.nullableOf(componentSchemaWithout) : componentSchemaWithout;

          Schema arraySchema = Schema.arrayOf(componentSchemaWithout);
          arraySchema = isNullable ? Schema.nullableOf(arraySchema) : arraySchema;
          fields.add(Schema.Field.of(field.getName(), arraySchema));
          continue;
        } else if (nextPath != null && fieldtype != Schema.Type.RECORD) {
          throw new IllegalArgumentException(
            String.format("Nested field '%s' in path '%s' must be of type '%s', but is '%s'.",
                          recordField, fullPath, Schema.Type.RECORD, fieldtype));
        }
        fields.add(Schema.Field.of(field.getName(), drop(field.getSchema(), nextPath, fullPath)));
      } else {
        fields.add(field);
      }
    }
    return Schema.recordOf(schema.getRecordName(), fields);
  }

  /**
   * Selects the sub-record based on the path specified.
   *
   * @param schema to be used as source to apply the path to.
   * @param path to be applied on the {@link Schema} to select.
   * @return sub-selected {@link Schema}
   */
  public static Schema select(Schema schema, String path) {
    return select(schema, path, Splitter.on('.').split(path).iterator());
  }

  private static Schema select(Schema schema, String path, Iterator<String> fields) {
    String fieldName = fields.next();

    String key = null;
    int bracketIndex = fieldName.indexOf('[');
    if (bracketIndex > 0) {
      if (!fieldName.endsWith("]")) {
        throw new IllegalArgumentException(
          String.format("Invalid field '%s'. An index start '[' must end with a ']'", fieldName));
      }
      key = fieldName.substring(bracketIndex + 1, fieldName.length() - 1);
      fieldName = fieldName.substring(0, bracketIndex);
    }

    Schema.Field field = schema.getField(fieldName);

    if (field == null) {
      throw new IllegalArgumentException(
        String.format("Nested field '%s' in path '%s' does not exist", fieldName, path));
    }

    Schema fieldSchema = field.getSchema();
    boolean isNullable = fieldSchema.isNullable();
    Schema.Type fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();

    if (key != null) {
      if (fieldType == Schema.Type.ARRAY) {
        try {
          int arrayIndex = Integer.parseInt(key);
          if (arrayIndex < 0) {
            throw new IllegalArgumentException(
              String.format("Invalid array index '%d' for field '%s' in path '%s. Must be at least 0.",
                            arrayIndex, fieldName, path));
          }
        } catch (NumberFormatException e) {
          throw new IllegalArgumentException(
            String.format("Invalid array index '%s' for field '%s' in path '%s'. Must be a valid int.",
                          key, fieldName, path));
        }

        fieldSchema = isNullable ? fieldSchema.getNonNullable().getComponentSchema() : fieldSchema.getComponentSchema();
        isNullable = fieldSchema.isNullable();
        fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();
      } else if (fieldType == Schema.Type.MAP) {

        Map.Entry<Schema, Schema> mapSchema = fieldSchema.getMapSchema();
        Schema keySchema = mapSchema.getKey();
        Schema valSchema = mapSchema.getValue();

        Schema.Type keyType = keySchema.isNullable() ? keySchema.getNonNullable().getType() : keySchema.getType();
        if (keyType != Schema.Type.STRING) {
          throw new IllegalArgumentException(
            String.format("Only map keys of type string are supported. Field '%s' in path '%s' has keys of type '%s'.",
                          fieldName, path, keyType));
        }

        fieldSchema = valSchema;
        isNullable = fieldSchema.isNullable();
        fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();

      } else {
        throw new IllegalArgumentException(
          String.format("Array syntax for nested field '%s' in path '%s' was specified, but '%s' is of type %s.",
                        fieldName, path, fieldName, fieldType));
      }
    }

    if (fields.hasNext()) {
      if (fieldType != Schema.Type.RECORD) {
        throw new IllegalArgumentException(
          String.format("Nested field '%s' in path '%s' must be of type '%s', but is '%s'.",
                        fieldName, path, Schema.Type.RECORD, fieldType));
      }

      return select(isNullable ? fieldSchema.getNonNullable() : fieldSchema, path, fields);
    }
    return fieldSchema;
  }

  public static StructuredRecord drop(StructuredRecord record, String path) {
    return drop(record, path, path);
  }

  public static StructuredRecord drop(StructuredRecord record, String path, String ... paths) {
    // No-op. This is just to mirror the drop method for Schema
    return record;
  }

    /**
     * Select a sub-stucture of a {@link StructuredRecord}.
     *
     * @param record to be operated on
     * @param path to applied to the {@link StructuredRecord}
     * @param <T> type of object returned.
     * @return sub-structure of the {@link StructuredRecord}
     */
  public static <T> T select(StructuredRecord record, String path) {
    return recursiveGet(record, path, Splitter.on('.').split(path).iterator());
  }

  private static <T> T recursiveGet(StructuredRecord record, String path, Iterator<String> fields) {
    String fieldName = fields.next();

    int bracketIndex = fieldName.indexOf('[');
    String key = null;
    if (bracketIndex > 0) {
      if (!fieldName.endsWith("]")) {
        throw new IllegalArgumentException(
          String.format("Invalid field '%s'. An index start '[' must end with a ']'", fieldName));
      }
      key = fieldName.substring(bracketIndex + 1, fieldName.length() - 1);
      fieldName = fieldName.substring(0, bracketIndex);
    }

    Schema.Field field = record.getSchema().getField(fieldName);

    if (field == null) {
      throw new IllegalArgumentException(
        String.format("Nested field '%s' in path '%s' does not exist", fieldName, path));
    }

    Schema fieldSchema = field.getSchema();
    boolean isNullable = fieldSchema.isNullable();
    Schema.Type fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();

    Object val = record.get(fieldName);

    if (key != null) {
      if (fieldType == Schema.Type.ARRAY) {
        try {
          int arrayIndex = Integer.parseInt(key);
          if (arrayIndex < 0) {
            throw new IllegalArgumentException(
              String.format("Invalid array index '%d' for field '%s' in path '%s. Must be at least 0.",
                            arrayIndex, fieldName, path));
          }

          fieldSchema = isNullable ?
            fieldSchema.getNonNullable().getComponentSchema() : fieldSchema.getComponentSchema();
          isNullable = fieldSchema.isNullable();
          fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();

          try {
            if (val instanceof Collection) {
              val = Iterables.get((Collection) val, arrayIndex);
            } else {
              val = Array.get(val, arrayIndex);
            }
          } catch (IndexOutOfBoundsException e) {
            throw new IllegalArgumentException(
              String.format("Index '%d' for nested field '%s' in path '%s' is out of bounds.",
                            arrayIndex, fieldName, path));
          }
        } catch (NumberFormatException e) {
          throw new IllegalArgumentException(
            String.format("Invalid array index '%s' for field '%s' in path '%s'. Must be a valid int.",
                          key, fieldName, path));
        }
      } else if (fieldType == Schema.Type.MAP) {

        Map.Entry<Schema, Schema> mapSchema = fieldSchema.getMapSchema();
        Schema keySchema = mapSchema.getKey();
        Schema valSchema = mapSchema.getValue();

        Schema.Type keyType = keySchema.isNullable() ? keySchema.getNonNullable().getType() : keySchema.getType();
        if (keyType != Schema.Type.STRING) {
          throw new IllegalArgumentException(
            String.format("Only map keys of type string are supported. Field '%s' in path '%s' has keys of type '%s'.",
                          fieldName, path, keyType));
        }

        fieldSchema = valSchema;
        isNullable = fieldSchema.isNullable();
        fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType();

        Map map = (Map) val;
        val = map.get(key);

      } else {
        throw new IllegalArgumentException(
          String.format("Array syntax for nested field '%s' in path '%s' was specified, but '%s' is of type %s.",
                        fieldName, path, fieldName, fieldType));
      }
    }

    if (fields.hasNext()) {
      if (fieldType != Schema.Type.RECORD) {
        throw new IllegalArgumentException(
          String.format("Nested field '%s' in path '%s' must be of type '%s', but is '%s'.",
                        fieldName, path, Schema.Type.RECORD, fieldType));
      }

      return recursiveGet((StructuredRecord) val, path, fields);
    }
    return (T) val;
  }

}


text:
#ifndef crypto_auth_hmacsha512_H
#define crypto_auth_hmacsha512_H

#include <stddef.h>
#include "crypto_hash_sha512.h"
#include "export.h"

#ifdef __cplusplus
# ifdef __GNUC__
#  pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif

#define crypto_auth_hmacsha512_BYTES 64U
SODIUM_EXPORT
size_t crypto_auth_hmacsha512_bytes(void);

#define crypto_auth_hmacsha512_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_auth_hmacsha512_keybytes(void);

SODIUM_EXPORT
int crypto_auth_hmacsha512(unsigned char *out,
                           const unsigned char *in,
                           unsigned long long inlen,
                           const unsigned char *k) __attribute__ ((nonnull(1, 4)));

SODIUM_EXPORT
int crypto_auth_hmacsha512_verify(const unsigned char *h,
                                  const unsigned char *in,
                                  unsigned long long inlen,
                                  const unsigned char *k)
            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));

/* ------------------------------------------------------------------------- */

typedef struct crypto_auth_hmacsha512_state {
    crypto_hash_sha512_state ictx;
    crypto_hash_sha512_state octx;
} crypto_auth_hmacsha512_state;

SODIUM_EXPORT
size_t crypto_auth_hmacsha512_statebytes(void);

SODIUM_EXPORT
int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
                                const unsigned char *key,
                                size_t keylen) __attribute__ ((nonnull));

SODIUM_EXPORT
int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
                                  const unsigned char *in,
                                  unsigned long long inlen) __attribute__ ((nonnull(1)));

SODIUM_EXPORT
int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
                                 unsigned char *out) __attribute__ ((nonnull));

SODIUM_EXPORT
void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES])
            __attribute__ ((nonnull));

#ifdef __cplusplus
}
#endif

#endif


text:
package com.kevinwhinnery.converter;

import org.appcelerator.titanium.TitaniumActivityGroup;

public class CurrencyconverterActivity extends TitaniumActivityGroup
{
}


text:
'use strict';

const HttpException = require('./http-exception');
const HttpStatus    = require('http-status-codes');

/**
 * The TooManyRequestsException class.
 *
 * This is a concrete class of the the HttpException class.
 * It represents a too many requests http response.
 *
 * @author tommelo
 */
class TooManyRequestsException extends HttpException {

    /**
     * The class constructor
     *
     * @param {Object} entity The object to be serialized as response body
     * @param {Error}  cause  The error cause
     */
    constructor(entity, cause) {
        cause = cause || new Error('TooManyRequestsException');
        super(entity, HttpStatus.TOO_MANY_REQUESTS, cause);
    }

}

module.exports = TooManyRequestsException;


text:
package kizitorashiro.mp3meta.id3v22;

import java.util.HashMap;

import kizitorashiro.mp3meta.ID3v2Exception;
import kizitorashiro.mp3meta.ID3v2InvalidFormatException;

public class TYE extends TXX{
	public TYE(){
		super();
	}

	@Override
	public byte[] create(HashMap<String, String> args) throws ID3v2Exception{
		String value = args.get("value");
		if(isValidValue(value)){
			return super.create(args);
		}else{
			throw new ID3v2InvalidFormatException("TYE MUST be from 1000 to 9999");
		}
	}

	private boolean isValidValue(String value){
		if(value.length() != 4){
			return false;
		}

		int year;
		try{
			year = Integer.parseInt(value);
			if(1000 <= year && year <= 9999){
				return true;
			}else{
				return false;
			}
		}catch(Exception e){
			return false;
		}
	}
}


text:
package com.googlecode.mp4parser;

import com.coremedia.iso.boxes.Container;
import com.googlecode.mp4parser.authoring.Movie;
import com.googlecode.mp4parser.authoring.Track;
import com.googlecode.mp4parser.authoring.builder.FragmentedMp4Builder;
import com.googlecode.mp4parser.authoring.builder.TwoSecondIntersectionFinder;
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;
import com.googlecode.mp4parser.authoring.tracks.Amf0Track;
import org.apache.commons.codec.binary.Base64;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.util.HashMap;
import java.util.Properties;

/**
 * Shows a simple use of the AMF0Track
 */
public class MuxVideoWithAmf0 {
    public static void main(String[] args) throws IOException {
        String videoFile = MuxVideoWithAmf0.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/example-sans-amf0.mp4";

        Movie video = MovieCreator.build(videoFile);

        Properties props = new Properties();
        props.load(MuxVideoWithAmf0.class.getResourceAsStream("/amf0track.properties"));
        HashMap<Long, byte[]> samples = new HashMap<Long, byte[]>();
        for (String key : props.stringPropertyNames()) {
            samples.put(Long.parseLong(key), Base64.decodeBase64(props.getProperty(key)));
        }
        Track amf0Track = new Amf0Track(samples);
        amf0Track.getTrackMetaData();
        video.addTrack(amf0Track);

        FragmentedMp4Builder fragmentedMp4Builder = new FragmentedMp4Builder();
        fragmentedMp4Builder.setIntersectionFinder(new TwoSecondIntersectionFinder(video, 2));

        Container out = fragmentedMp4Builder.build(video);
        FileOutputStream fos = new FileOutputStream(new File(String.format("output.mp4")));

        FileChannel fc = fos.getChannel();
        out.writeContainer(fc);

        fos.close();

    }
}