text:
namespace KFS
{
namespace client
{
using std::string;
using std::istringstream;

Path::Path(
    const char* inPathPtr,
    size_t      inLength)
    : mComponents(),
      mNormComponents(),
      mDirFlag(false),
      mNormalizedFlag(false)
{
    if (inLength > 0) {
        Path::Set(inPathPtr, inLength);
    }
}

bool
Path::Set(
    const char* inPathPtr,
    size_t      inLength)
{
    mComponents.clear();
    mNormComponents.clear();
    mComponents.reserve(16);
    mNormComponents.reserve(16);

    const Token       kRootDir("/",    1);
    const Token       kThisDir(".",    1);
    const Token       kParentDir("..", 2);
    const char* const theEndPtr = inPathPtr + inLength;
    mNormalizedFlag = true;
    for (const char* theStartPtr = inPathPtr;
            theStartPtr < theEndPtr;
            ++theStartPtr) {
        const char* const theSlashPtr =
            (const char*)memchr(theStartPtr, '/', theEndPtr - theStartPtr);
        if (theSlashPtr == inPathPtr) {
            const Token theRoot(theSlashPtr, 1);
            mComponents.push_back(theRoot);
            mNormComponents.push_back(theRoot);
            mNormalizedFlag = false;
            continue;
        }
        if (theSlashPtr == theStartPtr) {
            mNormalizedFlag = false;
            continue;
        }
        const char* const thePtr = theSlashPtr ? theSlashPtr : theEndPtr;
        const Token theName(theStartPtr, thePtr - theStartPtr);
        theStartPtr = thePtr;
        if (theName == kParentDir) {
            const size_t theSize = mNormComponents.size();
            if (theSize <= 0) {
                mComponents.clear();
                break; // invalid path
            }
            if (theSize > 1 || mNormComponents[0] != kRootDir) {
                mNormComponents.pop_back();
                if (theSize == 1) {
                    mComponents.clear();
                    break; // invalid relative path
                }
            }
            mComponents.push_back(theName);
            mNormalizedFlag = false;
        } else if (theName != kThisDir) {
            mComponents.push_back(theName);
            mNormComponents.push_back(theName);
        }
    }
    if (mComponents.empty()) {
        mDirFlag        = false;
        mNormalizedFlag = false;
        return false;
    }
    mDirFlag = inLength > 0 && theEndPtr[-1] == '/';
    return true;
}

string
Path::ToString(const Path::Components& inComponents) const
{
    string result;
    for (iterator theIt = inComponents.begin();
            theIt != inComponents.end();
            theIt++) {
        if (theIt > inComponents.begin() + 1 ||
                (theIt == inComponents.begin() + 1 &&
                (inComponents[0].mLen != 1 || inComponents[0].mPtr[0] != '/'))) {
            result += "/";
        }
        result.append(theIt->mPtr, theIt->mLen);
    }
    return result;
}

}}

redpajama_set_name: RedPajamaGithub


text:
'use strict'

var os = require('os')
var ipHeaders = [ // Priority
  'forwarded', // 1
  'x-real-ip', // 2
  'x-forwarded-for', // 3
  'fastly-client-ip', // 4
  'cf-connecting-ip', // 4
  'x-cluster-client-ip', // 5
  'z-forwarded-for', // 5
  'wl-proxy-client-ip', // 5
  'proxy-client-ip' // 5
]

module.exports = {
  /**
   * get server address from network interface
   */
  getServerAddress: function (testOverride) {
    var ret = '127.0.0.1'
    os = testOverride || os
    var interfaces = os.networkInterfaces()

    Object.keys(interfaces).forEach(function (el) {
      interfaces[el].forEach(function (el2) {
        if (!el2.internal && el2.family === 'IPv4') {
          ret = el2.address
        }
      })
    })

    return ret
  },

  getClientAddress: function (req) {
    var address
    ipHeaders.reverse().forEach(function (header) {
      address = req.headers[header] || address
    })
    if (!address) {
      if (req.connection && req.connection.remoteAddress) {
        address = req.connection.remoteAddress
      } else if (req.connection && req.connection.socket && req.connection.socket.remoteAddress) {
        address = req.connection.socket.remoteAddress
      } else if (req.socket && req.socket.remoteAddress) {
        address = req.socket.remoteAddress
      } else {
        address = ''
      }
    }
    if (address && typeof address === 'string' && address.indexOf(',') > -1) {
      address = address.split(',')[0]
    }
    return address
  },

  /**
   * convert header string to assoc array
   */
  parseResponseHeaderString: function (string) {
    if (!string || string === '' || string.indexOf('\r\n') === -1) {
      return {
        version: 'HTTP/1.1',
        statusText: ''
      }
    }

    var lines = string.split('\r\n')
    var status = lines.shift()

    // Remove empty strings
    lines = lines.filter(Boolean)

    // Parse status line
    var output = this.parseStartLine(status)

    // init headers object & array
    output.headersObj = {}
    output.headersArr = []

    // Parse headers
    var header
    for (var i = lines.length; i--;) {
      header = this.parseHeaderLine(lines[i])

      output.headersArr.push(header)
      output.headersObj[header.name] = header.value
    }

    return output
  },

  /**
   * parse status line into an object
   */
  parseStartLine: function (line) {
    var pieces = line.split(' ')

    // Header string pieces
    var output = {
      version: pieces.shift(),
      status: parseFloat(pieces.shift()),
      statusText: pieces.join(' ')
    }

    return output
  },

  /**
   *
   */
  parseHeaderLine: function (line) {
    var pieces = line.split(': ')
    var name = pieces.shift()
    var value = pieces.join(': ')

    return {
      name: name,
      value: value
    }
  },

  /**
   * Transform objects into an array of key value pairs.
   */
  objectToArray: function (obj) {
    // sanity check
    if (!obj || typeof obj !== 'object') {
      return []
    }

    var results = []

    Object.keys(obj).forEach(function (name) {
      // nested values in query string
      if (typeof obj[name] === 'object') {
        obj[name].forEach(function (value) {
          results.push({
            name: name,
            value: value
          })
        })
        return
      }

      results.push({
        name: name,
        value: obj[name]
      })
    })

    return results
  },

  /**
   * uses regex to match a header value
   */
  getHeaderValue: function (headers, key, def) {
    if (headers instanceof Array) {
      var regex = new RegExp(key, 'i')
      for (var i = 0; i < headers.length; i++) {
        if (regex.test(headers[i].name)) {
          return headers[i].value
        }
      }
    }

    return def !== undefined ? def : false
  },

  /**
   * quickly calculates the header size in bytes for a given array of headers
   */
  getReqHeaderSize: function (req) {
    var keys = Object.keys(req.headers)

    var values = keys.map(function (key) {
      return req.headers[key]
    })

    var headers = req.method + req.url + keys.join() + values.join()

    // startline: [method] [url] HTTP/1.1\r\n = 12
    // endline: \r\n = 2
    // every header + \r\n = * 2
    // add 2 for each combined header
    return new Buffer(headers).length + (keys.length * 2) + 2 + 12 + 2
  },
  /*
   * get unique elements of an array
   */
  uniq: function (arr) {
    var hash = {}
    var result = []
    for (var i = 0, l = arr.length; i < l; ++i) {
      if (!hash.hasOwnProperty(arr[i])) {
        hash[arr[i]] = true
        result.push(arr[i])
      }
    }
    return result
  }
}


text:
import proxyquire from 'proxyquire';
import {describe, it} from 'mocha';
import {withFixtures} from 'inline-fixtures';
import * as assert from 'assert';
import * as path from 'path';
import * as checker from '../src/checker';
import {PackageJson} from '../src/package-json-file';

const {LicenseChecker} = proxyquire<typeof checker>('../src/checker', {
  // fake packge-json
  'package-json': (
    pkg: string,
    opts?: {version?: string}
  ): Promise<PackageJson> => {
    if (!opts || !opts.version) {
      throw new Error('package options or version does not exist');
    }
    requestedPackages.push(`${pkg}@${opts.version}`);
    switch (pkg) {
      case 'foo':
        return Promise.resolve({
          name: 'foo',
          version: '1.2.3',
          license: 'ISC', // green license
          dependencies: {
            bar: '^4.5.0',
          },
        });
      case 'bar':
        return Promise.resolve({
          name: 'bar',
          version: '4.5.6',
          license: 'EVIL', // non-green license
        });
      case 'baz':
        return Promise.resolve({
          name: 'baz',
          version: '7.8.9',
          license: 'ALSO-EVIL', // non-green license
        });
      default:
        throw new Error(`Unexpected package: ${pkg}`);
    }
  },
});

let requestedPackages: string[] = [];

describe(__filename, () => {
  it('correct packages are requested and non-green-license is emitted', async () => {
    requestedPackages = [];
    const nonGreenPackages: string[] = [];
    const checker = new LicenseChecker();
    checker.on('non-green-license', arg => {
      nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
    });
    await checker.checkRemotePackage('foo');
    assert.deepStrictEqual(requestedPackages, ['foo@latest', 'bar@^4.5.0']);
    assert.deepStrictEqual(nonGreenPackages, ['bar@4.5.6']);
  });

  it('local directory is checked correctly', () => {
    const packageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        foo: '^1.2.3',
      },
    });
    return withFixtures(
      {
        'path/to/dir': {
          'package.json': packageJson,
          'another-file': 'hello, world',
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory('path/to/dir');
        assert.deepStrictEqual(requestedPackages, ['foo@^1.2.3', 'bar@^4.5.0']);
        assert.deepStrictEqual(nonGreenPackages, ['bar@4.5.6']);
      }
    );
  });

  it('local directory should have correct licenses too', () => {
    const packageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'EVIL',
      dependencies: {
        foo: '^1.2.3',
      },
    });
    return withFixtures(
      {
        'path/to/dir': {
          'package.json': packageJson,
          'another-file': 'hello, world',
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory('path/to/dir');
        assert.deepStrictEqual(requestedPackages, ['foo@^1.2.3', 'bar@^4.5.0']);
        assert.deepStrictEqual(nonGreenPackages, ['hello@1.0.0', 'bar@4.5.6']);
      }
    );
  });

  it('local monorepo directory is checked correctly', () => {
    const topLevelPackageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        foo: '^1.2.3',
      },
    });
    const subPackageJson = JSON.stringify({
      name: 'hello-sub',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        baz: '^7.0.0',
      },
    });
    const pathToDir = path.join('path', 'to', 'dir');
    return withFixtures(
      {
        [pathToDir]: {
          'package.json': topLevelPackageJson,
          'another-file': 'hello, world',
          packages: {
            'sub-package': {
              'package.json': subPackageJson,
            },
          },
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const packageJsonPaths: string[] = [];
        const checker = new LicenseChecker();
        checker
          .on('non-green-license', arg => {
            nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
          })
          .on('package.json', filePath => {
            packageJsonPaths.push(filePath);
          });
        await checker.checkLocalDirectory(pathToDir);
        assert.deepStrictEqual(requestedPackages, [
          'foo@^1.2.3',
          'bar@^4.5.0',
          'baz@^7.0.0',
        ]);
        assert.deepStrictEqual(nonGreenPackages, ['bar@4.5.6', 'baz@7.8.9']);
        assert.deepStrictEqual(packageJsonPaths, [
          path.join(pathToDir, 'package.json'),
          path.join(pathToDir, 'packages', 'sub-package', 'package.json'),
        ]);
      }
    );
  });

  it('local monorepo with local dependency is checked correctly', () => {
    const topLevelPackageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        'hello-sub': '^1.0.0',
      },
    });
    const subPackageJson = JSON.stringify({
      name: 'hello-sub',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        baz: '^7.0.0',
      },
    });
    const pathToDir = path.join('path', 'to', 'dir');
    return withFixtures(
      {
        [pathToDir]: {
          'package.json': topLevelPackageJson,
          'another-file': 'hello, world',
          packages: {
            'sub-package': {
              'package.json': subPackageJson,
            },
          },
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const packageJsonPaths: string[] = [];
        const checker = new LicenseChecker();
        checker
          .on('non-green-license', arg => {
            nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
          })
          .on('package.json', filePath => {
            packageJsonPaths.push(filePath);
          });
        await checker.checkLocalDirectory(pathToDir);
        console.log(JSON.stringify(requestedPackages, null, 2));
        assert.deepStrictEqual(requestedPackages, ['baz@^7.0.0']);
        assert.deepStrictEqual(nonGreenPackages, ['baz@7.8.9']);
        assert.deepStrictEqual(packageJsonPaths, [
          path.join(pathToDir, 'package.json'),
          path.join(pathToDir, 'packages', 'sub-package', 'package.json'),
        ]);
      }
    );
  });

  it('package allowlist should be respected (local repo)', () => {
    const packageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        foo: '^1.2.3',
      },
    });
    const configJson = JSON.stringify({
      packageAllowlist: ['bar'],
    });
    const pathToDir = path.join('path', 'to', 'dir');
    return withFixtures(
      {
        [pathToDir]: {
          'package.json': packageJson,
          'js-green-licenses.json': configJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory(pathToDir);
        assert.strictEqual(nonGreenPackages.length, 0);
      }
    );
  });

  it('custom green license list (local repo)', () => {
    const packageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Foo License',
      dependencies: {
        foo: '^1.2.3',
      },
    });
    const configJson = JSON.stringify({
      greenLicenses: ['Foo License', 'EVIL'],
    });
    return withFixtures(
      {
        'path/to/dir': {
          'package.json': packageJson,
          'js-green-licenses.json': configJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory('path/to/dir');
        assert.deepStrictEqual(requestedPackages, ['foo@^1.2.3', 'bar@^4.5.0']);
        assert.deepStrictEqual(nonGreenPackages, ['foo@1.2.3']); // ISC is not green now.
      }
    );
  });

  it('errors properly output to console', async () => {
    // temporarily mock out global console.log so we can see what gets
    // written there.
    const realConsoleLog = console.log;
    let consoleOutput = '';
    console.log = output => {
      if (output !== undefined) {
        consoleOutput += output;
      }
      consoleOutput += '\n';
    };
    requestedPackages = [];
    const checker = new LicenseChecker();
    checker.setDefaultHandlers({setExitCode: false});
    await checker.checkRemotePackage('foo');
    console.log = realConsoleLog;
    assert.ok(/EVIL: bar@4\.5\.6/.test(consoleOutput));
    assert.ok(/1 non-green licenses found\./.test(consoleOutput));
  });

  it('accept private package (local repo)', () => {
    const packageJson = JSON.stringify({
      private: true,
      dependencies: {},
    });
    const configJson = JSON.stringify({
      greenLicenses: ['private'],
    });
    return withFixtures(
      {
        'path/to/dir': {
          'package.json': packageJson,
          'js-green-licenses.json': configJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory('path/to/dir');
        assert.deepStrictEqual(requestedPackages, []);
        assert.deepStrictEqual(nonGreenPackages, []);
      }
    );
  });

  it('decline private package (local repo)', () => {
    const packageJson = JSON.stringify({
      private: true,
      dependencies: {},
    });
    const configJson = JSON.stringify({
      greenLicenses: ['ISC'],
    });
    return withFixtures(
      {
        'path/to/dir': {
          'package.json': packageJson,
          'js-green-licenses.json': configJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const checker = new LicenseChecker();
        checker.on('non-green-license', arg => {
          nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
        });
        await checker.checkLocalDirectory('path/to/dir');
        assert.deepStrictEqual(requestedPackages, []);
        assert.deepStrictEqual(nonGreenPackages, ['undefined@undefined']);
      }
    );
  });

  it('support local paths', () => {
    const primaryPackageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        foo: '^1.2.3',
        linked: 'file:../linked',
      },
    });
    const linkedPackageJson = JSON.stringify({
      name: 'linked',
      version: '1.0.0',
      license: 'Apache-2.0',
      dependencies: {
        baz: '^7.0.0',
      },
    });
    const pathToPrimary = path.join('path', 'to', 'primary');
    const pathToLinked = path.join('path', 'to', 'linked');
    return withFixtures(
      {
        [pathToPrimary]: {
          'package.json': primaryPackageJson,
          'another-file': 'meh, world.',
        },
        [pathToLinked]: {
          'package.json': linkedPackageJson,
          'another-file': 'i depend on a package with an evil license',
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const packageJsonPaths: string[] = [];
        const checker = new LicenseChecker();
        checker
          .on('non-green-license', arg => {
            nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
          })
          .on('package.json', filePath => {
            packageJsonPaths.push(filePath);
          });
        await checker.checkLocalDirectory(pathToPrimary);
        console.log('requested packages: ', requestedPackages);
        assert.deepStrictEqual(requestedPackages, [
          'foo@^1.2.3',
          'bar@^4.5.0',
          'baz@^7.0.0',
        ]);
        assert.deepStrictEqual(nonGreenPackages, ['bar@4.5.6', 'baz@7.8.9']);
        assert.deepStrictEqual(packageJsonPaths, [
          path.join(pathToPrimary, 'package.json'),
          path.join(pathToLinked, 'package.json'),
        ]);
      }
    );
  });

  it('treats UNLICENSED as non-green', () => {
    const primaryPackageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      license: 'UNLICENSED',
    });

    const pathToPrimary = path.join('path', 'to', 'primary');
    return withFixtures(
      {
        [pathToPrimary]: {
          'package.json': primaryPackageJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const packageJsonPaths: string[] = [];
        const checker = new LicenseChecker();
        checker
          .on('non-green-license', arg => {
            nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
          })
          .on('package.json', filePath => {
            packageJsonPaths.push(filePath);
          });
        await checker.checkLocalDirectory(pathToPrimary);
        console.log('requested packages: ', requestedPackages);
        assert.deepStrictEqual(requestedPackages, []);
        assert.deepStrictEqual(nonGreenPackages, ['hello@1.0.0']);
        assert.deepStrictEqual(packageJsonPaths, [
          path.join(pathToPrimary, 'package.json'),
        ]);
      }
    );
  });

  it('skips package.json checks if package is allow listed', () => {
    const primaryPackageJson = JSON.stringify({
      name: 'hello',
      version: '1.0.0',
      licenses: ['invalid', 'values'],
    });

    const configJson = JSON.stringify({
      packageAllowlist: ['hello'],
    });
    const pathToPrimary = path.join('path', 'to', 'primary');
    return withFixtures(
      {
        [pathToPrimary]: {
          'package.json': primaryPackageJson,
          'js-green-licenses.json': configJson,
        },
      },
      async () => {
        requestedPackages = [];
        const nonGreenPackages: string[] = [];
        const packageJsonPaths: string[] = [];
        const checker = new LicenseChecker();
        checker
          .on('non-green-license', arg => {
            nonGreenPackages.push(`${arg.packageName}@${arg.version}`);
          })
          .on('package.json', filePath => {
            packageJsonPaths.push(filePath);
          });
        await checker.checkLocalDirectory(pathToPrimary);
        console.log('requested packages: ', requestedPackages);
        assert.deepStrictEqual(requestedPackages, []);
        assert.deepStrictEqual(nonGreenPackages, []);
        assert.deepStrictEqual(packageJsonPaths, [
          path.join(pathToPrimary, 'package.json'),
        ]);
      }
    );
  });
});


text:
module.exports = {
    testDir: 'test/test_sandbox',
    testFiles: [
        'nordea_semicolon.csv', 'nordea_wrongheadings.csv', 'nordea_onlyheaders.csv', 'empty.csv',
        'strangedates.csv', 'nordea_pipe.csv'
     ]
};


text:
package org.apache.fineract.portfolio.shareaccounts.service;

import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountAssembler;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountDomainService;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccountDividendDetails;
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccountDividendRepository;
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccountDividendStatusType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ShareAccountSchedularServiceImpl implements ShareAccountSchedularService {

    private final ShareAccountDividendRepository shareAccountDividendRepository;
    private final SavingsAccountDomainService savingsAccountDomainService;
    private final SavingsAccountAssembler savingsAccountAssembler;

    @Autowired
    public ShareAccountSchedularServiceImpl(final ShareAccountDividendRepository shareAccountDividendRepository,
            final SavingsAccountDomainService savingsAccountDomainService, final SavingsAccountAssembler savingsAccountAssembler) {
        this.shareAccountDividendRepository = shareAccountDividendRepository;
        this.savingsAccountDomainService = savingsAccountDomainService;
        this.savingsAccountAssembler = savingsAccountAssembler;
    }

    @Override
    @Transactional
    public void postDividend(final Long dividendDetailId, final Long savingsId) {

        ShareAccountDividendDetails shareAccountDividendDetails = this.shareAccountDividendRepository.findOne(dividendDetailId);
        final SavingsAccount savingsAccount = this.savingsAccountAssembler.assembleFrom(savingsId);
        SavingsAccountTransaction savingsAccountTransaction = this.savingsAccountDomainService.handleDividendPayout(savingsAccount,
                DateUtils.getLocalDateOfTenant(), shareAccountDividendDetails.getAmount());
        shareAccountDividendDetails.update(ShareAccountDividendStatusType.POSTED.getValue(), savingsAccountTransaction.getId());
        this.shareAccountDividendRepository.save(shareAccountDividendDetails);
    }

}


text:
import {AST, Binary, BindingPipe, Chain, Conditional, FunctionCall, ImplicitReceiver, Interpolation, KeyedRead, KeyedWrite, LiteralArray, LiteralMap, LiteralPrimitive, MethodCall, ParseSpan, PrefixNot, PropertyRead, PropertyWrite, Quote, RecursiveAstVisitor, SafeKeyedRead, SafeMethodCall, SafePropertyRead, Unary} from '../../../src/expression_parser/ast';

import {unparse} from './unparser';

class ASTValidator extends RecursiveAstVisitor {
  private parentSpan: ParseSpan|undefined;

  visit(ast: AST) {
    this.parentSpan = undefined;
    ast.visit(this);
  }

  validate(ast: AST, cb: () => void): void {
    if (!inSpan(ast.span, this.parentSpan)) {
      if (this.parentSpan) {
        const parentSpan = this.parentSpan as ParseSpan;
        throw Error(`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${
            parentSpan.start},  ${parentSpan.end}) for ${unparse(ast)}`);
      } else {
        throw Error(`Invalid root AST span for ${unparse(ast)}`);
      }
    }
    const oldParent = this.parentSpan;
    this.parentSpan = ast.span;
    cb();
    this.parentSpan = oldParent;
  }

  visitUnary(ast: Unary, context: any): any {
    this.validate(ast, () => super.visitUnary(ast, context));
  }

  visitBinary(ast: Binary, context: any): any {
    this.validate(ast, () => super.visitBinary(ast, context));
  }

  visitChain(ast: Chain, context: any): any {
    this.validate(ast, () => super.visitChain(ast, context));
  }

  visitConditional(ast: Conditional, context: any): any {
    this.validate(ast, () => super.visitConditional(ast, context));
  }

  visitFunctionCall(ast: FunctionCall, context: any): any {
    this.validate(ast, () => super.visitFunctionCall(ast, context));
  }

  visitImplicitReceiver(ast: ImplicitReceiver, context: any): any {
    this.validate(ast, () => super.visitImplicitReceiver(ast, context));
  }

  visitInterpolation(ast: Interpolation, context: any): any {
    this.validate(ast, () => super.visitInterpolation(ast, context));
  }

  visitKeyedRead(ast: KeyedRead, context: any): any {
    this.validate(ast, () => super.visitKeyedRead(ast, context));
  }

  visitKeyedWrite(ast: KeyedWrite, context: any): any {
    this.validate(ast, () => super.visitKeyedWrite(ast, context));
  }

  visitLiteralArray(ast: LiteralArray, context: any): any {
    this.validate(ast, () => super.visitLiteralArray(ast, context));
  }

  visitLiteralMap(ast: LiteralMap, context: any): any {
    this.validate(ast, () => super.visitLiteralMap(ast, context));
  }

  visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any {
    this.validate(ast, () => super.visitLiteralPrimitive(ast, context));
  }

  visitMethodCall(ast: MethodCall, context: any): any {
    this.validate(ast, () => super.visitMethodCall(ast, context));
  }

  visitPipe(ast: BindingPipe, context: any): any {
    this.validate(ast, () => super.visitPipe(ast, context));
  }

  visitPrefixNot(ast: PrefixNot, context: any): any {
    this.validate(ast, () => super.visitPrefixNot(ast, context));
  }

  visitPropertyRead(ast: PropertyRead, context: any): any {
    this.validate(ast, () => super.visitPropertyRead(ast, context));
  }

  visitPropertyWrite(ast: PropertyWrite, context: any): any {
    this.validate(ast, () => super.visitPropertyWrite(ast, context));
  }

  visitQuote(ast: Quote, context: any): any {
    this.validate(ast, () => super.visitQuote(ast, context));
  }

  visitSafeMethodCall(ast: SafeMethodCall, context: any): any {
    this.validate(ast, () => super.visitSafeMethodCall(ast, context));
  }

  visitSafePropertyRead(ast: SafePropertyRead, context: any): any {
    this.validate(ast, () => super.visitSafePropertyRead(ast, context));
  }

  visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any {
    this.validate(ast, () => super.visitSafeKeyedRead(ast, context));
  }
}

function inSpan(span: ParseSpan, parentSpan: ParseSpan|undefined): parentSpan is ParseSpan {
  return !parentSpan || (span.start >= parentSpan.start && span.end <= parentSpan.end);
}

const sharedValidator = new ASTValidator();

export function validate<T extends AST>(ast: T): T {
  sharedValidator.visit(ast);
  return ast;
}


text:
#import <Foundation/Foundation.h>

@interface GMBLDebugger :  NSObject

/// Enables beacon sighting logs. These logs gives more information about beacon sightings your application
/// is currently seeing.
+ (void)enableBeaconSightingsLogging;

/// Disables beacon sighting logs.
+ (void)disableBeaconSightingsLogging;

/// Gets current state of logging beacon sightings.
+ (BOOL)isBeaconSightingsEnabled;

@end


text:
class CreateEvents < ActiveRecord::Migration[5.1]
  def change
    create_table :events do |t|
      t.references :plan, foreign_key: true
      t.string :title
      t.string :color
      t.datetime :starts_at
      t.datetime :ends_at

      t.timestamps
    end

    add_index :events, :starts_at
  end
end


text:
/* ==========================================================================
   Store class
   ========================================================================== */

/**
 * wrapper for Store.js
 * @param prefix {String} prefix for keys, allows creating different store instances
 * @return {Store}
 */
var Store = function(prefix) {
  if (!(this instanceof Store)) {
    return new Store(prefix);
  }

  this.prefix = prefix;
  this.data = {};

  // if local storage set,
  // find all data in store, check if has this Store's prefix
  // if so, load it into memory
  if (store.enabled) {
    var queue = store.getAll();
    for (var key in queue) {
      if (key.substr(0, this.prefix.length) === this.prefix) {
        this.data[key] = queue[key];
      }
    }
  }

  return this;
};

/**
 * retrieves a value from the store
 * @param key {String} identifier in store
 * @return {*}
 */
Store.prototype.get = function(key) {
  return this.data[this.prefix + key];
};

/**
 * puts a value into the store
 * @param key {String} identifier for the store
 * @param value {*} value to put into the store
 * @returns {Store}
 */
Store.prototype.set = function(key, value) {
  this.data[this.prefix + key] = value;
  if (store.enabled) {
    store.set(this.prefix + key, value);
  }

  return this;
};

/**
 * removes an item from the store
 * @param key {String} identifier of item to remove
 * @return {Store}
 */
Store.prototype.remove = function(key) {
  delete this.data[this.prefix + key];
  store.remove(this.prefix + key);
  return this;
};

/**
 * gets all the items in the store
 * @return {Object}
 */
Store.prototype.getAll = function() {
  var
    alias = this,
    queue = {};

  for (var key in alias.data) {
    queue[key] = alias.data[key];
  }

  return queue;
};

/**
 * removes all items from the store
 * @return {Store}
 */
Store.prototype.clear = function() {
  var alias = this;

  if (store.enabled) {
    for (var key in alias.data) {
      if (key.substr(0, alias.prefix.length) === alias.prefix) {
        store.remove(key);
      }
    }
  }

  this.data = {};
  return this;
};


text:
trait T { private val z = new C1 }
private class C1


text:
var moment = require('../../moment');

exports.listers = {
    setUp : function (cb) {
        moment.locale('en');
        moment.createFromInputFallback = function () {
            throw new Error('input not handled by moment');
        };

        cb();
    },

    tearDown : function (cb) {
        moment.locale('en');
        cb();
    },

    'default' : function (test) {
        test.expect(5);
        test.deepEqual(moment.months(), ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
        test.deepEqual(moment.monthsShort(), ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);
        test.deepEqual(moment.weekdays(), ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']);
        test.deepEqual(moment.weekdaysShort(), ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']);
        test.deepEqual(moment.weekdaysMin(), ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']);
        test.done();
    },

    'index' : function (test) {
        test.equal(moment.months(0), 'January');
        test.equal(moment.months(2), 'March');
        test.equal(moment.monthsShort(0), 'Jan');
        test.equal(moment.monthsShort(2), 'Mar');
        test.equal(moment.weekdays(0), 'Sunday');
        test.equal(moment.weekdays(2), 'Tuesday');
        test.equal(moment.weekdaysShort(0), 'Sun');
        test.equal(moment.weekdaysShort(2), 'Tue');
        test.equal(moment.weekdaysMin(0), 'Su');
        test.equal(moment.weekdaysMin(2), 'Tu');
        test.done();
    },

    'localized' : function (test) {
        var months = 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_'),
            monthsShort = 'on_tw_th_fo_fi_si_se_ei_ni_te_el_tw'.split('_'),
            weekdays = 'one_two_three_four_five_six_seven'.split('_'),
            weekdaysShort = 'on_tw_th_fo_fi_si_se'.split('_'),
            weekdaysMin = '1_2_3_4_5_6_7'.split('_');

        moment.locale('numerologists', {
            months : months,
            monthsShort : monthsShort,
            weekdays : weekdays,
            weekdaysShort: weekdaysShort,
            weekdaysMin: weekdaysMin
        });

        test.deepEqual(moment.months(), months);
        test.deepEqual(moment.monthsShort(), monthsShort);
        test.deepEqual(moment.weekdays(), weekdays);
        test.deepEqual(moment.weekdaysShort(), weekdaysShort);
        test.deepEqual(moment.weekdaysMin(), weekdaysMin);

        test.equal(moment.months(0), 'one');
        test.equal(moment.monthsShort(0), 'on');
        test.equal(moment.weekdays(0), 'one');
        test.equal(moment.weekdaysShort(0), 'on');
        test.equal(moment.weekdaysMin(0), '1');

        test.equal(moment.months(2), 'three');
        test.equal(moment.monthsShort(2), 'th');
        test.equal(moment.weekdays(2), 'three');
        test.equal(moment.weekdaysShort(2), 'th');
        test.equal(moment.weekdaysMin(2), '3');

        test.done();
    },

    'with functions' : function (test) {
        var monthsShort = 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_'),
            monthsShortWeird = 'onesy_twosy_threesy_foursy_fivesy_sixsy_sevensy_eightsy_ninesy_tensy_elevensy_twelvesy'.split('_');

        moment.locale('difficult', {

            monthsShort: function (m, format) {
                var arr = format.match(/-MMM-/) ? monthsShortWeird : monthsShort;
                return arr[m.month()];
            }
        });

        test.expect(6);
        test.deepEqual(moment.monthsShort(), monthsShort);
        test.deepEqual(moment.monthsShort('MMM'), monthsShort);
        test.deepEqual(moment.monthsShort('-MMM-'), monthsShortWeird);

        test.deepEqual(moment.monthsShort('MMM', 2), 'three');
        test.deepEqual(moment.monthsShort('-MMM-', 2), 'threesy');
        test.deepEqual(moment.monthsShort(2), 'three');

        test.done();
    }
};


text:
<?php

require_once "MageTool/Tool/MageApp/Provider/Core/Config.php";
require_once 'MageTool/Lint.php';

class LintTest extends PHPUnit_Framework_TestCase
{

    /**
     * Internal container for the lint object
     *
     * @var MageTool_Lint
     **/
    protected $_lint;

    public function setUp()
    {
        parent::setUp();
        // Initialise Magento
        Mage::app();
        $this->_lint = new MageTool_Lint;
    }

    /**
     * _getConfigShouldReturnConfig
     * @author Alistair Stead
     * @test
     */
    public function _getConfigShouldReturnConfig()
    {
        $_getConfigMethod = self::getMethod('_getBaseConfig');
        $result = $_getConfigMethod->invoke($this->_lint);

        $this->assertInstanceOf('Varien_Simplexml_Config', $result);
    } // _getConfigShouldReturnConfig

    /**
     * getLintsShouldReturnArrayClassAndPath
     * @author Alistair Stead
     * @test
     */
    public function getLintsShouldReturnArrayClassAndPath()
    {
        $lints = array(
          'MageTool_Lint_Xml' => 'MageTool/Lint/Xml.php',
          'MageTool_Lint_Config' => 'MageTool/Lint/Config.php',
          'MageTool_Lint_System' => 'MageTool/Lint/System.php',
          'MageTool_Lint_Adminhtml' => 'MageTool/Lint/Adminhtml.php',
          'MageTool_Lint_Api' => 'MageTool/Lint/Api.php'
        );
        $lintObjects = array();
        foreach ($lints as $lintClass => $includePath) {
            include_once $includePath;
            $lintTest = new $lintClass;
            $lintObjects[] = $lintTest;
        }
        $this->_lint->addLints($lintObjects);
        $result = $this->_lint->getLints();

        $this->assertTrue(is_array($result), 'No lints array has been returned');
        $this->assertEquals(5, count($result), 'An unexpected number of lints has been found');

        foreach ($lints as $class => $path) {
            $this->assertFileExists($path, 'Path not found on the include path');
        }
    } // getLintsShouldReturnArrayClassAndPath

    /**
     * getXmlConfigPathsShouldReturnSingleItemWhenFilePathIsSet
     * @author Alistair Stead
     * @test
     */
    public function getXmlConfigPathsShouldReturnSingleItemWhenFilePathIsSet()
    {
        $testFilePath = dirname(__FILE__) . DS . 'Lint' . DS . 'valid' . DS . 'config.xml';
        $lint = new MageTool_Lint($testFilePath);
        $this->assertTrue( is_array($lint->getXmlConfigPaths()), 'Array not returned' );
        $this->assertEquals(1, count($lint->getXmlConfigPaths()), 'Number of array items is not what was expected');
    } // getXmlConfigPathsShouldReturnSingleItemWhenFilePathIsSet

    /**
     * runShouldCallEachLintClassRunMethod
     * @author Alistair Stead
     * @test
     */
    public function runShouldCallEachLintClassRunMethod()
    {
        // Create a stub for the SomeClass class.
        $stub = $this->getMock('Zend_Tool_Framework_Response');
        // Configure the stub.
        $stub->expects($this->any())
             ->method('appendContent')
             ->will($this->returnArgument(0));

        $this->_lint->run($stub);
    } // runShouldCallEachLintClassRunMethod

    /**
     * Provide access to protected methods by using reflection
     *
     * @param string $name
     * @return void
     * @author Alistair Stead
     */
    protected static function getMethod($name)
    {
        $class = new ReflectionClass('MageTool_Lint');
        $method = $class->getMethod($name);
        $method->setAccessible(true);

        return $method;
    }
}


text:
import numpy as np
import torch
import torch.nn as nn

from transformers import CLIPConfig, CLIPVisionModel, PreTrainedModel

from ...utils import logging

logger = logging.get_logger(__name__)

def cosine_distance(image_embeds, text_embeds):
    normalized_image_embeds = nn.functional.normalize(image_embeds)
    normalized_text_embeds = nn.functional.normalize(text_embeds)
    return torch.mm(normalized_image_embeds, normalized_text_embeds.t())

class StableDiffusionSafetyChecker(PreTrainedModel):
    config_class = CLIPConfig

    _no_split_modules = ["CLIPEncoderLayer"]

    def __init__(self, config: CLIPConfig):
        super().__init__(config)

        self.vision_model = CLIPVisionModel(config.vision_config)
        self.visual_projection = nn.Linear(config.vision_config.hidden_size, config.projection_dim, bias=False)

        self.concept_embeds = nn.Parameter(torch.ones(17, config.projection_dim), requires_grad=False)
        self.special_care_embeds = nn.Parameter(torch.ones(3, config.projection_dim), requires_grad=False)

        self.concept_embeds_weights = nn.Parameter(torch.ones(17), requires_grad=False)
        self.special_care_embeds_weights = nn.Parameter(torch.ones(3), requires_grad=False)

    @torch.no_grad()
    def forward(self, clip_input, images):
        pooled_output = self.vision_model(clip_input)[1]  # pooled_output
        image_embeds = self.visual_projection(pooled_output)

        # we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
        special_cos_dist = cosine_distance(image_embeds, self.special_care_embeds).cpu().float().numpy()
        cos_dist = cosine_distance(image_embeds, self.concept_embeds).cpu().float().numpy()

        result = []
        batch_size = image_embeds.shape[0]
        for i in range(batch_size):
            result_img = {"special_scores": {}, "special_care": [], "concept_scores": {}, "bad_concepts": []}

            # increase this value to create a stronger `nfsw` filter
            # at the cost of increasing the possibility of filtering benign images
            adjustment = 0.0

            for concept_idx in range(len(special_cos_dist[0])):
                concept_cos = special_cos_dist[i][concept_idx]
                concept_threshold = self.special_care_embeds_weights[concept_idx].item()
                result_img["special_scores"][concept_idx] = round(concept_cos - concept_threshold + adjustment, 3)
                if result_img["special_scores"][concept_idx] > 0:
                    result_img["special_care"].append({concept_idx, result_img["special_scores"][concept_idx]})
                    adjustment = 0.01

            for concept_idx in range(len(cos_dist[0])):
                concept_cos = cos_dist[i][concept_idx]
                concept_threshold = self.concept_embeds_weights[concept_idx].item()
                result_img["concept_scores"][concept_idx] = round(concept_cos - concept_threshold + adjustment, 3)
                if result_img["concept_scores"][concept_idx] > 0:
                    result_img["bad_concepts"].append(concept_idx)

            result.append(result_img)

        has_nsfw_concepts = [len(res["bad_concepts"]) > 0 for res in result]

        for idx, has_nsfw_concept in enumerate(has_nsfw_concepts):
            if has_nsfw_concept:
                images[idx] = np.zeros(images[idx].shape)  # black image

        if any(has_nsfw_concepts):
            logger.warning(
                "Potential NSFW content was detected in one or more images. A black image will be returned instead."
                " Try again with a different prompt and/or seed."
            )

        return images, has_nsfw_concepts

    @torch.no_grad()
    def forward_onnx(self, clip_input: torch.FloatTensor, images: torch.FloatTensor):
        pooled_output = self.vision_model(clip_input)[1]  # pooled_output
        image_embeds = self.visual_projection(pooled_output)

        special_cos_dist = cosine_distance(image_embeds, self.special_care_embeds)
        cos_dist = cosine_distance(image_embeds, self.concept_embeds)

        # increase this value to create a stronger `nsfw` filter
        # at the cost of increasing the possibility of filtering benign images
        adjustment = 0.0

        special_scores = special_cos_dist - self.special_care_embeds_weights + adjustment
        # special_scores = special_scores.round(decimals=3)
        special_care = torch.any(special_scores > 0, dim=1)
        special_adjustment = special_care * 0.01
        special_adjustment = special_adjustment.unsqueeze(1).expand(-1, cos_dist.shape[1])

        concept_scores = (cos_dist - self.concept_embeds_weights) + special_adjustment
        # concept_scores = concept_scores.round(decimals=3)
        has_nsfw_concepts = torch.any(concept_scores > 0, dim=1)

        images[has_nsfw_concepts] = 0.0  # black image

        return images, has_nsfw_concepts


text:
using droid.Runtime.Structs.Space;
using UnityEngine;

namespace droid.Runtime.Interfaces {
  /// <summary>
  /// </summary>
  public interface IHasTripleArray {
    /// <summary>
    /// </summary>
    Vector3[] ObservationArray { get; }

    Space1[] ObservationSpace { get; }
  }
}


text:
layout: post
date: 2017-09-03
title: "Maggie Sottero Divina 2014 Spring Sleeveless Chapel Train Mermaid/Trumpet Wedding Dresses In Color"
category: Maggie Sottero
tags: [Maggie Sottero,Mermaid/Trumpet,Wedding Dresses In Color,Sweetheart,Chapel Train,Sleeveless,2014,Spring]
---
### Maggie Sottero Divina
Just **$359.79**
### 2014 Spring Sleeveless Chapel Train Mermaid/Trumpet Wedding Dresses In Color

BRANDS	Maggie Sottero

Silhouette	Mermaid/Trumpet

Trend	Wedding Dresses In Color

Neckline	Sweetheart

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Years	2014

Season	Spring

Buy it: [https://www.readybrides.com/en/maggie-sottero/106-divina.html](https://www.readybrides.com/en/maggie-sottero/106-divina.html)


text:
package org.axonframework.integrationtests.modelling.saga.repository.jdbc;

import org.axonframework.modelling.saga.repository.jdbc.Oracle11SagaSqlSchema;
import org.axonframework.modelling.saga.repository.jdbc.SagaSchema;
import org.junit.jupiter.api.*;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

import static org.axonframework.common.jdbc.JdbcUtils.closeQuietly;

/**
 * Integration test class validating the {@link Oracle11SagaSqlSchema}.
 *
 * @author Joris van der Kallen
 */
@SuppressWarnings({"SqlDialectInspection", "SqlNoDataSourceInspection"})
@Testcontainers
class Oracle11SagaSqlSchemaTest {

    private static final String USERNAME = "test";
    private static final String PASSWORD = "test";

    @Container
    private static final OracleContainer ORACLE_CONTAINER = new OracleContainer("gvenzl/oracle-xe");

    private Oracle11SagaSqlSchema testSubject;
    private Connection connection;
    private SagaSchema sagaSchema;

    @BeforeEach
    void setUp() throws SQLException {
        sagaSchema = new SagaSchema();
        testSubject = new Oracle11SagaSqlSchema(sagaSchema);
        Properties properties = new Properties();
        properties.setProperty("user", USERNAME);
        properties.setProperty("password", PASSWORD);
        //Disable oracle.jdbc.timezoneAsRegion as when on true GHA fails to run this test due to missing region-info
        properties.setProperty("oracle.jdbc.timezoneAsRegion", "false");
        connection = DriverManager.getConnection(ORACLE_CONTAINER.getJdbcUrl(), properties);
    }

    @AfterEach
    void tearDown() {
        closeQuietly(connection);
    }

    @Test
    void sql_createTableAssocValueEntry() throws Exception {
        // test passes if no exception is thrown
        testSubject.sql_createTableAssocValueEntry(connection)
                   .execute();
        connection.prepareStatement("SELECT * FROM " + sagaSchema.associationValueEntryTable())
                  .execute();

        connection.prepareStatement("DROP TABLE " + sagaSchema.associationValueEntryTable())
                  .execute();
        connection.prepareStatement("DROP SEQUENCE " + sagaSchema.associationValueEntryTable() + "_seq")
                  .execute();
    }

    @Test
    void sql_createTableSagaEntry() throws Exception {
        // test passes if no exception is thrown
        testSubject.sql_createTableSagaEntry(connection)
                   .execute();
        connection.prepareStatement("SELECT * FROM " + sagaSchema.sagaEntryTable())
                  .execute();

        connection.prepareStatement("DROP TABLE " + sagaSchema.sagaEntryTable())
                  .execute();
    }
}


text:
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->
<configConfMos
  cookie="%cookie%"
  inHierarchical="false">
  <inConfigs>
    <pair key="%dn%">
      <orgTenant
        dn="%dn%"
        name="%name%"
        status="deleted,modified"/>
    </pair>
  </inConfigs>
</configConfMos>


text:
/*
 * This header is only installed for use by the debugger:
 * the structures and the API declared here are not supported.
 */

#ifndef __MONO_DEBUG_MONO_SYMFILE_H__
#define __MONO_DEBUG_MONO_SYMFILE_H__

#include <mono/metadata/class.h>
#include <mono/metadata/reflection.h>
#include <mono/metadata/mono-debug.h>

typedef struct MonoSymbolFileOffsetTable	MonoSymbolFileOffsetTable;
typedef struct MonoSymbolFileLineNumberEntry	MonoSymbolFileLineNumberEntry;
typedef struct MonoSymbolFileMethodAddress	MonoSymbolFileMethodAddress;
typedef struct MonoSymbolFileDynamicTable	MonoSymbolFileDynamicTable;
typedef struct MonoSymbolFileSourceEntry	MonoSymbolFileSourceEntry;
typedef struct MonoSymbolFileMethodEntry	MonoSymbolFileMethodEntry;

/* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
struct MonoSymbolFileOffsetTable {
	uint32_t _total_file_size;
	uint32_t _data_section_offset;
	uint32_t _data_section_size;
	uint32_t _compile_unit_count;
	uint32_t _compile_unit_table_offset;
	uint32_t _compile_unit_table_size;
	uint32_t _source_count;
	uint32_t _source_table_offset;
	uint32_t _source_table_size;
	uint32_t _method_count;
	uint32_t _method_table_offset;
	uint32_t _method_table_size;
	uint32_t _type_count;
	uint32_t _anonymous_scope_count;
	uint32_t _anonymous_scope_table_offset;
	uint32_t _anonymous_scope_table_size;
	uint32_t _line_number_table_line_base;
	uint32_t _line_number_table_line_range;
	uint32_t _line_number_table_opcode_base;
	uint32_t _is_aspx_source;
};

struct MonoSymbolFileSourceEntry {
	uint32_t _index;
	uint32_t _data_offset;
};

struct MonoSymbolFileMethodEntry {
	uint32_t _token;
	uint32_t _data_offset;
	uint32_t _line_number_table;
};

struct MonoSymbolFileMethodAddress {
	uint32_t size;
	const uint8_t *start_address;
	const uint8_t *end_address;
	const uint8_t *method_start_address;
	const uint8_t *method_end_address;
	const uint8_t *wrapper_address;
	uint32_t has_this;
	uint32_t num_params;
	uint32_t variable_table_offset;
	uint32_t type_table_offset;
	uint32_t num_line_numbers;
	uint32_t line_number_offset;
	uint8_t data [MONO_ZERO_LEN_ARRAY];
};

struct _MonoDebugMethodInfo {
	MonoMethod *method;
	MonoDebugHandle *handle;
	uint32_t index;
	uint32_t data_offset;
	uint32_t lnt_offset;
};

typedef struct {
	int parent;
	int type;
	/* IL offsets */
	int start_offset, end_offset;
} MonoDebugCodeBlock;

typedef struct {
	char *name;
	int index;
	/* Might be null for the main scope */
	MonoDebugCodeBlock *block;
} MonoDebugLocalVar;

/*
 * Information about local variables retrieved from a symbol file.
 */
struct _MonoDebugLocalsInfo {
	int num_locals;
	MonoDebugLocalVar *locals;
	int num_blocks;
	MonoDebugCodeBlock *code_blocks;
};

struct _MonoDebugLineNumberEntry {
	uint32_t il_offset;
	uint32_t native_offset;
};

#define MONO_SYMBOL_FILE_MAJOR_VERSION		50
#define MONO_SYMBOL_FILE_MINOR_VERSION		0
#define MONO_SYMBOL_FILE_MAGIC			0x45e82623fd7fa614ULL

MONO_BEGIN_DECLS

MonoSymbolFile *
mono_debug_open_mono_symbols       (MonoDebugHandle          *handle,
				    const uint8_t            *raw_contents,
				    int                       size,
				    mono_bool                 in_the_debugger);

void
mono_debug_close_mono_symbol_file  (MonoSymbolFile           *symfile);

mono_bool
mono_debug_symfile_is_loaded       (MonoSymbolFile           *symfile);

MonoDebugSourceLocation *
mono_debug_symfile_lookup_location (MonoDebugMethodInfo      *minfo,
				    uint32_t                  offset);

void
mono_debug_symfile_free_location   (MonoDebugSourceLocation  *location);

int32_t
_mono_debug_address_from_il_offset (MonoDebugMethodJitInfo   *jit,
				    uint32_t                  il_offset);

MonoDebugMethodInfo *
mono_debug_symfile_lookup_method   (MonoDebugHandle          *handle,
				    MonoMethod               *method);

MonoDebugLocalsInfo*
mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);

void
mono_debug_symfile_free_locals (MonoDebugLocalsInfo *info);

void
mono_debug_symfile_get_line_numbers (MonoDebugMethodInfo *minfo, char **source_file, int *n_il_offsets, int **il_offsets, int **line_numbers);

MONO_END_DECLS

#endif /* __MONO_SYMFILE_H__ */


text:
"""
Natural language analysis of tweets/posts
"""


text:
package com.evolveum.midpoint.testing.story.ldap.hierarchy;

import static org.testng.AssertJUnit.assertNotNull;

import java.io.File;

import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.CommonException;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

/**
 * Flat LDAP structure. All accounts in ou=people. The organizational structure is
 * reflected to (non-nested) LDAP groups. Users are members of the groups to reflect
 * the orgstruct.
 *
 * @author Radovan Semancik
 *
 */
@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"})
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestLdapFlat extends AbstractLdapHierarchyTest {

    public static final File TEST_DIR = new File(LDAP_HIERARCHY_TEST_DIR, "flat");

    @Override
    public void initSystem(Task initTask, OperationResult initResult) throws Exception {
        super.initSystem(initTask, initResult);
    }

    @Override
    protected File getTestDir() {
        return TEST_DIR;
    }

    @Override
    protected PrismObject<UserType> getAndAssertUser(String username, String directOrgGroupname, String... indirectGroupNames) throws SchemaException, CommonException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException {
        PrismObject<UserType> user = super.getAndAssertUser(username, directOrgGroupname, indirectGroupNames);
        Entry accountEntry = openDJController.searchSingle("uid="+username);

        Entry groupEntry = openDJController.searchSingle("cn="+directOrgGroupname);
        assertNotNull("No group LDAP entry for "+directOrgGroupname, groupEntry);
        openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());

        if (indirectGroupNames != null) {
            for (String expectedGroupName: indirectGroupNames) {
                groupEntry = openDJController.searchSingle("cn="+expectedGroupName);
                assertNotNull("No group LDAP entry for "+expectedGroupName, groupEntry);
                openDJController.assertUniqueMember(groupEntry, accountEntry.getDN().toString());
            }
        }

        return user;
    }

    @Override
    protected void recomputeIfNeeded(String changedOrgOid) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
        reconcileAllUsers();
    }

}


text:
from django.template import Context, Template, TemplateSyntaxError
from rest_framework import exceptions, serializers
from rest_framework.reverse import reverse

from rdmo.core.serializers import (MarkdownSerializerMixin, SiteSerializer,
                                   TranslationSerializerMixin)
from rdmo.core.utils import get_language_warning

from ..models import View
from ..validators import ViewLockedValidator, ViewUniqueURIValidator

class ViewSerializer(TranslationSerializerMixin, serializers.ModelSerializer):

    key = serializers.SlugField(required=True)

    def validate(self, data):
        # try to render the tamplate to see that the syntax is ok
        try:
            Template(data['template']).render(Context({}))
        except (KeyError, IndexError):
            pass
        except (TemplateSyntaxError, TypeError) as e:
            raise exceptions.ValidationError({'template': '\n'.join(e.args)})

        return super(ViewSerializer, self).validate(data)

    class Meta:
        model = View
        fields = (
            'id',
            'uri',
            'uri_prefix',
            'key',
            'comment',
            'locked',
            'available',
            'catalogs',
            'sites',
            'groups',
            'template'
        )
        trans_fields = (
            'title',
            'help'
        )
        validators = (
            ViewUniqueURIValidator(),
            ViewLockedValidator()
        )

class ViewIndexSerializer(MarkdownSerializerMixin, serializers.ModelSerializer):

    markdown_fields = ('help', )

    sites = SiteSerializer(many=True, read_only=True)
    warning = serializers.SerializerMethodField()
    xml_url = serializers.SerializerMethodField()

    class Meta:
        model = View
        fields = (
            'id',
            'uri',
            'uri_prefix',
            'key',
            'locked',
            'available',
            'sites',
            'title',
            'help',
            'warning',
            'xml_url'
        )

    def get_warning(self, obj):
        return get_language_warning(obj, 'title')

    def get_xml_url(self, obj):
        return reverse('v1-views:view-detail-export', args=[obj.pk])


text:
//
//  CBCentralManager+StateString.h
//  UHNBLEDemo
//
//  Created by Jay Moore on 2014-05-29.
//  Copyright (c) 2015 University Health Network.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <CoreBluetooth/CoreBluetooth.h>

/**
 `CBCentralManager+StateString` converts the state enum into a state string so memorization of the enum is not needed
 */
@interface CBCentralManager (StateString)

/**
 Converts the CBCentralManager state into a readable string

 @param state The state of the CBCentralManager

 @return Readable string indicating the CBCentralManager state
 */
- (NSString*) stringForState:(CBCentralManagerState)state;

@end


text:
package org.nmdp.hmlfhirconverter.controller;

import io.swagger.api.NotFoundException;
import io.swagger.api.ExtendedItemApi;
import org.nmdp.hmlfhirconvertermodels.dto.ExtendedItem;
import org.nmdp.hmlfhirconvertermodels.dto.TypeaheadQuery;

import org.apache.log4j.Logger;
import org.nmdp.hmlfhirconverter.service.ExtendedItemService;
import org.nmdp.hmlfhirconverter.util.Converters;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;

@RestController
@RequestMapping("/extendedItem")
@CrossOrigin
public class ExtendedItemController implements ExtendedItemApi {

    private final ExtendedItemService extendedItemService;
    private static final Logger LOG = Logger.getLogger(ExtendedItemController.class);

    @Autowired
    public ExtendedItemController(ExtendedItemService extendedItemService) {
        this.extendedItemService = extendedItemService;
    }

    @Override
    @RequestMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
    public Callable<ResponseEntity<List<ExtendedItem>>> createExtendedItems(@RequestBody List<ExtendedItem> extendeditems) throws NotFoundException {
        try {
            List<org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem> result = extendedItemService.createItems(extendeditems);
            List<ExtendedItem> transferResult = Converters.convertList(result, r -> r.toDto(r));
            return () -> new ResponseEntity<>(transferResult, HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /createMulti", ex);
            return () -> new ResponseEntity<>(new ArrayList<>(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.DELETE)
    public Callable<ResponseEntity<Boolean>> deleteExtendedItem(@RequestBody ExtendedItem extendedItem) throws NotFoundException {
        try {
            return () -> new ResponseEntity<>(extendedItemService.deleteItem(extendedItem), HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /delete", ex);
            return () -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.DELETE)
    public Callable<ResponseEntity<Boolean>> deleteExtendedItem(@PathVariable String id) throws NotFoundException {
        try {
            return () -> new ResponseEntity<>(extendedItemService.deleteItem(id), HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /delete/{id}", ex);
            return () -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
    public Callable<ResponseEntity<ExtendedItem>> getExtendedItem(@PathVariable String id) throws NotFoundException {
        try {
            org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem extendedItem = extendedItemService.getById(id);
            return () -> new ResponseEntity<>(extendedItem.toDto(extendedItem), HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /get/{id}", ex);
            return () -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(path = "/{maxResults}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
    public Callable<ResponseEntity<List<ExtendedItem>>> getTypeaheadExtendedItems(@PathVariable(value = "maxResults") Integer maxResults, @RequestBody TypeaheadQuery typeaheadQuery) throws NotFoundException {
        try {
            List<org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem> result = extendedItemService.getTypeaheadItems(maxResults, typeaheadQuery);
            List<ExtendedItem> transferResult = Converters.convertList(result, r -> r.toDto(r));
            return () -> new ResponseEntity<>(transferResult, HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /{maxResults}", ex);
            return () -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(path = "/{maxResults}/{pageNumber}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
    public Callable<ResponseEntity<List<ExtendedItem>>> getExtendedItems(@PathVariable Integer maxResults, @PathVariable Integer pageNumber) throws NotFoundException {
        try {
            List<org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem> result = extendedItemService.findByMaxReturn(maxResults, pageNumber).getContent();
            List<ExtendedItem> transferResult = Converters.convertList(result, r -> r.toDto(r));
            return () -> new ResponseEntity<>(transferResult, HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /getMulti/{maxResults}", ex);
            return () -> new ResponseEntity<>(new ArrayList<>(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
    public Callable<ResponseEntity<ExtendedItem>> getModel() {
        try {
            org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem extendedItem = new org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem(true);
            return () -> new ResponseEntity<>(extendedItem.toDto(extendedItem), HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error getting model.", ex);
            return () -> new ResponseEntity<>(new ExtendedItem(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }

    @Override
    @RequestMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.PUT)
    public Callable<ResponseEntity<ExtendedItem>> updateExtendedItem(@RequestBody ExtendedItem extendedItem) throws NotFoundException {
        try {
            org.nmdp.hmlfhirconvertermodels.domain.ExtendedItem nmdpModel = extendedItemService.updateItem(extendedItem);
            return () -> new ResponseEntity<>(nmdpModel.toDto(nmdpModel), HttpStatus.OK);
        } catch (Exception ex) {
            LOG.error("Error on /update", ex);
            return () -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
}


text:
(function ($) {

    $.fn.codekeeprPostNew = function() {

        var context = this;
        this.mode = '';

        this.init = function() {
            this.find('input#frigg_keeprbundle_post_topic').focus();

            this.find('.tags').codekeeprTags().buildForm();

            return this;
        };

        this.setMode = function(mode) {
            mode = mode || this.mode;
            this.mode = mode;

            return this;
        };

        this.data('context', this);

        return this;
    };

}(jQuery));


text:
<?php
    /**
     * Wein zu Kundenbestellung ORM Objekt Repository
     *
     * Erweiterung des Wein zu Kundenbestellung Objektes um individuelle Funktionen
     *
     * @author C. Depner
     */
namespace WineAdministrationBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * WinetoclientorderRepository
 */
class WinetoclientorderRepository extends EntityRepository
{

    /**
     * Suche nach Vor oder Nachnamen
     *
     * @param String $criteria
     *
     * @return Client
     */
    public function getOrderByName($criteria)
    {
        $qb = $this->createQueryBuilder('wtco');
        $query = $qb->select('wtco')
            ->leftJoin('wtco.clientOrder', 'co', 'co.id = wtco.client')
            ->leftJoin('co.client', 'c', 'c.id = co.client')
            ->leftJoin('wtco.wine', 'w', 'w.id = wtco.wine')
            ->where(
                $qb->expr()->orX(
                    $qb->expr()->orX(
                        $qb->expr()->like('c.forename', ':name'),
                        $qb->expr()->like('c.surname', ':name')
                    ),
                    $qb->expr()->like('w.name', ':name')
                )
            )
            ->andWhere($qb->expr()->eq('w.available', '1'))
            ->setParameter('name', $criteria);

        return $query->getQuery()->getResult();
    }

    /**
     * Suche nach ID
     *
     * @param String $criteria
     *
     * @return Client
     */
    public function getOrderByID($criteria)
    {
        $qb = $this->createQueryBuilder('wtco');
        $query = $qb->select('wtco')
            ->leftJoin('wtco.clientOrder', 'co', 'co.id = wtco.client')
            ->leftJoin('co.client', 'c', 'c.id = co.client')
            ->leftJoin('wtco.wine', 'w', 'w.id = wtco.wine')
            ->where(
                $qb->expr()->eq('wtco', ':id')
            )
            ->andWhere($qb->expr()->eq('w.available', '1'))
            ->setParameter('id', $criteria);

        return $query->getQuery()->getResult();
    }

    /**
     * Gibt alle Bestellungen zurück
     *
     * @return Client
     */
    public function getAll()
    {
        $qb = $this->createQueryBuilder('wtco');
        $query = $qb->select('wtco')
            ->leftJoin('wtco.clientOrder', 'co', 'co.id = wtco.client')
            ->leftJoin('co.client', 'c', 'c.id = co.client')
            ->leftJoin('wtco.wine', 'w', 'w.id = wtco.wine')
            ->where($qb->expr()->eq('w.available', '1'));

        return $query->getQuery()->getResult();
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <!-- changelog for the release branch -->
  <string name="changelog_release" translatable="false">\n
    <b>Next feature release:</b>\n
    · New: Archived or disabled caches stroken trough in titles\n
    · New: Offline routing in our maps (you need the \'BRouter\' app on your device)\n
    · New: Support ignoring caches on OpenCaching sites\n
    · New: Function to remove duplicate caches from all other lists\n
    · New: Undo ability for clear log menu item\n
    · New: Filter for found caches missing a voting\n
    · New: Korean translation\n
    · New: Cache history now also fetches all caches with saved offline log wich are not saved\n
    · New: Use cache type icon in header bar of logging screen\n
    · New: Export field notes also for opencaching websites\n
    · Fix: Better clipboard format when copying waypoint coordinates\n
    · Fix: Wrong icon when navigating to a waypoint\n
    · Fix: Detect wherigo cartridge links in short description\n
    · Fix: Don\'t store a signature only log when going back\n
    · Fix: Make URLs in hints clickable\n
    · Fix: Add to favorite was not available when logging webcam caches\n
    · Fix: Store from map no longer stores to default list\n
    · Fix: Correctly recognize OpenCaching.FR/.IT/.ES URLs\n
    · Fix: Connect with the new Opencache.uk\n
    · Change: Fetch more caches from OC sites when GC is disabled in settings\n
    · Removed: No longer supports captchas for getting exact coordinates as basic member\n
    \n
    \n
</string>
</resources>


text:
template <class T>
class Singleton : private NonCopyable
{
public:
	static T* instance()
	{
		if (pInstance != nullptr)
			return pInstance;
		else
		{
			pInstance = new T;
			return pInstance;
		}
	}

	static void release()
	{
		if (pInstance != nullptr)
		{
			delete pInstance;
			pInstance = nullptr;
		}
	}

private:
	static T *pInstance;
};

template <class T>
T * Singleton<T>::pInstance = nullptr;

#endif


text:
''' Interface and other definitions needed to create game modes for the drafting engine. '''

import os
from abc import ABCMeta as abstractclass, abstractmethod

# Definition of how many cards a set draft should have.
HS_NUM_CARDS_IN_SET = 3

# Private definitions; boilerplate for module definition.
thisdir = os.path.split(os.path.realpath(__file__))[0]
itlist = os.listdir(thisdir)
__all__ = [os.path.split(x)[-1].strip('\.py') for x in itlist if x.endswith('py') and not x.endswith('__init__.py')]

# Class definition for a game mode; interface.
class gameMode(object):
    __metaclass__ = abstractclass
    def __init__(self,coll,hero,info):
        self.name = ''
        self.collection = coll
        self.hero = hero
        self.info = info
    @abstractmethod
    def getDraft(self,numCards): return []


text:
	#if GCC_VERSION >= 40700
		#define __STD_EMPLACE_SUPPORT
	#endif
#endif

#endif


text:
using AlertRoster.Web.Commands;
using AlertRoster.Web.Models;
using FluentScheduler;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Converters;
using System;

namespace AlertRoster.Web
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables();
            Configuration = builder.Build();
            IsDevelopment = env.IsDevelopment();
        }

        public IConfigurationRoot Configuration { get; }

        public Boolean IsDevelopment { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<Database>();

            services.AddMvc(options =>
            {
                if (!IsDevelopment)
                {
                    options.Filters.Add(new RequireHttpsAttribute { });
                }
            })
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.Converters.Add(new StringEnumConverter { });
            });

            services.AddOptions();

            services.Configure<Settings>(Configuration);
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, Database db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();

            Database.Init(db);

            JobManager.Initialize(new JobRegistry(app.ApplicationServices));
        }
    }
}


text:
'use strict';

const common = require('../common');
if (!common.hasCrypto)
  common.skip('missing crypto');
const assert = require('assert');
const h2 = require('http2');

// Http2ServerResponse.flushHeaders

let serverResponse;

const server = h2.createServer();
server.listen(0, common.mustCall(function() {
  const port = server.address().port;
  server.once('request', common.mustCall(function(request, response) {
    assert.strictEqual(response.headersSent, false);
    assert.strictEqual(response._header, false); // Alias for headersSent
    response.flushHeaders();
    assert.strictEqual(response.headersSent, true);
    assert.strictEqual(response._header, true);
    response.flushHeaders(); // Idempotent

    assert.throws(() => {
      response.writeHead(400, { 'foo-bar': 'abc123' });
    }, {
      code: 'ERR_HTTP2_HEADERS_SENT'
    });

    response.on('finish', common.mustCall(function() {
      server.close();
      process.nextTick(() => {
        response.flushHeaders(); // Idempotent
      });
    }));
    serverResponse = response;
  }));

  const url = `http://localhost:${port}`;
  const client = h2.connect(url, common.mustCall(function() {
    const headers = {
      ':path': '/',
      ':method': 'GET',
      ':scheme': 'http',
      ':authority': `localhost:${port}`
    };
    const request = client.request(headers);
    request.on('response', common.mustCall(function(headers, flags) {
      assert.strictEqual(headers['foo-bar'], undefined);
      assert.strictEqual(headers[':status'], 200);
      serverResponse.end();
    }, 1));
    request.on('end', common.mustCall(function() {
      client.close();
    }));
    request.end();
    request.resume();
  }));
}));


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Tutorial: demo</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Tutorial: demo

demo

    <!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../dist/iDebugConsole.css" />

    This is a demonstration for iDebugConsole.

The overlay window is draggable from the side bar and resizeable from the edges.

The default view passes all events through to your site as to not interfere with navigation.

Now click the scroll icon (⇅) to activate scrolling.

Press the help icon (☤) for more a full description of all the controls.

    If your browsers console is not open, do so now.

    This demo shows you how to control the data displayed in both the built in console and the iDebugger overlay console.
    Compare the output of both windows as you review the code in the demo.html file.

Home

Classes

Debugger

DebuggerView

Profiler

Namespaces

iDebugConsole

iDebugDummy

Tutorials

demo

    Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 23:14:43 GMT-0400 (EDT)


text:
[Silex][1] Cookie Session Handler

[![Build Status](https://travis-ci.org/renegare/silexcsh.png?branch=master)](https://travis-ci.org/renegare/silexcsh)
[![Coverage Status](https://coveralls.io/repos/renegare/silexcsh/badge.png)](https://coveralls.io/r/renegare/silexcsh)

## Requirements

* PHP 5.4
* [composer][2] (preferably latest)

## Installation

```
$ composer require renegare/silexcsh:dev-master
```

## Usage Examples:

### Silex Usage
```
<?php

$app = new Silex\Application();

$app->register(new Renegare\SilexCSH\CookieSessionServiceProvider, [
    'session.cookie.options' => [
        'name' => 'CUSTOMNAME', // string
        'lifetime' => 0,        // int
        'path' => '/',          // string
        'domain' => null,       // string
        'secure' => false,      // boolean
        'httponly' => true      // boolean
    ]
]);

$app->get('/doing-nothing', function(Application $app) {
    return 'Nothing going on here with sessions';
});

$app->get('/persist', function(Application $app){
    $app['session']->set('message', 'Hello There!');
    return 'Check your cookie!';
});

$app->get('/read', function(Application $app){
    return print_r($app['session']->all(), true);
});

$app->get('/destroy', function(Application $app) {
    $app['session']->clear();
    return 'Ok Bye Bye!';
});

```

## Test

Check out the repo and from the top level directory run the
following command (xdebug required for coverage):

```
$ composer update && vendor/bin/phpunit --coverage-text
```

## Credits

Inspired by: [nelmio/NelmioSecurityBundle][3]

[1]: http://silex.sensiolabs.org/doc/usage.html
[2]: https://getcomposer.org/download/
[3]: https://github.com/nelmio/NelmioSecurityBundle#cookie-session-handler


text:
holiday = ask "Which holiday?"
familymember = ask "Name of family member?"
activity = ask "What activity?"
smallproblem = ask "Name of small problem"

puts "I just had a fun time over " + holiday + "."
puts "My " + familymember " and I were together."
puts "I also got to " + activity +"."
puts "I had " + smallproblem + " but it was OK."
puts "Pretty much I had a good " + holiday + "with my family."