query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Handle "end of data" situations
@param context the encoder context
@param buffer the buffer with the remaining encoded characters | [
"void handleEOD(EncoderContext context, StringBuilder buffer) {\n int unwritten = (buffer.length() / 3) * 2;\n int rest = buffer.length() % 3;\n\n int curCodewordCount = context.getCodewordCount() + unwritten;\n context.updateSymbolInfo(curCodewordCount);\n int available = context.getSymbolInfo().get... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Called when a key is pressed. | [
"@Override\n public void keyPressed(KeyEvent e) {\n switch (e.getKeyCode()) {\n case KeyEvent.VK_BACK_SPACE:\n case KeyEvent.VK_ENTER:\n case KeyEvent.VK_DELETE:\n case KeyEvent.VK_TAB:\n e.consume();\n break;\n }\n }"
] | [
"def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// String colorized service status message. | [
"func (u configGetMessage) String() string {\n\tconfig, e := json.MarshalIndent(u.Config, \"\", \" \")\n\tfatalIf(probe.NewError(e), \"Unable to marshal into JSON.\")\n\n\treturn string(config)\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
gets rtf image height
@return integer | [
"private function getImageRtfHeight()\n {\n if ($this->_height > 0) {\n return PHPRtfLite_Unit::getUnitInTwips($this->_height);\n }\n\n $imageHeight = $this->_imageHeight ? $this->_imageHeight : 100;\n if ($this->_width > 0) {\n $imageWidth = $this->_imageWidth ?... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a new file client.
@class The file client provides a convenience API for interacting with file services
provided by plugins. This class handles authorization, and authentication-related
error handling.
@name orion.fileClient.FileClient | [
"function FileClient(serviceRegistry, filter) {\n\t\tvar _patterns;\n\t\tvar _services;\n\t\tvar _names;\n\n\t\tEventTarget.attach(this);\n\t\t/* @callback */\n\t\tfunction _noMatch(loc) {\n\t\t\tvar d = new Deferred();\n\t\t\td.reject(messages[\"No Matching FileService for location:\"] + loc);\n\t\t\treturn d;\n\t... | [
"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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// forceAdd is used to force a lookup of the given deployment object and create
// a watcher. If the deployment does not exist or is terminal an error is
// returned. | [
"func (w *Watcher) forceAdd(dID string) (*deploymentWatcher, error) {\n\tsnap, err := w.state.Snapshot()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdeployment, err := snap.DeploymentByID(nil, dID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif deployment == nil {\n\t\treturn nil, fmt.Errorf(\"unknown d... | [
"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 text about container management:",
"pos": "Represent the code about container management:",
"neg": "Represent the code about Software development:"
} |
// send sends a changed total capacity event to the subscribers | [
"func (s tcSubs) send(tc uint64, underrun bool) {\n\tfor sub := range s {\n\t\tselect {\n\t\tcase <-sub.rpcSub.Err():\n\t\t\tdelete(s, sub)\n\t\tcase <-sub.notifier.Closed():\n\t\t\tdelete(s, sub)\n\t\tdefault:\n\t\t\tif underrun || !sub.onlyUnderrun {\n\t\t\t\tsub.notifier.Notify(sub.rpcSub.ID, tc)\n\t\t\t}\n\t\t}... | [
"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 description about Messaging:",
"pos": "Represent the code about Messaging:",
"neg": "Represent the code about Software development:"
} |
Test limits and take actions if they have been exceeded
@param MvcEvent $event | [
"public function check(MvcEvent $event)\n {\n foreach ($this->limits as $limit) {\n if ($this->storage->check($this->remoteAddress->getIpAddress(), $limit)) {\n foreach ($limit->getActions() as $action) {\n $action($event);\n }\n }\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// SetId sets the Id field's value. | [
"func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput {\n\ts.Id = &v\n\treturn s\n}"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Update moves the camera to the center of the space component.
// Values are automatically clamped to TrackingBounds by the camera. | [
"func (c *EntityScroller) Update(dt float32) {\n\tif c.SpaceComponent == nil {\n\t\treturn\n\t}\n\n\twidth, height := c.SpaceComponent.Width, c.SpaceComponent.Height\n\n\tpos := c.SpaceComponent.Position\n\ttrackToX := pos.X + width/2\n\ttrackToY := pos.Y + height/2\n\n\tengo.Mailbox.Dispatch(CameraMessage{Axis: XA... | [
"public void changeComplete (float complete)\n {\n // Store the new state\n _complete = complete;\n\n // Determine the percentage difference between the \"actual\"\n // completion state and the completion amount to render during\n // the smooth interpolation\n _renderOff... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Packages and submits a job, which is defined in a YAML file, to Spark.
Parameters
----------
args (List): Command-line arguments | [
"def _package_and_submit(args):\n \n args = _parse_and_validate_args(args)\n\n logging.debug(args)\n dist = __make_tmp_dir()\n try:\n __package_dependencies(dist_dir=dist, additional_reqs=args['requirements'],\n silent=args['silent'])\n __package_app(tasks_... | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Update constant variables.
:return: None
:rtype: :py:obj:`None` | [
"def update_constants(nmrstar2cfg=\"\", nmrstar3cfg=\"\", resonance_classes_cfg=\"\", spectrum_descriptions_cfg=\"\"):\n \n nmrstar_constants = {}\n resonance_classes = {}\n spectrum_descriptions = {}\n\n this_directory = os.path.dirname(__file__)\n\n nmrstar2_config_filepath = os.path.join(this_d... | [
"def _new_from_cdata(cls, cdata: Any) -> \"Random\":\n \"\"\"\"\"\"\n self = object.__new__(cls) # type: \"Random\"\n self.random_c = cdata\n return self"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Engineering:",
"pos": "Represent the Github code about Software Engineering:",
"neg": "Represent the Github code about Programming:"
} |
// Dial dials the handshake service in the hypervisor. If a connection has
// already been established, this function returns it. Otherwise, a new
// connection is created. | [
"func Dial(hsAddress string) (*grpc.ClientConn, error) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\n\tif hsConn == nil {\n\t\t// Create a new connection to the handshaker service. Note that\n\t\t// this connection stays open until the application is closed.\n\t\tvar err error\n\t\thsConn, err = hsDialer(hsAddress, grpc.W... | [
"def connectTo(self, remoteRouteName):\n \n self.remoteRouteName = remoteRouteName\n # This route must not be started before its router is started. If\n # sender is None, then the router is not started. When the router is\n # started, it will start this route.\n if self.r... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/plaid/authenticate | [
"def authenticate\n begin\n client = Plaid::Client.new(env: PlaidRails.env,\n client_id: PlaidRails.client_id,\n secret: PlaidRails.secret,\n public_key: PlaidRails.public_key)\n @exchange_token = client.item.public_token.exchange(link_params[:public_token])\n @p... | [
"def _init_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.gosubdag.prt_attr[key]\n return prtfmt.replace(\"{NS}\", \"{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs\")"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param array[string]mixed $arguments extra arguments to be passed to the api call
@param string $format override format (defaults to one specified in config file)
@return mixed | [
"public function getProvider($arguments = [], $format = null)\n {\n $options = $this->getOptions($format)->setArguments($arguments);\n\n return $this->request->send($options);\n }"
] | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Set the value of [version] column.
@param int $v new value
@return $this|\gossi\trixionary\model\Skill The current object (for fluent API support) | [
"public function setVersion($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->version !== $v) {\n $this->version = $v;\n $this->modifiedColumns[SkillTableMap::COL_VERSION] = true;\n }\n\n return $this;\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetStreamId sets the StreamId field's value. | [
"func (s *SetSourceRequest) SetStreamId(v string) *SetSourceRequest {\n\ts.StreamId = &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 Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Receive Payment and Return Payment Model.
@return PayuPayment | [
"public function capture()\n {\n $storage = new Storage();\n $config = new Config($storage->getAccount());\n\n if ($config->getDriver() == 'database') {\n return PayuPayment::find($storage->getPayment());\n }\n\n return new PayuPayment($storage->getPayment());\n }... | [
"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 Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Whether all conditions are met
@param array $trigger
@param array $data
@return boolean | [
"public function isMet(array $trigger, array $data)\n {\n $result = null;\n $this->hook->attach('condition.met.before', $trigger, $data, $result, $this);\n\n if (isset($result)) {\n return (bool) $result;\n }\n\n if (empty($trigger['data']['conditions'])) {\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Solves the formula on the solver and returns the result.
@param handler a MaxSAT handler
@return the result (SAT, UNSAT, Optimum found, or UNDEF if canceled by the handler) | [
"public MaxSAT.MaxSATResult solve(final MaxSATHandler handler) {\n if (this.result != UNDEF)\n return this.result;\n if (this.solver.currentWeight() == 1)\n this.solver.setProblemType(MaxSAT.ProblemType.UNWEIGHTED);\n else\n this.solver.setProblemType(MaxSAT.ProblemType.WEIGHTED);\n this.... | [
"public static Boolean lte(Object left, Object right) {\n return or(lt(left, right),\n eq(left, right)); // do not use Java || to avoid potential NPE due to FEEL 3vl.\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
@function execute
execute query
@returns {Promise} | [
"function execute () {\n // check access and set access params\n this.accessControl()\n // build select\n this.select = sql.select(this.model, this.args)\n // debug\n debug(this.select.sql, this.select.params)\n // do query\n defined(this.model.cache)\n && this.args.cache !== false\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 Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns all the days for the given month.
@param Month $month
@return DayInterface[] | [
"public function getDays(Month $month)\n {\n $days = array();\n\n for ($dayNo = 1; $dayNo <= $month->numberOfDays(); $dayNo++) {\n $days[$dayNo] = $this->getDay($month, $dayNo);\n }\n\n return $days;\n }"
] | [
"@Operation(name=\"$find-matches\", idempotent=true)\n public Parameters findMatchesAdvanced(\n @OperationParam(name=\"dateRange\") DateRangeParam theDate,\n @OperationParam(name=\"name\") List<StringParam> theName,\n @OperationParam(name=\"code\") TokenAndListParam theEnd) {\n \n Paramet... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Fire an event off up to the master server
CLI Example:
.. code-block:: bash
salt '*' event.fire_master '{"data":"my event data"}' 'tag' | [
"def fire_master(data, tag, preload=None, timeout=60):\n '''\n \n '''\n if (__opts__.get('local', None) or __opts__.get('file_client', None) == 'local') and not __opts__.get('use_master_when_local', False):\n # We can't send an event if we're in masterless mode\n log.warning('Local mode d... | [
"def main():\n ''' '''\n conn = symphony.Config('example-bot.cfg')\n # connect to pod\n agent, pod, symphony_sid = conn.connect()\n agent.test_echo('test')\n # main loop\n msgFormat = 'MESSAGEML'\n message = '<messageML> hello world. </messageML>'\n # send message\n agent.send_message... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetState will force a specific state in-memory for this local state. | [
"func (s *LocalState) SetState(state *terraform.State) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\ts.state = state.DeepCopy()\n\ts.readState = state.DeepCopy()\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
The inverse operator. | [
"def inverse(self):\n \"\"\"\"\"\"\n op = self\n\n class ShearlabOperatorInverse(odl.Operator):\n\n \"\"\"Inverse of the shearlet transform.\n\n See Also\n --------\n odl.contrib.shearlab.ShearlabOperator\n \"\"\"\n\n def __init_... | [
"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:"
} |
Set the value for a pair of terms.
Args:
term1 (str)
term2 (str)
value (mixed) | [
"def set_pair(self, term1, term2, value, **kwargs):\n\n \n\n key = self.key(term1, term2)\n self.keys.update([term1, term2])\n self.pairs[key] = value"
] | [
"def set_gamma_value(self, value):\n '''\n \n '''\n if isinstance(value, float) is False:\n raise TypeError(\"The type of __gamma_value must be float.\")\n self.__gamma_value = value"
] | codesearchnet | {
"query": "Represent the summarization about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code about programming:"
} |
Add a label to specified cell in table. | [
"def add_label_to_table(self, row, col, txt):\n \"\"\"\"\"\"\n label = QLabel(txt)\n label.setMargin(5)\n label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)\n self.table.setCellWidget(row, col, label)"
] | [
"def note(id, type, options = {})\n # Welguisz: No idea why this is here, but keeping it here because it follows other blocks\n _notes\n # Create a new note and place it in the notes 2-D Hash\n @_notes[id][type] = Note.new(id, type, options)\n end"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetTaskToken sets the TaskToken field's value. | [
"func (s *RespondActivityTaskCanceledInput) SetTaskToken(v string) *RespondActivityTaskCanceledInput {\n\ts.TaskToken = &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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
@param integer $page
@return \PagerFanta\PagerFanta | [
"public function getDisplayableWorkspacesPager($page, $max = 20)\n {\n $workspaces = $this->workspaceRepo->findDisplayableWorkspaces();\n\n return $this->pagerFactory->createPagerFromArray($workspaces, $page, $max);\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Annex M placement alogorithm low level | [
"function placeBit(&$array, $NR, $NC, $r, $c, $p, $b) {\n if ($r < 0) {\n $r += $NR;\n $c += 4 - (($NR + 4) % 8);\n }\n if ($c < 0) {\n $c += $NC;\n $r += 4 - (($NC + 4) % 8);\n }\n\n $array[$r * $NC + $c] = ($p << 3) + $b;\n }"
] | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Send a request to the DNS server | [
"def send_request\n nameserver = @nameservers.shift\n @nameservers << nameserver # rotate them\n begin\n @socket.send request_message, 0, @nameservers.first, DNS_PORT\n rescue Errno::EHOSTUNREACH # TODO figure out why it has to be wrapper here, when the other wrapper should be wrapping th... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Add appends a migration the list. | [
"func (m *Migrations) Add(id int, stmts ...string) {\n\t*m = append(*m, Migration{ID: id, Stmts: stmts})\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
This function sets up a command-line option parser and then calls match_and_print
to do all of the real work. | [
"def main(argv):\n \n import argparse\n import codecs\n # have to be ready to deal with utf-8 names\n out = codecs.getwriter('utf-8')(sys.stdout)\n\n description = 'Uses Open Tree of Life web services to find information for each OTT ID.'\n parser = argparse.ArgumentParser(prog='ot-taxon-info',... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Finds and all persona for admin.
@Route("admin/list/category")
@Method("GET")
@Template() | [
"public function listAction() {\n $entities = $this->container->get(\"haven_core.category.read_handler\")->getAll();\n\n foreach ($entities as $entity) {\n $delete_forms[$entity->getId()] = $this->container->get(\"haven_core.category.form_handler\")->createDeleteForm($entity->getId())->crea... | [
"func (app App) ConfigureApplication(application *application.Application) {\n\tcontroller := &Controller{View: render.New(&render.Config{AssetFileSystem: application.AssetFS.NameSpace(\"products\")}, \"app/products/views\")}\n\n\tfuncmapmaker.AddFuncMapMaker(controller.View)\n\tapp.ConfigureAdmin(application.Admin... | codesearchnet | {
"query": "Represent the Github text about Sales Channel API:",
"pos": "Represent the Github code about Sales Channel API:",
"neg": "Represent the Github code about Software development:"
} |
Fills the analysis' uncertainty to the item passed in.
:param analysis_brain: Brain that represents an analysis
:param item: analysis' dictionary counterpart that represents a row | [
"def _folder_item_uncertainty(self, analysis_brain, item):\n \n\n item[\"Uncertainty\"] = \"\"\n\n if not self.has_permission(ViewResults, analysis_brain):\n return\n\n result = analysis_brain.getResult\n\n obj = self.get_object(analysis_brain)\n formatted = form... | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
在使用本方法前,必须初始化AopClient且传入公私钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"public function rsaEncrypt($data, $rsaPublicKeyPem, $charset) {\n\t\tif($this->checkEmpty($this->alipayPublicKey)){\n\t\t\t//读取字符串\n\t\t\t$pubKey= $this->alipayrsaPublicKey;\n\t\t\t$res = \"-----BEGIN PUBLIC KEY-----\\n\" .\n\t\t\t\twordwrap($pubKey, 64, \"\\n\", true) .\n\t\t\t\t\"\\n-----END PUBLIC KEY-----\";\n... | [
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Returns a dictionary mapping a public identifier name to a
Python object. This counts the `__init__` method as being
public. | [
"def __public_objs(self):\n \n _budoc = getattr(self.module.module, '__budoc__', {})\n\n def forced_out(name):\n return _budoc.get('%s.%s' % (self.name, name), False) is None\n\n def exported(name):\n exported = name == '__init__' or _is_exported(name)\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
whether the string is an serialized object or not
@param string $string
@return bool | [
"public static function isSerialized(string $string): bool {\n $data = @unserialize($string);\n if (false === $data) {\n return false;\n } else {\n return true;\n }\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Request the browser to enter fullscreen mode.
@returns {boolean} Indicating if the request was successful. | [
"function PDFPresentationMode_request() {\n if (this.switchInProgress || this.active ||\n !this.viewer.hasChildNodes()) {\n return false;\n }\n this._addFullscreenChangeListeners();\n this._setSwitchInProgress();\n this._notifyStateChange();\n\n if (this.container.reque... | [
"function(terria) {\n CatalogMember.call(this, terria);\n\n this._enabledDate = undefined;\n this._shownDate = undefined;\n this._loadForEnablePromise = undefined;\n this._lastLoadInfluencingValues = undefined;\n\n // The catalog item to show in the Now Viewing when this item is enabled, instead of this item.... | codesearchnet | {
"query": "Represent the Github sentence about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Software development:"
} |
// SetEnabled sets the Enabled field's value. | [
"func (s *ConnectionDraining) SetEnabled(v bool) *ConnectionDraining {\n\ts.Enabled = &v\n\treturn s\n}"
] | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Sets the current item to be the item at currentIndex.
Also select the row as to give consistent user feedback.
See also the notes at the top of this module on current item vs selected item(s). | [
"def setCurrentIndex(self, currentIndex):\n \n selectionModel = self.selectionModel()\n selectionFlags = (QtCore.QItemSelectionModel.ClearAndSelect |\n QtCore.QItemSelectionModel.Rows)\n selectionModel.setCurrentIndex(currentIndex, selectionFlags)"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Deletes the file associated with the owner.
@throws CException if the file cannot be deleted or if the file id cannot be removed from the owner model. | [
"public function deleteFile()\n {\n if (!$this->getManager()->deleteModel($this->owner->{$this->idAttribute})) {\n throw new CException('Failed to delete file.');\n }\n $this->owner->{$this->idAttribute} = null;\n if (!$this->owner->save(false)) {\n throw new CEx... | [
"static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Gets the adGroupEstimates value for this CampaignEstimate.
@return adGroupEstimates * The estimates for the ad groups belonging to this campaign
in the request.
They will be returned in the same order that they
were sent in the request. | [
"public com.google.api.ads.adwords.axis.v201809.o.AdGroupEstimate[] getAdGroupEstimates() {\n return adGroupEstimates;\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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// ApplySchema is part of the tmclient.TabletManagerClient interface. | [
"func (client *FakeTabletManagerClient) ApplySchema(ctx context.Context, tablet *topodatapb.Tablet, change *tmutils.SchemaChange) (*tabletmanagerdatapb.SchemaChangeResult, error) {\n\treturn &tabletmanagerdatapb.SchemaChangeResult{}, nil\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:"
} |
Create a copy of TokenMetadata with tokenToEndpointMap reflecting situation after all
current leave, and move operations have finished.
@return new token metadata | [
"public TokenMetadata cloneAfterAllSettled()\n {\n lock.readLock().lock();\n\n try\n {\n TokenMetadata metadata = cloneOnlyTokenMap();\n\n for (InetAddress endpoint : leavingEndpoints)\n metadata.removeEndpoint(endpoint);\n\n\n for (Pair<Token,... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Force item to be output as a binary literal. | [
"public function forceBinary()\n {\n $this->_filter = $this->_filterParams();\n $this->_filter->binary = true;\n $this->_filter->literal = true;\n $this->_filter->quoted = false;\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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// LegendThin is a legend that doesn't obscure the chart area. | [
"func LegendThin(c *Chart, userDefaults ...Style) Renderable {\n\treturn func(r Renderer, cb Box, chartDefaults Style) {\n\t\tlegendDefaults := Style{\n\t\t\tFillColor: drawing.ColorWhite,\n\t\t\tFontColor: DefaultTextColor,\n\t\t\tFontSize: 8.0,\n\t\t\tStrokeColor: DefaultAxisColor,\n\t\t\tStrokeWidth: Defa... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Transform block to string
@param string|null $message Any message to pass to the page
@param mixed $results If string will redirect otherwise pass this to page
@return string | [
"protected function success($message = null, $results = null)\n {\n if($message) {\n $_SESSION['flash']['message'] = $message;\n $_SESSION['flash']['type'] = 'success';\n }\n\n $this->trigger('html-success', $this, $message, $results);\n $this->trigger('response-... | [
"public function getTemplateFile($filename, $data)\n {\n $data['getRegion'] = function($name) { \n return $this->getRegion($name); \n }; // This is for mustache compatibility\n\n // Push the data into regions and then pass a pointer to this class to the layout\n // $thi... | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
Stupidly simple function to fix any Items/Quantity disparities inside a
DistributionConfig block before use. Since AWS only accepts JSON-encodable
data types, this implementation is "good enough" for our purposes. | [
"def _fix_quantities(tree):\n '''\n \n '''\n if isinstance(tree, dict):\n tree = {k: _fix_quantities(v) for k, v in tree.items()}\n if isinstance(tree.get('Items'), list):\n tree['Quantity'] = len(tree['Items'])\n if not tree['Items']:\n tree.pop('Items... | [
"def _validate_compute_chunk_params(self,\n graph,\n dates,\n sids,\n initial_workspace):\n \n root = self._root_mask_term\n clsname = type(sel... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetSetup sets the Setup field's value. | [
"func (s *Recipes) SetSetup(v []*string) *Recipes {\n\ts.Setup = v\n\treturn s\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Updates all Locations of content identified with $contentId with $versionNo.
@param mixed $contentId
@param mixed $versionNo | [
"public function updateLocationsContentVersionNo($contentId, $versionNo)\n {\n $query = $this->handler->createUpdateQuery();\n $query->update(\n $this->handler->quoteTable('ezcontentobject_tree')\n )->set(\n $this->handler->quoteColumn('contentobject_version'),\n ... | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Connects to the configured PDO database and adds/updates table schema if required
@return Result
@api | [
"public function setup(): Result\n {\n $result = new Result();\n try {\n $this->connect();\n $connection = DriverManager::getConnection(['pdo' => $this->databaseHandle]);\n } catch (Exception | FilesException |DBALException $exception) {\n $result->addError(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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Decrypt a serialized value
@param string $value
@param string $key
@param boolean $base64 Whether to base64 decode the value before decrypting
@return mixed | [
"public function decrypt(string $value, string $key, bool $base64 = false)\n {\n if ($base64) {\n $value = base64_decode($value);\n }\n $ret = $this->decryptBinary($value, $key);\n return unserialize($ret);\n }"
] | [
"public function getData()\n {\n // The application has the option of passing the query parameter\n // in, perhaps using its own middleware, or allowing Omnipay to\n // provide it.\n\n $crypt = $this->getCrypt() ?: $this->httpRequest->query->get('crypt');\n\n // Make sure we ha... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Encryption:"
} |
Load xml from file. | [
"def load(self):\n \"\"\"\"\"\"\n lg.info('Loading ' + str(self.xml_file))\n update_annotation_version(self.xml_file)\n\n xml = parse(self.xml_file)\n return xml.getroot()"
] | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Retrieves the data in a jsoned form | [
"def export_data(self):\n \n\n def export_field(value):\n \"\"\"\n Export item\n \"\"\"\n try:\n return value.export_data()\n except AttributeError:\n return value\n\n if self.__modified_data__ is not None:\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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/*
Set the value of the last element returned by next or previous,
discarding any version information | [
"public void setValue(E element) {\n if(element == null)\n throw new NullPointerException(\"cannot set a null element\");\n if(_lastId == VStack.NULL_ID)\n throw new IllegalStateException(\"neither next() nor previous() has been called\");\n\n _stack.setById(_lastId, eleme... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
get general component config variables or info about subcomponents
@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 2.2.13 - 2007-10-23
@param string $config
@return value | [
"function getConfig( $config ) {\n switch( strtoupper( $config )) {\n case 'ALLOWEMPTY':\n return $this->allowEmpty;\n break;\n case 'COMPSINFO':\n unset( $this->compix );\n $info = array();\n foreach( $this->components as $cix => $component ) {\n unset( $com... | [
"final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Assert that the given method returns the expected return type.
@param method Method to assert.
@param expectedReturnType Expected return type of the method.
@throws IllegalArgumentException If the method's return type doesn't match the expected type. | [
"public static void assertReturnValue(ReflectionMethod method, Class<?> expectedReturnType) {\n final Class<?> returnType = method.getReturnType();\n if (returnType != expectedReturnType) {\n final String message = \"Class='\"+method.getDeclaringClass()+\"', method='\"+method.getName()+\"':... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Return classification accuracy of input | [
"def _value_function(self, x_input, y_true, y_pred):\n \n if len(y_true.shape) == 1:\n return y_pred.argmax(1).eq(y_true).double().mean().item()\n else:\n raise NotImplementedError"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Includes target contents into config.
:param str|unicode|Section|list target: File path or Section to include. | [
"def include(self, target):\n \n for target_ in listify(target):\n if isinstance(target_, Section):\n target_ = ':' + target_.name\n\n self._set('ini', target_, multi=True)\n\n return self"
] | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add custom repositories | [
"def command_repo_add(self):\n \n if len(self.args) == 3 and self.args[0] == \"repo-add\":\n Repo().add(self.args[1], self.args[2])\n else:\n usage(\"\")"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
renderer.insert function for rendering arrays,
`this` bound to the input.
@param {Table} table cli-table
@param {Object} object renderer object
@param {Array} fields fields to show | [
"function insertArray (table, object, fields) {\n var input = this\n\n input.forEach(function addRow (entry, rowNo) {\n var tableRow = fields.map(function cell (fieldName) {\n return getCellContent.call(entry, object.fields[fieldName], rowNo)\n })\n table.push(tableRow)\n })\n}"
] | [
"function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Create the readable name for the pipeline name. | [
"function prettyName(name, sidebar) {\n var adjustedName = name;\n if (sidebar) {\n var adjustedName = name;\n var parts = name.split('.');\n if (parts.length > 0) {\n adjustedName = parts[parts.length - 1];\n }\n }\n return adjustedName.replace(/\\./, '.<wbr>');\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Creates a {@code status} tag based on the response status of the given
{@code exchange}.
@param exchange the exchange
@return the status tag derived from the response status | [
"public static Tag status(ServerWebExchange exchange) {\n\t\tHttpStatus status = exchange.getResponse().getStatusCode();\n\t\tif (status == null) {\n\t\t\tstatus = HttpStatus.OK;\n\t\t}\n\t\treturn Tag.of(\"status\", String.valueOf(status.value()));\n\t}"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the sentence about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about programming:"
} |
<code>repeated .google.privacy.dlp.v2.FieldId headers = 1;</code> | [
"public com.google.privacy.dlp.v2.FieldIdOrBuilder getHeadersOrBuilder(int index) {\n return headers_.get(index);\n }"
] | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.automl.v1beta1.DataType> getFields() {\n return getFieldsMap();\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Only include rows which are missing this field, this was the only possible
way to do it.
@param fieldName
The field which should be missing
@return ScannerBuilder | [
"public EntityScannerBuilder<E> addIsMissingFilter(String fieldName) {\n SingleFieldEntityFilter singleFieldEntityFilter = new SingleFieldEntityFilter(\n entityMapper.getEntitySchema(), entityMapper.getEntitySerDe(),\n fieldName, \"++++NON_SHALL_PASS++++\", CompareFilter.CompareOp.EQUAL);\n Sing... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setOBJTYPE(Integer newOBJTYPE) {\n\t\tInteger oldOBJTYPE = objtype;\n\t\tobjtype = newOBJTYPE;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BEGIN_IMAGE__OBJTYPE, oldOBJTYPE, objtype));\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Validates to make sure all required services are defined
@return void
@throws \Exception | [
"private function validateServicesDefined() {\n if(!$this->getDi()->has(AclInterface::DI_NAME)) {\n throw new \\Exception('Service ' . AclInterface::class . '::DI_NAME must be defined with a type of: ' . AclInterface::class);\n }\n if(!$this->getDi()->has(OutputInterface::DI_NAME)) {... | [
"@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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// create body writer POST | [
"func reqForm(r Request, params map[string]string, method string) (Request, error) {\n\tbody := &bytes.Buffer{}\n\twriter := multipart.NewWriter(body)\n\tfor key, val := range params {\n\t\t_ = writer.WriteField(key, val)\n\t}\n\tdefer writer.Close()\n\treq, err := http.NewRequest(method, r.URI, body)\n\treq.Header... | [
"@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 writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about programming:"
} |
// TexturedPolygon draws a polygon filled with the given texture.
// (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a65137af308ea878f28abc95419e8aef5) | [
"func TexturedPolygon(renderer *sdl.Renderer, vx, vy []int16, surface *sdl.Surface, textureDX, textureDY int) bool {\n\t_len := C.int(min(len(vx), len(vy)))\n\tif _len == 0 {\n\t\treturn true\n\t}\n\t_vx := (*C.Sint16)(unsafe.Pointer(&vx[0]))\n\t_vy := (*C.Sint16)(unsafe.Pointer(&vy[0]))\n\t_surface := (*C.SDL_Surf... | [
"public function convertToUtf()\n {\n $dbHandler = $this->getDbHandler();\n\n $rs = $dbHandler->query(\n \"SELECT oxvarname, oxvartype, DECODE( oxvarvalue, '{$this->getConfigKey()}') AS oxvarvalue\n FROM oxconfig\n WHERE oxvartype IN ('str', 'a... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *ListTriggersInput) SetNextToken(v string) *ListTriggersInput {\n\ts.NextToken = &v\n\treturn s\n}"
] | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// NewMockAccessTokenStorage creates a new mock instance | [
"func NewMockAccessTokenStorage(ctrl *gomock.Controller) *MockAccessTokenStorage {\n\tmock := &MockAccessTokenStorage{ctrl: ctrl}\n\tmock.recorder = &MockAccessTokenStorageMockRecorder{mock}\n\treturn mock\n}"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// RetrieveCachedExternalFlowPolicy returns the policy for an external IP | [
"func (p *PUContext) RetrieveCachedExternalFlowPolicy(id string) (interface{}, error) {\n\treturn p.externalIPCache.Get(id)\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Bump version following semantic versioning rules. | [
"def bump(self, level='patch', label=None):\n \n bump = self._bump_pre if level == 'pre' else self._bump\n bump(level, label)"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// ParseAddr parses an address from its string format to a net.Addr. | [
"func ParseAddr(address, socksAddr string) (net.Addr, error) {\n\thost, portStr, err := net.SplitHostPort(address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tport, err := strconv.Atoi(portStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif IsOnionHost(host) {\n\t\treturn &OnionAddr{OnionService: host, ... | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Checks if a table exists.
@param string $table table name
@return bool TRUE if table exists, else FALSE | [
"public function tableExists( $table )\r\n {\r\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables\r\n WHERE table_schema = ? AND table_name = ?\";\r\n\r\n $params = [ $this->name, $table ];\r\n\r\n $statement = $this->database->prepare( $query );\r\n ... | [
"public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
Check if a missing translation exists in collection.
@param string $locale
@param string $transKey
@return bool | [
"private function hasMissing($locale, $transKey)\n {\n if ( ! isset($this->missing[$locale]))\n return false;\n\n return in_array($transKey, $this->missing[$locale]);\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 sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Utility that detects and returns the columns that are forward returns | [
"def get_forward_returns_columns(columns):\n \n pattern = re.compile(r\"^(\\d+([Dhms]|ms|us|ns))+$\", re.IGNORECASE)\n valid_columns = [(pattern.match(col) is not None) for col in columns]\n return columns[valid_columns]"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// SetUserName sets the UserName field's value. | [
"func (s *SigningCertificate) SetUserName(v string) *SigningCertificate {\n\ts.UserName = &v\n\treturn s\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(Player player, ProtocolMarshaller protocolMarshaller) {\n\n if (player == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(player.getPlayerId(), PLAYERID_BINDING);\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns the list of KNX devices currently attached to the host, based on known KNX vendor IDs.
@return the list of found KNX devices | [
"public static List<UsbDevice> getKnxDevices()\n\t{\n\t\tfinal List<UsbDevice> knx = new ArrayList<>();\n\t\tfor (final UsbDevice d : getDevices()) {\n\t\t\tfinal int vendor = d.getUsbDeviceDescriptor().idVendor() & 0xffff;\n\t\t\tfor (final int v : vendorIds)\n\t\t\t\tif (v == vendor)\n\t\t\t\t\tknx.add(d);\n\t\t}... | [
"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 sentence about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
Get this object properties
REST: GET /sms/{serviceName}/virtualNumbers/{number}
@param serviceName [required] The internal name of your SMS offer
@param number [required] The virtual number | [
"public OvhVirtualNumber serviceName_virtualNumbers_number_GET(String serviceName, String number) throws IOException {\n\t\tString qPath = \"/sms/{serviceName}/virtualNumbers/{number}\";\n\t\tStringBuilder sb = path(qPath, serviceName, number);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\tretu... | [
"@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 summarization about Object properties:",
"pos": "Represent the code about Object properties:",
"neg": "Represent the code about Programming:"
} |
Convert from AgMIP standard date string (YYMMDD) to a custom date string
@param agmipDate AgMIP standard date string
@param format Destination format
@return a formatted date string or {@code null} | [
"public synchronized static String formatAgmipDateString(String agmipDate, String format) {\n try {\n SimpleDateFormat fmt = new SimpleDateFormat(format);\n Date d = dateFormatter.parse(agmipDate);\n return fmt.format(d);\n } catch (Exception ex) {\n return ... | [
"def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// ContainsShard returns true if either Left or Right lists contain
// the provided Shard. | [
"func (os *OverlappingShards) ContainsShard(shardName string) bool {\n\tfor _, l := range os.Left {\n\t\tif l.ShardName() == shardName {\n\t\t\treturn true\n\t\t}\n\t}\n\tfor _, r := range os.Right {\n\t\tif r.ShardName() == shardName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
See https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files
for more information about this file format. | [
"protected function load($filename)\n {\n $lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n if ($lines === false) {\n throw new \\InvalidArgumentException('Invalid file');\n }\n\n $entry = self::newEntry();\n $lastKw = null;\n ... | [
"def configure(default=None, dev=None):\n \n cache_loc = openaccess_epub.utils.cache_location()\n config_loc = openaccess_epub.utils.config_location()\n\n #Make the cache directory\n openaccess_epub.utils.mkdir_p(cache_loc)\n\n defaults = {'now': time.asctime(),\n 'oae-version': ope... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Alias for the `resourcesFolder` function.
@param string $extensionKey The extension key
@param string $prefix The optional prefix, defaults to `EXT:`
@return string The resources folder | [
"public static function getResourcesFolder(string $extensionKey, string $prefix = 'EXT:'): string {\n return self::resourcesFolder($extensionKey, $prefix);\n }"
] | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param string $type
@param string $serviceId
@return bool | [
"private function clearTypedCacheFromService($type, $serviceId)\n {\n /** @type \\Psr\\Cache\\CacheItemPoolInterface $service */\n $service = $this->getContainer()->get($serviceId);\n if ($service instanceof TaggablePoolInterface) {\n return $service->clearTags([$type]);\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Initializes the first map for data input. | [
"private void initFirstMapForGrammarProductions() {\n\tfor (Production production : grammar.getProductions().getList()) {\n\t if (!firstGrammar.containsKey(production.getName())) {\n\t\tfirstGrammar.put(production.getName(), new LinkedHashSet<Terminal>());\n\t }\n\t}\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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Start the FTP Server for pulsar search. | [
"def run(self):\n \"\"\"\"\"\"\n self._log.info('Starting Pulsar Search Interface')\n # Instantiate a dummy authorizer for managing 'virtual' users\n authorizer = DummyAuthorizer()\n\n # Define a new user having full r/w permissions and a read-only\n # anonymous user\n ... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param array $provider
@throws ProviderException | [
"private function resolveProviderAnnotation($provider)\n {\n if (is_array($provider)) {\n\n foreach ($provider as $item) {\n $this->resolveProviderAnnotation($item);\n }\n\n } else {\n if (false === $this->isProvided($provider)) {\n $th... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the description about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
// SetCdcStartTime sets the CdcStartTime field's value. | [
"func (s *CreateReplicationTaskInput) SetCdcStartTime(v time.Time) *CreateReplicationTaskInput {\n\ts.CdcStartTime = &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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Unprotects an RTP Packet by decrypting the payload.
@param packet
RTP Packet to be unprotected
@return error code, 0 = success | [
"public int unprotect(RtpPacket packet) {\n\t\tif (txSessAuthKey == null) {\n\t\t\t// Only the tx session key is set at session start, rx is done when\n\t\t\t// 1st packet received\n\t\t\tlog(\"unprotect() called out of session\");\n\t\t\treturn UNPROTECT_SESSION_NOT_STARTED;\n\t\t}\n\t\tif (packet == null) {\n\t\t... | [
"def sanitize(self):\n '''\n \n '''\n super(MapNotifyMessage, self).sanitize()\n\n # The first bit after the Type field in a Map-Notify message is\n # allocated as the \"I\" bit. I bit indicates that a 128 bit xTR-ID and\n # 64 bit site-ID field is present at the en... | codesearchnet | {
"query": "Represent the Github text about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
Initialize the communities file bucket.
:raises: `invenio_files_rest.errors.FilesException` | [
"def initialize_communities_bucket():\n \n bucket_id = UUID(current_app.config['COMMUNITIES_BUCKET_UUID'])\n\n if Bucket.query.get(bucket_id):\n raise FilesException(\"Bucket with UUID {} already exists.\".format(\n bucket_id))\n else:\n storage_class = current_app.config['FILES... | [
"def get_object_record(self, pid):\n \n try:\n return self._cache['records'][pid]\n except KeyError:\n raise d1_onedrive.impl.onedrive_exceptions.ONEDriveException('Unknown PID')"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
// AppendUint encodes and inserts an unsigned integer value into the dst byte array. | [
"func (e Encoder) AppendUint(dst []byte, val uint) []byte {\n\treturn e.AppendInt64(dst, int64(val))\n}"
] | [
"func estimateUnknownSize(unk *runtime.Unknown, byteSize uint64) uint64 {\n\tsize := uint64(unk.Size())\n\t// protobuf uses 1 byte for the tag, a varint for the length of the array (at most 8 bytes - uint64 - here),\n\t// and the size of the array.\n\tsize += 1 + 8 + byteSize\n\treturn size\n}"
] | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
// GetKey implements KeyDB by returning the result of calling the closure. | [
"func (kc KeyClosure) GetKey(address btcutil.Address) (*btcec.PrivateKey,\n\tbool, error) {\n\treturn kc(address)\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 Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
/*
Each category is surrounded by one or several square brackets. The number of brackets indicates
the depth of the category.
Options are
`comment` Default to ";" | [
"function(str, options = {}) {\n var comment, current, data, lines, stack;\n lines = string.lines(str);\n current = data = {};\n stack = [current];\n comment = options.comment || ';';\n lines.forEach(function(line, _, __) {\n var depth, match, parent;\n if (!line || line.match(/^\\s*$/))... | [
"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 Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Displays a Bootstrap glyphicon.
@param string $name The name.
@return string Returns the Bootstrap glyphicon. | [
"protected function bootstrapGlyphicon($name, $style) {\n\n $attributes = [];\n\n $attributes[\"class\"][] = \"glyphicon\";\n $attributes[\"class\"][] = null !== $name ? \"glyphicon-\" . $name : null;\n $attributes[\"aria-hidden\"] = \"true\";\n $attributes[\"style\"] ... | [
"protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Validates data based on Joi schemas
@param {Object} data the data to be validated
@param {Object} schema the object schema specified in Joi against which data is validated | [
"function validate (data, schema) {\n if (!data || !schema) {\n throw new Error('Trying to validate without passing data and schema')\n }\n return Joi.validate(data, schema)\n}"
] | [
"function setup(check) {\n if (!check) {\n throw new Error('Data to match is not defined')\n } else if (!check.jsonBody) {\n throw new Error('jsonBody is not defined')\n } else if (!check.jsonTest) {\n throw new Error('jsonTest is not defined')\n }\n\n // define the defaults\n const defaults = {\n ... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
Specify camera calibration parameters
@param fx Focal length x-axis in pixels
@param fy Focal length y-axis in pixels
@param skew skew in pixels
@param cx camera center x-axis in pixels
@param cy center center y-axis in pixels | [
"public AddBrownPtoN_F64 setK( /**/double fx, /**/double fy, /**/double skew, /**/double cx, /**/double cy) {\n\n\t\t// analytic solution to matrix inverse\n\t\ta11 = (double)(1.0/fx);\n\t\ta12 = (double)(-skew/(fx*fy));\n\t\ta13 = (double)((skew*cy - cx*fy)/(fx*fy));\n\t\ta22 = (double)(1.0/fy);\n\t\ta23 = (double... | [
"def pixels_to_ndc(pos, size=None):\n \"\"\"\"\"\"\n pos = np.asarray(pos, dtype=np.float64)\n size = np.asarray(size, dtype=np.float64)\n pos = pos / (size / 2.) - 1\n # Flip y, because the origin in pixels is at the top left corner of the\n # window.\n pos[1] = -pos[1]\n return pos"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
TODO: should this method be final? | [
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n preProcessRequest(request);\n\n DefaultServerDolphin serverDolphin = resolveServerDolphin(request);\n\n String input = readInput(request);\n if (LOG.is... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.