query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Shows the problem count in the panel.<p>
@param numProblems the number of resources with publish problems | [
"private void showProblemCount(int numProblems) {\n\n m_problemsPanel.clear();\n if (numProblems > 0) {\n HorizontalPanel errorBox = new HorizontalPanel();\n Widget warnIcon = FontOpenCms.WARNING.getWidget(20, I_CmsConstantsBundle.INSTANCE.css().colorWarning());\n Stri... | [
"def before_reject(analysis):\n \n worksheet = analysis.getWorksheet()\n if not worksheet:\n return\n\n # Rejection of a routine analysis causes the removal of their duplicates\n for dup in worksheet.get_duplicates_for(analysis):\n doActionFor(dup, \"unassign\")"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetOrCreate provides a mock function with given fields: chainID | [
"func (_m *Factory) GetOrCreate(chainID string) (blockledger.ReadWriter, error) {\n\tret := _m.Called(chainID)\n\n\tvar r0 blockledger.ReadWriter\n\tif rf, ok := ret.Get(0).(func(string) blockledger.ReadWriter); ok {\n\t\tr0 = rf(chainID)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(blockledger.R... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Pubic for unit testing only.
@param type $mantissaByteString
@param type $integerExponent | [
"public function convertBinaryFractionToDecimalFraction($mantissaByteString, $integerExponent) {\n $bits = $this->mantissaBitLength;\n $value = pow(2, $integerExponent);\n for ($i = 0; $i < $bits; $i++) {\n $curExponent = $integerExponent - 1 - $i;\n $bitPosition = $bits -... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
xxxxx.xxxxx.adgroup.add
===================================
创建一个推广组 | [
"def add(self, campaign_id, item_id, default_price, title, img_url, nick=None):\n ''''''\n request = TOPRequest('xxxxx.xxxxx.adgroup.add')\n request['campaign_id'] = campaign_id\n request['item_id'] = item_id\n request['default_price'] = default_price\n request['title'] = t... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Do some nasty try/except voodoo to get some sort of datetime
object(s) out of the string. | [
"def _parse_interval(value):\n \n try:\n return sorted(aniso8601.parse_interval(value))\n except ValueError:\n try:\n return aniso8601.parse_datetime(value), None\n except ValueError:\n return aniso8601.parse_date(value), None"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns all the mods.
@return array|ModCombination[] | [
"public function findAll(): array\n {\n $queryBuilder = $this->entityManager->createQueryBuilder();\n $queryBuilder->select('mc')\n ->from(ModCombination::class, 'mc');\n\n return $queryBuilder->getQuery()->getResult();\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
add a IfNoneMatch header to the response
@param FilterResponseEvent $event response listener event
@return void | [
"public function onKernelResponse(FilterResponseEvent $event)\n {\n $response = $event->getResponse();\n $request = $event->getRequest();\n\n $ifNoneMatch = $request->headers->get('if-none-match');\n $etag = $response->headers->get('ETag', 'empty');\n\n if ($ifNoneMatch === $et... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Store a driver
@param drv The driver
@param writer The writer
@exception Exception Thrown if an error occurs | [
"protected void storeDriver(Driver drv, XMLStreamWriter writer) throws Exception\n {\n writer.writeStartElement(XML.ELEMENT_DRIVER);\n\n if (drv.getName() != null)\n writer.writeAttribute(XML.ATTRIBUTE_NAME,\n drv.getValue(XML.ATTRIBUTE_NAME, drv.getName()));\n\n ... | [
"def timeout(self, value):\n \"\"\"\"\"\"\n self.check_pyb()\n try:\n self.pyb.serial.timeout = value\n except:\n # timeout is a property so it calls code, and that can fail\n # if the serial port is closed.\n pass"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets an array of languages with active first, then fallback languages
@return array | [
"public function getFallbackLanguages()\n {\n if (empty($this->fallback_languages)) {\n if ($this->enabled()) {\n $fallback_languages = $this->languages;\n\n if ($this->active) {\n $active_extension = $this->active;\n $key = \\... | [
"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:"
} |
Decorates a function to dispatch handler of the value of the first
argument. | [
"def valuedispatch(func):\n \n registry = {}\n def dispatch(value):\n return registry.get(value, func)\n def register(value, func=None):\n if func is None:\n return lambda f: register(value, f)\n registry[value] = func\n return func\n def wrapper(*args, **kw):\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the static instance of this exporter.
@return Exporter The static exporter. | [
"public static function instance(): self\n {\n if (!self::$instance) {\n self::$instance = new self(\n 1,\n Sequencer::sequence('exporter-object-id'),\n InvocableInspector::instance()\n );\n }\n\n return self::$instance;\n ... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns true if the given score uses an index exactly the same as this
one. The only allowed differences are in the count of remainder
orderings. | [
"public boolean canMergeRemainderOrdering(OrderingScore<S> other) {\r\n if (this == other || (getHandledCount() == 0 && other.getHandledCount() == 0)) {\r\n return true;\r\n }\r\n\r\n if (isIndexClustered() == other.isIndexClustered()\r\n && getIndexPropertyCount() == othe... | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Find something
@param Callable $rule
@return array | [
"public function find($rule){\n\n $r = [];\n\n foreach($this->data as $k=>$v){\n if($rule($this->{$k})){\n $r[] = $this->{$k};\n }\n }\n\n return $r;\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Run handler and return `false` if it needs to exit the CLI or `true` otherwise | [
"void handle() throws IOException {\n if (null == handler) {\n println(\"Command not recognized: %s\", command());\n return;\n }\n if (handler == Exit.INSTANCE) {\n handler.handle(this);\n }\n CommandLineParser parser = commandLine();\n bool... | [
"function execute(exec, req, res) {\n\n // start timing slow logs before execution\n // validation time is not included nor i/o\n this.state.slowlog.start(req.cmd, req.raw);\n\n // ensure the slowlog stop is called\n // before encoding and sending the response\n res.before = this.state.slowlog.stop;\n\n // e... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// Disembed is a cancellable disembed of an src to a dst using a custom Disembedder | [
"func Disembed(ctx context.Context, d Disembedder, src, dst string) (err error) {\n\t// Log\n\tastilog.Debugf(\"Disembedding %s into %s...\", src, dst)\n\n\t// No need to disembed\n\tif _, err = os.Stat(dst); err != nil && !os.IsNotExist(err) {\n\t\treturn errors.Wrapf(err, \"stating %s failed\", dst)\n\t} else if ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the topmost objects (i.e. minimum y_loc). The comparison is done separately for each
box. | [
"def top(self, objects: Set[Object]) -> Set[Object]:\n \n objects_per_box = self._separate_objects_by_boxes(objects)\n return_set: Set[Object] = set()\n for _, box_objects in objects_per_box.items():\n min_y_loc = min([obj.y_loc for obj in box_objects])\n return_set... | [
"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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Persisting our data in the cache, uniquely referenced by a key with an optional expiration TTL time.
@param CacheItemInterface $item The cache item to store.
@return static Return self to support chaining | [
"public function save(CacheItemInterface $item)\n {\n $this->connect();\n\n $ttl = $this->ttl;\n\n $this->driver->set($item->getKey(), $item->get(), $ttl);\n\n return (bool) ($this->driver->getResultCode() == \\Memcached::RES_SUCCESS);\n }"
] | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Updates the size of the axes, curve and event panel. Recomputes the event
locations if necessary. | [
"private void updateChildren() {\n axesPanel.setSize(getWidth(), getHeight());\n plotPanel.setSize(getWidth() - X_OFFSET_LEFT - X_OFFSET_RIGHT,\n getHeight() - Y_OFFSET_BOTTOM - Y_OFFSET_TOP);\n }"
] | [
"def rowsInserted(self, parent, start, end):\n \n\n super(LogView, self).rowsInserted(parent, start, end)\n\n # IMPORTANT: This must be done *after* the superclass to get\n # an accurate value of the delegate's height.\n self.scrollToBottom()"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns true if handle is possible to be cached
@param RequestHandleInterface $handle Request handle
@return boolean True if can be cached | [
"private function isCacheable(RequestHandleInterface $handle)\n {\n if(null === $this->cache)\n {\n return false;\n }\n if($handle->getMethod() != self::GET)\n {\n return false;\n }\n\n return true;\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 Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Take a JSON export of part of a source site's page tree
and create those pages under the parent page | [
"def import_pages(import_data, parent_page):\n \n pages_by_original_path = {}\n pages_by_original_id = {}\n\n # First create the base Page records; these contain no foreign keys, so this allows us to\n # build a complete mapping from old IDs to new IDs before we go on to importing the\n # specific... | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Language and programming:"
} |
Convenience method to wrap a status with any key word args.
Args:
status (enum): enum response status, defaults to OK
Returns:
dict: inlcudes a 'status' attribute and any key word arguments | [
"def _wrap_response(self, status=None, **kwargs):\n \n kwargs['status'] = status if status is not None else self._status.OK\n return kwargs"
] | [
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Loads a special item, e.g. shipping cost.
@param string $name the name of the item.
@param float|int|double $price the unit price of the item.
@param string $currency the 3-letter ISO code (ISO 4217) for the item currency. | [
"public function loadSpecialItemData($name, $price, $currency)\n {\n $this->setProductId(self::PSEUDO_PRODUCT_ID);\n $this->setQuantity(1);\n $this->setName($name);\n $this->setPrice($price);\n $this->setPriceCurrencyCode($currency);\n }"
] | [
"public function printMoney(MoneyInterface $money = null)\n {\n if (!($money instanceof MoneyInterface)) {\n return '';\n }\n\n if (!($money->getCurrency() instanceof CurrencyInterface)) {\n return $money->getAmount();\n }\n\n $moneyFormatter = new NumberF... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetRoleARN sets the RoleARN field's value. | [
"func (s *ExtendedS3DestinationDescription) SetRoleARN(v string) *ExtendedS3DestinationDescription {\n\ts.RoleARN = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Reloads the contents for this box. | [
"def reload(self):\r\n \r\n enum = self._enum\r\n if not enum:\r\n return\r\n \r\n self.clear()\r\n \r\n if not self.isRequired():\r\n self.addItem('')\r\n \r\n if self.sortByKey():\r\n self.addItems(sorted(enum.keys()))... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Destroys a session from the request context and also from the storage engine. | [
"public void destroySession() {\n \tJsonObject session = get(\"session\");\n if (session == null) {\n return;\n }\n\n String sessionId = session.getString(\"id\");\n // remove from the context\n put(\"session\", null);\n\n if (sessionId == null) {\n ... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about programming:"
} |
Get the secondary structure as defined by DSSP.
@param group the input group to be calculated
@return the integer index of the group type. | [
"public static int getSecStructType(Group group) {\n\t\tSecStrucState props = (SecStrucState) group.getProperty(\"secstruc\");\n\t\tif(props==null){\n\t\t\treturn DsspType.NULL_ENTRY.getDsspIndex();\n\t\t}\n\t\treturn DsspType.dsspTypeFromString(props.getType().name).getDsspIndex();\n\t}"
] | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
put your code here | [
"public function loadChoiceList($value = null): ChoiceListInterface\n {\n $uomTypes = $this->uomTypeRepository->findAll();\n\n return new ArrayChoiceList($uomTypes, function ($ut) {\n $ut->getId();\n });\n }"
] | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Called only once after this callback is set.
@param view | [
"public void onViewSetup(NotificationView view) {\n if (DBG) Log.v(TAG, \"onViewSetup\");\n\n view.setCornerRadius(8.0f);\n view.setContentMargin(50, 50, 50, 50);\n view.setShadowEnabled(true);\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns product link type:
- OXARTICLE_LINKTYPE_PRICECATEGORY - when active category is price category
- OXARTICLE_LINKTYPE_CATEGORY - when active category is regular category
@return int | [
"protected function _getProductLinkType()\n {\n $categoryType = OXARTICLE_LINKTYPE_CATEGORY;\n if (($category = $this->getActiveCategory()) && $category->isPriceCategory()) {\n $categoryType = OXARTICLE_LINKTYPE_PRICECATEGORY;\n }\n\n return $categoryType;\n }"
] | [
"protected function process()\n {\n\n // query whether or not, we've found a new SKU => means we've found a new product\n if ($this->isLastSku($sku = $this->getValue(ColumnKeys::SKU))) {\n return;\n }\n\n // FIRST delete the data related with the product with the passed SKU... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
@param $id
@return string|\yii\web\Response
@throws NotFoundHttpException
@throws \yii\db\Exception | [
"public function actionUpdate($id)\r\n {\r\n if (Yii::$app->request->post('_asnew') == '1') {\r\n $model = new Customer();\r\n } else {\r\n $model = $this->findModel($id);\r\n }\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\r\n ... | [
"public function init()\n {\n if (!$this->isEnabled() || $this->getUser()->isGuest) {\n return;\n }\n\n $this->userSwitch = new UserSwitch(['userComponent' => $this->userComponent]);\n $this->addAccessRules();\n\n if (!is_object($this->filterModel)\n && cl... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// SetEndpointPublicAccess sets the EndpointPublicAccess field's value. | [
"func (s *VpcConfigRequest) SetEndpointPublicAccess(v bool) *VpcConfigRequest {\n\ts.EndpointPublicAccess = &v\n\treturn s\n}"
] | [
"@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Turn an Entry into an array
@param \Concrete\Core\Entity\Express\Entry $entry
@return array | [
"private function projectEntry(Entry $entry)\n {\n $date = $entry->getDateCreated();\n if ($date) {\n yield 'ccm_date_created' => $this->dateFormatter->formatCustom(\\DateTime::ATOM, $date);\n } else {\n yield 'ccm_date_created' => null;\n }\n\n $attribute... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Exchange one-use pin for an access_token and request_token. | [
"def exchange_pin(self, pin):\n \"\"\"\"\"\"\n params = {'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'grant_type': 'pin',\n 'pin': pin}\n result = self._send_request(EXCHANGE_URL.format(self._base_url),\n ... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Load profiles.
@param array $profiles Profiles
@param ContainerBuilder $container Container
@return $this self Object | [
"protected function loadProfiles(array $profiles, ContainerBuilder $container)\n {\n foreach ($profiles as $profileName => $profile) {\n $definition = $container\n ->register(\n 'elcodi.sitemap_profile.' . $profileName,\n 'Elcodi\\Component\\... | [
"private function init()\n {\n // return the configurations from the config file\n $this->configurations = $this->helper->getConfigurations();\n\n // return an instance of the corresponding Provider concrete according to the configuration\n $this->provider = $this->provider_factory->c... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
// WriteAPIListeningMessage writes the "API server listening" message in headless mode. | [
"func WriteAPIListeningMessage(addr string) {\n\tif logOut != nil {\n\t\tfmt.Fprintf(logOut, \"API server listening at: %s\\n\", addr)\n\t} else {\n\t\tfmt.Printf(\"API server listening at: %s\\n\", addr)\n\t}\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// AddRemoteAvailableShards merges the set of available shards into the current known set
// and saves the set to a file. | [
"func (f *Field) AddRemoteAvailableShards(b *roaring.Bitmap) error {\n\tf.mergeRemoteAvailableShards(b)\n\t// Save the updated bitmap to the data store.\n\treturn f.saveAvailableShards()\n}"
] | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Sets delimiter and namespaces | [
"protected function set_env()\n {\n if ($this->delimiter !== null && $this->namespace !== null) {\n return;\n }\n\n $config = rcube::get_instance()->config;\n $imap_personal = $config->get('imap_ns_personal');\n $imap_other = $config->get('imap_ns_other'... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set path search.
@internal
@param array $searchMask
@param array $searchPath
@param array $excludePath | [
"public function setSearchPath(array $searchMask = [], array $searchPath = [], array $excludePath = [])\n {\n $this->searchContent = new SearchContent($searchMask, $searchPath, $excludePath);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Compares two float numbers with the given operator.
@param float $v1
@param float $v2
@param string $operator
@param int $precision
@return boolean | [
"public static function compare_floats($v1, $v2, string $operator = '===', int $precision = 4): bool\n {\n $v1 = round((float)$v1 * pow(10, $precision));\n $v2 = round((float)$v2 * pow(10, $precision));\n switch ($operator ){\n case '===':\n return $v1 === $v2;\n case '==':\n retur... | [
"protected function opCmpNumberNumber($left, $right)\n {\n $n = $left[1] - $right[1];\n\n return new Node\\Number($n ? $n / abs($n) : 0, '');\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
中等长度的音频或者边录边传模式,将音频分片传输到评估服务 | [
"async function EvaluationMultipleSeq(client) {\n\n console.log(\"----------流式评估示例------------\")\n let startTime = Date.now()\n try {\n let sessionId = uuid.v1();\n // 初始化评估\n let initReq = new models.InitOralProcessRequest();\n initReq.SessionId = sessionId;\n initReq.R... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about text processing:"
} |
// Handle listens for incoming requests for CA information, and returns
// a list containing information on each root certificate. | [
"func (h *Handler) Handle(w http.ResponseWriter, r *http.Request) error {\n\treq := new(info.Req)\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tlog.Warningf(\"failed to read request body: %v\", err)\n\t\treturn errors.NewBadRequest(err)\n\t}\n\tr.Body.Close()\n\n\terr = json.Unmarshal(body, req)\n\... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// newHealthzHandler creates a healthz server from the config, and will also
// embed the metrics handler if the healthz and metrics address configurations
// are the same. | [
"func newHealthzHandler(config *kubeschedulerconfig.KubeSchedulerConfiguration, separateMetrics bool, checks ...healthz.HealthzChecker) http.Handler {\n\tpathRecorderMux := mux.NewPathRecorderMux(\"kube-scheduler\")\n\thealthz.InstallHandler(pathRecorderMux, checks...)\n\tif !separateMetrics {\n\t\tinstallMetricHan... | [
"func GetAPIServerProbeAddress(endpoint *kubeadmapi.APIEndpoint) string {\n\t// In the case of a self-hosted deployment, the initial host on which kubeadm --init is run,\n\t// will generate a DaemonSet with a nodeSelector such that all nodes with the label\n\t// node-role.kubernetes.io/master='' will have the API s... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
// Compare is like bytes.Compare with the pointed at key, but reduces the amount of faults. | [
"func (ri *readerOffsetsIterator) Compare(key []byte, pre prefix, b *faultBuffer) int {\n\tif cmp := comparePrefix(ri.Prefix(), pre); cmp != 0 {\n\t\treturn cmp\n\t}\n\treturn bytes.Compare(ri.Key(b), key)\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Return true if over any of the node's edges, it is translocated. | [
"def is_translocated(graph: BELGraph, node: BaseEntity) -> bool:\n \"\"\"\"\"\"\n return _node_has_modifier(graph, node, TRANSLOCATION)"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the size of the viewport excluding, if rendered, the vertical and horizontal scrollbars.
Uses JavaScript calling document.documentElement.client[Width|Height]().
@return the rectangle | [
"public Rectangle getViewport() {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tMap<String, Number> result = (Map<String, Number>) executeScript(JS_GET_VIEWPORT);\n\t\tint width = result.get(\"width\").intValue();\n\t\tint height = result.get(\"height\").intValue();\n\t\tRectangle viewport = new Rectangle(0, 0, height... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
If translated field is encountered, add also all its fallback fields.
Returns tuple: (set_of_new_fields_to_use, set_of_translated_field_names) | [
"def append_fallback(model, fields):\n \n fields = set(fields)\n trans = set()\n from modeltranslation.translator import translator\n opts = translator.get_options_for_model(model)\n for key, _ in opts.fields.items():\n if key in fields:\n langs = resolution_order(get_language(),... | [
"def clone (self, new_id, new_toolset_properties):\n \n assert isinstance(new_id, basestring)\n assert is_iterable_typed(new_toolset_properties, basestring)\n return self.__class__ (new_id,\n self.composing_,\n self.source_types... | codesearchnet | {
"query": "Represent the instruction about Data transformation:",
"pos": "Represent the code about Data transformation:",
"neg": "Represent the code about programming:"
} |
Renders the representation based on source, object, scope and locals
Template.new("...source...", { :format => "xlsx" }).render(scope, { :foo => "bar", :object => @user }) | [
"def render(scope, locals, &block)\n @locals, @scope = locals, scope\n set_locals_variables\n \n instance_eval(@source) if @source.present?\n instance_eval(&block) if block_given?\n \n super\n end"
] | [
"def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Abort SASL authentication. | [
"async def _sasl_abort(self, timeout=False):\n \n if timeout:\n self.logger.error('SASL authentication timed out: aborting.')\n else:\n self.logger.error('SASL authentication aborted.')\n\n if self._sasl_timer:\n self._sasl_timer.cancel()\n\n s... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a url to the chapter.
@param \core_search\document $doc
@return \moodle_url | [
"public function get_doc_url(\\core_search\\document $doc) {\n $contextmodule = \\context::instance_by_id($doc->get('contextid'));\n $params = array('id' => $contextmodule->instanceid, 'chapterid' => $doc->get('itemid'));\n return new \\moodle_url('/mod/book/view.php', $params);\n }"
] | [
"protected function setup_table() {\n $filter = $this->setup_filters();\n $this->tablelog = new report_loglive_table_log('report_loglive', $filter);\n $this->tablelog->define_baseurl($this->url);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Lookup value for a PluginOption instance
Args:
po: PluginOption
Returns: converted value | [
"def get(self, po):\n \n name = po.name\n typ = po.typ\n default = po.default\n\n handler = getattr(self, '_get_{}'.format(typ), None)\n if handler is None:\n raise ValueError(typ)\n self.seen.add(name)\n\n # pylint: disable=not-callable\n if... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Call the Middleware surface.
@return null | [
"private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Peek2 reads two first bytes at current position without advancing it.
// If there not enough data it returs 0. | [
"func (l *Scanner) Peek2() (a, b byte) {\n\tif l.pos == len(l.data) {\n\t\treturn 0, 0\n\t}\n\tif l.pos+1 == len(l.data) {\n\t\treturn l.data[l.pos], 0\n\t}\n\treturn l.data[l.pos], l.data[l.pos+1]\n}"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
Returns a list of ``datetime.timedelta`` objects representing the
durations of each interval in our list. | [
"def durations(self) -> List[datetime.timedelta]:\n \n return [x.duration() for x in self.intervals]"
] | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Adds output
@param key output field
@param value value
@return current instance | [
"public TaskResult addOutputData(String key, Object value) {\n this.outputData.put(key, value);\n return this;\n }"
] | [
"def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// notifyStatusChanged gets called by peer thunks | [
"func (pl *List) notifyStatusChanged(pid peer.Identifier) {\n\tpl.lock.Lock()\n\tdefer pl.lock.Unlock()\n\n\tif t := pl.availablePeers[pid.Identifier()]; t != nil {\n\t\t// TODO: log error\n\t\t_ = pl.handleAvailablePeerStatusChange(t)\n\t\treturn\n\t}\n\n\tif t := pl.unavailablePeers[pid.Identifier()]; t != nil {\... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Serialize this BatchResult result into a UNode tree. The root node is called
"batch-result".
@return This object serialized into a UNode tree. | [
"public UNode toDoc() {\r\n // Root node is map with 1 child per result field and optionally \"docs\".\r\n UNode result = UNode.createMapNode(\"batch-result\");\r\n for (String fieldName : m_resultFields.keySet()) {\r\n result.addValueNode(fieldName, m_resultFields.get(fieldName));\r... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// GetStringSlice returns the value associated with the key as a slice of strings. | [
"func (c *Context) GetStringSlice(key string) (ss []string) {\n\tif val, ok := c.Get(key); ok && val != nil {\n\t\tss, _ = val.([]string)\n\t}\n\treturn\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create a set of entities and upload to FireCloud.
Args
etype (str): one of {"sample, "pair", "participant"}
entities: iterable of firecloud.Entity objects. | [
"def create_set(self, set_id, etype, entities):\n \n if etype not in {\"sample\", \"pair\", \"participant\"}:\n raise ValueError(\"Unsupported entity type:\" + str(etype))\n\n payload = \"membership:\" + etype + \"_set_id\\t\" + etype + \"_id\\n\"\n\n for e in entities:\n ... | [
"def run(configObj=None, input_dict={}, loadOnly=False):\n \n # If called from interactive user-interface, configObj will not be\n # defined yet, so get defaults using EPAR/TEAL.\n #\n # Also insure that the input_dict (user-specified values) are folded in\n # with a fully populated configObj inst... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get a statement class given the name of the statement class. | [
"def get_statement_by_name(stmt_name):\n \"\"\"\"\"\"\n stmt_classes = get_all_descendants(Statement)\n for stmt_class in stmt_classes:\n if stmt_class.__name__.lower() == stmt_name.lower():\n return stmt_class\n raise NotAStatementName('\\\"%s\\\" is not recognized as a statement type... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Retrieves public filters.
@return mixed | [
"public function filters()\n {\n $filters = $this->files();\n\n if ($only = config('administrator.translations.filters.only', [])) {\n $filters = $filters->intersect($only);\n }\n\n if ($except = config('administrator.translations.filters.except', [])) {\n $filte... | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
If inside a side-effect, adds an effect to it. | [
"def add_effect(effect_id, *args, **kwargs):\n ''''''\n effect = fiber.get_stack_var(SIDE_EFFECT_TAG)\n if effect is None:\n return False\n effect.add_effect(effect_id, *args, **kwargs)\n return True"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
registering asset symlinker | [
"protected function registerAssetSymlinker()\n {\n// $this->app->singleton('asset.symlinker', function() {\n// $publicPath = sandbox_path('packages/antares');\n//\n// return new AssetSymlinker(new Filesystem, $publicPath);\n// });\n\n $this->app->singleton(AssetSymlinke... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Append to operation internal handler
@param bool $append
@throws Exception | [
"protected function insertIntoInternal($append)\n {\n $this->checkNode(false);\n if ($this->owner->{$this->keyAttribute} !== null) {\n $path = $this->convertPathFromPgToPhp($this->node->{$this->pathAttribute});\n $path[] = $this->node->{$this->keyAttribute};\n $this... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// ServeTCPConn runs on a single tcp connection. ServeTCPConn blocks, serving
// the connection until the client hangs up. The caller typically invokes
// ServeTCPConn in a go statement. | [
"func (service *TCPService) ServeTCPConn(conn *net.TCPConn) {\n\tconn.SetLinger(service.Linger)\n\tconn.SetNoDelay(service.NoDelay)\n\tconn.SetKeepAlive(service.KeepAlive)\n\tif service.KeepAlivePeriod > 0 {\n\t\tconn.SetKeepAlivePeriod(service.KeepAlivePeriod)\n\t}\n\tif service.TLSConfig != nil {\n\t\ttlsConn := ... | [
"func (d *Dispatcher) Stop() error {\n\td.mu.Lock()\n\tif !d.isRunning() {\n\t\td.mu.Unlock()\n\t\treturn errors.New(\"dispatcher is already stopped\")\n\t}\n\n\tlog := log.G(d.ctx).WithField(\"method\", \"(*Dispatcher).Stop\")\n\tlog.Info(\"dispatcher stopping\")\n\td.cancel()\n\td.mu.Unlock()\n\n\td.processUpdate... | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Container management:"
} |
eq succeeds if and only if value1 == value2
<p>Stack: ..., value1, value2 => ...
@param type
@param target
@throws IOException | [
"public void if_tcmpeq(TypeMirror type, String target) throws IOException\n {\n pushType(type);\n if_tcmpeq(target);\n popType();\n }"
] | [
"def backward_word(self, e): # (M-b)\r\n \"\"\"\r\n self.l_buffer.backward_word(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns true if point p1 and p2 are close to the line defined by points p0 and p3. | [
"boolean areMiddlePointsClose( Point2D_F64 p0 , Point2D_F64 p1 , Point2D_F64 p2 , Point2D_F64 p3 ) {\n\t\tUtilLine2D_F64.convert(p0,p3,line);\n\n\t\t// (computed expected length of a square) * (fractional tolerance)\n\t\tdouble tol1 = p0.distance(p1)*distanceTol;\n\n\t\t// see if inner points are close to the line\... | [
"@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 Github description about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Allows the user to change their password after a password reset email.
@param $userId
@param $key
@return string | [
"public function resetPassword($userId, $key)\n {\n $user = $this->userStore->getById($userId);\n $userKey = md5(date('Y-m-d') . $user->getHash());\n\n if (empty($user) || $key != $userKey) {\n $this->view->error = Lang::get('reset_invalid');\n return $this->view->rende... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
helper function to validate tags are correct | [
"def _tags_present(name, tags, vpc_id=None, vpc_name=None, region=None,\n key=None, keyid=None, profile=None):\n '''\n \n '''\n ret = {'result': True, 'comment': '', 'changes': {}}\n if tags:\n sg = __salt__['boto_secgroup.get_config'](name=name, group_id=None, region=region, ... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return the list of available state in this class.
@return array | [
"public function listMethodsByStates()\n {\n $methodsList = array();\n foreach ($this->getStatesList() as $stateName => $stateContainer) {\n $methodsList[$stateName] = $stateContainer->listMethods();\n }\n\n ksort($methodsList);\n\n return $methodsList;\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Send message to syslog and stdio
@return {undefined}
@api private | [
"function send (severity, msg) {\n var len \n output(severity, msg, msg.length)\n\n // this should probably be 1024\n if (msg.length > 1024)\n process.stderr.write(new Error('maximum log length is 1024 bytes') +'\\n')\n\n if (rc.syslog) {\n // add a hashtag based on the severity level\n msg = formatIf... | [
"def cancel_link_unlink_mode(self):\n \"\"\"\"\"\"\n self.logger.info(\"cancel_link_unlink_mode\")\n self.scene_command('08')\n # should send http://0.0.0.0/0?08=I=0\n\n ## TODO check return status\n status = self.hub.get_buffer_status()\n return status"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get actual length
@param string $text Original text
@return int Actual length | [
"private function _getActualLength ( $text ) {\n $convertedText = $this->_convertTagsToEscapeSequences($text);\n $strippedText = $this->_stripEscapeSequences($convertedText);\n $length = mb_strlen($strippedText, 'utf-8');\n return $length;\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Update the access levels of the modules.
@param Collection $modules
@param string $column
@param ServerRequestInterface $request
@return void | [
"private function updateOrder(Collection $modules, string $column, ServerRequestInterface $request): void\n {\n $order = (array) ($request->getParsedBody()['order'] ?? []);\n $order = array_flip($order);\n\n foreach ($modules as $module) {\n DB::table('module')\n ->... | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
// SetAvailabilityZone sets the AvailabilityZone field's value. | [
"func (s *CreateDBInstanceReadReplicaInput) SetAvailabilityZone(v string) *CreateDBInstanceReadReplicaInput {\n\ts.AvailabilityZone = &v\n\treturn s\n}"
] | [
"@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Indefinitely checks the writer queue for data to write
to socket. | [
"def _writer(self):\n \n while not self.closed:\n try:\n sock, data = self._write_queue.get(timeout=0.1)\n self._write_queue.task_done()\n sock.send(data)\n except Empty:\n pass # nothing to write after timeout\n ... | [
"@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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
simple string interpolation | [
"function stringSupplant(str, values) {\r\n\t\treturn str.replace(/#\\{(\\w+)\\}/g, function(match, name) {\r\n\t\t\treturn values[name] || \"\";\r\n\t\t});\r\n\t}"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets logo height.
@return the logo url | [
"public long getLogoWidth() {\n try {\n val items = getLogoUrls();\n if (!items.isEmpty()) {\n return items.iterator().next().getWidth();\n }\n } catch (final Exception e) {\n LOGGER.debug(e.getMessage(), e);\n }\n return DEFAULT... | [
"public String getHeader()\n {\n if (this.header == null)\n {\n if (this.headerKeys == null)\n {\n this.headerKeys = new String[2];\n this.headerKeys[0] = getPropertyName() + \".header\";\n this.headerKeys[1] = getPropertyName();\n ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Execute the console command.
@return mixed | [
"public function fire()\n {\n $name = $this->argument('name');\n $force = $this->option('force');\n $basePath = realpath(__DIR__ . '/../../..');\n $namespace = config('admin-generator.namespace');\n $engine = config(\"admin-generator.instances.{$name}.engine\");\n\... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Create an environment in the Chef server.
//
// Chef API docs: https://docs.chef.io/api_chef_server.html#environments | [
"func (e *EnvironmentService) Create(environment *Environment) (data *EnvironmentResult, err error) {\n\tbody, err := JSONReader(environment)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = e.client.magicRequestDecoder(\"POST\", \"environments\", body, &data)\n\treturn\n}"
] | [
"def _generate_api_gateway(self):\n \n self.tf_conf['resource']['aws_api_gateway_rest_api']['rest_api'] = {\n 'name': self.resource_name,\n 'description': self.description\n }\n self.tf_conf['output']['rest_api_id'] = {\n 'value': '${aws_api_gateway_rest_... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Find _all_ paths matching `name` and `version`. Returning an array. | [
"def find_all(name, version = nil)\n matched = []\n find(name, version) {|p| matched << p }\n matched\n end"
] | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// makeProviderMap creates a map of providers like this:
//
// var InternalProviders = map[string]plugin.ProviderFunc{
// "aws": aws.Provider,
// "azurerm": azurerm.Provider,
// "cloudflare": cloudflare.Provider, | [
"func makeProviderMap(items []plugin) string {\n\toutput := \"\"\n\tfor _, item := range items {\n\t\toutput += fmt.Sprintf(\"\\t\\\"%s\\\": %s.%s,\\n\", item.PluginName, item.ImportName, item.TypeName)\n\t}\n\treturn output\n}"
] | [
"func SampleCloudSpec() environs.CloudSpec {\n\tcred := cloud.NewCredential(cloud.UserPassAuthType, map[string]string{\"username\": \"dummy\", \"password\": \"secret\"})\n\treturn environs.CloudSpec{\n\t\tType: \"dummy\",\n\t\tName: \"dummy\",\n\t\tEndpoint: \"dummy-endpoint\",\n\t\t... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Returns the default value for a new LogRecord's threadID. | [
"private int defaultThreadID() {\n long tid = Thread.currentThread().getId();\n if (tid < MIN_SEQUENTIAL_THREAD_ID) {\n return (int) tid;\n } else {\n Integer id = threadIds.get();\n if (id == null) {\n id = nextThreadId.getAndIncrement();\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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Vert.x calls the stop method when the verticle is undeployed.
Put any cleanup code for your verticle in here
@throws Exception | [
"@Override\n public void stop(Future<Void> stopFuture) throws Exception {\n // Stop the real verticle\n if (realVerticle != null) {\n realVerticle.stop(stopFuture);\n realVerticle = null;\n }\n }"
] | [
"public static void main(final String[] args) {\n // create the croquet object through the builder\n final CroquetWicket<CrmSettings> croquet = configureBuilder(CrmSettings.class, args).build();\n\n // get the custom settings for the application\n // if custom settings aren't needed for ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Checks, that document is deleted
@param integer
@return boolean | [
"public function isDeleted($id)\n {\n if ($this->_deleted === null) {\n return false;\n }\n\n if (extension_loaded('bitset')) {\n return bitset_in($this->_deleted, $id);\n } else {\n return isset($this->_deleted[$id]);\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Free the node unsetting the pointers to other objects.
MUST clear entity manager after doing this! | [
"public function free()\n\t{\n\t\tif ( ! is_null($this->nestedSetNode)) {\n\t\t\t$this->nestedSetNode->free($this);\n\t\t\t$this->nestedSetNode = null;\n\t\t}\n\t}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github text about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about programming:"
} |
Return the object dict and mgmt ip for a firewall. | [
"def get_fw_dev_map(self, fw_id):\n \n for cnt in self.res:\n if fw_id in self.res.get(cnt).get('fw_id_lst'):\n return self.res[cnt].get('obj_dict'), (\n self.res[cnt].get('mgmt_ip'))\n return None, None"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github sentence about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code about Technology:"
} |
// SetArn sets the Arn field's value. | [
"func (s *Gateway) SetArn(v string) *Gateway {\n\ts.Arn = &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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Ajoute un validator
@param $rule
@param null $method
@param array $params
@param null $message
@return $this | [
"public function addRule($rule, $method = null, $params = [], $message = null)\n {\n\n // construction des paramètres\n array_unshift($params, $rule, $method);\n\n call_user_func_array([$this->getValidator(), 'addRule'], $params);\n\n if (!is_null($message)) {\n if(is_array... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Read a RES2DINV-style file produced by the ABEM export program. | [
"def add_dat_file(filename, settings, container=None, **kwargs):\n \n # each type is read by a different function\n importers = {\n # general array type\n 11: _read_general_type,\n }\n\n file_type, content = _read_file(filename)\n\n if file_type not in importers:\n raise Excep... | [
"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:"
} |
Set salt, encrypt password and set it on the user object
@param User $user User object to manipulate
@param string $password Password to encrypt and store | [
"public function setPassword(User $user, $password)\n {\n $encoder = $this->container->get('security.encoder_factory')\n ->getEncoder($user);\n\n $salt = $this->createSalt();\n\n $encryptedPassword = $encoder->encodePassword($password, $salt);\n\n $user\n ->setPa... | [
"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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Material Design Ripple 拡張
@param {jQuery} $ui [in] 検索対象の jQuery オブジェクト
@param {DomExtensionOptions} [options] [in] オプション | [
"function applyDomExtension($ui, options) {\n var NO_RIPPLE_CLASS = [\n \".ui-ripple-none\",\n \".ui-flipswitch-on\",\n \".ui-slider-handle\",\n \".ui-input-clear\",\n ];\n var selector = \".ui-b... | [
"function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns a row by ID. The ID is either the index of the row or {@link ID_SUMMARY_ROW}.
@param int $id The row ID.
@return Row|false The Row or false if not found. | [
"public function getRowFromId($id)\n {\n if (!isset($this->rows[$id])) {\n if ($id == self::ID_SUMMARY_ROW\n && !is_null($this->summaryRow)\n ) {\n return $this->summaryRow;\n }\n return false;\n }\n return $this->rows... | [
"public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Stops the MessagingClient, shuts down connections. If the unsubscribe
parameter is set to true, all durable subscriptions will be removed.
@param unsubscribe | [
"public void stop(boolean unsubscribe) throws MessagingException {\n try {\n if (unsubscribe) {\n m_jmsManager.unsubscribeAllDurable();\n }\n m_jmsManager.close();\n m_jmsManager = null;\n m_connected = false;\n } catch (MessagingEx... | [
"func (e *endpoint) Attach(dispatcher stack.NetworkDispatcher) {\n\te.dispatcher = dispatcher\n\t// Link endpoints are not savable. When transportation endpoints are\n\t// saved, they stop sending outgoing packets and all incoming packets\n\t// are rejected.\n\tgo e.dispatchLoop()\n}"
] | codesearchnet | {
"query": "Represent the Github comment about Messaging:",
"pos": "Represent the Github code about Messaging:",
"neg": "Represent the Github code about Software development:"
} |
Sets the options based on a MarkerOptions object
@param MarkerOptions $markerOptions | [
"public function setOptions(MarkerOptions $markerOptions)\n {\n $options = array_filter($markerOptions->options);\n $this->options = ArrayHelper::merge($this->options, $options);\n }"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Detects account type by invoking the Webex Teams People ressource - HUMAN if the token corresponds to a bot account, - BOT otherwise cb function signature should be (err, type, account) where type: HUMAN|BOT, account: People JSON structure | [
"function detectAccount(token, cb) {\n\t//console.log(\"checking account\");\n\tvar options = {\n\t\t\t\t\t\t'method': 'GET',\n\t\t\t\t\t\t'hostname': 'api.ciscospark.com',\n\t\t\t\t\t\t'path': '/v1/people/me',\n\t\t\t\t\t\t'headers': {'authorization': 'Bearer ' + token}\n\t\t\t\t\t};\n\tvar req = https.request(opt... | [
"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 instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns a value enum given a property enum and one of its value names. Does not throw.
@return value enum, or UProperty.UNDEFINED if not defined for that property | [
"public int getPropertyValueEnumNoThrow(int property, CharSequence alias) {\n int valueMapIndex=findProperty(property);\n if(valueMapIndex==0) {\n return UProperty.UNDEFINED;\n }\n valueMapIndex=valueMaps[valueMapIndex+1];\n if(valueMapIndex==0) {\n return UP... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
//CreateConnectionDefinition for a new client connection | [
"func CreateConnectionDefinition(couchDBAddress, username, password string, maxRetries,\n\tmaxRetriesOnStartup int, requestTimeout time.Duration, createGlobalChangesDB bool) (*CouchConnectionDef, error) {\n\n\tlogger.Debugf(\"Entering CreateConnectionDefinition()\")\n\n\tconnectURL := &url.URL{\n\t\tHost: couchDB... | [
"@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 summarization about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about Programming:"
} |
Returns true for commands like ^<CLIENT>\tA<NAME> | [
"function() {\n switch(self.command) {\n case constants.WHOIS:\n return (self.params[0][0]!=\"A\");\n case constants.GENERALINFO: // server-to-client\n return (self.params[0][0]!='c') && (self.params.length >= 2);\n default:\n retu... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Process a server request and return a response. | [
"public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $begin = microtime(true);\n $response = $handler->handle($request);\n $end = microtime(true);\n\n $message = $this->format;\n $message = $this->replaceConstantDi... | [
"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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Render a RadioButton
@param RadioButton $radioButton
@return string | [
"public function radioButton(RadioButton $radioButton)\n {\n $tag = new Tag('input');\n $tag->setAttribute('type', 'radio');\n\n if (!$radioButton->getId() && $radioButton->getLabel()) {\n $radioButton->setId('field-' . uniqid('radiobutton'));\n }\n\n if ($radioButto... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Determine the current website data.
Returns null if the web site is not found in the websites table.
@return array | [
"public static function currentWebsiteData()\n {\n static $current_data;\n $BASE_URL = static::currentServerName();\n $cache_key = 'website-data.' . $BASE_URL;\n\n // Get the current ID from the cache if it is present.\n if (empty($current_data)) {\n if (Cache::has(... | [
"@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 post about database:",
"pos": "Represent the Github code about database:",
"neg": "Represent the Github code about Programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.