text:
import uuid
import markdown2
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import UniqueConstraint, event
from flask_wiki.backend.custom_fields import GUIDField
from slugify import slugify

db = SQLAlchemy()

# TODO: Add Owner and other security fields later.
class Page(db.Model):
    """
    Implements the Page Model.
    """
    guid = db.Column(GUIDField, primary_key=True, default=uuid.uuid4)
    name = db.Column(db.String, nullable=False, unique=True)
    raw_content = db.Column(db.Text, nullable=False, unique=True)
    rendered_content = db.Column(db.Text)
    slug = db.Column(db.String, nullable=False, unique=True)

    UniqueConstraint('name', 'raw_content')

    def __repr__(self):
        return self.__str__()

    def __str__(self):
        return self.name

def make_slug(mapper, connection, target):
    target.slug = slugify(target.name)

def render_html(mapper, connection, target):
    target.rendered_content = markdown2.markdown(target.raw_content)

event.listen(Page, 'before_insert', make_slug)
event.listen(Page, 'before_insert', render_html)


text:
FOUNDATION_EXPORT double FSKitVersionNumber;
FOUNDATION_EXPORT const unsigned char FSKitVersionString[];

redpajama_set_name: RedPajamaGithub


text:
package org.apache.geode.internal;

import static org.junit.Assert.assertEquals;

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

import org.junit.Test;

public class LineWrapUnitJUnitTest {

  @Test
  public void test() {
    String test = "aaa aaaaa  aaa aaaa";

    assertEquals(list("aaa", "aaaaa", "aaa", "aaaa"), SystemAdmin.lineWrapOut(test, 3));
    assertEquals(list("aaa", "aaaaa", "aaa aaaa"), SystemAdmin.lineWrapOut(test, 8));

    assertEquals(list("aaa aaaaa", "aaa aaaa"), SystemAdmin.lineWrapOut(test, 9));
    assertEquals(list("aaa aaaaa  aaa", "aaaa"), SystemAdmin.lineWrapOut(test, 14));

    String test2 = "aaa\n aaaaa  aaa aaaa";
    assertEquals(list("aaa", " aaaaa  aaa", "aaaa"), SystemAdmin.lineWrapOut(test2, 14));
  }

  private List<String> list(String... strings) {
    return Arrays.asList(strings);
  }

}


text:
from ..py30compat import unittest
from ..test_backend import BackendBasicTests
from keyring.backends import SecretService
from .. import util

@unittest.skipUnless(SecretService.Keyring.viable,
    "SecretStorage package is needed for SecretServiceKeyring")
class SecretServiceKeyringTestCase(BackendBasicTests, unittest.TestCase):
    __test__ = True

    def init_keyring(self):
        print ("Testing SecretServiceKeyring; the following "
            "password prompts are for this keyring")
        return SecretService.Keyring()

class SecretServiceKeyringUnitTests(unittest.TestCase):
    def test_supported_no_secretstorage(self):
        """
        SecretService Keyring is not viable if secretstorage can't be imported.
        """
        with util.NoNoneDictMutator(SecretService.__dict__, secretstorage=None):
            self.assertFalse(SecretService.Keyring.viable)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

001/*
002 * To change this license header, choose License Headers in Project Properties.
003 * To change this template file, choose Tools | Templates
004 * and open the template in the editor.
005 */
006package edu.wpi.first.wpilibj.templates.commands;
007
008import edu.wpi.first.wpilibj.Timer;
009import edu.wpi.first.wpilibj.templates.RobotMap;
010
011/**
012 *
013 * @author Team 997
014 */
015public class unWinch extends CommandBase {
016
017    Timer myTimer = new Timer();
018
019    public unWinch() {
020        // Use requires() here to declare subsystem dependencies
021        // eg. requires(chassis);
022        requires(subShooter);
023    }
024
025    // Called just before this Command runs the first time
026    protected void initialize() {
027        myTimer.reset();
028        myTimer.start();
029    }
030
031    // Called repeatedly when this Command is scheduled to run
032    protected void execute() {
033        subShooter.extendWinch();
034
035    }
036
037    // Make this return true when this Command no longer needs to run execute()
038    protected boolean isFinished() {
039        if (myTimer.get() > RobotMap.WinchoutFailsafeTimer) {
040            System.out.println("Failsafe:  Stop Winch unwind on timer > 2.: " + myTimer.get());
041        return true;
042        } else{
043            return false;
044        }
045    }
046        // Called once after isFinished returns true
047    protected void end() {
048        subShooter.stopWinch();
049    }
050
051
052    // Called when another command which requires one or more of the same
053// subsystems is scheduled to run
054protected void interrupted() {
055       subShooter.stopWinch();
056    }
057}


text:
1. cd into the folder where the submodule should be
2. git submodule add https://github.com/bhr/BHRExtensions
3. Drag and Drop Xcodeproj into your workspace
4. Project Settings -> Link Framework
5. Project Build Settings -> Other Linker Flags -> Add '-ObjC'
6. Move Framework header file to project (don't copy)
7. Place '#import "BHRExtensions.h"' in the precompiled header of your project or where you need it!


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('climatemodels', '0099_auto_20190119_0603'),
    ]

    operations = [
        migrations.AddField(
            model_name='impactmodel',
            name='model_output_license',
            field=models.CharField(blank=True, max_length=500, null=True, verbose_name='Model Output License'),
        ),
        migrations.AlterField(
            model_name='baseimpactmodel',
            name='short_description',
            field=models.TextField(blank=True, default='', help_text='This information applies to all modeling rounds. Please do not erase this information, just add when necessary. This short description should assist other researchers in getting an understanding of your model, including the main differences between model versions used for different ISIMIP simulation rounds.', null=True, verbose_name='Short model description'),
        ),
    ]


text:
<?php

namespace Finix\Hal;

/**
 * The Extension Relation Type described in:
 * - section 8.2 of the HAL specification
 * - section 4 of the RFC5988 - Web Linking document
 *
 * @see https://tools.ietf.org/html/draft-kelly-json-hal-07#section-8.2
 * @see https://tools.ietf.org/html/rfc5988#section-4
 */
class CustomRel
{
    /**
     * @var string
     */
    private $name;

     /**
     * An Extension Relation Type SHOULD be a URI or a name
     * using the CURIE syntax (prefix:reference).
     * Any name as a string is accepted too.
     * @param $name        string        The relation name.
     */
     public function __construct($name) {
        $name = trim($name);
        if (!$name) {
            throw new \InvalidArgumentException("The name can't be empty");
        }

        $this->name = $name;
    }

    /**
     * @return        string        The relation name.
     */
    public function getName() {
        return $this->name;
    }

    /**
     * @return        string        The relation name.
     */
    public function __toString() {
        return $this->name;
    }
}