query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Generates language profiles for all language files
@param string $dirname Name of the directory where the translations files are located
@return void | [
"public function learn(string $dirname = '')\n {\n if (empty($dirname))\n {\n $dirname = __DIR__ . '/../../resources/*/*.txt';\n }\n else if (!is_dir($dirname) || !is_readable($dirname))\n {\n throw new \\InvalidArgumentException('Provided directory could ... | [
"def run(self, args): # pylint: disable=unused-argument\n \n logging.basicConfig(stream=sys.stdout, level=logging.INFO)\n\n # This is used as a tool only to segment translation files when adding a\n # new segment. In the regular workflow, the work is done by the extract\n # phas... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Send the estimate. Returns the updated estimate
@param Estimate $estimate
@param string $method Send method (email|hand|post); default: email
@param type $email Address to send to; default: contact e-mail
@param type $message
@return Estimate | [
"public function send(Estimate $estimate, $method = 'email', $email = null, $message = null)\n {\n return $this->connector->send($estimate, $this->buildEnvelope($method, $email, $message));\n }"
] | [
"public function sample1()\n {\n $data = null;\n $template_html = 'sample-1.html';\n\n $mail = new Mail();\n $mail->setMailBody($data, $template_html);\n $mail->sendMail('Test Sample 1 - external HTML template');\n exit('Message Sent!');\n }"
] | codesearchnet | {
"query": "Represent the Github post about invoice calculation:",
"pos": "Represent the Github code about invoice calculation:",
"neg": "Represent the Github code:"
} |
/* ------------------------------------------------------------ | [
"public void write(byte[] b) \n throws IOException\n {\n if (_encoding==null)\n _writer.write(new String(b));\n else\n _writer.write(new String(b,_encoding));\n }"
] | [
"public function description()\n {\n //====================================================================//\n // Stack Trace\n Splash::log()->trace();\n\n //====================================================================//\n // Build & Return Widget Description Array\n ... | codesearchnet | {
"query": "Represent the Github text about N/A:",
"pos": "Represent the Github code about N/A:",
"neg": "Represent the Github code about Software Development:"
} |
Equivalent of withQuery(getQuery().withOverriddenContext(ImmutableMap.of(MAX_QUEUED_BYTES_KEY, maxQueuedBytes))). | [
"public QueryPlus<T> withMaxQueuedBytes(long maxQueuedBytes)\n {\n return new QueryPlus<>(\n query.withOverriddenContext(ImmutableMap.of(QueryContexts.MAX_QUEUED_BYTES_KEY, maxQueuedBytes)),\n queryMetrics,\n identity\n );\n }"
] | [
"public List getObjectsWithChangedProperty(String propertyName){\n argumentIsNotNull(propertyName);\n\n return Lists.transform(getPropertyChanges(propertyName),\n input -> input.getAffectedObject().<JaversException>orElseThrow(() -> new JaversException(AFFECTED_CDO_IS_NOT_AVAILABLE)));\... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Mounts a host FS object on a given path.
Arguments:
path (str): A path within the MountFS.
fs (FS or str): A filesystem (instance or URL) to mount. | [
"def mount(self, path, fs):\n # type: (Text, Union[FS, Text]) -> None\n \n if isinstance(fs, text_type):\n from .opener import open_fs\n\n fs = open_fs(fs)\n\n if not isinstance(fs, FS):\n raise TypeError(\"fs argument must be an FS object or a FS URL\")\... | [
"def cast_to_python(self, value):\n \"\"\"\"\"\"\n # v2.x does not provide a distinction between users and groups at the field selection level, can only return\n # UserGroup instances instead of specific User or Group instances\n if value is not None:\n value = UserGroup(self.... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Helper method for collection items
:param item_type:
:return: | [
"def create_for_collection_items(item_type, hint):\n \n # this leads to infinite loops\n # try:\n # prt_type = get_pretty_type_str(item_type)\n # except:\n # prt_type = str(item_type)\n return TypeInformationRequiredError(\"Cannot parse object of type {t} as ... | [
"def component(self, *components):\n \n \"\"\"\n for component in components:\n self._component.append(component)\n return self"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
(non-PHPdoc)
@see Webcreate\Vcs\Common\Adapter.AdapterInterface::execute()
@return mixed | [
"public function execute($command, array $arguments = array(), $cwd = null)\n {\n $bincommand = $this->bin . ' ' . $command;\n $arguments += $this->getGlobalArguments();\n $commandline = $this->cli->prepare($bincommand, $arguments);\n\n if ($this->cli->execute($commandline, null, $c... | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Visit all end nodes and adjust their parent's `selected` and `partsel` attributes. Return selection state true, false, or undefined. | [
"function _walk(node){\n\t\t\tvar i, l, child, s, state, allSelected,someSelected,\n\t\t\t\tchildren = node.children;\n\n\t\t\tif( children && children.length ){\n\t\t\t\t// check all children recursively\n\t\t\t\tallSelected = true;\n\t\t\t\tsomeSelected = false;\n\n\t\t\t\tfor( i=0, l=children.length; i<l; i++ ){... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Convert the value according the type of DeviceData.
@param shortValues
the value to insert on DeviceData
@param deviceDataArgin
the DeviceData attribute to write
@param dataType
the type of inserted data
@throws DevFailed | [
"public static void insertFromShortArray(final short[] shortValues,\n\t final DeviceData deviceDataArgin, final int dataType) throws DevFailed {\n\t// by default for xdim = 1, send the sum.\n\tDouble doubleSum = new Double(0);\n\tfor (final short shortValue : shortValues) {\n\t doubleSum = doubleSum + shortVa... | [
"@Override\n protected void setAdditionalInfoToEventCallBackStruct(EventCallBackStruct callback_struct,\n String device_name, String attribute, String event_name, String[] filters, EventChannelStruct channel_struct) throws DevFailed {\n // Nothing\n ApiUtil.printTrace(\"---... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about N/A:"
} |
Get the stride for the given
shape information buffer
@param buffer
@return | [
"public static IntBuffer stride(IntBuffer buffer) {\n int rank = rank(buffer);\n val buffer2 = (Buffer) buffer;\n val ret = (IntBuffer) buffer2.position(1 + rank);\n return ret.slice();\n }"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetContent returns the Content field if it's non-nil, zero value otherwise. | [
"func (t *TreeEntry) GetContent() string {\n\tif t == nil || t.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Content\n}"
] | [
"def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
Documented, #without | [
"@SuppressWarnings(\"unchecked\")\n public static <E> List<E> without(final List<E> list, E ... values) {\n final List<E> valuesList = Arrays.asList(values);\n return filter(list, new Predicate<E>() {\n @Override\n public boolean test(E elem) {\n return !contain... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// AddCheck provides a mock function with given fields: check | [
"func (_m *Store) AddCheck(check types.CheckSpec) error {\n\tret := _m.Called(check)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(types.CheckSpec) error); ok {\n\t\tr0 = rf(check)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
map to elementary values | [
"function mapToValues(v){\n function mapRec(e){\n if(!isAVector(e)) return e;\n return mapRec(e.get(0));\n }\n return v.map(mapRec);\n }"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Provide an array of locales where the locale is the key and the label is
the value for easy display in a dropdown select for example
example: array('de_CH' => 'Deutsch', 'en_GB' => 'English').
@return array | [
"protected function getLocaleChoices()\n {\n $locale = [];\n\n foreach ($this->languages as $language) {\n $locale[$language['label']] = $language['locale'];\n }\n\n return $locale;\n }"
] | [
"def locale(qsetting=''):\n \n override_flag = QSettings(qsetting).value(\n 'locale/overrideFlag', True, type=bool)\n\n default = 'en_US'\n\n if override_flag:\n locale_name = QSettings(qsetting).value(\n 'locale/userLocale', default, type=str)\n else:\n # noinspection... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Get the number of the last page.
@return int | [
"public function getLastPageNumber()\n {\n $this->loadData();\n $count = count($this->filteredData);\n\n return ceil($count / $this->pageSize);\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Runs the given operation on all integrations. | [
"void performRun(IntegrationOperation operation) {\n for (Map.Entry<String, Integration<?>> entry : integrations.entrySet()) {\n String key = entry.getKey();\n long startTime = System.nanoTime();\n operation.run(key, entry.getValue(), projectSettings);\n long endTime = System.nanoTime();\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load a config file
@param string $file The config file without the extension
@return | [
"public function load($file)\n {\n $file_name = $this->_config_path.$file.'.php';\n\n // load the file, but only once\n if (is_file($file_name) and ! array_key_exists($file, $this->_loaded)) {\n // the config file values are secondary to the config values that have already been se... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Define the setting for a datetime custom field.
@param moodleform $form the user form | [
"public function define_form_specific($form) {\n // Get the current calendar in use - see MDL-18375.\n $calendartype = \\core_calendar\\type_factory::get_calendar_instance();\n\n // Create variables to store start and end.\n list($year, $month, $day) = explode('_', date('Y_m_d'));\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns true if the give $userAgent is from a mobile device
@param string $userAgent
@return bool | [
"public static function isMobileBrowser($userAgent)\n {\n if (self::$_is_mobile_browser !== null) {\n return self::$_is_mobile_browser;\n }\n self::$_is_mobile_browser = false;\n $userAgent = strtolower($userAgent);\n foreach (self::$mobileBrowsers as $key) {\n ... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Transfer ownership from global (shared) model to local model which will be worked on | [
"@Override protected void setupLocal(){\n// long start = System.currentTimeMillis();\n assert(_localmodel == null);\n _localmodel = _sharedmodel;\n _sharedmodel = null;\n _localmodel.set_processed_local(0);\n final int weightIdx =_fr.find(_localmodel.get_params()._weights_column);\n final int r... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
getter for pageId - gets
@generated
@return value of the feature | [
"public int getPageId() {\n if (DocumentElement_Type.featOkTst && ((DocumentElement_Type)jcasType).casFeat_pageId == null)\n jcasType.jcas.throwFeatMissing(\"pageId\", \"ch.epfl.bbp.uima.types.DocumentElement\");\n return jcasType.ll_cas.ll_getIntValue(addr, ((DocumentElement_Type)jcasType).casFeatCode_p... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Tests matrix product AB=C by Freivalds
:param A: n by n numerical matrix
:param B: same
:param C: same
:returns: False with high probability if AB != C
:complexity:
:math:`O(n^2)` | [
"def freivalds(A, B, C):\n \n n = len(A)\n x = [randint(0, 1000000) for j in range(n)]\n return mult(A, mult(B, x)) == mult(C, x)"
] | [
"def _check_L(self, L):\n \"\"\"\"\"\"\n # TODO: Take this out?\n if issparse(L):\n L = L.todense()\n\n # Check for correct values, e.g. warning if in {-1,0,1}\n if np.any(L < 0):\n raise ValueError(\"L must have values in {0,1,...,k}.\")"
] | codesearchnet | {
"query": "Represent the sentence about Mathematics:",
"pos": "Represent the code about Mathematics:",
"neg": "Represent the code:"
} |
Respond to the IDLETIME subcommand. | [
"function idletime(req, res) {\n var obj = req.db.getRawKey(req.args[0], req)\n , diff;\n if(obj === undefined) return res.send(null, null);\n diff = Date.now() - obj.t;\n diff = Math.round(diff / 1000);\n res.send(null, diff);\n}"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Custom attribute writer method checking allowed values (enum).
@param [Object] h264_profile Object to be assigned | [
"def h264_profile=(h264_profile)\n validator = EnumAttributeValidator.new('String', [\"baseline\", \"main\", \"high\", \"high10\", \"high422\", \"high444\"])\n unless validator.valid?(h264_profile)\n fail ArgumentError, \"invalid value for 'h264_profile', must be one of #{validator.allowable_values... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param array $data
@param string $file
@param string $sheet
@param string $range
@throws \MercesLab\Component\SpreadsheetClient\Exception\WriteRequestFailedException | [
"public function write(\n array $data,\n string $file,\n string $sheet = self::DEFAULT_SHEET,\n string $range = self::DEFAULT_RANGE\n ): void {\n $this->doWrite($data, $file, $sheet, $range);\n }"
] | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Decides whether to try to process the response as xml, json, or hand back
the text
@private
@inner
@function
@param {XMLHttpRequest} xhr - the completed network request | [
"function processResponse( xhr ){\n var responseText = xhr.responseText,\n status = xhr.status,\n statusText,\n data;\n\n if ( !xhr ) {\n throw new Error( $.getString( \"Errors.Security\" ) );\n } else if ( xhr.status !== 200 && xhr.status !== 0 ) {\n status = x... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the comment about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Computer Science:"
} |
// SetValue sets the Value field's value. | [
"func (s *StringFilter) SetValue(v string) *StringFilter {\n\ts.Value = &v\n\treturn s\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// fetchConfigs loads proto messages with rules from the config. | [
"func fetchConfigs(c context.Context, f policy.ConfigFetcher) (policy.ConfigBundle, error) {\n\tcfg := &admin.ServiceAccountsPermissions{}\n\tif err := f.FetchTextProto(c, serviceAccountsCfg, cfg); err != nil {\n\t\treturn nil, err\n\t}\n\treturn policy.ConfigBundle{serviceAccountsCfg: cfg}, nil\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
@see
com.ibm.wsspi.http.channel.compression.DecompressionHandler#decompress(
com.ibm.wsspi.bytebuffer.WsByteBuffer) | [
"@SuppressWarnings(\"unused\")\n public List<WsByteBuffer> decompress(WsByteBuffer buffer) throws DataFormatException {\n List<WsByteBuffer> output = new LinkedList<WsByteBuffer>();\n output.add(buffer);\n this.size += buffer.remaining();\n return output;\n }"
] | [
"@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com.... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// convertOffers takes any number of api-formatted remote applications and
// creates a collection of ui-formatted offers. | [
"func convertOffers(\n\tstore string, loggedInUser names.UserTag, offers ...*crossmodel.ApplicationOfferDetails,\n) (map[string]ShowOfferedApplication, error) {\n\tif len(offers) == 0 {\n\t\treturn nil, nil\n\t}\n\toutput := make(map[string]ShowOfferedApplication, len(offers))\n\tfor _, one := range offers {\n\t\ta... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github summarization about Juju model:",
"pos": "Represent the Github code about Juju model:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see
org.apache.lucene.search.spans.SpanQuery#createWeight(org.apache.lucene.
search.IndexSearcher, boolean) | [
"@Override\n public MtasSpanWeight createWeight(IndexSearcher searcher,\n boolean needsScores, float boost) throws IOException {\n return new SpanAllWeight(searcher, null, boost);\n }"
] | [
"public function addPhraseEntry()\n {\n include_once 'Zend/Search/Lucene/Search/QueryEntry/Phrase.php';\n $entry = new Zend_Search_Lucene_Search_QueryEntry_Phrase($this->_currentToken->text, $this->_context->getField());\n $this->_context->addEntry($entry);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about org.archive.wayback.resourceindex:",
"pos": "Represent the Github code about org.archive.wayback.resourceindex:",
"neg": "Represent the Github code:"
} |
Extracts types and related data from the given $rows.
@param array $rows
@param bool $keepTypeIdAsKey
@return array(Type) | [
"public function extractTypesFromRows(array $rows, bool $keepTypeIdAsKey = false)\n {\n $types = array();\n $fields = array();\n\n foreach ($rows as $row) {\n $typeId = (int)$row['ezcontentclass_id'];\n if (!isset($types[$typeId])) {\n $types[$typeId] = $... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get related Form instance or create it
@param bool|Form
@return Form | [
"public function form($instance = true)\n\t{\n\t\tif ($instance instanceof Form)\n\t\t{\n\t\t\t$this->form = $instance;\n\t\t\treturn $instance;\n\t\t}\n\n\t\tif (empty($this->form) and $instance === true)\n\t\t{\n\t\t\t$this->form = \\Form::forge($this);\n\t\t}\n\n\t\treturn $this->form;\n\t}"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Return locale-aware formatted string
@return string | [
"function format() {\n\t\t$args=func_get_args();\n\t\t$val=array_shift($args);\n\t\t// Get formatting rules\n\t\t$conv=localeconv();\n\t\treturn preg_replace_callback(\n\t\t\t'/\\{(?P<pos>\\d+)\\s*(?:,\\s*(?P<type>\\w+)\\s*'.\n\t\t\t'(?:,\\s*(?P<mod>(?:\\w+(?:\\s*\\{.+?\\}\\s*,?)?)*)'.\n\t\t\t'(?:,\\s*(?P<prop>.+?)... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
shortcut for returns(throws($e))
@api
@param \Throwable $e
@return $this
@since 3.2.0 | [
"public function throws(\\Throwable $e): self\n {\n $this->callMap = new CallMap(['function' => throws($e)]);\n return $this;\n }"
] | [
"final static function s($m, C $c) {return dfcf(function($m, C $c) {\n\t\t/**\n\t\t * 2017-07-19\n\t\t * Unable to reduce the implementation to:\n\t\t * \t\tdf_new(df_con_hier($m, self::class), $c);\n\t\t * because @uses __construct() is protected.\n\t\t * It is similar to @see \\Df\\Payment\\Facade::s()\n\t\t * ht... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Subclasses may override this method. | [
"def _get_index(self):\n \n contour = self.contour\n value = contour.bPoints.index(self)\n return value"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Checks if a user exists on the Postgres server.
CLI Example:
.. code-block:: bash
salt '*' postgres.user_exists 'username' | [
"def user_exists(name,\n user=None, host=None, port=None, maintenance_db=None,\n password=None,\n runas=None):\n '''\n \n '''\n return bool(\n role_get(name,\n user=user,\n host=host,\n port=port,\n ... | [
"def _list_nodes(call=None):\n '''\n \n '''\n local = salt.client.LocalClient()\n ret = local.cmd('salt-cloud:driver:vagrant', 'grains.items', '', tgt_type='grain')\n return ret"
] | codesearchnet | {
"query": "Represent the summarization about SaltStack:",
"pos": "Represent the code about SaltStack:",
"neg": "Represent the code about programming:"
} |
Loads a class of the given name from the project class loader or returns null if its not found | [
"public static Class<?> loadProjectClass(Project project, String className) {\n URLClassLoader classLoader = getProjectClassLoader(project);\n if (classLoader != null ){\n try {\n return classLoader.loadClass(className);\n } catch (ClassNotFoundException e) {\n ... | [
"private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
For the given group name, return the module list, on which it is mapped.
Create a new list, if not found.
@param map Map to be searched for group name.
@param groupname Group name to search. | [
"SortedSet<ModuleElement> getModuleList(Map<String, SortedSet<ModuleElement>> map,\n String groupname) {\n return map.computeIfAbsent(groupname, g -> new TreeSet<>(configuration.utils.makeModuleComparator()));\n }"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Replace the class name for the given stub.
@param string $stub
@param string $name
@return string | [
"protected function replaceClass($stub, $name)\n {\n $class = str_replace($this->getNamespace($name).'\\\\', '', $name);\n $view = $this->getViewName();\n\n $stub = str_replace('DummyClass', $class, $stub);\n\n return str_replace('DummyTemplate', 'admin.dashboard.'.$view, $stub);\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param array $properties
@return array | [
"protected function buildContext(array $properties)\n {\n $items = [];\n\n foreach ($properties as $key => $value) {\n $items[] = [\n 'Key' => $this->sanitizeString($key),\n 'Value' => $this->sanitizeString($value),\n ];\n }\n\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Renders a checkbox.
@return string the rendered content | [
"protected function checkBox()\n\t{\n\t\t$attribute = $this->attribute;\n\t\tlist($hidden, $checkbox) = $this->getSeparatedSelectableInput();\n\n\t\techo '<div class=\"controls\">';\n\t\techo ($hidden) ? $hidden . PHP_EOL : '';\n\t\techo '<label class=\"checkbox\" for=\"' . $this->getAttributeId($attribute) . '\">'... | [
"def render_flow(self, data):\n \n\n self.render_tree(data)\n\n # then reconstruct a new ODT document with the generated content\n for status in self.__save_output():\n yield status"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Returns the HTML string for insertion into the header.
@param string $uid Unique identifier for the output if the content is placed more than once on the same page
@return string|null String including HTML tags for the header on error | [
"public function getHeader( $uid = '' )\n\t{\n\t\t$context = $this->getContext();\n\t\t$site = $context->getLocale()->getSiteId();\n\t\t$view = $this->getView();\n\n\t\t$config = $context->getConfig()->get( 'client/html/basket/mini', [] );\n\t\t$key = $this->getParamHash( [], $uid . $site . ':basket:mini-header', $... | [
"def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Provide the contents of the requested file to tern
@param {string} name - the name of the file
@param {Function} next - the function to call with the text of the file
once it has been read in. | [
"function getFile(name, next) {\n // save the callback\n fileCallBacks[name] = next;\n\n setImmediate(function () {\n try {\n ExtractContent.extractContent(name, handleGetFile, _requestFileContent);\n } catch (error) {\n console.log(error);\n }\n });\n}"
] | [
"function(err, chunk)\n {\n // unsubscribe from the 'loadcomplete' event\n chunk.removeListener('loadcomplete', onLoadComplete);\n\n // if the chunk load succeeded\n if (!err)\n {\n // move on to the next chunk\n start++;\n\n // emit an event to signal that new data is available\n ... | codesearchnet | {
"query": "Represent the summarization about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code:"
} |
Provides Zenpy's default HTTPAdapter args for those users providing their own adapter. | [
"def http_adapter_kwargs():\n \n\n return dict(\n # Transparently retry requests that are safe to retry, with the exception of 429. This is handled\n # in the Api._call_api() method.\n max_retries=Retry(\n total=3,\n status_forcelist=[r fo... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Options registers a route for the Options http method.
//
// Returns a *Route and an error which will be filled if route wasn't registered successfully. | [
"func (api *APIBuilder) Options(relativePath string, handlers ...context.Handler) *Route {\n\treturn api.Handle(http.MethodOptions, relativePath, handlers...)\n}"
] | [
"func (c *defaultsCommand) Init(args []string) error {\n\t// There's no way of distinguishing a cloud name\n\t// from a model configuration setting without contacting the\n\t// API, but we aren't allowed to contact the API at Init time,\n\t// so we defer parsing the arguments until Run is called.\n\tc.args = args\n... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
get global total no of participants from db
@throws Exception | [
"private int getGlobalNoOfParticipants() throws Exception{\n if(sid == null){\n globalNoOfParticipants = calls.size();\n }else{\n CallDetailRecordsDao dao = storage.getCallDetailRecordsDao();\n globalNoOfParticipants = dao.getTotalRunningCallDetailRecordsByConferenceSi... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Loads the {@link TemporalSemanticSpace} from the sparse text formatted
file.
@param sspaceFile a file in {@link TSSpaceFormat#SPARSE_TEXT sparse text}
format | [
"private Map<String,SemanticVector> loadSparseText(File sspaceFile) \n throws IOException {\n\n LOGGER.info(\"loading sparse text TSS from \" + sspaceFile);\n\n BufferedReader br = new BufferedReader(new FileReader(sspaceFile));\n String[] header = br.readLine().split(\"\\\\s+\");\n ... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Documentation:"
} |
Adds doc-comment support to the given languages for the given documentation language.
@param {string[]|string} languages
@param {Object} docLanguage | [
"function addSupport(languages, docLanguage) {\n\t\tif (typeof languages === 'string') {\n\t\t\tlanguages = [languages];\n\t\t}\n\n\t\tlanguages.forEach(function (lang) {\n\t\t\tdocCommentSupport(lang, function (pattern) {\n\t\t\t\tif (!pattern.inside) {\n\t\t\t\t\tpattern.inside = {};\n\t\t\t\t}\n\t\t\t\tpattern.i... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// UseOrCreateObject returns obj if the canonical ObjectKind returned by the provided typer matches gvk, or
// invokes the ObjectCreator to instantiate a new gvk. Returns an error if the typer cannot find the object. | [
"func UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk schema.GroupVersionKind, obj Object) (Object, error) {\n\tif obj != nil {\n\t\tkinds, _, err := t.ObjectKinds(obj)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, kind := range kinds {\n\t\t\tif gvk == kind {\n\t\t\t\treturn obj, nil\n\t\t\t... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
// UpdateRunstatusIncident create runstatus incident event
// Events can be updates or final message with status completed. | [
"func (client *Client) UpdateRunstatusIncident(ctx context.Context, incident RunstatusIncident, event RunstatusEvent) error {\n\tif incident.EventsURL == \"\" {\n\t\treturn fmt.Errorf(\"empty Events URL for %#v\", incident)\n\t}\n\n\t_, err := client.runstatusRequest(ctx, incident.EventsURL, event, \"POST\")\n\tret... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Return identity details for the element as XML nodes | [
"def _as_rdf_xml(self, ns):\n \n self.rdf_identity = self._get_identity(ns)\n elements = []\n elements.append(ET.Element(NS('sbol', 'persistentIdentity'),\n attrib={NS('rdf', 'resource'):\n self._get_persistent_i... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// UpdateCurrentState updates the CurrentState for the service by saving the information in volatile storage. | [
"func (s *storeImpl) UpdateCurrentState(ctx datastore.Context, serviceID string, currentState string) error {\n\tplog.WithFields(log.Fields{\n\t\t\"serviceID\": serviceID,\n\t\t\"currentState\": currentState,\n\t}).Debug(\"Storing currentState\")\n\ts.updateCurrentState(serviceID, currentState, time.Now())\n\tre... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
附加中间件
@param {Object} app App对象
@param {Object} options 配置项 | [
"function attachMiddleware(app, options) {\n // 日志中间件\n app.use(log.express());\n // 初始化中间件\n app.use(require('./lib/middleware/init'));\n // 设置上下文\n app.use(setContext);\n\n // 附加自定义中间件\n beforeMiddlewares.forEach(function (fn) {\n app.use(fn);\n });\n\n // 路由绑定\n router.use... | [
"function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// listScaleSets lists all scale sets. | [
"func (ss *scaleSet) listScaleSets(resourceGroup string) ([]string, error) {\n\tvar err error\n\tctx, cancel := getContextWithCancel()\n\tdefer cancel()\n\n\tallScaleSets, err := ss.VirtualMachineScaleSetsClient.List(ctx, resourceGroup)\n\tif err != nil {\n\t\tklog.Errorf(\"VirtualMachineScaleSetsClient.List failed... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
404 Page Not Found Handler
@access private
@param string the page
@param bool log error yes/no
@return string | [
"function show_404($page = '', $log_error = TRUE)\n\t{\n\t\t$heading = \"404 Page Not Found\";\n\t\t$message = \"The page you requested was not found.\";\n\n\t\t// By default we log this, but allow a dev to skip it\n\t\tif ($log_error)\n\t\t{\n\t\t\tlog_message('error', '404 Page Not Found --> '.$page);\n\t\t}\n\n\... | [
"protected static function refuse(\n\t\tstring $message='Forbidden', int $code=403, bool $logout=false, bool $redirect=true\n\t) :void {\n\t\t// remove any existing session cookie\n\t\t!$logout ?: Cook::remove(Config::get('security','cookie'));\n\t\t// we will redirect to the login page\n\t\t!$redirect ?: Response:... | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code:"
} |
If given some hints['instance'] that is saved in a db, use related
fields from the same db. Otherwise if passed a class or instance to
model, return the salesforce alias if it's a subclass of SalesforceModel. | [
"def db_for_write(self, model, **hints):\n \n if 'instance' in hints:\n db = hints['instance']._state.db\n if db:\n return db\n if getattr(model, '_salesforce_object', False):\n return self.sf_alias"
] | [
"def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Deletes the auto-generated files for resize and letterboxing created by Timber
@param string $local_file ex: /var/www/wp-content/uploads/2015/my-pic.jpg
or: http://example.org/wp-content/uploads/2015/my-pic.jpg | [
"static function delete_generated_files( $local_file ) {\n\t\tif ( URLHelper::is_absolute($local_file) ) {\n\t\t\t$local_file = URLHelper::url_to_file_system($local_file);\n\t\t}\n\t\t$info = pathinfo($local_file);\n\t\t$dir = $info['dirname'];\n\t\t$ext = $info['extension'];\n\t\t$filename = $info['filename'];\n\t... | [
"def photo_url(self):\n \n img = self.soup.find('a', id='zh-avartar-edit-form').img['src']\n return img.replace('_m', '_r')"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about text processing:"
} |
[TARGET waitFor(RetryOption...)] | [
"public boolean waitFor() throws InterruptedException {\n try {\n // [START ]\n Job completedJob = job.waitFor();\n if (completedJob == null) {\n // job no longer exists\n } else if (completedJob.getStatus().getError() != null) {\n // job failed, handle error\n } else {\n ... | [
"def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Public functions
Creates an html string containing the issues.
@param {Object} issues - the issues in viewmodel format
@param {Boolean} enableFiltering - if true renders the severity filters
@returns {String} | [
"function render(issues, enableFiltering) {\n\t\tvar content = '';\n\n\t\tif (enableFiltering) {\n\t\t\tcontent += '<div class=\"filters\">' + getSeverityFilters(issues) + '<div>\\n';\n\t\t}\n\n\t\tcontent += '<div>' + getIssues(issues) + '</div>';\n\n\t\treturn '<div>' + content + '</div>';\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Registers the core services. | [
"private function registerServices(): void\n {\n $services = ExchangerRegistry::getServices();\n\n foreach ($services as $name => $class) {\n self::register($name, $class);\n }\n }"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// UnitState returns a single UnitState stored in the registry for a given unit
// name. | [
"func (r *EtcdRegistry) UnitState(name string) (state *unit.UnitState, err error) {\n\tvar us *unit.UnitState\n\tus, err = r.stateByMUSKey(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn us, nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Event handler called after writing to the database. | [
"public function onAfterWrite()\n {\n parent::onAfterWrite();\n if ($this->ParentID > 0) {\n $this->MenuSetID = $this->Parent()->MenuSetID;\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
set up all methods representing the port operations.
Parameters:
port -- Port that defines the operations. | [
"def setUpMethods(self, port):\n '''\n '''\n assert isinstance(port, WSDLTools.Port), \\\n 'expecting WSDLTools.Port not: ' %type(port)\n\n sd = self._services.get(port.getService().name)\n assert sd is not None, 'failed to initialize.'\n\n binding = port.getBind... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Handles a node leave event. | [
"private void handleLeaveEvent(Node node) {\n SwimMember member = members.get(MemberId.from(node.id().id()));\n if (member != null && !member.isActive()) {\n members.remove(member.id());\n }\n }"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Initialize object.
@param AdminStore $admin_store An instance of AdminStore. | [
"public static function init(AdminStore $admin_store) {\n\t\tself::$admin_store = $admin_store;\n\t\tself::$sql = $admin_store->store;\n\t\tself::$logger = $admin_store->logger;\n\t}"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Draw this image as part of a collection of images
@param x The x location to draw the image at
@param y The y location to draw the image at
@param width The width to render the image at
@param height The height to render the image at | [
"public void drawEmbedded(float x,float y,float width,float height) {\r\n\t\tinit();\r\n\t\t\r\n\t\tif (corners == null) {\r\n\t\t GL.glTexCoord2f(textureOffsetX, textureOffsetY);\r\n\t\t\tGL.glVertex3f(x, y, 0);\r\n\t\t\tGL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);\r\n\t\t\tGL.glVertex3f(x, ... | [
"function fillRotatedRect(ctx, x, y, width, height, angle) {\n // Get the origin of the rectangle around its center\n var originX = width / 2;\n var originY = height / 2;\n\n // Save the unrotated context of the canvas so we can restore it later\n ctx.save();\n\n // Rotate the around the origin, given the spe... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Process the timephased resource assignment data to work out the
split structure of the task.
@param task parent task
@param timephasedComplete completed resource assignment work
@param timephasedPlanned planned resource assignment work | [
"public void processSplitData(Task task, List<TimephasedWork> timephasedComplete, List<TimephasedWork> timephasedPlanned)\n {\n Date splitsComplete = null;\n TimephasedWork lastComplete = null;\n TimephasedWork firstPlanned = null;\n if (!timephasedComplete.isEmpty())\n {\n lastCo... | [
"def ObjectInitializedEventHandler(analysis, event):\n \n\n # Initialize the analysis if it was e.g. added by Manage Analysis\n wf.doActionFor(analysis, \"initialize\")\n\n # Try to transition the analysis_request to \"sample_received\". There are\n # some cases that can end up with an inconsistent s... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
- (id) fleeceValueToObjectAtIndex: (NSUInteger)index | [
"private Object fleeceValueToObject(int index) {\n check(index);\n final FLValue value = values.get(index);\n if (value == null) { return null; }\n final MRoot root = new MRoot(context, value, false);\n synchronized (rs.getQuery().getDatabase().getLock()) {\n return roo... | [
"def creationTime(item):\n \n forThisItem = _CreationTime.createdItem == item\n return item.store.findUnique(_CreationTime, forThisItem).timestamp"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
called when the user has moved the map. the coordinates are EPSG:4326 (WGS) values. The arguments are double
primitives and no Double objects.
@param lat
new latitude value
@param lon
new longitude value | [
"public void centerMovedTo(double lat, double lon) {\n final Coordinate newCenter = new Coordinate(lat, lon);\n if (logger.isTraceEnabled()) {\n logger.trace(\"JS reports center value {}\", newCenter);\n }\n lastCoordinateFromMap.set(newCenter);\n ... | [
"def setCenter(self, loc):\n \n offset = self.getCenter().getOffset(loc) # Calculate offset from current center\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Wrap a view-like function that returns an object that
is convertable from json | [
"def json_api_call(req_function):\n \n @wraps(req_function)\n def newreq(request, *args, **kwargs):\n outp = req_function(request, *args, **kwargs)\n if issubclass(outp.__class__, HttpResponse):\n return outp\n else:\n return '%s' % json.dumps(outp, cls=LazyEncode... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return the perp product of the given vectors. The perp product is
just a cross product where the third dimension is taken to be zero and
the result is returned as a scalar. | [
"def perp_product(self, other):\n \n\n return self.x * other.y - self.y * other.x"
] | [
"def dihedral(array_of_xyzs):\n \n p1 = array_of_xyzs[0]\n p2 = array_of_xyzs[1]\n p3 = array_of_xyzs[2]\n p4 = array_of_xyzs[3]\n\n vector1 = -1.0 * (p2 - p1)\n vector2 = p3 - p2\n vector3 = p4 - p3\n\n # Normalize vector so as not to influence magnitude of vector\n # rejections\n ... | codesearchnet | {
"query": "Represent the instruction about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code:"
} |
Closes our streams. It's up to you
to close any {@link OggPacketWriter} instances
first! | [
"public void close() throws IOException {\n if(inp != null)\n inp.close();\n if(out != null)\n out.close();\n }"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. | [
"func (s *Snapshot) SetPreferredMaintenanceWindow(v string) *Snapshot {\n\ts.PreferredMaintenanceWindow = &v\n\treturn s\n}"
] | [
"public final void start() {\n if (!enabled) {\n return;\n }\n\n long periodSeconds = properties.getSeconds(PERIOD_SECONDS);\n if (periodSeconds <= 0) {\n long defaultValue = Long.parseLong(PERIOD_SECONDS.getDefaultValue());\n logger.warning(\"Provided cl... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Возвращает модель
@param int $id
@return mixed
@throws HttpException | [
"protected function loadModel($id)\n {\n // Если модель не определена\n if (!$this->model) {\n // Определяем модель в соответствии с переданным именем класса\n $this->model = call_user_func([$this->modelClass, 'findOne'], [$id]);\n }\n\n // Определяем переданные ... | [
"private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
HTTP request
@param string $method
@param string $url
@param array $options
@return ResponseInterface
@throws ServerErrorHttpException | [
"private function _request($method, $url, array $options) {\n\t\ttry {\n\t\t\t$response = $this->httpClient->{$method}($url, $options);\n\t\t} catch(ClientException $e) {\n\t\t\t$response = $e->getResponse();\n\t\t} catch(ConnectException $e) {\n\t\t\t$this->_throwServerError($e);\n\t\t} catch (RequestException $e)... | [
"public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ... | codesearchnet | {
"query": "Represent the sentence about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
// Pop removes the minimum element from the queue and returns it.
// The time complexity is O(log n) where n = q.Len(). | [
"func (q *prioQueue) Pop() int {\n\tn := q.Len() - 1\n\tq.swap(0, n)\n\tq.down(0, n)\n\n\tv := q.heap[n]\n\tq.index[v] = -1\n\tq.heap = q.heap[:n]\n\treturn v\n}"
] | [
"def k_closest(points, k, origin=(0, 0)):\n # Time: O(k+(n-k)logk)\n # Space: O(k)\n \n heap = [(-distance(p, origin), p) for p in points[:k]]\n heapify(heap)\n\n \"\"\"\n For every point p in points[k:],\n check if p is smaller than the root of the max heap;\n if it is, add p to heap and... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
client = BacklogClient("your_space_name", "your_api_key")
client.project_activities("YOUR_PROJECT")
client.project_activities("YOUR_PROJECT", {"activityTypeId[]": [1, 2],}) | [
"def project_activities(self, project_id_or_key, extra_query_params={}):\n \n return self.do(\"get\", \"projects/{project_id_or_key}/activities\",\n url_params={\"project_id_or_key\": project_id_or_key},\n query_params=extra_query_params,\n ... | [
"def get_order(self, uuid):\n \n return self._api_query(path_dict={\n API_V1_1: '/account/getorder',\n API_V2_0: '/key/orders/getorder'\n }, options={'uuid': uuid, 'orderid': uuid}, protection=PROTECTION_PRV)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about API documentation:"
} |
// ApplicationNames returns the names of applications
// represented by units running on the machine. | [
"func (m *Machine) ApplicationNames() ([]string, error) {\n\tunits, err := m.Units()\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tapps := set.NewStrings()\n\tfor _, unit := range units {\n\t\tapps.Add(unit.ApplicationName())\n\t}\n\treturn apps.SortedValues(), nil\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Returns the maximum value that is accepted by the `speed_sp` attribute. This
may be slightly different than the maximum speed that a particular motor can
reach - it's the maximum theoretical speed. | [
"def max_speed(self):\n \n (self._max_speed, value) = self.get_cached_attr_int(self._max_speed, 'max_speed')\n return value"
] | [
"def _pdf_value(pdf, population, fitnesses, fitness_threshold):\n \n # Add the chance of obtaining a solution from the pdf\n # when the fitness for that solution exceeds a threshold\n value = 0.0\n for solution, fitness in zip(population, fitnesses):\n if fitness >= fitness_threshold:\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Log a message with priority 'verbose'.
@param string $msg
@param resource fileHandle | [
"public function verbose($msg, $fileHandle = null)\n {\n $this->log(self::$logLevelVerbose, $msg, $fileHandle = null);\n }"
] | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Honeycomb is a honeypot framework. | [
"def cli(ctx, home, iamroot, config, verbose):\n \"\"\"\"\"\"\n _mkhome(home)\n setup_logging(home, verbose)\n\n logger.debug(\"Honeycomb v%s\", __version__, extra={\"version\": __version__})\n logger.debug(\"running command %s (%s)\", ctx.command.name, ctx.params,\n extra={\"command\... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Load an instance of this class from YAML. | [
"def loads(cls, s):\n \n with closing(StringIO(s)) as fileobj:\n return cls.load(fileobj)"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Gets the back route with the correct language
@param string $language Language to be replaced
@return string string for back url | [
"public function getLocalBack($language)\n {\n $backUrl = redirect()->back()->getTargetUrl();\n $current = $this->getCurrentLanguage();\n $start = strpos($backUrl, $current);\n $count = strlen($current);\n if ($backUrl[$start - 1] == '/' && (!isset($backUrl[$start + $count])) |... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// ListFetchedFeeds list fetched feeds information | [
"func ListFetchedFeeds(driver db.DB) (metas []models.FeedMeta, err error) {\n\tlastMetas, err := driver.GetFetchedFeedMetas()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get Meta: %s\", err)\n\t}\n\tif len(lastMetas) == 0 {\n\t\tlog.Infof(\"No feeds found\")\n\t\treturn nil, nil\n\t}\n\n\t//TODO use ... | [
"function(list){\n localStorage.setItem(localStorageKey, JSON.stringify(list));\n // if we used a real database, we would likely do the below in a callback\n this.list = list;\n this.trigger(list); // sends the updated list to all listening components (TodoApp)\n }... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Extends the inline parser dictionary.
@param
@return | [
"public function addInlineType($Marker, $Type)\r\n {\r\n if (!isset($this->InlineTypes[$Marker]))\r\n {\r\n $this->InlineTypes[$Marker] = [];\r\n $this->inlineMarkerList .= $Marker;\r\n }\r\n\r\n $InlineTypes = &$this->InlineTypes[$Marker];\r\n array_unshi... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param mixed $subject
@param array $classes
@return bool | [
"protected function supportClasses($subject, array $classes) {\n foreach ($classes as $supportedClass) {\n if ($subject instanceof $supportedClass) {\n return true;\n }\n }\n\n return false;\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get messages from the queue and pass them to _process_msg().
Make sure we process one message at a time to keep them in sequence. | [
"async def _process_msgs(self):\n \n while True:\n args = await self._msgq.get()\n _LOGGER.debug('Processing: %s %02x %s %s %s', args[0], args[1],\n *[args[i].hex() for i in range(2, 5)])\n await self._process_msg(*args)"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github summarization about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about File management:"
} |
Process the view request at the current state. | [
"def process(\n self, request, application,\n expected_state, label, extra_roles=None):\n \n\n # Get the authentication of the current user\n roles = self._get_roles_for_request(request, application)\n if extra_roles is not None:\n roles.update(extra_role... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetEcsClusterName sets the EcsClusterName field's value. | [
"func (s *EcsCluster) SetEcsClusterName(v string) *EcsCluster {\n\ts.EcsClusterName = &v\n\treturn s\n}"
] | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
ControlFileHandler - Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()). | [
"public void init(Record record)\n {\n super.init(record);\n this.setMasterSlaveFlag(FileListener.RUN_IN_MASTER | FileListener.DONT_REPLICATE_TO_SLAVE);\n }"
] | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Resolve the field directive.
@param \Nuwave\Lighthouse\Schema\Values\FieldValue $value
@param \Closure $next
@return \Nuwave\Lighthouse\Schema\Values\FieldValue
@throws \Nuwave\Lighthouse\Exceptions\DirectiveException | [
"public function handleField(FieldValue $value, Closure $next): FieldValue\n {\n $contextAttributeName = $this->directiveArgValue('context');\n if (! $contextAttributeName) {\n throw new DirectiveException(\n \"The `inject` directive on {$value->getParentName()} [{$value->... | [
"protected function addSql($sql, array $params = [], array $types = [])\n {\n $message = 'Calling method \"addSql\" is not allowed. Use \"sql\" method instead';\n throw new \\Shopsys\\MigrationBundle\\Component\\Doctrine\\Migrations\\Exception\\MethodIsNotAllowedException($message);\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
initTypes
Get the result types from the result handler.
@return ResultIterator $this | [
"protected function initTypes()\n {\n foreach ($this->result->getFieldNames() as $index => $name) {\n $type = $this->result->getFieldType($name);\n\n if ($type === null) {\n $type = 'text';\n }\n\n $this->types[$name] = $type;\n $this->... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
@param TemplateEntityInterface $templateEntity
@param bool $recip
@return $this
@SuppressWarnings(PHPMD.BooleanArgumentFlag) | [
"public function removeTemplateEntity(\n TemplateEntityInterface $templateEntity,\n bool $recip = true\n ): self {\n $this->removeFromEntityCollectionAndNotify('templateEntities', $templateEntity);\n if ($this instanceof ReciprocatesTemplateEntityInterface && true === $recip) {\n ... | [
"public function _afterLoad()\n {\n $value = $this->getValue();\n /** @noinspection ExceptionsAnnotatingAndHandlingInspection */\n /** @noinspection PhpParamsInspection */\n $this->setValue(empty($value) ? false : $this->encoder->decode($value));\n parent::_afterLoad();\n }"... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about writing:"
} |
Creates table which manages schema version and insert an initial record as version 0. | [
"protected void createTable(){\r\n sqlManager.executeUpdate(\r\n new StringSqlResource(String.format(\"CREATE TABLE %s (VERSION NUMERIC NOT NULL)\", tableName)));\r\n\r\n sqlManager.executeUpdate(\r\n new StringSqlResource(String.format(\"INSERT INTO %s (0))\", tableName)... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
List roles
@Route ("/", name="KunstmaanUserManagementBundle_settings_roles")
@Template("KunstmaanAdminListBundle:Default:list.html.twig")
@throws AccessDeniedException
@return array | [
"public function listAction(Request $request)\n {\n $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');\n\n $em = $this->getDoctrine()->getManager();\n /* @var AdminList $adminlist */\n $adminlist = $this->container->get('kunstmaan_adminlist.factory')->createList(new RoleAdminListConf... | [
"public function exitAction($hash, $id)\n {\n $media = $this->getMedia($id);\n\n $this->checkMedia($hash, $media);\n\n return new Response($this->templating->render('@SonataMedia/Extra/pixlr_exit.html.twig'));\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Publish failed response event.
@param string $eventClass
@param string $errorMessage
@param KernelContext $context
@return \Generator | [
"private static function publishThrowable(string $eventClass, string $errorMessage, KernelContext $context): \\Generator\n {\n /**\n * @noinspection VariableFunctionsUsageInspection\n *\n * @var \\ServiceBus\\Services\\Contracts\\ExecutionFailedEvent $event\n */\n $e... | [
"public function logError(ContactEventLog $eventLog, $errorMessage)\n {\n // @todo - add translator for messages.\n $eventLog->addProperty('error', $errorMessage)\n ->setAction('failed');\n $this->ContactEventLogRepo->saveEntity($eventLog);\n // $this->logDebug('Line '. 1 .... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// SetDataSourceName sets the DataSourceName field's value. | [
"func (s *CreateDataSourceFromRedshiftInput) SetDataSourceName(v string) *CreateDataSourceFromRedshiftInput {\n\ts.DataSourceName = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
-------------------------------------------------------------------------------------------- | [
"protected GenericDataSinkBase<T> translateToDataFlow(Operator<T> input) {\n\t\t// select the name (or create a default one)\n\t\tString name = this.name != null ? this.name : this.format.toString();\n\t\tGenericDataSinkBase<T> sink = new GenericDataSinkBase<>(this.format, new UnaryOperatorInformation<>(this.type, ... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the Github instruction about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.