query stringlengths 10 8.11k | document stringlengths 17 398k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Fonction de redirection par header, meta ou javascript | function redirection($cible = 'index.php' , $type = 'php' , $time = 0)
{
if($type == 'meta' OR $type == 'html' OR $type == 'js')
{
echo '<meta http-equiv="refresh" content="'.$time.'; url='.$cible.'" />';
}elseif($type == 'php' OR $type == 'header')
{
header('location:'.$cible);
}/*elseif($type == 'js')
{
e... | [
"function clientRedirect($url)\n\t {\t\t\n\t\t$url=$this->makeSefUrl($url);\n\t\t\tdie(\"<meta HTTP-EQUIV='REFRESH' content='0; url='$url'><script type='text/javascript'>window.location='$url';</script>\");\n\t\t}",
"function helper_js_redirect($value) {\n if (USE_JS_REDIRECT){\necho \"<script>\";\n e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the trs code tarif3. | public function setTrsCodeTarif3(?string $trsCodeTarif3): Clients2 {
$this->trsCodeTarif3 = $trsCodeTarif3;
return $this;
} | [
"public function setTrsCodeTarif3Sens($trsCodeTarif3Sens) {\n $this->trsCodeTarif3Sens = $trsCodeTarif3Sens;\n return $this;\n }",
"public function getTrsCodeTarif5() {\n return $this->trsCodeTarif5;\n }",
"public function getTrsCodeTarif6() {\n return $this->trsCodeTarif6;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the 'sylius.controller.shipment' service. This service is shared. This method always returns the same instance of the service. | protected function getSylius_Controller_ShipmentService()
{
$this->services['sylius.controller.shipment'] = $instance = new \Sylius\Bundle\ShippingBundle\Controller\ShipmentController($this->get('sylius.controller.configuration_factory')->createConfiguration('sylius', 'shipment', NULL));
$instance-... | [
"protected function getSylius_EmailManager_ShipmentService()\n {\n return $this->services['sylius.email_manager.shipment'] = new \\Sylius\\Bundle\\AdminBundle\\EmailManager\\ShipmentEmailManager(${($_ = isset($this->services['sylius.email_sender']) ? $this->services['sylius.email_sender'] : $this->get('sy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if 'playtime_forever' has a value | public function hasPlaytimeForever()
{
return $this->playtime_forever !== null;
} | [
"public function isPlayable() {\r\n if($this->getMinutesToWait() <= 0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"public function hasTimeLimitReached(): bool;",
"public function hasTimeLimitReached();",
"public function hasTimeLimitReached(): bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a logged call. | public static function find($reference, $call = null, $reset = true) {
if ($reset) {
static::$_index = 0;
}
if ($call === null) {
return static::_findAll($reference);
}
$index = static::$_index;
$count = count(static::$_logs);
for ($i = $index; $i < $count; $i++) {
$log = static::$_logs[$i];
i... | [
"function CabGetCall($log) {\n // Scan for the CALLSIGN: header\n // if (preg_match(\"/^CALLSIGN:[\\s{0,}|\\t{0,}]([\\w|\\W]+?)[\\s|\\n]/ms\", $log, $match)) {\n // return($match[1]);\n // }\n\n // Scan for the first QSO record...\n if (preg_match(\"/(QSO:.*\\n)/ms\", $log, $match)) {\n // Got a QSO reco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the seat that belongs to a vehicle | public function seat()
{
return $this->belongsTo(VehicleSeat::class);
} | [
"public function getSeat()\n {\n return $this->seat;\n }",
"public function getSeat()\n {\n return $this->hasOne(Seat::class, ['id' => 'seatId']);\n }",
"public function getReservation($seat_id)\n {\n return ($this->reservations[$seat_id]);\n }",
"public function getSeatid()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get_enrolled_employees($roleid, $userid) returns an array of user ids that resemble the userid's the user is enrolled in | static public function get_enrolled_employees($roleid, $userid) {
global $DB;
$list = array();
$sql = "SELECT c.instanceid
FROM {context} AS c
JOIN {role_assignments} AS ra ON ra.contextid = c.id
WHERE ra.roleid='{$roleid}'
AND ra.userid='{$userid}'";
$list = array_keys($DB->get_records_s... | [
"protected function getIncludedEmployeeIDs() {\n\n /* Set necessary data */\n $companies = $this->getCompanyIDs($this->user, 'Adding/Editing of Learning Activities'); \n $ids = [];\n\n foreach($companies as $key => $tmpCompany) {\n\n /* Check if role is null, meaning al... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create CursorPaginator instance using `before` query. | protected function newBeforeCursorPaginator($id, $perPage, $orderBy)
{
return $this->newCursorPaginator($id, true, $perPage, $orderBy);
} | [
"public static function createFromQuery($query)\n {\n $perPage = $query->getModel()->getPerPage();\n $page = static::resolveCurrentPage();\n $query->skip(($page - 1) * $perPage)->take($perPage + 1);\n return new Paginator($query->get(),$perPage,$page);\n }",
"private function pre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle php fatal errors, if can | public static function handleFatal()
{
$error = error_get_last();
if (!$error) {
return false;
}
ini_set('memory_limit', (ini_get('memory_limit') + 25).'M');
$message = "Fatal: ".self::varExport($error);
self::createError(
$message,
self::ERROR_LEVEL_FATAL,
self::getErrorKey(... | [
"function handle_fatal_error(){\n\t\t$GLOBALS[\"ErrorHandler\"]->error_memory = null;\n\t\t$error = error_get_last();\n\t\t// Unset Error Type and Message implies a proper shutdown.\n\t\tif(!isset($error['type']) && !isset($error['message']))\n\t\t\texit();\n\t\telse{\n\t\t\thandle_runtime_error($error['type'], \"F... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the `template()` method of the `TemplateManager` class when it throws exceptions of the type Exception. | public function testTemplateException()
{
$templateManager = new TemplateManager();
$testTemplateFile = TEST_DIRECTORY . 'testTemplate.html';
if (file_exists($testTemplateFile)) {
unlink($testTemplateFile);
}
$this->setExpectedExceptionRegExp(
'Exce... | [
"public function testInvalidTemplate() {\n\t\t$this->object->setTemplate(\"x\");\n\t}",
"public function testThrowsExceptionIfTemplateFileNotFound()\n\t{\n\t\t$this->template->setInputValue('content', 'example content');\n\t\t$this->template->setTemplateFilename('incorrect-filename.php');\n\t\t$this->template->ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ public $vvars = [ 'menu' => 'pay', 'nav' =>'pay', ]; | public function init(){
$this->vvars['menu'] = 'channelcount';
$this->vvars['nav'] = 'channelcount';
} | [
"public function init(){\n $this->vvars['menu'] = 'paid';\n $this->vvars['nav'] = 'paid';\n }",
"public function menu_vue(){\n\t\t\t$this->load->helper('url');\n\t\t\t$this->load->library('session');\n\t\t\t$this->load->helper('html');\n\t\t\t$this->load->library('form_validation');\n\t\t\t$this-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fill class dropdown depending on the selected grade level | public function getClassByGradeLevel()
{
$gradelevel_id = $this->input->post('id');
$query = $this->schoolclass_model->GetClassByGradeLevel($gradelevel_id);
$classes["-1"]="Select Class";
$options = '<option value="All" selected>All Classes/Groups</option>';
... | [
"function genSubjectClassDropdown($subjectLevel) //param subject - mysqli::result\r\n\t{\r\n\t\t$dropdown = '<br>';\r\n\t\t#lable for the dropdown\r\n\t\t$dropdown .= \"<label class='control-label' for='subjectDropdown'>Grade </label>\";\r\n \r\n\t\t#subject dropdown\r\n\t\t$dropdown .= \"<select class='form... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the BP Core avatar url to be global and not network specific. | public function hcommons_set_bp_core_avatar_url( $url ) {
if ( ! empty( $url ) ) {
$site_loc = strpos( $url, '/site' );
if ( false === $site_loc ) {
return $url;
} else {
$global_url = substr( $url, 0, $site_loc );
//hcommons_write_error_log( 'info', '****BP_CORE_AVATAR_URL****-'.var_export( $g... | [
"public function getAvatarURL()\n\t{\n\t}",
"public function getAvatarUrl();",
"public function urlBlankAvatarScheme()\n {\n $sUrl = DEPLOY_CDN_DRIVER_AWS_CLOUDFRONT_URL_PROCESSING;\n $sUrl .= 'blank_avatar/{{width}}/{{height}}/{{sex}}';\n\n return $this->urlMakeSecure($sUrl);\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ setLimitOffset Adds a portal option to the $fmxQueryStringArray property. | public function setLimitOffset($limit,$offset=1)
{
$queryArray = $this->fmxQueryStringArray;
$queryArray['_offset'] = $offset;
$queryArray['_limit'] = $limit;
$this->fmxQueryStringArray = $queryArray;
} | [
"function setOffsetLimit($offset, $limit);",
"protected function setOffsetAndLimit(){\n $parameters = $this->request->getQueryParams();\n $this->offset = !empty($parameters['offset']) ? (int)filter_var($parameters['offset'], FILTER_SANITIZE_NUMBER_INT) : 0;\n if((!empty($parameters['limit']) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get value from internal stack | protected function retrieve_value($k) {
if( !isset($this->_stack[$k]) ) {
return false;
}
return $this->_stack[$k];
} | [
"protected function popFromStack() {\n\n\t\tif (count($this->values_stack) === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$value = array_shift($this->values_stack);\n\t\treturn $value;\n\n\t}",
"public function get()\n {\n return $this->_stack;\n }",
"protected function _peek()\n\t{\n\t\treturn $this-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a place exists with the same name | function place_exists($name)
{
//Query the places table and get the place with the selected name
$query = $this->db->get_where('places',array('name'=>$name));
//If the place was found then return true, otherwise false
if (count($query->result()) > 0)
{
return TRUE;
}
else
{
return FALSE;
}... | [
"function _place_exists($name)\n\t{\t\t\t\t\n\t\t//Check if the user exists with the username and password provided\n\t\tif($this->Place_model->place_exists($name) === FALSE)\n\t\t{\t\n\t\t\t//Category exists, return true\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Category does not exist, set a validation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field first_leader | public function getFirstLeader()
{
return $this->first_leader;
} | [
"public function leader() {\n return $this->leader;\n }",
"function getLeaderName() {\n return $this->getFieldValue('leader_name');\n }",
"public function getLeader()\n {\n return $this->_leader;\n }",
"public function setFirstLeader($first_leader)\n {\n $this->first_leader ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the topic menu | function displayTopicMenu($subId)
{
$arrTopics=getAllTopics($subId);
echo "<table id='tblTopic'>";
/* echo "<tr><td colspan='2'>".getSubName($subId)."</td></tr>";*/
foreach($arrTopics as $valTopic)
{
$arrTopicDetails=getTopicDetails($valTopic[0]);
//to give link to all subtopics
$arrSubTopic=getAll... | [
"public function view() {\n $idTopic = filter_var($_GET['topic'], FILTER_SANITIZE_NUMBER_INT);\n\n $this->render(\"view.topic\", \"Sujet\", [\"id\" => $idTopic]);\n }",
"public function display_topic_index()\n {\n }",
"function discussion_menu($title) {\n\t$title = discussion::decode_titl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que presenta el encabezado del horario para los grupos del proyecto | function crearEncabezadoHorario($estilo, $mensajeEnlace) {
?>
<div class='sigma'>
<th class='<? echo $estilo ?>' width="50">Grupo</th>
<th class='<? echo $estilo ?>' width="60">Lun</th>
<th class='<? echo $estilo ?>' width="60">Mar</th>
<th class='<? echo $estilo ?>' width="60"... | [
"function generarHorario($gruposProyecto,$variables,$estilo,$icono,$horario) {\n $noHorario=0;\n ?>\n <tr onmouseover=\"this.style.background='#F4F4EA'\" onmouseout=\"this.style.background=''\">\n <td class='<? echo $estilo ?>'>\n <? echo $gruposProyecto['GRUPO'];?>\n </td>\n <?\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of '_charge_reply' property | public function getChargeReply()
{
return $this->get(self::_CHARGE_REPLY);
} | [
"public function getReply()\n {\n return $this->reply;\n }",
"public function getCharge()\n {\n return $this->charge;\n }",
"public function getCharge()\n {\n return $this->_fields['Charge']['FieldValue'];\n }",
"public function getReply(): string\n {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
studentanswer = replaceFunctionName($answer, $mingze); | function replaceFunctionName($studentanswer, $actualname)
{
$x = strpos($studentanswer, "(");
$y = substr($studentanswer, 0, $x);
$z = ltrim($studentanswer, $y);
$newstudentanswer = "def " . $actualname . $z;
return $newstudentanswer;
} | [
"function grade_exam($student_answer, $funcname, $parameters, $testcase_input, $testcase_output, $studentID, $pointValue, $constraints){\n $grade = $pointValue;\n $gradeTotal = 0;\n $comments = \"\";\n\n $student_answer = ltrim($student_answer); //trimming white space from beginning\n $split_answer = preg_spli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the resource type that the request is for. | public function getResourceType()
{
return $this->jsonApiRequest->getResourceType();
} | [
"public function getResourceType()\n {\n return $this->resource_type;\n }",
"public function typeResource()\n {\n return $this->get('rdf:type');\n }",
"public function getResourceType()\n {\n return $this->getProperty(\"resourceType\");\n }",
"public function getResource... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Arguments: $message. Body : array defined in the 'PublicInterface.php' file returns: the defined in the 'PublicInterface.php' file | function getMessageBodyFromMessage($message){
return simpleGetMessageBodyFromMessage($message);
} | [
"protected function _adMessageBody()\r\n\t{\r\n\t}",
"function rewind_body(MessageInterface $message)\n{\n return Utils::rewind_body($message);\n}",
"abstract protected function getBuiltMessage();",
"abstract public function processMessage();",
"public function getMessageParams(): array;",
"function im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "T__14" $ANTLR start "T__15" | function mT__15(){
try {
$_type = t018llstarLexer::T_T__15;
$_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;
// runtime/Php/test/Antlr/Tests/grammers/t018llstar.g
// runtime/Php/test/Antlr/Tests/grammers/t018llstar.g
{
$this->matchChar(1... | [
"function mT__14(){\n try {\n $_type = t018llstarLexer::T_T__14;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n $this-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OAuth starting URI Generated from protobuf field string bank_linking_uri = 3; | public function setBankLinkingUri($var)
{
GPBUtil::checkString($var, True);
$this->bank_linking_uri = $var;
return $this;
} | [
"public function oauth_url();",
"public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It should allow replacing a non defined non namespaced function | public function allow_replacing_a_non_defined_non_namespaced_function()
{
$f = 'func' . uniqid(rand(1, 9999));
$spy = FunctionMocker::replace($f, 2324);
$this->assertTrue(function_exists($f));
$this->assertEquals(2324,$f());
$spy->wasCalledOnce();
} | [
"public function allow_replacing_a_non_defined_namespaced_function()\n {\n $f = 'Some\\Name\\Space\\func' . uniqid(rand(1, 9999));\n\n $spy = FunctionMocker::replace($f, 2324);\n\n $this->assertTrue(function_exists($f));\n $this->assertEquals(2324, $f());\n $spy->wasCalledOnce(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Puts data to specific page data. So any data can be send to new page. | function put_page_data($name, $value)
{
return $_POST[PAGE_DATA_PREFIX . $name] = $value;
} | [
"private function setPageData()\n {\n // Load $this->data['article']\n if ($this->getTextId()) {\n $this->getArticle($this->getTextId());\n }\n\n $path_arr = explode('/', $_SERVER['REQUEST_URI']);\n $path = $path_arr[count($path_arr)-1];\n\n $seo = Seo::get($p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method set_city Sample of usage: $address>city = $object; | public function set_city(City $object)
{
$this->city = $object;
$this->city_id = $object->id;
} | [
"public function setCity( $city );",
"public function setCity($city) { $this->city = $city ; }",
"function setCity($city)\n {\n $this->__city = $city ;\n }",
"public function setCity($city) { $this->city = $city; }",
"public function set_city($city) {\r\n $this->city = $city;\r\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Funcion para encontrar la info de las empresas por su email, o por el email de uno de sus contactos | public function _searchByEmail($email) {
$url = "https://crm.zoho.com/crm/private/json/Accounts/searchRecords";
$params = 'authtoken='.$this->authToken.'&scope=crmapi&newFormat=2&criteria=(Correo electrónico:"'.$email.'")';
$response = json_decode($this->_cu... | [
"function searchForPersonByEmail($email) {\n $searchItems = array(\n 'term='.$email,\n \"field=email\",\n \"exact_match=true\"\n );\n $searchString = implode ('&', $searchItems);\n $searchResults = searchForPerson($searchString);\n\n // Person ID of 0 === non-existing user\n $person... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ gets all the devices names per class and stores it in $allClassesDevicesList | function getAllClassesDevices() {
$this->allClassesDevicesList = array();
$this->getClassesNames();
foreach ($this->classesNamesList as $class) {
$this->getClassDevices($class);
$this->allClassesDevicesList[$class] = $this->classDevicesList;
}
} | [
"public static function getDeviceClassList()\n {\n return DB::table('css_networking_device_class AS dc')\n ->select('dc.id', 'dc.description')\n ->join('css_networking_device_type AS dt', 'dc.id', '=', 'dt.class_id') \n ->where('dt.auto_build_enabled', '=', 1)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a quota project from the environment variable GOOGLE_CLOUD_QUOTA_PROJECT. Return null if GOOGLE_CLOUD_QUOTA_PROJECT is not specified. | public static function quotaProjectFromEnv()
{
return getenv(self::QUOTA_PROJECT_ENV_VAR) ?: null;
} | [
"public function getQuotaProject()\n {\n if ($this->fetcher instanceof GetQuotaProjectInterface) {\n return $this->fetcher->getQuotaProject();\n }\n\n return null;\n }",
"public function getQuotaProject()\n {\n return $this->quotaProject;\n }",
"function projec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Remove group contact | public function removeGroupContact() {
try {
/* Check if for the empty or null parameters */
if (isset($_POST["group_id"]) && isset($_POST["contact_id"])) {
// Get the group id and contact id from POST request to insert or remove
$form_... | [
"function civicrm_rules_rules_action_remove_from_group($contact, $settings) {\n $contactId = !empty($contact->id) ? $contact->id : $contact->getVar('_contactId');\n if ($contactId) {\n foreach ($settings as $gid) {\n _civicrm_rules_group_contact($contactId, $gid, 'delete');\n }\n return array('conta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The DeleteVpnConnection operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the [DescribeVpnGateway](~~73720~~) operation to query the status of a VPN gateway. If the VPN gateway is in the updating... | public function deleteVpnConnection($request)
{
$runtime = new RuntimeOptions([]);
return $this->deleteVpnConnectionWithOptions($request, $runtime);
} | [
"public function deleteVpnGateway($request)\n {\n if (!$request instanceof Amazon_EC2_Model_DeleteVpnGatewayRequest) {\n require_once ('Amazon/EC2/Model/DeleteVpnGatewayRequest.php');\n $request = new Amazon_EC2_Model_DeleteVpnGatewayRequest($request);\n }\n \n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the Fully Qualified Structural Element Name (FQSEN) for this element. | public function setFullyQualifiedStructuralElementName(Fqsen $name): void; | [
"public function setFullyQualifiedStructuralElementName(Fqsen $name): void\n {\n $this->fqsen = $name;\n }",
"public function asFQSEN() : FQSEN\n {\n if (!empty($this->fqsen)) {\n return $this->fqsen;\n }\n\n return parent::asFQSEN();\n }",
"public function set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rewrites Blade structure closings into PHP structure closings. | protected static function compile_structure_closings($value)
{
$pattern = '/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/';
return preg_replace($pattern, '$1<?php $2; ?>$3', $value);
} | [
"public function blade()\n {\n $raw = str_replace('.blade.php', '', $this->filepath);\n $raw = str_replace('/', '.', $raw);\n $raw = str_replace('views.', '', $raw);\n return $raw;\n }",
"public function printFormTagClosing()\n {\n ?>\n </form>\n <?php\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if HTTP request to $url results in 403 forbidden response. Method returns: true if HTTP request to $url returns HTTP status 403. false if HTTP request to $url returns HTTP status 200 and response body is equal to $body (if given) or 404 is returned (meaning file does not exist, but access is not forbidden). null,... | public static function isAccessToUrlForbidden(string $url, ?string $body = null): ?bool
{
// Try to get provided URL. Use HEAD request for simplicity if response body is of no interest.
$response = \is_string($body) ? wp_remote_get($url) : wp_remote_head($url);
switch (wp_remote_retrieve_re... | [
"public static function statusForbidden() {\n $aStatus = drupal_get_http_header(\"status\");\n if ($aStatus == '403 Forbidden') {\n return true;\n }\n }",
"public function testThatAOnlineHostWithBadUrlReturnsNotA200()\n {\n $url = 'http://www.google.com/ughhhh.htm';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load emoji files return array | private function loadEmoji($path)
{
$files = [];
if (is_dir($path)) {
$basename = basename($path);
$dirs = opendir($path);
if ($dirs) {
while (($file = readdir($dirs)) !== false) {
if ($file !== '.' && $file !== '..') {
... | [
"function read_file()\n{\n\t// Read the htm file\n\t$input = file_get_contents(\"emoji_cheat_sheet.htm\");\n\t// Create an array of all words of the file. (breaking from spaces)\n\t$array = explode(\" \",$input);\n\t// Getting the match from regex to fetch only the links to image files. This has to be suitably modi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function validateRegistrationForm Insert a new valid affiliate into the database Args: none Return: none | private function insertNewAffiliate() {
$queryVals = array(
'~company' => prepDB($this->registrationForm['company']),
'~first' => prepDB($this->registrationForm['first']),
'~last' => prepDB($this->registrationForm['last']),
'~phone' => prepDB($this->registrationForm['phone']),
... | [
"private function validateRegistrationForm() {\n\t\t\t$require = $this->requiredRegistrationFields;\n\t\t\t$this->checkRequired($require);\n\t\t\t// country/state/postal info\n\t\t\t// this removes state from missing array if international\n\t\t\tif ($this->registrationForm['country'] == 'USA') {\n\t\t\t\t// US p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pregmatch the Google sheet ID from the google sheet link | function google_get_sheet_id($link) {
$matches = array();
preg_match('/spreadsheets\/d\/(.*)\/edit/', $link, $matches);
if (!empty($matches[1])) {
return $matches[1];
}
return null;
} | [
"function google_get_sheet_link($id) {\n return \"https://docs.google.com/spreadsheets/d/{$id}/edit\";\n}",
"private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if is a mobile device | public function isMobile(); | [
"public function isMobile() {\n $session = $this->getSession();\n $driver = $session->GetDriver();\n $user_agent = $driver->evaluateScript('return navigator.userAgent');\n return preg_match(\"/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\\.browser|... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new permissionsEmailSingle | public function setPermissionsEmailSingle($permissionsEmailSingle)
{
$this->permissionsEmailSingle = $permissionsEmailSingle;
return $this;
} | [
"public function setPermission($todolist_id,$user_email,$permission)\n \t{\n \t\t$db = Model::getDoctrine();\n\t\t$perm=$this->checkPermByEmail($todolist_id,$user_email,$db);\n\t\tif ($perm) {\n \t\t\t$query=$db->createQueryBuilder();\n\t\t $result = $query->select('p')\n\t ->from('entities\\Share', '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make CSS class names specific to the current path for use in the HTML tag for example: /content/some/path/to/current/content => SomePathToCurrentContent | public function pathCSS($path = null)
{
$path = (is_null($path))
? $this->getPath()->get()
: $path;
// Build Classes based on Path parts names
if($path)
{
foreach(explode('/', $path) as $folder)
{
if(!empty($folder))
$out[] = str_replace(
' ', '',
ucwords(
preg_replace(... | [
"function getCssClass($path) {\n\tif(is_link($path)) return 'link';\n\tif(is_file($path)) return 'file';\n\tif(is_dir($path)) return 'dir';\n\treturn 'error';\n}",
"function highlight($path, $home = false, $normal = '', $selected = 'active') {\n $class = $normal;\n $currentPath = substr($th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register Event service provider | public function registerEventProvider()
{
$this->register(new EventServiceProvider($this));
} | [
"protected function registerEventProvider()\n {\n $this->register(new EventServiceProvider($this));\n }",
"public function registerEvents() : void\n {\n $this->container->singleton('events', function () : Dispatcher {\n return new Dispatcher();\n });\n }",
"public fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the topic event | public function get_event() {
$topic = explode( '.', $this->get( 'topic' ) );
return apply_filters( 'llms_rest_webhook_get_event', isset( $topic[1] ) ? $topic[1] : '', $this->get( 'id' ) );
} | [
"public static function event($topic)\n {\n return self::context()->event($topic);\n }",
"function get_event_topic_id(){\n\t\treturn $this->event_topic_id;\n\t}",
"public function getIdEventTopic()\n {\n return $this->id_event_topic;\n }",
"public function getEvent() \n\t{\n\t\tretur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new post to add the action to the audit log. | public function testCreatePostForAuditLog( AcceptanceTester $I ) {
$I->wantToTest( 'Create a new post to add the action to the audit log.' );
$I->loginAsAdmin();
// Go to new post page.
$I->amOnAdminPage( 'post-new.php' );
// Add a title.
$I->click( '.editor-post-title__input' );
$I->type( 'Test audit l... | [
"public function actionCreate()\n {\n $this->checkAccess('blog___blog__admin');\n $model = new Post();\n\n $model->user_id = Yii::$app->getUser()->getId();\n\n $model->status_id = Publishable::STATUS_DRAFT;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the target file name | public function getTargetFileName()
{
return $this->target_file_name;
} | [
"public function getTargetFilename()\n {\n if ($this->targetFolder->containsFile($this->getFilename()) &&\n strpos($this->copyOptions, 'overwrite') === false &&\n strpos($this->copyOptions, 'autorename') !== false) {\n $this->autorename();\n }\n\n return $thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field string sector_identifier_uri = 26[json_name = "sectorIdentifierUri"]; | public function setSectorIdentifierUri($var)
{
GPBUtil::checkString($var, True);
$this->sector_identifier_uri = $var;
return $this;
} | [
"public function getSectorIdentifierUri()\n {\n return $this->sectorIdentifierUri;\n }",
"public function setSectorIdentifierUri($uri)\n {\n ValidationUtility::ensureNullOrString('$uri', $uri);\n\n $this->sectorIdentifierUri = $uri;\n\n return $this;\n }",
"public functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return_browse_tab This method processes and creates the browse tab Returns html of browse tab | function return_browse_tab(){
global $theme, $image_path, $app_list_strings, $mod_strings, $app_strings;
$ss_brws = new Sugar_Smarty();
$ss_brws->assign("MOD", $mod_strings);
$ss_brws->assign("APP", $app_strings);
require_once('vendor/ytree/Tree.php');
require_once('v... | [
"public function getTabContent() {\n\n\t\t$expandPage = NULL;\n\t\tif (!isset($this->browseLinksObj->expandPage)) {\n\t\t\t$urlInfo = $this->browseLinksObj->curUrlInfo;\n\t\t\tif ($urlInfo['recordTable'] && $urlInfo['recordUid']) {\n\t\t\t\t$record = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord($urlInf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render edit row values | function RenderEditRow() {
global $Security, $gsLanguage, $Language;
// Call Row Rendering event
$this->Row_Rendering();
// id
$this->id->EditAttrs["class"] = "form-control";
$this->id->EditCustomAttributes = "";
$this->id->EditValue = $this->id->CurrentValue;
$this->id->ViewCustomAttributes = "";
... | [
"public function renderEditRow()\n\t{\n\t\tglobal $Security, $CurrentLanguage, $Language;\n\n\t\t// Call Row Rendering event\n\t\t$this->Row_Rendering();\n\n\t\t// id\n\t\t$this->id->EditAttrs[\"class\"] = \"form-control\";\n\t\t$this->id->EditCustomAttributes = \"\";\n\t\t$this->id->EditValue = $this->id->CurrentV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the value as a date and time. | public function formatDatetime($value)
{
return Yii::app()->dateFormatter->formatDateTime($value, $this->dateFormatWidth, $this->timeFormatWidth);
} | [
"public function formatTime($value)\n\t{\n\t\treturn date($this->timeFormat,$this->normalizeDateValue($value));\n\t}",
"public function modifierFormatDateTime($value)\n {\n $params = func_get_args();\n array_shift($params);\n $formatStr = implode(':', $params);\n switch ($formatStr)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a User is following a given serie. Return true if there is one row in table user_serie with the id of the serie, and of the user | public function checkIfFollow($userId, $serieId) {
$users = Users::find($userId)
->series()
->where('serie_id', '=', $serieId)
->count();
if ($users === 1) {
$thereIsOne = json_encode(true);
return $thereIsOne;
} else if ($u... | [
"public function following(User $user){\n return $this->follows()\n ->where('following_user_id', $user->id)\n ->exists();\n }",
"public function isFollowing(User $user)\n {\n /* @var $redis Connection */\n $redis = Yii::$app->redis;\n return (bool) $redis->s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! \brief Returns a list of used item names for a given path. | function getUsedNamesForPath($path)
{
$item = $this->dataModel->getItemByPath($path);
$names = array();
foreach($item['children'] as $path => $data){
$names[] = $data['name'];
}
return($names);
} | [
"public function getNames()\n {\n $allItems = [];\n foreach ($this->items as $item) {\n $allItems[] = $item->getName();\n }\n return $allItems;\n }",
"public function listItems($path, $options = null);",
"public function get_arrPathItems()\n {\n return $thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the hint for an exception handler. | protected function handlerHint(callable $callback)
{
$reflection = new ReflectionFunction($callback);
$exception = $reflection->getParameters()[0];
return $exception->getType()->getName();
} | [
"public function getExceptionHandler() {\r\n if (!isset($this->_settings['exception-handler'])) {\r\n return null;\r\n }\r\n return (string) $this->_settings['exception-handler'];\r\n }",
"public function getHint() {\n\t\tif (empty($this->hint)) {\n\t\t\treturn $this->message;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Required. The notification category to send the test message for. All contacts must be subscribed to this category. Generated from protobuf field .google.cloud.essentialcontacts.v1.NotificationCategory notification_category = 3 [(.google.api.field_behavior) = REQUIRED]; | public function getNotificationCategory()
{
return $this->notification_category;
} | [
"public function setNotificationCategory($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\EssentialContacts\\V1\\NotificationCategory::class);\n $this->notification_category = $var;\n\n return $this;\n }",
"public function setNotificationCategories($var)\n {\n $arr = GPBU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return internal channel ID. | public function getChannelId(); | [
"public function getChannelID();",
"public function getChannelId() {\n return $this->channel->getChannelId();\n }",
"public function channel_id() : string {\r\n return $this->payload[\"channel\"][\"id\"];\r\n }",
"public function getChannelId()\n {\n return isset($this->channel_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encode a string using Q encoding. | public function encodeQ($str, $position = 'text')
{
} | [
"function EncodeQ ($str, $position = \"text\") {\n // There should not be any EOL in the string\n $encoded = preg_replace(\"[\\r\\n]\", \"\", $str);\n\n switch (strtolower($position)) {\n case \"phrase\":\n $encoded = preg_replace(\"/([^A-Za-z0-9!*+\\/ -])/e\", \"'='.sprintf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the temporary directory for media to be generated in. | protected function generateTempDirectory()
{
$tempdir = vsprintf('%s/media-generate-%s', [
sys_get_temp_dir(),
microtime(true),
]);
if (! wp_mkdir_p($tempdir)) {
WP_CLI::error("Failed to create the temp directory $tempdir");
}
add_action('shutdown', function() use ($tempdir) {
WP_CLI::debug("Cl... | [
"private function generateTempDirectory()\n {\n $dirname = uniqid();\n\n $fs = new Filesystem();\n\n $fs->mkdir($this->report_dir.$dirname);\n\n return $this->report_dir.$dirname;\n }",
"private function createNewTempdir(){\n $tempdirname = '';\n do{\n $t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna o disciplina do Diario | public function getDisciplina(){
return $this->disciplina;
} | [
"public function getDisciplina() {\n return $this->oDisciplina;\n }",
"public function getDisciplina() {\n\n return $this->oDisciplina;\n }",
"public function getDisciplina()\n {\n return $this->disciplina;\n }",
"public function GetDiscAtrDisciplina()\n\t{\n\t\treturn $this->_phreezer->G... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
My Account navigation template. | function communityservice_account_navigation() {
cs_get_template( 'myaccount/navigation.php' );
} | [
"public function menu_my_account() {\n\t\tdo_action( 'plugpress_account_view' );\n\t}",
"function woocommerce_account_navigation()\n {\n }",
"function kapee_before_account_navigation() {\n\n\t\t// Name to display\n\t\t$current_user = wp_get_current_user();\n\n\t\tif ( $current_user->display_name ) {\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Match current action name with provided action name | public function matchAction($action)
{
return $this->action === $action;
} | [
"public function setActionName($action) {}",
"public function get_action($action_name, $context = 'view')\n {\n }",
"protected function RetrieveActionName()\n {\n $this->_process_level++;\n if(count($this->_parts) > $this->_URI_Accept_Level && ($c = $this->_parts[$this->_URI_Accep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation removeProductBundleWithHttpInfo Remove product bundle from cart | public function removeProductBundleWithHttpInfo($cart_id, $product_bundle_id)
{
$returnType = '\Swagger\Client\Model\InlineResponse20032';
$request = $this->removeProductBundleRequest($cart_id, $product_bundle_id);
try {
$options = $this->createHttpClientOption();
tr... | [
"protected function removeProductBundleRequest($cart_id, $product_bundle_id)\n {\n // verify the required parameter 'cart_id' is set\n if ($cart_id === null || (is_array($cart_id) && count($cart_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query get business account by ids | public function getBusinessAccountByIds($ids)
{
return $this->getByIds($ids)->role(UserRole::BUSINESS_ACCOUNT);
} | [
"public function getAllBusinessUnitIds();",
"function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Identifies all metrics used in this worksheet Checks the database for alreadyidentified metrics and interacts with the user if necessary | public function identifyMetrics()
{
$this->shell_io->out('Identifying metrics...');
$unknownMetrics = $this->getUnknownMetrics();
if (!$unknownMetrics) {
$this->shell_io->out(' - Done');
unset($unknownMetrics);
return;
}
$context = $this-... | [
"public function fetchMetrics();",
"public function fetchMetrics()\n {\n $names = array_keys($this->groups);\n $rights = $this->groups;\n\n // build SQL fragments\n $outerSelects = [];\n $innerSelects = [];\n foreach ($names as $group) {\n $outerSelects[] = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays plugin activity statistics. | private function _displayPluginActivityStatistics()
{
$statistics = array();
// Combine statistics from all plugins.
foreach ( $this->_plugins as $plugin ) {
$statistics = array_merge($statistics, array_filter($plugin->getStatistics()));
}
// Show statistics.
$this->_io->writeln('<debug>Combined Plugi... | [
"public function show_stats()\r\n {\r\n }",
"function showStatistics() {\n global $options;\n include($options['pluginpath'].\"/statistic/statistics.html.inc.php\");\n}",
"public function actionStatistics()\n {\n return $this->render('statistics');\n }",
"public function plugin_stats() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement addOffreVideo() method. | public function addOffreVideo($data)
{
$data['etat'] = self::$etatImpMetier->getEtatByNum(1);
$data['image'] = self::$metierImpImage->addImage($data['image']);
$data['duree'] = self::$metierImpDuree->addDuree($data['duree']);
$data['devise'] = self::$deviseImpMetier->getDevise($da... | [
"public function extractEmbedToVideo()\n\t{\n\t\t// test listids with special case such as reminder (252) and agenda (253)\n\t\t$checkList = false;\n\t\tif (!empty($this->listIds))\n\t\t{\n\t\t\tif (!is_array($this->listIds))\n\t\t\t\t$list = unserialize($this->listIds);\n\t\t\telse \n\t\t\t\t$list = $this->listIds... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Time spent waiting during this transition. Wait duration corresponds to idle time and does not include break time. Also note that this wait time may be split into several noncontiguous intervals. Generated from protobuf field .google.protobuf.Duration wait_duration = 6; | public function setWaitDuration($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
$this->wait_duration = $var;
return $this;
} | [
"public function getWaitingTime ()\n {\n return round($this->waitingTime * 1000);\n }",
"public function getWaitingTime()\n {\n if ($this->lastActionTime === null) {\n return 0;\n }\n $diff = $this->lastActionTime - ($this->timeProvider->getTime() - $this->getCurren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field civility_id | public function getCivilityId()
{
return $this->civility_id;
} | [
"public function getCivility()\n {\n return $this->civility;\n }",
"public function getIdCovoitureur(): string\n {\n return $this->idCovoitureur;\n }",
"function get_candidat_id() {\n\treturn read_session('abb_id_candidat', false);\n}",
"public function getCouncilId() {\n\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UPDATE SUM RMIC 3 | public function updSumScmRmic3($refid, $staff_id, $scm_rm_tot_amt_rmic, $scm_total_amt_dept_apprv_hod, $scm_rm_tot_amt_apprv_rmic, $scm_rm_tot_amt_apprv_tncpi, $scm_rm_total_amt_approve_tnca, $scm_foreign_tot_amt_rmic, $scm_rm_total_amt, $scm_rm_total_amt_approve_hod, $scm_rm_total_amt_approve_tnca2, $scm_rm_total_amt_... | [
"function total_sisa_paket_update($dapaket_dpaket, $dapaket_jpaket, $dapaket_paket){\r\n\t\t//* UPDATE db.detail_jual_paket.dpaket_sisa_paket ==> sisa paket dari paket yang dibeli akan diupdate akibat dari pengambilan paket /\r\n\t\t/*$sql_sisa_paket=\"UPDATE detail_jual_paket\r\n\t\t\tSET dpaket_sisa_paket=\r\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getZRLocationSettings Get location settings. | public function testGetZRLocationSettings()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
} | [
"public function testGetZRLocationSettings()\n {\n }",
"public function testListZRLocations()\n {\n }",
"public function testGetZRLocationProfile()\n {\n }",
"abstract public function getSettings();",
"public function testChangeZRLocation()\n {\n }",
"public function getSettings();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check external links for existence | protected function checkExternalLinks()
{
if (!$this->getEditionOption('plugins.options.LinkCheck.check_external_links')) {
return;
}
$checker = new LinkChecker();
$this->writeLn('Checking external links....');
$errors = false;
$numLinks = 0;
f... | [
"public function shouldCheckLink($url);",
"public function hasHref();",
"private function checkExternal( $url ) {\n\t\treturn isset( $url ) ? preg_match( '/(http)s?/', $url ) : false;\n\t}",
"function is_external_link($url)\n {\n return strpos($url, config('app.url')) === FALSE;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Static function to get the XML attribute from the SimpleXmlElement object. | private static function getXmlAttribute(\SimpleXMLElement $xmlObject, string $attribute)
{
if (isset($xmlObject[$attribute])) {
return (string) $xmlObject[$attribute];
}
return null;
} | [
"function get_attribute($attribute)\n {\n $attributes = $this->xml_value_[0][\"attributes\"];\n return $attributes[$attribute];\n }",
"private function get_attribute($attr)\n\t{\n\t\t$attributes = $this->saml->getAttributes();\n\t\treturn $attributes[$attr][0];\n\t}",
"public function getAttr()\n {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ellipseArc($mx, $my, $rx, $ry, $xar, $laflag, $sflag, $x, $y, $style) A rx ry xaxisrotation largearcflag sweepflag x y $mx,$my = starting absolute curve point $rx,$ry = ellipse radiuses $xar = xaxisrotation $laflag = largearcflag $sflag = sweepflag $x,$y = last absolute curve point | public static function ellipseArc($mx=100, $my=100, $rx=20, $ry=50, $xar=0, $laflag=0, $sflag=0,
$x=200, $y=100, $style='stroke:black;stroke-width:1;fill:none;') {
echo "<path d='M$mx $my A$rx $ry $xar $laflag $sflag $x $y'
style='$style' />";
return array($mx,$my,$rx,$ry,$xar,$laflag,$sflag,$x,$y);
} | [
"public static function ellipseArcCcw($mx=100, $my=100, $rx=20, $ry=50,\r\n$x=200, $y=100, $style='stroke:black;stroke-width:1;fill:none;') {\r\necho \"<path d='M$mx $my A$rx $ry 0 0 0 $x $y' \r\nstyle='$style' />\";\r\nreturn array($mx,$my,$rx,$ry,$x,$y);\r\n}",
"public static function ellipseArcCw($mx=100, $my=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of 'relive_total_time' property | public function getReliveTotalTime()
{
$value = $this->get(self::RELIVE_TOTAL_TIME);
return $value === null ? (integer)$value : $value;
} | [
"public function getReliveTime()\n {\n $value = $this->get(self::RELIVE_TIME);\n return $value === null ? (integer)$value : $value;\n }",
"public function getTotalTime()\n {\n return $this->total_time;\n }",
"public function getTotalTime()\n {\n return $this->totalTime... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Arguments $user (&Object) Returns: Object isKickRequired (Boolean) isIPDifferent (Boolean) | function handleUserIPChangeCheck (&$user) {
$previousIP = getPreviousLastIPValue();
$currentIP = Users\Session\getCurrentIP();
$hasEmptyPreviousIP = empty($previousIP);
$hasDifferentIP = (
$hasEmptyPreviousIP ||
($currentIP != $previousIP)
);
$hasIPCheckDisabled = ($user['noipch... | [
"public function isIpKicked() {\n\t\treturn isset($_SERVER['REMOTE_ADDR']) && $this->kicksService->isIpAddressKicked($_SERVER['REMOTE_ADDR']);\n\t}",
"function handleUserKick(&$user, $params) {\n $userID = $user['id'];\n $isKickedOut = ($user['dokick'] == 1);\n $timestamp = $params['timestamp'];\n\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[0] Initializes a new instance of the Random class, using a timedependent default seed value. [1] Initializes a new instance of the Random class, using the specified seed value. | public function __construct($Seed = null) {
parent::__construct();
if (!is_null($Seed)) {
mt_srand($Seed);
}
} | [
"function srand ($seed = null) {}",
"function mt_srand ($seed = null) {}",
"function _seedRandom() {\n if(!$this->_srand) {\n srand((double)microtime() * 1000000);\n $this->_srand = true;\n }\n }",
"function __construct($seed = 0)\n\t{\n\t\tif( func_num_args() == 0 ){\n\t\t\t$seed = getmypid(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ expand a network alias, if necessary | function alias_expand_net($name) {
global $aliastable;
if (isset($aliastable[$name]) && is_subnet($aliastable[$name]))
return $aliastable[$name];
else if (is_subnet($name))
return $name;
else
return null;
} | [
"function alias_expand($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name]))\n\treturn $aliastable[$name];\n\telse if (is_ipaddr($name) || is_subnet($name))\n\treturn $name;\n\telse\n\treturn null;\n}",
"function alias_expand_net($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name])... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if current user is not the author and does not have permitted role to edit an item | public function cannotEdit($author = 0) {
return !$this->canEdit($author);
} | [
"public function allowEdit()\n\t{\n\t\treturn $this->id == Auth::user() -> id || Auth::user() -> admin;\n\t}",
"public function userNotOwnerOrAdmin()\n {\n if(auth()->id() != $this->user_id && !auth()->user()->hasRole('admin')) return true;\n return false;\n }",
"public static function can... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the second value for this point | public function set_second_value($value) {
if (is_int($value) || is_float($value)) {
$this->secondvalue = $value;
} else if (is_string($value)) {
if (strpos($value, '.')!==false) {
$this->secondvalue = (float)$value;
} else {
$this->sec... | [
"public function setX2($x2){\n $this->x2 = $x2;\n }",
"public function use_second_xvalue() {\n $this->usesecondxvalue = true;\n }",
"public function setValue2($var)\n {\n GPBUtil::checkInt32($var);\n $this->Value2 = $var;\n\n return $this;\n }",
"public function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts a new payer into the payer table | public function insert_new_payer($input_data) {
$table_name = $this->wpdb->prefix . '_Payers';
$this->wpdb->insert(
$table_name,
array(
'merchantid' => $input_data["merchantid"],
'payerid' => $input_data["payerid"],
'email' => $input_data["email"]
)
);
} | [
"public function insertSkier($skier) {\n try {\n\t$stmt = $this->db->prepare('INSERT INTO Skier (userName, firstName, lastName, yearOfBirth)'\n\t\t\t\t . 'VALUES(:userName, :firstName, :lastName, :yearOfBirth)');\n\t$stmt->bindValue(':userName', $skier->userName);\n\t$stmt->bindValue(':firstName', $skier->first... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the created date formatted with time | function getFormattedCreatedDateTime()
{
return $this->created_at->format('d/m/Y H:i:s');
} | [
"public function getCreatedDateString()\n {\n return date('l, F j, Y g:i:s A', strtotime($this->created_date));\n }",
"public function createDate () {\n return date('Y-m-d H:i:s', $this->created);\n }",
"public function getFormattedCreateDate();",
"public function created() {\n\t\tretur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get "allow negative" flag value | public function getAllowNegative()
{
return ($this->_allowNegative);
} | [
"public function getAllowNegative() : bool\r\n {\r\n return $this->allowNegative ?? self::DEFAULT_ALLOW_NEGATIVE;\r\n }",
"public function getNegativeUnwrapped()\n {\n return $this->readWrapperValue(\"negative\");\n }",
"public function getNegativeIntValue() {}",
"protected function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Site maintenance. Determine if the website is under maintenance. There is a default method for determining if this is the case, but modules can define their own methods, too. If any of the modules' methods returns true then the site is considered to be under maintenance. | function site_maintenance()
{
return maintenance_file_exists()||module_invoke_all('maintenance');
} | [
"function chkIsSiteUnderMaintenance()\n\t{\n\t\tglobal $CFG;\n\n\t\tif(!isAdmin())\n\t\t\t{\n\t\t\t\t$currentPage = strtolower($CFG['html']['current_script_name']);\n\t\t\t\tif($CFG['admin']['module']['site_maintenance'] AND $currentPage != 'maintenance')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Unset all of the session variab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation addBillOfLadingAsyncWithHttpInfo Create a billOfLading | public function addBillOfLadingAsyncWithHttpInfo($body)
{
$returnType = '\Infoplus\Infoplus\Model\BillOfLading';
$request = $this->addBillOfLadingRequest($body);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
funct... | [
"public function getBillOfLadingByIdAsyncWithHttpInfo($bill_of_lading_id)\n {\n $returnType = '\\Infoplus\\Infoplus\\Model\\BillOfLading';\n $request = $this->getBillOfLadingByIdRequest($bill_of_lading_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It is the tag that is listed in RabbitMQ UI as the consumer "name" | private function getConsumerTag(): string
{
return sprintf("%s_%s_%s", $this->aliasName, gethostname(), getmypid());
} | [
"public function ConsumerName()\n {\n return $this->consumer['name'];\n }",
"public function getConsumerName()\n {\n return $this->consumer_name;\n }",
"public function getConsumerName() {\n\t\treturn $this->_getField(self::$CONSUMER_NAME);\n\t}",
"public function getConsumerName()\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the shipping information for the shipment. | public function getShippingInformation(){
return $this->_getData(self::SHIPPING_INFORMATION);
} | [
"public function getShippingInfo();",
"public function getShippingInformation();",
"public function getShipping() {\n return Mage::getSingleton(\"customer/session\")->getPargoShippingAddress();\n }",
"public function getShippingPackageInfo()\n {\n return $this->shippingPackageInfo;\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of livro_isbn | public function getLivroIsbn()
{
return $this->livro_isbn;
} | [
"public function getIsbn_livro()\r\n {\r\n return $this->isbn_livro;\r\n }",
"public function getISBN();",
"public function getIsbn()\n {\n return $this->isbn;\n }",
"public function getISBN()\n {\n return $this->iSBN;\n }",
"public function getIsbn()\n {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the order data from supplied context and order objects. | public function loadData(Context $context, Order $order)
{
if (!Validate::isLoadedObject($order))
return;
$customer = new Customer((int)$order->id_customer);
// The order reference was introduced in prestashop 1.5 where orders can be split into multiple ones.
$this->order_number = isset($order->reference) ... | [
"private function loadOrder()\n {\n $brqOrderId = $this->getOrderIncrementId();\n\n //Check if the order can receive further status updates\n $this->order->loadByIncrementId((string) $brqOrderId);\n\n if (!$this->order->getId()) {\n $this->logging->addDebug('Order could not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test Requested Attributes With Id | public function testRequestedAttributesWithId() {
$this->Query->Controller->request
->expects($this->any())
->method('query')
->with('attributes')
->will($this->returnValue('att1,att2,id'));
$results = $this->Query->requestedAttributes();
$this->assertEquals(array('att1', 'att2', 'id'), $res... | [
"public function findAttributesById($id, $dynamic);",
"public function testInventoryAttributeValueGETRequestInventoryIDAttributeGroupsAttributeGroupIDAttributeValuesAttributeIDGet()\n {\n }",
"public function test_id() {\n\t\t$reflected = self::get_method('id');\n\t\t$form = new Form();\n\n\t\t$this->asse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find client that will be expired in the next 30 days. | public function toBeExpired(): \Illuminate\Http\JsonResponse
{
$today = new \DateTime('now');
$from = $today->format('Y-m-d');
$end = $today->add(new \DateInterval('P30D'))->format('Y-m-d');
$clients = $this->client->whereBetween('membership_expiry_date', [$from, $end])->get();
... | [
"public function findExpired()\n {\n $date = new \\DateTime();\n $date->setTime(0, 0, 0);\n $date->modify('-2 weeks');\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT c FROM AppBundle:Coupon c '\n . 'WHERE c.expireDate < :date'\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the aArchivos for this model. | public function aArchivos()
{
return $this->hasMany('App\Models\AArchivo','cia_id','id');
} | [
"public function getComparte_archivos(){\r\n return $this->comparte_archivos;\r\n }",
"public function getDilArchivos()\r\n {\r\n return $this->dil_archivos;\r\n }",
"public function _listarArchivos()\n {\n $objIterator = new RecursiveIteratorIterator($obj_Directory = new RecursiveD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get search label query. | public function getSearchLabelQuery()
{
$query = (new Db\Query())->select(['csl.crmid', 'csl.setype', 'csl.searchlabel'])
->from('u_#__crmentity_search_label csl')->innerJoin('vtiger_tab', 'csl.setype = vtiger_tab.name');
$where = ['and', ['vtiger_tab.presence' => 0]];
if ($this->moduleName) {
$where[] = [... | [
"public function search_label($query)\n {\n }",
"public function search_label( $query ) {\n\t\tglobal $pagenow, $typenow;\n\n\t\tif ( 'edit.php' !== $pagenow || 'cs-activity' !== $typenow || ! get_query_var( 'cs-activity_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.\n\t\t\treturn $qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of supplier_id | public function getSupplier_id()
{
return $this->supplier_id;
} | [
"public function getSupplierId()\n {\n return $this->supplierId;\n }",
"public function getSupplierId() : SupplierId\n {\n return $this->supplierId;\n }",
"public function getIdSupplier()\n {\n return $this->idSupplier;\n }",
"function get_supplier_id($su... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fix the max value of "order_num" and set that before the save | public function before_save(&$obj)
{
$field_name = $this->get_order_field($obj);
$table_name = $obj->get_table();
$curval = $obj->$field_name;
if ($curval == null || intval($curval) < 1)
{
$new_map = array_flip($obj->field_maps);
if (array_key_exists($field_name, $new_map)) $field_name = $new_map[$fiel... | [
"public function setHighestOrderNumber()\n {\n }",
"private function get_max_order_number() {\n\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $this->max_order_number ) ) {\n\t\t\treturn $this->max_order_number;\n\t\t}\n\n\t\treturn $this->max_order_number = $wpdb->get_var( \"SELECT MAX( CAST( meta_value AS SIGN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for shareCart Warenkorbvorlage erstellen. | public function testShareCart()
{
} | [
"public function testCartConfirmCheckout()\n {\n }",
"public function testSecondMarketSell()\n {\n }",
"public function testRetrieveCashDrawerShift()\n {\n\n }",
"public function testCartCheckout()\n {\n }",
"public function testCartAddLoyalty()\n {\n }",
"public function tes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Automatic HTTPS Rewrites setting. Enable the Automatic HTTPS Rewrites feature for this zone. | public function get_zone_settings_automatic_https_rewrites( $id ) {
return $this->build_request( "zones/$id/settings/automatic_https_rewrites" )->fetch();
} | [
"public function update_zone_settings_automatic_https_rewrites( string $id, bool $on ) {\n\t\t\t$args = array(\n\t\t\t\t'value' => ( true === $on ) ? 'on' : 'off',\n\t\t\t);\n\t\t\treturn $this->build_request( \"zones/$id/settings/automatic_https_rewrites\", $args, 'PATCH' )->fetch();\n\t\t}",
"public function ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If this reference is of an entity type, this will return a valid entity type reference to the type definition. Otherwise, it will return a bad entity type reference. | public function asEntity(): IEntityTypeReference
{
if ($this instanceof IEntityTypeReference) {
return $this;
}
$typeDefinition = $this->getDefinition();
if ($typeDefinition->getTypeKind()->isEntity()) {
assert($typeDefinition instanceof IEntityType);
... | [
"protected function getReferencedEntityType() {\n $field_def = $this->getFieldDefinition();\n $entity_type_id = $field_def->getItemDefinition()->getSetting('target_type');\n return $this->entityTypeManger->getDefinition($entity_type_id);\n }",
"public function asEntityReference(): IEntityReferenceTypeRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Singleton access to RbacAuthorization controller | public function getRbacAuthorization()
{
return Controllers\RbacAuthorizationController::getInstance();
} | [
"public function getAuthorization()\n {\n return Controllers\\AuthorizationController::getInstance();\n }",
"public static function getInstance() {\n if (static::$instance == null) {\n static::$instance = new AnnAuthorization();\n }\n return static::$instance;\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BuddyPress creates ajaxurl, no need to define ajaxurl then If BuddyPress is not active, add ajaxurl in the head | public function ajax_url() {
if ( function_exists( 'bp_is_active' ) ) {
return;
}
?>
<script type="text/javascript">
var ajaxurl = "<?php echo admin_url( 'admin-ajax.php' );?>";
</script>
<?php
} | [
"function wp_experts_ajax_url_admin_head() {\r\n echo '<script type=\"text/javascript\"> var ajaxurl = \"'.admin_url('admin-ajax.php').'\"; </script>';\r\n}",
"public static function define_ajaxurl() {\n ?>\n <script type=\"text/javascript\">\n ajaxurl = '<?php echo admin_url('admin-aj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to purge a URL, sending the result as an XHR/JSON response. | public function handle_purge_url_request() {
$cache = $this->plugin->cache;
$purge = $this->plugin->purge;
$url = isset( $_POST['url'] ) ? $_POST['url'] : '';
$host = parse_url( $url, PHP_URL_HOST );
$path = parse_url( $url, PHP_URL_PATH );
$purge_ctx = $purge->purge_in... | [
"public function purge($url);",
"public function purgeUrl($url);",
"public function purge($url, array $headers = []);",
"public function API_purge ( $url ) {\n\t\t$this->_laststatus = null;\n\n\t\t#prevent stupid\n\t\tif( empty($url) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_curl_init();\n\t\tcurl_setopt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the string is a valid time in HH:MM 12hour format, with optional leading 0. | public function isTime_HM12( string $time ): bool {
return (bool) @preg_match(
'/^(0?[1-9]|1[0-2]):[0-5][0-9]$/',
$time
);
} | [
"static function validate12HrTime($param)\n {\n if (preg_match('/00:00:00/', $param) == false) {\n return preg_match(\"(((0[1-9])|(1[0-2])):([0-5])(0|5)\\s(A|P)M)\", $param);\n }\n return false;\n }",
"function check_time($string) {\n if (preg_match('@[0-9]{2}:[0-9]{2}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |