query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Creates new {@linkplain WebArgumentMetadata} in the target and copies all meta data.
@param sourceView source jCas
@param targetView target jCas
@throws IllegalArgumentException if the {@code targetView} already contains
{@linkplain WebArgumentMetadata} | [
"public static void copy(final JCas sourceView, final JCas targetView)\n throws IllegalArgumentException\n {\n if (hasWebArgumentMetadata(targetView)) {\n throw new IllegalArgumentException(\n \"Target view already contains \" + WebArgumentMetadata.class.getName())... | [
"public void visitEnd() {\n String classname = workbench.getType().getClassName();\n\n component.addAttribute(new Attribute(\"classname\", classname));\n\n // Generates the provides attribute.\n component.addElement(ElementHelper.getProvidesElement(specifications));\n\n if (workbe... | codesearchnet | {
"query": "Represent the summarization about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
simple synchronous rest get call | [
"private static String syncRestNativeCall(final String purl) {\n final XMLHttpRequest xmlHttp = Browser.getWindow().newXMLHttpRequest();\n xmlHttp.open(\"GET\", purl, false); // false for synchronous request\n xmlHttp.send();\n return xmlHttp.getResponseText();\n }"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Lists all PartnerRequest models.
@return mixed
@throws ForbiddenHttpException | [
"public function actionIndex()\n {\n $partners = PartnerRequest::find()->all();\n $searchModel = new SearchPartnerRequest();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'partners' => $par... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the post about Sales Channel API:",
"pos": "Represent the code about Sales Channel API:",
"neg": "Represent the code about Software development:"
} |
Marshall the given parameter object. | [
"public void marshall(DeleteTopicRuleRequest deleteTopicRuleRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteTopicRuleRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetRoleArn sets the RoleArn field's value. | [
"func (s *CreateStreamProcessorInput) SetRoleArn(v string) *CreateStreamProcessorInput {\n\ts.RoleArn = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Scale the components of the colour by the given value
@param value The value to scale by
@return The copy which has been scaled | [
"public Color scaleCopy(float value) {\r\n\t\tColor copy = new Color(r,g,b,a);\r\n\t\tcopy.r *= value;\r\n\t\tcopy.g *= value;\r\n\t\tcopy.b *= value;\r\n\t\tcopy.a *= value;\r\n\t\t\r\n\t\treturn copy;\r\n\t}"
] | [
"def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns transformed amount by the given currency code which can be handled by the gateway API.
@param float $amount Value from the store.
@param string $currencyCode
@return int
@throws InvalidArgumentException | [
"public static function getGatewayAmountOfCurrency($amount, $currencyCode) {\n $currencyCode = strtoupper($currencyCode);\n\n if ( ! is_numeric($amount) ) {\n throw new InvalidArgumentException('The amount value is not numeric. The [' . $amount . '] value has been given.');\n }\n\n ... | [
"public function resetAllInvoiceOptions(): Client\n {\n $this->sendInvoiceByPost = null;\n $this->invoiceMaturityDays = null;\n $this->stopServiceDue = null;\n $this->stopServiceDueDays = null;\n // TODO: Add 'Late fee delay' to list of resets when made available!\n\n /*... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
name is an Array | [
"def extract_suffix(name)\n return unless name && name.size >= 3\n\n (name.size - 1).downto(2) do |n|\n suff = nil\n\n Nameable::Latin::Patterns::SUFFIX.each_pair do |pretty, regex|\n suff = pretty if name[n] =~ regex\n end\n\n if name[n] =~ Nameable::Latin::Patterns::... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Update an existing app transfer.
//
// appTransferIdentity is the unique identifier of the AppTransfer. state is the
// the current state of an app transfer. | [
"func (c *Client) AppTransferUpdate(appTransferIdentity string, state string) (*AppTransfer, error) {\n\tparams := struct {\n\t\tState string `json:\"state\"`\n\t}{\n\t\tState: state,\n\t}\n\tvar appTransferRes AppTransfer\n\treturn &appTransferRes, c.Patch(&appTransferRes, \"/account/app-transfers/\"+appTransferId... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
process packets from MAVLink slaves, forwarding to the master | [
"def process_mavlink(slave):\n ''''''\n try:\n buf = slave.recv()\n except socket.error:\n return\n try:\n global mavversion\n if slave.first_byte and mavversion is None:\n slave.auto_mavlink_version(buf)\n msgs = slave.mav.parse_buffer(buf)\n except mavu... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param mixed $model
@return mixed | [
"protected function getModel($model)\n {\n if ($model instanceof Model) {\n return $model;\n }\n\n if (!class_exists($model) || !is_string($model) || !is_subclass_of($model, Model::class)) {\n throw new \\InvalidArgumentException(\"Invalid model [$model] !\");\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Generate csfr token.
@return void
@throws EndomondoApiException When generating fail | [
"protected function generateCSRFToken()\n {\n try {\n parent::generateCSRFToken();\n } catch (ClientException $e) {\n // too many request, sleep for a while\n if ($e->getCode() === 429) {\n throw new EndomondoApiException('Too many requests', $e->getC... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// randBytes returns a random string consisting of the characters in
// validBootstrapTokenChars, with the length customized by the parameter | [
"func randBytes(length int) (string, error) {\n\t// len(\"0123456789abcdefghijklmnopqrstuvwxyz\") = 36 which doesn't evenly divide\n\t// the possible values of a byte: 256 mod 36 = 4. Discard any random bytes we\n\t// read that are >= 252 so the bytes we evenly divide the character set.\n\tconst maxByteValue = 252\... | [
"func createTxidRangeEndKey(txid string) []byte {\n\tvar endKey []byte\n\tendKey = append(endKey, prwsetPrefix)\n\tendKey = append(endKey, compositeKeySep)\n\tendKey = append(endKey, []byte(txid)...)\n\t// As txid is a fixed length string (i.e., 128 bits long UUID), 0xff can be used as a stopper.\n\t// Otherwise a ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Set the stub logic. | [
"public function andRun()\n {\n if ($this->_returns) {\n throw new Exception(\"Some return value(s) has already been set.\");\n }\n $closures = func_get_args();\n foreach ($closures as $closure) {\n if (!is_callable($closure)) {\n throw new Excepti... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns recommlist count
@param string $sOx object ID (default is null)
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
@return int | [
"public function getRecommListsCount($sOx = null)\n {\n if (!$sOx) {\n $sOx = $this->getId();\n }\n\n if ($this->_iCntRecommLists === null || $sOx) {\n $oDb = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb();\n $this->_iCntRecommLists = 0;\n $i... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Modifies the HTTP response and body based on the provided HaltException.
@param httpResponse The HTTP servlet response
@param body The body content
@param halt The halt exception object | [
"public static void modify(HttpServletResponse httpResponse, Body body, HaltException halt) {\n\n httpResponse.setStatus(halt.statusCode());\n\n if (halt.body() != null) {\n body.set(halt.body());\n } else {\n body.set(\"\");\n }\n }"
] | [
"@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// NewContext creates a Context object. | [
"func NewContext(req *Request, res *Response, f *Fibre) *Context {\n\treturn &Context{\n\t\tfibre: f,\n\t\trequest: req,\n\t\tresponse: res,\n\t}\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 summarization about Go programming language:",
"pos": "Represent the Github code about Go programming language:",
"neg": "Represent the Github code about programming:"
} |
// Source returns the JSON-serializable data. | [
"func (s GeoDistanceSort) Source() interface{} {\n\tsource := make(map[string]interface{})\n\tx := make(map[string]interface{})\n\tsource[\"_geo_distance\"] = x\n\n\t// Points\n\tptarr := make([]interface{}, 0)\n\tfor _, pt := range s.points {\n\t\tptarr = append(ptarr, pt.Source())\n\t}\n\tfor _, geohash := range ... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Create a writer builder for Ebi43InvoiceType.
@return The builder and never <code>null</code> | [
"@Nonnull\n public static EbInterfaceWriter <Ebi43InvoiceType> ebInterface43 ()\n {\n final EbInterfaceWriter <Ebi43InvoiceType> ret = EbInterfaceWriter.create (Ebi43InvoiceType.class);\n ret.setNamespaceContext (EbInterface43NamespaceContext.getInstance ());\n return ret;\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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
以SQL语句发起查询操作,将父类查询结果实例为SResult对象
@param string $sql
@param array|string $bind 要绑定的参数
@return Result | [
"public function query(string $sql, $bind = []): Result\n {\n $result = parent::query($sql, $bind);\n return new Result($this->tableName, $result);\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Invokes the $.mobile.changePage method | [
"static void changePage(String url, TransitionIntf<?> t, boolean reverse, boolean changeHash,\n boolean dialog) {\n changingPage = true;\n try {\n changePage(url, t.getJqmValue(), reverse, changeHash, dialog ? DATA_ROLE_DIALOG : null);\n } finally {\n ... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
insertValueIntoStructureByPath
@param array<string> $path
@param array $target
@param mixed $value
@return void | [
"static protected function insertValueIntoStructureByPath(array $path, &$target, $value) {\n\t\t$segment = array_shift($path);\n\t\tif (count($path) > 0) {\n\t\t\tif (!array_key_exists($segment, $target)) {\n\t\t\t\t$target[$segment] = array();\n\t\t\t}\n\t\t\tself::insertValueIntoStructureByPath($path, $target[$se... | [
"protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Creates \Google\Protobuf\EnumDescriptorProto object from serialized Protocol Buffers message.
@param string $input
@param EnumDescriptorProto $object
@param int $start
@param int $end
@throws \Exception
@return EnumDescriptorProto | [
"public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)\n\t{\n\t\tif ($object === null) {\n\t\t\t$object = new EnumDescriptorProto();\n\t\t}\n\n\t\tif ($end === null) {\n\t\t\t$end = strlen($input);\n\t\t}\n\n\t\twhile ($start < $end) {\n\t\t\t$tag = Binary::decodeVarint($input, $star... | [
"protected function generateExtension(FileDescriptorProto $fileDescriptor, $parent = null)\n {\n $name = 'Extension';\n $type = Entity::TYPE_EXTENSION;\n $entity = new Entity($type, $name, $fileDescriptor, $fileDescriptor, $parent);\n\n if ($fileDescriptor->hasExtensionList() && $... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Stores given data into a file
@param object $data IDS_Report
@throws Exception if the logfile isn't writeable
@return boolean | [
"public function execute(IDS_Report $data) \n {\n\n /*\n * In case the data has been modified before it might be necessary \n * to convert it to string since we can't store array or object \n * into a file\n */\n $data = $this->prepareData($data);\n\n if (is_... | [
"def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Do a transfer with `target` with the given `amount` of `token_address`. | [
"def transfer_and_wait(\n self,\n registry_address: PaymentNetworkID,\n token_address: TokenAddress,\n amount: TokenAmount,\n target: Address,\n identifier: PaymentID = None,\n transfer_timeout: int = None,\n secret: Secret = No... | [
"function (state) {\n // console.log(JSON.stringify(state, false, 2));\n let env = state.pointers[state.head];\n let specific = '';\n let faked = '';\n\n if(env.type === 'internal') {\n let dHeight = env.meta.height - env.forkRoot;\n specific = `fork root: ${env.forkRoot}\nheight: +${dHeigh... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Blockchain:"
} |
// ArrayOfFloats extracts an array of float64s from some json | [
"func (j *JsonQuery) ArrayOfFloats(s ...string) ([]float64, error) {\n\tarray, err := j.Array(s...)\n\tif err != nil {\n\t\treturn []float64{}, err\n\t}\n\ttoReturn := make([]float64, len(array))\n\tfor index, val := range array {\n\t\ttoReturn[index], err = floatFromInterface(val)\n\t\tif err != nil {\n\t\t\tretur... | [
"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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Returns the link validator class.<p>
@return the link validator class | [
"private CmsInternalLinksValidator getValidator() {\n\n if (m_validator == null) {\n // get the content check result object\n Map objects = (Map)getSettings().getDialogObject();\n Object o = objects.get(CmsInternalLinkValidationDialog.class.getName());\n List resou... | [
"public final void setTemplateMode(final String templateMode) {\n // Setter overload actually goes against the JavaBeans spec, but having this one is good for legacy\n // compatibility reasons. Besides, given the getter returns TemplateMode, intelligent frameworks like\n // Spring will recogniz... | codesearchnet | {
"query": "Represent the Github instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
Parse string into a list of points.
Returns a list containing an even number of coordinate strings | [
"def parseListOfPoints(s):\n \n i = 0\n\n # (wsp)? comma-or-wsp-separated coordinate pairs (wsp)?\n # coordinate-pair = coordinate comma-or-wsp coordinate\n # coordinate = sign? integer\n # comma-wsp: (wsp+ comma? wsp*) | (comma wsp*)\n ws_nums = re.split(r\"\\s*[\\s,]\\s*\", s.strip())\n nu... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// TerminateNicely can be called multiple times simultaneously from different goroutines | [
"func (p *execProcess) TerminateNicely(killGracePeriod time.Duration) error {\n\t// Make sure process is being waited on for process state reaping to occur\n\t// as to avoid forcibly killing the process after killGracePeriod\n\tif p.waitCh == nil {\n\t\tpanic(\"TerminateNicely() must be called after Wait()\")\n\t}\... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Loads a custom logic module to populate additional distribution information | [
"function customLogic (os, name, file, cb) {\n var logic = './logic/' + name + '.js'\n try { require(logic)(os, file, cb) } catch (e) { cb(null, os) }\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a normalized front
@param front
@return | [
"public Front normalize(Front front) {\n if (front == null) {\n throw new JMetalException(\"The front is null\") ;\n }\n\n return getNormalizedFront(front, maximumValues, minimumValues);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Generate a listing of all glyph names in a font
@param $data
@return array | [
"protected function dataToGlyphSet($data)\n {\n $glyphs = array();\n foreach ($data->icons as $iconProperties) {\n $glyphs[] = $iconProperties->properties->name;\n }\n return $glyphs;\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get the configuration for a cache cluster.
CLI example::
salt myminion boto_elasticache.get_config myelasticache | [
"def get_config(name, region=None, key=None, keyid=None, profile=None):\n '''\n \n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n if not conn:\n return None\n try:\n cc = conn.describe_cache_clusters(name,\n s... | [
"def openstack_undercloud_install(self):\n \n instack_undercloud_ver, _ = self.run('repoquery --whatprovides /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.pp')\n if instack_undercloud_ver.rstrip('\\n') == 'instack-undercloud-0:2.2.0-1.el7ost.noarch':\n LOG.war... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets the Elliptic Curve associated with the key.
:param arg: an optional curve name
:raises InvalidJWKType: the key is not an EC or OKP key.
:raises InvalidJWKValue: if the curve names is invalid. | [
"def get_curve(self, arg):\n \n k = self._key\n if self._params['kty'] not in ['EC', 'OKP']:\n raise InvalidJWKType('Not an EC or OKP key')\n if arg and k['crv'] != arg:\n raise InvalidJWKValue('Curve requested is \"%s\", but '\n 'ke... | [
"function(algo) {\n switch (algo) {\n // Algorithm-Specific Fields for RSA encrypted session keys:\n // - MPI of RSA encrypted value m**e mod n.\n case enums.publicKey.rsa_encrypt:\n case enums.publicKey.rsa_encrypt_sign:\n return [type_mpi];\n\n // Algorithm-Specific Fi... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Encryption:"
} |
Converts map element into a float or returns null if conversion is not
possible.
@param key a key of element to get.
@return float value of the element or null if conversion is not supported.
@see FloatConverter#toNullableFloat(Object) | [
"public Float getAsNullableFloat(String key) {\n\t\tObject value = getAsObject(key);\n\t\treturn FloatConverter.toNullableFloat(value);\n\t}"
] | [
"@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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
@param string $method
@param string $uri
@param array $headers
@param array $options
@return RequestInterface | [
"public function createRequest($method, $uri, array $headers = [], array $options = [])\n {\n $body = JsonRpc\\json_encode($this->addIdToRequest($method, $options));\n\n return new Request('POST', $uri, $headers, $body === false ? null : $body);\n }"
] | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Registers an event handler for a message type and returns a subscription. | [
"@Override\n public <T, U extends T> AutoCloseable registerHandler(\n final Class<U> messageType, final EventHandler<RemoteMessage<T>> theHandler) {\n\n if (LOG.isLoggable(Level.FINE)) {\n LOG.log(Level.FINE, \"RemoteManager: {0} messageType: {1} handler: {2}\", new Object[] {\n this.name, me... | [
"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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Infof implements the github.com/uber/jaeger-client-go/log.Logger interface. | [
"func (l *Logger) Infof(msg string, args ...interface{}) {\n\tl.infoLogger.Log(l.messageKey, fmt.Sprintf(msg, args...))\n}"
] | [
"func GenerateConfig(cfgFile string, data map[string]interface{}) error {\n\toncer.Deprecate(0, \"generate.GenerateConfig\", \"Use github.com/gobuffalo/pop/genny/config instead.\")\n\treturn Config(cfgFile, data)\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Update progress bar
:param SyncCopy self: this | [
"def _update_progress_bar(self):\n # type: (SyncCopy) -> None\n \n blobxfer.operations.progress.update_progress_bar(\n self._general_options,\n 'synccopy',\n self._synccopy_start_time,\n self._synccopy_total,\n self._synccopy_sofar,\n ... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Determine the location to map loaded data (e.g., weights)
for a given target device (e.g. 'cuda'). | [
"def get_map_location(target_device, fallback_device='cpu'):\n \n map_location = torch.device(target_device)\n\n # The user wants to use CUDA but there is no CUDA device\n # available, thus fall back to CPU.\n if map_location.type == 'cuda' and not torch.cuda.is_available():\n warnings.warn(\n... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
对于java.lang.Object/java.util.Date对象, hessian序列化时需要写入object/date,此处进行转换
@param type 类名称
@return 转换结果 | [
"public static String encodeObjectAndDate(String type) {\n return type.replace(Object.class.getName(), \"object\").replace(Date.class.getName(), \"date\");\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
The helper method for handling JSON Post and Get requests. | [
"def _handle_wrapper(self):\n \"\"\"\"\"\"\n if self.request.headers.get(\"X-Requested-With\") != \"XMLHttpRequest\":\n logging.error(\"Got JSON request with no X-Requested-With header\")\n self.response.set_status(\n 403, message=\"Got JSON request with no X-Requested-With header\")\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 description about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code about programming:"
} |
Get a CLI password input (hidden) from a password property.
@param PropertyInterface $prop The property to retrieve input from.
@param string $label The input label.
@return LeagueInput The League's terminal input object. | [
"private function passwordInput(PropertyInterface $prop, $label)\n {\n unset($prop);\n\n $climate = $this->climate();\n\n $input = $climate->password($label);\n return $input;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns true, if entities contains VO members group
@param Group[] $entities
@return bool | [
"private function containsMembersGroup($entities)\n {\n if (empty($entities)) {\n return false;\n }\n foreach ($entities as $entity) {\n if (preg_match('/[^:]*:members$/', $entity->getName())) {\n return true;\n }\n }\n return fal... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Documentation:"
} |
Assert that database changed only by insertion of given
data sets (error message variant).
@param message Assertion error message.
@param dataSets Data sets.
@throws DBAssertionError if the assertion fails.
@see #assertInserted(String,DataSet)
@since 1.2 | [
"@SafeVarargs\n public static void assertInserted(String message, DataSet... dataSets) throws DBAssertionError {\n multipleInsertAssertions(CallInfo.create(message), dataSets);\n }"
] | [
"public StringAssert isString() {\n Node node = assertType(STRING);\n return new StringAssert((String) node.getValue()).as(\"Different value found in node \\\"%s\\\"\", path);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Convert to an array.
This will include any protected or private properties as well as public.
Normally this shouldn't be an issue as struct classes are usually
intended to have all members public. | [
"public function toArray()\n {\n $ret = [ ];\n foreach ($this as $key => $value) {\n $ret[ $key ] = $value;\n }\n return $ret;\n }"
] | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
When a log in fails, increment the failed count.
@param string $email The email the user tried to log in as.
@return bool | [
"public static function failedLogin($email)\n {\n $user = self::where('email', $email)->first();\n\n if (! is_null($user)) {\n $user->increment('failed_login_attempts');\n }\n\n $rules = config('jumpgate.users.blocking', null);\n\n if (is_null($rules)) {\n ... | [
"public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Generate the package index file named "overview-frame.html".
@throws DocletAbortException | [
"public static void generate(ConfigurationImpl configuration) {\n PackageIndexFrameWriter packgen;\n DocPath filename = DocPaths.OVERVIEW_FRAME;\n try {\n packgen = new PackageIndexFrameWriter(configuration, filename);\n packgen.buildPackageIndexFile(\"doclet.Window_Overvi... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Check Phar
Download the remote release information for the phar version of
the library and compare it against what we currently have.
@return string Info URI. | [
"public static function check_phar() {\n\t\t// Not checking or can't check, we're done!\n\t\tif (! \\BLOBCOMMON_PHAR_UPDATES ||\n\t\t\t(false === ($remote = static::get_release_info('Phar URI', static::PHAR_TEMPLATE)))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$current = \\get_option('blob-common_installed', false);\n\... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Starts an eyes timer. Call `req.stopTimer()` at the end of the request. | [
"function startTimer(req, res, next) {\n req.mainRoutePath = req.route.path;\n req.stopTimer = eyes.start('routes.' + req.mainRoutePath + '.' + req.method);\n next();\n}"
] | [
"function onComplete (err) {\n if (err) {\n console.log('interpolation encountered an error: ', err)\n return callback(err)\n }\n // set is complete and create a queue drain function\n // however, a feed may not have any interpolated times, so\n // `isComplete` is set in case nothing is pus... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Regla letras: analiza si un string contiene sólo letras y vocales con acento
-Si no es cargada no se controla
@param string $name
@param mixed $value
@return boolean | [
"protected function letters ($name, $value){\n //Si no se completo no se valida\n if(! $this->isComplete($value)){\n return TRUE;\n }\n \t$expresion = '/^[a-zA-Záéíóúñ\\s]*$/';\n \tif(! preg_match($expresion, $value)){\n $this->add_message($name, 'letters');\n ... | [
"public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{\n DFAgentDescription dfd = new DFAgentDescription();\n ServiceDescription sd = new ServiceDescription();\n \n sd.setType(serviceType);\n sd.setName(serviceName);\n \... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Verifies that the decoded diff is identical to the original diff.
@param task
DiffTask
@param decodedDiff
diff created from encoding the decoded diff information
@param originalDiff
original diff
@throws SQLConsumerException
if an error occurs | [
"private void verify(final Task<Diff> task, final Diff decodedDiff,\n\t\t\tfinal Diff originalDiff)\n\t\tthrows SQLConsumerException\n\t{\n\n\t\tString orig = originalDiff.toString();\n\t\tString deco = decodedDiff.toString();\n\n\t\tboolean notEqual = !orig.equals(deco);\n\n\t\tif (notEqual && MODE_SURROGATES == S... | [
"public ExportSection loadExportSection() throws IOException {\n Optional<ExportSection> edata = maybeLoadExportSection();\n return (ExportSection) getOrThrow(edata,\n \"unable to load export section\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// eventFromBuffer parser bytes into InputEvent struct | [
"func (k *KeyLogger) eventFromBuffer(buffer []byte) (*InputEvent, error) {\n\tevent := &InputEvent{}\n\terr := binary.Read(bytes.NewBuffer(buffer), binary.LittleEndian, event)\n\treturn event, err\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Sample usage for this python module
This main method simply illustrates sample usage for this python
module.
:return: None | [
"def main():\n \n mkdir_p('/tmp/test/test')\n source('/root/.bash_profile')\n yum_install(['httpd', 'git'])\n yum_install(['httpd', 'git'], dest_dir='/tmp/test/test', downloadonly=True)\n sed('/Users/yennaco/Downloads/homer_testing/network', '^HOSTNAME.*', 'HOSTNAME=foo.joe')\n test_script = '/... | [
"def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ... | codesearchnet | {
"query": "Represent the Github summarization about Software Engineering:",
"pos": "Represent the Github code about Software Engineering:",
"neg": "Represent the Github code:"
} |
// Delete removes the value for given key | [
"func (d *Datastore) Delete(key ds.Key) (err error) {\n\tfn := d.KeyFilename(key)\n\tif !isFile(fn) {\n\t\treturn ds.ErrNotFound\n\t}\n\n\treturn os.Remove(fn)\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 about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
eslint-disable-next-line consistent-return | [
"function getConfig(macro, filename, source) {\n if (macro.options.configName) {\n try {\n // lazy-loading it here to avoid perf issues of loading it up front.\n // No I did not measure. Yes I'm a bad person.\n // FWIW, this thing told me that cosmiconfig is 227.1 kb of minified JS\n // so t... | [
"function (app) {\n this.options = this.options || {}\n this.options.babel = this.options.babel || {}\n this.options.babel.optional = this.options.babel.optional || []\n\n if (this.options.babel.optional.indexOf('es7.decorators') === -1) {\n this.options.babel.optional.push('es7.decorators')\n }... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Registers an array of new CMS form fields.
@param $formFields | [
"public function registerMany($formFields)\n {\n foreach ($formFields as $fieldName => $fieldClass) {\n $this->register($fieldName, $fieldClass);\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Convert_v1_Role_To_rbac_Role is an autogenerated conversion function. | [
"func Convert_v1_Role_To_rbac_Role(in *v1.Role, out *rbac.Role, s conversion.Scope) error {\n\treturn autoConvert_v1_Role_To_rbac_Role(in, out, s)\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the PID file path. | [
"def get_pidfile_path(working_dir):\n \n pid_filename = virtualchain_hooks.get_virtual_chain_name() + \".pid\"\n return os.path.join( working_dir, pid_filename )"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Insert a signature into the outgoing request.
@throws Trustly_SignatureException if private key has not been loaded
yet or if we for some other reason fail to sign the request.
@param Trustly_Data_JSONRPCRequest $request Request to sign. | [
"public function signMerchantRequest($request) {\n\t\tif(!isset($this->merchant_privatekey)) {\n\t\t\tthrow new Trustly_SignatureException('No private key has been loaded for signing');\n\t\t}\n\n\t\t$method = $request->getMethod();\n\t\tif($method === NULL) {\n\t\t\t$method = '';\n\t\t}\n\t\t$uuid = $request->getU... | [
"public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about API documentation:"
} |
Check that value is of types for name and property Print messages and throw an error if the check fails | [
"function(name, property, value, types) {\n if (!(types instanceof Array)) {\n types = [types];\n }\n if (types.indexOf(typeof value) === -1) {\n debug('%s \\'%s\\' expected %j got: %j', name, property, types, value);\n throw new Error(name + ' \\'' + property + '\\' expected one of type(s): \\'' +\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Add a header file.
@param string $name Name of header file.
@param bool $enabled Flag to inidicate if the header should be included
as part of the code generation. | [
"public function AddHeader($name, $enabled=true)\n {\n if(!isset($this->headers[$name]))\n {\n $header = new Element\\Header($name, $enabled);\n\n $this->headers[$name] = $header;\n }\n }"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Language and programming:"
} |
Set the value of Type / type
@param $value string
@return Job | [
"public function setType(string $value) : Job\n {\n\n if ($this->data['type'] !== $value) {\n $this->data['type'] = $value;\n $this->setModified('type');\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Adds a {@link ResilienceStrategy} instance to be used with a cache matching the provided alias.
@param alias the cache alias
@param resilienceStrategy the resilience strategy instance
@return this configuration instance | [
"public DefaultResilienceStrategyProviderConfiguration addResilienceStrategyFor(String alias, ResilienceStrategy<?, ?> resilienceStrategy) {\n getDefaults().put(alias, new DefaultResilienceStrategyConfiguration(resilienceStrategy));\n return this;\n }"
] | [
"public static String getName(DistributedObject distributedObject) {\n /*\n * The motivation of this behaviour is that some distributed objects (`ICache`) can have prefixed name.\n * For example, for the point of view of cache,\n * it has pure name and full name which contains prefixe... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Return a .kibana index-pattern doc_type | [
"def field_cache_to_index_pattern(self, field_cache):\n \"\"\"\"\"\"\n mapping_dict = {}\n mapping_dict['customFormats'] = \"{}\"\n mapping_dict['title'] = self.index_pattern\n # now post the data into .kibana\n mapping_dict['fields'] = json.dumps(field_cache, separators=('... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sends a HTTP request.
@param string $method
@param Client $httpClient
@param array $path additional components for the path; e.g.: [$id, 'prices']
@return DorcasResponse
@throws \GuzzleHttp\Exception\GuzzleException | [
"public function send(string $method, Client $httpClient, array $path = []): DorcasResponse\n {\n $this->prefillHeader();\n $this->prefillBody();\n if (strtolower($method) !== 'get') {\n # we don't validate GEt requests\n $this->validate();\n }\n $uri = st... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Create the QTableView that will hold the data model. | [
"def create_data_table(self):\r\n \"\"\"\"\"\"\r\n self.dataTable = DataFrameView(self, self.dataModel,\r\n self.table_header.horizontalHeader(),\r\n self.hscroll, self.vscroll)\r\n self.dataTable.verticalHeader().hide(... | [
"def rowsInserted(self, parent, start, end):\n \n\n super(LogView, self).rowsInserted(parent, start, end)\n\n # IMPORTANT: This must be done *after* the superclass to get\n # an accurate value of the delegate's height.\n self.scrollToBottom()"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// CaptureMessage sends a message to the Sentry server. | [
"func (self *Client) CaptureMessage(message string, extra map[string]interface{}) (err error) {\n\ttimestamp := time.Now().UTC()\n\ttimestampStr := timestamp.Format(iso8601)\n\n\tpacket := sentryRequest{\n\t\tProject: self.Project,\n\t\tMessage: message,\n\t\tTimestamp: timestampStr,\n\t\tLevel: \"error\",\... | [
"@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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Store a newly created resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"public function store(Request $request)\n {\n $user_setting = new User_setting();\n\n \n $user_setting->user_id = $request->user_id;\n\n \n $user_setting->setting_id = $request->setting_id;\n\n \n $user_setting->notes = $request->notes;\n\n \n \n ... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// isHex reports whether c is a hexadecimal character. | [
"func isHex(c byte) bool {\n\tswitch {\n\tcase '0' <= c && c <= '9':\n\t\treturn true\n\tcase 'a' <= c && c <= 'f':\n\t\treturn true\n\tcase 'A' <= c && c <= 'F':\n\t\treturn true\n\t}\n\treturn false\n}"
] | [
"def _replacer(x):\n \n # get the hex repr of the binary char and remove 0x and pad by pad_size\n # zeros\n try:\n hexin = ord(x)\n except TypeError:\n # bytes literals masquerade as ints when iterating in py3\n hexin = x\n\n return hex(hexin)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set body with stream acceptance
@param resource|string $body Request body
@throws InvalidArgumentException | [
"public function setBody($body)\n {\n if (is_string($body)) {\n return $this->setStringBody($body);\n }\n\n if (!is_resource($body)) {\n throw new InvalidArgumentException('Body must be a stream !');\n }\n if (!stream_is_local($body)) {\n throw ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Programming:"
} |
Push a new job onto the queue after a delay.
@param \DateTimeInterface|\DateInterval|int $delay
@param string $job
@param mixed $data
@param string $queue
@return mixed | [
"public function later($delay, $job, $data = '', $queue = null)\n {\n return $this->sqs->sendMessage([\n 'QueueUrl' => $this->getQueue($queue),\n 'MessageBody' => $this->createPayload($job, $queue ?: $this->default, $data),\n 'DelaySeconds' => $this->secondsUntil($delay),\... | [
"public function exists(string $statement, ...$params): bool\n {\n /**\n * @var string|int|float|bool|null $result\n */\n $result = $this->single($statement, $params);\n return !empty($result);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Loads a YAML file, parses it and returns a hash with symbolized keys. | [
"def load(file)\n if File.exist? file\n symbolize_keys(YAML.load_file(File.expand_path('.', file)))\n else\n {}\n end\n end"
] | [
"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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Helper context manager for :meth:`buffer` which saves the whole state.
This is broken out in a separate method for readability and tested
indirectly by testing :meth:`buffer`. | [
"def _save_state(self):\n \n ns_prefixes_floating_in = copy.copy(self._ns_prefixes_floating_in)\n ns_prefixes_floating_out = copy.copy(self._ns_prefixes_floating_out)\n ns_decls_floating_in = copy.copy(self._ns_decls_floating_in)\n curr_ns_map = copy.copy(self._curr_ns_map)\n ... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get a value from the (upper triangular) distance matrix.
Note: in many cases, linear iteration over the matrix will be fastet than
repeated calls to this method!
@param x First object
@param y Second object
@return Distance | [
"public double get(int x, int y) {\n return (x == y) ? 0 : (x < y) //\n ? matrix[MatrixParadigm.triangleSize(y) + x] //\n : matrix[MatrixParadigm.triangleSize(x) + y];\n }"
] | [
"def rsdl_s(self, Yprev, Y):\n \"\"\"\"\"\"\n\n # Since s = rho A^T B (y^(k+1) - y^(k)) and B = -(I I I ...)^T,\n # the correct calculation here would involve replicating (Yprev - Y)\n # on the axis on which the blocks of X are stacked. Since this would\n # require allocating addi... | codesearchnet | {
"query": "Represent the Github summarization about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Checks if given function raises an error
@method raises | [
"function raises(fn, errorValidator) {\n check.verify.fn(fn, 'expected function that raises');\n try {\n fn();\n } catch (err) {\n if (typeof errorValidator === 'undefined') {\n return true;\n }\n if (typeof errorValidator === 'function') {\n return errorValidator(err);\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Creates the DCA configuration | [
"public function create()\n\t{\n\t\t// Element fields, so don´t use parent construct method\n\t\t$GLOBALS['TL_DCA']['tl_content']['palettes'][$this->element] .= ',protected';\n\t\t$GLOBALS['TL_DCA']['tl_content']['fields']['protected']['eval']['tl_class'] = 'clr'; // push to new row (clear)\n\n\t\t// The groups fie... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Validate the Job's JobId by checking name, version, and hash are
not null or empty, don't contain invalid characters.
@param job The Job to check.
@return A set of error Strings | [
"private Set<String> validateJobId(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n final JobId jobId = job.getId();\n\n if (jobId == null) {\n errors.add(\"Job id was not specified.\");\n return errors;\n }\n\n final String jobIdVersion = jobId.getVersion();\n final St... | [
"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 Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Checks that the edge set input contains valid vertex Ids, i.e. that they
also exist in the vertex input set.
@return a boolean stating whether a graph is valid
with respect to its vertex ids. | [
"@Override\n\tpublic boolean validate(Graph<K, VV, EV> graph) throws Exception {\n\t\tDataSet<Tuple1<K>> edgeIds = graph.getEdges()\n\t\t\t\t.flatMap(new MapEdgeIds<>()).distinct();\n\t\tDataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)\n\t\t\t\t.equalTo(0).with(new GroupInvalidIds<>()).first(1)... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Where for different attributes.
@param string $propertyName
@param $find
@param Closure $finderClosure
@return static | [
"private function arrayFinder(string $propertyName, $find, Closure $finderClosure)\n {\n return $this->filter(function ($data) use ($find, $propertyName, $finderClosure) {\n try {\n $attributeValue = $data->{$propertyName};\n } catch (\\Exception $e) {\n ... | [
"public function getAll() : array\n {\n $fieldOptions = call_user_func($this->fieldOptionsLoader);\n TypeMismatchException::verifyAllInstanceOf(__METHOD__, '<return>', $fieldOptions, IFieldOption::class);\n return $fieldOptions;\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Creates a core SPI connection factory that will use the given connection
manager to create connections.
@param connectionManager
the connection manager | [
"public Object createConnectionFactory(\n final ConnectionManager connectionManager) {\n\n if (TRACE.isEntryEnabled()) {\n SibTr.entry(this, TRACE, \"createConnectionFactory\",\n connectionManager);\n }\n\n final Object connectionFactory = new SibRaConne... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Using the lowercase name of the class as node_type, returns `obj.visit_{node_type}`,
or `obj.visit_default` if the type-specific method is not found. | [
"def get(self, obj, cls):\n \n method = self._cache.get(cls)\n if not method:\n name = \"visit_\" + cls.__name__.lower()\n method = getattr(obj, name, obj.visit_default)\n self._cache[cls] = method\n return method"
] | [
"function(inst) {\n // `can.__reading` makes a note that `id` was just read.\n can.__reading(inst, inst.constructor.id);\n // Use `__get` instead of `attr` for performance. (But that means we have to remember to call `can.__reading`.)\n return inst.__get(i... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
销毁对应的pipeline节点,同步调用 | [
"public void destory(Long channelId, Long pipelineId) {\n String path = ManagePathUtils.getPipeline(channelId, pipelineId);\n String processRootPath = ManagePathUtils.getProcessRoot(channelId, pipelineId);\n String terminRootPath = ManagePathUtils.getTerminRoot(channelId, pipelineId);\n ... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get a list of status Resources from the server.
:rtype: List[Status] | [
"def statuses(self):\n \n r_json = self._get_json('status')\n statuses = [Status(self._options, self._session, raw_stat_json)\n for raw_stat_json in r_json]\n return statuses"
] | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the Github sentence about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
Calls the editor change handlers.<p>
@param changedScopes the changed content value scopes | [
"void callEditorChangeHandlers(final Set<String> changedScopes) {\r\n\r\n m_changedScopes.addAll(changedScopes);\r\n if (!m_callingChangeHandlers && (m_changedScopes.size() > 0)) {\r\n m_callingChangeHandlers = true;\r\n final Set<String> scopesToSend = new HashSet<String>(m_chan... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Fetch data from an sql query
Returns always an array of results
@param string $query
@param array $params
@return array | [
"public static function fetch( $query, $params = array(), $handler = null, $arguments = array( 'obj' ) ) \n\t{\n\t\treturn Handler::create( $handler )->fetch( $query, $params, $arguments );\n\t}"
] | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parse editor themes from dir | [
"protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
判断是否需要排除自定义过滤器
@param customFilters 自定义filter列表
@return 需要排除的过滤器的key列表 | [
"private static HashSet<String> parseExcludeFilter(List<Filter> customFilters) {\n HashSet<String> excludeKeys = new HashSet<String>();\n if (CommonUtils.isNotEmpty(customFilters)) {\n for (Filter filter : customFilters) {\n if (filter instanceof ExcludeFilter) {\n ... | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
<p>
The files to stream.
</p>
@param files
The files to stream. | [
"public void setFiles(java.util.Collection<StreamFile> files) {\n if (files == null) {\n this.files = null;\n return;\n }\n\n this.files = new java.util.ArrayList<StreamFile>(files);\n }"
] | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the post about document management:",
"pos": "Represent the code about document management:",
"neg": "Represent the code about Programming:"
} |
Ensure that the `definition_type` property of `marking-definition`
objects is one of the values in the STIX 2.0 specification. | [
"def vocab_marking_definition(instance):\n \n if (instance['type'] == 'marking-definition' and\n 'definition_type' in instance and not\n instance['definition_type'] in enums.MARKING_DEFINITION_TYPES):\n\n return JSONError(\"Marking definition `definition_type` should be one \"\n ... | [
"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:"
} |
triangle_unaddress(FX, tr) yields the point P, inside the reference triangle given by the
(3 x d)-sized coordinate matrix FX, that is addressed by the address coordinate tr, which may
either be a 2-d vector or a (2 x n)-sized matrix. | [
"def triangle_unaddress(fx, tr):\n '''\n \n '''\n fx = np.asarray(fx)\n tr = np.asarray(tr)\n # the triangle vectors...\n ab = fx[1] - fx[0]\n ac = fx[2] - fx[0]\n bc = fx[2] - fx[1]\n return np.asarray([ax + tr[1]*(abx + tr[0]*bcx) for (ax, bcx, abx) in zip(fx[0], bc, ab)])"
] | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<p>Return the value of the <code>cellpadding</code> property.</p>
<p>Contents: Definition of how much space the user agent should
leave between the border of each cell and its contents. | [
"public java.lang.String getCellpadding() {\n return (java.lang.String) getStateHelper().eval(PropertyKeys.cellpadding);\n\n }"
] | [
"function assignGroupMarginsAndHeaders(offset) {\n if (options.last) {\n // When looking for the *last* group, the *trailing* header and margin belong to the group.\n return offset - that._getHeaderSizeGroupAdjustment() - that._sizes.items... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generate the templates for adding, editing, viewing.
:return: None | [
"def generate_html_files(*args):\n '''\n \n '''\n _ = args\n\n for tag_key, tag_list in SWITCH_DICS.items():\n if tag_key.startswith('dic_'):\n __write_view_tmpl(tag_list)\n\n __write_filter_tmpl(TPL_LIST)\n __write_list_tmpl(TPL_LISTINFO)"
] | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// LookupString performs a lookup into a value, using a string. Same as `Loookup`
// but using a string with the keys separated by `.` | [
"func LookupString(i interface{}, path string) (reflect.Value, error) {\n\treturn Lookup(i, strings.Split(path, SplitToken)...)\n}"
] | [
"def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// deliver injects a new batch of data received from a remote node. | [
"func (d *Downloader) deliver(id string, destCh chan dataPack, packet dataPack, inMeter, dropMeter metrics.Meter) (err error) {\n\t// Update the delivery metrics for both good and failed deliveries\n\tinMeter.Mark(int64(packet.Items()))\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tdropMeter.Mark(int64(packet.Items... | [
"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 description about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code about programming:"
} |
// ClosePorts removes the specified port range from the list of ports
// maintained by this document. | [
"func (p *Ports) ClosePorts(portRange PortRange) (err error) {\n\tdefer errors.DeferredAnnotatef(&err, \"cannot close ports %s\", portRange)\n\n\tif err = portRange.Validate(); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tvar newPorts []PortRange\n\tports := Ports{st: p.st, doc: p.doc, areNew: p.areNew}\n\n\t... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Print a formatted summary of the current solve state. | [
"def dump(self):\n \"\"\"\"\"\"\n from rez.utils.formatting import columnise\n\n rows = []\n for i, phase in enumerate(self.phase_stack):\n rows.append((self._depth_label(i), phase.status, str(phase)))\n\n print \"status: %s (%s)\" % (self.status.name, self.status.descr... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Config validation rules go here. | [
"func init() {\n\t// Milo is only responsible for validating the config matching the instance's\n\t// appID in a project config.\n\tvalidation.Rules.Add(\"regex:projects/.*\", \"${appid}.cfg\", validateProjectCfg)\n\tvalidation.Rules.Add(\"services/${appid}\", globalConfigFilename, validateServiceCfg)\n}"
] | [
"void appendGoogRequiresTo(StringBuilder sb) {\n for (GoogRequire require : googRequires.values()) {\n // TODO(lukes): we need some namespace management here... though really we need namespace\n // management with all declarations... The problem is that a require could introduce a name\n // alias ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Find and add an asset to the directory.
@param string $name
@param \Closure $callback
@return \Basset\Asset | [
"public function add($name, Closure $callback = null)\n {\n try\n {\n $path = $this->finder->find($name);\n\n if (isset($this->assets[$path]))\n {\n $asset = $this->assets[$path];\n }\n else\n {\n $asset... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
return an array of String URLs for all known locations of the file
in the DB.
@param name
@return String[] of URLs to arcName
@throws IOException | [
"public String[] nameToUrls(final String name) throws IOException {\n\n\t\tNameValuePair[] args = {\n\t\t\t\tnew NameValuePair(\n\t\t\t\t\t\tResourceFileLocationDBServlet.OPERATION_ARGUMENT,\n\t\t\t\t\t\tResourceFileLocationDBServlet.LOOKUP_OPERATION),\n\t\t\t\t\t\n\t\t\t\tnew NameValuePair(\n\t\t\t\t\t\tResourceFi... | [
"def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"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.