text:
id: api
title: API
---

If you want to run Prettier programmatically, check this page out.

```js
const prettier = require("prettier");
```

## `prettier.format(source, options)`

`format` is used to format text using Prettier. `options.parser` must be set according to the language you are formatting (see the [list of available parsers](options.md#parser)). Alternatively, `options.filepath` can be specified for Prettier to infer the parser from the file extension. Other [options](options.md) may be provided to override the defaults.

```js
prettier.format("foo ( );", { semi: false, parser: "babel" });
// -> "foo()"
```

## `prettier.check(source [, options])`

`check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`. This is similar to the `--check` or `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.

## `prettier.formatWithCursor(source [, options])`

`formatWithCursor` both formats the code, and translates a cursor position from unformatted code to formatted code. This is useful for editor integrations, to prevent the cursor from moving when code is formatted.

The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`.

```js
prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
// -> { formatted: '1;\n', cursorOffset: 1 }
```

## `prettier.resolveConfig(filePath [, options])`

`resolveConfig` can be used to resolve configuration for a given source file, passing its path as the first argument. The config search will start at the file path and continue to search up the directory (you can use `process.cwd()` to start searching from the current directory). Or you can pass directly the path of the config file as `options.config` if you don't wish to search for it. A promise is returned which will resolve to:

- An options object, providing a [config file](configuration.md) was found.
- `null`, if no file was found.

The promise will be rejected if there was an error parsing the configuration file.

If `options.useCache` is `false`, all caching will be bypassed.

```js
const text = fs.readFileSync(filePath, "utf8");
prettier.resolveConfig(filePath).then((options) => {
  const formatted = prettier.format(text, options);
});
```

If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc. Currently, the following EditorConfig properties are supported:

- `end_of_line`
- `indent_style`
- `indent_size`/`tab_width`
- `max_line_length`

Use `prettier.resolveConfig.sync(filePath [, options])` if you'd like to use sync version.

## `prettier.resolveConfigFile([filePath])`

`resolveConfigFile` can be used to find the path of the Prettier configuration file that will be used when resolving the config (i.e. when calling `resolveConfig`). A promise is returned which will resolve to:

- The path of the configuration file.
- `null`, if no file was found.

The promise will be rejected if there was an error parsing the configuration file.

The search starts at `process.cwd()`, or at `filePath` if provided. Please see the [cosmiconfig docs](https://github.com/davidtheclark/cosmiconfig#explorersearch) for details on how the resolving works.

```js
prettier.resolveConfigFile(filePath).then((configFile) => {
  // you got the path of the configuration file
});
```

Use `prettier.resolveConfigFile.sync([filePath])` if you'd like to use sync version.

## `prettier.clearConfigCache()`

When Prettier loads configuration files and plugins, the file system structure is cached for performance. This function will clear the cache. Generally this is only needed for editor integrations that know that the file system has changed since the last format took place.

## `prettier.getFileInfo(filePath [, options])`

`getFileInfo` can be used by editor extensions to decide if a particular file needs to be formatted. This method returns a promise, which resolves to an object with the following properties:

```typescript
{
  ignored: boolean,
  inferredParser: string | null,
}
```

The promise will be rejected if the type of `filePath` is not `string`.

Setting `options.ignorePath` (`string`) and `options.withNodeModules` (`boolean`) influence the value of `ignored` (`false` by default).

If the given `filePath` is ignored, the `inferredParser` is always `null`.

Providing [plugin](plugins.md) paths in `options.plugins` (`string[]`) helps extract `inferredParser` for files that are not supported by Prettier core.

When setting `options.resolveConfig` (`boolean`, default `false`), Prettier will resolve the configuration for the given `filePath`. This is useful, for example, when the `inferredParser` might be overridden for a subset of files.

Use `prettier.getFileInfo.sync(filePath [, options])` if you'd like to use sync version.

## `prettier.getSupportInfo()`

Returns an object representing the options, parsers, languages and file types Prettier supports.

The support information looks like this:

```typescript
{
  languages: Array<{
    name: string,
    since?: string,
    parsers: string[],
    group?: string,
    tmScope?: string,
    aceMode?: string,
    codemirrorMode?: string,
    codemirrorMimeType?: string,
    aliases?: string[],
    extensions?: string[],
    filenames?: string[],
    linguistLanguageId?: number,
    vscodeLanguageIds?: string[],
  }>
}
```

## Custom Parser API

If you need to make modifications to the AST (such as codemods), or you want to provide an alternate parser, you can do so by setting the `parser` option to a function. The function signature of the parser function is:

```js
(text: string, parsers: object, options: object) => AST;
```

Prettier's built-in parsers are exposed as properties on the `parsers` argument.

```js
prettier.format("lodash ( )", {
  parser(text, { babel }) {
    const ast = babel(text);
    ast.program.body[0].expression.callee.name = "_";
    return ast;
  },
});
// -> "_();\n"
```

The `--parser` CLI option may be a path to a node.js module exporting a parse function.


text:
<?php
namespace Importer;

interface Parser extends \Iterator
{
    public function fetchNextLine();
}

redpajama_set_name: RedPajamaGithub


text:
package com.storage.test.milan.uitest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClick(View view) {
        EditText editText = (EditText) findViewById(R.id.inputField);
        switch (view.getId()) {
            case R.id.changeText:
                editText.setText("Lalala");
                break;
            case R.id.switchActivity:
                Intent intent = new Intent(this, SecondActivity.class);
                Log.i("testing: value1:" , editText.getText().toString());
                intent.putExtra("input", editText.getText().toString());
                startActivity(intent);
                break;
        }
    }
}


text:
package br.com.wicketlocadora.service.exception.reserva;

import java.util.Arrays;

import br.com.wicketlocadora.service.exception.NegocioException;

public class DataInicialMaiorQueFinalException extends NegocioException {

    private static final long serialVersionUID = -8376920325538924406L;

    public DataInicialMaiorQueFinalException() {
	super(Arrays.asList("Data inicial maior que a data final."));
    }

}


text:
//-------------
// version 1.1
// maj 11/2016
// by e-Coucou
//-------------
// 08/2017 try to add webhook !!
//
var express = require("express");
var path = require("path");
var bodyParser = require("body-parser");
var mongodb = require("mongodb");
var ObjectID = mongodb.ObjectID;

const util = require('util');
var http = require('http');

var CONTACTS_COLLECTION = "contacts";

var app = express();
app.use(express.static(__dirname + "/public"));
app.use(bodyParser.json());

// Create a database variable outside of the database connection callback to reuse the connection pool in your app.
var db;

// Connect to the database before starting the application server.
mongodb.MongoClient.connect(process.env.MONGODB_URI, function (err, database) {
  if (err) {
    console.log(err);
    process.exit(1);
  }

  // Save database object from the callback for reuse.
  db = database;
  console.log("Database connection ready");

  // Initialize the app.
  var server = app.listen(process.env.PORT || 8080, function () {
    var port = server.address().port;
    console.log("App now running on port", port);
  });
});

// CONTACTS API ROUTES BELOW

// Generic error handler used by all endpoints.
function handleError(res, reason, message, code) {
  console.log("ERROR: " + reason);
  res.status(code || 500).json({"error": message});
}

/*  "/contacts"
 *    GET: finds all contacts
 *    POST: creates a new contact
 */

app.get("/contacts", function(req, res) {
  db.collection(CONTACTS_COLLECTION).find({}).toArray(function(err, docs) {
    if (err) {
      handleError(res, err.message, "Failed to get contacts.");
    } else {
      res.status(200).json(docs);
    }
  });
});

app.post("/contacts", function(req, res) {
  var newContact = req.body;
  var d = new Date();
    newContact.date = d.toLocaleDateString();
    newContact.heure = d.toLocaleTimeString();

//toLocaleString().substring(0,9);

//  if (!(req.body.firstName || req.body.lastName)) {
//    handleError(res, "Invalid user input", "Must provide a first or last name.", 400);
//  }

  db.collection(CONTACTS_COLLECTION).insertOne(newContact, function(err, doc) {
    if (err) {
      handleError(res, err.message, "Failed to create new contact.");
    } else {
      res.status(201).json(doc.ops[0]);
    }
  });
});

//----------------------
// add scale value
//
// scale : name
// high / low
app.post("/api/v1/scale", function(req, res) {
    var newScale = req.body;

    db.collection(CONTACTS_COLLECTION).insertOne(newScale, function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to create new scale value.");
        } else {
        res.status(201).json(doc.ops[0]);
        }
    });
});

//------
// WebHook ?!
var obj = {
  "id": "id",
  "timestamp": "2017-02-09T15:38:26.548Z",
  "lang": "fr",
  "result": {
    "source": "agent",
    "resolvedQuery": "Population Test",
    "action": "complete",
    "actionIncomplete": false,
    "parameters": {},
    "contexts": [],
    "metadata": {
      "intentId": "9f41ef7c-82fa-42a7-9a30-49a93e2c14d0",
      "webhookUsed": "true",
      "webhookForSlotFillingUsed": "false",
      "intentName": "Population"
    },
    "fulfillment": {
      "speech": "Ca roule pour moi",
      "messages": [
        {
          "type": 0,
          "speech": "Ca roule pour moi"
        }
      ]
    },
    "score": 1
  },
  "status": {
    "code": 200,
    "errorType": "success"
  },
  "sessionId": "4b6a6779-b8ea-4094-b2ed-a302ba201815"
};
var reponse = { source : "Heroku server", speech : "xx", displayText : "xx" };
var text = "réponse";

app.post("/api/v1/webhook", function(req,res) {
	obj.id = req.body.id;
	obj.result.metadata.intentId = req.body.result.metadata.itentId;
	obj.sessionId = req.body.sessionId;
	console.log(req.body);
	console.log(Date.now())
	var pays = req.body.result.parameters.country;
	var annee = req.body.result.parameters.annee;
	var age = req.body.result.parameters.age;
	// on interroge le serveur de population.io
	apiResponse = http.get("http://api.population.io/1.0/population/" + annee + "/" + pays + "/" + age + "/?format=json", function (resp) {
		let body = [];
		resp.on("data", function(chunk) {
			body.push(chunk); });
		resp.on('end', function() {
			var result = JSON.parse(body.join(''))
			console.log(result[0]);
			text = util.format("Je connais la réponse concernant %s pour l'année %s et la catégorie d'age de %s ans. Sur un total de %s personnes il y a %s femmes et %s hommes",pays,annee,age,result[0].total,result[0].females,result[0].males);
			reponse.speech = text;
			reponse.displayText = text;
			res.setHeader('Content-Type', 'application/json'); //Requires application/json MIME type
			res.status(200).json(reponse); //try !
			console.log(reponse);  });
		}).on('error', function(e) {
			console.log("Got error: " + e.message);
			res.status(404).json({source : "Heroku server", speech : "No data found", displayText : "No data found " }); //try !
			});

});

/*  "/contacts/:id"
 *    GET: find contact by id
 *    PUT: update contact by id
 *    DELETE: deletes contact by id
 */

app.get("/contacts/:id", function(req, res) {
  db.collection(CONTACTS_COLLECTION).findOne({ _id: new ObjectID(req.params.id) }, function(err, doc) {
    if (err) {
      handleError(res, err.message, "Failed to get contact");
    } else {
      res.status(200).json(doc);
    }
  });
});

app.get("/api/v1/test/:name", function(req, res) {
    console.log("Param: " + req.params.name);
    db.collection(CONTACTS_COLLECTION).find({ name: req.params.name }).toArray( function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to list name");
        } else {
            res.status(200).json(doc);
        }
    });
});
//-----------------------------------------------
// API V1 -> SEARCH
//
app.get("/api/v1/search", function(req, res) {
    if (req.query.source == "*" || ( typeof req.query.source == 'undefined')) { source = { $regex: /\w|/, $options:"i"} } else { source = req.query.source }
    if (req.query.name == "*" || (typeof req.query.name == 'undefined')) { name = { $regex: /\w|/, $options:"i"} } else { name = req.query.name }
    if (typeof req.query.before == 'undefined') { before = ObjectID(Math.floor((new Date('2100/12/31'))/1000).toString(16) + "0000000000000000") } else { before = ObjectID(Math.floor((new Date(req.query.before))/1000 - 7200).toString(16) + "0000000000000000") }
    if (typeof req.query.after == 'undefined') { after = ObjectID(Math.floor((new Date('2016/01/01'))/1000).toString(16) + "0000000000000000") } else { after = ObjectID(Math.floor((new Date(req.query.after))/1000 - 7200).toString(16) + "0000000000000000") }
    if (typeof req.query.filtre == 'undefined') { filtre = {} } else { if (req.query.filtre == "name") { filtre = {name: 1, value:  1, _id: 0} } else {filtre = { value: 1 , _id: 0 } } }

	selection = { name: name, source: source , _id: {$lt: before, $gt: after}} ;

	console.log("before = "+before+"  after : "+after);

    db.collection(CONTACTS_COLLECTION).find( selection , filtre ).toArray( function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to find contact");
        } else {
            res.status(200).json(doc);
        }
    });
});
// /api/v1/scale
app.get("/api/v1/list/scale", function(req, res) {

    if (req.query.scale == "*" || ( typeof req.query.scale == 'undefined')) { scale = { $regex: /\w|/, $options:"i"} } else { scale = req.query.scale }

        selection = { scale : scale } ;

        db.collection(CONTACTS_COLLECTION).find( selection ).toArray( function(err, doc) {
            if (err) {
                handleError(res, err.message, "Failed to find scale");
            } else {
                res.status(200).json(doc);
            }
        });
    });
//----------------------------
// API for IOS
//
app.get("/api/v1/name", function(req, res) {
        db.collection(CONTACTS_COLLECTION).distinct( "name" , function(err, doc) {
            if (err) {
                handleError(res, err.message, "Failed to find name");
            } else {
                res.status(200).json(doc);
            }
    });
});

app.get("/api/v1/source", function(req, res) {
    db.collection(CONTACTS_COLLECTION).distinct( "source" , function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to find source");
        } else {
            res.status(200).json(doc);
        }
    });
});

app.get("/api/v1/date", function(req, res) {
    db.collection(CONTACTS_COLLECTION).distinct( "date" , function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to find date");
        } else {
            res.status(200).json(doc);
        }
    });
});

app.get("/api/v1/heure", function(req, res) {
    db.collection(CONTACTS_COLLECTION).distinct( "heure" , function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to find heure");
        } else {
            res.status(200).json(doc);
        }
    });
});
app.get("/api/v1/scale", function(req, res) {
    db.collection(CONTACTS_COLLECTION).distinct( "scale" , function(err, doc) {
        if (err) {
            handleError(res, err.message, "Failed to find scale value");
        } else {
        res.status(200).json(doc);
        }
    });
});

//--------xxxxx
app.put("/contacts/:id", function(req, res) {
  var updateDoc = req.body;
  delete updateDoc._id;

  db.collection(CONTACTS_COLLECTION).updateOne({_id: new ObjectID(req.params.id)}, updateDoc, function(err, doc) {
    if (err) {
      handleError(res, err.message, "Failed to update contact");
    } else {
      res.status(204).end();
    }
  });
});
//------------------------------------------------
// API delete
//
app.delete("/api/v1/id/:id", function(req, res) {
  db.collection(CONTACTS_COLLECTION).deleteOne({_id: new ObjectID(req.params.id)}, function(err, result) {
    if (err) {
      handleError(res, err.message, "Failed to delete contact");
    } else {
      res.status(204).end();
    }
  });
});

app.delete("/api/v1/name/:name", function(req, res) {
    db.collection(CONTACTS_COLLECTION).deleteMany({ name: req.params.name}, function(err, result) {
        if (err) {
            handleError(res, err.message, "Failed to delete contact");
        } else {
            res.status(204).end();
        }
    });
});

app.delete("/api/v1/source/:source", function(req, res) {
    db.collection(CONTACTS_COLLECTION).deleteMany({ source: req.params.source }, function(err, result) {
        if (err) {
            handleError(res, err.message, "Failed to delete contact");
        } else {
            res.status(204).end();
        }
    });
});
// delete with value and name
app.delete("/api/v1/valeur", function(req, res) {

  console.log("before = "+req.query.max+"  after : "+req.query.min);
  selection = { name: req.query.name, value: req.query.max } ;
//  selection = { name: req.query.name, value: {$lt: req.query.min, $gt: req.query.max}} ;

    db.collection(CONTACTS_COLLECTION).deleteMany( selection , function(err, result) {
        if (err) {
            handleError(res, err.message, "Failed to delete contact");
        } else {
            res.status(204).end();
        }
    });
});


text:
namespace IxMilia.Step.Tokens
{
    internal enum StepTokenKind
    {
        Semicolon,
        Omitted,
        Integer,
        Real,
        String,
        ConstantInstance,
        ConstantValue,
        EntityInstance,
        InstanceValue,
        Enumeration,
        LeftParen,
        RightParen,
        Comma,
        Equals,
        Asterisk,
        Keyword
    }
}


text:
function cf = cfX_Exponential(t,lambda,coef,niid)
%% cfX_Exponential
%  Characteristic function of the EXPONENTIAL distribution with the rate
%  parameter lambda > 0.
%
%  cfX_Exponential is an ALIAS NAME of the more general function
%  cf_Exponential, used to evaluate the characteristic function of a linear
%  combination of independent EXPONENTIAL distributed random variables.
%
%  The characteristic function of the EXPONENTIAL distribution is
%   cf(t) = lambda / (lambda - 1i*t)
%
% SYNTAX:
%  cf = cfX_Exponential(t,lambda)
%  cf = cfX_Exponential(t,lambda,coef,niid)
%
% INPUTS:
%  t      - vector or array of real values, where the CF is evaluated.
%  lambda - vector of the 'rate' parameters lambda > 0. If empty, default
%           value is lambda = 1.
%  coef  - vector of the coefficients of the linear combination of the
%          Beta distributed random variables. If coef is scalar, it is
%          assumed that all coefficients are equal. If empty, default value
%          is coef = 1.
%  niid  - scalar convolution coeficient niid, such that Z = Y + ... + Y is
%          sum of niid iid random variables Y, where each Y = sum_{i=1}^N
%          coef(i) * X_i is independently and identically distributed
%          random variable. If empty, default value is niid = 1.
%
% WIKIPEDIA:
%  https://en.wikipedia.org/wiki/Exponential_distribution.
%
% EXAMPLE 1:
%  % CF of the Exponential distribution with lambda = 5
%  lambda = 5;
%  t = linspace(-50,50,501);
%  cf = cfX_Exponential(t,lambda);
%  figure; plot(t,real(cf),t,imag(cf)),grid
%  title('CF of the Exponential distribution with lambda = 5')
%
% EXAMPLE 2:
%  % PDF/CDF of the Exponential distribution with lambda = 5
%  lambda = 5;
%  cf = @(t) cfX_Exponential(t,lambda);
%  x  = linspace(0,1.5,101);
%  clear options
%  options.xMin = 0;
%  options.SixSigmaRule = 8;
%  result = cf2DistGP(cf,x,[],options)
%
% EXAMPLE 3:
% % PDF/CDF of the compound Binomial-Exponential distribution
%  n = 25;
%  p = 0.3;
%  lambda = 5;
%  cfX  = @(t) cfX_Exponential(t,lambda);
%  cf   = @(t) cfN_Binomial(t,n,p,cfX);
%  x    = linspace(0,5,101);
%  prob = [0.9 0.95 0.99];
%  clear options
%  options.isCompound = true;
%  result = cf2DistGP(cf,x,prob,options)

% (c) 2017 Viktor Witkovsky (witkovsky@gmail.com)
% Ver.: 24-Jun-2017 10:07:43
% Rev.: 28-Apr-2020 13:47:42

%% ALGORITHM
narginchk(1, 4);
if nargin < 4, niid = []; end
if nargin < 3, coef = []; end
if nargin < 2, lambda = []; end

cf = cf_Exponential(t,lambda,coef,niid);

end


text:
@interface YPRecommendUserCell()

@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;

@property (weak, nonatomic) IBOutlet UILabel *screen_NameView;

@property (weak, nonatomic) IBOutlet UILabel *fans_CountView;

@end

@implementation YPRecommendUserCell

-(void)setUser:(YPRecommendUser *)user{

    _user = user;

    self.screen_NameView.text = user.screen_name;
    NSString * fansCount = nil;
    if (user.fans_count < 10000) {
        fansCount = [NSString stringWithFormat:@"%zd人订阅",user.fans_count];
    }else{ //订阅人数大于1万

        fansCount = [NSString stringWithFormat:@"%.1f万人订阅",user.fans_count / 10000.0];

    }
    self.fans_CountView.text = fansCount;
//    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:user.header] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
    [self.headerImageView setHeader:user.header];

}

@end


text:
package org.danyuan.application.resume.modal.service;

import org.danyuan.application.common.base.BaseService;
import org.danyuan.application.common.base.BaseServiceImpl;
import org.danyuan.application.resume.modal.po.SysModalInfo;
import org.springframework.stereotype.Service;

/**
 * @文件名 SysModalInfoService.java
 * @包名 org.danyuan.application.resume.modal.service
 * @描述 service层
 * @时间 2019年02月28日 17:42:26
 * @author test
 * @版本 V1.0
 */
@Service
public class SysModalInfoService extends BaseServiceImpl<SysModalInfo> implements BaseService<SysModalInfo> {

}


text:
package foo.ipojo;

/**
 * Creates a simple annotation to create the processing of matching
 * annotations
 */
public @interface IPOJOFoo {
    String bar();
}


text:
package dagger.functional.producers.fluentfuture;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.util.concurrent.Futures.immediateFuture;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;

import com.google.common.util.concurrent.FluentFuture;
import dagger.functional.producers.fluentfuture.FluentFutures.Component;
import dagger.functional.producers.fluentfuture.FluentFutures.Dependency;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class FluentFuturesTest {

  @Test
  public void testFluentFutures() throws Exception {
    Component component =
        DaggerFluentFutures_Component.builder()
            .executor(directExecutor())
            .dependency(
                new Dependency() {
                  @Override
                  public FluentFuture<Float> floatFuture() {
                    return FluentFuture.from(immediateFuture(42.0f));
                  }
                })
            .build();
    assertThat(component.string().isDone()).isTrue();
    assertThat(component.string().get()).isEqualTo("hello");
    assertThat(component.setOfDouble().isDone()).isTrue();
    assertThat(component.setOfDouble().get()).containsExactly(5.0, 6.0, 7.0, 42.0);
  }
}


text:
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { AllClustersGroupings } from './AllClustersGroupings';

export const CLUSTER_ALLCLUSTERSGROUPINGS = 'core.cluster.allclustergroupings';
module(CLUSTER_ALLCLUSTERSGROUPINGS, []).component(
  'allClustersGroupings',
  react2angular(AllClustersGroupings, ['app', 'initialized']),
);


text:
#= Imports
import json
import urllib2

class LottosendSDK:
	#= Contrusctor
	def __init__(self):
		self.token = ''
		self.lottosend_api = ''
		self.results_api = ''
		self.auto_login_url = ''

	# signup user in lottosend system
	def signupViaApi(self,first_name, last_name, prefix, phone, email, address, country, passwd, a_aid):
		params = dict()
		params = {
			'web_user': {
				'email': email,
				'first_name': first_name,
				'last_name': last_name,
				'phone': phone,
				'password': passwd,
				'country': country,
				'address': address,
				'aid': a_aid
			}
		}
		req = urllib2.Request(self.lottosend_api,
            headers = {
                "Authorization": 'Token token=%s' % self.token,
                "Content-Type": "application/json",
                "Accept": "*/*"
        	}, data = json.dumps(params))
		return urllib2.urlopen(req).read()

	# obtain user token to resign-in
	def obtainToken(self,id):
		req = urllib2.Request('%s/%s/token'%(self.lottosend_api,id),
            headers = {
                "Authorization": 'Token token=%s' % self.token,
                "Content-Type": "application/json",
                "Accept": "*/*"
        	})

		return urllib2.urlopen(req).read()

	# get all user info
	def getUsersInfo(self):
		req = urllib2.Request('%s/?last_synced_timestamp=1'%self.lottosend_api,
            headers = {
                "Authorization": 'Token token=%s' % self.token,
                "Content-Type": "application/json",
                "Accept": "*/*"
        	})
		return urllib2.urlopen(req).read()

	# get user transactions
	def getUsersTransactions(self):
		req = urllib2.Request('%s/transactions/?last_synced_timestamp=1'%self.lottosend_api,
            headers = {
                "Authorization": 'Token token=%s' % self.token,
                "Content-Type": "application/json",
                "Accept": "*/*"
        	})
		return urllib2.urlopen(req).read()


text:
{
  return el.for !== undefined || el.tag === "template" || el.tag === "slot";
}


text:
#include "tensorflow/dtensor/mlir/expansions/segmentation_spmd_expander.h"

#include <string>

#include "absl/container/flat_hash_set.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.h"
#include "tensorflow/dtensor/cc/dstatus.h"
#include "tensorflow/dtensor/cc/tensor_layout.h"
#include "tensorflow/dtensor/mlir/collectives.h"
#include "tensorflow/dtensor/mlir/layout_parsing.h"
#include "tensorflow/dtensor/mlir/shape_utils.h"
#include "tensorflow/dtensor/mlir/spmd_expander_common.h"
#include "tensorflow/dtensor/mlir/value_utils.h"

namespace tensorflow {
namespace dtensor {

StatusOr<llvm::DenseMap<int, Layout>>
UnsortedSegmentSumSPMDExpander::ComputeLayoutForward(
    mlir::Operation* op, const llvm::DenseMap<int, Layout>& input_layouts) {
  TF_ASSIGN_OR_RETURN(const auto mesh, ExtractDeviceMeshEnclosingCluster(op));
  auto unsorted_segmented_sum = llvm::cast<mlir::TF::UnsortedSegmentSumOp>(op);
  const int output_rank = ValueRank(unsorted_segmented_sum.output());
  if (input_layouts.find(0) != input_layouts.end()) {
    // If the data layout exists, we can use it to forward propagate a layout
    // to the output.
    const int segment_ids_rank =
        ValueRank(unsorted_segmented_sum.segment_ids());

    return llvm::DenseMap<int, Layout>(
        {{0, input_layouts.lookup(0)
                 .Truncate(segment_ids_rank, /*end=*/true)
                 .LeftPad(output_rank)}});
  }

  // When we don't have a data layout we can only output a replicated layout.
  return llvm::DenseMap<int, Layout>(
      {{0, Layout::ReplicatedOnMesh(mesh, output_rank)}});
}

StatusOr<llvm::DenseMap<int, Layout>>
UnsortedSegmentSumSPMDExpander::ComputeLayoutBackward(
    mlir::Operation* op, const llvm::DenseMap<int, Layout>& output_layouts) {
  TF_ASSIGN_OR_RETURN(const auto mesh, ExtractDeviceMeshEnclosingCluster(op));
  auto unsorted_segmented_sum = llvm::cast<mlir::TF::UnsortedSegmentSumOp>(op);

  Layout segment_ids_layout =
      Layout::ReplicatedOnMesh(mesh, ValueRank(op->getOperand(1)));
  Layout num_segments_layout = Layout::ReplicatedOnMesh(mesh, /*rank=*/0);
  if (!output_layouts.empty()) {
    // If we have an output layout, we can send it backwards to the last few
    // dimension
    const int data_rank = ValueRank(unsorted_segmented_sum.data());
    return llvm::DenseMap<int, Layout>({{0, output_layouts.lookup(0)
                                                .Truncate(1, /*end=*/true)
                                                .LeftPad(data_rank)},
                                        {1, segment_ids_layout},
                                        {2, num_segments_layout}});
  }
  return llvm::DenseMap<int, Layout>(
      {{0, Layout::ReplicatedOnMesh(
               mesh, /*rank=*/ValueRank(unsorted_segmented_sum.data()))},
       {1, segment_ids_layout},
       {2, num_segments_layout}});
}

StatusOr<mlir::Operation*> UnsortedSegmentSumSPMDExpander::ExpandOp(
    mlir::Operation* op) {
  // The algorithm is simple
  //
  // 1. Relayout segment_ids to match the layout of data[:rank(segment_ids)].
  //    An improved version of this would merge the layouts of segment_ids and
  //    data into a common layout (e.g. data with layout [x,*,*,*] and
  //    segment_ids with layout [*,y] would result in [x,y,*,*] and [x,y].
  // 2. Emit a local UnsortedSegmentSum.
  // 3. Emit an AllReduce on the output.
  // 4. Emit a Relayout to the output layout.

  auto sum_op = mlir::cast<mlir::TF::UnsortedSegmentSumOp>(op);
  mlir::Value data = sum_op.data();
  mlir::Value segment_ids = sum_op.segment_ids();

  TF_ASSIGN_OR_RETURN(Layout data_layout,
                      ExtractRequiredLayoutFromOperand(data));
  TF_ASSIGN_OR_RETURN(Layout segment_ids_layout,
                      ExtractRequiredLayoutFromOperand(segment_ids));

  const int data_rank = data_layout.rank();
  const int segment_ids_rank = segment_ids_layout.rank();

  Layout new_segment_ids_layout = data_layout.Truncate(segment_ids_rank);

  absl::flat_hash_set<std::string> reduce_dimensions;
  for (int i = 0; i < segment_ids_rank; i++)
    if (new_segment_ids_layout.sharding_spec(i) != Layout::kUnshardedDim)
      reduce_dimensions.insert(new_segment_ids_layout.sharding_spec(i));

  TF_ASSIGN_OR_RETURN(
      mlir::Value new_segment_ids,
      EmitRelayout(segment_ids, segment_ids_layout, new_segment_ids_layout));

  mlir::OpBuilder builder(op);
  mlir::Operation* new_sum_op = builder.create<mlir::TF::UnsortedSegmentSumOp>(
      op->getLoc(), sum_op.output().getType(), data, new_segment_ids,
      sum_op.num_segments());

  InferSPMDExpandedLocalShape(new_sum_op);

  Layout result_output_layout =
      data_layout.Truncate(segment_ids_rank, /*end=*/true)
          .LeftPad(data_rank - segment_ids_rank + 1);  // This is output rank.

  TF_ASSIGN_OR_RETURN(
      new_sum_op, EmitAllReduce(builder, result_output_layout,
                                reduce_dimensions, new_sum_op, kReduceOpAdd));

  // Transform the result to the expected output_layout, if necessary.
  TF_ASSIGN_OR_RETURN(Layout output_layout,
                      ExtractRequiredSingleLayoutFromOp(op));
  TF_ASSIGN_OR_RETURN(mlir::Value final_output,
                      EmitRelayout(new_sum_op->getResult(0),
                                   result_output_layout, output_layout));
  op->getResult(0).replaceAllUsesWith(final_output);
  op->erase();

  return final_output.getDefiningOp();
}

}  // namespace dtensor
}  // namespace tensorflow


text:
package se.mah.c3larra;

import java.awt.BorderLayout;

import java.awt.EventQueue;
import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;

public class AnimalGUI extends JFrame {

	public ArrayList<Animal> allAnimals = new ArrayList<Animal>();

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AnimalGUI frame = new AnimalGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AnimalGUI() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 550, 309);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(6, 6, 463, 275);
		contentPane.add(scrollPane);

		JTextArea textArea = new JTextArea();
		scrollPane.setViewportView(textArea);

		Animal Cat1 = new Cat("lynx", 6, 9);
		allAnimals.add(Cat1);
		Animal Cat2 = new Cat("lynxlynx", 6, 9);
		allAnimals.add(Cat2);
		Animal Dog1 = new Dog("dogomium", 8, true, "Bosse");
		allAnimals.add(Dog1);
		Animal Dog2 = new Dog("hundomium", 8, false);
		allAnimals.add(Dog2);
		Animal Snake1 = new Snake("ormares", true);
		allAnimals.add(Snake1);
		Animal Snake2 = new Snake("nagini", false);
		allAnimals.add(Snake2);

		for (Animal animals : allAnimals) {
			System.out.println(animals.getInfo());
			textArea.append(animals.getInfo());
		}
	}

}


text:
require 'spec_helper'

describe CMSScanner::Finders::InterestingFile::RobotsTxt do
  subject(:finder) { described_class.new(target) }
  let(:target)     { CMSScanner::Target.new(url) }
  let(:url)        { 'http://example.com/' }
  let(:robots_txt) { url + 'robots.txt' }
  let(:fixtures)   { File.join(FIXTURES, 'interesting_files', 'robots_txt') }

  describe '#url' do
    its(:url) { should eq robots_txt }
  end

  describe '#aggressive' do
    after do
      stub_request(:get, robots_txt).to_return(status: status, body: body)

      result = finder.aggressive

      expect(result).to be_a CMSScanner::RobotsTxt if @expected
      expect(finder.aggressive).to eql @expected
    end

    let(:body) { '' }

    context 'when 404' do
      let(:status) { 404 }

      it 'returns nil' do
        @expected = nil
      end
    end

    context 'when 200' do
      let(:status) { 200 }

      context 'when the body is empty' do
        it 'returns nil' do
          @expected = nil
        end
      end

      context 'when the body matches a robots.txt' do
        let(:body) { File.new(File.join(fixtures, 'robots.txt')).read }

        it 'returns the InterestingFile result' do
          @expected = CMSScanner::RobotsTxt.new(robots_txt,
                                                confidence: 100,
                                                found_by: 'Robots Txt (Aggressive Detection)')
        end
      end
    end
  end
end


text:
Squash Client Library: Ruby
===========================

This client library reports exceptions to Squash, the Squarish exception
reporting and management system.

[![Build Status](https://travis-ci.org/SquareSquash/ruby.png)](https://travis-ci.org/SquareSquash/ruby)

Documentation
-------------

Comprehensive documentation is written in YARD- and Markdown-formatted comments
throughout the source. To view this documentation as an HTML site, run
`rake doc`.

For an overview of the various components of Squash, see the website
documentation at https://github.com/SquareSquash/web.

Compatibility
-------------

This library is compatible with Ruby 1.9.2 and later, including JRuby.

Requirements
------------

The only dependency is the `json` gem (http://rubygems.org/gems/json). You can use
any JSON gem that conforms to the typical standard (`require 'json';
object.to_json`).

Usage
-----

Add the Squash client to your Gemfile with
`gem 'squash_ruby'`. Before you can use Squash, you must configure it (see
**Configuration** below). At a minimum, you must specify the API host and which
project you are recording exceptions for:

```` ruby
Squash::Ruby.configure api_key: 'YOUR_API_KEY',
                       api_host: 'https://your.squash.host',
                       environment: 'production'
````

To use Squash to manage your exceptions, place a `begin::rescue` statement at
the highest level of your code. Inside the `rescue` block, make a call to
{Squash::Ruby.notify} with the exception. In general, you probably want to
rescue all subclasses of `Object`, so you catch every possible exception.
Example:

```` ruby
begin
  all_of_your_code
rescue Object => err
  Squash::Ruby.notify err
  raise
end
````

In this example the exception is re-raised to take advantage of Ruby's typical
last-resort exception handling as well.

There are many additional features you can take advantage of; see **Additional
Features** below.

### Additional Features

There are a number of other features you can take advantage of to help you debug
your exceptions:

#### User Data

Exceptions can be annotated with freeform user data. This data can take any
format and have any meaning, typically being relevant to the exception at hand.
This is in fact the system that `squash_rails` uses to annotate an exception
with information about the Rails request.

There are multiple ways to add user data to an exception. By default, user data
is culled from any instance variables set in the exception. This means that for
those exceptions that store additional information in instance variables, you
get user data "for free." An example is the `ActiveRecord::RecordInvalid`
exception, which stores the invalid record as an instance variable.

You can also add user data using the {Squash::Ruby.add_user_data} method:

```` ruby
input = gets
Squash::Ruby.add_user_data(input: input) do
  process_input # may raise an exception
end
````

And lastly, if you require `squash/ruby/exception_additions`, you can add user
data directly in the exception constructor:

```` ruby
require 'squash/ruby/exception_additions'

def process_value(value)
  raise ArgumentError.new("value must be a number", value: value) unless value.kind_of?(Fixnum)
  # [...]
end
````

Requiring that file also lets you add user data to exceptions you catch and
re-raise:

```` ruby
require 'squash/ruby/exception_additions'

begin
  do_something_with_input(input)
rescue ArgumentError => err
  err.user_data input: input
  raise # assumed that Squash::Ruby.notify is called somewhere further up in the stack
end
````

If monkey-patching doesn't appeal to you, then don't load
`squash/ruby/exception_additions`; it's not required for the client to work.

#### Ignoring Exceptions

You can ignore certain exceptions within a block of code if those exceptions are
not worth sending to Squash. Use the {Squash::Ruby.ignore_exceptions} method:

```` ruby
Squash::Ruby.ignore_exceptions(SocketError, Net::HTTPError) do
  some_http_code_that_could_fail
end
````

The exceptions _will_ be raised (not eaten) but will _not_ be reported to
Squash.

You can also globally ignore exceptions using the `ignored_exceptions`
configuration; see **Configuration** below.

Configuration
-------------

You can configure the client with the {Squash::Ruby.configure} method. Calling
this method multiple times will merge new values in with the existing
configuration. The method takes a hash, which accepts the following (symbol)
keys:

### General

* `disabled`: If `true`, the Squash client will not report any errors.
* `api_key`: The API key of the project that exceptions will be associated with.
  This configuration option is required. The value can be found by going to the
  project's home page on Squash.
* `environment`: The environment that exceptions will be associated with.
* `project_root`: The path to your project's root directory. This path will be
  stripped from backtrace lines. By default it's set to the working directory.
* `mirrored_repository`: Set this option to be true if your repository root is a
  mirrored Git repository.
* `exception_behavior_when_disabled`: Set this option to customize Squash's
  behavior when an exception is raised in an environment where Squash is
  disabled (typically development and test). Values are `ignore` (default):
  exception is ignored; `raise`: exception is raised; and `log`: exception is
  logged at the error level to the failsafe log.

### Revision Information

Squash can determine the current code revision using one of two methods. Specify
only one of the following configuration keys:

* `revision_file`: The path to a file storing the SHA1 of the current Git
  revision. This is the revision of the code that is currently running.
* `revision`: The 40-character SHA1 of the current deployed revision.
* `repository_root`: The path to the working directory of the Git repository
  that is currently running. Use this option if your deployed code is a working
  Git repository.

By default, `repository_root` is assumed and is set to `Dir.getwd`. Other
options override `repository_root`.

### Error Transmission

* `api_host`: The host on which Squash is running. This field is required.
* `notify_path`: The path to post new exception notifications to. By default
  it's set to `/api/1.0/notify`.
* `transmit_timeout`: The amount of time to wait before giving up on trasmitting
  an error. By default this is treated as both an open and a read timeout.
* `max_variable_size`: The maximum size (in bytes) of a serialized
  representation of a value that will be transmitted over the network. Values
  that serialize to larger than this size will be replaced with a placeholder.
* `timeout_protection`: a `proc { |timeout, &block| ... }` that runs the given
  block, and times out after `timeout` seconds.  By default this will use
  `SystemTimer` if present, or else the built in `Timeout` class, but can be
  overridden to provide more fine grain logic around timeouts.

### Ignored Exceptions

* `ignored_exception_classes`: An array of exception class names that will not
  be reported to Squash.
* `ignored_exception_messages`: A hash mapping an exception class name to an
  array of regexes. Exceptions of that class whose messages match a regex in the
  list will not be reported to Squash.
* `ignored_exception_procs`: An array of `Proc` objects that can be used to
  filter exceptions. Takes as arguments 1) the exception and 2) the user data
  hash. Should return `true` if the exception should be ignored (_not_ reported)
  and false otherwise. The user data hash can include stuff useful to extended
  client libraries (e.g., Squash Rails client); an example:

```` ruby
Squash::Ruby.configure ignored_exception_procs: lambda do |exception, user_data|
  exception.kind_of?(ActiveRecord::RecordNotFound) && user_data[:headers]['X-Testing'].blank?
end
````

### Failsafe Reporting

* `failsafe_log`: The pathname of a log file where failsafe exceptions will be
  recorded (see **Failsafe Reporting** below). By default, records to a file
  named `squash.failsafe.log` in the current working directory.
* `disable_failsafe`: If `true`, the failsafe handler will be disabled.
  Exceptions raised when Squash is processing another exception will be handled
  normally by the Ruby interpreter.

Error Transmission
------------------

Exceptions are transmitted to Squash using JSON-over-HTTPS. A default API
endpoint is pre-configured, though you can always set your own (see
**Configuration** above).

By default, `Net::HTTP` is used to transmit errors to the API server. If you
would prefer to use your own HTTP library, you can override the
{Squash::Ruby.http_transmit} method. This method is also used for deploy
notification.

Failsafe Reporting
------------------

In the event that the Squash client itself raises an exception when processing
an exception, it will log that exception to the failsafe log. (See the
`failsafe_log` configuration option, described above.) Both the original
exception and the failsafe error will be logged. The original exception will
still be re-raised, but the failsafe error will be "eaten."

If for some reason the exceptions cannot be logged (e.g., a permissions error),
they will be logged to standard error.

It would behoove the engineers of a project using Squash to periodically check
the failsafe log, as it may contain exceptions that couldn't be reported due
to, e.g., bugs in generating user data.


text:
"""
Copyright (c) 2012 - 2015, Ernesto Ruge
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

from flask.ext.script import Manager

from webapp import app
from webapp import util
from scripts import init_webapp as init_webapp_script
from scripts import osm_import as osm_import_script
from scripts import osm_import_es as osm_import_es_script

manager = Manager(app)

@manager.command
def init():
  init_webapp_script.run()

@manager.command
def verify_created_modified():
  util.verify_created_modified()

@manager.command
def osm_import(city_id):
  osm_import_script.run(city_id)

@manager.command
def osm_import_es():
  osm_import_es_script.run()

if __name__ == "__main__":
  manager.run()


text:
@class EasyTimeline;

typedef void (^timelineCompletionBlock)(EasyTimeline *timeline);
typedef void (^timelineTickBlock)(NSTimeInterval time, EasyTimeline *timeline);

@protocol EasyTimelineDelegate <NSObject>

@optional

- (void)tickAt:(NSTimeInterval)time forTimeline:(EasyTimeline *)timeline;
- (void)finishedTimeLine:(EasyTimeline *)timeline;

@end

@interface EasyTimeline : NSObject
{
	NSTimer *_mainTimer;
	NSTimer *_tickTimer;

	NSTimeInterval _startTime;
	NSTimeInterval _pausedTime;

	NSMutableArray *_events;
	NSMutableArray *_eventTimers;

	NSInteger _loop;

	__weak id <EasyTimelineDelegate> _delegate;
}

@property (weak, nonatomic) id <EasyTimelineDelegate> delegate;

#pragma mark Easy Timeline Properties

@property (nonatomic, assign) NSTimeInterval duration;
@property (nonatomic, assign) BOOL willLoop; // Default to NO
@property (nonatomic, assign) NSTimeInterval tickPeriod; // This is the period (in seconds) in which tickFortimeline: will be called, this can be changed on the fly
@property (nonatomic, readonly) NSArray *events;
@property (nonatomic, copy) timelineCompletionBlock completionBlock;
@property (nonatomic, copy) timelineTickBlock tickBlock;

#pragma mark Easy Timeline Status

@property (nonatomic, readonly) NSTimeInterval currentTime;
@property (nonatomic, readonly) NSInteger currentLoopCount;
@property (nonatomic, readonly) BOOL isRunning;
@property (nonatomic, readonly) BOOL hasStarted;

#pragma mark Easy Timeline Controllers

- (void)start;
- (void)pause;
- (void)resume;
- (void)stop;
- (void)skipForwardSeconds:(NSTimeInterval)seconds;
- (void)clear;

#pragma mark Easy Timeline Events

// Adding or removing events while timeline is running won't work
- (void)addEvent:(EasyTimelineEvent *)event;
- (void)removeEvent:(EasyTimelineEvent *)event;

@end


text:
package com.google.zxing.client.result;

import com.google.zxing.Result;

import java.util.Map;

/**
 * Represents a result that encodes an e-mail address, either as a plain address
 * like "joe@example.org" or a mailto: URL like "mailto:joe@example.org".
 *
 * @author Sean Owen
 */
public final class EmailAddressResultParser extends ResultParser {

  @Override
  public EmailAddressParsedResult parse(Result result) {
    String rawText = getMassagedText(result);
    String emailAddress;
    if (rawText.startsWith("mailto:") || rawText.startsWith("MAILTO:")) {
      // If it starts with mailto:, assume it is definitely trying to be an email address
      emailAddress = rawText.substring(7);
      int queryStart = emailAddress.indexOf('?');
      if (queryStart >= 0) {
        emailAddress = emailAddress.substring(0, queryStart);
      }
      Map<String,String> nameValues = parseNameValuePairs(rawText);
      String subject = null;
      String body = null;
      if (nameValues != null) {
        if (emailAddress.length() == 0) {
          emailAddress = nameValues.get("to");
        }
        subject = nameValues.get("subject");
        body = nameValues.get("body");
      }
      return new EmailAddressParsedResult(emailAddress, subject, body, rawText);
    } else {
      if (!EmailDoCoMoResultParser.isBasicallyValidEmailAddress(rawText)) {
        return null;
      }
      emailAddress = rawText;
      return new EmailAddressParsedResult(emailAddress, null, null, "mailto:" + emailAddress);
    }
  }

}