text:
Name      | Type   | Default | Description
----------|--------|---------|-------------
style     | object |         | `style` attribute for the root element
className | string |         | `class` attribute for the root element
children  | node   |         | child elements
node      | string <br> `['a'|'button'|'input']`   | 'button'    | DOM element to render the button
flat      | any    | true    | a flat button
raised    | any    | false   | a raised button
icon      | any    | false   | an icon button
block     | any    | false   | set `width` to `100%` and `display` to `block`
ripple    | any    | true    | ripple effect
disabled  | any    | false   | disable this button
onClick   | func   |         | callback on mouse clicks

redpajama_set_name: RedPajamaGithub


text:
package de.intarsys.tools.functor;

import de.intarsys.tools.reflect.ObjectCreationException;

public class SimpleFunctorCallFactory implements IFunctorCallFactory {

	public IFunctorCall createFunctorCall(IFunctor functor, Object receiver,
			IArgs args) throws ObjectCreationException {
		return new FunctorCall(receiver, args);
	}

}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/aiplatform/v1beta1/dataset_service.proto

package com.google.cloud.aiplatform.v1beta1;

public interface ImportDataResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.ImportDataResponse)
    com.google.protobuf.MessageOrBuilder {}


text:
@implementation AmpacheSession

@synthesize username, password, auth;
@synthesize url;
@synthesize artists_num, albums_num, songs_num, auth_current_retry;

- (id)init {
	if (!(self = [super init] )){
		return nil;
	}
	[self initWthUsername:nil password:nil url:nil];
	return self;
}

- (id)initWthUsername:(NSString *)a_username password:(NSString *)a_password url:(NSURL *)a_url {
	if (!(self = [super init] )){
		return nil;
	}
	[self setUsername:a_username];
	[self setPassword:a_password];
	[self setUrl:a_url];

	[self setAuth:nil];
	[self setArtists_num:-1];
	[self setAlbums_num:-1];
	[self setSongs_num:-1];
	[self setAuth_current_retry:0];
	return self;
}

- (void)setCredentialsWithUsername:(NSString *)a_username password:(NSString *)a_password url:(NSURL *)a_url {
	[self setUsername:a_username];
	[self setPassword:a_password];
	[self setUrl:a_url];
}

-(BOOL)authenticate { // Authenticate to the Server
	[self startActivityIndicator];
	// API Version
	int api_version = 350001;
	// get the time stamp
	int timestamp = [[NSDate date] timeIntervalSince1970];
	// hash the passphrase
	NSString *key = [self SHA256:password];
	NSString *passphrase = [self SHA256:[NSString stringWithFormat:@"%d%@", timestamp, key]];
	NSLog(@"%@", passphrase);

	// Format the GET data
	NSString *data = [NSString
					  stringWithFormat:@"action=handshake&version=%d&user=%@&timestamp=%d&auth=%@",
					  api_version, username, timestamp, passphrase];
	// Create the new URL with the data
	NSURL *newURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@",url,data]];

	[self parseXMLFileAtURL:newURL];
	[self stopActivityIndicator];

	NSLog(@"XML AUTH = '%@'", xml_auth);

	if ([xml_auth length] == 0) { // failed
		NSLog(@"Error authenticating: %@", xml_error);
		return NO;
	}

	// everything OK up until now
	auth = [[self trimNewLines:xml_auth] retain];

	if (auth != nil) {
		return YES;
	} // else
	return NO;
}

- (NSMutableArray *)get_artists {
	if (!auth) { // not authenticated
		return NO;
	}

	[self startActivityIndicator];

	// Format the GET data
	NSString *data = [NSString stringWithFormat:@"action=artists&auth=%@", auth];
	NSURL *newURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@",url,data]];

	[self parseXMLFileAtURL:newURL];

	[self stopActivityIndicator];

	return items;

}

- (NSMutableArray *)get_albums_by_artist_id:(NSString *)artist_id {
	if (!auth) { // not authenticated
		return NO;
	}

	[self startActivityIndicator];

	// Format the GET data
	NSString *data = [NSString stringWithFormat:@"action=artist_albums&filter=%@&auth=%@", artist_id, auth];
	NSLog(@"data = %@",data);
	NSURL *newURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@",url,data]];
	NSLog(@"%@", newURL);
	[self parseXMLFileAtURL:newURL];

	[self stopActivityIndicator];

	return items;
}

- (NSMutableArray *)get_songs_by_album_id:(NSString *)album_id {
	if (!auth) { // not authenticated
		return NO;
	}

	[self startActivityIndicator];

	// Format the GET data
	NSString *data = [NSString stringWithFormat:@"action=album_songs&filter=%@&auth=%@", album_id, auth];
	NSLog(@"data = %@",data);
	NSURL *newURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@",url,data]];
	NSLog(@"%@", newURL);
	[self parseXMLFileAtURL:newURL];

	[self stopActivityIndicator];

	return items;
}

#pragma mark XML Parser

- (void)parseXMLFileAtURL:(NSURL *)URL {
	items = [[NSMutableArray alloc] init];
	currentItem = nil;
	currentElement = [[NSString alloc] init];

	xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:URL];

	// Set self as the delegate of the parser so that it will receive the parser delegate methods callbacks.
	[xmlParser setDelegate:self];

	// properties
	[xmlParser setShouldProcessNamespaces:NO];
	[xmlParser setShouldReportNamespacePrefixes:NO];
	[xmlParser setShouldResolveExternalEntities:NO];

	[xmlParser parse]; // blocking
}

- (void)parserDidStartDocument:(NSXMLParser *)parser {
	//NSLog(@"Starting the xml parser");
}

- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
	NSString *error = [NSString stringWithFormat:@"Error code %i", [parseError code]];
	NSLog(@"Error: %@", error);

	UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Cannot connect to Ampache!" message:error delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
	[errorAlert show];
}

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
	//NSLog(@"current element = %@, found element: %@", currentElement, elementName);
	currentElement = [elementName copy];
	if (!currentItem) {
		currentItem = [elementName copy];
	}
	//NSLog(@"Current Item is NOW SET TO %@", currentItem);

	if ([currentElement isEqualToString:@"root"]) { // starting the first parse
		[self clearAllXMLVariables];
		currentItem = nil;
	} else if ([currentItem isEqualToString:@"artist"]) { // parsing artists
	//	NSLog(@"currentItem is equal to string artist");
		if ([elementName isEqualToString:@"artist"]) { // starting a new artist
			[self clearAllXMLVariables];
	//		NSLog(@"Clearing All Variables");
			xml_id = [attributeDict objectForKey:@"id"];
		}
		//currentItem = [elementName copy];
	} else if ([currentItem isEqualToString:@"album"]) { // parsing albums
		if ([elementName isEqualToString:@"album"]) { // starting a new album
			[self clearAllXMLVariables];
			xml_id = [attributeDict objectForKey:@"id"];
		}
	} else if ([currentItem isEqualToString:@"song"]) { // parsing songs
		if ([elementName isEqualToString:@"song"]) { // starting a new song
			[self clearAllXMLVariables];
			xml_id = [attributeDict objectForKey:@"id"];
		}
	}
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{

	//NSLog(@"Ended element: %@", elementName);
	if (currentItem != nil) {
		//NSLog(@"current item is at this when element ended: %@", currentItem);
	}

	if ([currentItem isEqualToString:@"artist"]) {
		if ([elementName isEqualToString:@"artist"]) {
			//NSLog(@"---- Ended current item artist-----");
			//NSLog(@"xml_name = %@", xml_name);
			[item setObject:[self trimNewLines:xml_name]   forKey:@"name"];
			[item setObject:[self trimNewLines:xml_id]     forKey:@"id"];

			//NSLog(@"adding story: %@ - item = %@", xml_name, item);
			[items addObject:[item copy]];
		}
	} else if ([currentItem isEqualToString:@"album"]) {
		if ([elementName isEqualToString:@"album"]) {
			[item setObject:[self trimNewLines:xml_name]   forKey:@"name"];
			[item setObject:[self trimNewLines:xml_year]   forKey:@"year"];
			[item setObject:[self trimNewLines:xml_tracks] forKey:@"tracks"];
			[item setObject:[self trimNewLines:xml_art]    forKey:@"art"];
			[item setObject:[self trimNewLines:xml_id]     forKey:@"id"];

			[items addObject:[item copy]];
		}
	} else if ([currentItem isEqualToString:@"song"]) {
		if ([elementName isEqualToString:@"song"]) {
			[item setObject:[self trimNewLines:xml_title]  forKey:@"title"];
			[item setObject:[self trimNewLines:xml_time]   forKey:@"time"];
			[item setObject:[self trimNewLines:xml_size]   forKey:@"size"];
			[item setObject:[self trimNewLines:xml_id]     forKey:@"id"];
			[item setObject:[self trimNewLines:xml_url]    forKey:@"url"];
			[item setObject:[self trimNewLines:xml_album]  forKey:@"album"];
			[item setObject:[self trimNewLines:xml_artist] forKey:@"artist"];
			[item setObject:[self trimNewLines:xml_art]    forKey:@"art"];

			[items addObject:[item copy]];
		}
	}
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
	//NSLog(@"found characters: %@", string);
	// save the characters for the current item...
	if ([currentElement isEqualToString:@"name"]) {
		[xml_name appendString:string];
	} else if ([currentElement isEqualToString:@"year"]) {
		[xml_year appendString:string];
	} else if ([currentElement isEqualToString:@"error"]) {
			[xml_error appendString:string];
	} else if ([currentElement isEqualToString:@"auth"]) {
		[xml_auth appendString:string];
	} else if ([currentElement isEqualToString:@"songs"]) {
		[xml_songs_num appendString:string];
	} else if ([currentElement isEqualToString:@"albums"]) {
		[xml_albums_num appendString:string];
	} else if ([currentElement isEqualToString:@"artists"]) {
		[xml_artists_num appendString:string];
	} else if ([currentElement isEqualToString:@"title"]) {
		[xml_title appendString:string];
	} else if ([currentElement isEqualToString:@"tracks"]) {
		[xml_tracks appendString:string];
	} else if ([currentElement isEqualToString:@"art"]) {
		[xml_art appendString:string];
	} else if ([currentElement isEqualToString:@"size"]) {
		[xml_size appendString:string];
	} else if ([currentElement isEqualToString:@"url"]) {
		[xml_url appendString:string];
	} else if ([currentElement isEqualToString:@"time"]) {
		[xml_time appendString:string];
	} else if ([currentElement isEqualToString:@"artist"]) {
		[xml_artist appendString:string];
	} else if ([currentElement isEqualToString:@"album"]) {
		[xml_album appendString:string];
	}

}

- (void)parserDidEndDocument:(NSXMLParser *)parser {

	//[activityIndicator stopAnimating];
	//[activityIndicator removeFromSuperview];

//	NSLog(@"all done!");
//	NSLog(@"items array has %d items", [items count]);
}

- (void)clearAllXMLVariables {
	item = [[NSMutableDictionary alloc] init];
	xml_id = [[NSMutableString alloc] init];
	xml_auth = [[NSMutableString alloc] init];
	xml_songs_num = [[NSMutableString alloc] init];
	xml_artists_num = [[NSMutableString alloc] init];
	xml_albums_num = [[NSMutableString alloc] init];
	xml_name = [[NSMutableString alloc] init];
	xml_artist = [[NSMutableString alloc] init];
	xml_album = [[NSMutableString alloc] init];
	xml_year = [[NSMutableString alloc] init];
	xml_tracks = [[NSMutableString alloc] init];
	xml_art = [[NSMutableString alloc] init];
	xml_title = [[NSMutableString alloc] init];
	xml_time = [[NSMutableString alloc] init];
	xml_url = [[NSMutableString alloc] init];
	xml_size = [[NSMutableString alloc] init];
	xml_error = [[NSMutableString alloc] init];
}

#pragma mark Private Functions
// SHA256 function taken from
// http://www.iphonedevsdk.com/forum/iphone-sdk-development/60684-hashing-nsstring-encoded-utf-8-using-sha256-than-base64.html
- (NSString *)SHA256:(NSString *)value {
	const char *s = [value cStringUsingEncoding:NSUTF8StringEncoding]; // NSUTF16LittleEndianStringEncoding
	NSData *keyData = [NSData dataWithBytes:s length:strlen(s)];
	uint8_t digest[CC_SHA256_DIGEST_LENGTH] = {0};
	CC_SHA256(keyData.bytes, keyData.length, digest);
	NSData *out = [NSData dataWithBytes:digest length:CC_SHA256_DIGEST_LENGTH];
	NSString *hash = [out description];
	hash = [hash stringByReplacingOccurrencesOfString:@" " withString:@""];
	hash = [hash stringByReplacingOccurrencesOfString:@"<" withString:@""];
	hash = [hash stringByReplacingOccurrencesOfString:@">" withString:@""];
	return hash;
}

#pragma mark convenience
// Trim whitespace and newlines
- (NSString *)trimNewLines:(NSString *)value {
	return [[value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]
			stringByReplacingOccurrencesOfString:@"\n" withString:@""];
}

- (void)startActivityIndicator {
	 UIApplication* app = [UIApplication sharedApplication];
	 app.networkActivityIndicatorVisible = YES;
}

- (void)stopActivityIndicator {
	UIApplication* app = [UIApplication sharedApplication];
	app.networkActivityIndicatorVisible = NO;
}

#pragma mark Built In
-(NSString *) description {
	return [NSString stringWithFormat:@"Username = %@, Password = %@, URL = %@, auth = %@",
			username, password, url, auth];
}
@end


text:
import unittest, os, weakref, setup_path, utils

from svn import core, client, wc

try:
  # Python >=3.0
  from urllib.parse import urljoin
except ImportError:
  # Python <3.0
  from urlparse import urljoin

class SubversionClientTestCase(unittest.TestCase):
  """Test cases for the basic SWIG Subversion client layer"""

  def log_message_func(self, items, pool):
    """ Simple log message provider for unit tests. """
    self.log_message_func_calls += 1
    return "Test log message"

  def log_receiver(self, changed_paths, revision, author, date, message, pool):
    """ Function to receive log messages retrieved by client.log3(). """
    self.log_message = message
    self.change_author = author
    self.changed_paths = changed_paths

  def log_entry_receiver(self, log_entry, pool):
    """An implementation of svn_log_entry_receiver_t."""
    self.received_revisions.append(log_entry.revision)

  def setUp(self):
    """Set up authentication and client context"""
    self.client_ctx = client.svn_client_create_context()
    self.assertEquals(self.client_ctx.log_msg_baton2, None)
    self.assertEquals(self.client_ctx.log_msg_func2, None)
    self.assertEquals(self.client_ctx.log_msg_baton3, None)
    self.assertEquals(self.client_ctx.log_msg_func3, None)
    self.client_ctx.log_msg_func3 = client.svn_swig_py_get_commit_log_func
    self.client_ctx.log_msg_baton3 = self.log_message_func
    self.log_message_func_calls = 0
    self.log_message = None
    self.changed_paths = None
    self.change_author = None

    providers = [
       client.svn_client_get_simple_provider(),
       client.svn_client_get_username_provider(),
    ]

    self.client_ctx.auth_baton = core.svn_auth_open(providers)

    self.temper = utils.Temper()
    (_, self.repos_path, self.repos_uri) = self.temper.alloc_known_repo(
      'trac/versioncontrol/tests/svnrepos.dump', suffix='-client')

  def tearDown(self):
    # We have to free client_ctx first, since it may be holding handles
    # to WC DBs
    del self.client_ctx
    self.temper.cleanup()

  def testBatonPlay(self):
    """Test playing with C batons"""
    baton = lambda: 1
    weakref_baton = weakref.ref(baton)
    self.client_ctx.log_msg_baton2 = baton
    baton = None
    self.assertEquals(self.client_ctx.log_msg_baton2(), 1)
    self.assertEquals(weakref_baton()(), 1)
    self.client_ctx.log_msg_baton2 = None
    self.assertEquals(self.client_ctx.log_msg_baton2, None)
    self.assertEquals(weakref_baton(), None)

    # External objects should retain their current parent pool
    self.assertNotEquals(self.client_ctx._parent_pool,
                         self.client_ctx.auth_baton._parent_pool)

    # notify_func2 and notify_baton2 were generated by
    # svn_client_create_context, so they should have
    # the same pool as the context
    self.assertEquals(self.client_ctx._parent_pool,
                      self.client_ctx.notify_func2._parent_pool)
    self.assertEquals(self.client_ctx._parent_pool,
                      self.client_ctx.notify_baton2._parent_pool)

  def testMethodCalls(self):
    """Test direct method calls to callbacks"""

    # Directly invoking the msg_baton should work
    self.client_ctx.log_msg_baton3(None, None)
    b = self.client_ctx.log_msg_baton3
    b(None, None)
    self.assertEqual(self.log_message_func_calls, 2)

    # You can also invoke the log_msg_func3. It'd be
    # nice if we could get log_msg_func3 function
    # to invoke the baton function, but, in order to do that,
    # we'd need to supply a value for the first parameter.
    self.client_ctx.log_msg_func3(None, self.client_ctx.log_msg_baton3)

  def info_receiver(self, path, info, pool):
    """Squirrel away the output from 'svn info' so that the unit tests
       can get at them."""
    self.path = path
    self.info = info

  def test_client_ctx_baton_lifetime(self):
    pool = core.Pool()
    temp_client_ctx = client.svn_client_create_context(pool)

    # We keep track of these objects in separate variables here
    # because you can't get a PyObject back out of a PY_AS_VOID field
    test_object1 = lambda *args: "message 1"
    test_object2 = lambda *args: "message 2"

    # Verify that the refcount of a Python object is incremented when
    # you insert it into a PY_AS_VOID field.
    temp_client_ctx.log_msg_baton2 = test_object1
    test_object1 = weakref.ref(test_object1)
    self.assertNotEqual(test_object1(), None)

    # Verify that the refcount of the previous Python object is decremented
    # when a PY_AS_VOID field is replaced.
    temp_client_ctx.log_msg_baton2 = test_object2
    self.assertEqual(test_object1(), None)

    # Verify that the reference count of the new Python object (which
    # replaced test_object1) was incremented.
    test_object2 = weakref.ref(test_object2)
    self.assertNotEqual(test_object2(), None)

    # Verify that the reference count of test_object2 is decremented when
    # test_client_ctx is destroyed.
    temp_client_ctx = None
    self.assertEqual(test_object2(), None)

  def test_checkout(self):
    """Test svn_client_checkout2."""

    rev = core.svn_opt_revision_t()
    rev.kind = core.svn_opt_revision_head

    path = self.temper.alloc_empty_dir('-checkout')

    self.assertRaises(ValueError, client.checkout2,
                      self.repos_uri, path, None, None, True, True,
                      self.client_ctx)

    client.checkout2(self.repos_uri, path, rev, rev, True, True,
            self.client_ctx)

  def test_info(self):
    """Test svn_client_info on an empty repository"""

    # Run info
    revt = core.svn_opt_revision_t()
    revt.kind = core.svn_opt_revision_head
    client.info(self.repos_uri, revt, revt, self.info_receiver,
                False, self.client_ctx)

    # Check output from running info. This also serves to verify that
    # the internal 'info' object is still valid
    self.assertEqual(self.path, os.path.basename(self.repos_path))
    self.info.assert_valid()
    self.assertEqual(self.info.URL, self.repos_uri)
    self.assertEqual(self.info.repos_root_URL, self.repos_uri)

  def test_mkdir_url(self):
    """Test svn_client_mkdir2 on a file:// URL"""
    directory = urljoin(self.repos_uri+"/", "dir1")

    commit_info = client.mkdir2((directory,), self.client_ctx)
    self.assertEqual(commit_info.revision, 13)
    self.assertEqual(self.log_message_func_calls, 1)

  def test_mkdir_url_with_revprops(self):
    """Test svn_client_mkdir3 on a file:// URL, with added revprops"""
    directory = urljoin(self.repos_uri+"/", "some/deep/subdir")

    commit_info = client.mkdir3((directory,), 1, {'customprop':'value'},
                                self.client_ctx)
    self.assertEqual(commit_info.revision, 13)
    self.assertEqual(self.log_message_func_calls, 1)

  def test_log3_url(self):
    """Test svn_client_log3 on a file:// URL"""
    directory = urljoin(self.repos_uri+"/", "trunk/dir1")

    start = core.svn_opt_revision_t()
    end = core.svn_opt_revision_t()
    core.svn_opt_parse_revision(start, end, "4:0")
    client.log3((directory,), start, start, end, 1, True, False,
        self.log_receiver, self.client_ctx)
    self.assertEqual(self.change_author, "john")
    self.assertEqual(self.log_message, "More directories.")
    self.assertEqual(len(self.changed_paths), 3)
    for dir in ('/trunk/dir1', '/trunk/dir2', '/trunk/dir3'):
      self.assert_(dir in self.changed_paths)
      self.assertEqual(self.changed_paths[dir].action, 'A')

  def test_log5(self):
    """Test svn_client_log5."""
    start = core.svn_opt_revision_t()
    start.kind = core.svn_opt_revision_number
    start.value.number = 0

    end = core.svn_opt_revision_t()
    end.kind = core.svn_opt_revision_number
    end.value.number = 4

    rev_range = core.svn_opt_revision_range_t()
    rev_range.start = start
    rev_range.end = end

    self.received_revisions = []

    client.log5((self.repos_uri,), end, (rev_range,), 0, False, True, False, (),
        self.log_entry_receiver, self.client_ctx)

    self.assertEqual(self.received_revisions, range(0, 5))

  def test_uuid_from_url(self):
    """Test svn_client_uuid_from_url on a file:// URL"""
    self.assert_(isinstance(
                 client.uuid_from_url(self.repos_uri, self.client_ctx),
                 basestring))

  def test_url_from_path(self):
    """Test svn_client_url_from_path for a file:// URL"""
    self.assertEquals(client.url_from_path(self.repos_uri), self.repos_uri)

    rev = core.svn_opt_revision_t()
    rev.kind = core.svn_opt_revision_head

    path = self.temper.alloc_empty_dir('-url_from_path')

    client.checkout2(self.repos_uri, path, rev, rev, True, True,
                     self.client_ctx)

    self.assertEquals(client.url_from_path(path), self.repos_uri)

  def test_uuid_from_path(self):
    """Test svn_client_uuid_from_path."""
    rev = core.svn_opt_revision_t()
    rev.kind = core.svn_opt_revision_head

    path = self.temper.alloc_empty_dir('-uuid_from_path')

    client.checkout2(self.repos_uri, path, rev, rev, True, True,
                     self.client_ctx)

    wc_adm = wc.adm_open3(None, path, False, 0, None)

    self.assertEquals(client.uuid_from_path(path, wc_adm, self.client_ctx),
                      client.uuid_from_url(self.repos_uri, self.client_ctx))

    self.assert_(isinstance(client.uuid_from_path(path, wc_adm,
                            self.client_ctx), basestring))

  def test_open_ra_session(self):
      """Test svn_client_open_ra_session()."""
      client.open_ra_session(self.repos_uri, self.client_ctx)

  def test_info_file(self):
    """Test svn_client_info on working copy file and remote files."""

    # This test requires a file /trunk/README.txt of size 8 bytes
    # in the repository.
    rev = core.svn_opt_revision_t()
    rev.kind = core.svn_opt_revision_head
    wc_path = self.temper.alloc_empty_dir('-info_file')

    client.checkout2(self.repos_uri, wc_path, rev, rev, True, True,
                     self.client_ctx)
    adm_access = wc.adm_open3(None, wc_path, True, -1, None)

    try:
      # Test 1: Run info -r BASE. We expect the size value to be filled in.
      rev.kind = core.svn_opt_revision_base
      readme_path = '%s/trunk/README.txt' % wc_path
      readme_url = '%s/trunk/README.txt' % self.repos_uri
      client.info(readme_path, rev, rev, self.info_receiver,
                  False, self.client_ctx)

      self.assertEqual(self.path, os.path.basename(readme_path))
      self.info.assert_valid()
      self.assertEqual(self.info.working_size, client.SWIG_SVN_INFO_SIZE_UNKNOWN)
      self.assertEqual(self.info.size, 8)

      # Test 2: Run info (revision unspecified). We expect the working_size value
      # to be filled in.
      rev.kind = core.svn_opt_revision_unspecified
      client.info(readme_path, rev, rev, self.info_receiver,
                  False, self.client_ctx)

      self.assertEqual(self.path, readme_path)
      self.info.assert_valid()
      self.assertEqual(self.info.size, client.SWIG_SVN_INFO_SIZE_UNKNOWN)
      # README.txt contains one EOL char, so on Windows it will be expanded from
      # LF to CRLF hence the working_size will be 9 instead of 8.
      if os.name == 'nt':
        self.assertEqual(self.info.working_size, 9)
      else:
        self.assertEqual(self.info.working_size, 8)

      # Test 3: Run info on the repository URL of README.txt. We expect the size
      # value to be filled in.
      rev.kind = core.svn_opt_revision_head
      client.info(readme_url, rev, rev, self.info_receiver,
                  False, self.client_ctx)
      self.info.assert_valid()
      self.assertEqual(self.info.working_size, client.SWIG_SVN_INFO_SIZE_UNKNOWN)
      self.assertEqual(self.info.size, 8)
    finally:
      wc.adm_close(adm_access)

  def test_merge_peg3(self):
    """Test svn_client_merge_peg3."""
    head = core.svn_opt_revision_t()
    head.kind = core.svn_opt_revision_head
    wc_path = self.temper.alloc_empty_dir('-merge_peg3')

    client.checkout3(self.repos_uri, wc_path, head, head, core.svn_depth_infinity,
                     True, False, self.client_ctx)

    # Let's try to backport a change from the v1x branch
    trunk_path = core.svn_dirent_join(wc_path, 'trunk')
    v1x_path = core.svn_dirent_join(wc_path, 'branches/v1x')

    start = core.svn_opt_revision_t()
    start.kind = core.svn_opt_revision_number
    start.value.number = 8

    end = core.svn_opt_revision_t()
    end.kind = core.svn_opt_revision_number
    end.value.number = 9

    rrange = core.svn_opt_revision_range_t()
    rrange.start = start
    rrange.end = end

    client.merge_peg3(v1x_path, (rrange,), end, trunk_path,
                      core.svn_depth_infinity, False, False, False, False,
                      None, self.client_ctx)

    # Did it take effect?
    readme_path_native = core.svn_dirent_local_style(
      core.svn_dirent_join(trunk_path, 'README.txt')
    )

    readme = open(readme_path_native, 'r')
    readme_text = readme.read()
    readme.close()

    self.assertEqual(readme_text, 'This is a test.\n')

  def test_platform_providers(self):
    providers = core.svn_auth_get_platform_specific_client_providers(None, None)
    # Not much more we can test in this minimal environment.
    self.assert_(isinstance(providers, list))
    self.assert_(not filter(lambda x:
                             not isinstance(x, core.svn_auth_provider_object_t),
                            providers))

  def testGnomeKeyring(self):
    if not hasattr(core, 'svn_auth_set_gnome_keyring_unlock_prompt_func'):
      # gnome-keying not compiled in, do nothing
      return

    # This tests setting the gnome-keyring unlock prompt function as an
    # auth baton parameter. It doesn't actually call gnome-keyring
    # stuff, since that would require having a gnome-keyring running. We
    # just test if this doesn't error out, there's not even a return
    # value to test.
    def prompt_func(realm_string, pool):
      return "Foo"

    core.svn_auth_set_gnome_keyring_unlock_prompt_func(self.client_ctx.auth_baton, prompt_func)

def suite():
    return unittest.defaultTestLoader.loadTestsFromTestCase(
      SubversionClientTestCase)

if __name__ == '__main__':
    runner = unittest.TextTestRunner()
    runner.run(suite())


text:
var gulp = require('gulp');
var gulpWatch = require('gulp-watch');
var del = require('del');
var argv = process.argv;

/**
 * Ionic Gulp tasks, for more information on each see
 * https://github.com/driftyco/ionic-gulp-tasks
 */
var buildWebpack = require('ionic-gulp-webpack-build');
var buildSass = require('ionic-gulp-sass-build');
var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy');

gulp.task('watch', ['sass', 'html', 'fonts'], function() {
  gulpWatch('app/**/*.scss', function() { gulp.start('sass'); });
  gulpWatch('app/**/*.html', function() { gulp.start('html'); });
  return buildWebpack({ watch: true });
});
gulp.task('build', ['sass', 'html', 'fonts'], buildWebpack);
gulp.task('sass', buildSass);
gulp.task('html', copyHTML);
gulp.task('fonts', copyFonts);
gulp.task('clean', function(done) {
  del('www/build', done);
});

/**
 * Ionic hooks
 * Add ':before' or ':after' to any Ionic project command name to run the specified
 * tasks before or after the command.
 */
gulp.task('serve:before', ['watch']);
gulp.task('emulate:before', ['build']);
gulp.task('deploy:before', ['build']);

// we want to 'watch' when livereloading
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
gulp.task('run:before', [shouldWatch ? 'watch' : 'build']);


text:
LOGS=""
echo "Internal production startup"
echo ""

####################################
if [ -n "$UWSGI_MASTER" ]; then
    echo "Starting uwsgi"
    uwsgi --ini $UWSGI_MASTER
    echo ""
    LOGS="/var/log/uwsgi/*log $LOGS"
elif [ -n "$UWSGI_EMPEROR" ]; then
    echo "Starting uwsgi in emperor/vassals mode"
    uwsgi --emperor $UWSGI_EMPEROR
    echo ""
fi

####################################
if [ -n "$NGINX_ACTIVE" ]; then
    # remove defaults
    rm -rf /etc/nginx/sites-enabled
    echo "Starting nginx"
    service nginx start
    echo ""
    LOGS="/var/log/nginx/*log $LOGS"
fi

####################################
if [ "$LOGS" != "" ]; then
    sleep 2
    echo "Waiting for logs:"
    tail -f $LOGS
    echo "There was a problem. Hanging."
fi

####################################
sleep infinity


text:
__user_thumb__

__placeholder__

__form__

__js_content__


text:
package net.tburne.blog.effectiveunittests.tests;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

import org.junit.Test;

import net.tburne.blog.effectiveunittests.code.updated.impl.WriterImpl;
import net.tburne.blog.effectiveunittests.code.updated.types.IDestinationRecord;
import net.tburne.blog.effectiveunittests.tests.helpers.BooleanValue;
import net.tburne.blog.effectiveunittests.tests.helpers.FailingOutputStream;

import static org.junit.Assert.*;

public class WriterImplTests {

	/**
	 * Basic success case
	 * @throws IOException
	 */
	@Test
	public void testSuccess() throws IOException {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		try(WriterImpl impl = new WriterImpl(output)){
			IDestinationRecord destination = create("John Smith", 10);
			impl.write(destination);
		}
		assertEquals("John Smith,10", new String(output.toByteArray()));
	}

	/**
	 * Functional coverage
	 * @throws IOException
	 */
	@Test
	public void testMultipleRecords() throws IOException {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		try(WriterImpl impl = new WriterImpl(output)){
			{
				IDestinationRecord destination = create("John Smith", 10);
				impl.write(destination);

			}
			{
				IDestinationRecord destination = create("Jane Smith", 12);
				impl.write(destination);
			}

		}
		assertEquals("John Smith,10\nJane Smith,12", new String(output.toByteArray()));
	}

	/**
	 * Functional coverage
	 * @throws IOException
	 */
	@Test
	public void testMultipleRecordsRepeated() throws IOException {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		try(WriterImpl impl = new WriterImpl(output)){
			{
				IDestinationRecord destination = create("John Smith", 10);
				impl.write(destination);

			}
			{
				IDestinationRecord destination = create("Jane Smith", 12);
				impl.write(destination);
			}
			{
				IDestinationRecord destination = create("John Smith", 10);
				impl.write(destination);

			}
			{
				IDestinationRecord destination = create("Jane Smith", 12);
				impl.write(destination);
			}
		}
		assertEquals("John Smith,10\nJane Smith,12\nJohn Smith,10\nJane Smith,12", new String(output.toByteArray()));
	}

	/**
	 * Functional coverage
	 * @throws IOException
	 */
	@Test
	public void testOutputStreamClosed() throws IOException {
		BooleanValue closed = new BooleanValue();
		ByteArrayOutputStream output = new ByteArrayOutputStream(){

			@Override
			public void close() throws IOException {
				closed.Value = true;
				super.close();
			}

		};
		try(WriterImpl impl = new WriterImpl(output)){
			IDestinationRecord destination = create("John Smith", 10);
			impl.write(destination);
		}
		assertTrue(closed.Value);
	}

	/**
	 * Boundary case
	 * @throws IOException
	 */
	@Test
	public void testNullRecord() throws IOException {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		try(WriterImpl impl = new WriterImpl(output)){
			IDestinationRecord destination = null;
			impl.write(destination);
		}
		assertEquals("", new String(output.toByteArray()));
	}

	/**
	 * Boundary case
	 * @throws IOException
	 */
	@Test
	public void testNullName() throws IOException {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		NullPointerException ex = null;
		try(WriterImpl impl = new WriterImpl(output)){
			{
				IDestinationRecord destination = create(null, 10);
				impl.write(destination);
			}
		}catch(NullPointerException e){
			ex = e;
		}
		assertNotNull(ex);
	}

	/**
	 * Boundary cases
	 * @throws IOException
	 */
	@Test
	public void testAges() throws IOException {
		{
			int age = -1;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
		{
			int age = 0;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
		{
			int age = 1;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
		{
			int age = Integer.MAX_VALUE;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
		{
			int age = Integer.MIN_VALUE;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
	}

	/**
	 * Exception
	 */
	@Test
	public void testIOExceptions() {
		{
			FailingOutputStream output = new FailingOutputStream("");
			IOException ex = null;
			try(WriterImpl impl = new WriterImpl(output)){
				{
					IDestinationRecord destination = create("John Smith", 10);
					impl.write(destination);
				}
			}catch(IOException e){
				ex = e;
			}
			assertNotNull(ex);
		}
		{
			FailingOutputStream output = new FailingOutputStream("John");
			IOException ex = null;
			try(WriterImpl impl = new WriterImpl(output)){
				{
					IDestinationRecord destination = create("John Smith", 10);
					impl.write(destination);
				}
			}catch(IOException e){
				ex = e;
			}
			assertNotNull(ex);
		}
		{
			FailingOutputStream output = new FailingOutputStream("John Smith,10");
			IOException ex = null;
			try(WriterImpl impl = new WriterImpl(output)){
				{
					IDestinationRecord destination = create("John Smith", 10);
					impl.write(destination);
					destination = create("Jane Smith", 12);
					impl.write(destination);
				}
			}catch(IOException e){
				ex = e;
			}
			assertNotNull(ex);
		}
	}

	/**
	 * Partial programmatic state coverage
	 * @throws IOException
	 */
	@Test
	public void testAllAges() throws IOException {
		for(int i = -1000; i <= 1000; i++){
			int age = i;
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			try(WriterImpl impl = new WriterImpl(output)){
				IDestinationRecord destination = create("John Smith", age);
				impl.write(destination);
			}
			assertEquals("John Smith," + age, new String(output.toByteArray()));
		}
	}

	private IDestinationRecord create(String name, int age){
		return new IDestinationRecord() {

			@Override
			public String name() {
				return name;
			}

			@Override
			public int age() {
				return age;
			}
		};
	}

}


text:
#ifndef _SCSI_SCSI_SCAN_H
#define _SCSI_SCSI_SCAN_H

#ifdef CONFIG_SCSI
/* drivers/scsi/scsi_scan.c */
extern int scsi_complete_async_scans(void);
#else
static inline int scsi_complete_async_scans(void) { return 0; }
#endif

#endif /* _SCSI_SCSI_SCAN_H */


text:
<?php
class Article extends Model
{

}