query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Generate a sequence of filenames that match ``word``.
:param word: the word to complete | [
"def gen_filename_completions(self, word, filenames):\n \n if not word:\n return filenames\n else:\n trie = pygtrie.CharTrie()\n for filename in filenames:\n trie[filename] = filename\n return trie.iterkeys(prefix=word)"
] | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Sets key/values based on a mapping. Mapping can be supplied as a single
dictionary argument or as kwargs.
Cluster impl:
Itterate over all items and do SET on each (k,v) pair
Operation is no longer atomic. | [
"async def mset(self, *args, **kwargs):\n \n if args:\n if len(args) != 1 or not isinstance(args[0], dict):\n raise RedisError('MSET requires **kwargs or a single dict arg')\n kwargs.update(args[0])\n\n for pair in iteritems(kwargs):\n await self.... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Load the data in memory.
Args:
dataset: string in ['train', 'test'] | [
"def _load(self, dataset='train'):\n \n data, labels = None, None\n if dataset is 'train':\n files = [os.path.join(self.cifar10_dir, 'data_batch_%d' % i) for i in range(1, 6)]\n else:\n files = [os.path.join(self.cifar10_dir, 'test_batch')]\n\n for file in fi... | [
"def get_group(self):\n \n if self.group is None:\n self.group = self.get_field('group')\n if self.group is not None:\n # group data from LightGBM is boundaries data, need to convert to group size\n self.group = np.diff(self.group)\n return se... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the application nane.
@param applicationNames a {@link java.lang.String} object. | [
"public final void setApplicationName(String... applicationNames) {\n synchronized (lock) {\n if (applicationNames == null) {\n serviceProperties.remove(APPLICATION_NAME);\n } else {\n serviceProperties.put(APPLICATION_NAME, applicationNames);\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 text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Documentation:"
} |
Private functions
If steamID is a clan ID, converts to the appropriate chat ID. Otherwise, returns it untouched.
@param {SteamID} steamID
@returns SteamID | [
"function toChatID(steamID) {\n\tsteamID = Helpers.steamID(steamID);\n\n\tif (steamID.type == SteamID.Type.CLAN) {\n\t\tsteamID.type = SteamID.Type.CHAT;\n\t\tsteamID.instance |= SteamID.ChatInstanceFlags.Clan;\n\t}\n\n\treturn steamID;\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
This is called by the EJB container server code to write a
EJB method call postinvoke ends record to the trace log, if enabled. | [
"public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n {\n StringBuffer sbuf = new StringBuffer();\n\n sbuf\n .append(MthdPostInvokeExit_Type_Str)... | [
"@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Database management:"
} |
Create and initialize a `nn.Conv1d` layer with spectral normalization. | [
"def conv1d(ni:int, no:int, ks:int=1, stride:int=1, padding:int=0, bias:bool=False):\n \"\"\n conv = nn.Conv1d(ni, no, ks, stride=stride, padding=padding, bias=bias)\n nn.init.kaiming_normal_(conv.weight)\n if bias: conv.bias.data.zero_()\n return spectral_norm(conv)"
] | [
"def optimizer(self) -> Union[mx.optimizer.Optimizer, SockeyeOptimizer]:\n \n # TODO: Push update to MXNet to expose the optimizer (Module should have a get_optimizer method)\n return self.current_module._optimizer"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// RawDeleteRange implements the RawKV interface. | [
"func (mvcc *MVCCLevelDB) RawDeleteRange(startKey, endKey []byte) {\n\tterror.Log(mvcc.doRawDeleteRange(startKey, endKey))\n}"
] | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Compose the view.
@param \Illuminate\Contracts\View\View $view | [
"public function composeFilters(View $view)\n {\n $roles = $this->cacheResults('roles.filters', function () {\n return $this->role->has('users')->get();\n });\n\n $filters = new Collection;\n $filters->push(link_to_route('admin::auth.users.index', trans('core::generals.al... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates global config file.
@since 1.0.0
@access public | [
"public function createGlobalConfig() {\n\t\t$basicConfig = array(\n\t\t\t'actor' => $this->actorSuffix,\n\t\t\t'paths' => array(\n\t\t\t\t'tests' => 'tests',\n\t\t\t\t'log' => $this->logDir,\n\t\t\t\t'data' => $this->dataDir,\n\t\t\t\t'helpers' => $this->helperDir\n\t\t\t),\n\t\t\t'settings' => array(\n\t... | [
"function init(entry, socket, req) { // {{{2\n/**\n * Class constructor\n *\n * @param entry {Object} Entry of xorg kind\n *\n * @method constructor\n */\n\n this.entry = entry;\n\n O.link.open(this, socket);\n}"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Computer Science:"
} |
Remove a listener laoder from this dispatcher.
@param LoaderInterface|string $event The event object or name.
@return Dispatcher This method is chainable. | [
"public function removeListenerLoader($loader)\n\t{\n\t\tif ($loader instanceof LoaderInterface)\n\t\t{\n\t\t\t$loader = $loader->getName();\n\t\t}\n\n\t\tif (isset($this->loaders[$loader]))\n\t\t{\n\t\t\tunset($this->loaders[$loader]);\n\t\t}\n\n\t\treturn $this;\n\t}"
] | [
"@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// MonthNarrow returns the locales narrow month given the 'month' provided | [
"func (lg *lg_UG) MonthNarrow(month time.Month) string {\n\treturn lg.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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Takes the detected point along the line and its gradient and converts it into transform space.
@param x point in image.
@param y point in image.
@param derivX gradient of point.
@param derivY gradient of point. | [
"public void parameterize( int x , int y , float derivX , float derivY )\n\t{\n\t\t// put the point in a new coordinate system centered at the image's origin\n\t\t// this minimizes error, which is a function of distance from origin\n\t\tx -= originX;\n\t\ty -= originY;\n\n\t\tfloat v = (x*derivX + y*derivY)/(derivX... | [
"@Override\n public int parity() {\n\n // create three vectors, v->u, v->w and u->x\n double[] vu = toVector(v, u);\n double[] vw = toVector(v, w);\n double[] ux = toVector(u, x);\n\n // normal vector (to compare against), the normal vector (n) looks like:\n // x n w... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Concatenate KM3HDF5 files via pipeline. | [
"def km3h5concat(input_files, output_file, n_events=None, **kwargs):\n \"\"\"\"\"\"\n from km3pipe import Pipeline # noqa\n from km3pipe.io import HDF5Pump, HDF5Sink # noqa\n\n pipe = Pipeline()\n pipe.attach(HDF5Pump, filenames=input_files, **kwargs)\n pipe.attach(StatusBar, every=250)\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@internal Log debug events in verbose mode
@param string $message | [
"private function debug($message)\n {\n if (1 < func_num_args()) {\n $message = call_user_func_array('sprintf', func_get_args());\n }\n $this->logger->addDebug($message);\n }"
] | [
"def doc_uri(self, args, range=None):\n \"\"\"\"\"\"\n self.log.debug('doc_uri: in')\n self.send_at_position(\"DocUri\", False, \"point\")"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
The list of all tags associated with this configuration.
@param tags
The list of all tags associated with this configuration.
@return Returns a reference to this object so that method calls can be chained together. | [
"public Configuration withTags(java.util.Map<String, String> tags) {\n setTags(tags);\n return this;\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 post about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about Software development:"
} |
Auto Generated Code | [
"def netconf_capability_change_changed_by_server_or_user_server_server(self, **kwargs):\n \n config = ET.Element(\"config\")\n netconf_capability_change = ET.SubElement(config, \"netconf-capability-change\", xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-notifications\")\n changed_by =... | [
"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 summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about File management:"
} |
Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"public function handle($request, Closure $next)\n {\n if (Auth::admin()->get()) {\n if ($request->ajax()) {\n return response('Authorized.', 403);\n } else {\n return redirect()->route('lara-mvcms.dashboard');\n }\n }\n\n return... | [
"abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ... | codesearchnet | {
"query": "Represent the sentence about Laravel:",
"pos": "Represent the code about Laravel:",
"neg": "Represent the code:"
} |
Compiles an array with order confirmation data to pass to Paymorrow.
@return array | [
"public function collectConfirmData()\n {\n $aData = $this->collectEshopData(false);\n\n // Add transaction data from session\n $aData['pm_order_transaction_id'] = oxRegistry::get('OxpsPaymorrowModule')->getPaymentTransactionId();\n $aData['order_id'] = oxRegistry::getSession()->getVa... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// ControllerRevisionName returns the Name for a ControllerRevision in the form prefix-hash. If the length
// of prefix is greater than 223 bytes, it is truncated to allow for a name that is no larger than 253 bytes. | [
"func ControllerRevisionName(prefix string, hash string) string {\n\tif len(prefix) > 223 {\n\t\tprefix = prefix[:223]\n\t}\n\n\treturn fmt.Sprintf(\"%s-%s\", prefix, hash)\n}"
] | [
"public FP64 extend(char c) {\n byte b1 = (byte)(c & 0xff);\n extend(b1);\n byte b2 = (byte) (c >>> 8);\n // NOTE pdalbora 23-Jul-2009 -- The following check is intentional. We don't extend the high order byte when it's\n // zero, in order to avoid \"weakening\" the fingerprint of primarily ASCII dat... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Filter header set against a whitelist of regular expressions.
@param string $type | [
"private function filterHeaderSet(Swift_Mime_SimpleHeaderSet $headerSet, $type)\n {\n foreach ($headerSet->getAll($type) as $headers) {\n $headers->setNameAddresses($this->filterNameAddresses($headers->getNameAddresses()));\n }\n }"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Process an object template
@param $tpl The object template
@param $selectStmt A SelectStatement instance | [
"protected function processObjectTemplate(PersistentObject $tpl, SelectStatement $selectStmt) {\n // avoid infinite recursion\n $oidStr = $tpl->getOID()->__toString();\n if (isset($this->processedNodes[$oidStr])) {\n return;\n }\n\n $mapper = self::getMapper($tpl->getType());\n $tableName = s... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@internal
@param array $permissions
@param string|NULL $type
@param array|object|NULL $context
@return bool | [
"protected function dispatchArray(array $permissions, $type = NULL, $context = NULL) {\n if(!$permissions) {\n return TRUE;\n }\n\n reset($permissions);\n $key = key($permissions);\n $value = current($permissions);\n\n if(!is_numeric($key)) {\n $keyUpper = strtoupper($key);\n if('NO... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Tests if specified category matches any category and doesn't match any exception of this subscription.
@param string $category
@return boolean | [
"public function matchCategory($category)\n {\n $result = empty($this->categories);\n foreach ($this->categories as $allowedCategory) {\n if ($this->categoryContains($allowedCategory, $category)) {\n $result = true;\n }\n }\n foreach ($this->except... | [
"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 about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Documentation:"
} |
Initializes head and tail, ensuring invariants hold. | [
"private void initHeadTail(Node<E> h, Node<E> t) {\n if (h == t) {\n if (h == null)\n h = t = new Node<>(null);\n else {\n // Avoid edge case of a single Node with non-null item.\n Node<E> newNode = new Node<>(null);\n t.lazySe... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about File management:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESSION__EXPRESSION:\n\t\t\t\treturn basicSetExpression(null, msgs);\n\t\t\tcase XbasePackage.XBASIC_FOR_LOOP_EXPRESS... | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the description about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Returns {@code Stream} with elements that does not satisfy the given predicate.
<p>This is an intermediate operation.
@param predicate the predicate used to filter elements
@return the new stream | [
"@NotNull\n public Stream<T> filterNot(@NotNull final Predicate<? super T> predicate) {\n return filter(Predicate.Util.negate(predicate));\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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Render the comments.
@param AnCommandContext $context | [
"protected function _actionGetcomments(AnCommandContext $context)\n {\n $this->getCommentController()->getRequest()->remove('get');\n\n $this->getCommentController()\n ->limit($this->getRequest()->get('limit'))\n ->start($this->getRequest()->get('start'));\n\n $this->getComment... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Add a child to the child list.
<!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
<!ATTLIST xsl:apply-templates
select %expr; "node()"
mode %qname; #IMPLIED
>
@param newChild Child to add to child list
@return Child just added to child list | [
"public ElemTemplateElement appendChild(ElemTemplateElement newChild)\n {\n\n int type = ((ElemTemplateElement) newChild).getXSLToken();\n\n if (Constants.ELEMNAME_SORT == type)\n {\n setSortElem((ElemSort) newChild);\n\n return newChild;\n }\n else\n return super.appendChild(newChild... | [
"function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 gr... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetDisplayName sets the DisplayName field's value. | [
"func (s *Grantee) SetDisplayName(v string) *Grantee {\n\ts.DisplayName = &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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Shows menu's links as a sortable tree.
@param int $id Menu's ID for which render its links tree
@return void | [
"public function menu($id)\n {\n $this->loadModel('Menu.Menus');\n $menu = $this->Menus->get($id);\n $links = $this->Menus->MenuLinks->find()\n ->where(['menu_id' => $menu->id])\n ->order(['lft' => 'ASC'])\n ->all()\n ->map(function ($link) {\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Calculates data tranfer rate values
@return int The rate in bytes/second | [
"protected function calulateDataTransferRateValues()\r\n {\r\n $vals = array();\r\n \r\n // Works like this:\r\n // After the server resonded, the socket-buffer is already filled with bytes,\r\n // that means they were received within the server-response-time.\r\n \r\n // To calulate the real ... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// UpLeftArrow displays an arrow pointing upwards and to the left on the Microbit LEDs | [
"func (b *LEDDriver) UpLeftArrow() (err error) {\n\tbuf := []byte{0x1E, 0x18, 0x14, 0x12, 0x01}\n\terr = b.WriteMatrix(buf)\n\treturn\n}"
] | [
"function jBox(type, options) {\n\n\n // Options (https://stephanwagner.me/jBox/options)\n\n this.options = {\n\n // jBox ID\n id: null, // Choose a unique id, otherwise jBox will set one for you (jBox1, jBox2, ...)\n\n // Dimensions\n width: 'auto', // The... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a child (variable) to this object. | [
"def _add(self, codeobj):\n \"\"\"\"\"\"\n assert isinstance(codeobj, CodeVariable)\n self.variables.append(codeobj)"
] | [
"@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:"
} |
/*
public MysqlUpdateExecutor(SocketChannel ch){ this.channel = ch; } | [
"public OKPacket update(String updateString) throws IOException {\r\n QueryCommandPacket cmd = new QueryCommandPacket();\r\n cmd.setQueryString(updateString);\r\n byte[] bodyBytes = cmd.toBytes();\r\n PacketManager.writeBody(connector.getChannel(), bodyBytes);\r\n\r\n logger.debug... | [
"public void init(ProxyTask proxyTask, RemoteTask remoteTask)\n {\n super.init(null, remoteTask); // TaskHolder doesn't have a parent (BaseHolder).\n m_proxyTask = proxyTask;\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Hide the given parameters.
@param array $data
@param array $hidden
@return mixed | [
"protected function hideParameters($data, $hidden)\n {\n foreach ($hidden as $parameter) {\n if (Arr::get($data, $parameter)) {\n Arr::set($data, $parameter, '********');\n }\n }\n\n return $data;\n }"
] | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
This function only needs to be called by the default SQL metadata storage module
Other modules should default to calling super.configure(...) alone
@param defaultValue default property value | [
"public void createBindingChoices(Binder binder, String defaultValue)\n {\n String prop = PROPERTY;\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageConnector.class), defaultValue);\n PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageProvider.class), defaultValue... | [
"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:"
} |
// Connect returns a handler for the pod exec proxy | [
"func (r *ExecREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) {\n\texecOpts, ok := opts.(*api.PodExecOptions)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid options object: %#v\", opts)\n\t}\n\tlocation, transport, err := pod.ExecLocation(r.Sto... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Get the absolute file path for a relative @import like './sub/file.scsss'
If the @import is made from a raw data section a best guess path is returned | [
"function getImportAbsolutePath(url, prev, includedFilesMap, includedPaths = []) {\n // Ensure that both @import 'file' and @import 'file.scss' is mapped correctly\n let extension = path.posix.extname(prev);\n if(path.posix.extname(url) !== extension) {\n url += extension;\n }\n\n const absolutePath = findI... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Consume GitHub WebHook
Capture a GitHub event and publish it via pulse, if it's a push,
release or pull request.
This method is ``experimental`` | [
"def githubWebHookConsumer(self, *args, **kwargs):\n \n\n return self._makeApiCall(self.funcinfo[\"githubWebHookConsumer\"], *args, **kwargs)"
] | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetQuality sets the Quality field's value. | [
"func (s *ComparedFace) SetQuality(v *ImageQuality) *ComparedFace {\n\ts.Quality = 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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// authorizeRemoteUser returns checker based on cert authority roles | [
"func (a *authorizer) authorizeRemoteUser(u RemoteUser) (*AuthContext, error) {\n\tca, err := a.trust.GetCertAuthority(services.CertAuthID{Type: services.UserCA, DomainName: u.ClusterName}, false)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\troleNames, err := ca.CombinedMapping().Map(u.RemoteRoles)\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:"
} |
Display a list of all modules.
@return View | [
"public function index()\n {\n $coreModules = $this->moduleManager->getCoreModules();\n $thirdPartyModules = $this->moduleManager->getThirdPartyModules();\n\n return view('modules::backend.modules.index', compact('coreModules', 'thirdPartyModules'));\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetResult sets the Result field's value. | [
"func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput {\n\ts.Result = &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 Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Extends the validator with custom rules | [
"protected function registerValidator()\n {\n $this->app->resolving('validator', function($validator) {\n /*\n * Allowed file extensions, as opposed to mime types.\n * - extensions: png,jpg,txt\n */\n $validator->extend('extensions', function ($att... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Parse over the options passed on the command line and determine how to
handle them | [
"def run_profile(self, profile, names, vm_overrides=None):\n '''\n \n '''\n if profile not in self.opts['profiles']:\n msg = 'Profile {0} is not defined'.format(profile)\n log.error(msg)\n return {'Error': msg}\n\n ret = {}\n if not vm_overr... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Whoops handle exceptions
@param MvcEvent $e | [
"public function prepareException(MvcEvent $e)\n {\n if ($e->getRequest() instanceof Request) {\n $error = $e->getError();\n if (!empty($error) && !$e->getResult() instanceof Response) {\n switch ($error) {\n case Application::ERROR_CONTROLLER_NOT_FO... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Clears the dict. | [
"def clear(self):\r\n \r\n self.__values.clear()\r\n self.__access_keys = []\r\n self.__modified_times.clear()"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Generate the new nav based on parent_id
@param $model
@return \Illuminate\Support\Collection|static | [
"private function generateCompleteUrl($model)\n {\n $row = self::find($model->parent_id);\n\n if ($row) {\n if (strlen($row->slug) > 1) {\n $this->url = $row->slug . (strlen($this->url) ? '/' . $this->url : '');\n }\n\n return $this->generateCompleteU... | [
"protected function map() {return df_map_0(df_sort_a(df_map_r(df_cms_blocks(), function(B $b) {return [\n\t\t$b->getId(), $b->getTitle()\n\t];})), '-- select a CMS block --');}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Prepare an image
This method should prepare an image object from php://input. The method must also figure out
the width, height, mime type and extension of the image.
@param EventInterface $event The current event
@throws ImageException | [
"public function prepareImage(EventInterface $event) {\n $request = $event->getRequest();\n\n // Fetch image data from input\n $imageBlob = $request->getContent();\n\n if (empty($imageBlob)) {\n $e = new ImageException('No image attached', 400);\n $e->setImboErrorCo... | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Updates the session state.
@param state The session state. | [
"private void setState(State state) {\n if (this.state != state) {\n this.state = state;\n log.debug(\"State changed: {}\", state);\n }\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:"
} |
Template variable getter. Returns paymentlist
@return object | [
"public function getPaymentList()\n {\n if ($this->_oPaymentList === null) {\n $this->_oPaymentList = false;\n\n $sActShipSet = \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('sShipSet');\n if (!$sActShipSet) {\n $sActShipSet = \\OxidE... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *OpsWorksInstanceBlockDeviceMappingList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := OpsWorksInstanceBlockDeviceMapping{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = OpsWorksInstanceBlockDeviceMappingList{it... | [
"@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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Display admin dashboard page
@param Request $request
@return string | [
"public function slash(Request $request)\n {\n switch ($emailStatus = $request->query->get('email')) {\n case 'sent';\n $emailStatus = $this->app->trans('Mail sent');\n break;\n case 'error':\n $emailStatus = $this->app->trans('Could not s... | [
"public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Returns an external catalog. | [
"public static ExternalCatalog findAndCreateExternalCatalog(Descriptor descriptor) {\n\t\tMap<String, String> properties = descriptor.toProperties();\n\t\treturn TableFactoryService\n\t\t\t.find(ExternalCatalogFactory.class, properties)\n\t\t\t.createExternalCatalog(properties);\n\t}"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Verify the user for the given token.
@param array $credentials
@param \Closure $callback
@return mixed | [
"public function verify(array $credentials, Closure $callback)\n {\n // If the responses from the validate method is not a user instance, we will\n // assume that it is a redirect and simply return it from this method and\n // the user is properly redirected having an error message on the po... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
//////////////////////////////////////////////////////////////// | [
"func (l *Lexer) consumeHTMLLikeCommentToken() bool {\n\tc := l.r.Peek(0)\n\tif c == '<' && l.r.Peek(1) == '!' && l.r.Peek(2) == '-' && l.r.Peek(3) == '-' {\n\t\t// opening HTML-style single line comment\n\t\tl.r.Move(4)\n\t\tl.consumeSingleLineComment()\n\t\treturn true\n\t} else if l.emptyLine && c == '-' && l.r.... | [
"private void readPacket(Results results) throws SQLException {\n Buffer buffer;\n try {\n buffer = reader.getPacket(true);\n } catch (IOException e) {\n throw handleIoException(e);\n }\n\n switch (buffer.getByteAt(0)) {\n\n //***********************************************************... | codesearchnet | {
"query": "Represent the Github post about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
add some data to the graph | [
"def add_values(self, values):\n ''''''\n if self.child.is_alive():\n self.parent_pipe.send(values)"
] | [
"@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:"
} |
@param array $item
@return \Pressbooks\Entities\Cloner\H5P | [
"protected function createH5PEntity( $item ) {\n\t\t$h5p = new \\Pressbooks\\Entities\\Cloner\\H5P();\n\t\tif ( isset( $item['id'] ) ) {\n\t\t\t$h5p->id = $item['id'];\n\t\t}\n\t\tif ( isset( $item['url'] ) ) {\n\t\t\t$h5p->url = $item['url'];\n\t\t}\n\t\treturn $h5p;\n\t}"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
The ``Bcc`` header. | [
"def bcc(self) -> Optional[Sequence[AddressHeader]]:\n \"\"\"\"\"\"\n try:\n return cast(Sequence[AddressHeader], self[b'bcc'])\n except KeyError:\n return None"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return sql table data.
@param string $machine
@param string $buildToken
@param string $table
@param integer $offset
@return array | [
"public function actionDataProvider($machine, $buildToken, $table, $offset)\n {\n $build = $this->ensureBuild($machine, $buildToken);\n \n $config = $build->getTableConfig($table);\n \n $offsetNummeric = $offset * $build->rowsPerRequest;\n\n $query = (new Query())\n ... | [
"private function getSent($orderId)\n {\n //Getting connection\n $connection = $this->_resource->getConnection();\n //Getting full table name\n $tableName = $this->_resource->getTableName('pagseguro_orders');\n //Update sales_order_grid query\n $mapsDeleteQuery = \"SELE... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
TODO: implement test | [
"def members\n NippoCore::User.joins(:group_member_relations)\n .where(nippo_core_group_member_relations: {group_id: self.id})\n .where.not(nippo_core_group_member_relations: {accepted_at: nil})\n end"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@inheritDoc}
@throws \InvalidArgumentException When the table is unknown. | [
"public function getMappingFor(string $tables, string $sourceLanguage, string $targetLanguage): MappingInterface\n {\n switch ($tables) {\n case 'tl_page':\n return $this->getPageMap($sourceLanguage, $targetLanguage);\n case 'tl_article':\n return $this-... | [
"@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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
execute command and return execution flags | [
"public int exec(Map<String, Command> references) throws Exception\n\t{\n\t\t// System.out.println(\"in exec() status = \" + translateStatus(status) +\n\t\t// \"...\");\n\t\tif (status < Command.CHILDREN_PROCESSED)\n\t\t{\n\t\t\tif (status < Command.COMMAND_EXECUTED)\n\t\t\t{\n\t\t\t\tif (status < Command.CHILDREN_... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns `content` with consecutive spaces converted to non-break
spaces, and linebreak converted into HTML br elements.
:param content: text to format
:type content: `str`
:rtype: `str` | [
"def _format_content(self, content):\n \n content = re.sub(r'\\n', '<br/>\\n', content)\n content = re.sub(r' ', '  ', content)\n content = re.sub(r'  ', '  ', content)\n return content"
] | [
"def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return a list of templates usable by a model. | [
"def get_templates(model):\n \n for template_name, template in templates.items():\n if issubclass(template.model, model):\n yield (template_name, template.layout._meta.verbose_name)"
] | [
"@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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Make sure a property is supported by adding prefix.
@param {string} property A property to be checked
@return {string} the property or its prefixed version | [
"function prefixProperty (property) {\n property = property.replace(camelReg, (match, first, char) => (first ? char : char.toUpperCase()))\n\n if (prefixCache[property]) {\n return prefixCache[property]\n }\n\n let prop\n\n if (!(property in supportElement.style)) {\n for (let i = 0; i < PREFIX_TYPE.leng... | [
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Parse rules, normalizing format into: { attribute: [{ name: 'age', value: 3 }] }
@param {object} rules
@return {object} | [
"function (rules) {\n\n var parsedRules = {};\n rules = this._flattenObject(rules);\n\n for (var attribute in rules) {\n\n var rulesArray = rules[attribute];\n\n this._parseRulesCheck(attribute, rulesArray, parsedRules);\n }\n return parsedRules;\n\n\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Apply request to appropriate ledger and state. `cons_time` is the
UTC epoch at which consensus was reached. | [
"def applyReq(self, request: Request, cons_time: int):\n \n self.execute_hook(NodeHooks.PRE_REQUEST_APPLICATION, request=request,\n cons_time=cons_time)\n req_handler = self.get_req_handler(txn_type=request.operation[TXN_TYPE])\n seq_no, txn = req_handler.apply(r... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Converts a string containing comma separated email addresses
into a list of email addresses. | [
"def split_addresses(email_string_list):\n \n return [f for f in [s.strip() for s in email_string_list.split(\",\")] if f]"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Update the environments based upon the user's selection
+changes+ : Hash with two keys: :new and :obsolete.
changed[:/new|obsolete/] is and Array of Strings
Returns : Array of Strings containing all record errors | [
"def obsolete_and_new(changes = { })\n return if changes.empty?\n if changes['new'].present?\n changes['new'].each { |name, _| ForemanChef::Environment.create(:name => name, :chef_proxy_id => @chef_proxy.id) }\n end\n if changes['obsolete'].present?\n changes['obsolete'].each { |na... | [
"def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
@param ITypedCollection $collection
@param callable $objectLoaderCallback
@return ILazyCollection
@throws InvalidArgumentException | [
"public static function from(ITypedCollection $collection, callable $objectLoaderCallback) : ILazyCollection\n {\n if (method_exists($collection, 'createLazyCollection')) {\n return $collection->createLazyCollection($objectLoaderCallback);\n }\n\n if ($collection instanceof Entity... | [
"public function objectFromIndex(IObjectSetWithIdentityByIndex $objects) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder(\n $this->type(new ObjectIdType(new ObjectIndexOptions($objects), $loadAsObjects = true))\n );\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Returns a Span that covers all rows beginning with a prefix. | [
"public static Span prefix(Bytes rowPrefix) {\n Objects.requireNonNull(rowPrefix);\n Bytes fp = followingPrefix(rowPrefix);\n return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false);\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise. | [
"func (o *Organization) GetReposURL() string {\n\tif o == nil || o.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.ReposURL\n}"
] | [
"func (f *RecordFlags) AddFlags(cmd *cobra.Command) {\n\tif f == nil {\n\t\treturn\n\t}\n\n\tif f.Record != nil {\n\t\tcmd.Flags().BoolVar(f.Record, \"record\", *f.Record, \"Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see
retrofit2.Converter.Factory#requestBodyConverter(java.lang.reflect.Type,
java.lang.annotation.Annotation[], java.lang.annotation.Annotation[],
retrofit2.Retrofit) | [
"@SuppressWarnings(\"rawtypes\")\n\t@Override\n\tpublic Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations,\n\t\t\tAnnotation[] methodAnnotations, Retrofit retrofit) {\n\t\tif (type instanceof Class) {\n\t\t\tClass<?> ct = ((Class) type);\n\t\t\tAnnotation annotation = ct.ge... | [
"public void addInterceptor(ConnectInterceptor<?> interceptor) {\n\t\tClass<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ConnectInterceptor.class);\n\t\tconnectInterceptors.add(serviceApiType, interceptor);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
nodejs的require('path').relative有bug,因此自己写 | [
"function getRelativePath (from, to) {\n // 去除相同部分\n var i = 0\n while (from[i] === to[i]) {\n i++\n }\n from = from.substr(i)\n to = to.substr(i)\n // 加上..或.\n var l = from.split(/\\/|\\\\/).length - 1\n var s = ''\n if (l) {\n while (l--) {\n s += '../'\n }\n } else {\n s = './'\n }\n... | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. | [
"func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *PutBucketEncryptionInput {\n\ts.ServerSideEncryptionConfiguration = v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. | [
"func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) {\n\t*v = RawMessage(l.Raw())\n}"
] | [
"func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Check if a particular space is clear of blockages
@param map The map the spaces are being built from
@param space The space to check
@return True if there are no blockages in the space | [
"public boolean clear(TileBasedMap map, Space space) {\n\t\tif (tileBased) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tfloat x = 0;\n\t\tboolean donex = false;\n\t\t\n\t\twhile (x < space.getWidth()) {\n\t\t\tfloat y = 0;\n\t\t\tboolean doney = false;\n\t\t\t\n\t\t\twhile (y < space.getHeight()) {\n\t\t\t\tsx = (int) (... | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Display the current flair for all users in the subreddit. | [
"def output_current_flair(self, as_json=False):\n \"\"\"\"\"\"\n flair_list = sorted(self.current_flair(), key=lambda x: x['user'].name)\n if as_json:\n print(json.dumps(flair_list, sort_keys=True, indent=4))\n return\n\n for flair in flair_list:\n print(... | [
"def note(id, type, options = {})\n # Welguisz: No idea why this is here, but keeping it here because it follows other blocks\n _notes\n # Create a new note and place it in the notes 2-D Hash\n @_notes[id][type] = Note.new(id, type, options)\n end"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
$ANTLR start "AT" | [
"public final void mAT() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = AT;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:152:4: ( '@' )\n\t\t\t// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:152:6: '@'\n\t\t\t{\n\t\t\tmatch('@... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Rename
@param string $path Path
@param string $newpath New path
@param callable $cb Callback
@param integer $pri Priority
@return resource|boolean | [
"public static function rename($path, $newpath, $cb = null, $pri = EIO_PRI_DEFAULT)\n {\n $cb = CallbackWrapper::forceWrap($cb);\n if (!self::$supported) {\n $r = rename($path, $newpath);\n if ($cb) {\n $cb($path, $newpath, $r);\n }\n retur... | [
"protected function help()\n {\n $style = new Style(' *** RUN - HELP ***');\n Out::std($style->color('fg', Style::COLOR_GREEN)->get());\n Out::std('');\n\n $help = new Help('...', true);\n $help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
XML handler for a closing tag.
@param resource $parser the resource handler for the xml parser
@param string $name the name of the xml element parsed
@return void | [
"protected function endElement($parser, string $name): void\n {\n $method = $name . 'EndHandler';\n\n if (method_exists($this, $method)) {\n $this->$method();\n }\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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Returns the metric query service scope for this group.
@param filter character filter
@return query service scope | [
"public QueryScopeInfo getQueryServiceMetricInfo(CharacterFilter filter) {\n\t\tif (queryServiceScopeInfo == null) {\n\t\t\tqueryServiceScopeInfo = createQueryServiceMetricInfo(filter);\n\t\t}\n\t\treturn queryServiceScopeInfo;\n\t}"
] | [
"@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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Returns the count of callbacks still listening to 'this'.
This method will perform a hard disconnect if 0 is returned.
@param criteria
@return | [
"public int removeCallback(IConnectionStateCallback criteria) {\n\t\t \n\t\t List<IConnectionStateCallback> listCallbacks = getConnectionDetail().getConnCallbacks();\n\t\t /**\n\t\t * If this method is about to delete the last callback, then\n\t\t * there are no windows left listening, so it is safe to\n\t\t... | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Runs the current application.
@param InputInterface $input An Input instance
@param OutputInterface $output An Output instance
@return int 0 if everything went fine, or an error code | [
"public function doRun(InputInterface $input, OutputInterface $output)\n {\n $name = $this->getCommandName($input);\n\n // Did the user enter an environment option?\n if (true === $input->hasParameterOption(['--env', '-e'])) {\n $this->environment = $input->getParameterOption(['--... | [
"public function run()\n {\n $this->requestId = uniqid();\n $this->startTime = microtime();\n\n try {\n // Generate a Request object from the data available in the\n // current running environment.\n try {\n $requestFactory = new Requests\\Factorie... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Set new merge rule for dataset. Some types are available in basis.data.Dataset.Merge
@param {function(count:number, sourceCount:number):boolean|string} rule New rule.
@return {Object} Delta of member changes. | [
"function(rule){\n rule = basis.getter(rule || UNION);\n\n if (this.rule !== rule)\n {\n var oldRule = this.rule;\n\n this.rule = rule;\n this.emit_ruleChanged(oldRule);\n\n return this.applyRule();\n }\n }"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param array|null $params
@param array|string|null $options
@return \Stripe\File The created resource. | [
"public static function create($params = null, $options = null)\n {\n $opts = \\Stripe\\Util\\RequestOptions::parse($options);\n if (is_null($opts->apiBase)) {\n $opts->apiBase = Stripe::$apiUploadBase;\n }\n // Manually flatten params, otherwise curl's multipart encoder wi... | [
"public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
/*
* Performs a raw Select query given a raw query string
*/ | [
"func (c *Connection) SelectRaw(q string) (*SelectResponse, error) {\n\tresp, err := c.CustomSelectRaw(q, \"select\")\n\treturn resp, err\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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Write the given bytes (binary string) into the WebHDFS file from constructor. | [
"def write(self, b):\n \n if self._closed:\n raise ValueError(\"I/O operation on closed file\")\n\n if not isinstance(b, six.binary_type):\n raise TypeError(\"input must be a binary string\")\n\n self.lines.append(b)\n self.chunk_bytes += len(b)\n self... | [
"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:"
} |
保存日志
@return bool | [
"public function save()\n\t{\n\t\t$this->db->begin();\n\t\tforeach($this->data as $item)\n\t\t{\n\t\t\t$this->db->insert($this->tableName,$item);\n\t\t}\n\t\t$this->db->commit();\n\t\treturn true;\n\t}"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the summarization about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
// DisconnectFromNetwork disconnects container from network n. | [
"func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, networkName string, force bool) error {\n\tn, err := daemon.FindNetwork(networkName)\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tif !container.Running || (err != nil && force) {\n\t\tif container.RemovalInProgress || container.Dea... | [
"function TcpStreamConnect () {\n this.simulator.Debug (3, 'Dispatcher connected to %s:%s', simulator.opts.host, simulator.opts.port);\n ActiveClients[this] = this; // register on remote server in active socket list\n }"
] | codesearchnet | {
"query": "Represent the post about Container management:",
"pos": "Represent the code about Container management:",
"neg": "Represent the code about Computer Science:"
} |
Call PayPal to check if IPN request originally from PayPal.
@param array $requestData data of request.
@return \OxidEsales\PayPalModule\Model\Response\Response | [
"protected function doVerifyWithPayPal($requestData)\n {\n $callerService = $this->getCommunicationService();\n $payPalPayPalRequest = $this->getPayPalRequest();\n foreach ($requestData as $requestParameterName => $requestParameterValue) {\n $payPalPayPalRequest->setParameter($req... | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Add a piece of data to the view.
@param string|array $key
@param mixed $value
@return \Illuminate\View\View | [
"public function with($key, $value = null)\n {\n if (is_array($key)) {\n return parent::with($this->factory->decorate($key));\n }\n\n return parent::with($key, $this->factory->decorate($value));\n }"
] | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
removeByPath
@param array $data
@param string $path
@param string $separator
@return bool | [
"public static function removeByPath(array &$data, $path, $separator = '.')\n {\n $nodes = static::getPathNodes($path, $separator);\n\n if (empty($nodes)) {\n return false;\n }\n\n $previous = null;\n $dataTmp = &$data;\n\n foreach ($nodes as $node) {\n ... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Module name of the wrapped function. | [
"def _module_name(self) -> str:\n \"\"\"\"\"\"\n name = self.f.__module__\n if name == '__main__':\n return importer.main_module_name()\n return name"
] | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
single variable or dictionary to xml representation | [
"def var_to_xml(val, name, trim_if_too_big=True, additional_in_xml='', evaluate_full_value=True):\n \n\n type_name, type_qualifier, is_exception_on_eval, resolver, value = get_variable_details(\n val, evaluate_full_value)\n\n try:\n name = quote(name, '/>_= ') # TODO: Fix PY-5834 without usi... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the absolute integer part of the Real number as a Natural
@param RoundingMode $rounding_mode Rounding mode of the conversion. Defaults to RoundingMode::HALF_UP.
@return Natural | [
"public function toNatural(RoundingMode $rounding_mode = null)\n {\n $integerValue = $this->toInteger($rounding_mode)->toNative();\n $naturalValue = \\abs($integerValue);\n $natural = new Natural($naturalValue);\n\n return $natural;\n }"
] | [
"public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) {\r\n return new ToFloat(scale, roundingMode);\r\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return a FilterChain with Filters for postprocessing the image
@return FilterChain|null | [
"public function getFilters()\n {\n if ($this->progressive) {\n $fc = new FilterChain();\n $fc->add(new Interlace(ImageInterface::INTERLACE_PLANE));\n return $fc;\n } else {\n return null;\n }\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:"
} |
Register application with dispatcher | [
"def registerContextEngineId(self, contextEngineId, pduTypes, processPdu):\n \"\"\"\"\"\"\n # 4.3.2 -> no-op\n\n # 4.3.3\n for pduType in pduTypes:\n k = contextEngineId, pduType\n if k in self._appsRegistration:\n raise error.ProtocolError(\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"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.