query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Wrapper around spork to shorthand common behavior
[ "function _spork(command, args, resolve, reject) {\n spork(command, args, {exit: false, quiet: true})\n .on('exit:code', function(code) {\n if (code === 0) {\n resolve();\n } else {\n reject();\n }\n });\n }" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Sets the current position of the splitter in pixels. @param position the desired position of the splitter
[ "public void setSplitterPosition(int position) {\n mSplitterPosition = clamp(position, 0, Integer.MAX_VALUE);\n mSplitterPositionPercent = -1;\n remeasure();\n notifySplitterPositionChanged(false);\n }" ]
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets duration of video track in milliseconds. @return
[ "public long getDurationMillis()\n\t{\n\t\tList<Element> durations = element.getChildren(\"Duration\");\n\n\t\tif (durations.size() != 0)\n\t\t{\n\t\t\tfinal String durationString = durations.get(0).getValue();\n\n\t\t\tfinal long duration = Long.parseLong(durationString);\n\n\t\t\treturn duration;\n\t\t}\n\t\telse...
[ "def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Calculates the initial value for the s parameter in Phase I. Return s = max(||Ai.x+bi|| - (ci.x+di)) @see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2"
[ "@Override\r\n\tpublic double calculatePhase1InitialFeasiblePoint(double[] originalNotFeasiblePoint, double tolerance){\r\n\t\tdouble s = -Double.MAX_VALUE;\r\n\t\tRealVector x = new ArrayRealVector(originalNotFeasiblePoint); \r\n\t\tfor(int i=0; i<socpConstraintParametersList.size(); i++){\r\n \t\t\tSOCPConstraint...
[ "def hdrval(cls):\n \n\n hdrmap = {'Itn': 'Iter', 'X r': 'PrimalRsdl', 'X s': 'DualRsdl',\n u('X ρ'): 'Rho', 'D cnstr': 'Cnstr', 'D dlt': 'DeltaD',\n u('D η'): 'Eta'}\n return hdrmap" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Data processing:" }
Pretty print an XML string - if the HTML Display flag is passed it will be formatted for display on a web page with special characters escaped. @param string $xmlString @param boolean $htmlDisplay @return string
[ "public static function prettyPrint($xmlString, $htmlDisplay = false) {\n\n // Create a nicely formatted version\n $doc = new \\DOMDocument();\n $doc->loadXML($xmlString);\n $doc->preserveWhiteSpace = false;\n $doc->formatOutput = true;\n\n $prettyXML = $doc->saveXML();\n\n...
[ "public function format($templateData)\n {\n $viewer = SSViewer::execute_template(['type' => 'Includes', 'WorkflowDefinitionExport'], $templateData);\n // Temporary until we find the source of the replacement in SSViewer\n $processed = str_replace('&amp;', '&', $viewer);\n // Clean-up...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Scan a string for tokens using the same engine. @param $string @return array a unique list of all the raw mustache tags found in the string
[ "public function getTokens($string)\n {\n $tokens = [];\n $scanResults = $this->engine->getTokenizer()->scan($string);\n\n foreach ($scanResults as $scanResult) {\n if (\n isset($scanResult['type'])\n && isset($scanResult['name'])\n ...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Callback function that writes backward end appropriate data to Tensorboard.
[ "def on_backward_end(self, iteration:int, **kwargs)->None:\n \"\"\n if iteration == 0: return\n self._update_batches_if_needed()\n #TODO: This could perhaps be implemented as queues of requests instead but that seemed like overkill. \n # But I'm not the biggest fan of maintaining...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Abuses the bot. Syntax: {command}
[ "def cmd(send, _, args):\n \n\n def lenny_send(msg):\n send(gen_lenny(msg))\n\n key = args['config']['api']['bitlykey']\n cmds = [lambda: gen_fortune(lenny_send), lambda: gen_urban(lenny_send, args['db'], key)]\n choice(cmds)()" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set the related list criteria. @param NewsCriteria $criteria @param Module $module @throws NoNewsException
[ "private function setRelatedListCriteria(NewsCriteria $criteria, Module $module)\n {\n if (null === ($news = $module->currentNews)) {\n throw new NoNewsException();\n }\n\n /** @var Model $adapter */\n $adapter = $this->framework->getAdapter(Model::class);\n $categor...
[ "public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Remove browser. @param \BlackForest\PiwikBundle\Entity\PiwikBrowser $browser @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
[ "public function removeBrowser(\\BlackForest\\PiwikBundle\\Entity\\PiwikBrowser $browser)\n {\n return $this->browser->removeElement($browser);\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Make Update Parameter @param array $data @return array
[ "protected static function makeUpdateParameter($data)\n {\n foreach ($data as $field => $value) {\n $newData[] = \"{$field}=:{$field}\";\n }\n\n $newData = implode(\",\", $newData); // override new data\n\n return $newData;\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Ensure directory exists for a given file path.
[ "def ensure_directory(path):\n \n dirname = os.path.dirname(path)\n if not os.path.exists(dirname):\n os.makedirs(dirname)" ]
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Rolls checkpointed image.
[ "private static void renameCheckpointInDir(StorageDirectory sd, long txid)\n throws IOException {\n File ckpt = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE_NEW, txid);\n File curFile = NNStorage.getStorageFile(sd, NameNodeFile.IMAGE, txid);\n // renameTo fails on Windows if the destination file \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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// CreateASCIIArt Create an ASCII art object from a string slice
[ "func CreateASCIIArt(c []string, x, y int, fg, bg termbox.Attribute) *ASCIIArt {\n\ti := ASCIIArt{contents: c, x: x, y: y, fg: fg, bg: bg, bordered: false, tabSkip: true}\n\ti.activeFg, i.activeBg = fg, bg\n\treturn &i\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Load's and return's the decimal attributes for the passed primary key/store ID. @param integer $pk The primary key of the attributes @param integer $storeId The store ID of the attributes @return array The decimal attributes
[ "public function findAllByPrimaryKeyAndStoreId($pk, $storeId)\n {\n\n // prepare the params\n $params = array(\n ParamNames::PK => $pk,\n ParamNames::STORE_ID => $storeId\n );\n\n // load and return the product decimal attributes with the passed primary k...
[ "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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Merge the CSS/ID stuff. @param Module $module
[ "private function mergeCssId(Module $module)\n {\n $cssID = StringUtil::deserialize($module->cssID, true);\n\n // Override the CSS ID (see #305)\n if ($this->cssID[0]) {\n $cssID[0] = $this->cssID[0];\n }\n\n // Merge the CSS classes (see #6011)\n if ($this->c...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
A locator MUST have a type and its value MUST be 'resource' @param string $linkbase @param string $value The value of the type @return boolean
[ "private function validateXLinkResourceType( $linkbase, $value )\r\n\t{\r\n\t\tif ( ! XBRL::isValidating() ) return true;\r\n\r\n\t\tif ( $value == 'resource' ) return true;\r\n\r\n\t\treturn $this->reportXLinkResourceTypeError( \"3.5.3.8.1\", $linkbase, $value );\r\n\t}" ]
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Removes all unnecassary whitespaces and newlines from the given translations @param array $translations @return array filtered translations
[ "public function filter($translations)\n {\n foreach ($translations as $pluginName => $pluginTranslations) {\n foreach ($pluginTranslations as $key => $translation) {\n\n $baseTranslation = '';\n if (isset($this->baseTranslations[$pluginName][$key])) {\n ...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param string|int|object $value @param string $name @param string|array $parameters @return mixed
[ "protected function _validate($value, $name, $parameters)\n {\n if (is_object($value)) {\n return $value;\n }\n\n $method = \"_validate_$name\";\n if (method_exists($this, $method)) {\n return $parameters === null ? $this->$method($value) : $this->$method($value,...
[ "protected static function getField(\n ParticleInterface $particle,\n FieldsCargo $cargo,\n string $name,\n array $args = []\n )/*: mixed*/\n {\n $name = Utils::findFieldName($cargo, $name);\n return $particle->attributes()->$name; // test with null.\n }" ]
codesearchnet
{ "query": "Represent the summarization about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(DownloadDefaultKeyPairRequest downloadDefaultKeyPairRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (downloadDefaultKeyPairRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n } catch (E...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sets the sandbox. @param boolean sandbox
[ "public static function setSandbox($sandbox)\n {\n if ($sandbox == true) {\n static::setEnvironment(Environment::SANDBOX);\n } else {\n static::setEnvironment(Environment::PRODUCTION);\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SetPrefix sets the Prefix field's value.
[ "func (s *ListObjectsV2Input) SetPrefix(v string) *ListObjectsV2Input {\n\ts.Prefix = &v\n\treturn s\n}" ]
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// Show runs the show action.
[ "func (c *WorkitemtypeController) Show(ctx *app.ShowWorkitemtypeContext) error {\n\terr := application.Transactional(c.db, func(appl application.Application) error {\n\t\twitModel, err := appl.WorkItemTypes().Load(ctx.Context, ctx.WitID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn ctx.ConditionalReque...
[ "@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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(BatchDetectKeyPhrasesRequest batchDetectKeyPhrasesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (batchDetectKeyPhrasesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sends 5 {@link HelloReply} responses when receiving a request. @see #lazyHello(HelloRequest, StreamObserver)
[ "@Override\n public void lotsOfReplies(HelloRequest request, StreamObserver<HelloReply> responseObserver) {\n // You can also write this code without Reactor like 'lazyHello' example.\n Flux.interval(Duration.ofSeconds(1))\n .take(5)\n .map(index -> \"Hello, \" + request.getNa...
[ "@Override\n public <T extends Actor> IPromise<T> connect(Callback<ActorClientConnector> disconnectCallback, Consumer<Actor> actorDisconnecCB) {\n return new Promise<>((T) actor);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// ToBool converts a string ("true" or "false") to its boolean equivalent
[ "func ToBool(s string) (b bool) {\n\tif len(s) == 0 {\n\t\tlog.Fatal(\"ERROR: variable empty, cannot convert to boolean\")\n\t}\n\tswitch s {\n\tcase \"false\":\n\t\tb = false\n\tcase \"true\":\n\t\tb = true\n\t}\n\treturn b\n}" ]
[ "function validateRule(rule, value) {\n // For a given rule, get the first letter of the string name of its\n // constructor function. \"R\" -> RegExp, \"F\" -> Function (these shouldn't\n // conflict with any other types one might specify). Note: instead of\n // getting .toString from a new object {} o...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Decode decodes the leading bytes in src as a single instruction. // The mode arguments specifies the assumed processor mode: // 16, 32, or 64 for 16-, 32-, and 64-bit execution modes.
[ "func Decode(src []byte, mode int) (inst Inst, err error) {\n\treturn decode1(src, mode, false)\n}" ]
[ "function norm16(v) {\n v = parseInt(v, 16);\n return size == 2 ? v : // 16 bit\n size == 1 ? v << 4 : // 8 bit\n v >> (4 * (size - 2)); // 24 or 32 bit\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetPasswordResetRequired sets the PasswordResetRequired field's value.
[ "func (s *CreateLoginProfileInput) SetPasswordResetRequired(v bool) *CreateLoginProfileInput {\n\ts.PasswordResetRequired = &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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Create an instance of {@link PersonInfo}
[ "@XmlElementDecl(namespace = \"http://org/persons/\", name = \"PersonInfo\")\n public JAXBElement<PersonInfo> createPersonInfo(PersonInfo value) {\n return new JAXBElement<PersonInfo>(_PersonInfo_QNAME, PersonInfo.class, null, value);\n }" ]
[ "@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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Performs the actual connection, retrying, generating the authorization key if necessary, and starting the send and receive loops.
[ "async def _connect(self):\n \n self._log.info('Connecting to %s...', self._connection)\n for attempt in retry_range(self._retries):\n try:\n self._log.debug('Connection attempt {}...'.format(attempt))\n await self._connection.connect(timeout=self._conne...
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetInstanceId sets the InstanceId field's value.
[ "func (s *StartInstanceInput) SetInstanceId(v string) *StartInstanceInput {\n\ts.InstanceId = &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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Description returns the first Description option found in the [Unit] section. // If the option is not defined, an empty string is returned.
[ "func (u *UnitFile) Description() string {\n\tif values := u.Contents[\"Unit\"][\"Description\"]; len(values) > 0 {\n\t\treturn values[0]\n\t}\n\treturn \"\"\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 Github instruction about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
Returns the previous command, if any.
[ "def scroll_up(self):\n \n self._index += 1\n nb_commands = len(self._history)\n if self._index >= nb_commands:\n self._index = nb_commands - 1\n try:\n return self._history[self._index]\n except IndexError:\n return ''" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Try to initialize the Configuration and TransactionStateStorage instances. Obtaining the Configuration may fail until ReactorServiceMain has been started.
[ "private void tryInit() {\n try {\n Configuration conf = getSnapshotConfiguration();\n if (conf != null) {\n // Since this is only used for background loading of transaction snapshots, we use the no-op metrics collector,\n // as there are no relevant metrics to report\n this.storag...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetJobUpdate sets the JobUpdate field's value.
[ "func (s *UpdateJobInput) SetJobUpdate(v *JobUpdate) *UpdateJobInput {\n\ts.JobUpdate = 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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get an email from the archive by its reference @param string $sRef The email's reference @param array $aData The data array @return mixed stdClass on success, false on failure @throws \Nails\Common\Exception\FactoryException
[ "public function getByRef($sRef, $aData = [])\n {\n if (empty($aData['where'])) {\n $aData['where'] = [];\n }\n\n $aData['where'][] = [$this->sTableAlias . '.ref', $sRef];\n\n $aEmails = $this->getAll(null, null, $aData);\n\n return !empty($aEmails) ? reset($aEmails)...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// ParseGTID calls the GTID parser for the specified flavor.
[ "func ParseGTID(flavor, value string) (GTID, error) {\n\tparser := gtidParsers[flavor]\n\tif parser == nil {\n\t\treturn nil, vterrors.Errorf(vtrpc.Code_INTERNAL, \"parse error: unknown GTID flavor %#v\", flavor)\n\t}\n\treturn parser(value)\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 Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Use this method only when using this class as an ordinary ImageView. @deprecated Use {@link #setController(DraweeController)} instead.
[ "@Override\n @Deprecated\n public void setImageBitmap(Bitmap bm) {\n init(getContext());\n mDraweeHolder.setController(null);\n super.setImageBitmap(bm);\n }" ]
[ "public static BasicGalleryWrapper<GalleryWrapper, String, String, String> gallery(Fragment fragment) {\n return new GalleryWrapper(fragment.getActivity());\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Open a zip file. @param $location @throws \LogicException if it cannot open the archive
[ "public function openArchive($location)\n {\n $location = str_replace('/', DIRECTORY_SEPARATOR, $location);\n if (($response = $this->archive->open($location, ZipArchive::CREATE)) !== true) {\n throw new \\LogicException('Could not open zip archive at:'.$location.', error: '.$response);\...
[ "private function checkPackage(stdClass $item)\n {\n if( ! file_exists($item->rootDirectory) )\n $this->abort('Package ' . $item->directory . ' not existing, please create a repository and launch \"php artisan hc:new-package\" command');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Logistics:" }
// Get implements the payment.pb/Get method. // Get charge object by charge id or error.
[ "func (p *paymentService) List(ctx context.Context, req *paymentpb.ListRequest) (*paymentpb.ChargeList, error) {\n\n\tif err := validation.Validate(req); err != nil {\n\t\treturn nil, err\n\t}\n\n\tslice := &charges{}\n\n\tn, err := storage.Handler().List(slice, object.ListOpt{\n\t\tLimit: req.GetLimit(),\n\t\tPage...
[ "func (r *MintOAuthTokenGrantRPC) validateRequest(c context.Context, req *minter.MintOAuthTokenGrantRequest, caller identity.Identity) (*Rule, error) {\n\t// Dump the whole request and relevant auth state to the debug log.\n\tr.logRequest(c, req, caller)\n\n\t// Reject obviously bad requests.\n\tif err := r.checkRe...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Access control:" }
接口参数类型认证 source:接口文档数据 qs:请求的参数
[ "function CheckParams(data, query)\n{\n for (let key in data) {\n let par = data[key];\n if(par.constructor!=Object)continue;//非\n let errkey = par.lbl?par.lbl:(par.rem?par.rem:key);//发生错误时的key的称呼方式\n if(par.constructor != Object){return `${errkey}接口文档定义错误。`}\n if (null==par.re...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the hostname of a given IP
[ "def ip_to_host(ip):\n '''\n \n '''\n try:\n hostname, aliaslist, ipaddrlist = socket.gethostbyaddr(ip)\n except Exception as exc:\n log.debug('salt.utils.network.ip_to_host(%r) failed: %s', ip, exc)\n hostname = None\n return hostname" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github text about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
获取文件的临时访问Url @param string $path @param \DateTimeInterface $expiration @param array $options @return string
[ "public function temporaryUrl($path, $expiration, array $options = [])\n {\n $adapter = $this->driver->getAdapter();\n\n if ($adapter instanceof CachedAdapter) {\n $adapter = $adapter->getAdapter();\n }\n\n if (method_exists($adapter, 'getTemporaryUrl')) {\n retu...
[ "private function setFileList(array $list): void\n {\n // 获取缓存数据文件目录的文件名\n $category = $this->fileList();\n\n // 写入\n write($category, serialize($list), LOCK_EX);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Delete a document from the repository using its ID. @param mixed $id The ID of the document (or the document itself) to delete @return boolean True if deleted, false if not.
[ "public function delete($id)\n {\n if ($id instanceof DocumentInterface) {\n $id = $id->getId();\n }\n\n $path = $this->getPathForDocument($id);\n\n return unlink($path);\n }" ]
[ "public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Loads a source file. @param string $page The page to load. @return SourceFile
[ "public function getSourceFile($page)\n {\n $path = realpath($this->generator->getInputDirectory() . '/' . $page . '.xml');\n\n return new SourceFile($page, $path);\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// Delete removes a blob from an S3 compatible blobstore. If the object does // not exist, Delete does not return an error.
[ "func (client *S3Blobstore) Delete(dest string) error {\n\tif client.s3cliConfig.CredentialsSource == config.NoneCredentialsSource {\n\t\treturn errorInvalidCredentialsSourceValue\n\t}\n\n\tdeleteParams := &s3.DeleteObjectInput{\n\t\tBucket: aws.String(client.s3cliConfig.BucketName),\n\t\tKey: client.key(dest),\...
[ "public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ...
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Add a new knot. @param x the knot position @param color the color @see #removeKnot
[ "public void addKnot(int x, int color) {\n\t\tint[] nx = new int[numKnots+1];\n\t\tint[] ny = new int[numKnots+1];\n\t\tSystem.arraycopy(xKnots, 0, nx, 0, numKnots);\n\t\tSystem.arraycopy(yKnots, 0, ny, 0, numKnots);\n\t\txKnots = nx;\n\t\tyKnots = ny;\n\t\txKnots[numKnots] = x;\n\t\tyKnots[numKnots] = color;\n\t\t...
[ "def refinements(self):\n \"\"\"\"\"\"\n self.rc(\"setattr a color gray @CENTROID\")\n self.rc(\"setattr a radius 0.3 @CENTROID\")\n self.rc(\"represent sphere @CENTROID\")\n self.rc(\"setattr a color orange @CHARGE\")\n self.rc(\"setattr a radius 0.4 @CHARGE\")\n se...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* Return KeyNameSpaceWithTime and TimeNameSpaceWithKey as multi-return set */
[ "func (namespace *Namespace) KeyAndTimeBothNameSpace(key string, key_time goltime.Timestamp) (string, string) {\n\ttime_ns := namespace.TimeKeyPart(key_time)\n\treturn fmt.Sprintf(\"%s:%s\", key, time_ns), fmt.Sprintf(\"%s:%s\", time_ns, key)\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Fetches the translation for the specified string. @param string $string @return string
[ "public function getString($string)\n {\n // Exact match?\n if (isset($this->strings[$string])) {\n return $this->strings[$string];\n } else {\n return $string;\n }\n }" ]
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Documentation:" }
Windows specific config validations.
[ "def ValidateEndConfig(self, config_obj, errors_fatal=True):\n \"\"\"\"\"\"\n errors = super(WindowsClientRepacker, self).ValidateEndConfig(\n config_obj, errors_fatal=errors_fatal)\n\n install_dir = config_obj[\"Client.install_path\"]\n for path in config_obj[\"Client.tempdir_roots\"]:\n if...
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a node for FileItem/PEInfo/Type :return: A IndicatorItem represented as an Element node
[ "def make_fileitem_peinfo_type(petype, condition='is', negate=False, preserve_case=False):\n \n document = 'FileItem'\n search = 'FileItem/PEInfo/Type'\n content_type = 'string'\n content = petype\n ii_node = ioc_api.make_indicatoritem_node(condition, document, search, content_type, content,\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:" }
An Avro message. It contains the various types used to send it (request, error, response).
[ "function Message(name, attrs, opts) {\n opts = opts || {};\n\n if (!types.isValidName(name)) {\n throw new Error(f('invalid message name: %s', name));\n }\n this._name = name;\n\n var recordName = f('org.apache.avro.ipc.%sRequest', name);\n this._requestType = types.createType({\n name: recordName,\n ...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see com.emc.ecs.nfsclient.nfs.NfsResponseBase#unmarshalling(com.emc.ecs. nfsclient.rpc.Xdr)
[ "public void unmarshalling(Xdr xdr) throws RpcException {\n super.unmarshalling(xdr);\n if (stateIsOk()) {\n unmarshallingFileHandle(xdr);\n unmarshallingAttributes(xdr);\n }\n _directoryWccData = new NfsWccData(xdr);\n }" ]
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
System call to 'git'
[ "def git_call(command, verbose = debug_mode, enforce_success = false)\n if verbose\n puts\n puts \" git #{command}\"\n puts\n end\n\n output = `git #{command}`\n puts output if verbose and not output.empty?\n\n if enforce_success and not command_successful?\n pu...
[ "def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Adds a step to the Exercise. @param Step $step @return $this
[ "public function addStep(Step $step)\n {\n if (!$this->steps->contains($step)) {\n $step->setOrder($this->steps->count());\n $this->steps->add($step);\n $step->setExercise($this);\n }\n\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// CreatePCRs creates an object referring to a TSS PCR composite. It returns // a reference to the object plus any error.
[ "func (context *Context) CreatePCRs(flags int) (*PCRs, error) {\n\tvar handle C.TSS_HPCRS\n\terr := tspiError(C.Tspi_Context_CreateObject(context.context, C.TSS_OBJECT_TYPE_PCRS, (C.TSS_FLAG)(flags), (*C.TSS_HOBJECT)(&handle)))\n\treturn &PCRs{handle: handle, context: context.context}, err\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 Github description about Go programming language:", "pos": "Represent the Github code about Go programming language:", "neg": "Represent the Github code:" }
Converts an old FIPS region code to ISO @param string $countryCode @param string $fipsRegionCode @param bool $returnOriginalIfNotFound return given region code if no mapping was found @return array
[ "public static function convertRegionCodeToIso($countryCode, $fipsRegionCode, $returnOriginalIfNotFound = false)\n {\n static $mapping;\n if(empty($mapping)) {\n $mapping = include __DIR__ . '/../data/regionMapping.php';\n }\n $countryCode = strtoupper($countryCode);\n ...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings(\n array(\n 'isMultiple' => !empty($storageDef->dataInt1) ? (bool)$storageDef->dataInt1 : false,\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns a runnable that, when run, removes the file system with the given URI from this provider.
[ "@SuppressWarnings(\"unused\") // called via reflection\n public static Runnable removeFileSystemRunnable(final URI uri) {\n return new Runnable() {\n @Override\n public void run() {\n fileSystems.remove(uri);\n }\n };\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetMinimumHealthyPercent sets the MinimumHealthyPercent field's value.
[ "func (s *DeploymentConfiguration) SetMinimumHealthyPercent(v int64) *DeploymentConfiguration {\n\ts.MinimumHealthyPercent = &v\n\treturn s\n}" ]
[ "def setupJobAfterFailure(self, config):\n \n self.remainingRetryCount = max(0, self.remainingRetryCount - 1)\n logger.warn(\"Due to failure we are reducing the remaining retry count of job %s with ID %s to %s\",\n self, self.jobStoreID, self.remainingRetryCount)\n # S...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parses give options against default options. @param array $options @param array $defaults @return array
[ "public static function parseDefaultOptions($options = [], $defaults = [])\n {\n array_walk($defaults, function ($value, $key) use (&$options) {\n if (!isset($options[$key])) {\n $options[$key] = $value;\n }\n });\n\n return $options;\n }" ]
[ "public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about NLP:" }
/* (non-Javadoc) @see tuwien.auto.calimero.mgmt.ManagementClient#writeDomainAddress(byte[])
[ "public void writeDomainAddress(byte[] domain) throws KNXTimeoutException,\r\n\t\tKNXLinkClosedException\r\n\t{\r\n\t\tif (domain.length != 2 && domain.length != 6)\r\n\t\t\tthrow new KNXIllegalArgumentException(\"invalid length of domain address\");\r\n\t\ttl.broadcast(true, priority, DataUnitBuilder.createAPDU(DO...
[ "public void set_rpc_protocol(final DeviceProxy deviceProxy, final int mode) throws DevFailed {\n checkIfTaco(deviceProxy, \"dev_rpc_protocol\");\n\n build_connection(deviceProxy);\n\n deviceProxy.taco_device.set_rpc_protocol(mode);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about language and writing:" }
Add indexes for the given shape @param shape the shape ot convert to indexes @return the indexes for the given shape
[ "public static INDArrayIndex[] indexesFor(long... shape) {\n INDArrayIndex[] ret = new INDArrayIndex[shape.length];\n for (int i = 0; i < shape.length; i++) {\n ret[i] = NDArrayIndex.point(shape[i]);\n }\n\n return ret;\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// ListenAndServe listens on the TCP network address addr using the // DefaultServer. If the handler is nil, http.DefaultServeMux is used.
[ "func ListenAndServe(addr string, handler http.Handler) error {\n\th := handler\n\tif h == nil {\n\t\th = http.DefaultServeMux\n\t}\n\tif DefaultServer == nil {\n\t\tDefaultServer = NewServer(&http.Server{Addr: addr, Handler: h})\n\t}\n\treturn DefaultServer.ListenAndServe()\n}" ]
[ "function listen(self, address, port, addressType, backlog, exclusive) {\n /* TODO Index servers by a self-assigned identifier and the process\n * identifier so messages intended for previous instances do not pass\n * through. */\n servers[port] = self; // Index servers by port.\n self._port = port...
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// PUT /v1/connect/intentions/:id
[ "func (s *HTTPServer) IntentionSpecificUpdate(id string, resp http.ResponseWriter, req *http.Request) (interface{}, error) {\n\t// Method is tested in IntentionEndpoint\n\n\targs := structs.IntentionRequest{\n\t\tOp: structs.IntentionOpUpdate,\n\t}\n\ts.parseDC(req, &args.Datacenter)\n\ts.parseToken(req, &args.Toke...
[ "def Delete(self):\n\t\t\n\t\tr = clc.v2.API.Call('DELETE','antiAffinityPolicies/%s/%s' % (self.alias,self.id),{},session=self.session)" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Called during rotation to update route information. @param location used to update route information
[ "public void resume(Location location) {\n if (location != null) {\n currentRouteInformation = buildRouteInformationFromLocation(location, null);\n }\n navigation.addProgressChangeListener(progressChangeListener);\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Pobiera dostępny layout @param \Mmi\Http\Request $request @return string @throws \Mmi\Mvc\MvcException brak layoutów
[ "private function _getLayout(\\Mmi\\Http\\Request $request)\n {\n //test layoutu dla modułu i kontrolera\n if ($this->getTemplateByPath($request->getModuleName() . '/' . $request->getControllerName() . '/layout')) {\n //zwrot layoutu moduł:kontroler\n return $request->getModul...
[ "protected function _setupRouter()\n {\n //powołanie routera z konfiguracją\n return new \\Mmi\\Mvc\\Router(\\App\\Registry::$config->router ? \\App\\Registry::$config->router : new \\Mmi\\Mvc\\RouterConfig);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// renewNodeInfo renews vSphere connection, VirtualMachine and Datacenter for NodeInfo instance.
[ "func (nm *NodeManager) renewNodeInfo(nodeInfo *NodeInfo, reconnect bool) (*NodeInfo, error) {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tvsphereInstance := nm.vsphereInstanceMap[nodeInfo.vcServer]\n\tif vsphereInstance == nil {\n\t\terr := fmt.Errorf(\"vSphereInstance for vSp...
[ "@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 description about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code about programming:" }
Apply a function to mapping with 'field'.
[ "def visit_field(rec, field, op):\n # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None\n \"\"\"\"\"\"\n\n if isinstance(rec, MutableMapping):\n if field in rec:\n rec[field] = op(rec[field])\n for d in rec:\n visit_field(rec[d], field, op)\n if i...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Normalize will normalize the Template message, returning an error if it is // invalid.
[ "func (t *File_Template) Normalize() error {\n\tif t.Body == \"\" {\n\t\treturn errors.New(\"body is empty\")\n\t}\n\n\tdefaultParams := make(map[string]*Value, len(t.Param))\n\tfor k, param := range t.Param {\n\t\tif k == \"\" {\n\t\t\treturn fmt.Errorf(\"param %q: invalid name\", k)\n\t\t}\n\t\tif !ParamRegex.Mat...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Encodes a value @param mixed $value The value to encode @return mixed The encoded value @throws SerializationException Thrown if there was an error encoding the value
[ "protected function encode($value)\n {\n try {\n return $this->encoders->getEncoderForValue($value)\n ->encode($value, new EncodingContext());\n } catch (EncodingException | InvalidArgumentException | OutOfBoundsException $ex) {\n throw new SerializationExceptio...
[ "public function getPassword() : IHashedPassword\n {\n return new class implements IHashedPassword\n {\n /**\n * Gets the hashed password string.\n *\n * @return string\n */\n public function getHash() : string\n {\n ...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
//Close - allows us to clean up the tmp file (delete, close)
[ "func (s *TempFile) Close() {\n\tlo.G.Debug(\"removing tmpfile: \", s.FileRef.Name())\n\ts.FileRef.Close()\n\n\tif e := os.Remove(s.FileRef.Name()); e != nil {\n\t\tlo.G.Errorf(\"removing tmpfile: %s failed with %s\", s.FileRef.Name(), e)\n\t}\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
Print a help screen. Assumes that self._help_request is an instance of OptionsHelp. Note: Ony useful if called after options have been registered.
[ "def _print_options_help(self):\n \n show_all_help = self._help_request.all_scopes\n if show_all_help:\n help_scopes = list(self._options.known_scope_to_info.keys())\n else:\n # The scopes explicitly mentioned by the user on the cmd line.\n help_scopes = set(self._options.scope_to_flags.k...
[ "def error(self, message):\n \n if (\n \"not allowed\" in message\n or \"ignored\" in message\n or \"expected\" in message\n or \"invalid\" in message\n or self.add_help\n ):\n # when we have \"help\" then we must also have prope...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get or set the most common data for a particuliar view(s) in a performant way (more performant than attr) For example, text for UILabel, image for UIImageView @return [RMQ]
[ "def data(new_data = :rmq_not_provided)\n if new_data != :rmq_not_provided\n selected.each do |view|\n case view\n when UILabel then view.setText new_data # set is faster than =\n when UIButton then view.setTitle(new_data, forState: UIControlStateNorma...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v. This is // equivalent to encoding/json.Decode().
[ "func (d *Decoder) Decode(v interface{}) error {\n\tswitch d.context {\n\tcase objValue:\n\t\td.context = objKey\n\t\tbreak\n\tcase arrValue:\n\t\td.path.incTop()\n\t\tbreak\n\t}\n\treturn d.Decoder.Decode(v)\n}" ]
[ "func NewHTTPCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {\n\tcom, err := cobrafy.Command(http.NewMain())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcom.Use = `http`\n\tcom.Short = `listens for and indexes arbitrary JSON data in Pilosa`\n\tcom.Long = `\npdk http listens for and indexes arbitra...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Compute VAT Amount from the Price and system configured VAT
[ "def getVATAmount(self):\n \n price, vat = self.getPrice(), self.getVAT()\n return float(price) * (float(vat) / 100)" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns a chrome URL for a given path, given the current package depth in an error bundle. State may either be an error bundle or the actual package stack.
[ "def reverse_lookup(self, state, path):\n \n\n # Make sure the path starts with a forward slash.\n if not path.startswith('/'):\n path = '/%s' % path\n\n # If the state is an error bundle, extract the package stack.\n if not isinstance(state, list):\n state =...
[ "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 Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Starts the JDCP server.
[ "private static void startServer() {\n\n try {\n\n JdcpUtil.initialize();\n\n Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n EmbeddedDataSource ds = new EmbeddedDataSource();\n ds.setConnectionAttributes(\"create=true\");\n ds.setDatabaseName(\"classes\");\n\n System.err...
[ "@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 text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Retrieve all yaml files from a directory. @param string $directory The directory to scan @return array @throws FileSystemException
[ "protected function retrieveFiles(string $directory): array\n {\n $files = [];\n\n foreach (scandir($directory) as $file) {\n $elem = $this->pathHelper->join($directory, $file);\n\n if (\n $elem != '.' &&\n $elem != '..' &&\n \\is_f...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Reasons on normalization, invokes hierarchy API and prepares calc for saving NB: this is the PUBLIC method @returns tilde_obj, error
[ "def classify(self, calc, symprec=None):\n '''\n \n '''\n error = None\n symbols = calc.structures[-1].get_chemical_symbols()\n calc.info['formula'] = self.formula(symbols)\n calc.info['cellpar'] = cell_to_cellpar(calc.structures[-1].cell).tolist()\n if calc.i...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Prefer importing modules from local node_modules (for NPX and global bin)
[ "async function _import(modulePath) {\n let m\n for (const mp of [ path.resolve(localNodeModules, modulePath), modulePath ]) {\n try {\n m = await import(mp)\n } catch (e) {\n /* istanbul ignore next */\n if (e.code !== 'MODULE_NOT_FOUND') {\n throw e\n } else if (mp === modulePat...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Start ZAP authentication
[ "def start(self):\n \"\"\"\"\"\"\n super().start()\n self.__poller = zmq.asyncio.Poller()\n self.__poller.register(self.zap_socket, zmq.POLLIN)\n self.__task = asyncio.ensure_future(self.__handle_zap())" ]
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
configure @param array $options
[ "protected function configure(array $options)\n {\n foreach ($options as $key => $value) {\n switch (strtolower($key)) {\n case 'arguments':\n $this->setArguments($value);\n break;\n case 'cache':\n $this->se...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Saves the direction of the slope to a file
[ "def save_direction(self, rootpath, raw=False, as_int=False):\n \n self.save_array(self.direction, None, 'ang', rootpath, raw, as_int=as_int)" ]
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param BlockOwnerInterface $owner @param string $type @param integer $parentId @param integer $placeholder @param array $sort @param null|array $data @throws \Exception @return BlockInterface
[ "public function createBlock($owner, $type, $parentId, $placeholder, $sort, $data = null, $draft = true)\n {\n /** @var AbstractBlockService $service */\n $service = $this->getService($type);\n $parent = $parentId ? $this->find($parentId, $draft) : null;\n\n // This should replaced wi...
[ "protected function createNodeLocked(LockNode $command, Pbjx $pbjx): NodeLocked\n {\n /** @var NodeLocked $event */\n $event = $this->createEventFromCommand($command, 'locked');\n return $event;\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns the hypervisor running on this host, and assumes a 1-1 between host and hypervisor
[ "def get_local_hypervisor(self):\n \n # Look up hypervisors available filtered by my hostname\n host = self.get_my_hostname()\n hyp = self.get_all_hypervisor_ids(filter_by_host=host)\n if hyp:\n return hyp[0]" ]
[ "def initrd(self, initrd):\n \n\n initrd = self.manager.get_abs_image_path(initrd)\n\n log.info('QEMU VM \"{name}\" [{id}] has set the QEMU initrd path to {initrd}'.format(name=self._name,\n id=self._id,\n...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Start tasks provided from the command line @name startRequested @access internal @return bool started
[ "function startRequested() {\n\t\tvar start = [];\n\n\t\tif (run.length) {\n\t\t\trun.forEach(function(task) {\n\t\t\t\tvar exists = task.replace(/:.*$/, '') in definitions.task;\n\n\t\t\t\tconsole.log(\n\t\t\t\t\t'Task %s %s',\n\t\t\t\t\texists ? chalk.green(task) : chalk.red(task),\n\t\t\t\t\texists ? 'running' :...
[ "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 text about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code about Software development:" }
Performs full language data validation @param array $submitted @param array $options @return array|boolean
[ "public function language(array &$submitted, array $options = array())\n {\n $this->options = $options;\n $this->submitted = &$submitted;\n\n $this->validateLanguage();\n $this->validateWeight();\n $this->validateBool('status');\n $this->validateBool('default');\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:" }
Start your pulling live session by live session id. @param request The request object containing all parameters for starting pulling live session. @return the response
[ "public StartPullSessionResponse startPullSession(StartPullSessionRequest request) {\n checkNotNull(request, \"The parameter request should NOT be null.\");\n checkStringNotEmpty(request.getSessionId(), \"The parameter sessionId should NOT be null or empty string.\");\n InternalRequest internal...
[ "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 Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Renders the field holder for the receiver. @param array $properties @return DBHTMLText
[ "public function FieldHolder($properties = [])\n {\n return FieldGroup::create(\n $this->Title(),\n $this->Fields\n )->addExtraClass('dimensions')->FieldHolder($properties);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Rewrite will alter the request EDNS0 subnet option
[ "func (rule *edns0SubnetRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {\n\tresult := RewriteIgnored\n\to := setupEdns0Opt(r)\n\tfound := false\n\tfor _, s := range o.Option {\n\t\tswitch e := s.(type) {\n\t\tcase *dns.EDNS0_SUBNET:\n\t\t\tif rule.action == Replace || rule.action == Set {\n\t\t\t\tif rule.f...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the index of a given entry, raising an IndexError if it's not present. `key` can be an iterable of entries that is not a string, in which case this returns a list of indices.
[ "def index(self, key):\n \n if is_iterable(key):\n return [self.index(subkey) for subkey in key]\n return self.map[key]" ]
[ "def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Builds an AudioPlayer Directive's audioItem and updates current_stream
[ "def _audio_item(self, stream_url=None, offset=0, push_buffer=True, opaque_token=None):\n \"\"\"\"\"\"\n audio_item = {'stream': {}}\n stream = audio_item['stream']\n\n # existing stream\n if not stream_url:\n # stream.update(current_stream.__dict__)\n stream...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
getter for projective - gets The dependency relations can be projective or not, C @generated @return value of the feature
[ "public boolean getProjective() {\n if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_projective == null)\n jcasType.jcas.throwFeatMissing(\"projective\", \"de.julielab.jules.types.DependencyRelation\");\n return jcasType.ll_cas.ll_getBooleanValue(addr, ((DependencyRela...
[ "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:" }
// NewTreeModule is like NewTree except it parses the configuration in // the directory and gives it a specific name. Use a blank name "" to specify // the root module.
[ "func NewTreeModule(name, dir string) (*Tree, error) {\n\tc, err := config.LoadDir(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn NewTree(name, c), nil\n}" ]
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Returns a simple jar manifest.
[ "private static Manifest standardSoyJarManifest() {\n Manifest mf = new Manifest();\n mf.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, \"1.0\");\n mf.getMainAttributes().put(new Attributes.Name(\"Created-By\"), \"soy\");\n return mf;\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Determines if a given GlobalID is correct, i.e. if it is derived by the specified $key and $salt. @param $key the publicKey @param $salt the salt @param $gid the GlobalID to check @return true if the $gid is correct, else false
[ "public static function verifyGID($key, $salt, $gid)\n\t{\n\t\tif(self::createGID($key, $salt) == $gid)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}" ]
[ "public function getPropertyValue($propertyName, $objectId = null)\n {\n\n //You can return this protected properties as objects too.\n if (in_array($propertyName, array(\"objectId\", \"objectType\", \"objectURI\")) && isset($this->$propertyName)) {\n return $this->$propertyName;\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:" }
@param string $fileFullPath @param string $localeDir @param string $messageFile @return ResourceBundleInterface
[ "protected function loadBundleFromFile(\n string $fileFullPath,\n string $localeDir,\n string $messageFile\n ): ResourceBundleInterface {\n /** @noinspection PhpIncludeInspection */\n $properties = require $fileFullPath;\n $bundle = new ResourceBundle($localeDir, $me...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
Get the first item from the collection. @param \Closure $callback @param mixed $default @return mixed|null
[ "public function first(Closure $callback = null, $default = null)\n {\n return count($this->items) > 0 ? reset($this->items) : null;\n }" ]
[ "protected function stringOrCallback($content)\n {\n if( is_scalar($content) )\n {\n return $content;\n }\n elseif( is_callable($content) )\n {\n return Buffering\\Callback::do($content);\n }\n\n throw new Exception\\InvalidArgumentException(...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// ServeHTTP implements the http.Handler interface by delegating to the // underlying httprouter.Router
[ "func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\ts.router.ServeHTTP(w, req)\n}" ]
[ "func WithNamespace(ctx context.Context, namespace string) context.Context {\n\tctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace\n\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withGRPCNamespaceHeader(ctx, namespace)...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about consul address:" }
/* (non-Javadoc) @see com.impetus.client.cassandra.CassandraClientBase#execute(java.lang.String , java.lang.Object)
[ "@Override\n public <T> T execute(final String query, Object connection) {\n\n Session session = factory.getConnection();\n try {\n Statement queryStmt = new SimpleStatement(query);\n KunderaCoreUtils.printQuery(query, showQuery);\n queryStmt.setConsistencyLevel(Con...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }