query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Determine if the passed token has a condition of one of the passed types.
public function hasCondition($stackPtr, $types) { return $this->__call(__FUNCTION__, func_get_args()); }
[ "public function hasConditionType(string $type): bool;", "private function foundOneOf($tokentypes) {\n\t\tforeach ( $tokentypes as $tokentype ) {\n\t\t\tif ($this->token->getType () == $tokentype)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasCondition();", "function isApplicableF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy datas from $_POST to object
public function copyFromPost() { /* Classical fields */ foreach ($this->fields AS $key => $more) { if (array_key_exists($key, $_POST)) { /* Do not take care of password field if empty */ if ($key == 'passwd' AND empty($_POST[$key])) { continue; } /* Automatically encrypt password in MD5 ...
[ "protected function copyFromPost(&$object) {\r\n\t\t/* Classical fields */\r\n\t\tforeach ( $_POST as $key => $value ) {\r\n\t\t\tif ($key == 'active_column' || $key == 'active_menu' || $key == 'active_element') {\r\n\t\t\t\t$key = 'active';\r\n\t\t\t}\r\n\t\t\tif (key_exists($key, $object)) {\r\n\t\t\t\t$object->{...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select Specific details of lead specified in arguments
function selectLeadDetails($leadId, $select = array('salutation_name', 'first_name', 'last_name')) { global $db; $strSelect = implode(', ', $select); try { $stmt = $db->prepare("SELECT $strSelect FROM leads l WHERE l.id = :leadid...
[ "public function lead_details($lead_id){\n\n $this->db->select('Ld.id,Ld.lead_identification,Ld.lead_ticket_range,Ld.opened_account_no,Ld.created_by_branch_id,Ld.customer_name,Ld.contact_no,Ld.remark,La.employee_name,La.status,La.is_deleted,La.is_updated,La.followup_date,db_master_products.title,rs.reminder_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is version order creation time?
public function isVersionOrderCreationTime();
[ "public function isVersionOrderCreationTime()\n {\n $versionOrder = $this->getVersionOrder();\n\n return $versionOrder == self::VERSION_ORDER_CREATION_TIME;\n }", "public function shouldCreateVersion() {\n\t\treturn $this->createVersion;\n\t}", "public function hasVersions(): bool;", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject the current media storage
public function setMediaStorage(MediaStorageInterface $mediaStorage);
[ "public function upload_media_in_storage() {\n \n // Upload the media's files\n (new MidrubBaseAdminComponentsCollectionSettingsHelpers\\Settings)->upload_media_in_storage();\n \n }", "protected abstract function getMediaObjectPersistence();", "public function getMediaStorage()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function scrape_between This function returns all data between two HTML tags to reduce search space.
function scrape_between($data, $start, $end){ $data = stristr($data, $start); // Stripping all data from before $start $data = substr($data, strlen($start)); // Stripping $start $stop = stripos($data, $end); // Getting the position of the $end of the data to scrape $data = substr($data, ...
[ "public static function getBetweenText( $html, $tag_before, $tag_after ) { \n\t\t$tag_before = preg_quote($tag_before);\n\t\t$tag_after = preg_quote($tag_after);\n\t\t$match = '';\n\t\tpreg_match_all(\"/$tag_before(.*?)$tag_after/uis\", $html, $match);\n\t\treturn $match[1];\n\t}", "function getTextBetweenHTML($...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtains lead routing rules.
public function getRoutingRules($data) { $admin = &Yii::app()->settings; $online = $admin->onlineOnly; Session::cleanUpSessions(); $sessions = Session::getOnlineUsers(); $criteria = new CDbCriteria; $criteria->order = "priority ASC"; $rules = X2Model::model('LeadR...
[ "protected function rewrite_rules() {\n $rules = array();\n foreach ( $this->routes as $route ) {\n /** @var Route $route */\n $rules = array_merge($rules, $route->rewrite_rules());\n }\n return $rules;\n }", "public function getRoutingRules($data) {\n\t\t$admi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unset relevent keys before stats object is inserted into db
public function unsetKeysBeforeCreate($stats) { foreach ($this->keysOnlyUsedDuringCreation() as $key) { unset($stats[$key]); } return $stats; }
[ "public static function reset_draw_stats_entries()\r\n {\r\n db::sql(\"DELETE FROM `tl_users_stats_draw`;\", DB_NAME);\r\n }", "public function clearData()\n {\n $this->save();\n $this->_data = array();\n $this->_indexes = array();\n $this->_preloaded = false;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to check if archive is a flex loop. This doesn't check if viewing an actual archive, but this layout should not be an option if ! is_archive()
function mai_is_flex_loop() { // Bail if not a content archive. if ( ! mai_is_content_archive() ) { return false; } // Get columns. $columns = mai_get_columns(); // If we have more than 1 column or if we are using featured image as bg image, it's a flex loop. if ( ( $columns > 1 ) || ( 'background' === mai_get...
[ "function mai_is_content_archive() {\n\n\tglobal $wp_query;\n\n\tif ( ! $wp_query->is_main_query() ) {\n\t\treturn false;\n\t}\n\n\t$is_archive = false;\n\n\t// Blog\n\tif ( is_home() ) {\n\t\t$is_archive = true;\n\t}\n\t// Term archive\n\telseif ( is_category() || is_tag() || is_tax() ) {\n\t\t$is_archive = true;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created Community in storage.
public function store(CreateCommunityRequest $request) { $input = $request->all(); $community = $this->communityRepository->create($input); $community->users()->attach(Auth::id()); Flash::success(trans('flash.store', ['model' => trans_choice('functionalities.communities', ...
[ "public function store(CreateCommunityRequest $request)\n {\n $input = $request->all();\n\n $community = $this->communityRepository->create($input);\n\n Flash::success('Community saved successfully.');\n\n return redirect(route('communities.index'));\n }", "public function newCom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all tweets with mentioned hashtag since id.
function campaign_tweetcounter_get_tweets($oauth, $hashtag, $since_id = FALSE) { $statuses = array(); $hashtag = preg_replace('/^\#/', '', $hashtag); $params = array( 'q' => '#' . $hashtag, 'count' => '100', 'result_type' => 'recent', 'include_entities' => 'true', ); if ($since_id) { $para...
[ "protected function generateTweetsByHashtag()\n {\n $this->setTweets($this->twitter->getSearch(array(\n 'q' => '#'.$this->value,\n 'count' => 100,\n 'result_type' => 'recent'\n ))->statuses);\n }", "public function getTwitterHashtags()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses $smNavigationData looking for the block pertaining to the current SMTool or SMFolder. Returns it.
protected function getNavigationDataForThisObject($navigationData = null) { global $smSiteNavigationData; if (!$navigationData) { $navigationData = $smSiteNavigationData; } $returnVal = null; // $this is an SMFolder: $this.id should equal $navigationData['site_instance_id'] if (get_class($this) == 'S...
[ "private function navigationDataForCurrentFolder($incomingData = null) {\n\t\t\tglobal $smSiteNavigationData;\n\t\t\t$returnData = null;\n\t\t\t\n\t\t\t// choose navData based on what we got (since this is a recursive method)\n\t\t\tif ($incomingData) {\n\t\t\t\tif (smDebugToolStructure) { echo 'navigationDataForCu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Injecting dependencies. This time we have typehinted our TwitterFeedReader to ensure that we can't pass strange dependencies into our constructor. THAT guy is foiled!
public function __construct(TwitterFeedReader $twitterFeedReader) { $this->twitterFeedReader = $twitterFeedReader; }
[ "public function testFeedReaderCanBeInstantiated()\n {\n $s = new TwitterFeedReader;\n }", "public function __construct()\n {\n $this->twitter = new TwitterRepo();\n }", "function __construct()\n {\n $this->twitter = new TwitterOAuth($this->consumer, $this->consumersecret, $t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the validation rule builders.
public function getBuilders(): array { return collect($this->rules)->map(function ($rules, string $actionMethod) { return $this->resolveRulesFor($actionMethod); })->all(); }
[ "public static function builders()\n {\n return self::$builders;\n }", "function getBuilders(): array\n {\n return $this->builders;\n }", "public function getBuilders()\r\n {\r\n foreach ($this->_builders as &$builder) {\r\n if (is_string($builder)) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation gETCarrierAccountsAsync List all carrier accounts
public function gETCarrierAccountsAsync() { return $this->gETCarrierAccountsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; } ); }
[ "public function gETCarrierAccounts()\n {\n $this->gETCarrierAccountsWithHttpInfo();\n }", "public function listAccounts()\n {\n return $this->apiRequest('system.listaccounts');\n }", "public function listAllAccounts(){\r\n return $this->identityGateway->listAllAccounts();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
two uses to this script: 1. load cities into cities table (done only once). (will be done when loadToDB==1) 2. (primary usage) search venues data using the API. (when requestData==1). returns something og the form array(boolean, "error message")
function addNewCity($foursquare,$cityName, // cityName - no underscore $jsonsDir,$venuesDir,$splitNum,$categotyId,$loadToDB,$requestData,$conn){ // google API part $googleApiKey = "AIzaSyDutGO-yGZstF2N3IjGOUv8kWYWi9aGGGk"; $boundingBox = $foursquare->getBoundingBox($cityName,$googleApiKey); // null when we hav...
[ "function discoverWorldcitiesAvailable()\n{\n global $dbConn;\n $params = array();\n $query = \"SELECT C.id as cityid,C.country_code, C.state_code, C.name, C.latitude, C.longitude, CO.name AS country_name, ST.state_name FROM webgeocities AS C INNER JOIN cms_countries AS CO ON C.country_code=CO.code LEFT J...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Doctors data API accepts four parameters doctor_id : doctor id which user will select API will return following parameters doctors details all doctors related details address address from previously booked camps for which same doctor was assigned message message relevant to api response status SUCCESS / FALSE $user_i...
public function doctor_data(){ $response_data = ''; $address = ''; $user_id = $this->input->post('doctor_id'); $doctors_data = $this->db->query("SELECT * FROM doctors WHERE doctors.id = '".$user_id."'"); if ($doctors_data->num_rows() > 0) { $address_data = $this->db->query("SELECT * FROM camp_c...
[ "public function get_doctor_detail($doctor_id) {\n $doctor_query = \"\n SELECT\n user_id,\n user_first_name,\n user_last_name,\n user_photo,\n user_photo_filepath,\n user_status,\n user_phone_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function returns the default value of a parameter.
protected function getDefaultValue($param) { return self::$param_info[$param]['default']; }
[ "abstract protected function getDefaultValue($param);", "function default_value(&$var, $def = null) {\n return isset($var)?$var:$def;\n}", "public function defaultValue($default = NULL);", "public function getDefaultValue() { return $this->default_value; }", "private static function parse_policy_paramete...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Redirect to new URL. Used as a fallback function for the old URL structure of Elementor page edit URL. Fired by `template_redirect` action.
public function redirect_to_new_url() { if ( ! isset( $_GET['elementor'] ) ) { return; } $document = Plugin::$instance->documents->get( get_the_ID() ); if ( ! $document ) { wp_die( __( 'Document not found.', 'elementor' ) ); } if ( ! $document->is_editable_by_current_user() || ! $document->is_built...
[ "function _template_redirect() {\n\n\t\t}", "public function template_redirect() {\n\t\t// If there is no path, nothing to do.\n\t\tif ( empty( $_SERVER['REQUEST_URI'] ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$path = \\sanitize_text_field( \\wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\n\t\t// If it's not a wp-sitemap requ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as shippingCarrierUsed This field is deprecated.
public function getShippingCarrierUsed() { return $this->shippingCarrierUsed; }
[ "public function getShippingServiceUsed()\n {\n return $this->shippingServiceUsed;\n }", "public function getFreightShipping()\n {\n return $this->freightShipping;\n }", "public function getListedShippingServiceCost()\n {\n return $this->listedShippingServiceCost;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a die to dieArray
public function add_die($die) { $this->dieArray[] = $die; }
[ "public function add_die(BMDie $die) {\n // need to search with strict on to avoid identical-valued\n // objects matching\n if (!in_array($die, $this->validDice, TRUE)) {\n if (is_array($die->skillList)) {\n foreach ($die->skillList as $skill) {\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Dim in an OpenXML Drawing (pictures in an XLSX)
function TbsPicGetDim_Drawings($Txt, $Pos, $FieldPos, $FieldLen, $Offset, $dim_inner) { // The <a:ext> coordinates must have been found previously. if ($dim_inner===false) return false; // The current file must be an XLSX drawing sub-file. if (strpos($this->TBS->OtbsCurrFile, 'xl/drawings/')!==0) return f...
[ "function TbsPicGetDim_Drawings($Txt, $Pos, $FieldPos, $FieldLen, $Offset, $dim_inner) {\n\n\t\t// The <a:ext> coordinates must have been found previously.\n\t\tif ($dim_inner===false) return false;\n\t\t// The current file must be an XLSX drawing sub-file.\n\t\tif (strpos($this->TBS->OtbsCurrFile, 'xl/drawings/')!...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the model class.
public function getModelClass(): string { return $this->model_class; }
[ "public function getModelClass()\n\t{\n\t\treturn $this->model_class;\n\t}", "final public function modelClass()\r\n {\r\n $parts = explode('\\\\', get_class($this));\r\n return $parts[count($parts) - 1];\r\n }", "protected function _getClassModel()\r\n {\r\n return $this->getModel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all articles with a technical name like the string given.
public function getWithTechnicalNameLike($technicalName) { return $this->model ->newQuery() ->with(['media', 'translations' => function ($query) { $query->where('locale', content_locale()); }]) ->where('technical_name', 'like', "{$technicalName...
[ "function searchArticlesByName($article_name, $ignore_offlines = false, $clang = false, $category = false) {\r\n\t\tglobal $REX;\r\n\t\tif($clang === false) $clang = $REX[CUR_CLANG];\r\n\t\t$offline = $ignore_offlines ? \" and status = 1 \" : \"\";\r\n\t\t$oocat = $category ? \" and startpage = 1 \" : \"\";\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load all initialized actions/filter, models and external files
public function load() { $this->includes(); $this->inits(); }
[ "public function _loadFilters()\n {\n //include_once XOOPS_ROOT_PATH.'/class/filters/filter.php';\n //foreach ($this->_filters as $f) {\n //\t include_once XOOPS_ROOT_PATH.'/class/filters/'.strtolower($f).'php';\n //}\n }", "public static function init() {\n\t\tcore::loadClass(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the url of the video that can be inserted in an iframe
public function buildVideoUrl($params) { $videoId = $this->_getVideoId($params); if (!empty($videoId)) { $videoUrl = '//vk.com/video_ext.php' . $videoId; if ($iframeUrlParams) { $videoUrl = $this->_addParamsToUrl($videoUrl, $iframeUrlParams); } return $vid...
[ "private function createVideoUrl() {\n\t\t$arguments = array();\n\t\t$arguments['tx_jwplayer_pi1'] = array();\n\t\t$arguments['tx_jwplayer_pi1']['action'] = 'showVideo';\n\t\t$arguments['tx_jwplayer_pi1']['controller'] = 'Player';\n\t\t$settings = $this->settings;\n\t\t$settings['autostart']= TRUE;\n\t\t$settings['...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the Organisation model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Organisation::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
[ "protected function findModel($id)\n {\n if (($model = Organization::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('error', 'backend.controllers.organization_page_error', ['ru' => 'The requested page does not exist.']));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return true if the linked list is empty
public function isEmpty() { //return false if linked list has nodes }
[ "public function is_empty()\r\n\t{\r\n\t\treturn empty( $this->list );\r\n\t}", "public function isEmpty() {\n return 0 === sizeof($this->list);\n }", "function isEmpty() {\n return empty($this->head) && empty($this->tail);\n }", "public function isEmpty()\n {\n return $this->list->...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of fv_economic_activity.
public function getEconomic_activity() { return $this->fv_economic_activity; }
[ "public function getActivity()\n {\n if (!isset($this->data['fields']['activity'])) {\n if ($this->isNew()) {\n $this->data['fields']['activity'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('activity', $this->data['fields'])) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: Dashboard Google Page Rank Plugin URI: Description: Shows your google pagerank in the wordpress dashboard Author: Weston Deboer Version: 1.1 Author URI:
function gpr_wp_dashboard_test() { include('pagerank.php'); $url = get_bloginfo('url'); echo $url.' has a Page Rank of '.$pr_rank; echo getpagerank($url ); }
[ "function PN_Referer_Default()\n{\n\tglobal $pluginMenuURL, $pluginSelfParam;\n\tif (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['page']))\n\t\t$_GET['page'] = $_POST['page'];\n\t\n\t$page = Setting::getBlogSetting('RowsPerPageReferer',20);\n\tif (empty($_POST['perPage'])) { \n\t\t$perPage = $page; \n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a gallery based on slug.
public function get_gallery_by_slug( $slug ) { return envira_get_gallery_by_slug( $slug ); }
[ "public static function findBySlug($slug)\n {\n return self::where(['slug' => $slug])->with('photos')->first();\n }", "function ap_get_galleries()\r\n{\r\n return get_posts([\r\n 'post_type' => 'rl_gallery',\r\n ]);\r\n}", "protected function listGalleries()\n {\n $galleries ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will register a webhook url for the invitee.canceled event
public function registerInviteeCanceled($url){ return $this->register(['url'=>$url,'events'=>['invitee.canceled']]); }
[ "public function removeWebhook();", "public function get_cancel_endpoint()\n {\n }", "abstract public function onCancel(Request $request);", "public function getCanceledUrl()\n {\n return $this->getVal('canceled_url');\n }", "function set_cancel_url($cancel_url){\n $this->canc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the version number of the plugin.
public function get_plugin_version() { return $this->version; }
[ "public static function get_version() {\n\t\t$plugin = self::get_instance();\n\t\treturn $plugin->version;\n\t}", "public static function get_plugin_version() {\n\t\t\t$self = self::get_instance();\n\n\t\t\tif ( ! isset( $self->version ) ) {\n\t\t\t\t$data = get_file_data( $self->plugin_file, array(\n\t\t\t\t\t'V...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test report with empty constants
public function test_report_with_empty_constants() { $this->constants = new TestConstants(); $sut = $this->make_instance(); $run = $sut->run(); codecept_debug($run); $this->assertMatchesJsonSnapshot(json_encode($run, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); }
[ "public function testNoOptions()\n {\n $this->executeReport($this->getResults(), array());\n }", "public function testCommandWithReportConfigurationUnknown(): void\n {\n $process = $this->phpbench(\n 'run --report=\\'{\"generator\": \"foo_table\"}\\' benchmarks/set4/NothingBench....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process export remaining carts
function processExportRemainingCarts($idShop, $module) { $data = $module->cronExport('carts', $idShop, true, 'start'); for ($i = 0; $i < (int) $data['totalChunks']; $i++) { MailChimp::resetGuzzle(); $module->cronExport('carts', $idShop, true, 'next'); } die('ok'); }
[ "function processExportRemainingCarts($idShop, $module)\n{\n $data = $module->cronExportCarts($idShop, true, 'start');\n for ($i = 0; $i < (int) $data['totalChunks']; $i++) {\n $module->cronExportCarts($idShop, true, 'next');\n }\n\n die('ok');\n}", "function exportCart ( ) {\n\t\t$export = ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a personReference object (array).
private function constructPersonReference(Request $request) { $personReference = [ "tenant_id" => $this->requester->getTenantId(), "person_id" => $request->personId, "name" => $request->name, "relationship" => $request->relationship, "description" ...
[ "public static function createFromArray($fields) \n\t{\n\t\t$person = new Person();\n\t\tself::populate($person,$fields);\n\t\treturn $person;\n\t}", "public function getReferences(): array;", "protected function makeReferenceForm()\n {\n $faker = \\Faker\\Factory::create();\n $projects = [];\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set/Create template compile directory
public function setCompileDirectory() { $compilePath = $this->getTemplatesDirectory() . DIRECTORY_SEPARATOR . $this->compileDirectoryName . DIRECTORY_SEPARATOR; if (!file_exists($compilePath)) { static::mkdir($compilePath); } $this->compilePath = $compi...
[ "private function setTemplateFolderPath(){\n $this->TemplateFolderPath = dirname(__DIR__) . DIRECTORY_SEPARATOR . \"frontend\" . DIRECTORY_SEPARATOR . \"templates\" . DIRECTORY_SEPARATOR;\n }", "function set_template_dir($dir)\n {\n $this->smarty->addTemplateDir($dir);\n\n if (!isset($this->smart...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a file name from a path. i.e. 'path/to/a/name.less' > 'name'
private function getFilenameFromPath($path) { $pathBits = explode('/', $path); $file = end($pathBits); $fileBits = explode('.', $file); $filename = $fileBits[0]; return $filename; }
[ "public function filename($path)\n {\n return $this->pathInfo($path, PATHINFO_FILENAME);\n }", "function filename_from_path($path)\n{\n $data = explode( '/', $path );\n return $data[ count( $data ) -1 ];\n}", "function getFilename($path) {\r\n\t$splitPath = spliti('[/\\]', $path);\r\n\t\r\n\tretu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if the repository has a composer file for a given identifier, false otherwise.
function hasComposerFile($identifier);
[ "public function hasComposerFile(string $identifier): bool;", "public function hasComposerFile(): bool\n {\n return file_exists(sprintf('%s/composer.json', $this->baseDirectory));\n }", "public function usesComposer()\n\t{\n\t\t$path = $this->app['path.base'].DIRECTORY_SEPARATOR.'composer.json';\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return GraphQL query string by categoryId
private function getQuery(int $categoryId): string { return <<<QUERY { categoryList(filters: {ids: {in: ["$categoryId"]}}) { id name children_count children { id name children_count } } } QUERY; }
[ "public function getCategory(): string\n {\n return 'graphql';\n }", "public function transferCategoriesQuery(): string;", "private function buildCategoryCountQuery(): string\n {\n $language = $this->requestInputService->getInputValue(QueryConstants::LANGUAGE_KEY);\n\n $query =\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAddToProjectsUrl Return send welcome message URL
function getSendWelcomeMessageUrl() { return assemble_url('people_company_user_send_welcome_message', array( 'company_id' => $this->getCompanyId(), 'user_id' => $this->getId(), )); }
[ "public function getProjectUrl()\n {\n return Mage::getUrl('xcentia_projects/project/view', array('id'=>$this->getId()));\n }", "public function project_url(){\n\t\treturn $this->the_url;\n\t}", "function getSendReminderUrl() {\n \treturn assemble_url('reminders_add', array('parent_id' => $this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find active document signature by source id and type.
public function findActiveDocumentSignatureBySourceIdAndType($accountId, $type) { return $this->findOneDocumentSignatureBySourceIdAndType($accountId, $type, true); }
[ "public function findActiveDocumentSignature($id)\n {\n return $this->findOneDocumentSignatureBy(['id' => $id, 'active' => true]);\n }", "public function getDocumentSignatureType();", "public function get_audit_signature_id($id, &$document) {\n\n $invitations = $this->invite->getInvitations(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set testcases to run
public function setSelectedTestcases(array $testcases = array()) { $this->selectedTestcases = $testcases; }
[ "public function setTestcases($testcases) {\n $this->testcases = $testcases;\n }", "public function runTests() {\n\t}", "public function runSelectedTests(){\n\t\tself::getAvailableTests(); // just to include all files\n\n\t\tif (array_key_exists('runtest', $_REQUEST)) {\n\n\t\t\t// logging\n\t\t\trequ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return's the body content stored in body stream
public function getBodyContent();
[ "public static function bodyStream() {\n\t\treturn fopen(self::REQUEST_BODY_STREAM, 'r');\n\t}", "public function getRawBody()\n {\n if ($this->stream) {\n $this->readStream();\n }\n return $this->content;\n }", "public function getFullBodyContents() {\n\t\t$offset = $this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forces the API key to regenerate and saves the record
public function regenerateApiKey() { $this->apiKey = false; return $this->save(false, ['apiKey']); }
[ "public function updateApikey();", "public function save( ApiKey $api_key ): ApiKey;", "public function reset_key()\n {\n $response = $this->check_request('Changing web key');\n if (!$response) {\n $wpid = \\get_current_user_id();\n $person = TableMembers::findByWordpressI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a new flavor
public function store() { // Slug Validation for Translations if ( Input::get('language') ){ $slug = Str::slug(Input::get('flavor_title') . '-' . Input::get('language')); } else { $slug = Str::slug(Input::get('flavor_title')); } $validation = Validator::make([ 'title' => Input::get('flavor_title'),...
[ "function set_flavor($flavor){\n $this->flavor = $flavor ;\n return $this->flavor ;\n }", "public function setFlavor($flavor) {\n\t\tif ($this->configurationCheck) {\n\t\t\t$this->configurationCheck->setFlavor($flavor);\n\t\t}\n\t}", "protected function setFlavor($flavor = null)\n {\n if (is_ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new lUFTWP
public function setLUFTWP($lUFTWP) { $this->lUFTWP = $lUFTWP; return $this; }
[ "public function setPlu($plu)\n {\n $this->plu = $plu;\n\n return $this;\n }", "public function set_lp(string $_lp) {\n $this->_lp = $_lp;\n return $this;\n}", "public function setLUPUS($LUPUS)\n {\n $this->LUPUS = $LUPUS;\n\n return $this;\n }", "public function setNPW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for replaceNamespacedDaemonSetStatus .
public function testReplaceNamespacedDaemonSetStatus() { }
[ "public function testPatchNamespacedDaemonSetStatus()\n {\n }", "public function testReplaceExtensionsV1beta1NamespacedDaemonSetStatus()\n {\n\n }", "public function testPatchExtensionsV1beta1NamespacedDaemonSetStatus()\n {\n\n }", "public function testReadNamespacedDaemonSetStatus()\n {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the 'test.client.history' service.
protected function getTest_Client_HistoryService() { return new \Symfony\Component\BrowserKit\History(); }
[ "public function historySubscriber()\n {\n $history = new History();\n\n // Place new adapter on client class\n $this->testClass->setClientSubscriber($history);\n\n return $history;\n }", "public function getHistory(): History\n {\n return $this->history;\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the accumulated score. Returns the result of the accumulated score. The score that can be lost if the result of the roll is one.
public function getAccumulatedScore() { return $this->score; }
[ "public function totalScore()\n {\n return $this->score + $this->roundScore;\n }", "public function getTotalScore()\n\t{\n\t\treturn $this->totalScore;\n\t}", "public function getTotalScore()\n {\n return $this->total_score;\n }", "public function getScore()\n {\n return Ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse description only if description block is present
function _parseDescription() { if ($this->checkTemplateBlockExists('description')) { $this->tpl->parse('description'); return $this->tpl->text('description'); } else { return false; } }
[ "public function parse_description_field($description)\n {\n }", "function parseDescription($descriptionLine){\r\n\t\tif(strpos($descriptionLine,\"*\")<=2) $descriptionLine=substr($descriptionLine,(strpos($descriptionLine,\"*\")+1));\r\n\r\n\t \t//geen lege comment regel indien al in grote omschrijv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a whereGeoShape condition.
public function whereGeoShape( string $field, array $shape, string $relation = 'INTERSECTS', string $boolean = 'must' ): self { $this->wheres[$boolean][] = [ 'geo_shape' => [ $field => [ 'shape' => $shape, 'relation' => $relation, ], ], ]; return $this; }
[ "public function whereGeoShape($field, array $shape, $relation = 'INTERSECTS', $boolean = 'must')\n {\n $this->wheres[$boolean][] = [\n 'geo_shape' => [\n $field => [\n 'shape' => $shape,\n 'relation' => $relation,\n ],\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the delegated roles if any.
public function getDelegatedRoles(): array { return $this->getSigned()['delegations']['roles'] ?? []; }
[ "public static function get_roles()\n {\n }", "public function getUserRoles() {\n return $this->roles;\n }", "public function getRoles()\r\n {\r\n return $this->roles;\r\n }", "public function getRoles()\n {\n return isset($this->Roles) ? $this->Roles : null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Affichage d'un message pour mot de passe non identique
function mdpPasIdentique() { return '<div class="alert alert-warning" role="alert"> Les mots de passe ne sont pas identiques. </div>'; }
[ "function mdpPasIdentique() {\n\t\treturn '<div class=\"alert alert-warning\" role=\"alert\">\n\t\t\t\tLes mots de passe ne sont pas identiques.\n\t\t\t</div>';\n\t}", "private function getPassword(): string\n {\n return json_decode($this->getSender()->messenger_settings)->sms->password;\n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for comDayCqDamS7damCommonServletsS7damProductInfoServlet .
public function testComDayCqDamS7damCommonServletsS7damProductInfoServlet() { $client = static::createClient(); $path = '/system/console/configMgr/com.day.cq.dam.s7dam.common.servlets.S7damProductInfoServlet'; $crawler = $client->request('POST', $path); }
[ "public function testComDayCqDamS7damCommonServletsS7damProductInfoServlet() {\n\n }", "public function testComAdobeGraniteAcpPlatformPlatformServlet() {\n\n }", "public function testComDayCqDamCoreImplServletMetadataGetServlet() {\n\n }", "public function testComDayCqDamCoreImplServletMultipleLicens...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that reflection() returns the ReflectionClass object.
public function testReflection() { $this->assertInstanceOf('ReflectionClass', $this->object->reflection()); }
[ "public function getClassReflection(): ReflectionClass;", "public function testLoadClassReflectionFromObject()\n {\n $object = new ReflectionClassTested();\n $reflection = Reflection::loadClassReflection($object);\n\n $this->assertInstanceOf('ReflectionClass', $reflection);\n $this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns active search parameter
public function getActSearchParam() { return oxRegistry::getConfig()->getRequestParameter('searchparam'); }
[ "public function _get_search_param()\r\n\t{\r\n\t}", "public function getSearchParam(){\r\n return $this->_searchParam;\r\n }", "public function getSearchParam()\r\n {\r\n return $this->searchParam;\r\n }", "public function getSearchQueryParameter()\n {\n return $this->search_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register CSS and Javascript Register CSS and Javascript Register custom CSS and Javascript for this plugin. Multiple code blocks can be implemented to enable multiple stylesheets or javascript files.
function register_css_and_js() { // Access the global data structure global $trj_golem_data; /* * Register a css stylesheet */ // Stylesheet name $stylesheet = 'styles.css'; // Register the stylesheet wp_register_style('trj_golem', $trj_golem_data['paths']['css_url'] . $stylesheet); // Enqueue the ...
[ "public function addCustomCSSandJS(){\n \n $this->addCss('/plugins/brunomagconcept/whitelabel/assets/css/admin-overrides.css', 'core');\n $this->addJs('/plugins/brunomagconcept/whitelabel/assets/js/custom-javascript.js', 'core');\n echo $this->makeAssets();\n \n }", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns a list of hyphenation patterns, that are available.
public static function getAvailableHyphenatePatterns() { if (self::$hyphenatePatterns != NULL) { return self::$hyphenatePatterns; } self::$hyphenatePatterns = array(); $files = file_scan_directory(libraries_get_path('tcpdf') . '/hyphenate_patterns', '/.tex$/', array('nomask' => '/(\.\.?|CVS)$/')...
[ "private function getPatterns()\n\t{\n\t\t$rtrn = '';\n\t\treset($this->patterns);\n\t\tforeach ($this->patterns as $pattern)\n\t\t{\n\t\t\t$rtrn .= '('.$pattern['expression'].')|';\n\t\t}\n\t\t$rtrn = substr($rtrn, 0, -1);\n\t\treturn '~'.$rtrn.'~'.($this->ignoreCase ? 'i' : '');\n\t}", "public static function p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the target for the React to mount to.
public function render_target() { }
[ "public function render($target)\n {\n print($this->buildGraphImgTag($target));\n }", "public function renderSelf();", "function render($target_or_options, array $additional_options = []): string\n{\n return get_renderer()->render($target_or_options, $additional_options);\n}", "public function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Init area editing form.
public function initAreaEditingForm($a_edit_property) { global $lng, $ilCtrl; include_once("Services/Form/classes/class.ilPropertyFormGUI.php"); $form = new ilPropertyFormGUI(); $form->setOpenTag(false); $form->setCloseTag(false); // name if ($a_edit_property != "link" && $a_edit_property != "shape") ...
[ "public function editarea() {\n\t\tif ($this->secureCheck ()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$id = \"\";\n\t\tif ($this->request->isParameterNotEmpty ( 'actionid' )) {\n\t\t\t$id = $this->request->getParameter ( \"actionid\" );\n\t\t}\n\t\t\n\t\t$model = new SyArea ();\n\t\t$area = $model->getArea ( $id );\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$sql = "INSERT INTO delivery VALUES('','" . $data['id_delivery'] . "','" . $data['type_deliv'] . "','" . $data['sub_type'] . "','" . $data['no_resi'] . "','" . $data['nik'] . "','" . $data['jmlh_barang'] . "','" . $data['jenis_barang'] . "','" . $data['front_desk'] . "','" . $data['deliv_status'] . "','" . $data['date_...
public function insertd($data_deliv) { // $sql = "INSERT INTO `delivery` (`id_delivery`, `type_deliv`, `sub_type`, `no_resi`, `nik`, `jmlh_barang`, `jenis_barang`, `front_desk`, `deliv_status`, `date_time`, `id_barang`) VALUES (NULL, 'E-commerce', 'Shopee', '12345', '09876', '4', 'pakaian', 'mega', 'Belum Diam...
[ "function insertKelas($data){\n //VALUES ('$start', '$end', '$durasi', '$nama_kegiatan', '$ruang', '$hari','$tgl_kegiatan',1)\";\n //$result = mysql_query($sql) or die (mysql_error());\n $this->db->insert('jadwal', $data);\n }", "public function insert_delivery($arr_data){\n\n\t\tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the scopeType property value. The type of the scope where the policy is created. One of Directory, DirectoryRole, Group. Required.
public function setScopeType(?string $value): void { $this->getBackingStore()->set('scopeType', $value); }
[ "public function setScopeType($val)\n {\n $this->_propDict[\"scopeType\"] = $val;\n return $this;\n }", "public function validateScopeType($scopeType);", "public function getScopeType()\n {\n return $this->scopeType;\n }", "protected function addType($type, $id, $scopeType = S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to edit a Newsletter entity.
private function createEditForm(Newsletter $entity) { $form = $this->createForm(new NewsletterType(), $entity, array( 'action' => $this->generateUrl('newsletters_update', array('id' => $entity->getId())), 'method' => 'PUT', )); //$form->add('submit', 'submit',...
[ "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ExtranetBundle:Newsletters')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Newsletter entity.');\n }\n\n $editF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert UCS4 strin into UCS4 garray
function _ucs4_string_to_ucs4($input) { $output = array(); $inp_len = strlen($input); // Input length must be dividable by 4 if ($inp_len % 4) { $this->_error('Input UCS4 string is broken'); return false; } // Empty input - return empty output ...
[ "protected function _ucs4_string_to_ucs4($input)\n {\n $output = array();\n $inp_len = strlen($input);\n // Input length must be dividable by 4\n if ($inp_len % 4) {\n $this->_error('Input UCS4 string is broken');\n return false;\n }\n // Empty inpu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an order from the ACP Order Screen
function createFromOrderScreen() { global $_POST, $dbConn; $basket = new Cart(); //This iterates over each item in the order items row until a row is not defined, which marks the end of the table for ($i=1; isset($_POST['item'.$i.'ID']); $i++) { //This order item row exists, create an item in the cart bas...
[ "public function createOrderAction(){\n\t\tif (!$this->_loadValidSubscription()) {\n\t\t\treturn;\n\t\t}\n\t\t$subscription = Mage::registry('current_subscription');\n\n\t\t$this->createOrder($subscription);\n\t}", "public function createOrder()\n {\n\n $cart = $this->options['user']->getCart();\n // Fill ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a tbody object with "form.calculation_act.row.html" rows
public function html_act_tbody($i, $records, $valid_rules, $model_article, $model_calculation) { $rows = array(); $ii= 1; foreach($records as $record){ $rows[] = $this->html_act_row($i, $ii, $record, $valid_rules, $model_article, $model_calculation); $ii++; } return $this->wrapTag('tbody',$rows); }
[ "private function generateRows()\n {\n $this->rows = array();\n\n // empty row for cloneable js\n $this->addRow();\n\n $values = $this->getForm()->getValue($this->getName());\n\n if (is_array($values) && count($values)) {\n foreach ($values As $key => $rowValues) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================= END ADD/ REMOVE/ UPDATE/ GET BLOGPOST DATA IN journal2_blog_post ============================ ======================= START ADD/ REMOVE/ UPDATE/ GET POST DETAILS IN journal2_blog_post ============================
public function addPostDetails($post_data) { $this->db->query( "INSERT INTO " . DB_PREFIX . "journal2_blog_post_description (`post_id`,`language_id`,`name`, `description`, `meta_title`, `meta_keywords` , `meta_description`, `keyword`, `tags`) VALUES (" . (int)($post_data['post_id']...
[ "public function saveBlogPost() {\r\n\t\t\r\n\t\t//$this->verifyID($toid);\r\n\t\t$html_tags = '<b><p><br></br><u><ul><li><table><tr><th><td><i>';\r\n\r\n\t\t// controleer of submit gepost is\r\n\t\tif (isset($_POST['admblogsubmit'])) {\r\n\t\t\t\r\n\t\t\t// check: velden voor titel en content zijn niet leeg\r\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ based on the latt/long passed in, get a list of venues and their city_region and intersection fucntion returns distance in Km Used when adding new venue to guess the nearest intersection / city_region / neighbourhood
function getNearbyVenueIntersection( $lat, $lng, $venueId = null) { $distance = 10; // 1 = 1000 metres, 10 = 10km $limit = 10; $venueLat = floatval($lat); $venueLng = floatval($lng); $result = $this->find('all', array('fields' =>...
[ "function _getNearByVenues( $venueLatt, $venueLong ) {\r\n\t\t$distance = 1; // 1000 metres\r\n\r\n\t\t$venueLatt = floatval($venueLatt);\r\n\t\t$venueLong = floatval($venueLong);\r\n\r\n\t\t$result1 = $this->Venue->query( \"SELECT Venue.name, Venue.subname, Venue.slug, Venue.address, Venue.geo_latt, Venue.geo_long...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns tenant scope for this model.
public static function getTenantScope() { return TenantScopeFacade::getFacadeRoot(); }
[ "public function get_scope()\n {\n return $this->scope;\n }", "public function getScope()\n {\n return $this->fields['scope'];\n }", "public function getTenantObject()\n {\n return $this->tenant;\n }", "public function getTenant()\n {\n return $this->hasOne(Ten...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the byte counter of a chain.
public function getChainByteCounter($table, $chain) { if (isset($this->fileTree[$table][$chain]['byte-counter'])) return $this->fileTree[$table][$chain]['byte-counter']; return NULL; }
[ "public function count_bytes() : int {\n $bytes = 0;\n foreach ($this->lines as $line) { $bytes += strlen($line); }\n return $bytes;\n }", "function getDownloadCount() {\n\t\t\t$cache = $this->readCache();\n\t\t\treturn $cache[12];\n\t\t}", "public function getReceivedBytes(): int;", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delivery servers usage logs
public function actionDelivery_servers_usage_logs() { $request = Yii::app()->request; $log = new DeliveryServerUsageLog('search'); $log->unsetAttributes(); $log->attributes = (array)$request->getQuery($log->modelName, array()); $this->setData(array( ...
[ "public function get_delivery_stats() {\n\t\t\t\treturn $this->build_request()->fetch( '/deliverystats' );\n\t\t}", "public function get_delivery_logs()\n {\n }", "public function do_server_side_stats() {\n\t\t$urls = $this->get_stats_urls();\n\t\tforeach ( $urls as $url ) {\n\t\t\t$this->do_serve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move entry points in place.
function moveEntryPHPpoints() { $rootDir = __DIR__ . '/../tmp_uploaded_update/phplist/public_html/lists'; $downloadedFiles = scandir($rootDir); foreach ($downloadedFiles as $filename) { $oldFile = $rootDir . '/' . $filename; $newFile = __DIR__ . '/../' . $filename; ...
[ "public function escortPositions(): void;", "public function moveScriptsToFooter()\n {\n global $wp_scripts;\n $notInFooter = array_diff($wp_scripts->queue, $wp_scripts->in_footer);\n $wp_scripts->in_footer = array_merge($wp_scripts->in_footer, $notInFooter);\n }", "private function m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test constructor exception wrong 1st parameter.
public function testConstructorException1st2(): void { $this->expectException(Exception::class); $this->e(false); }
[ "public function test___construct_calledWithBadValue_throw()\n {\n $this->setExpectedException($this->getExceptionToArgument('InvalidNativeArgumentException'));\n $this->getSut($this->getBadNativeValue());\n }", "public function test_not_valid_data_excention_is_thrown_in_constructor_method()\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the unpublish extension to the builder.
protected function addUnpublish(Builder $builder) { $builder->macro('unpublish', function (Builder $builder) { $builder->withPublished(); $column = $this->getPublishedAtColumn($builder); return $builder->update([ $column => null, ]); }...
[ "protected function addWithoutUnpublished(Builder $builder)\n {\n $builder->macro('withoutUnpublished', function (Builder $builder) {\n $model = $builder->getModel();\n\n $builder->withoutGlobalScope($this)->where($model->getQualifiedPublishAtColumn(), '<=', $model->freshTimestamp())...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Push a details item fields to the data array
public function pushDetailsItem($fields) { $defaults = array( 'id' => '', 'name' => '' ); $this->data['ecommerce']['detail']['products'][] = $this->getDefaults($fields, $defaults); }
[ "public function pushItemField(array $data);", "public function AddCustomerDetails(){\n // this is a valuable piece of code\n // here we are iterating over the items array and decorating the items in the array with the customer name property\n // since array are object references, we dont pus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a customer check debit request for the given $order
public function create_echeck_debit( WC_Order $order ) { $this->create_transaction( self::AUTH_CAPTURE, $order ); }
[ "public function check_debit( \\WC_Order $order ) {\n\n\t\t$request = $this->get_new_echeck_request( $order );\n\n\t\t$request->set_echeck_data();\n\n\t\treturn $this->perform_request( $request );\n\t}", "public function createPaymentRequest($order);", "public function debit() \n {\n $sOxid = $this->_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement getPackedSize() method.
public function getPackedSize() { }
[ "public function getUnpackedSize() {}", "public function getPackSize() : int\n {\n return $this->packSize;\n }", "public function extractSize();", "function GetSize(){}", "public function packedLen(): int\n {\n return vscf_message_info_editor_packed_len_php($this->ctx);\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of user_id_user.
public function getUserIdUser(): int { return $this->user_id_user; }
[ "public function getId_user()\r\n {\r\n return $this->id_user;\r\n }", "public function getUserID()\n\t{\n\t\treturn $this->user_id;\n\t}", "public function getUserId()\n\t{\n\t\t$column = self::COL_USER_ID;\n\t\t$v = $this->$column;\n\n\t\tif ($v !== null) {\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the 'form.type.country' service. This service is shared. This method always returns the same instance of the service.
protected function getForm_Type_CountryService() { return $this->services['form.type.country'] = new \Symfony\Component\Form\Extension\Core\Type\CountryType(); }
[ "protected function getOroLocale_Form_Type_CountryService()\n {\n return $this->services['oro_locale.form.type.country'] = new \\Oro\\Bundle\\LocaleBundle\\Form\\Type\\CountryType();\n }", "protected function getSylius_Form_Type_CountryChoiceService()\n {\n return $this->services['sylius.fo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Should every piece of every order entered be logged as it comes in? This helps solve problems when people think they submitted correct orders but may not have, but it can use up lots of disk space and waste resources every time orders are submitted. Every complaint about incorrect orders have been found via the order l...
public static function orderlogDirectory() { return false; return '../orderlogs'; }
[ "private static function checkPaths() {\n\t\tif(!is_dir (self::$logpath)) mkdir(self::$logpath, 0777);\n\t\tif(!is_file(self::$logfile)) file_put_contents(self::$logfile, \"<?\\n/**\\n#\\n# Tools FTP Log file\\n#\\n*/\\n\\n\");\n\t}", "public function isLoggingForced() {\n return Mage::getStoreConfigFlag(s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if an action exists in a given module.
public function actionExists($module, $action) { if (isset($this->modules[$module]['commands'][$action]['cmd'][$this->hostOS])) { return true; } return false; }
[ "public function module_has_action($action)\n\t{\n\t\tif (empty($this->CI->item_actions)) return FALSE;\n\t\treturn (isset($this->CI->item_actions[$action]) OR in_array($action, $this->CI->item_actions));\n\t}", "public function actionExists($action){\n return method_exists($this, $action);\n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Added meta to a collection. The $mediaId is actually the WordPress Post/Attachment ID.
function add_media_to_collection( $mediaId, $collectionId, $isRemove = false ) { $id = $this->get_id_for_collection( $collectionId ); $str = get_post_meta( $id, '_post_image_gallery', TRUE ); $ids = !empty( $str ) ? explode( ',', $str ) : array(); $index = array_search( $mediaId, $ids, false ); if (...
[ "function add_media_to_collection( $mediaId, $collectionId ) {\n global $wplr;\n\n // Upload the file to the gallery\n $gallery_id = $wplr->get_meta( 'nextgen_gallery_id', $collectionId );\n $abspath = get_attached_file( $mediaId );\n $file_data = file_get_contents( $abspath );\n $file_name = M_I1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the minlength attribute value.MDN: Defines the minimum number of characters allowed in the element. Parent tags allowed: ,
public function get_minlength() { return $this->get_attr('minlength'); }
[ "public function getMinLength()\r\r\n {\r\r\n return $this->minLength;\r\r\n }", "public function getMinLength()\n {\n return $this->min_length;\n }", "public function getMinLength()\n {\n return $this->minLength;\n }", "public function getMinLength()\r\n {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds sanitization callback function: text align
function skyre_sanitize_text_align( $input ) { $talign = skyre_get_text_aligns(); if ( array_key_exists( $input, $talign ) ) { return $input; } else { return ''; } }
[ "function getTextAlignment(){}", "function setTextAlignment($alignment){}", "function do_bbcode_align($action, $attr, $content, $params, $node_object) {\n\treturn '<div style=\"text-align:'. $attr['default'] .'\">'. $content .'</div>';\n}", "function aligner($letexte, $justif='') {\n\t$letexte = trim($letexte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows the user to add another privilege in the application
public function addAction(){ $this->title = 'Add a new privilege.'; $form = new PrivilegeForm(); $privilegeModel = new Privilege(); if($this->getRequest()->isPost()){ if($form->isValid($this->getRequest()->getPost())){ $privilegeModel->save($...
[ "public function addPrivilegeAction() {\n\n }", "public function addSitePrivileges()\n {\n\n }", "public function testUpdatePrivilege()\n {\n }", "protected function privilegeAction()\n {\n $userRoleID = $this->flattenArray($this->userRole->getRepo()->findBy(['role_id'], ['user_id' =>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable a stringmatch type as supported.
protected function addStringMatchType (osid_type_Type $type) { $this->stringMatchTypes[] = $type; }
[ "public function supports(string $string): bool;", "public function setRegExMatch() {\r\n $this->db->sqliteCreateFunction('REGEX_MATCH',array($this,'RegExMatch'),2);\r\n }", "public function setStringToMatch($string) : void\n {\n $this->setString('stringToMatch', $string);\n \n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modify Multimedia Objects status.
private function modifyMultimediaObjectsStatus($values) { $dm = $this->get('doctrine_mongodb.odm.document_manager'); $repo = $dm->getRepository('PumukitSchemaBundle:MultimediaObject'); $repoTags = $dm->getRepository('PumukitSchemaBundle:Tag'); $tagService = $this->get('pumukitschema....
[ "function ctools_export_set_object_status($object, $new_status = TRUE) {\r\n $table = $object->table;\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n $status = variable_get($export['status'], array());\r\n\r\n // Compare\r\n if (!$new_status && $object->export_type & EXPOR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a Tecnico entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('OsBundle:Tecnico')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Tecnico entity.'); } $deleteForm = $this->createDeleteF...
[ "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ColegioAdminBundle:TipoColegio')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TipoColegio entity.');\n }\n\n $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates the spectrum based on the annotation array. The more annotations fit to the spectrum, the higher the score
public function getSpectrumScore($annotations, $massprop, $intensityprop, $annotationprop, $threshold, $thresholdtype) { $arrReturn = array(); $dblFactor = 0; $dblInt = 0; $dblMass = 0; $dblMassMax = 0; $dblMassMin = 0; $k = 0; $l = count($annotations); $varEntry = null; $aFound = 0; ...
[ "public function get_array_scores();", "public function annotateSpectrum($annotations, $massprop, $intensityprop, $annotationprop, $threshold, $thresholdtype)\r\n\t{\r\n\t\t$arrReturn = array();\r\n\t\t$dblFactor = 0;\r\n\t\t$dblInt = 0;\r\n\t\t$dblMass = 0;\r\n\t\t$dblMassMax = 0;\r\n\t\t$dblMassMin = 0;\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set number of pages.
private function setNumberOfPages(): void { $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page); }
[ "private function setPages()\n {\n $this->pages_count = (int) ceil( $this->records_count / $this->per_page );\n }", "protected function updateNumPages(): void\n {\n $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int)ceil($this->totalItems / $this->itemsPerPage));\n }", "public func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read all logfiles (if existent)
public static function getLogfiles() { try { $texte = file_get_contents(Path::path_logs() . 'texte_errors.log'); } catch (\Exception $exception) { $texte = '[Not found]'; } try { $morph = file_get_contents(Path::path_logs() . 'morph_errors.log');...
[ "public static function get_log_files()\n {\n }", "private function checkLogFiles()\n {\n foreach ($this->filesystem->all() as $path) {\n $this->checkLogFile($path);\n }\n }", "protected function read_working_logs_dir() {\n $working_logs = [];\n $working_dir = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/================= / Admin Campaigns /================= / List Campaigns. Displays the first 15 entries by default.
function admin_campaigns_list( $page = 1, $perpage = 15 ) { $request['page'] = $page; $request['perpage'] = $perpage; return $this->hook( "/campaigns.json", "campaign", $request, 'GET', 'admin' ); }
[ "public function listCampaign(){\n\n $token = generateAccessToken();\n $campaigns = listCampaign($token);\n return $campaigns['data'];\n\n }", "public function getCampaigns()\n {\n }", "public function listCampaigns()\n\t{\n\t\t$url = $this->getBetaAPIURL() . 'campaigns';\n\t\t$hea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
4.5.12 deleteDriverGroup This action deletes a driver group and the assignments of all drivers to that group. The drivers detached through this action are not being deleted.
public function deleteDriverGroup($params);
[ "function deleteGroup($group) {}", "public function delete_group() {\n\n // Deletes Groups\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Groups)->delete_group();\n\n }", "public function deleteGroup()\n {\n $this->showDeleteConfirm = false;\n DB::transaction(function () {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register settings on admin page, called if is_admin() && pageId = YoPressBase::instance()>getAdminPageId match
public function registerAdminSettings();
[ "public function admin_init() {\n\t\t\tdo_action( 'learndash_settings_page_init', $this->settings_page_id );\n\t\t}", "public function on_hook_admin_menu_setup(){\n\t\t$menu_slug = BTM_Plugin_Options::get_instance()->get_admin_menu_slug();\n\n\t\t// Admin Settings submenu page init\n\t\tadd_submenu_page(\n\t\t\t$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether to show the Category field on form
function snax_link_show_category_field() { return 'disabled' !== snax_link_category_field(); }
[ "function snax_text_show_category_field() {\n\treturn 'disabled' !== snax_text_category_field();\n}", "public function category_filter() {\n\n\t\t$categories = get_terms( 'form_category' );\n\t\tif ( $categories && ! is_wp_error( $categories ) ) {\n\t\t\techo Give()->html->category_dropdown( 'category', $this->ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read file and return an array of words in the file
public function readFileByWord() { if ($this->exists) { $filecontents = file_get_contents ( $this->filename ); $words = preg_split ( '/[\s]+/', $filecontents, - 1, PREG_SPLIT_NO_EMPTY ); return $words; } else { return false; } }
[ "private function wordArray()\n {\n $wordArray = array(file('wordlist.txt'));\n return $wordArray[0];\n }", "function get_file_words($file, $exclude) {\n\t$result = array();\n\n\t$content = file_get_contents($file);\n\tif (!empty($content)) {\n\t\t$words = explode(' ', $content);\n\n\t\tforeac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of date_birth
public function getDateBirth() { return $this->date_birth; }
[ "public function getDateOfBirth() {\n\t\treturn $this->getAsInteger('date_of_birth');\n\t}", "public function get_birth_date(){\n\t\treturn $this->v_birth_date->sec;\n\t}", "public function getBirthDate();", "public function getDate_Birth()\r\n\t{\r\n\t\treturn $this->date_birth;\r\n\t}", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify cURL timeouts are appropriately reported.
public function testWithCurlTimeout() { $handle = curl_init(); curl_setopt($handle, CURLOPT_TIMEOUT_MS, 1); $safeCurl = new SafeCurl($handle); $safeCurl->execute("https://httpstat.us/200?sleep=100"); }
[ "public function testCurlTimeout()\n {\n $expected = env('GOOGLE_CURL_TIMEOUT');\n $actual = Config::curlTimeout();\n\n $this->assertEquals($expected, $actual);\n }", "public function testConnectTimeoutExceeded()\n {\n $this->connection = new DefaultConnection(1, -1);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that proper method calls are made in ItemManager's setExpired() method
public function testSetItemExpired() { putenv('DB_CONNECTION=sqlite_testing'); Log::shouldReceive('info'); Mail::shouldReceive('to'); $item = factory(\App\item::class)->make([ 'End_Date' => Carbon::today() ]); $item->save(); $this->assertData...
[ "public function testItemExpiration()\n {\n $this->assertTrue(true);\n }", "public function Cache_And_Get_Expired() {\n\t\t// Arrange\n\t\t$cache = $this->GetCache();\n\t\t$date = new DateTime();\n\t\t$date = $date->sub(new DateInterval(\"P1Y\"));\n\t\t$cacheItem = new \\EggCup\\CacheItem(\"key\", $d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }