query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Обновить размеры текущего изображения | [
"protected function updateDimensions()\n {\n $this->width = $this->image ? imagesx($this->image) : null;\n $this->height = $this->image ? imagesy($this->image) : null;\n\n return $this;\n }"
] | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Validate the uniqueness of the given username
@api private
@param {String} value - The username to check for uniqueness
@param {Function} respond - The callback function | [
"function validateUniqueName(value, respond) {\n // jshint validthis: true\n var self = this;\n\n // check for uniqueness of user name\n this.constructor.findOne({name: value}, function (err, user) {\n if (err) {\n throw err;\n }\n\n if (user) {\n // the searched name is my name or a duplicat... | [
"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 comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Render the picked up itemStack at the cursor position.
@param itemStack the item stack | [
"public boolean renderPickedItemStack(ItemStack itemStack)\n\t{\n\t\tif (itemStack == null || itemStack == ItemStack.EMPTY)\n\t\t\treturn false;\n\n\t\tint size = itemStack.getCount();\n\t\tString label = null;\n\t\tif (size == 0)\n\t\t{\n\t\t\titemStack.setCount(size != 0 ? size : 1);\n\t\t\tlabel = TextFormatting... | [
"def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Attempts to dispatch an event
@param Subscription $subscription
@param Event $event
@return boolean True if dispatch was successful, false otherwise | [
"private function tryDispatch(Subscription $subscription, Event $event)\n {\n $dispatched = false;\n\n try {\n $dispatched = $this->doDispatch($subscription, $event);\n } catch (\\Exception $ex) {\n if (! $this->silent) {\n thr... | [
"public function setThrowable(\\Throwable $throwable) : Event\n {\n // Setting the Exception after it's already been handled makes no sense. This might potentially lead to\n // confusion in the future as we are not throwing an Exception on our own for this in order not to mess\n // up things... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Imports a given literal.
@param lit the literal | [
"protected void importLit(final int lit) {\n final int idx = Math.abs(lit);\n assert lit != 0;\n int newIdx;\n while (idx >= (newIdx = this.vars.size())) {\n this.vars.push(new CLVar());\n this.vals.push((byte) 0);\n this.phases.push((byte) 1);\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:"
} |
// NewBitcoindFilteredChainView creates a new instance of a FilteredChainView
// from RPC credentials and a ZMQ socket address for a bitcoind instance. | [
"func NewBitcoindFilteredChainView(\n\tchainConn *chain.BitcoindConn) *BitcoindFilteredChainView {\n\n\tchainView := &BitcoindFilteredChainView{\n\t\tchainFilter: make(map[wire.OutPoint]struct{}),\n\t\tfilterUpdates: make(chan filterUpdate),\n\t\tfilterBlockReqs: make(chan *filterBlockReq),\n\t\tquit: ... | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Copy all of the bytes from the input stream to the output stream.
@param input Stream to read bytes from.
@param output Stream to write bytes to.
@return The total number of bytes copied.
@throws IOException Failed to copy bytes. | [
"public static long copy(final InputStream input,\n final OutputStream output)\n throws IOException {\n return copy(input, output, DEFAULT_BUFFER_SIZE);\n }"
] | [
"function spawnPrng() {\n var ctx = forge.prng.create(prng_aes);\n\n /**\n * Gets random bytes. If a native secure crypto API is unavailable, this\n * method tries to make the bytes more unpredictable by drawing from data that\n * can be collected from the user of the browser, eg: mouse movement.\n *\n ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Find a model by its primary key or throw an exception.
@param mixed $id
@param array $columns
@return \Fly\Database\ActiveRecord\Model|Collection|static
@throws ModelNotFoundException | [
"public static function findOrFail($id, $columns = array('*'))\n\t{\n\t\tif ( ! is_null($model = static::find($id, $columns))) return $model;\n\n\t\tthrow new ModelNotFoundException(get_called_class().' model not found');\n\t}"
] | [
"public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\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 the last metric recorded. | [
"func (mvl *MetricsList) Last() *MetricValue {\n\tif len(mvl.data) > 0 {\n\t\tmvl.Sort()\n\t\treturn mvl.data[len(mvl.data)-1]\n\t}\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
-------------------------- | [
"public function tag_add($tag, $key)\n {\n if ($this->stopwatch) {\n $e = $this->getStopwatchEvent('tag_add');\n }\n\n $result = parent::tag_add($tag, $key);\n\n if ($this->stopwatch) {\n $e->stop();\n }\n\n return $result;\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the sentence about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code:"
} |
Returns a dict to communicate with the server
:param restrict_keys: a set of keys to restrict the returned data to
:rtype: dict | [
"def to_api_data(self, restrict_keys=None):\n \n cc = self._cc # alias\n data = {\n cc('column_hidden'): self._column_hidden,\n cc('row_hidden'): self._row_hidden,\n cc('formulas'): self._formulas,\n cc('formulas_local'): self._formulas_local,\n ... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the description about AWS Route 53:",
"pos": "Represent the code about AWS Route 53:",
"neg": "Represent the code:"
} |
Need this to be synchronous so we're assured of a valid value | [
"function (xData) {\n $(xData.responseXML).find(\"List\").each(function () {\n listXml = $(this);\n\n // If listName has been specified, then only return results for that list\n if ((opt.listName.length === 0) || (listXml.attr(\... | [
"func (rl *resignLeadership) Execute(state State) (*State, error) {\n\t// TODO(fwereade): this hits a lot of interestingly intersecting problems.\n\t//\n\t// 1) we can't yet create a sufficiently dumbed-down hook context for a\n\t// leader-deposed hook to run as specced. (This is the proximate issue,\n\t// an... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param Request $request
@return JsonResponse
@throws \Exception
@Route("/identities", name="accesscontrol_identities") | [
"public function identitiesAction(Request $request)\n {\n $objectType = $request->get('objectType');\n $objectId = $request->get('objectId', null);\n\n $objectIdentityResolver = $this->get('phlexible_access_control.object_identity_resolver');\n $objectIdentity = $objectIdentityResolve... | [
"public function callbackSubmit()\n {\n $id = $this->form->value(\"id\");\n $this->di->get(\"userService\")->deleteUser($id);\n $this->di->get(\"utils\")->redirect(\"admin\");\n }"
] | codesearchnet | {
"query": "Represent the comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about NLP:"
} |
Returns an HTML table containing data on each corpus' n-grams. | [
"def _generate_corpus_table(self, labels, ngrams):\n \"\"\"\"\"\"\n html = []\n for label in labels:\n html.append(self._render_corpus_row(label, ngrams))\n return '\\n'.join(html)"
] | [
"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 description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
For a grouped AVP, returns all AVPs it contains with this name.
@param [String] name The AVP name
@return [Array<AVP>] | [
"def inner_avps(name)\n code, _type, _vendor = AVPNames.get(name)\n\n grouped_value.select { |a| a.code == code }\n end"
] | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the text about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
Calculates assignment cost between two cells taking into account the movement of cells neighbours.
:param CellFeatures d1: detection in first frame
:param CellFeatures d2: detection in second frame | [
"def calculate_localised_cost(self, d1, d2, neighbours, motions):\n \n my_nbrs_with_motion = [n for n in neighbours[d1] if n in motions]\n\n my_motion = (d1.center[0] - d2.center[0], d1.center[1] - d2.center[1])\n\n if my_nbrs_with_motion == []:\n distance = euclidean_dist(d1.... | [
"def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Construct base string on which the slug will be based.
@param Array $baseFields Basefield configuration (per field)
@param Array $data Submitted data
@return String | [
"protected function _getBaseString($baseField, $data) {\n $type = $baseField['type'];\n $method = '_getBaseStringFrom' . ucfirst($type);\n return $this->{$method}($data, $baseField);\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Retrieves the path using the endpoint value
@param pathValue - path (endpoint) value
@param requestType - "GET", "POST", etc
@return Path or null
@throws Exception exception | [
"public JSONObject getPathFromEndpoint(String pathValue, String requestType) throws Exception {\n int type = getRequestTypeFromString(requestType);\n String url = BASE_PATH;\n JSONObject response = new JSONObject(doGet(url, null));\n JSONArray paths = response.getJSONArray(\"paths\");\n ... | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Parser(a, None)
Throws an exception if any tokens are left in the input unparsed. | [
"def finished(tokens, s):\n \n if s.pos >= len(tokens):\n return None, s\n else:\n raise NoParseError(u'should have reached <EOF>', s)"
] | [
"def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Dispatches incoming SASL responses to the appropriate handler methods.
@param ctx the handler context.
@param msg the incoming message to investigate.
@throws Exception if something goes wrong during negotiation. | [
"@Override\n protected void channelRead0(ChannelHandlerContext ctx, FullBinaryMemcacheResponse msg) throws Exception {\n if (msg.getOpcode() == SASL_LIST_MECHS_OPCODE) {\n handleListMechsResponse(ctx, msg);\n } else if (msg.getOpcode() == SASL_AUTH_OPCODE) {\n handleAuthRespon... | [
"@Override\n protected int runTask(long ssl) {\n try {\n callback.handle(ssl, keyTypeBytes, asn1DerEncodedPrincipals);\n return 1;\n } catch (Exception e) {\n // Just catch the exception and return 0 to fail the handshake.\n // The problem is that rethrow... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// bytes estimates the memory footprint of this logTagValue, in bytes. | [
"func (tv *logTagValue) bytes() int {\n\tvar b int\n\tb += len(tv.name)\n\tb += int(unsafe.Sizeof(*tv))\n\tb += (int(tv.cardinality()) * 8)\n\treturn b\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 Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// teeSSH runs an SSH command, streaming stdout, stderr to logs | [
"func teeSSH(s *ssh.Session, cmd string, outB io.Writer, errB io.Writer) error {\n\toutPipe, err := s.StdoutPipe()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stdout\")\n\t}\n\n\terrPipe, err := s.StderrPipe()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stderr\")\n\t}\n\tvar wg sync.WaitGroup\n\twg.Add(... | [
"def work_on_machine(context):\n \n print(\"Created context. Context ID is\", context.context_id)\n\n # You don't need to understand any/all of this, but it's helpful to grok\n # the whole chain:\n\n # - Context.call() is a light wrapper around .call_async(), the wrapper\n # simply blocks the ca... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Makes a brush compatible with the `html-script` functionality.
@param {Object} regexGroup Object containing `left` and `right` regular expressions. | [
"function(regexGroup)\n {\n var regex = { 'end' : regexGroup.right.source };\n\n if(regexGroup.eof)\n regex.end = \"(?:(?:\" + regex.end + \")|$)\";\n\n this.htmlScript = {\n left : { regex: regexGroup.left, css: 'script' },\n righ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Finds Location shifted left by 1
:rtype: Location | [
"def shift_left(self, times=1):\n \n try:\n return Location(self._rank, self._file - times)\n except IndexError as e:\n raise IndexError(e)"
] | [
"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 text about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
构建表单 textarea element
@param $ele
@return string | [
"private function buildTextarea($ele) {\n\n $formNs = $this->formNs;\n\n if ($ele['editor'] == true){\n $textareaClass = $formNs.'form-editor '.$formNs.'form-textarea '.$formNs.'textarea-'.$ele['name'];\n }else {\n $textareaClass = $formNs.'form-textarea '.$formNs.'textare... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Fired when Queue is declared
@param e | [
"private void fireOnDeclareQueue(ChannelEvent e) {\n List<EventListener> listeners = changes.getListenerList(AMQP);\n for (EventListener listener : listeners) {\n ChannelListener amqpListener = (ChannelListener)listener;\n amqpListener.onDeclareQueue(e);\n }\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
直接注册为默认mapping
@param src
@param dest | [
"public void register(Class src, Class target) {\n List<BeanMappingObject> objects = BeanMappingParser.parseMapping(src, target);\n for (BeanMappingObject object : objects) {\n register(object);\n }\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
@return mixed | [
"public function handle($request, Closure $next)\n {\n $this->authenticate($request);\n\n $response = $next($request);\n\n // Send the refreshed token back to the client.\n return $this->setAuthenticationHeader($response);\n }"
] | [
"protected function boot(): void\n {\n // boot extensions\n foreach ($this->extensionManager->getExtensions() as $extension) {\n if ($extension->isActivated()) {\n $extension->boot();\n }\n }\n\n // boot app\n $this->dispatch(new RoutesWillB... | codesearchnet | {
"query": "Represent the Github sentence about Symfony:",
"pos": "Represent the Github code about Symfony:",
"neg": "Represent the Github code about Software development:"
} |
Generation of the message to send to Sphinx to update attributes of a
document. | [
"def update_message(index, attributes, values_by_doc)\n message = Message.new\n\n message.append_string index\n message.append_array attributes\n\n message.append_int values_by_doc.length\n values_by_doc.each do |key,values|\n message.append_64bit_int key # document ID\n messa... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
{@inheritdoc}
@see FileInterface::rename() | [
"public function rename(string $path): bool\n {\n if ($this->exists() && !@rename($this->filepath, $path)) {\n return false;\n }\n\n $this->setFilepath($path);\n\n return true;\n }"
] | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Size returns the size of the cache. | [
"func (cache *HealthStatusCache) Size() int {\n\tcache.mu.Lock()\n\tdefer cache.mu.Unlock()\n\treturn len(cache.data)\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Converts an iterator of rows into a single ColumnBatch. | [
"public static ColumnarBatch toBatch(\n StructType schema, MemoryMode memMode, Iterator<Row> row) {\n int capacity = 4 * 1024;\n WritableColumnVector[] columnVectors;\n if (memMode == MemoryMode.OFF_HEAP) {\n columnVectors = OffHeapColumnVector.allocateColumns(capacity, schema);\n } else {\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Map Route
@param array $methods
@param string $pattern
@param $callable
@return RouteInterface | [
"public function map(array $methods, string $pattern, $callable) : RouteInterface\n {\n $route = $this->getRouter()->map($methods, $pattern, $callable);\n\n return $route;\n }"
] | [
"static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Treat consecutive packets as if they are a discontinuous buffer.
The default behavior.
@see self::enableContinuousBuffer()
@access public
@internal Could, but not must, extend by the child Crypt_* class | [
"function disableContinuousBuffer()\r\n {\r\n if ($this->mode == CRYPT_MODE_ECB) {\r\n return;\r\n }\r\n if (!$this->continuousBuffer) {\r\n return;\r\n }\r\n\r\n $this->continuousBuffer = false;\r\n $this->changed = true;\r\n\r\n $this->_set... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns component_id with seperate entries from every page in tree
@example
root
|-1
|-2
|-3
componentId: 3, expandedComponentId: root-1_2_3
@return string | [
"public function getExpandedComponentId()\n {\n if ($this->_expandedComponentIdCache) {\n return $this->_expandedComponentIdCache;\n }\n $generator = $this->generator;\n if ($generator instanceof Kwc_Root_Category_Generator) {\n $separator = '_';\n } else ... | [
"function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |... | codesearchnet | {
"query": "Represent the Github sentence about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about programming:"
} |
値がnullでないかどうか検証する。
@param arg 検証対象の値
@param name 検証対象の引数の名前
@throws NullPointerException {@literal arg == null.} | [
"public static void notNull(final Object arg, final String name) {\r\n if(arg == null) {\r\n throw new NullPointerException(String.format(\"%s should not be null.\", name));\r\n }\r\n }"
] | [
"public function setMetadata(array $metadata)\n {\n $this->metadata = $this->validator->parseMetadata(array_filter($metadata, function ($field): bool {\n // 文字列型以外の (明らかに構文解析済みである) フィールドは構文解析器にかけない\n return is_string($field);\n })) + $metadata;\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get update time.
@return string timestamp | [
"public function getUpdatedAt()\n {\n $updatedAtAttribute = $this->updatedAtAttribute;\n if (!is_string($updatedAtAttribute) || empty($updatedAtAttribute)) {\n return null;\n }\n return $this->$updatedAtAttribute;\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
region StreamSegmentStore Implementation | [
"@Override\n public CompletableFuture<Void> append(String streamSegmentName, byte[] data, Collection<AttributeUpdate> attributeUpdates, Duration timeout) {\n ensureRunning();\n\n TimeoutTimer timer = new TimeoutTimer(timeout);\n logRequest(\"append\", streamSegmentName, data.length);\n ... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Restore restores the settings from State. | [
"func Restore(fd int, st State) error {\n\tif err := sys.Setattr(fd, sys.TCSANOW, &st.wrap); err != nil {\n\t\treturn os.NewSyscallError(\"sys.Setattr\", err)\n\t}\n\treturn nil\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0
@param float_img_buff: ROS Image to translate
@type img: ros image
@return a Opencv RGB image | [
"def depthToRGB8(float_img_buff, encoding):\n '''\n \n\n '''\n gray_image = None\n if (encoding[-3:-2]== \"U\"):\n gray_image = float_img_buff\n else: \n float_img = np.zeros((float_img_buff.shape[0], float_img_buff.shape[1], 1), dtype = \"float32\")\n float_img.data = floa... | [
"def :\n \"\"\"\"\"\"\n\n if not self.colorspace or self.colorspace.n > 3:\n print(\"warning: colorspace invalid for function\")\n return\n\n return _fitz.Pixmap_"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Include the configuration file used to setup the peridot
environment
@param $configuration
@return bool | [
"protected function includeConfiguration($configuration)\n {\n if (file_exists($configuration)) {\n $callable = include $configuration;\n if (is_callable($callable)) {\n call_user_func($callable, $this->eventEmitter);\n }\n }\n\n return true;\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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// Log will send any error log lines up to Yeller. | [
"func (s *Sink) Log(line lager.LogFormat) {\n\tif line.LogLevel < lager.ERROR {\n\t\treturn\n\t}\n\n\tif errStr, ok := line.Data[\"error\"].(string); ok {\n\t\tdelete(line.Data, \"message\")\n\t\tdelete(line.Data, \"error\")\n\n\t\ts.yeller.Notify(\n\t\t\tline.Message,\n\t\t\terrors.New(errStr),\n\t\t\tline.Data,\n... | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Getter for history.
@author Benjamin Carl <opensource@clickalicious.de>
@return string The value if set, otherwise NULL
@access protected | [
"protected function getHistory($key = null)\n {\n return (true === isset($this->history[$key])) ? $this->history[$key] : null;\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 Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Returns the failure reason for the provided fileUploadId or an empty
string but never <code>null</code>.
@param fileUploadId
@return the failure reason or an empty String. | [
"private String getFailureReason(final FileUploadId fileUploadId) {\n String failureReason = \"\";\n if (artifactUploadState.getFileUploadProgress(fileUploadId) != null) {\n failureReason = artifactUploadState.getFileUploadProgress(fileUploadId).getFailureReason();\n }\n if (S... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Return a random number expression with the given seed
@param seed seed
@return random(seed) | [
"public static NumberExpression<Double> random(int seed) {\n return Expressions.numberOperation(Double.class, MathOps.RANDOM2, ConstantImpl.create(seed));\n }"
] | [
"def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
// New returns a worker that will keep an up-to-date audit log config. | [
"func New(source ConfigSource, initial auditlog.Config, logFactory AuditLogFactory) (worker.Worker, error) {\n\tu := &updater{\n\t\tsource: source,\n\t\tcurrent: initial,\n\t\tlogFactory: logFactory,\n\t}\n\terr := catacomb.Invoke(catacomb.Plan{\n\t\tSite: &u.catacomb,\n\t\tWork: u.loop,\n\t})\n\tif err != n... | [
"function _prepSnapshot() {\n var config = this.constructor.config,\n copy = (config.snapshotSerializer || config.serializer).serialize(this);\n\n // we don't want to store our snapshots in the snapshots because that would make the rollback kind of funny\n // not to m... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// This is for internal access to the raw data bytes from the C cursor, use
// carefully, or not at all. | [
"func (db *DB) Info() *Info {\n\treturn &Info{uintptr(unsafe.Pointer(&db.data[0])), db.pageSize}\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// MonthNarrow returns the locales narrow month given the 'month' provided | [
"func (bez *bez) MonthNarrow(month time.Month) string {\n\treturn bez.monthsNarrow[month]\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:"
} |
Connects to the manager. | [
"def _connect(self):\n \"\"\"\"\"\"\n cls = self._get_manager_class(register_callables=False)\n ins = cls(address=self.addr, authkey=self.authkey)\n ins.connect()\n return ins"
] | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Serve servers service on started listener | [
"func (s *Server) Serve(l net.Listener) error {\n\tif len(s.getCommandLabels()) > 0 {\n\t\ts.updateLabels()\n\t}\n\tgo s.heartbeat.Run()\n\treturn s.srv.Serve(l)\n}"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// OutputXML returns the text that including tags name. | [
"func (n *Node) OutputXML(self bool) string {\n\tvar buf bytes.Buffer\n\tif self {\n\t\toutputXML(&buf, n)\n\t} else {\n\t\tfor n := n.FirstChild; n != nil; n = n.NextSibling {\n\t\t\toutputXML(&buf, n)\n\t\t}\n\t}\n\n\treturn buf.String()\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// bundlePath returns the path to the location where the verified charm
// bundle identified by info will be, or has been, saved. | [
"func (d *BundlesDir) bundlePath(info BundleInfo) string {\n\treturn d.bundleURLPath(info.URL())\n}"
] | [
"def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Decodes a string representation of a UUID into a UuidInterface object instance
@param string $encodedUuid
@return UuidInterface
@throws \Ramsey\Uuid\Exception\InvalidUuidStringException | [
"public function decode($encodedUuid)\n {\n $components = $this->extractComponents($encodedUuid);\n $fields = $this->getFields($components);\n\n return $this->builder->build($this, $fields);\n }"
] | [
"public static function toByteString($value)\n {\n if (self::isStringCastable($value)) {\n return (string)$value;\n } else {\n throw new \\InvalidArgumentException(ErrorMessageCreator::create($value, 'ByteString (a string)'));\n }\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:"
} |
// isTypeName returns true iff x is a (qualified) TypeName. | [
"func isTypeName(x ast.Expr) bool {\n\tswitch t := x.(type) {\n\tcase *ast.BadExpr:\n\tcase *ast.Ident:\n\tcase *ast.SelectorExpr:\n\t\t_, isIdent := t.X.(*ast.Ident)\n\t\treturn isIdent\n\tdefault:\n\t\treturn false // all other nodes are not type names\n\t}\n\treturn true\n}"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
If current content is assigned to category returns its object
@return oxcontent | [
"public function getContentCategory()\n {\n if ($this->_oContentCat === null) {\n // setting default status ..\n $this->_oContentCat = false;\n if (($oContent = $this->getContent()) && $oContent->oxcontents__oxtype->value == 2) {\n $this->_oContentCat = $oCo... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Programming Interface for NVM
- Supports:
- creationix/nvm for Linux and OS X
https://github.com/creationix/nvm
- coreybutler/nvm-windows for Windows
https://github.com/coreybutler/nvm-windows
@method NvmApi | [
"function NvmApi () {\n\tvar self = this;\n\n\tObject.defineProperty(this, \"initialized\", {\n\t\t\"value\": false,\n\t\t\"enumerable\": false,\n\t\t\"writable\": true\n\t});\n\n\tObject.defineProperty(this, \"__data\", {\n\t\t\"value\": {},\n\t\t\"enumerable\": false,\n\t\t\"writable\": true\n\t});\n\n\t// Get da... | [
"def i3():\n ''''''\n install_package('i3')\n install_file_legacy(path='~/.i3/config', username=env.user, repos_dir='repos')\n\n # setup: hide the mouse if not in use\n # in ~/.i3/config: 'exec /home/<USERNAME>/repos/hhpc/hhpc -i 10 &'\n install_packages(['make', 'pkg-config', 'gcc', 'libc6-dev', ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Add multiple value arguments.
@param values must not be {@literal null}.
@return the command args. | [
"public CommandArgs<K, V> addValues(Iterable<V> values) {\n\n LettuceAssert.notNull(values, \"Values must not be null\");\n\n for (V value : values) {\n addValue(value);\n }\n return this;\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Extract presence information from a TunnelAttrs mask | [
"func (ta TunnelAttrs) present() TunnelAttrsPresence {\n\t// The kernel requires Ipv4Dst and Ttl to be present, so we\n\t// always mark those as present, even if we end up wildcarding\n\t// them.\n\treturn TunnelAttrsPresence{\n\t\tTunnelId: !AllBytes(ta.TunnelId[:], 0),\n\t\tIpv4Src: !AllBytes(ta.Ipv4Src[:], 0),\... | [
"@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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// MarshalJSON supports json.Marshaler interface | [
"func (v Storage) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}"
] | [
"func (ev *ChangeWatchResp) GetValue(val proto.Message) error {\n\treturn json.Unmarshal(ev.message.Content, val) //TODO use contentType...\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Will attempt to re-open stream in the event that it was closed unexpectedly. Will use default if unable to
re-open custom
@see DefaultLogger::defaultStream() | [
"protected function attemptStreamRecovery()\n {\n if ('resource' === gettype($this->stream))\n {\n @fflush($this->stream);\n @fclose($this->stream);\n }\n\n $this->stream = fopen($this->streamURI, $this->streamMode);\n if (false === $this->stream)\n ... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The unary operator to apply.
Generated from protobuf field <code>.google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1;</code>
@param int $var
@return $this | [
"public function setOp($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Firestore\\V1\\StructuredQuery_UnaryFilter_Operator::class);\n $this->op = $var;\n\n return $this;\n }"
] | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypes() {\n return getParamTypesMap();\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
If today is a day configured as an exception.
@return true if so.
@see #daysOfWeek | [
"public boolean isExceptionToday() {\n if (daysOfWeek != null && daysOfWeek.length > 0) {\n int dayOfWeekNow = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);\n for (int exceptionDay : daysOfWeek) {\n if (exceptionDay == dayOfWeekNow) {\n return true;... | [
"public Any execute(DeviceImpl device,Any in_any) throws DevFailed\n\t{\n\t\tUtil.out4.println(\"GetTraceLevelCmd.execute(): arrived\");\n\n String desc = \"GetTraceLevel is no more supported, please use GetLoggingLevel\";\n Except.throw_exception(\"API_DeprecatedCommand\", desc, \"GetTraceLevelCmd::execute\"... | codesearchnet | {
"query": "Represent the Github post about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about language and writing:"
} |
[VARIABLE "my_dataset"] | [
"public Sink updateSinkAsync(String sinkName, String datasetName)\n throws ExecutionException, InterruptedException {\n // [START updateSinkAsync]\n SinkInfo sinkInfo =\n SinkInfo.newBuilder(sinkName, DatasetDestination.of(datasetName))\n .setVersionFormat(SinkInfo.VersionFormat.V2)\n ... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Derived Features | [
"function() {\n if (!this._eAllSuperTypes) {\n var compute = function(eClass) {\n var superTypes = eClass.get('eSuperTypes').array(),\n eAllSuperTypes = _.flatten(_.map(superTypes, function(s) {\n return s.get('eAllSuperTypes');\n ... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetFileVersion sets the FileVersion field's value. | [
"func (s *OTAUpdateFile) SetFileVersion(v string) *OTAUpdateFile {\n\ts.FileVersion = &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 Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
{@inheritdoc}
@throws \BEAR\Resource\Exception\ParameterException | [
"public function handle(\\ReflectionParameter $parameter)\n {\n $func = $parameter->getDeclaringFunction();\n $method = new \\ReflectionMethod($parameter->getDeclaringClass()->name, $func->name);\n $parameter->getDeclaringFunction()->name;\n $annotations = $this->reader->getMethodAnno... | [
"protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
<p>
An array of virtual tape descriptions.
</p>
@return An array of virtual tape descriptions. | [
"public java.util.List<Tape> getTapes() {\n if (tapes == null) {\n tapes = new com.amazonaws.internal.SdkInternalList<Tape>();\n }\n return tapes;\n }"
] | [
"function FileArray (schema) {\n var fileArray = [];\n\n /**\n * Internal stuff. Use at your own risk!\n *\n * @private\n */\n fileArray[__internal] = {\n /**\n * A reference to the {@link Schema} object\n */\n schema: schema,\n };\n\n // Return an array that \"inherits\" from FileArray\n... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
// This is the format used for the bytes protocol buffer
// type and for embedded messages. | [
"func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {\n\tn, err := p.DecodeVarint()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnb := int(n)\n\tif nb < 0 {\n\t\treturn nil, fmt.Errorf(\"proto: bad byte length %d\", nb)\n\t}\n\tend := p.index + nb\n\tif end < p.index || end > len(p.buf) {\n\t\... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Gets the list of options to render in this formfield
@return ArrayList | [
"public function getOptions()\n {\n // Loop through and figure out which values were selected.\n $options = array();\n $selectedValue = $this->getValueArray();\n foreach ($this->getSource() as $itemValue => $title) {\n $itemSelected = in_array($itemValue, $selectedValue)\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Closes the database connection. Close should be called on this object
when it is done being used. | [
"@Override\n public synchronized void close() {\n if (isOpen()) {\n clearCache();\n closeStatements();\n try {\n connection.close();\n } catch (SQLException ex) {\n LOGGER.error(\"There was an error attempting to close the CveDB, se... | [
"private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null | [
"public Object execute(final Object value, final CsvContext context) {\n\t\tif (value == null){\n\t\t\tthrow new SuperCsvConstraintViolationException(\"null value encountered\", context, this);\n\t\t}\n\t\treturn next.execute(value, context);\n\t}"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Documentation:"
} |
// SetLastSuccessfulSyncTime sets the LastSuccessfulSyncTime field's value. | [
"func (s *ResourceDataSyncItem) SetLastSuccessfulSyncTime(v time.Time) *ResourceDataSyncItem {\n\ts.LastSuccessfulSyncTime = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Schedule a job.
@param newSJE new job entry. | [
"private synchronized void schedule(final ScheduledJobEntry newSJE) {\n // disallow new jobs after shutdown\n if (shutdown) {\n return;\n }\n int max = jobList.size();\n long desiredExecutionTime = newSJE.desiredExecutionTime;\n\n // find the index i such that ti... | [
"@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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Initializes an instance of Custom Vision Prediction API client.
@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API client | [
"public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) {\n return new PredictionEndpointImpl(restClient).withApiKey(apiKey);\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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
<p>
The request omitted one or more required parameters.
</p>
@return The request omitted one or more required parameters. | [
"@com.fasterxml.jackson.annotation.JsonProperty(\"RequiredParameters\")\n public java.util.List<String> getRequiredParameters() {\n return requiredParameters;\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 post about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
An initializer function for random normal coefficients. | [
"def RandomNormalInitializer(stddev=1e-2):\n \"\"\"\"\"\"\n def init(shape, rng):\n return (stddev * backend.random.normal(rng, shape)).astype('float32')\n return init"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *PodDisruptionBudgetSpec) DeepCopyInto(out *PodDisruptionBudgetSpec) {\n\t*out = *in\n\tif in.MinAvailable != nil {\n\t\tin, out := &in.MinAvailable, &out.MinAvailable\n\t\t*out = new(intstr.IntOrString)\n\t\t**out = **in\n\t}\n\tif in.Selector != nil {\n\t\tin, out := &in.Selector, &out.Selector\n\t\t*ou... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
into a base class (the *Value() methods also share a lot of similarity). | [
"public IntegerSize getIntegerSize()\n {\n load_once();\n if (_value_type != IonType.INT || _v.isNull())\n {\n return null;\n }\n return _Private_ScalarConversions.getIntegerSize(_v.getAuthoritativeType());\n }"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Evaluate script in page frame.
:param script: The script to evaluate. | [
"def evaluate(self, script):\n \n if WEBENGINE:\n return self.dom.runJavaScript(\"{}\".format(script))\n else:\n return self.dom.evaluateJavaScript(\"{}\".format(script))"
] | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Execute the action.
@param ManialinkInterface $manialink
@param $login
@param $answerValues | [
"public function execute(ManialinkInterface $manialink, $login, $answerValues)\n {\n call_user_func_array($this->callable, [$manialink, $login, $answerValues, $this->args]);\n }"
] | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Applies the list of post processing methods if any | [
"def post_process(table, post_processors):\n \"\"\"\"\"\"\n table_result = table\n for processor in post_processors:\n table_result = processor(table_result)\n return table_result"
] | [
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets the keys of a Hashtable
@param table
a Hashtable
@return the keyset of a Hashtable (or an empty set if table is null) | [
"public static Set getKeySet(Hashtable table) {\n\t\treturn (table == null) ? Collections.EMPTY_SET : table.keySet();\n\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 post about Redis command documentation:",
"pos": "Represent the code about Redis command documentation:",
"neg": "Represent the code:"
} |
Link this Varying to another object from which it will derive its
dtype. This method is used internally when assigning an attribute to
a varying using syntax ``Function[varying] = attr``. | [
"def link(self, var):\n \n assert self._dtype is not None or hasattr(var, 'dtype')\n self._link = var\n self.changed()"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
A batch of requests has been created and has been applied but
committed to ledger and state.
:param ledger_id:
:param state_root: state root after the batch creation
:return: | [
"def onBatchCreated(self, three_pc_batch: ThreePcBatch):\n \n ledger_id = three_pc_batch.ledger_id\n if ledger_id == POOL_LEDGER_ID:\n if isinstance(self.poolManager, TxnPoolManager):\n self.get_req_handler(POOL_LEDGER_ID).onBatchCreated(three_pc_batch.state_root, thre... | [
"def reset(self):\n \n self.getsCounter = 0\n\n # dictionary of processed requests for each client. Value for each\n # client is a dictionary with request id as key and transaction id as\n # value\n self.processedRequests = {} # type: Dict[str, Dict[int, str]]\n\n #... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Gets a string description of {@code assignments} and their weights in
{@code this}.
@param assignments
@param includeZeros if {@code false}, zero weight assignments are omitted.
@return | [
"public String describeAssignments(List<Assignment> assignments, boolean includeZeros) {\n StringBuilder sb = new StringBuilder();\n for (Assignment assignment : assignments) {\n double unnormalizedProb = getUnnormalizedProbability(assignment);\n if (unnormalizedProb != 0.0 || includeZeros) {\n ... | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github text about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about programming:"
} |
Return an array of tag strings
@memberof UMLElementMixin
@return {Array.<string>} | [
"function () {\n var tagArray = [];\n if (this.tags && this.tags.length > 0) {\n var i, len, tag;\n for (i = 0, len = this.tags.length; i < len; i++) {\n tag = this.tags[i];\n switch (tag.kind) {\n case Core... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Export the given reflected constant definition to the provided parent element.
@param \DOMElement $parent Element to augment.
@param ConstantDescriptor $constant Element to export.
@return \DOMElement | [
"public function convert(\\DOMElement $parent, ConstantDescriptor $constant)\n {\n $fullyQualifiedNamespaceName = $constant->getNamespace() instanceof NamespaceDescriptor\n ? $constant->getNamespace()->getFullyQualifiedStructuralElementName()\n : $parent->getAttribute('namespace');\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns
-------
A tuple consisting of (max, min) of the index. | [
"def _max_min(self):\r\n \r\n dtbl = self.datatable\r\n\r\n objs = object_session(self)\r\n if isinstance(dtbl, Table):\r\n return objs.query(func.max(dtbl.c.indx).label(\"max_indx\"),\r\n func.min(dtbl.c.indx).label(\"min_indx\")).one()\r\n ... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
For each alignment block in the sequence `blocks`, chop out the portion
of the block that overlaps the interval [`start`,`end`) in the
component/species named `src`. | [
"def chop_list( blocks, src, start, end ):\n \n new_blocks = []\n for block in blocks: \n ref = block.get_component_by_src( src )\n # If the reference component is on the '-' strand we should complement the interval\n if ref.strand == '-':\n slice_start = max( ref.src_size -... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// BoolOmitEmpty adds a bool to be encoded, must be used inside a slice or array encoding (does not encode a key) | [
"func (enc *Encoder) BoolOmitEmpty(v bool) {\n\tif v == false {\n\t\treturn\n\t}\n\tenc.grow(5)\n\tr := enc.getPreviousRune()\n\tif r != '[' {\n\t\tenc.writeByte(',')\n\t}\n\tenc.writeString(\"true\")\n}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
decompress a tar.gz archive | [
"function untgz(istream, dst){\n // decompress\n const tarStream = istream.pipe(_zlib.createGunzip());\n\n // unpack\n return _untar(tarStream, dst);\n}"
] | [
"def set_regionfiles(self, filenames):\n \n for filename in filenames:\n # Assume that filenames have the name r.<x-digit>.<z-digit>.<extension>\n m = re.match(r\"r.(\\-?\\d+).(\\-?\\d+).\"+self.extension, os.path.basename(filename))\n if m:\n x = int(m.... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
differences : BEFORE !! et data et calcul
@param \Zend\EventManager\Event $e | [
"public function newsletterBefore(\\Zend\\EventManager\\Event $e)\n {\n $data = $e->getParam('data');\n $user = $e->getParam('user');\n \n $sm = $e->getTarget()->getServiceManager();\n $storyTellingService = $sm->get('playgroundflow_storytelling_service');\n /*\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Bulk adds multiple documents in bulk mode | [
"func (c *Connection) BulkSend(documents []Document) (*Response, error) {\n\t// We do not generate a traditional JSON here (often a one liner)\n\t// Elasticsearch expects one line of JSON per line (EOL = \\n)\n\t// plus an extra \\n at the very end of the document\n\t//\n\t// More informations about the Bulk JSON f... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Combines multiple DifferenceEvaluators so that the first one
that changes the outcome wins. | [
"public static DifferenceEvaluator\n first(final DifferenceEvaluator... evaluators) {\n return new DifferenceEvaluator() {\n @Override\n public ComparisonResult evaluate(Comparison comparison,\n ComparisonResult orig) {\n ... | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// CreateAccountMember invites a new member to join an account.
//
// API reference: https://api.cloudflare.com/#account-members-add-member | [
"func (api *API) CreateAccountMember(accountID string, emailAddress string, roles []string) (AccountMember, error) {\n\tif accountID == \"\" {\n\t\treturn AccountMember{}, errors.New(errMissingAccountID)\n\t}\n\n\turi := \"/accounts/\" + accountID + \"/members\"\n\n\tvar newMember = AccountMemberInvitation{\n\t\tEm... | [
"def authorize_proxy_routes\n deny_access unless (authenticate || authenticate_client)\n\n route, params = Engine.routes.router.recognize(request) do |rte, parameters|\n break rte, parameters if rte.name\n end\n\n # route names are defined in routes.rb (:as => :name)\n case route.nam... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Validate a command plugin, ensuring it is a command plugin and has the
necessary fields present.
`plugin` is a subclass of scruffy's Plugin class. | [
"def valid_command_plugin(self, plugin):\n \n if (issubclass(plugin, CommandPlugin) and\n hasattr(plugin, 'plugin_type') and plugin.plugin_type == 'command' and\n hasattr(plugin, 'name') and plugin.name != None):\n return True\n return False"
... | [
"def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Takes a reference to an attribute associative array and performs
all inclusions specified by the zero index.
@param array &$attr Reference to attribute array | [
"public function performInclusions(&$attr)\r\n {\r\n if (!isset($attr[0])) {\r\n return;\r\n }\r\n $merge = $attr[0];\r\n $seen = array(); // recursion guard\r\n // loop through all the inclusions\r\n for ($i = 0; isset($merge[$i]); $i++) {\r\n if ... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Start the StatsD reporter, if configured.
@throws URISyntaxException | [
"@PostConstruct\n public final void init() throws URISyntaxException {\n final String address = getConfig(ADDRESS, null);\n if (address != null) {\n final URI uri = new URI(\"udp://\" + address);\n final String prefix = getConfig(PREFIX, \"mapfish-print\").replace(\"%h\", getH... | [
"public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about N/A:"
} |
// SetProcessingConfiguration sets the ProcessingConfiguration field's value. | [
"func (s *SplunkDestinationDescription) SetProcessingConfiguration(v *ProcessingConfiguration) *SplunkDestinationDescription {\n\ts.ProcessingConfiguration = 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:"
} |
Returns the descendant variable with the given name path, relative to this variable. | [
"public IVarDef find( String... path)\n {\n return\n path == null || path.length == 0\n ? this\n : getDescendant( path);\n }"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.