query stringlengths 10 8.11k | document stringlengths 17 398k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Optional. The filter applied to the endpoints of the resolved service. If no filter is specified, all endpoints will be considered. An endpoint will be chosen arbitrarily from the filtered list for each request. For endpoint filter syntax and examples, see Generated from protobuf field string endpoint_filter = 2 [(.goo... | public function setEndpointFilter($var)
{
GPBUtil::checkString($var, True);
$this->endpoint_filter = $var;
return $this;
} | [
"public function setEndpoint($var)\n {\n GPBUtil::checkString($var, True);\n $this->endpoint = $var;\n\n return $this;\n }",
"public function add_endpoints() {\n $mask = $this->get_endpoints_mask();\n \n foreach ( $this->get_query_vars() as $key => $var ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get albums by short description | public function getAlbumsByTitle($description) {
$success = $this->_db->query("SELECT * FROM albums WHERE album_description LIKE%'$description'%");
if ($success) {
$albums = [];
while ($row = $success->fetch_assoc()) {
$albums[] = $row;
}
... | [
"public function getAlbumsByDescription($longdescription) {\n $success = $this->_db->query(\"SELECT * FROM albums WHERE album_long_description LIKE %'$longdescription'% \");\n\n if ($success) {\n $albums = [];\n while ($row = $success->fetch_assoc()) {\n $albums[] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of all updatable instances of this package. | public function getUpdatableInstances() {
$packages = $this->getDuplicates();
$updatable = array();
$newVersion = $this->packageInfo['version'];
foreach ($packages as $package) {
if (Package::compareVersion($newVersion, $package['packageVersion']) == 1) {
$updatable[$package['packageID']] = $package;
... | [
"public function getUpdatesList()\n {\n return $this->updates;\n }",
"public function getUpdatedByIds() {\n\t\treturn $this->updatedByIds;\n\t}",
"protected function getPackagesToUpdate() {\n return $this->packagesToUpdate;\n }",
"public function getUpdatableProperties(): Updatabl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to get the real error code from the $report array of GeneralUtility::getURL() | protected function getErrorCode($report)
{
$message = $report['message'];
$errorCode = $report['error'];
if (strstr($message, '404')) {
$errorCode = '404';
} else {
if (strstr($message, '501')) {
$errorCode = '501';
} else {
... | [
"public function get_error_code();",
"abstract protected function getErrorURL();",
"public function getCode(){\n return $this -> file['error'];\n }",
"public function get_error_codes() {}",
"public function getErrorNumber()\n {\n return curl_errno($this->handle);\n }",
"public funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tests the value update tracing | public function testValueUpdateTracing()
{
if (version_compare(PHP_VERSION, '5.2') < 0) {
// Skip next tests for PHP versions before 5.2
return;
}
$memoryManager = new Zend_Memory_Manager_Dummy();
$memObject = new Zend_Memory_Container_Movable($memoryManager,... | [
"abstract protected function updateValue();",
"public function testV1UpdateVaration()\n {\n\n }",
"public function testElementUpdate()\r\n {\r\n\r\n }",
"public function test_updateQuickAdjustment() {\n\n }",
"public function testPointUpdate()\r\n {\r\n\r\n }",
"public function testUp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add comment to country | public function storeComment($country_id,Request $request){
$request->validate([
'comment' => 'required'
]);
$country = Country::findOrFail($country_id);
$comment = $country->comments()->create([
'comment' => $request->comment,
]);
return response()->json(['comment'... | [
"function addComment($comment) {\n\n $comment = \"<!-- $comment -->\";\n $this->addHtml($comment);\n\n }",
"function render_geolocation_comments_table() {\n\t\techo \"<table id='geolocate_table'>\\n\";\n\t\techo \"\\t<tr><td><strong>Location</strong></td><td><strong>Number of Comments</strong></td></tr>\\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a whereGeoDistance condition. | public function whereGeoDistance(string $field, $value, $distance, string $boolean = 'must'): self
{
$this->wheres[$boolean][] = [
'geo_distance' => [
'distance' => $distance,
$field => $value,
],
];
return $this;
} | [
"public function search_engine_client_add_filter_geolocation_distance( $field_name, $geo_latitude, $geo_longitude, $distance ) {\n\n\t\t$this->query_select->addFilterQuery(\n\t\t\t[\n\t\t\t\t'key' => sprintf( 'distance %s', $field_name ),\n\t\t\t\t'query' => $this->query_select->getHelper()->geofilt(\n\t\t\t\t\t$... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a dsid regex to the rule. | function addDsidRegex($regex) {
$this->setValue('dsidregexs', $regex);
} | [
"function removeDsidRegex($regex) {\n $this->removeValues('dsidregexs', $regex);\n }",
"function content_model_viewer_add_datastream_dsid_rule_validate(array $form, array &$form_state) {\n $add = $form['fieldset']['rows']['add'];\n if (empty($add['dsid']['#value'])) {\n form_error($add['dsid'], t('field ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the file entries per page. | public function setFileEntriesPerPage($fileEntriesPerPage)
{
if (intval($this->fileEntriesPerPage) !== intval($fileEntriesPerPage)) {
$this->fileEntriesPerPage = intval($fileEntriesPerPage);
}
} | [
"protected function setPagesPerImport() {\n\t\tif (!empty($this->config['pages_per_import'])) {\n\t\t\t$this->pages_per_import = $this->config['pages_per_import'];\n\t\t} else {\n\t\t\t$this->pages_per_import = 7;\n\t\t}\n\t}",
"function setPagePerPage($page, $perPage);",
"function setNumberOfPages(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================ STATIC FUNCTIONS ============================ Load and get a SteamUser object from the provided data. | public static function loadSteamUser(array $steamData) : SteamUser
{
$steamID = $steamData['steamID'];
$username = $steamData['username'];
$gameList = $steamData['gameList'];
return new SteamUser($steamID, $username, $gameList);
} | [
"function loadUser($login, $mail)\r\n{\r\n $userobj = new WP_User();\r\n $user = $userobj->get_data_by('login', $login);\r\n $user = new WP_User($user->ID); // Attempt to load up the user with that ID\r\n openam_debug('loadUser: user object: ' . print_r($user, true));\r\n\r\n if (0 == $user->ID) { //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que se encarga de trar los datos almacenados en los premios, en la tabla premios, dichos pemios son solo los que estan disponibles para la obtencion no los que ya tiene dispoinible le usuario para canjearlos | public function obtenerPremios(){
//Se prepara el query
$stmt = Conexion::conectar()->prepare("SELECT * FROM premios");
//se ejecuta
$stmt->execute();
$r = array();
//Se trane todos los ddatos
$r = $stmt->FetchAll();
//y finalmente se p... | [
"public function obtenerMisPremios(){\n\n //Se declara un arreglo para recibir todos los datos de la tabla\n $datosMisPremios = array();\n\n //Se llena el arreglo con los datos obtenidos por la funcion del modelo obtenerMisPremios()\n $datosMisPremios = Datos::obtenerMisPremios();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor which will instantiate a new object pulled from database given a User ID If user does not exist in database, creates returns a template User object with UserID as given id and rest of attributes the default blank values Takes User ID and a database Connection object | public static function createFromID($conn, $userID) {
// set static database connection
$dbc = $conn->getdbc();
// sql to pull data if it exists
$sql_getUserFromdb = "SELECT * FROM users where userID = '$userID'";
// if query is able to be run
if ($r... | [
"static function create() {\n $numargs = func_num_args();\n if($numargs < 3 || $numargs > 7) return false;\n $args = func_get_args();\n\n $u = new User;\n\n // required values\n $u->id = (integer) $args[0];\n $u->firstName = (string) $args[1];\n $u->la... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for showTransactionFees Show Transaction Fees. | public function testShowTransactionFees()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
} | [
"private function fee_list(){\n $results = $this->dt->fee_list();\n echo $results;\n }",
"public function getFees()\n {\n return $this->fees;\n }",
"public function testTaxableFees()\n {\n $this->app['config']->set('laracart.fees_taxable', true);\n $this->laracart->add... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for customers to add product in comparison. | public function addCompareProduct()
{
$productId = request()->get('productId');
$customerId = auth()->guard('customer')->user()->id;
$compareProduct = $this->compareProductsRepository->findOneByField([
'customer_id' => $customerId,
'prod... | [
"public static function addCustomerCompareProduct($id_customer, $id_product)\n\t{\n\t\t return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_customer`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_customer).', NOW(), NOW())');\n\t}",
"public fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purchase links for upgrades URL to purchase this app | function si_purchase_link( $url = '', $campaign = 'free' ) {
echo si_get_purchase_link( $url, $campaign );
} | [
"function getUpgradeURL ()\r\n\t{\r\n\t\treturn str_replace('http://', 'https://', CloudNCo::config()->get('accountURL') ) . 'checkout/upgrade' ;\r\n\t}",
"private function get_upsell_link()\n {\n }",
"function add_upgrade_link( $links ) {\n $mylinks = array(\n '<a target... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end if( !( function_exists( 'repair_status_checker' ) ) ) e.g.[drawer title='title' swaptitle='alternate title for open drawer' alt='hover tag' notitle='"true" if no hover element desired' id='uniqueid' tag='' trigclass='triggerclass' targtag='' targclass='targetcontentclass' rel='groupforelementsonlyoneopenatatime' ex... | function drawer( $atts, $content = null ) { // New function parameter $content is added!
extract( shortcode_atts( array(
'title' => 'Click Here',
'swaptitle' => 'Click Here to Hide',
'alt' => '',
'notitle' => '',
'id' => 'id'.$ran,
'tag' => $options['tag'],
'trigclass' => '',
'trigpos' => $options['... | [
"function on_shortcode_if_not_status ($atts, $content)\n{\n if (!if_status ($atts)) {\n return do_shortcode ($content);\n }\n return '';\n}",
"function on_shortcode_if_status ($atts, $content)\n{\n if (if_status ($atts)) {\n return do_shortcode ($content);\n }\n return '';\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uploads a chunk of file and returns the upload id and offset representing the number of bytes transferred so far. The first chunk will be uploaded without setting an upload_id. The default offset for the first chunk is 0. After each chunk has been uploaded, the server returns a new offset. | private function uploadChunk($params = array())
{
$httpMethod = 'PUT';
$urlBase = 'https://api-content.dropbox.com/1/chunked_upload';
$urlParams = '';
if ($params['uploadId'] != null && $params['offset'] != 0) {
$urlParams = '?upload_id=' . $params['uploadId'] . '&offset... | [
"private function pack_chunk() {\n\t\t$Err = new ChunkUploadError;\n\n\t\t$index = $chunk = $chunk_path = null;\n\t\textract($this->chunk_data);\n\n\t\t# truncate or append\n\t\t$fhn = @fopen($tempname, ($index === 0 ? 'wb' : 'ab'));\n\t\tif (false === $fhn) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tself::$logger... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns array with Ranged weapon haste value | private function GetCharacterRangedHaste() {
$player_stats = array();
$rating = $this->SetRating();
$rangedSkillID = Mangos::getSkillFromItemID($this->GetDataField(PLAYER_VISIBLE_ITEM_18_ENTRYID));
if($rangedSkillID == SKILL_UNARMED) {
$player_stats['value'] ... | [
"private function GetCharacterOffHandMeleeHaste() {\n return array('hastePercent' => 0, 'hasteRating' => 0, 'value' => 0);\n }",
"private function GetCharacterRangedDamage() {\n $tmp_stats = array();\n $rangedSkillID = Mangos::getSkillFromItemID($this->GetDataField(PLAYER_VISIBLE_ITEM_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Terminates a search for a given PID | public function TerminateSearch($pid) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoBackend->TerminateSearch(): terminating search for pid %d", $pid));
if (!isset($this->store) || $this->store === false) {
ZLog::Write(LOGLEVEL_WARN, sprintf("The store is not available. It is not possible to r... | [
"public function TerminateSearch($pid) {\n return true;\n }",
"public function stop($pid = null) {\n\t\ttry {\n\t\t\t$this->int($pid);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function consumersTerminate($pid) {\n $childpid = $this->getChildProcess($pid);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the base table name. | public function getBaseTable() {
return $this->baseTable;
} | [
"function table_name()\n\t{\n\t\treturn( \"t_base\" );\n\t}",
"public function getBaseTable()\n\t{\n\t\treturn $this->base_table;\n\t}",
"public function get_table_name() {\n\t\treturn $this->get_table_prefix() . $this->table_name;\n\t}",
"public function get_table_name() {\n\t\treturn $this->table_prefix . s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets instances id by its name | public function getIdByName(string $name); | [
"public function getId()\n {\n return $this->attributes[self::INSTANCE_ID];\n }",
"public function get_instance_id()\n {\n }",
"static public function find_instanceid($contextname) {\n try {\n $contexthandler = self::factory($contextname);\n $instanceid = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
access token expires in an hour, reconnect function revokes it using refresh token refresh token lasts 101 days, after that it is necessary to click he QUICKBOOKS CONNECT button and reauthorize tokens are saved in db and in instance and new DataService is instantiated after a successful reconnect | public function reconnect(){
$ks = Yii::$app->keyStorage;
// if refresh_token is not set, it means the app never connected to quickbooks
if (!$this->refreshToken){
throw new Exception('Refresh token not set. You need to click CONNECT QUICKBOOKS button');
}
// discov... | [
"public function reconnect(){\n $ks = Yii::$app->keyStorage;\n\n // if refresh_token is not set, it means the app never connected to quickbooks\n if (!$this->refreshToken){\n $ks->set('quickbooks.need-connect', \"\");\n throw new Exception(self::NEED_TO_CLICK_QUICKBOOKS_CO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the blue print collection | public function getBlueprints() {
return $this->blueprints;
} | [
"public function getBlueprintCollection(): BlueprintCollection\n {\n return $this->blueprintCollection;\n }",
"public function getBlueprints() {\n\t\t$return = array();\n\t\tforeach ($this->blueprints as $key => $value) {\n\t\t\t$return[$key] = $value;\n\t\t}\n\t\treturn $return;\n\t}",
"public fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pages_sort Sorts an array of page items by short_title field. | protected function pages_sort(&$list) {
if ( empty($list) || is_array($list) === false ) {
return $list;
}
$list = $this->model->sort_alpha($list);
foreach ($list as &$item) {
if ( ! empty($item['subpages']) ) {
$item['subpages'] = $this->pages_sort($item['subpages']);
}
}
return $list;
... | [
"public function sortByTitle( )\n {\n usort( $this->pages, function( $a, $b ) {\n /** @var Page $a */\n /** @var Page $b */\n return strcmp( $a->getTitle( ), $b->getTitle( ) );\n } );\n }",
"public function sortSearchPages($search_pages);",
"protected functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
input condition tree: [ combinedcondition => [ aggregation => any conditions => [ condition1 => [ attribute => field1 ] condition2 => [ attribute => field2 ] ] ] ] in case when condition2 is not mappable the result must be next: [ combinedcondition => [ aggregation => any conditions => [] ] ] | public function testConditionV1()
{
$field1 = 'field-1';
$field2 = 'field-2';
$simpleCondition1 = $this->getMockForSimpleCondition($field1);
$simpleCondition2 = $this->getMockForSimpleCondition($field2);
$inputCondition = $this->getMockForCombinedCondition(
[
... | [
"public function buildConditions(): ?string {\n\n $groups = [];\n foreach ($this->where as $group) {\n if (!empty($group['conditions'])) {\n $conditions = '';\n foreach ($group['conditions'] as $clause) {\n $conditions .= $this->translateCondition($clause['field'], $clause['value']... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Autolink Function : transform every word of more than $limit characters in internal link | public function everylink(string $text, int $limit): string
{
$regex = '~([\w-_éêèùïüîçà]{' . $limit . ',})(?![^<]*>|[^<>]*<\/)~';
$text = preg_replace_callback($regex, function ($matches) {
return '<a href="' . idclean($matches[1]) . '">' . $matches[1] . '</a>';
}, $text);
... | [
"function rcms_prc_link_short($matches){\n\tif(mb_strlen($matches[2])>25){\n\t\treturn ' <a href=\"http://' . $matches[2] . '\" target=\"_blank\">' . mb_substr($matches[2], 0, 11) . '...' . mb_substr($matches[2], -11) . '</a>';\n\t} else return ' <a href=\"http://' . $matches[2] . '\" target=\"_blank\">' . $matches... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This is to clear an exam of all candidates. | public static function clearCandidates($exam_id)
{
$ret = DB::table('pivots')->where('exam_id', '=', $exam_id)->delete();
return $ret;
} | [
"public function clearAnswers()\n {\n $this->emissions = null;\n $this->cabotage = null;\n $this->trips = null;\n $this->internationalJourneys = null;\n $this->sectors = null;\n $this->updatePermitsRequired(null);\n $this->resetCountrys();\n $this->resetChe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a bool to a 'yes' or 'no'. | function masvideos_bool_to_string( $bool ) {
if ( ! is_bool( $bool ) ) {
$bool = masvideos_string_to_bool( $bool );
}
return true === $bool ? 'yes' : 'no';
} | [
"function boolToWord($bool){\nif ($bool === true) {\n $bool = 'Yes';\n} else $bool = 'No';\n\nreturn $bool;\n}",
"function boolToWord($bool){\n if($bool == true){\n return \"Yes\";\n }else{\n return \"No\";\n }\n }",
"public func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the principalId The identifier of the principal whose membership or ownership assignment is granted through PIM for groups. Required. | public function setPrincipalId($val)
{
$this->_propDict["principalId"] = $val;
return $this;
} | [
"public function setPrincipalId($principalId)\n {\n $this->principalId = $principalId;\n return $this;\n }",
"public function setPrincipalId(?string $value): void {\n $this->getBackingStore()->set('principalId', $value);\n }",
"public function setPrincipal(PrincipalInterface $princ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funciton to Update JP_CHRISTIAN Table | private function updateJP_CHRISTIAN($iProfileID,$paramArray=array())
{
try{
return $this->objProfileChristianStore->update($iProfileID,$paramArray);
} catch (Exception $ex) {
jsCacheWrapperException::logThis($ex);
return false;
}
} | [
"function updateVisits($firstname, $lastname, $year){\n //connect to your database. Type in your username, password and the DB path\n $conn=oci_connect('mcai','coen174', 'dbserver.engr.scu.edu/db11g');\n if(!$conn) {\n print \"<br> connection failed:\";\n exit;\n }\n\n //locate row that... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement postTypeCategory() method. | public function postTypeCategory() {
return ProductCat::class;
} | [
"public static function post_type(){}",
"public function category_post_types() {\n\n\t\tglobal $wp_taxonomies;\n\n\t\t$wp_taxonomies['category']->object_type = array( 'post', 'page' );\n\t}",
"private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrypt $data with $secret | public static function decrypt(string $data, string $secret='', string $algorithm='AES-256-CBC'); | [
"public function decrypt($data);",
"abstract public function decrypt($data);",
"private function decryptFeedData($data)\n {\n $helper = FoxyHelper::create();\n return \\rc4crypt::decrypt($helper->config()->get('secret'), $data);\n }",
"public function decrypt(array $data);",
"public func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$resize = new DynImage\Filter\Resize(array('height' => 200, 'width' => 200)); | public function testResizeGmagick() {
$resize = (new DynImage\Filter\Resize())->setHeight(200)->setWidth(200);
$dynimage = new DynImage\DynImage();
$dynimage->add($resize);
$filename = __DIR__ . '/Fixtures/test.jpg';
$image = $dynimage->apply(file_get_contents($filename), Dyn... | [
"function resizeImage ( ) {/* Contructor */}",
"public function resizeimage($width, $height, $filter, $blur, $fit){}",
"public function testResizeGd() {\n $resize = (new DynImage\\Filter\\Resize())->setHeight(200)->setWidth(200);\n\n $dynimage = new DynImage\\DynImage();\n $dynimage->add($r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create new shift for specified doctor. | public function newShift(Doctor $doctor, Request $request)
{
$schedule = new Schedule;
$schedule->date = new Carbon($request->date);
$in = $request->filled('time_in') ? new Carbon($request->time_in) : Schedule::DEFAULT_TIME_IN;
$out = $request->filled('time_out') ? new Carbon($request->time_out) : S... | [
"public function newShift(Request $request)\n\t{\n\t\t$doctor = $request->user()->doctor;\n\n $schedule = new Schedule;\n\t\t$schedule->date = new Carbon($request->date);\n\n\t\t$in = $request->filled('time_in') ? new Carbon($request->time_in) : Schedule::DEFAULT_TIME_IN;\n\t $out = $request->filled('tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make_filename Make a safe filename from domain and code | private function make_filename($domain,$code) {
$s = array('http://','https://');
$r = array('','');
$domain = str_replace($s,$r,$domain);
return $domain.'-'.$code;
} | [
"function _safe_filename($filename) {\n $pi = pathinfo($filename);\n $sanitized = md5($pi['filename'] . ' ' . $_SERVER['REMOTE_ADDR'] . ' ' . time());\n if ( isset($pi['extension']) && $pi['extension'] ) return $sanitized . '.' . $pi['extension'];\n else return $sanitized;\n}",
"function make_filename... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the authenticated user's list of accounts. (accounts.listAccounts) | public function listAccounts($optParams = array())
{
$params = array();
$params = array_merge($params, $optParams);
return $this->call('list', array($params), 'Google\Service\AdExchangeBuyer\AccountsList');
} | [
"public function getAccounts()\n {\n return $this->client->request('GET', '/accounts');\n }",
"public function listAccounts($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_MyBusiness_L... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for backend widgts | public function getBackendWidgets()
{
return $this->backendWidgets;
} | [
"public function getBackend()\n {\n return $this->resourceType->getBackend();\n }",
"public function getBackend()\n {\n return $this->backend;\n }",
"final public function getBackend()\n {\n return $this->backend;\n }",
"public function getBackend() {\n return $th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable translating the block. All translations (except the main one) will be removed. | public function disableTranslations(Block $block): Block; | [
"public function enableTranslations(Block $block): Block;",
"public function block_localization() {\n\t\t\tif ( function_exists( 'wp_set_script_translations' ) ) {\n\t\t\t\twp_set_script_translations( 'coblocks-editor', 'coblocks' );\n\t\t\t}\n\t\t}",
"public function disableAction()\n {\n $session = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the components are cached. | public function isComponentsCached(): bool
{
return is_file($this->componentCacheFile());
} | [
"private function cacheEnabled() {\n return isset(Yii::app()->components['cache']) ? true : false;\n }",
"public function isCached() {}",
"public function isCached();",
"public function hasCaching(): bool;",
"public function cache_valid() {\n return $this->cache_exists();\n }",
"protected fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds and displays a Resource entity. | public function showAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('VMBResourceBundle:Resource')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Resource entity.');
}
$of... | [
"public function show(Resource $resource) {\n //\n }",
"public function show(Resource $resource)\n {\n //\n }",
"public function viewResourceAction() {\n \t$idRole = intval($this->request->get('idRole'));\n \tif(empty($idRole)) {\n \t\t$this->flashSession->error($this->_(\"idRole... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the JIRA callback and stores the auth token | public function callbackAction()
{
try {
/** @var \Symfony\Component\HttpFoundation\Request $request */
$request = $this->get('request');
/** @var \Ma27\Jira\IssueVoteBundle\Util\OAuthSecurityAccessProvider $provider */
$provider = $this->get('ma27_jira_issue_... | [
"public function process_callback() {\n\n\t\t$_REQUEST['hauth_done'] = $this->id;\n\n\t\twc_social_login()->get_hybridauth_instance()->process_endpoint();\n\t}",
"public function callbackAction()\n {\n \t$analyticsService = $this->get('google_analytics_api.api');\n \t$client = $analyticsService->getClien... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a rule for the minimum a numeric value can be | public function min($value) {
$this->rules['min'] = $value;
return $this;
} | [
"public function requireNumbers($num = 1) {\n // Makes sure that the passed argument is a number and is greater than 0.\n\tif (is_numeric($num) && $num > 0) {\n // If so, it is assigned to the respective property of the current instance.\n\t $this->_minimumNumbers = (int) $num; \n\t}\n }",
"public funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a target attribute to all links in passed content. By default, this function only applies to `` tags. However, this can be modified via the `$tags` parameter. NOTE: Any current target attribute will be stripped and replaced. | function links_add_target($content, $target = '_blank', $tags = array('a'))
{
} | [
"function links_add_target($content, $target = '_blank', $tags = array('a'))\n{\n}",
"function _links_add_target( $m, $target ) {\n\t$tag = $m[1];\n\t$link = preg_replace('|(target=[\\'\"](.*?)[\\'\"])|i', '', $m[2]);\n\treturn '<' . $tag . $link . ' target=\"' . $target . '\">';\n}",
"public function setLinkTa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test file service copy | public function testCopy()
{
// Create temporary file
$path = tempnam(sys_get_temp_dir(), 'test');
$fileName = basename($path);
// Create test dir
$testDir = sys_get_temp_dir().'/testDir/';
if (!$this->fileService->exists($testDir)) {
$this->fileService->... | [
"public function testCopyFile()\n {\n\n $fileManager = new FileManager();\n\n $testFile = TEST_DIRECTORY . basename(__FILE__);\n\n $this->assertEquals(true, $fileManager->copyFile(__FILE__, $testFile));\n\n unlink($testFile);\n }",
"public static function testCopyingAFile()\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
modifie la luminescence d'une couleur en hsl | function mod_l_hsl($delta_l) {
$hsl=$this->get_hsl();
$l=$hsl[2];
if ($delta_l>0)
$l=$l+(1-$l)*(($delta_l>1)?1:$delta_l);
if ($delta_l<0)
$l=$l*(($delta_l<-1)?-1:(1+$delta_l));
//echo $l."<br>\n";
$this->set_from_hsl($hsl[0],$hsl[1],$l);
} | [
"function originaltint(){\n\tglobal $hue, $luminance, $saturation;\n\t$temp_satu = round($saturation/2 ,0);\n\tif ($luminance < 50) {\n\t\t$luminance += 50;\n\t}elseif($luminance > 60) {\n\t\t$luminance = ($luminance/2) + 50;\n\t}\n\techo \"hsl(\". round($hue, 0). \",\" . $temp_satu . \"%,\" . $luminance.\"%)\"; \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the age column Example usage: $query>filterByAge(1234); // WHERE age = 1234 $query>filterByAge(array(12, 34)); // WHERE age IN (12, 34) $query>filterByAge(array('min' => 12)); // WHERE age > 12 | public function filterByAge($age = null, $comparison = null)
{
if (is_array($age)) {
$useMinMax = false;
if (isset($age['min'])) {
$this->addUsingAlias(AliMemberTableMap::COL_AGE, $age['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
... | [
"private function applyUserAge($age)\n {\n $date = Carbon::now();\n $date->subYears($age);\n $year = $date->format('Y-m-d');\n\n $this->query->where('birth', '<', $date);\n }",
"public function filterByAge($age = null, $comparison = null)\n {\n if (is_array($age)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
///////////////// customtype implementation: returns an argument, ostensibly to be sent to a query for storage. number of indices must be determined form getFieldNames | public function getArgParam($index) {
if ($index > 1)
throw new data_exception("data_phone stores only 2 parameters");
return $this->args[$index];
} | [
"public function getArgument($index);",
"public function getNamedTypeArgument($name);",
"public function showOnIndex(): FieldInterface;",
"public function getArgumentValue(string $name);",
"protected function get_arg($arg){\n return $this->_args[$arg];\n }",
"public function getQueryArrayItem($inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation postPrototypeDestroyByIdComments Delete a related item by id for comments. | public function postPrototypeDestroyByIdComments($fk, $id)
{
list($response) = $this->postPrototypeDestroyByIdCommentsWithHttpInfo($fk, $id);
return $response;
} | [
"public function postPrototypeDestroyByIdComments($fk, $id)\n {\n list($response, $statusCode, $httpHeader) = $this->postPrototypeDestroyByIdCommentsWithHttpInfo ($fk, $id);\n return $response; \n }",
"public function flagPrototypeDestroyComments($id)\n {\n list($response) = $this->f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure the redis connection. | protected function configureRedis()
{
$config = [
'REDIS_HOST' => null,
'REDIS_DATABASE' => null,
'REDIS_PORT' => null,
];
$config['REDIS_HOST'] = $this->ask('What is the host of your redis server?');
$config['REDIS_DATABASE'] = $this->ask... | [
"protected function configureRedis()\n {\n $config = [\n 'REDIS_HOST' => null,\n 'REDIS_DATABASE' => null,\n 'REDIS_PORT' => null,\n ];\n\n $config['REDIS_HOST'] = $this->ask('What is the host of your redis server?');\n $config['REDIS_DATABASE'] = $thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default locale. | public static function getDefaultLocale(): string
{
return self::instance()->defaultLocale;
} | [
"public function getDefaultLocale(): string\n {\n return $this->defaultLocale;\n }",
"public static function getDefaultLocale(): string\n {\n return self::proxy()->getDefaultLocale();\n }",
"public function getDefaultLocale()\n {\n return $this->defaultLocale;\n }",
"pub... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads the target table, yielding rows as associative arrays. | private function readTargetTable(TargetTable $targetTable): Generator
{
$query = 'SELECT * FROM ' . $this->driver->getTableIdentifier($targetTable->table);
if ($targetTable->conditions !== null) {
$query .= ' ' . $targetTable->conditions;
}
$statement = $this->pdo->quer... | [
"public function readAll() : array\n {\n $result = $this->db->query('SELECT * FROM ' . $this->tablename);\n\n return $this->readQuery($result);\n }",
"function readTable(string $tableName): array\r\n {\r\n $results = $this->querySimpleExecute('select * from ' . $tableName);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value from CUSTOM_19. | public function getCustom19(){
return $this->_dataArray[ProspectProps::CUSTOM_19];
} | [
"public function getCustomValue()\n {\n return $this->customValue;\n }",
"public function getCustom14(){\n return $this->_dataArray[ProspectProps::CUSTOM_14];\n }",
"public function getCustom16(){\n return $this->_dataArray[ProspectProps::CUSTOM_16];\n }",
"public function get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To more easily process a file repository based on Mime Types, it's sometimes easier to tokenize a mimetype and process using the tokens (e.g. if you have a directory of image icons that you want to map back to a mime type or a collection of mime types, a tokenizedversion of the mime type would be more appropriate). Giv... | public static function GetTokenForMimeType($strMimeType) {
$strMimeType = strtolower($strMimeType);
$strToReturn = '';
$intLength = strlen($strMimeType);
for ($intIndex = 0; $intIndex < $intLength; $intIndex++) {
$strCharacter = $strMimeType[$intIndex];
if ((ord($strCharacter) >= ord('a')) &&
... | [
"function get_mime_class($mime)\n{\n if (empty($mime) || is_null($mime)) {\n return 'mime mime-file';\n }\n $_temp_mime = explode('/', $mime);\n $part1 = $_temp_mime[0];\n $part2 = $_temp_mime[1];\n\n // Image\n if ($part1 == 'image') {\n if (strpos($part2, 'photoshop') ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / /Method Name: appusers /Description: CreateUpdate Post Method / / | public function createupdateappuser()
{
$logger = Logger::getLogger(__CLASS__);
try
{
$taskCode = "AppUsers";
$this->LogAccess($taskCode);
$authResult = $this->Authorize($taskCode);
if ($authResult == "LOGIN")
{
return $this->view->outputJson(Constants::$LOGIN, "", "");
}
$_A... | [
"public function systemusers_post()\n {\n $email=$this->post('UserEmail');\n $password=sha1($this->post('UserPass'));\n $add_data = array(\n\n 'UserFirstName' => $this->post('UserFirstName'),\n 'UserLastName' => $this->post('UserLastName'),\n 'UserEmail' => $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create's a new instance of the login module with the passed class name. | public function createLoginModuleInstance(String $className)
{
return parent::createLoginModuleInstance($className);
} | [
"public function instantiate($className);",
"public static function loginFactory($tipo_login){\n\t\tif($tipo_login === \"promotec\"){\n\t\t\treturn new LoginPromotor();\n\n\t\t}else if($tipo_login === \"microtae\"){\n\n\t\t}else if($tipo_login === \"login3\"){\n\t\t\t\n\t\t}else if($tipo_login === \"login4\"){\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mendapatkan username dari userid | function getUsername($userid) {
global $conn;
$sql = "select username from gate.sc_user where userid = ".Query::escape($userid);
return $conn->GetOne($sql);
} | [
"private function username( $uid ){\n \n $query = USR_NAME . $uid;\n $result = mysql_query($query) or die(\"Query failed: \" . mysql_error());\n $res;\n while( $r = mysql_fetch_array($result, MYSQL_ASSOC) ){\n $res = $r['username'];\n }\n echo \"<script> pl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up a new Comments widget instance. | public function __construct()
{
$widget_options = array(
'classname' => 'widget_acw_recent_comments',
'description' => __( 'A comments widget with extended features.' ),
'customize_selective_refresh' => true,
);
$control_options = array();
parent::__construct(
'acw-recent-comments', /... | [
"function register_Zappy_Lates_Comment_Widget() {\n register_widget('Zappy_Lates_Comment_Widget');\n}",
"function onourmoon_loar_recent_comments_widget() {\n register_widget( 'OnourMoon_Recent_Comments' );\n}",
"public function CommentsForm()\n {\n // Check if enabled\n $enabled = $this->... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get request types of itil object between 2 dates | function getUsedRequestTypeBetween($date1 = '', $date2 = '') {
global $DB;
$ctable = $this->getTable();
$criteria = [
'SELECT' => 'requesttypes_id',
'DISTINCT' => true,
'FROM' => $ctable,
'WHERE' => [
"$ctable.is_del... | [
"public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Condition::DATE_OPERATORS;\n\t\tforeach (array_keys($dateFilters) as $filterType) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reassign documents to the default document set, where they'd previously have been assigned to pages | protected function reassignDocuments()
{
$countCheck = SQLSelect::create('*', 'DMSDocument_Pages');
if (!$countCheck->count()) {
$this->output('There was no data to migrate. Finishing.');
return $this;
}
$query = SQLSelect::create(array('DMSDocumentID', 'Site... | [
"public function resetDefault() {\r\n // delete content page where page_id = $this->page_id\r\n $contentTable = Engine_Api::_()->getDbtable('content', 'core');\r\n $contentTable->delete(array('page_id = ?' => $this->page_id));\r\n \r\n //copy content structure\r\n Engine_Ap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the defenderNetworkProtectionType Value indicating the behavior of NetworkProtection. Possible values are: userDefined, enable, auditMode, warn, notConfigured. | public function setDefenderNetworkProtectionType($val)
{
$this->_propDict["defenderNetworkProtectionType"] = $val;
return $this;
} | [
"public function getDefenderNetworkProtectionType()\n {\n if (array_key_exists(\"defenderNetworkProtectionType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"defenderNetworkProtectionType\"], \"\\Beta\\Microsoft\\Graph\\Model\\DefenderProtectionType\") || is_null($this->_propDict[\"defen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================= printTop() Prints the heading of the webpage ======================================================= | function printTop() {
print
" <div class='container-fluid'> \n".
" <div class='page-header'> \n".
" <div class='row'> \n".
" <div class='col-xs-12'> \n".
" <h1>Music Shop Checkout</h1> \n".
" </div> <!--/col-xs... | [
"function printTop() {\n print\n \" <div class='container-fluid'> \\n\".\n \" <div class='page-header'> \\n\".\n \" <div class='row'> \\n\".\n \" <div class='col-xs-12'> \\n\".\n \" <h1>Music Shop Login</h1> \\n\".\n \" ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the domain used for cookies | function phpgw_set_cookiedomain() {
$dom = $_SERVER['HTTP_HOST'];
if (preg_match("/^(.*):(.*)$/",$dom,$arr)) {
$dom = $arr[1];
}
$parts = explode('.',$dom);
if (count($parts) > 2) {
if (!ereg('[0-9]+',$parts[1])) {
for($i=1;$i<count($parts);$i++) {
$this->cookie_domain .= '.'.... | [
"private function _set_cookie_domain() {}",
"public function setCookieDomain ($domain = '') {\r\n\t\t\r\n\t\t$explicit = false;\r\n\t\t\r\n\t\tif ( ! $domain ) {\r\n\t\t\t$domain = $_SERVER['HTTP_HOST'];\r\n\t\t\t$explicit = true;\r\n\t\t}\r\n\t\t\r\n\t\t// strip port, add leading period etc.\r\n\t\t$domain = owa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all the audio options | public function getAllAudioOptions() {
return $this->audioOptions;
} | [
"private function _audio_stream(): array\n\t{\n\t\treturn $this->__get_stream(self::CODEC_TYPE_AUDIO);\n\t}",
"public function getAudio();",
"private function getAudioSounds()\n {\n return [\n 'finish_task' => [\n [\n 'name' => 'Sound 1',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the paymentTerm property value. The paymentTerm property | public function getPaymentTerm(): ?PaymentTerm {
$val = $this->getBackingStore()->get('paymentTerm');
if (is_null($val) || $val instanceof PaymentTerm) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'paymentTerm'");
} | [
"public function getPaymentTerms()\n {\n return $this->paymentTerms;\n }",
"public function getBusinessPartnerCreditTerm() {\n return $this->businessPartnerCreditTerm;\n }",
"public function getDeliveryTerm();",
"public function getTerm() {\n \treturn $this->getOffering()->getTerm();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete delivery method configs for delivery methods that no longer exist in system. | public function deleteObsoleteConfigs()
{
$this->storage->deleteObsoleteMethodConfigs();
} | [
"public function deleteObsoleteConfigs();",
"protected static function deleteRemovedPaymentMethods()\n {\n foreach (self::$aRemovedPaymentMethods as $sPaymentId) {\n self::deletePaymentMethod($sPaymentId);\n }\n }",
"function clearDelivery() {\n $this->storage['delivery_id'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maps settings to param variables. | public static function settings_to_params() {
return [
'dropcap_color' => 'color',
'dropcap_text_color' => 'text_color',
];
} | [
"private function set_params()\n {\n $this->params = json_decode(preg_replace($this->mask[0], $this->mask[1], file_get_contents(_GEN_ROOT . \"/data/params.json\")));\n\n $this->scheme = isset($_POST['scheme']) && in_array(preg_replace('/[^A-Za-z]*/', '', $_POST['scheme']), $this->params->scheme->op... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets ownership of Item to Owner | public function setOwner($item_id, $owner_id) {
$sql = "UPDATE items SET owner_id=:owner_id WHERE item_id = :item_id";
$query = $this->db->prepare($sql);
$query->execute(array(
':owner_id' => $owner_id,
':item_id' => $item_id
));
} | [
"protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }",
"function setOwner($owner) {\r\r\n\t\t$this->owner = $owner;\r\r\n\t}",
"function setOwner(&$owner)\n {\n assert('$id = $this->getObjectId()');\n assert('$oid = $this->owner->getObjectId()');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current curl verison if curl is installed | public function get_curl_version() {
if ( function_exists( 'curl_version' ) ) {
$curl = curl_version();
if ( isset( $curl['version'] ) ) {
return $curl['version'];
}
}
return false;
} | [
"public function version()\n {\n $version = curl_version();\n return $version;\n }",
"function curl_version() {}",
"public function getVersion() {\n\t\treturn curl_version();\n\t}",
"public function version()\n {\n return curl_version();\n }",
"public function version() {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the specified driverStripe. | public function show($id)
{
$driverStripe = $this->driverStripeRepository->findWithoutFail($id);
if (empty($driverStripe)) {
Flash::error('Driver Stripe not found');
return redirect(route('driverStripes.index'));
}
return view('driver_stripes.show')->with('... | [
"public function payWithStripe()\n {\n return view('front.visaTestingDemo');\n }",
"public function payWithStripe()\n {\n if (file_exists(resource_path('views/extend/back-end/paymentstripe.blade.php'))) {\n return view('extend.back-end.paymentstripe');\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Agregar pagina en PDF | public function PDF_Add() {
$this->PDF->AddPage();
} | [
"public function PDF_Add() {\n $this->PDF->AddPage();\n }",
"function addPage($pdf, $font = 'freesans') {\n\t\t$pdf->AddPage();\n\t\t$pdf->SetXY(80, 0);\n\t\t$pdf->SetFont($font, '', 20);\n\t\t\n\t\t$pdf->write(30, \"Fluxo de Caixa\");\n\t\t//$pdf->writeHTML('Fluxo de Caixa');\n\t\t$pdf->SetXY(10, 24);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Team Name Abreviation | function getTeamNameAbrv()
{
return $this->_team_name_abrv ;
} | [
"public static function team() : string\n {\n return static::teamName();\n }",
"public function getTeamName(){\n\t\treturn($this->teamName);\n\t}",
"public function getTeamName()\n {\n return $this->getText();\n }",
"public function getTeamName ()\r\n {\r\n return $this->te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Embed the related [Tenant] resource. | public function embedTenant() {
$this->addEmbed("Tenant");
return $this;
} | [
"public function tenant()\n {\n return $this->belongsTo(Tenant::class);\n }",
"public function tenant()\n {\n return $this->belongsTo(config('multitenancy.tenant_model'));\n }",
"public function setTenant($var)\n {\n GPBUtil::checkString($var, True);\n $this->tenant = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return if $nbr is valid UN Nbr | public function hazmat_unnbr($nbr) {
return true;
} | [
"private function RUcheck($number)\n {\n // 10 digit INN numbers\n if (10 === strlen($number)) {\n $total = 0;\n $multipliers = [2, 4, 10, 3, 5, 9, 4, 6, 8, 0];\n\n for ($i = 0; $i < 10; ++$i) {\n $total += (int) $number[$i] * $multipliers[$i];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Reader of this Rating | public function getReader()
{
return $this->hasOne(Reader::className(), ['User_ID' => 'User_ID']);
} | [
"protected function getReader()\n {\n return $this->reader;\n }",
"public function get_reader() {\n if (!$this->reader) {\n $iid = \\csv_import_reader::get_new_iid('modratingallocate');\n $this->reader = new \\csv_import_reader($iid, 'modratingallocate');\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Drupal core's CKEditor version number. | protected function getCkeditorVersion() {
// Get CKEditor semantic version number from the JS file.
// @see core/core.libraries.yml
$definition = $this->libraryDiscovery->getLibraryByName('core', 'ckeditor');
$ckeditor_version = $definition['js'][0]['version'];
// Parse CKEditor semantic version nu... | [
"public function getRevisionVersion() : int;",
"public function EngineVersionNumber() {\n $version = $this->EngineVersion();\n $start = strpos($version['VERSION'], '.');\n return intval(substr($version['VERSION'], 0, $start));\n }",
"final public function get_version() {\n\t\treturn $this->get_arg_or_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Location Address Meta Box | function locaddress_meta_box() {
global $post;
echo '<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><label for="location_address_aptno">' . __( 'Apartment / Room Number', 'locations' ) . '</label></th>
<td><input name="location_address_aptno" type="text" id="location_addre... | [
"function add_location_metaboxes() {\n\t\t\tadd_meta_box( 'wpseo_locations', __( 'Business address details', 'yoast-local-seo' ), array(\n\t\t\t\t&$this,\n\t\t\t\t'metabox_locations',\n\t\t\t), 'wpseo_locations', 'normal', 'high' );\n\t\t}",
"function ctloc_location_meta() {\n\tadd_meta_box( 'ctloc_meta', __( 'Ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new wave with a list of participants on it | public function newWave($_domain, $_participants, $_msg, $_proxyForId, $_rpcServerUrl) {} | [
"public function create() {\n $data = Ensure::Input(func_get_args());\n $data = $data->get();\n if (!isset($data['recordingId'])) {\n $data['recordingId'] = \"\";\n }\n \n return parent::create($data,\n new RemoveResource($this,array(\"recordingId\"),\n new PathResourc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Listing of orgGroup members as b_tab | static function b_tab_groupMembers($org_id){
// Open the tabs
locateAndInclude('b_tabs');
$b_tabs = new b_tabs(array_values(myOrg($org_id)->orgGroups()->get_groups()));
// Fill the tab
locateAndInclude('bHolder_Avatar_ea');
foreach(myOrg($org_id)->orgGroups()->get_groups() as $group_co... | [
"function listgroup()\n\t{\n\t\tglobal $atmail;\n\n\t $h = array();\n\n\t $abookGroup = Filter::cleanSqlFieldNames($this->db->AbookGroup);\n\n\t // users from addressbooks for current account\n\t $users = $this->db->sqlarray(\"SELECT id\n\t FROM $abookGroup\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if this model must use slugs as an identifier for when recording audit trail entries | public function useSlugAsIdentifier(): bool
{
return $this instanceof Sluggable || in_array(Slugs::class, class_uses_recursive($this));
} | [
"public function canGenerateSlug();",
"public function isAutoSetSlugs()\n {\n // @todo (Pablo - 2019-04-15) - Phase out support for $this->tableAutoSetSlugs\n return $this->tableAutoSetSlugs ?? (defined('static::AUTO_SET_SLUG') ? static::AUTO_SET_SLUG : false);\n }",
"public function hasSlu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field opid | public function setOpid($opid)
{
$this->opid = $opid;
return $this;
} | [
"public function setOpId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax to delete a device | public function deleteDevice(){
$this->autoRender = false;
$this->layout = 'ajax';
$id = $this->request->data['id'];
$this->Device->delete($id);
} | [
"public function deleteDevice(){\n }",
"public function ajax_delete() {\n\t\t$request = $this->request;\n\t\tif ($request->isAJAX()) {\n\t\t\t$id = $request->getPost('id');\n\t\t\tif ($id != '') {\n\t\t\t\t$halamanModel = new \\App\\Models\\HalamanModel();\n\t\t\t\t$halaman = $halamanModel->find($id);\n\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare a given value to the total inclusive value of this instance | public function compareTo($value)
{
return $this->compareMonies(
$this->inclusive(),
$this->valueToMoney($value)
);
} | [
"public function compareValue();",
"public function evaluate($value)\n {\n return $value < $this->value;\n }",
"public function compareTo($value) { return $this === $value ? 0 : 1; }",
"function lowcomp($a, $b) {\n if ((double)$a->getTotal() == (double)$b->getTotal()) {return 0; }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of the TransportStatus property. | public function getTransportStatus()
{
return $this->_fields['TransportStatus']['FieldValue'];
} | [
"public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }",
"public function getTransportType()\r\n {\r\n return $this->transportType;\r\n }",
"public function getTicketStatus()\n\t{\n\t\treturn $this->ticket_status;\n\t}",
"public f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Releases an existing savepoint. | public function releaseSavepoint($name); | [
"public function releaseSavepoint($savepoint)\n {\n $this->doctrine->releaseSavepoint($savepoint);\n }",
"public function releaseSavepoint($name) {}",
"public function releaseSavepoint($savepoint)\n {\n if (! $this->getDatabasePlatform()->supportsSavepoints()) {\n throw Connect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print the standard footer, currently very simple. Pass $and_exit as TRUE to exit afterwards | function print_footer($and_exit)
{
global $theme;
// Load the print_theme_footer function appropriate to the theme. If there
// isn't one then fall back to the default footer.
if (is_readable("Themes/$theme/footer.inc"))
{
include_once "Themes/$theme/footer.inc";
}
if (!function_exists(__NAMESPACE... | [
"public function printFooter() {\n\t\ttemplate( 'footer', $this->args );\n\t}",
"public function footer()\r\n {\r\n print file_get_contents(_HTML_TEMPLATE_FOLDER_.'footer.html');\r\n }",
"public function printFooter() {\n echo \"</body></html>\\n\";\n }",
"public function printFooter() {\n\t\te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shorten a string to a custom length | function _shortenString($str, $maxLength) {
if (strlen($str) > $maxLength) {
return substr($str, 0, $maxLength-3).'...';
}
return $str;
} | [
"function wpseed_shorten($string,$length,$append=\"...\") {\n $string = trim($string);\n if(strlen($string) > $length) {\n $string = substr($string, 0, $length);\n $string .= $append;\n }\n return $string;\n }",
"function shortenString($str, $length)\r\n\t{\r\n\t\treturn substr($str, 0, $l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves the musicWorks object on edit | function musicEditSave() {
$this->save();
try {
//$this->setTags($this->getTags(). " ".$this->getArtistID()." ". $this->getTrackName());
//momusicTag::getInstance(momusicTags::getInstance($this->getID())->getTagID())->setName($this->getTags())->save();;
} catch ( Exception $e) {
systemLog::message($e);
... | [
"function save()\r\n {\r\n $album \t= JRequest::get('POST'); \r\n $model \t= $this->getModel('album');\r\n \r\n $model->saveAlbum($album);\r\n $this->setRedirect('index.php?view=album&option='.JRequest::getVar('option'), 'Saved!');\r\n }",
"public function saves()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get fake instance of Space | public function fakeSpace($spaceFields = [])
{
return new Space($this->fakeSpaceData($spaceFields));
} | [
"public function getSpace(): Space;",
"protected function createSpaceModel()\n {\n $model = new Space();\n $model->scenario = 'create';\n $model->visibility = Setting::Get('defaultVisibility', 'space');\n $model->join_policy = Setting::Get('defaultJoinPolicy', 'space');\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test Holidays for 2005 | function testHolidays2005()
{
$drv = Date_Holidays::factory('UNO', 2005, 'en_EN');
$this->assertFalse(Date_Holidays::isError($drv));
foreach ($this->testDates2005 as $name => $dateInfo) {
$day = $drv->getHoliday($name);
$this->assertFalse(Date_Holidays::isError($day... | [
"function testHolidays2005()\n {\n $drv = Date_Holidays::factory('PHPdotNet', 2005, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2005 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Hol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the api configuration section. | public function addApiSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('api')
->addDefaultsIfNotSet()
->children()
->enumNode('mode')
->isRequired()
... | [
"protected function addApiSettingsSection()\n {\n if (false == get_option('satoshipay_api')) {\n add_option('satoshipay_api', $this->defaultApiSettings);\n }\n\n add_settings_section(\n 'satoshipay_api_settings_section',\n __('API Settings', $this->textdomain... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build an absolute repository resource locator | public function getAbsoluteResourcePath(RepositoryLocatorInterface $repositoryLocator)
{
return $this->root.str_replace(
'/',
DIRECTORY_SEPARATOR,
$repositoryLocator->withExtension(getenv('OBJECT_RESOURCE_EXTENSION'))
);
} | [
"public function locate_resources();",
"public function getRepositoryPath();",
"function testAssetWithAbsoluteBasePath() {\n $asset = new binarypool_asset($this->getDummyStorage());\n $asset->setBasePath('http://bin.staticlocal.ch/', true);\n $asset->setOriginal('http://bin.staticlocal.ch/v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Confirm the requested invite, requiring authentication precondition: $invite must exist, be valid, and attached to a valid CO person postcondition: CO Person status set to 'Active' and/or CO Petition updated postcondition: $inviteid deleted postcondition: Session flash message updated (HTML) | public function authconfirm($inviteid) {
// This behaves just like confirm(), except that authentication is required to get here.
$this->process_invite($inviteid, true, $this->Session->read('Auth.User.username'));
} | [
"function confirm($inviteid) {\n $this->process_invite($inviteid, true);\n }",
"public function action_accept_invite($event_id = null)\n {\n // chekc if user has access to accepting invite\n if (Auth::has_access('participant.accept_invite'))\n {\n is_null($event_id) and Resp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scope a query to only include admin roles. | public function scopeAdmin($query)
{
return $query->where('admin', true);
} | [
"public function scopeAdmin($query)\n \t{\n \t\treturn $query->join('role_user', 'users.id', '=', 'role_user.user_id')\n ->where('role_user.role_id','=',Config::get('auth.roles.admin'));\n \t}",
"public function scopeAdmin($query)\n {\n return $query->where('role_id', Role::ADMIN_ROLE);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abstract method to add wp shortcodes | abstract public function addShortcode(); | [
"protected function register_shortcodes() {}",
"public function addShortcodes() {\n\t\t// Nothing to do here now, adding class so method exists for child classes\n\t}",
"function initShortCode()\n {\n }",
"public function initShortcodes()\n {\n add_shortcode($this->tag, array($this, 'shortcode... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if this session contains this attribute. | public function hasAttribute($name)
{
return isset($_SESSION[$name]);
} | [
"public function hasAttribute($name)\n\t{\n\t\treturn isset($_SESSION[SESSION_NAMESPACE][$name]);\n\t}",
"private function has_attribute($attribute){\n $object_vars=$this->attributes();\n return array_key_exists($attribute,$object_vars);\n }",
"public function hasAttributes()\n {\n if (phpCAS::... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the max modified time among the given files. Note: it doesn't support microseconds. | protected function maxFileModifiedTime($files)
{
$max = 0;
foreach ($files as $file) {
$lastModifiedTime = @filemtime($file);
if (false === $lastModifiedTime) {
throw new Exception('Unable to get last modification time of file: '.$file);
}
... | [
"protected static function _get_last_modified($files)\n\t{\n\t\t$last_modified = 0;\n\n\t\tforeach ($files as $file) \n\t\t{\n\t\t\t$modified = filemtime($file);\n\t\t\tif ($modified !== false and $modified > $last_modified) $last_modified = $modified;\n\t\t}\n\n\t\treturn $last_modified;\n\t}",
"protected static... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the notifyLevel of the logger, as defined in Psr\Log\LogLevel. | public function setNotifyLevel(string $notifyLevel): void
{
if (!in_array($notifyLevel, $this->getLogLevelOrder())) {
syslog(LOG_WARNING, 'Bugsnag Warning: Invalid notify level supplied to Bugsnag Logger');
} else {
$this->notifyLevel = $notifyLevel;
}
} | [
"public function setLogLevel($logLevel);",
"protected function update_logging_level( $level ) {\n\t\t$this->log_manager()->set_level( $level );\n\t}",
"public function setLogLevel($level)\n {\n $this->logLevel = $level;\n }",
"public function setLevel($level)\n {\n switch ($level)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve posts identifiers ordered by creation date DESC, for the given limit and offset | public function paginateByDate($limit, $offset = 0)
{
$builder = $this->createQueryBuilder('post');
$builder
->select('post.identifier')
->orderBy('post.createdAt', 'DESC')
->setFirstResult($offset)
->setMaxResults($limit)
;
$arrayResu... | [
"protected function getPosts($offset, $limit)\n\t{\n\t\t// Construts a query criteria\n\t\t$criteria=new TActiveRecordCriteria;\n\t\t$criteria->OrdersBy['create_time']='desc';\n\t\t$criteria->Limit=$limit;\n\t\t$criteria->Offset=$offset;\n\t\t// query for the posts with the above criteria and with author informatio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ reIndex For an array of assoc rays, return a new array of assoc rays using a certain field for keys | public static function reIndex() {
$fields = func_get_args();
$array = array_shift($fields);
$array = (array) $array;
$R = array();
foreach ($array as $obj) {
$target =& $R;
foreach ($fields as $field) {
if (! array_key_exists($field, $obj)) die("reIndex: array doesn't have req... | [
"public static function reIndex() {\r\n $fields = func_get_args();\r\n $array = array_shift($fields);\r\n $array = (array) $array;\r\n \r\n $R = array();\r\n foreach ($array as $obj) {\r\n $target =& $R;\r\n \r\n foreach ($fields as $field) {\r\n if (! array_key_exists($field... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tells whether the Topology entity should be excluded because of feature flags. | private function isFeatureFlagExcluded(Topology $entity): bool
{
$flag = (string) $entity->getTopologyFeatureFlag();
if ('' === $flag) {
return false;
}
return ! in_array($flag, $this->enabledFeatureFlags, true);
} | [
"public function isExcluded(): bool\n {\n return $this->exclude ?? false;\n }",
"public function isExcluded();",
"private function exclude(): bool\n {\n return ($this->testAnnotations['class']['PostmanExclude'] ?? false)\n || ($this->testAnnotations['method']['PostmanExclude'] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |