<commit_before>// BitFaucet is a simple example of a Maki-powered application.  
// It implements some basic Resources with external lookups, and overrides some
// of Maki's built-in behaviors.

// First, we'll retrieve the Maki class.  
// In a real application, this could simply be `require('maki')`.
var Maki = require('../../lib/Maki');
// Create an instance of Maki – named according to our app.  
// As shorthand, this could be `var bitfaucet = require('maki')();`
var bitfaucet = new Maki();

// Let's define a few requirements.  
// In our case, we need a Bitcoin client.
var bitcoin = require('bitcoin');

// Now, let's use sessions so we can provide messages to the user.
var Passport = require('maki-passport-local');
var passport = new Passport();

// Maki plugins are easy; in this case, we want to use it before any other
// things are defined.
maki.use( passport );

// ## Resource Definitions  
// Maki starts with definitions of "Resources" that your application exposes.
// Our first Resource is, well, a "Faucet".
var Faucet = bitfaucet.define('Faucet', {
  // ### Resource Attributes
  attributes: {
    // Attributes can have enforced types, validators, behaviors...  
    // Most of these should be self-descriptive.  For a full reference, check
    // [the documentation]().
    name:    { type: String , default: 'Default' , required: true , max: 80 },
    balance: { type: Number , default: 0 , required: true },
    host:    { type: String , default: 'localhost', required: true , max: 120 },
    port:    { type: Number , default: 8332, required: true },
    user:    { type: String , default: 'default', max: 40 },
    pass:    { type: String , default: '<PASSWORD>', max: 40 },
    timeout: { type: Number , default: 30000 }
  },
  // ### Resource Methods
  // Maki Resources can expose "methods".  These exist as functions on every
  // instance of such a resource.  
  // In the case of a "Faucet", each faucet needs a bitcoind instance.
  methods: {
    btcClient: function() {
      var faucet = this;
      return new bitcoin.Client( faucet );
    }
  }<commit_msg>Migrate to `maki-sessions` from login system.<commit_after>// BitFaucet is a simple example of a Maki-powered application.  
// It implements some basic Resources with external lookups, and overrides some
// of Maki's built-in behaviors.

// First, we'll retrieve the Maki class.  
// In a real application, this could simply be `require('maki')`.
var Maki = require('../../lib/Maki');
// Create an instance of Maki – named according to our app.  
// As shorthand, this could be `var bitfaucet = require('maki')();`
var bitfaucet = new Maki();

// Let's define a few requirements.  
// In our case, we need a Bitcoin client.
var bitcoin = require('bitcoin');

// Now, let's use sessions so we can provide messages to the user.
var Passport = require('maki-sessions');
var passport = new Passport();

// Maki plugins are easy; in this case, we want to use it before any other
// things are defined.
bitfaucet.use( passport );

// ## Resource Definitions  
// Maki starts with definitions of "Resources" that your application exposes.
// Our first Resource is, well, a "Faucet".
var Faucet = bitfaucet.define('Faucet', {
  // ### Resource Attributes
  attributes: {
    // Attributes can have enforced types, validators, behaviors...  
    // Most of these should be self-descriptive.  For a full reference, check
    // [the documentation]().
    name:    { type: String , default: 'Default' , required: true , max: 80 },
    balance: { type: Number , default: 0 , required: true },
    host:    { type: String , default: 'localhost', required: true , max: 120 },
    port:    { type: Number , default: 8332, required: true },
    user:    { type: String , default: 'default', max: 40 },
    pass:    { type: String , default: '<PASSWORD>', max: 40 },
    timeout: { type: Number , default: 30000 }
  },
  // ### Resource Methods
  // Maki Resources can expose "methods".  These exist as functions on every
  // instance of such a resource.  
  // In the case of a "Faucet", each faucet needs a bitcoind instance.
  methods: {
    btcClient: function() {
      var faucet = this;
      return new bitcoin.Client( faucet );
    }
  }
{'fraction_non_alphanumeric': 0.1255022453320728, 'fraction_numerical': 0.008981328291184117, 'mean_word_length': 3.065321805955812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5276741', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1232, 'n_words': 519}