text:
;var ls = ls || {};

/* ****************************************************
 * Frontend for LS-compatibility
 */

ls.photoset = ( function ($) {

    this.idLast = 0;
    this.isLoading = false;
    this.swfu;

    this.initSwfUpload = function (opt) {
        opt = opt || {};
        opt.button_placeholder_id = 'photoset-start-upload';
        opt.post_params.ls_photoset_target_tmp = $.cookie('ls_photoset_target_tmp') ? $.cookie('ls_photoset_target_tmp') : 0;

        $(ls.swfupload).unbind('load').bind('load', function () {
            this.swfu = ls.swfupload.init(opt);

            $(this.swfu).bind('eUploadProgress', this.swfHandlerUploadProgress);
            $(this.swfu).bind('eFileDialogComplete', this.swfHandlerFileDialogComplete);
            $(this.swfu).bind('eUploadSuccess', this.swfHandlerUploadSuccess);
            $(this.swfu).bind('eUploadComplete', this.swfHandlerUploadComplete);
        }.bind(this));

        ls.swfupload.loadSwf();
    }

    this.swfHandlerUploadProgress = function (e, file, bytesLoaded, percent) {
        $('#photoset_photo_empty_progress').text(file.name + ': ' + ( percent == 100 ? 'resize..' : percent + '%'));
    }

    this.swfHandlerFileDialogComplete = function (e, numFilesSelected, numFilesQueued) {
        if (numFilesQueued > 0) {
            ls.photoset.addPhotoEmpty();
        }
    }

    this.swfHandlerUploadSuccess = function (e, file, serverData) {
        ls.photoset.addPhoto(jQuery.parseJSON(serverData));
    }

    this.swfHandlerUploadComplete = function (e, file, next) {
        if (next > 0) {
            ls.photoset.addPhotoEmpty();
        }
    }

    this.addPhotoEmpty = function () {
        template = '
'
            + '

';
        $('#swfu_images').append(template);
    }

    this.addPhoto = function (response) {
        $('#photoset_photo_empty').remove();
        if (!response.bStateError) {
            template = '
'
                + '<textarea onBlur="ls.photoset.setPreviewDescription(' + response.id + ', this.value)"></textarea>
'
                + '' + ls.lang.get('topic_photoset_photo_delete') + ''
                + '' + ls.lang.get('topic_photoset_mark_as_preview') + '
';
            $('#swfu_images').append(template);
            ls.msg.notice(response.sMsgTitle, response.sMsg);
        } else {
            ls.msg.error(response.sMsgTitle, response.sMsg);
        }
        ls.photoset.closeForm();
    }

    this.deletePhoto = function (id) {
        if (!confirm(ls.lang.get('topic_photoset_photo_delete_confirm'))) {
            return;
        }
        ls.ajax(aRouter['content'] + 'photo/delete', {'id': id}, function (response) {
            if (!response.bStateError) {
                $('#photo_' + id).remove();
                ls.msg.notice(response.sMsgTitle, response.sMsg);
            } else {
                ls.msg.error(response.sMsgTitle, response.sMsg);
            }
        });
    }

    this.setPreview = function (id) {
        $('#topic_main_photo').val(id);

        $('.marked-as-preview').each(function (index, el) {
            $(el).removeClass('marked-as-preview');
            tmpId = $(el).attr('id').slice($(el).attr('id').lastIndexOf('_') + 1);
            $('#photo_preview_state_' + tmpId).html('' + ls.lang.get('topic_photoset_mark_as_preview') + '');
        });
        $('#photo_' + id).addClass('marked-as-preview');
        $('#photo_preview_state_' + id).html(ls.lang.get('topic_photoset_is_preview'));
    }

    this.setPreviewDescription = function (id, text) {
        ls.ajax(aRouter['content'] + 'photo/description', {'id': id, 'text': text}, function (result) {
                if (!result.bStateError) {

                } else {
                    ls.msg.error('Error', 'Please try again later');
                }
            }
        )
    }

    this.getMore = function (topic_id) {
        if (this.isLoading) return;
        this.isLoading = true;

        ls.ajax(aRouter['content'] + 'photo/getmore', {'topic_id': topic_id, 'last_id': this.idLast}, function (result) {
            this.isLoading = false;
            if (!result.bStateError) {
                if (result.photos) {
                    $.each(result.photos, function (index, photo) {
                        var image = '

';
                        $('#topic-photo-images').append(image);
                        this.idLast = photo.id;
                        $('.photoset-image').unbind('click');
                        $('.photoset-image').prettyPhoto({
                            social_tools: '',
                            show_title: false,
                            slideshow: false,
                            deeplinking: false
                        });
                    }.bind(this));
                }
                if (!result.bHaveNext || !result.photos) {
                    $('#topic-photo-more').remove();
                }
            } else {
                ls.msg.error('Error', 'Please try again later');
            }
        }.bind(this));
    }

    this.upload = function () {
        ls.photoset.addPhotoEmpty();
        ls.ajaxSubmit(aRouter['content'] + 'photo/upload/', $('#photoset-upload-form'), function (data) {
            if (data.bStateError) {
                $('#photoset_photo_empty').remove();
                ls.msg.error(data.sMsgTitle, data.sMsg);
            } else {
                ls.photoset.addPhoto(data);
            }
        });
        ls.photoset.closeForm();
    }

    this.closeForm = function () {
        $('#photoset-upload-form').jqmHide();
    }

    this.showForm = function () {
        var $select = $('#photoset-start-upload');
        if ($select.length) {
            var pos = $select.offset(),
                w = $select.outerWidth(),
                h = $select.outerHeight(),
                t = pos.top + h - 30 + 'px',
                l = pos.left - 15 + 'px';
            $('#photoset-upload-form').css({'top': t, 'left': l});
        }
        $('#photoset-upload-form').show();
    }

    this.showMainPhoto = function (id) {
        $('#photoset-main-preview-' + id).css('width', $('#photoset-main-image-' + id).outerWidth());
        $('#photoset-photo-count-' + id).show();
        $('#photoset-photo-desc-' + id).show();
    }

    return this;
}).call(ls.photoset || {}, jQuery);


text:
from django.utils.translation import activate

def pytest_runtest_setup(item):
    # run all tests with en locale
    activate('en')

redpajama_set_name: RedPajamaGithub


text:
package benchmarkdp.datagenerator.generator.codegenerator.msword;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import benchmarkdp.datagenerator.core.IGeneratedCode;

public class MSWordGeneratedCode implements IGeneratedCode {

	String generatedCode;

	String fileExtension;

	String operatingSystem;
	String software;

	public MSWordGeneratedCode(String fE, String os, String soft) {
		fileExtension = fE;
		operatingSystem = os;
		software = soft;
		generatedCode="";
	}

	public void setGeneratedCode(String code) {
		generatedCode = code;
	}

	public void addGeneratedCode(String code) {
		generatedCode += code;
	}

	@Override
	public void saveToFile(String filePath, String testCaseName) {
		if (generatedCode != null) {
			try {
				String platPath = filePath + "/" + getPlatform();
				File f = new File(platPath);
				if (!f.exists()) {
					f.mkdir();
				}

				String file = platPath + "/" + testCaseName + "." + fileExtension;
				f = new File(file);
				BufferedWriter bw = new BufferedWriter(new FileWriter(f));
				bw.write(generatedCode + "\n");
				bw.close();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}

	}

	@Override
	public String getPlatform() {
		return operatingSystem + "-" + software;
	}

}


text:
<!doctype html>

		<meta charset="utf-8">
		<meta http-equiv="x-ua-compatible" content="ie=edge">
		<title>fesTest</title>
		<meta name="description" content="Fritzing Export SVG problem exploring">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="stylesheet" href="css/normalize.css">
		<link rel="stylesheet" href="css/main.css">

Fritzing Export SVG problem exploring

This github repository and associated githubio pages track and document exploration of what works, and does not work, creating Fritzing parts, then attempting to export the views as svg images.

The Problem

When creating Fritzing documents of circuits, then exporting the views to svg images, some content gets dropped. This is seen mostly for custom parts. Since the content does get included when exporting to png or jpeg images, there appears to be a problem with the svg export code. However, since most parts export correctly, there is also some interaction with the way the parts have been created. This is some exploration of that. The svg and fzp files that go into an fzpz part file are manipulated in various ways.

The svg export also gets the automatic text rotation wrong for both part rotations and flips. The schematic view, and png export look correct.

Environment

Fedora 24 x86_64

Fritzing Version 0.9.2 (b8d2d5970658f0bed09c661c9e)

The Process

Setup

Getting a working part

Testing process

zip -u ../testPart.fzpz *.svg *.fzp

Fritzing ¦ File ¦ Open ¦ testPart.fzpz

Breadboard view ¦ delete breadboard ¦ place test part ¦ position to 0,0

Export ¦ as Image ¦ svg

Schematic view ¦ Export ¦ as Image ¦ svg

eog untitled.svg

edit untitled.svg

add just inside main part group with transform, to add background to make it easier to see (instead of the patterned transparent background)

<rect id="rectbck" height="86" x="203" y="366" fill="#F0FFFF" width="97"/>

size and positioning intended to keep small transparent border for alignment reference

xmldiff untitled.svg ref.svg

exit Fritzing between tests, to make sure to get a clean environment

do no save imported parts, document changes, or My Parts bin changes on exit

Testing History

Testing log

Discoveries

fzp

See FZP format for a lot of useful details.

General SVG

Typically SVG files use 90 pixels per inch, but Illustrator uses 72 pixels per inch. Fritzing might figure it out correctly, but editing the svg element to set the width and height attributes in inches (in) can work around the difference.1

Terminal elements are optional in breadboard view.2 When they do not exist, the centre point of the connector pin graphics is used.

See About SVGs

html style comments in the source svg file get carried through to the view export svg.

Breadboard svg file

the snapped 'zero' position varies a small amount from build to build, although the breadboard svg file was not touched.

Schematic svg file

From the supplied svg template file

<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

The template does not include a doctype, but does have the xmlns:inkscape attribute in the svg tag.

The template does not include an enable-background attribute

The svg element has a Layer_1 id

There are 3 top level groups, with ids of background, help, and schematic

There are no references to connector or terminal

From the base working svg file

<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

Despite that, the svg tag includes an xmlns:inkscape attribute. The x, y, width, height attributes are in pixels (px), starting from (0,0). The viewBox and enable-background use the same coordinates, without units.

The top level group wrapper <g id="schematic"> contains a single group <g id="layer1"> plus a pair of rectangle objects for each connection pin. The rectangles have ids of "connector«pinNumber»" and "connector«pinNumber»terminal". These are NOT part of the layer1 group, and do not have any stroke or style information. Fill is set to none. The pin numbers are not sequential, but match the (zero based) pin positions for a 14 pin DIP chip. Other svg files have connector«n» ids, but only svg also has the terminals.

The layer1 group has a transform attribute that translates by a fairly large amount (-202,-376). In addition to the graphics for the part, it contains line elements (nested in more groups) with stroke="#787878" for the connector lines. These do NOT have an id

To match the standard 0.1 inch snap grid, the complete schematic graphics should start at (0,0), and be multiples of 0.1 in width and height. That will be multiples of 7.2 or 9.0 px. Rectangular schematic symbols that have pin connections around the outside should have a background rectangle that matches the viewBox, but inset by 0.1 inch on each side that any connection pins exist. That inset needs to be adjusted by an addition 0.5 of the background rectangle stroke width (which could be zero). That means adding 0.5 * stroke width to the x and y rect element coordinates, and subtracting 1.0 * stroke width from the width and height.

Fritzing aligns (at least) the schematic symbol position (origin) based on the (first?) detected pin location. Not on the viewBox origin. Symptoms make it look like the viewBox origin is not on a grid boundary, but the terminal end of the first pin is.

Graphics content in the schematic svg file that is NOT inside of the schematic (id) group is visible in the Fritzing view, but does not get exported to the svg image. However, it DOES get exported to png.  Exporting to png even includes the current highlight / selected element dashed border.  Is the whole problem simply graphics that is not inside the appropriate view/layer group?  connector«n»terminal graphics is fine outside of the group, because that is functionality for Fritzing, and does not show on the export anyway.

If there are no top or bottom schematic pin connections, the height of the graphics does not need to be a multiple of 0.1 inch, and the side pin connections do not need to be a multiple of 0.1 inch from the top.  They still needed to be separated vertically by multiples of 0.1 inch.

defs and use tags give in file reusable block, and look good in Fritzing.  However, the defs element does not get exported with the rest of the view svg.  The use elements do (assuming other constraints valid), but without the defs, they are invisible.

After rotate, drag to make sure pin locations get snapped to grid.

Example data values

internal pin label names (eg. NC): fill="#787878" font-size="4.5" font-family="'DroidSans'"

internal component (chip) text label: font-size="5.5" font-family="'DroidSans'"

schematic component body graphics: fill="none" stroke="#000000" stroke-width="0.7" stroke-linecap="round"

internal schematic graphics that connect to external pins have id in the form connector«n»pin_«number»_

PCB svg file

See More SVG topics for a few PCB specific svg rules and options.


text:
package com.sequenceiq.cloudbreak.orchestrator.exception;

public class CloudbreakOrchestratorFailedException extends CloudbreakOrchestratorException {

    public CloudbreakOrchestratorFailedException(String message) {
        super(message);
    }

    public CloudbreakOrchestratorFailedException(String message, Throwable cause) {
        super(message, cause);
    }

    public CloudbreakOrchestratorFailedException(Throwable cause) {
        super(cause);
    }

    protected CloudbreakOrchestratorFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}


text:
{{track.name}}

{{track.artists[0].name}}


text:
bundle exec jekyll doctor

# Verify the site can be compiled.
bundle exec jekyll build --verbose


text:
#import <IDEKit/IDEBaseDocumentNavigableItem.h>

@interface IDEDocumentLocationNavigableItem : IDEBaseDocumentNavigableItem
{
}

- (id)_documentLocation;
- (id)contentDocumentLocation;
- (id)documentType;
- (id)fileURL;
- (id)initWithRepresentedObject:(id)arg1;
- (id)name;
- (id)newImage;

@end


text:
[![Build Status](https://travis-ci.org/tsuru/tsuru.png?branch=master)](https://travis-ci.org/tsuru/tsuru)
[![Go Report Card](https://goreportcard.com/badge/github.com/tsuru/tsuru)](https://goreportcard.com/report/github.com/tsuru/tsuru)

## What is tsuru?

tsuru is an extensible and open source Platform as a Service (PaaS) that makes
application deployments faster and easier.
tsuru is an open source polyglot cloud application platform (PaaS).
With tsuru, you don't need to think about servers at all.
As an application developer, you can:

- Write apps in the programming language of your choice
- Back apps with add-on resources such as SQL and NoSQL databases, including memcached, redis, and many
others.
- Manage apps using the ``tsuru`` command-line tool
- Deploy apps using the Git revision control system

Links:

- Full Documentation: https://docs.tsuru.io
- How to Contribute: https://docs.tsuru.io/stable/contributing/
- Repository & Issue Tracker: https://github.com/tsuru/tsuru
- Talk to us on Gitter: https://gitter.im/tsuru/tsuru

## Quick Start

With the purpose of test tsuru and/or for development, you can use [installer](https://docs.tsuru.io/master/experimental/installer.html) to have tsuru up and running. Installer is an experimental feature.

### From Binary

#### Getting tsuru-client

Download the latest release for your platform at: https://github.com/tsuru/tsuru-client/releases/

Example for release 1.1.1 and OS X.

```
$ curl -sSL https://github.com/tsuru/tsuru-client/releases/download/1.1.1/tsuru-1.1.1-darwin_amd64.tar.gz \
  | tar xz
```

#### Call tsuru installer

```
$ tsuru install create
```

### From Source

#### Getting tsuru-client

You need to have [Go](https://golang.org/doc/install) properly installed in your machine.

```
$ git clone github.com/tsuru/tsuru-client $GOPATH/src/github.com/tsuru/tsuru-client
$ cd $GOPATH/src/github.com/tsuru/tsuru-client
$ make install
```

#### Create an installer config

Create the tsuru installer config files with:

```
$ tsuru install config init
```

Replace tsuru api image tag with the latest tag on the install-compose.yml:

```
$ sed -i'' -e 's/api:v1/api:latest/g' install-compose.yml
```

#### Call tsuru installer

```
$ $GOPATH/bin/tsuru install create -c install-config.yml -e install-compose.yml
```

### Testing

If everything's gone well you have the tsuru running on a virtualbox.
Call app-list to see tsuru working, this command needs to return one app called tsuru-dashboard.

```
$ tsuru app-list
```


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

<title>TextureManager</title>
<meta name="date" content="2015-06-01">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

net.majorkernelpanic.streaming.gl

Class TextureManager

java.lang.Object

net.majorkernelpanic.streaming.gl.TextureManager

public class TextureManager
extends java.lang.Object

Code for rendering a texture onto a surface using OpenGL ES 2.0.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
TAG

Constructor Summary

Constructors

Constructor and Description

TextureManager()

Method Summary

Methods

Modifier and Type
Method and Description

void
changeFragmentShader(java.lang.String fragmentShader)

Replaces the fragment shader.

void
checkGlError(java.lang.String op)

android.graphics.SurfaceTexture
createTexture()

Initializes GL state.

void
drawFrame()

android.graphics.SurfaceTexture
getSurfaceTexture()

int
getTextureId()

void
release()

void
updateFrame()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TAG

public static final java.lang.String TAG

See Also:

Constant Field Values

Constructor Detail

TextureManager

public TextureManager()

Method Detail

getTextureId

public int getTextureId()

getSurfaceTexture

public android.graphics.SurfaceTexture getSurfaceTexture()

updateFrame

public void updateFrame()

drawFrame

public void drawFrame()

createTexture

public android.graphics.SurfaceTexture createTexture()

Initializes GL state.  Call this after the EGL surface has been created and made current.

release

public void release()

changeFragmentShader

public void changeFragmentShader(java.lang.String fragmentShader)

Replaces the fragment shader.  Pass in null to reset to default.

checkGlError

public void checkGlError(java.lang.String op)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
"""Filesystem scheduler/master backend.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from collections import namedtuple
import io
import logging
import os
import threading

from treadmill import dirwatch
from treadmill import fs
from treadmill import utils
from treadmill import yamlwrapper as yaml
from treadmill import zknamespace as z
from treadmill.zksync import utils as zksync_utils

from . import backend

_LOGGER = logging.getLogger(__name__)

# ZK nodes that can be ignored during snapshot
_ZK_BLACKLIST = ['//finished', '//keytabs']

def _fpath(fsroot, zkpath):
    """Returns file path to given zk node."""
    if zkpath == '/':
        return os.path.join(fsroot, '_data')

    path = zkpath.lstrip('/').split('/')
    return os.path.join(
        fsroot,
        '/'.join(['_' + d for d in path[:-1]]),
        path[-1]
    )

def _dpath(fsroot, zkpath):
    """Returns file path to given zk node."""
    if zkpath == '/':
        return fsroot

    path = zkpath.lstrip('/').split('/')
    return os.path.join(
        fsroot,
        '/'.join(['_' + d for d in path])
    )

def _write_data(fpath, data, stat):
    """Write Zookeeper data to filesystem."""
    zksync_utils.write_data(
        fpath, data, stat.last_modified
    )

def snapshot(zkclient, root, zkpath='/'):
    """Create a snapshot of ZK state to the filesystem."""
    if zkpath in _ZK_BLACKLIST:
        return

    _LOGGER.debug('snapshot %s', zkpath)

    fpath = _fpath(root, zkpath)
    fs.mkdir_safe(os.path.dirname(fpath))

    data, stat = zkclient.get(zkpath)
    _write_data(fpath, data, stat)

    children = zkclient.get_children(zkpath)
    for node in children:
        zknode = z.join_zookeeper_path(zkpath, node)
        snapshot(zkclient, root, zknode)

class FsBackend(backend.Backend):
    """Implements readonly Zookeeper based storage."""

    def __init__(self, fsroot):
        self.fsroot = fsroot
        # pylint: disable=C0103
        self.ChildrenWatch = self._childrenwatch

        self._dirwatcher = dirwatch.DirWatcher()
        self._dirwatch_dispatcher = dirwatch.DirWatcherDispatcher(
            self._dirwatcher)

        thread = threading.Thread(target=self._run_dirwatcher)
        thread.daemon = True
        thread.start()

        super(FsBackend, self).__init__()

    def _run_dirwatcher(self):
        """Dirwatcher loop."""
        while True:
            if self._dirwatcher.wait_for_events():
                self._dirwatcher.process_events()

    def _childrenwatch(self, zkpath):
        """ChildrenWatch decorator."""

        def wrap(func):
            """Decorator body."""

            def _func(_path):
                """wrapped func."""
                func(self.list(zkpath))

            dpath = _dpath(self.fsroot, zkpath)
            fs.mkdir_safe(dpath)

            self._dirwatcher.add_dir(dpath)
            self._dirwatch_dispatcher.register(dpath, {
                dirwatch.DirWatcherEvent.CREATED: _func,
                dirwatch.DirWatcherEvent.DELETED: _func,
            })

            return func

        return wrap

    def event_object(self):
        """Create new event object."""
        return threading.Event()

    def list(self, path):
        """Return path listing."""
        dpath = _dpath(self.fsroot, path)
        fs.mkdir_safe(dpath)
        try:
            children = os.listdir(dpath)
            return [e for e in children if not e.startswith('_')]
        except OSError:
            raise backend.ObjectNotFoundError()

    def get(self, path):
        """Return stored object given path.
        """
        data, _ = self.get_with_metadata(path)
        return data

    def get_with_metadata(self, path):
        """Return stored object with metadata."""
        fpath = _fpath(self.fsroot, path)
        try:
            stat = os.stat(fpath)
            meta = namedtuple('Metadata', 'ctime')(stat.st_ctime)
            with io.open(fpath) as datafile:
                return yaml.load(datafile.read()), meta
        except OSError:
            raise backend.ObjectNotFoundError()

    def exists(self, path):
        """Check if object exists."""
        fpath = _fpath(self.fsroot, path)
        return os.path.exists(fpath)

    def ensure_exists(self, path):
        """Ensure storage path exists."""
        fpath = _fpath(self.fsroot, path)
        try:
            fs.mkdir_safe(os.path.dirname(fpath))
            utils.touch(fpath)
        except OSError:
            raise backend.ObjectNotFoundError()

    def delete(self, path):
        """Delete object given the path."""
        fpath = _fpath(self.fsroot, path)
        fs.rm_safe(fpath)

    def put(self, path, value):
        """Store object at a given path."""
        fpath = _fpath(self.fsroot, path)
        try:
            fs.mkdir_safe(os.path.dirname(fpath))
            with io.open(fpath, 'w') as node:
                node.write(yaml.dump(value))
        except OSError:
            raise backend.ObjectNotFoundError()

    def update(self, path, data, check_content=True):
        """Set data into ZK node."""
        return self.put(path, data)


text: \chapter{\label{chapter7} A Quick User Guide}


text:
@implementation ServiceBaseRequest
+ (ServiceBaseRequest *)sharedService{
    static ServiceBaseRequest *_sharedService = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedService = [[ServiceBaseRequest alloc] init];
    });

    return _sharedService;
}

- (id)init
{
    self = [super init];
    if (self) {
        appDelegate = [[UIApplication sharedApplication] delegate];

    }
    return self;
}

- (ASIFormDataRequest *)requestMethod:(NSString *)method
{
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:method]];
    request=[self addCommanHeader:request];
    request=[self addCommanPostValue:request];
    request.delegate = self;
    [request setValidatesSecureCertificate:NO];
    [request setTimeOutSeconds:10];
    [request setNumberOfTimesToRetryOnTimeout:3];
    [ASIFormDataRequest setShouldUpdateNetworkActivityIndicator:YES];

    return request;
}

-(ASIFormDataRequest *)addCommanHeader:(ASIFormDataRequest *)request{
    [request addRequestHeader:@"Accept" value:@"application/json"];
    [request addRequestHeader:@"Content-Type" value:@"multipart/form-data"];
//    [request addPostValue:@"ios" forKey:@"os"];

    return request;
}

-(ASIFormDataRequest *)addCommanPostValue:(ASIFormDataRequest *)request{
//    [request addPostValue:appDelegate.uesrId forKey:@"userId"];

    return  request;
}

-(void )setRequestService:(ASIFormDataRequest *)request completionHandler:(void(^)(ServiceBaseResponse *response))completionHandler;{
    __block ASIFormDataRequest *nowRequest = request;
    [request setCompletionBlock:^{
    ServiceBaseResponse *response = [[ServiceBaseResponse alloc] initWithRequest:nowRequest];
    completionHandler(response);
    }];
    [request setFailedBlock:^{
    ServiceBaseResponse *response = [[ServiceBaseResponse alloc] initWithRequest:nowRequest];
    completionHandler(response);
    }];
    [request startAsynchronous];
}
//自习室的方法
-(void)getHealthCondition:(NSString *)buildingID  weekDayTime:(NSString *)weekDay section:(NSString *)sectionID compus:(NSString *)compus   completionHandler:(void(^)(ServiceBaseResponse *response))completionHandler
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/zapp"];

    [request addPostValue:buildingID forKey:@"buildID"];
    [request addPostValue:weekDay  forKey:@"weekDay"];
    [request addPostValue:sectionID  forKey:@"section"];
    [request addPostValue:compus forKey:@"campus"];

    NSLog(@"%@,%@,%@,%@",buildingID,weekDay,sectionID,compus);

    [self setRequestService:request completionHandler:completionHandler];

}
//显示成绩的方法
-(void)getGrade:(NSString *)nianjiID xuehao:(NSString *)xuehao mima:(NSString *)mimaID    completionHandler:(void(^)(ServiceBaseResponse *response))completionHandler;
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/QueryScore"];

    [request addPostValue:nianjiID forKey:@"nianji"];
    [request addPostValue:xuehao  forKey:@"xuehao"];
    [request addPostValue:mimaID  forKey:@"mima"];
    NSLog(@"%@,%@,%@",nianjiID,xuehao,mimaID);

    [self setRequestService:request completionHandler:completionHandler];
}
//选择学期显示成绩的方法
-(void)selectItem:(NSString *)urlString   completionHandler:(void(^)(ServiceBaseResponse *response))completionHandler
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/QueryScoreFromURL"];
    [request addPostValue:urlString forKey:@"url"];

    NSLog(@"%@",urlString);

    [self setRequestService:request completionHandler:completionHandler];
}

//获取新闻列表的方法
-(void)getNews:(void(^)(ServiceBaseResponse *response))completionHandler
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/ObtainNewsInformation"];
    [self setRequestService:request completionHandler:completionHandler];
}

//获取通知公告的方法
-(void)getNotice:(void(^)(ServiceBaseResponse *response))completionHandler
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/ObtainNoticeInformation"];
    [self setRequestService:request completionHandler:completionHandler];
}
//获取问题列表的方法实现
-(void)getWentiLiebiao:(void(^)(ServiceBaseResponse *response))completionHandler
{
    ASIFormDataRequest *request = [self requestMethod:@"http://115.28.230.185:8080/AppZZU/ResponseWentiServlet"];
    [self setRequestService:request completionHandler:completionHandler];
}
//加载学习宝问题评论的列表
-(void)getCommentsList:(NSString *)pID comletionHandler:(void(^)(ServiceBaseResponse *response))completionHandler
{
    NSString *urlString=@"http://115.28.230.185:8080/AppZZU/ResponseCommentsServlet";
    urlString=[NSString stringWithFormat:@"%@?pID=%@",urlString,pID];
    ASIFormDataRequest *request = [self requestMethod:urlString];
    [self setRequestService:request completionHandler:completionHandler];
}

//提交评论并不附带图片
-(void)postCommentWithoutImage:(NSString *)pID comment:(NSString *)comment  comletionHandler:(void(^)(ServiceBaseResponse *response))completionHandler
{
    NSString *urlString=@"http://115.28.230.185:8080/AppZZU/ReceiveCommentsNoImageServlet";
    ASIFormDataRequest *request = [self requestMethod:urlString];
    [request addPostValue:pID forKey:@"ID"];
    [request addPostValue:comment forKey:@"content"];
    [self setRequestService:request completionHandler:completionHandler];
}
@end


text:
import cgi
import unittest
from io import BytesIO

from kinto_attachment.utils import save_file

class _Registry(object):
    settings = {'attachment.folder': ''}
    attachment_resources = {}

    def save(self, *args, **kw):
        return 'yeahok'

    def url(self, location):
        return 'http://localhost/%s' % location

    def create(self, *args, **kw):
        pass

    @property
    def storage(self):
        return self

class _Request(object):
    registry = _Registry()
    matchdict = {'bucket_id': 'bucket',
                 'collection_id': 'collection'}

    attachment = _Registry()

    def route_path(self, *args, **kw):
        return 'fullpath'

class TestUtils(unittest.TestCase):

    def test_save_file_gzip(self):
        my_font = cgi.FieldStorage()
        my_font.filename = 'font.ttf'
        my_font.file = BytesIO(b'content')
        my_font.type = 'application/x-font'

        request = _Request()
        request.registry.settings['attachment.gzipped'] = True
        res = save_file(request, my_font)
        self.assertTrue('original' in res)

    def test_save_file_not_gzip(self):
        my_font = cgi.FieldStorage()
        my_font.filename = 'font.ttf'
        my_font.file = BytesIO(b'content')
        my_font.type = 'application/x-font'

        request = _Request()
        request.registry.settings['attachment.gzipped'] = False
        res = save_file(request, my_font)
        self.assertFalse('original' in res)


text:
package org.ovirt.engine.core.common.queries;

import org.ovirt.engine.core.compat.*;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "RegisterQueryParameters", namespace = "http://service.engine.ovirt.org")
public class RegisterQueryParameters extends VdcQueryParametersBase {
    private static final long serialVersionUID = -1794521524205136814L;

    @XmlElement(name = "QueryID", required = true)
    private Guid privateQueryID = new Guid();

    public Guid getQueryID() {
        return privateQueryID;
    }

    protected void setQueryID(Guid value) {
        privateQueryID = value;
    }

    @XmlElement(name = "QueryType", required = true)
    private VdcQueryType privateQueryType = VdcQueryType.forValue(0);

    public VdcQueryType getQueryType() {
        return privateQueryType;
    }

    protected void setQueryType(VdcQueryType value) {
        privateQueryType = value;
    }

    @XmlElement(name = "QueryParams", required = true)
    private VdcQueryParametersBase privateQueryParams;

    public VdcQueryParametersBase getQueryParams() {
        return privateQueryParams;
    }

    protected void setQueryParams(VdcQueryParametersBase value) {
        privateQueryParams = value;
    }

    public RegisterQueryParameters(Guid queryID, VdcQueryType queryType, VdcQueryParametersBase queryParams) {
        setQueryID(queryID);
        setQueryType(queryType);
        setQueryParams(queryParams);
    }

    @Override
    public RegisterableQueryReturnDataType GetReturnedDataTypeByVdcQueryType(VdcQueryType queryType) {
        return RegisterableQueryReturnDataType.UNDEFINED;
    }

    public RegisterQueryParameters() {
    }
}


text:
<bill session="111" type="s" number="291" updated="2009-03-07T14:08:22-05:00">
	<status><introduced date="1232514000" datetime="2009-01-21"/></status>

	<introduced date="1232514000" datetime="2009-01-21"/>
	<titles>
		<title type="short" as="introduced">Guantanamo Bay Detention Facility Safe Closure Act of 2009</title>
		<title type="official" as="introduced">A bill to provide for certain requirements related to the closing of the Guantanamo Bay detention facility.</title>
	</titles>
	<sponsor id="300013"/>
	<cosponsors>
		<cosponsor id="300083" joined="2009-01-21"/>
		<cosponsor id="300010" joined="2009-01-21"/>
	</cosponsors>
	<actions>
		<action date="1232514000" datetime="2009-01-21"><text>Read twice and referred to the Committee on Armed Services.</text></action>
	</actions>
	<committees>
		<committee name="Senate Armed Services" subcommittee="" activity="Referral, In Committee" />
	</committees>
	<relatedbills>
		<bill relation="identical" session="111" type="h" number="1069" />
	</relatedbills>
	<subjects>
		<term name="Armed forces and national security"/>
		<term name="Caribbean area"/>
		<term name="Congressional oversight"/>
		<term name="Correctional facilities and imprisonment"/>
		<term name="Cuba"/>
		<term name="Government investigations"/>
		<term name="Latin America"/>
		<term name="Military facilities and property"/>
	</subjects>
	<amendments>

	</amendments>

	1/21/2009--Introduced.
Guantanamo Bay Detention Facility Safe Closure Act of 2009 - Directs the President to notify the congressional defense and appropriations committees at least 90 days before taking any action associated with the closure of the Department of Defense (DOD) detention facility at Guantanamo Bay, Cuba, and the transfer of any persons detained there to a new detention facility in the United States.
Requires the notification to include a: (1) study addressing the legal ramifications and the security, infrastructure, and other support requirements associated with such closure and transfer of persons detained; and (2) plan for the relocation of the persons detained.

</bill>


text:
using System.IO;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.IO;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osu.Game.Scoring;
using osu.Game.Users;

#nullable enable

namespace osu.Game.Extensions
{
    public static class ModelExtensions
    {
        /// <summary>
        /// Get the relative path in osu! storage for this file.
        /// </summary>
        /// <param name="fileInfo">The file info.</param>
        /// <returns>A relative file path.</returns>
        public static string GetStoragePath(this IFileInfo fileInfo) => Path.Combine(fileInfo.Hash.Remove(1), fileInfo.Hash.Remove(2), fileInfo.Hash);

        /// <summary>
        /// Returns a user-facing string representing the <paramref name="model"/>.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Non-interface types without special handling will fall back to <see cref="object.ToString()"/>.
        /// </para>
        /// <para>
        /// Warning: This method is _purposefully_ not called <c>GetDisplayTitle()</c> like the others, because otherwise
        /// extension method type inference rules cause this method to call itself and cause a stack overflow.
        /// </para>
        /// </remarks>
        public static string GetDisplayString(this object? model)
        {
            string? result = null;

            switch (model)
            {
                case IBeatmapSetInfo beatmapSetInfo:
                    result = beatmapSetInfo.Metadata.GetDisplayTitle();
                    break;

                case IBeatmapInfo beatmapInfo:
                    result = beatmapInfo.GetDisplayTitle();
                    break;

                case IBeatmapMetadataInfo metadataInfo:
                    result = metadataInfo.GetDisplayTitle();
                    break;

                case IScoreInfo scoreInfo:
                    result = scoreInfo.GetDisplayTitle();
                    break;

                case IRulesetInfo rulesetInfo:
                    result = rulesetInfo.Name;
                    break;

                case IUser user:
                    result = user.Username;
                    break;
            }

            // fallback in case none of the above happens to match.
            result ??= model?.ToString() ?? @"null";
            return result;
        }

        /// <summary>
        /// Check whether this <see cref="IRulesetInfo"/>'s online ID is within the range that defines it as a legacy ruleset (ie. either osu!, osu!taiko, osu!catch or osu!mania).
        /// </summary>
        public static bool IsLegacyRuleset(this IRulesetInfo ruleset) => ruleset.OnlineID >= 0 && ruleset.OnlineID <= ILegacyRuleset.MAX_LEGACY_RULESET_ID;

        /// <summary>
        /// Check whether the online ID of two <see cref="IBeatmapSetInfo"/>s match.
        /// </summary>
        /// <param name="instance">The instance to compare.</param>
        /// <param name="other">The other instance to compare against.</param>
        /// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
        public static bool MatchesOnlineID(this IBeatmapSetInfo? instance, IBeatmapSetInfo? other) => matchesOnlineID(instance, other);

        /// <summary>
        /// Check whether the online ID of two <see cref="IBeatmapInfo"/>s match.
        /// </summary>
        /// <param name="instance">The instance to compare.</param>
        /// <param name="other">The other instance to compare against.</param>
        /// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
        public static bool MatchesOnlineID(this IBeatmapInfo? instance, IBeatmapInfo? other) => matchesOnlineID(instance, other);

        /// <summary>
        /// Check whether the online ID of two <see cref="IRulesetInfo"/>s match.
        /// </summary>
        /// <param name="instance">The instance to compare.</param>
        /// <param name="other">The other instance to compare against.</param>
        /// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
        public static bool MatchesOnlineID(this IRulesetInfo? instance, IRulesetInfo? other) => matchesOnlineID(instance, other);

        /// <summary>
        /// Check whether the online ID of two <see cref="APIUser"/>s match.
        /// </summary>
        /// <param name="instance">The instance to compare.</param>
        /// <param name="other">The other instance to compare against.</param>
        /// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
        public static bool MatchesOnlineID(this APIUser? instance, APIUser? other) => matchesOnlineID(instance, other);

        /// <summary>
        /// Check whether the online ID of two <see cref="IScoreInfo"/>s match.
        /// </summary>
        /// <param name="instance">The instance to compare.</param>
        /// <param name="other">The other instance to compare against.</param>
        /// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
        public static bool MatchesOnlineID(this IScoreInfo? instance, IScoreInfo? other) => matchesOnlineID(instance, other);

        private static bool matchesOnlineID(this IHasOnlineID<long>? instance, IHasOnlineID<long>? other)
        {
            if (instance == null || other == null)
                return false;

            if (instance.OnlineID < 0 || other.OnlineID < 0)
                return false;

            return instance.OnlineID.Equals(other.OnlineID);
        }

        private static bool matchesOnlineID(this IHasOnlineID<int>? instance, IHasOnlineID<int>? other)
        {
            if (instance == null || other == null)
                return false;

            if (instance.OnlineID < 0 || other.OnlineID < 0)
                return false;

            return instance.OnlineID.Equals(other.OnlineID);
        }

        private static readonly char[] invalid_filename_characters = Path.GetInvalidFileNameChars()
                                                                         // Backslash is added to avoid issues when exporting to zip.
                                                                         // See SharpCompress filename normalisation https://github.com/adamhathcock/sharpcompress/blob/a1e7c0068db814c9aa78d86a94ccd1c761af74bd/src/SharpCompress/Writers/Zip/ZipWriter.cs#L143.
                                                                         .Append('\\')
                                                                         .ToArray();

        /// <summary>
        /// Get a valid filename for use inside a zip file. Avoids backslashes being incorrectly converted to directories.
        /// </summary>
        public static string GetValidArchiveContentFilename(this string filename)
        {
            foreach (char c in invalid_filename_characters)
                filename = filename.Replace(c, '_');
            return filename;
        }
    }
}


text:
package io.quarkus.gradle;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;

import org.junit.jupiter.api.Test;

public class MultiSourceProjectTest extends QuarkusGradleWrapperTestBase {

    @Test
    public void shouldRunTest() throws Exception {
        final File projectDir = getProjectDir("multi-source-project");
        final BuildResult buildResult = runGradleWrapper(projectDir, ":clean", ":test");

        assertThat(BuildResult.isSuccessful(buildResult.getTasks().get(":test"))).isTrue();
    }

}


text:
{% load best_practice_courselet %}

        {{forloop.counter}}. {{ template.summary }}

      {% if template.bestpractice_set.all|bps_exists:courselet %}

          {% for best_practice in template.bestpractice_set.all|active:courselet %}
            {% if best_practice.courselet %}

              You've uploaded the file "{{ best_practice.filename }}" and {{ best_practice.get_converted_status_display|lower }}.
              {% if best_practice.converted_status != 'pending' %}

                View threads.

              {% endif %}
            {% endif %}
          {% endfor %}

      {% else %}
        {{ template.explanation }}
      {% endif %}

      {% if template.bestpractice_set.all|bps_exists:courselet %}Do this again{% else %}View{% endif %}

        {{ template.description }}

        Add Threads


text:
Are you sure to delete this item?

            <form ng-submit="deleteItemFromTimesheet(timesheetId,itemId)">

                <button type="submit" class="btn btn-warning btn-sm">YES</button>
                <button type="button" class="btn btn-default btn-sm" ng-click=cancelNgDialogue()>NO</button>
            </form>


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v10/resources/ad_group_simulation.proto

namespace Google\Ads\GoogleAds\V10\Resources;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * An ad group simulation. Supported combinations of advertising
 * channel type, simulation type and simulation modification method is
 * detailed below respectively.
 * 1. SEARCH - CPC_BID - DEFAULT
 * 2. SEARCH - CPC_BID - UNIFORM
 * 3. SEARCH - TARGET_CPA - UNIFORM
 * 4. SEARCH - TARGET_ROAS - UNIFORM
 * 5. DISPLAY - CPC_BID - DEFAULT
 * 6. DISPLAY - CPC_BID - UNIFORM
 * 7. DISPLAY - TARGET_CPA - UNIFORM
 *
 * Generated from protobuf message google.ads.googleads.v10.resources.AdGroupSimulation
 */
class AdGroupSimulation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name of the ad group simulation.
     * Ad group simulation resource names have the form:
     * `customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}`
     *
     * Generated from protobuf field string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
     */
    protected $resource_name = '';
    /**
     * Output only. Ad group id of the simulation.
     *
     * Generated from protobuf field optional int64 ad_group_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     */
    protected $ad_group_id = null;
    /**
     * Output only. The field that the simulation modifies.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationTypeEnum.SimulationType type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     */
    protected $type = 0;
    /**
     * Output only. How the simulation modifies the field.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationModificationMethodEnum.SimulationModificationMethod modification_method = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     */
    protected $modification_method = 0;
    /**
     * Output only. First day on which the simulation is based, in YYYY-MM-DD format.
     *
     * Generated from protobuf field optional string start_date = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     */
    protected $start_date = null;
    /**
     * Output only. Last day on which the simulation is based, in YYYY-MM-DD format
     *
     * Generated from protobuf field optional string end_date = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
     */
    protected $end_date = null;
    protected $point_list;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $resource_name
     *           Output only. The resource name of the ad group simulation.
     *           Ad group simulation resource names have the form:
     *           `customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}`
     *     @type int|string $ad_group_id
     *           Output only. Ad group id of the simulation.
     *     @type int $type
     *           Output only. The field that the simulation modifies.
     *     @type int $modification_method
     *           Output only. How the simulation modifies the field.
     *     @type string $start_date
     *           Output only. First day on which the simulation is based, in YYYY-MM-DD format.
     *     @type string $end_date
     *           Output only. Last day on which the simulation is based, in YYYY-MM-DD format
     *     @type \Google\Ads\GoogleAds\V10\Common\CpcBidSimulationPointList $cpc_bid_point_list
     *           Output only. Simulation points if the simulation type is CPC_BID.
     *     @type \Google\Ads\GoogleAds\V10\Common\CpvBidSimulationPointList $cpv_bid_point_list
     *           Output only. Simulation points if the simulation type is CPV_BID.
     *     @type \Google\Ads\GoogleAds\V10\Common\TargetCpaSimulationPointList $target_cpa_point_list
     *           Output only. Simulation points if the simulation type is TARGET_CPA.
     *     @type \Google\Ads\GoogleAds\V10\Common\TargetRoasSimulationPointList $target_roas_point_list
     *           Output only. Simulation points if the simulation type is TARGET_ROAS.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V10\Resources\AdGroupSimulation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name of the ad group simulation.
     * Ad group simulation resource names have the form:
     * `customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}`
     *
     * Generated from protobuf field string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
     * @return string
     */
    public function getResourceName()
    {
        return $this->resource_name;
    }

    /**
     * Output only. The resource name of the ad group simulation.
     * Ad group simulation resource names have the form:
     * `customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}`
     *
     * Generated from protobuf field string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
     * @param string $var
     * @return $this
     */
    public function setResourceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_name = $var;

        return $this;
    }

    /**
     * Output only. Ad group id of the simulation.
     *
     * Generated from protobuf field optional int64 ad_group_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return int|string
     */
    public function getAdGroupId()
    {
        return isset($this->ad_group_id) ? $this->ad_group_id : 0;
    }

    public function hasAdGroupId()
    {
        return isset($this->ad_group_id);
    }

    public function clearAdGroupId()
    {
        unset($this->ad_group_id);
    }

    /**
     * Output only. Ad group id of the simulation.
     *
     * Generated from protobuf field optional int64 ad_group_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param int|string $var
     * @return $this
     */
    public function setAdGroupId($var)
    {
        GPBUtil::checkInt64($var);
        $this->ad_group_id = $var;

        return $this;
    }

    /**
     * Output only. The field that the simulation modifies.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationTypeEnum.SimulationType type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Output only. The field that the simulation modifies.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationTypeEnum.SimulationType type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V10\Enums\SimulationTypeEnum\SimulationType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Output only. How the simulation modifies the field.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationModificationMethodEnum.SimulationModificationMethod modification_method = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return int
     */
    public function getModificationMethod()
    {
        return $this->modification_method;
    }

    /**
     * Output only. How the simulation modifies the field.
     *
     * Generated from protobuf field .google.ads.googleads.v10.enums.SimulationModificationMethodEnum.SimulationModificationMethod modification_method = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param int $var
     * @return $this
     */
    public function setModificationMethod($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V10\Enums\SimulationModificationMethodEnum\SimulationModificationMethod::class);
        $this->modification_method = $var;

        return $this;
    }

    /**
     * Output only. First day on which the simulation is based, in YYYY-MM-DD format.
     *
     * Generated from protobuf field optional string start_date = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return string
     */
    public function getStartDate()
    {
        return isset($this->start_date) ? $this->start_date : '';
    }

    public function hasStartDate()
    {
        return isset($this->start_date);
    }

    public function clearStartDate()
    {
        unset($this->start_date);
    }

    /**
     * Output only. First day on which the simulation is based, in YYYY-MM-DD format.
     *
     * Generated from protobuf field optional string start_date = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param string $var
     * @return $this
     */
    public function setStartDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->start_date = $var;

        return $this;
    }

    /**
     * Output only. Last day on which the simulation is based, in YYYY-MM-DD format
     *
     * Generated from protobuf field optional string end_date = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return string
     */
    public function getEndDate()
    {
        return isset($this->end_date) ? $this->end_date : '';
    }

    public function hasEndDate()
    {
        return isset($this->end_date);
    }

    public function clearEndDate()
    {
        unset($this->end_date);
    }

    /**
     * Output only. Last day on which the simulation is based, in YYYY-MM-DD format
     *
     * Generated from protobuf field optional string end_date = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param string $var
     * @return $this
     */
    public function setEndDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->end_date = $var;

        return $this;
    }

    /**
     * Output only. Simulation points if the simulation type is CPC_BID.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.CpcBidSimulationPointList cpc_bid_point_list = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return \Google\Ads\GoogleAds\V10\Common\CpcBidSimulationPointList|null
     */
    public function getCpcBidPointList()
    {
        return $this->readOneof(8);
    }

    public function hasCpcBidPointList()
    {
        return $this->hasOneof(8);
    }

    /**
     * Output only. Simulation points if the simulation type is CPC_BID.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.CpcBidSimulationPointList cpc_bid_point_list = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param \Google\Ads\GoogleAds\V10\Common\CpcBidSimulationPointList $var
     * @return $this
     */
    public function setCpcBidPointList($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V10\Common\CpcBidSimulationPointList::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Output only. Simulation points if the simulation type is CPV_BID.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.CpvBidSimulationPointList cpv_bid_point_list = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return \Google\Ads\GoogleAds\V10\Common\CpvBidSimulationPointList|null
     */
    public function getCpvBidPointList()
    {
        return $this->readOneof(10);
    }

    public function hasCpvBidPointList()
    {
        return $this->hasOneof(10);
    }

    /**
     * Output only. Simulation points if the simulation type is CPV_BID.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.CpvBidSimulationPointList cpv_bid_point_list = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param \Google\Ads\GoogleAds\V10\Common\CpvBidSimulationPointList $var
     * @return $this
     */
    public function setCpvBidPointList($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V10\Common\CpvBidSimulationPointList::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Output only. Simulation points if the simulation type is TARGET_CPA.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.TargetCpaSimulationPointList target_cpa_point_list = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return \Google\Ads\GoogleAds\V10\Common\TargetCpaSimulationPointList|null
     */
    public function getTargetCpaPointList()
    {
        return $this->readOneof(9);
    }

    public function hasTargetCpaPointList()
    {
        return $this->hasOneof(9);
    }

    /**
     * Output only. Simulation points if the simulation type is TARGET_CPA.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.TargetCpaSimulationPointList target_cpa_point_list = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param \Google\Ads\GoogleAds\V10\Common\TargetCpaSimulationPointList $var
     * @return $this
     */
    public function setTargetCpaPointList($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V10\Common\TargetCpaSimulationPointList::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Output only. Simulation points if the simulation type is TARGET_ROAS.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.TargetRoasSimulationPointList target_roas_point_list = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @return \Google\Ads\GoogleAds\V10\Common\TargetRoasSimulationPointList|null
     */
    public function getTargetRoasPointList()
    {
        return $this->readOneof(11);
    }

    public function hasTargetRoasPointList()
    {
        return $this->hasOneof(11);
    }

    /**
     * Output only. Simulation points if the simulation type is TARGET_ROAS.
     *
     * Generated from protobuf field .google.ads.googleads.v10.common.TargetRoasSimulationPointList target_roas_point_list = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * @param \Google\Ads\GoogleAds\V10\Common\TargetRoasSimulationPointList $var
     * @return $this
     */
    public function setTargetRoasPointList($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V10\Common\TargetRoasSimulationPointList::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getPointList()
    {
        return $this->whichOneof("point_list");
    }

}


text: Some of my more interesting solutions to problems found at codewars.com