query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Display the RWhois information for your account. | [
"def cli(env):\n \"\"\"\"\"\"\n\n mgr = SoftLayer.NetworkManager(env.client)\n result = mgr.get_rwhois()\n\n table = formatting.KeyValueTable(['name', 'value'])\n table.align['name'] = 'r'\n table.align['value'] = 'l'\n table.add_row(['Name', result['firstName'] + ' ' + result['lastName']])\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns `val`'s relshell compatible type.
:param val: value to check relshell equivalent type
:raises: `NotImplementedError` if val's relshell compatible type is not implemented. | [
"def equivalent_relshell_type(val):\n \n builtin_type = type(val)\n if builtin_type not in Type._typemap:\n raise NotImplementedError(\"builtin type %s is not convertible to relshell type\" %\n (builtin_type))\n relshell_type_str = Type._ty... | [
"def _slice_value(index, context=None):\n \"\"\"\"\"\"\n\n if isinstance(index, Const):\n if isinstance(index.value, (int, type(None))):\n return index.value\n elif index is None:\n return None\n else:\n # Try to infer what the index actually is.\n # Since we can't... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Text analysis:"
} |
Given a node of the form (2 + 4 + 5)x -- ie the coefficients have been grouped for adding -- add the coefficients together to make a new coeffient that is a constant or constant fraction. | [
"function evaluateCoefficientSum(node) {\n // the node is now always a * node with the left child the coefficent sum\n // e.g. (2 + 4 + 5) and the right node the symbol part e.g. x or y^2\n // so we want to evaluate args[0]\n const coefficientSum = clone(node).args[0];\n const childStatus = evaluateConstantSum... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Returns the lines from AdditionalConfiguration.php file without own additions
@param string $extensionKey Extension key | [
"protected function getCleanAdditionalConfiguration($extensionKey)\n {\n $newLines = [];\n\n // Load content and search for the include\n if (($content = GeneralUtility::getUrl($this->getConfigurationManager()->getAdditionalConfigurationFileLocation())) !== false)\n {\n $cu... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return a JSON encoded scalar array of index names.
@return Response | [
"public function indexesAction()\n {\n return $this->viewHandler->handle(\n View::create(\n array_map(\n function($indexName) {\n $indexConfiguration = $this->indexConfigurationProvider->getIndexConfiguration($indexName);\n\n ... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Documentation:"
} |
Or where like statement
@param $column
@param $value
@return $this | [
"public function orWhereLike($column, $value)\n {\n try {\n if (!is_null($this->query)) {\n $this->query .= ' OR '.$column. ' LIKE \"'.$value.'\"';\n return $this;\n }\n\n } catch (\\Exception $exception) {\n var_dump($exception->getMes... | [
"protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Import taxonomy terms. | [
"protected function importTaxonomyTerms() {\n $data = $this->loadDataArray('taxonomy');\n if (!empty($data)) {\n\n $uuids = [];\n\n foreach ($data as $item) {\n\n // Prepare content.\n $values = [\n 'vid' => $item['vid'],\n 'name' => $item['name'],\n ];\n\n ... | [
"protected function parentId()\n\t{\n\t\tswitch ( $this->position )\n\t\t{\n\t\t\tcase 'root':\n\t\t\t\treturn null;\n\n\t\t\tcase 'child':\n\t\t\t\treturn $this->target->getKey();\n\n\t\t\tdefault:\n\t\t\t\treturn $this->target->getParentId();\n\t\t}\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Use this API to fetch filtered set of policypatset resources.
set the filter parameter values in filtervalue object. | [
"public static policypatset[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{\n\t\tpolicypatset obj = new policypatset();\n\t\toptions option = new options();\n\t\toption.set_filter(filter);\n\t\tpolicypatset[] response = (policypatset[]) obj.getfiltered(service, option);\n\t\treturn res... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// UnmarshalYAML implements the yaml.Unmarshaler interface. | [
"func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tif err := unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\tdur, err := ParseDuration(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*d = dur\n\treturn nil\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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Consulta el último No de Comprobante registrado | [
"def ConsultarUltimoComprobante(self, tipo_cbte=151, pto_vta=1):\n \"\"\n ret = self.client.consultarUltimoNroComprobantePorPtoVta(\n auth={\n 'token': self.Token, 'sign': self.Sign,\n 'cuit': self.Cuit, },\n solicitud... | [
"def create_card\n raise StandardError, 'Cliente null' if @client.nil?\n # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta\n card = PayuLatam::Card.new(@client)\n # hay un metodo card_params que genera el objeto a enviar con los datos correctos\n # s... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Forward status updates via callbacks
@param [Symbol] type of client: :auth, :api, or :router
@param [Symbol] state of client
@return [Hash] status of various clients | [
"def update_status(type, state)\n @status[type] = state\n (@status_callbacks || []).each do |callback|\n begin\n callback.call(type, state)\n rescue RuntimeError => e\n ErrorTracker.log(self, \"Failed status callback\", e, nil, :caller)\n end\n end\n @statu... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Called by a handler to notify the controller that a request is
being processed. | [
"def active_io(self, iocb):\n \"\"\"\"\"\"\n if _debug: IOController._debug(\"active_io %r\", iocb)\n\n # requests should be idle or pending before coming active\n if (iocb.ioState != IDLE) and (iocb.ioState != PENDING):\n raise RuntimeError(\"invalid state transition (current... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Get name: /first(first|second)*/
// Do not set d.err if the name is missing (unless unexpected EOF is received):
// let the caller provide better context. | [
"func (d *Decoder) name() (s string, ok bool) {\n\td.buf.Reset()\n\tif !d.readName() {\n\t\treturn \"\", false\n\t}\n\n\t// Now we check the characters.\n\ts = d.buf.String()\n\tif !isName([]byte(s)) {\n\t\td.err = d.syntaxError(\"invalid XML name: \" + s)\n\t\treturn \"\", false\n\t}\n\treturn s, true\n}"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the collection name for a given document class.
:param cls: The document class for which to return the collection name.
:returns: The collection name for the given class. | [
"def get_collection_for_cls_name(self, cls_name):\n \n for cls in self.classes:\n if cls.__name__ == cls_name:\n return self.classes[cls]['collection']\n raise AttributeError(\"Unknown class name: %s\" % cls_name)"
] | [
"def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Executes a given block with an "anonymous" temporary file.
The temporary file is deleted at the end of the block, and its contents
are returned. | [
"def with_temporary_files(file_contents='', dest_extension = '', source_extension = '', message=nil)\n\n #File mode for all of the created temporary files.\n #Create the files, and allow read/write, but do not lock for exclusive access.\n file_mode = File::CREAT | File::RDWR\n\n #Create a new fi... | [
"public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
// Create takes the representation of a imageSignature and creates it. Returns the server's representation of the imageSignature, and an error, if there is any. | [
"func (c *imageSignatures) Create(imageSignature *image.ImageSignature) (result *image.ImageSignature, err error) {\n\tresult = &image.ImageSignature{}\n\terr = c.client.Post().\n\t\tResource(\"imagesignatures\").\n\t\tBody(imageSignature).\n\t\tDo().\n\t\tInto(result)\n\treturn\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Creates a secure random token.
@param int|null $length Token length
@return string
@see http://stackoverflow.com/a/29137661/2020428 | [
"public static function random($length = null)\n {\n if ($length === null) {\n $length = Configure::read('Muffin/Tokenize.length', self::DEFAULT_LENGTH);\n }\n\n return bin2hex(Security::randomBytes($length / 2));\n }"
] | [
"public static function getStrength()\n {\n /**\n * Prior to PHP 5.6.12 (see https://bugs.php.net/bug.php?id=70014) the \"openssl_random_pseudo_bytes\"\n * was using \"RAND_pseudo_bytes\" (predictable) instead of \"RAND_bytes\" (unpredictable).\n * Release notes: http://php.net/Cha... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Resolves the collection values and keys
@return Array_|Collection | [
"private function resolveCollection(\\ArrayIterator $tokens, Type $classType, Context $context)\n {\n $isArray = ('array' === (string) $classType);\n\n // allow only \"array\" or class name before \"<\"\n if (!$isArray\n && (! $classType instanceof Object_ || $classType->getFqsen(... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Create a minimal producer configuration that can be used to produce to this broker
@return Properties | [
"public Properties producerConfig() {\n Properties props = new Properties();\n props.put(\"bootstrap.servers\", connectionString());\n props.put(\"acks\", \"all\");\n props.put(\"batch.size\", \"100\");\n props.put(\"client.id\", \"kafka-junit\");\n props.put(\"request.time... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Return all classes and interfaces (including those inside
packages) to be documented. | [
"public ClassDoc[] classes() {\n ListBuffer<ClassDocImpl> classesToDocument = new ListBuffer<>();\n for (ClassDocImpl cd : cmdLineClasses) {\n cd.addAllClasses(classesToDocument, true);\n }\n for (PackageDocImpl pd : cmdLinePackages) {\n pd.addAllClassesTo(classesTo... | [
"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:"
} |
// A list of all the log entries. This should only be used for debugging purposes. | [
"func (s *server) LogEntries() []*LogEntry {\n\ts.log.mutex.RLock()\n\tdefer s.log.mutex.RUnlock()\n\treturn s.log.entries\n}"
] | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Determines if the instances contains a date.
@see \Carbon\Carbon::between
@param CarbonDate $date
@param bool $equal Indicates if a > and < comparison should be used or <= or >=
@return bool | [
"public function contains(CarbonDate $date, $equal = true)\n {\n return $date->between($this->startDate, $this->endDate, $equal);\n }"
] | [
"public function addWhere($column, $operator = null, $value = null, $boolean = 'and')\n {\n if ($boolean !== 'and') {\n throw new NotSupportedException('Only support \"and\" in where clause');\n }\n\n // Here we will make some assumptions about the operator. If only 2 values are\n... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Register the service provider
@return void | [
"public function register()\n\t{\n\t\t$this->app['arguments'] = function($app)\n\t\t{\n\t\t\tglobal $argv;\n\n\t\t\t// Register namespace for App commands and component commands\n\t\t\t// @FIXME: neither of these work yet...\n\t\t\tArguments::registerNamespace('\\App\\Commands');\n\t\t\tArguments::registerNamespace... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// MeasurementNames returns a list of sorted measurement names. | [
"func (s MeasurementStats) MeasurementNames() []string {\n\ta := make([]string, 0, len(s))\n\tfor name := range s {\n\t\ta = append(a, name)\n\t}\n\tsort.Strings(a)\n\treturn a\n}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the post about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
this action handler the callback sent from the bank.
@throws NotFoundHttpException
@throws UnauthorizedHttpException
@return Response | [
"public function callbackAction()\n {\n try {\n $response = $this->getPaymentHandler()->getPaymentCallbackResponse($this->getCurrentRequest());\n } catch (EntityNotFoundException $ex) {\n throw new NotFoundHttpException($ex->getMessage());\n } catch (InvalidTransactionE... | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Documentation:"
} |
Adds the download button.
@param view layout which displays the log file | [
"private void addDownloadButton(final CmsLogFileView view) {\n\n Button button = CmsToolBar.createButton(\n FontOpenCms.DOWNLOAD,\n CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0));\n button.addClickListener(new ClickListener() {\n\n private static final... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
**********************************************************************************************
FORMATS THE TIME
********************************************************************************************** | [
"function formatTime(time) {\r\n\t\t\t\tif (time == '') {\r\n\t\t\t\t\tif (settings.required) return settings.duration ? '0:00' : '00:00';\r\n\t\t\t\t\telse return time;\r\n\t\t\t\t}\r\n\t\t\t\tif ((new RegExp('^(-|\\\\+)?([0-9]+)(.([0-9]{1,2})?)?$', 'i')).test(time)) {\r\n\t\t\t\t\tvar hour = parseInt(RegExp.$2);\... | [
"private void populateMilestone(Row row, Task task)\n {\n task.setMilestone(true);\n //PROJID\n task.setUniqueID(row.getInteger(\"MILESTONEID\"));\n task.setStart(row.getDate(\"GIVEN_DATE_TIME\"));\n task.setFinish(row.getDate(\"GIVEN_DATE_TIME\"));\n //PROGREST_PERIOD\n //SYMBO... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Data management:"
} |
/*
(non-Javadoc)
@see
javax.servlet.http.HttpServletRequestWrapper#isUserInRole(java.lang.String
) | [
"@Override\n public boolean isUserInRole(String role) {\n if (userRoles == null) {\n return false;\n }\n\n return userRoles.contains(role);\n }"
] | [
"@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com.... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
校验数据
@param array $attributes
@return bool
@throws \One\Validation\Exceptions\ValidationException | [
"public function validate(array $attributes): bool\n {\n $rules = $this->getScenarios();\n\n foreach ($rules as $rule) {\n $names = array_map('trim', explode(',', $rule[0]));\n array_walk($names, function ($name) use ($attributes, $rule) {\n $this->validateValue... | [
"public static function ReadSuidSession ($name = null) {\n\t\tif (!static::SeesionOnSu()) {\n\t\t\tthrow \\ickx\\fw2\\core\\exception\\CoreException::RaiseSystemError('suidセッションが開始されていません。');\n\t\t}\n\t\treturn Session::Read(static::_GetSeesionLayerPath($name));\n\t}"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// NewSplitDiffWorker returns a new SplitDiffWorker object. | [
"func NewSplitDiffWorker(wr *wrangler.Wrangler, cell, keyspace, shard string, sourceUID uint32, excludeTables []string, minHealthyRdonlyTablets, parallelDiffsCount int, tabletType topodatapb.TabletType) Worker {\n\treturn &SplitDiffWorker{\n\t\tStatusWorker: NewStatusWorker(),\n\t\twr: ... | [
"@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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates an HTML form control getting its object by its name.
@param string HTML name for this control.
@return string | [
"public function renderControl($name) {\n\n\t\t// gets control object\n\t\t$control = $this->getControl($name);\n\t\t\n\t\tif ($control) {\n\t\t\t\n\t\t\t// adds common CSS classes to requested control\n\t\t\tif (count($this->controlClasses)) {\n\t\t\t\t$control->addClass(implode(' ', $this->controlClasses));\n\t\t... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Get the name of the session variable.
@param \Sonata\Component\Customer\CustomerInterface $customer
@return string | [
"protected function getSessionVarName(CustomerInterface $customer = null)\n {\n if (null === $customer || null === $customer->getId()) {\n return self::SESSION_BASE_NAME.'new';\n }\n\n return self::SESSION_BASE_NAME.$customer->getId();\n }"
] | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
ApplyImpule applies the motors impulse to the connected bodies.
*/ | [
"func (joint *SimpleMotor) ApplyImpulse() {\n\ta := joint.BodyA\n\tb := joint.BodyB\n\t\n\t// compute relative rotational velocity\n\twr := b.w - a.w + joint.rate\n\t\n\tjMax := joint.MaxForce\n\t\n\t// compute normal impulse\n\tj := -wr*joint.iSum\n\tjOld := joint.jAcc\n\tjoint.jAcc = clamp(jOld + j, -jMax, jMax)\... | [
"def do(actor, targets)\n #Acceleration will be limited by elapsed time.\n pull_force = delta\n targets.each do |target|\n #Angle from target to actor is also angle of pull force (opposite of that for push).\n pull_angle = Utility.find_angle(target.location, actor.location)\n #Apply the forc... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Recursively pop last element from extremity tree
@return ParseNode | [
"function abs_pop(){\n\t\t$Node = $this->abs_end();\n\t\tif( is_null($Node->pidx) ){\n\t\t\t// cannot pop self from self\n\t\t\treturn false;\n\t\t}\n\t\t// pop node from it's parent\n\t\treturn $Node->get_parent()->pop();\n\t}"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Search pre-trained word vectors by their language
:param lang: str, default ''
:return: None
print search result as pandas DataFrame | [
"def search(lang=''):\n \n df = load_datasets()\n if lang == '':\n print(df[['Name', 'Dimension', 'Corpus', 'VocabularySize', 'Method', 'Language', 'Author']])\n else:\n rows = df[df.Language==lang]\n print(rows[['Name', 'Dimension', 'Corpus', 'VocabularySize', 'Method', 'Language',... | [
"def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"def do_execute(self):\n \n if isinstance(self.input.payload, Instances):\n inst = None\n data = self.input.payload\n elif isinstance(self.input.payload, Instance):\n inst = self.input.payload\n data = inst.dataset\n\n index = str(self.resolve_... | [
"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:"
} |
Marshall the given parameter object. | [
"public void marshall(CreateIntegrationRequest createIntegrationRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createIntegrationRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.ma... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Pages through the get_entities_query endpoint to get all entities in
the workspace without crashing. | [
"def _entity_paginator(namespace, workspace, etype, page_size=500,\n filter_terms=None, sort_direction=\"asc\"):\n \n\n page = 1\n all_entities = []\n # Make initial request\n r = fapi.get_entities_query(namespace, workspace, etype, page=page,\n pa... | [
"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 post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Technology:"
} |
Enables / disables the use of wider sections
@param EXPANDED_SECTIONS_ENABLED | [
"public void setExpandedSectionsEnabled(final boolean EXPANDED_SECTIONS_ENABLED) {\n expandedSectionsEnabled = EXPANDED_SECTIONS_ENABLED;\n init(getInnerBounds().width, getInnerBounds().height);\n repaint(getInnerBounds());\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This function is to encrypt string.
@param string
@return encrypted hash | [
"public function encode($input)\n {\n $this->value = base64_encode(\n mcrypt_encrypt(\n MCRYPT_RIJNDAEL_256,\n $this->secureKey,\n $input,\n MCRYPT_MODE_ECB,\n $this->iv\n )\n );\n\n return $this... | [
"def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Toggles a native event on/off this is called by the EventDispatcher when
the first native event handler is added and when the last native event handler is removed.
@private | [
"function (name, state) {\n var self = this;\n\n // Never bind focus/blur since the FocusManager fakes those\n if (name == \"focus\" || name == \"blur\") {\n return;\n }\n\n if (state) {\n if (self.initialized) {\n bindEventDelegate(self, name);\n ... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Remove an array of items from the cache.
@param array $keys
@return array | [
"public function forgetMany(array $keys)\n {\n array_forget($this->storage, $this->prefixKeys($keys));\n\n return array_fill_keys($keys, true);\n }"
] | [
"protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
/*MinusDi - Minus Directional Indicator
Input = High, Low, Close
Output = double
Optional Parameters
-------------------
optInTimePeriod:(From 1 to 100000)
Number of period
*/ | [
"func MinusDi(high, low, close []float64, timePeriod int32) []float64 {\n\tvar outBegIdx C.int\n\tvar outNBElement C.int\n\toutReal := make([]float64, len(high))\n\tC.TA_MINUS_DI(0, C.int(len(high)-1), (*C.double)(unsafe.Pointer(&high[0])), (*C.double)(unsafe.Pointer(&low[0])), (*C.double)(unsafe.Pointer(&close[0])... | [
"public void init(Rec record, int iKeyDup, String strKeyName)\n {\n super.init(record, iKeyDup, strKeyName);\n m_iKeyActualLength = 0; // Actual Byte length\n m_iKeyByteLength = 0; // Key length (0-64 bytes) (including trailer bytes)\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
----- protected methods ----- | [
"private StructrPath checkPath(final Path obj) {\n\n\t\tif (obj == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\n\t\tif (!(obj instanceof StructrPath)) {\n\t\t\tthrow new ProviderMismatchException();\n\t\t}\n\n\t\treturn (StructrPath)obj;\n\t}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns a dictionary containing the details for a Dota 2 match
:param match_id: (int, optional)
:return: dictionary of matches, see :doc:`responses </responses>` | [
"def get_match_details(self, match_id=None, **kwargs):\n \n if 'match_id' not in kwargs:\n kwargs['match_id'] = match_id\n url = self.__build_url(urls.GET_MATCH_DETAILS, **kwargs)\n req = self.executor(url)\n if self.logger:\n self.logger.info('URL: {0}'.form... | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Home robot's head and plunger motors. | [
"def home(self, *args, **kwargs):\n \n\n # Home gantry first to avoid colliding with labware\n # and to make sure tips are not in the liquid while\n # homing plungers. Z/A axis will automatically home before X/Y\n self.poses = self.gantry.home(self.poses)\n # Then plungers\... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// addValues adds the fields of this struct to the passed in url.Values.
// It is important that all the fields of Registrant remain string type. | [
"func (reg *Registrant) addValues(u url.Values) error {\n\tif u == nil {\n\t\treturn errors.New(\"nil value passed as url.Values\")\n\t}\n\n\tval := reflect.ValueOf(*reg)\n\tt := val.Type()\n\tfor i := 0; i < val.NumField(); i++ {\n\t\tfieldName := t.Field(i).Name\n\t\tfield := val.Field(i).String()\n\t\tif ty := v... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
If the compensated sum is spuriously NaN from accumulating one
or more same-signed infinite values, return the
correctly-signed infinity stored in the simple sum. | [
"static double computeFinalSum(double[] summands) {\n // Better error bounds to add both terms as the final sum\n double tmp = summands[0] + summands[1];\n double simpleSum = summands[summands.length - 1];\n if (Double.isNaN(tmp) && Double.isInfinite(simpleSum))\n return simpl... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *ApplicationAutoScalingScalableTargetScalableTargetActionList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := ApplicationAutoScalingScalableTargetScalableTargetAction{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l... | [
"@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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Quote a value for use in a query.
@param $value
@return string | [
"public function quote($value)\n {\n if (is_array($value)) {\n $result = [];\n foreach ($value as $single) {\n $result[] = $this->quote($single);\n }\n return sprintf(\n '(%s)',\n implode(', ', $result)\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
クラスから、指定したgetterメソッド情報を取得します。
@param targetClass し抽出先のクラス
@param propertyName プロパティ名
@param propertyType プロパティタイプ
@return 存在しない場合、空を返します。 | [
"public static Optional<Method> extractGetter(final Class<?> targetClass, final String propertyName, final Class<?> propertyType) {\r\n \r\n final String methodName = \"get\" + Utils.capitalize(propertyName);\r\n \r\n Method method;\r\n try {\r\n method = targetClass.ge... | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
A file is deleted - delete the output.
This method deletes the generated js, js.map (source map) and declaration (d.ts) files.
@param file the file
@return {@literal true} as the pipeline should continue | [
"@Override\n public boolean fileDeleted(File file) {\n FileUtils.deleteQuietly(getOutputFile(file, \"js\"));\n FileUtils.deleteQuietly(getOutputFile(file, \"js.map\"));\n FileUtils.deleteQuietly(getOutputFile(file, \"d.ts\"));\n return true;\n }"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Find the import filename, | [
"function transform({ babel, filename, documentFilename }) {\n if (!filename) {\n throw new Error(\n `You must pass a filename to importMDX(). Please see the mdx.macro documentation`,\n )\n }\n let documentPath = path.join(filename, '..', documentFilename);\n let imports = `import React from 'react'\... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Define the functions of the rest API.
@return array Example:
[ 'listFiles' => [ 'method' => 'get', 'endpoint' => 'http://...', 'args' => [ 'folder' => PARAM_STRING ] ] ] | [
"public function get_api_functions() {\n return [\n 'list' => [\n 'endpoint' => 'https://graph.microsoft.com/v1.0/me/drive/{parent}/children',\n 'method' => 'get',\n 'args' => [\n '$select' => PARAM_RAW,\n '$expand'... | [
"function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Parse a line of the Nginx error log | [
"def parse(self, line):\n \"\"\"\"\"\"\n csv_list = line.split(\",\")\n date_time_message = csv_list.pop(0).split(\" \", 2)\n otherinfo = dict()\n\n for item in csv_list:\n key_value_pair = item.split(\":\", 1)\n key = key_value_pair[0].strip()\n\n ... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
获取一个thrift原始连接对象的方法
@param thriftConnectionHandle
thrift连接代理类对象
@return thrift连接对象
@throws ThriftConnectionPoolException
当获取连接出现问题时抛出该异常 | [
"public ThriftConnection<T> obtainInternalConnection(ThriftConnectionHandle<T> thriftConnectionHandle)\n\t\t\tthrows ThriftConnectionPoolException {\n\t\tboolean tryAgain;\n\t\tThriftConnection<T> result;\n\t\tThriftConnection<T> oldRawConnection = thriftConnectionHandle.getInternalConnection();\n\t\tThriftServerIn... | [
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Creates a new connection builder that can be used to create a web socket connection.
@param worker The XnioWorker to use for the connection
@param bufferPool The buffer pool
@param uri The connection URI
@return The connection builder | [
"public static ConnectionBuilder connectionBuilder(XnioWorker worker, ByteBufferPool bufferPool, URI uri) {\n return new ConnectionBuilder(worker, bufferPool, uri);\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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Function which runs on the pyboard. Matches up with send_file_to_remote. | [
"def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):\n \"\"\"\"\"\"\n import sys\n import ubinascii\n if HAS_BUFFER:\n try:\n import pyb\n usb = pyb.USB_VCP()\n except:\n try:\n import machine\n usb = mach... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Provide allows the ServiceFabric provider to provide configurations to traefik
// using the given configuration channel. | [
"func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool) error {\n\treturn p.updateConfig(configurationChan, pool, time.Duration(p.RefreshSeconds))\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Handle a a set of routes. If a pattern match is found, execute the handling function.
@param $routes Collection of route patterns
@param bool $fireAfterRoutingCallback
@return int The number of routes handled | [
"private function handle($routes, $fireAfterRoutingCallback = false)\n {\n // Counter to keep track of the number of routes we've handled\n $handledRequest = 0;\n\n $i = 0;\n // Loop all routes\n foreach ($routes as $route) {\n if ($matches = $this->isPatternMatches(... | [
"public function listen($uri, EventHandler $handler, $overRideYamlKey) {\n //CP-2 added this while working on calling listeners during core/components/render call\n //no need to add handlers that will never match our request\n //CP-265 - $overRideYamlKey - render component is the main __YML_KEY... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Construct action before running it.
@param $action
@param array $arguments
@throws \Shorty\Framework\Routing\Exceptions\HTTPException
@return bool | [
"private function constructAction($action, array $arguments = []): bool\n {\n if (is_callable($action)) {\n $this->pendingAction = $action;\n\n return true;\n } elseif (is_string($action)) {\n $actionParts = explode('@', $action);\n\n $controllerName = 'A... | [
"private function FindRouteMatch() {\n $route = new Route();\n $route->setDefaultUrl(Config::Init($this->app)->Get(\\Puzzlout\\Framework\\Enums\\AppSettingKeys::DefaultUrl));\n $this->getRoute($route, $this->url);\n return $route;\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
Delete action
POST
@param string $id | [
"public function delete($id)\n {\n $this->request->allowMethod('post');\n\n $menu = $this->Menus->get($id);\n if ($this->Menus->delete($menu)) {\n $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been deleted.', $menu->name));\n } else {\n ... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// parseSortFields parses the sort fields for an ORDER BY clause. | [
"func (p *Parser) parseSortFields() (SortFields, error) {\n\tvar fields SortFields\n\n\ttok, pos, lit := p.ScanIgnoreWhitespace()\n\n\tswitch tok {\n\t// The first field after an order by may not have a field name (e.g. ORDER BY ASC)\n\tcase ASC, DESC:\n\t\tfields = append(fields, &SortField{Ascending: (tok == ASC)... | [
"@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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// CiliumEndpoints returns a CiliumEndpointInformer. | [
"func (v *version) CiliumEndpoints() CiliumEndpointInformer {\n\treturn &ciliumEndpointInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}\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:"
} |
Sends the HTTP status header.
@param string|null $protocol
@return \m\Http\Response | [
"public function sendStatus($protocol = null)\n {\n if (null === $protocol) {\n $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';\n }\n header($protocol.' '.$this->_status.' '.$this->getStatusMessage($this->_status));\n\n return $thi... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
//See: http://godoc.org/labix.org/v2/mgo#Query.Sort | [
"func (self *Query) Sort(fields ...string) *Query {\n\n\tself.sort = append(self.sort, fields...)\n\n\treturn self\n}"
] | [
"func (b *Box) String(name string) string {\n\toncer.Deprecate(0, \"github.com/gobuffalo/packr/v2#Box.String\", \"Use github.com/gobuffalo/packr/v2#Box.FindString instead.\")\n\treturn string(b.Bytes(name))\n}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Timeout is an explicit operation timeout. | [
"func (s *IndicesPutTemplateService) Timeout(timeout string) *IndicesPutTemplateService {\n\ts.timeout = timeout\n\treturn s\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
日の個別データを返す
営業設定・休業設定・イベントなどが登録されている
@method getDayInfo
@param {Object} days
@param {date} date
@param {Boolean} create 存在しない場合は空の個別データを作成する
@return {Object} info | [
"function getDayInfo (days, date, create) {\n var key = createKey(date);\n var info = days[key];\n if (!info && create) {\n info = {events: []};\n days[key] = info;\n }\n return info || null;\n}"
] | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
模块设计器是否可用
@return bool | [
"public function canCreateModule()\n {\n $gii = Yii::$app->getModule($this->giiModuleName);\n return $gii !== null && isset($gii->generators[$this->giiGeneratorName]);\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github text about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
Initializes the session tracker.
Starts a new session, storing it on the current thread.
This allows Bugsnag to track error rates for a release. | [
"def start_session\n return unless Bugsnag.configuration.enable_sessions\n start_delivery_thread\n start_time = Time.now().utc().strftime('%Y-%m-%dT%H:%M:00')\n new_session = {\n :id => SecureRandom.uuid,\n :startedAt => start_time,\n :events => {\n :handled => 0,\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value. | [
"public Boolean getBooleanProperty(String key, Boolean defaultValue) {\n String val = getProperty(key, defaultValue.toString());\n Boolean booleanVal = Boolean.parseBoolean(val);\n return booleanVal;\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns a prime number which is very close to <code>desiredCapacity</code>
@param desiredCapacity the capacity desired by the user.
@return the capacity which should be used for a hash. | [
"public static final int nextPrime(final int desiredCapacity) {\n\t\tfinal int i = Arrays.binarySearch(primeCapacities, desiredCapacity);\n\t\treturn primeCapacities[((i < 0) ? ((-i) - 1) : i)];\n\t}"
] | [
"@Override\n public int getAvailablePermits() {\n int minPermits = Integer.MAX_VALUE;\n for (PoolLimitDeterminationStrategy strategy : strategies) {\n int availablePermits = strategy.getAvailablePermits();\n minPermits = Math.min(minPermits, availablePermits);\n }\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Used by {@link start_based_on()} to get the data needed to start a new
attempt from the point this attempt has go to.
@return array name => value pairs. | [
"public function get_resume_data() {\n $olddata = $this->qa->get_step(0)->get_all_data();\n $olddata = $this->qa->get_last_qt_data() + $olddata;\n $olddata = $this->get_our_resume_data() + $olddata;\n return $olddata;\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Callback when each frame in the peek drawer animation should be drawn. | [
"@SuppressLint(\"NewApi\")\n\tprivate void peekDrawerInvalidate() {\n\t\tif (mPeekScroller.computeScrollOffset()) {\n\t\t\tfinal int oldX = (int) mOffsetPixels;\n\t\t\tfinal int x = mPeekScroller.getCurrX();\n\t\t\tif (x != oldX) {\n\t\t\t\tsetOffsetPixels(x);\n\t\t\t}\n\n\t\t\tif (!mPeekScroller.isFinished()) {\n\... | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Validate ensures that config is a valid configuration. | [
"func Validate(c Config) error {\n\tif v, ok := c[IdentityPublicKey].(string); ok {\n\t\tvar key bakery.PublicKey\n\t\tif err := key.UnmarshalText([]byte(v)); err != nil {\n\t\t\treturn errors.Annotate(err, \"invalid identity public key\")\n\t\t}\n\t}\n\n\tif v, ok := c[IdentityURL].(string); ok {\n\t\tu, err := ur... | [
"@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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Adds the default creators
@param FTPWrapper $wrapper The FTPWrapper instance
@param FTPFilesystemManager $manager The Filesystem manager | [
"public function addDefaultFTPCreators(FTPWrapper $wrapper, FTPFilesystemManager $manager)\n {\n $this->addVotable(new FTPCreator\\RecursiveDirectoryCreator($wrapper, $manager));\n }"
] | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Return the class name of the module
@param string $name Module name
@return string | [
"public function getModuleClass ($name = FALSE)\n\t{\n\t\t\n\t\t// Set name if none is passed\n\t\t\n\t\tif ($name === FALSE)\n\t\t{\n\t\t\t$name\t= $this->get ('name');\n\t\t}\n\t\t\n\t\t// Convert . in module name to \\\n\t\t// and ucfirst each section\n\t\t\n\t\t$arr\t= explode ('.', $name);\n\t\t\n\t\tforeach (... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Executes the build.
@throws ConfigurationException
@throws Exception
@return void | [
"public function runBuild()\n {\n if (!$this->readyToRun) {\n return;\n }\n\n $project = new Project();\n\n self::setCurrentProject($project);\n set_error_handler(['Phing', 'handlePhpError']);\n\n $error = null;\n\n $this->addBuildListeners($project);\n... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
wechat_sender 向 wxpy 注册控制消息 handler | [
"def register_listener_handle(wxbot):\n \n from wxpy import TEXT\n\n @wxbot.bot.register(wxbot.default_receiver, TEXT, except_self=False)\n def sender_command_handle(msg):\n command_dict = {MESSAGE_REPORT_COMMAND: timeout_message_report(),\n MESSAGE_STATUS_COMMAND: generate... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// IMEILock IMEIロック | [
"func (api *SIMAPI) IMEILock(id int64, imei string) (bool, error) {\n\tvar (\n\t\tmethod = \"PUT\"\n\t\turi = fmt.Sprintf(\"%s/%d/sim/imeilock\", api.getResourceURL(), id)\n\t)\n\n\treturn api.modify(method, uri, map[string]interface{}{\n\t\t\"sim\": map[string]interface{}{\n\t\t\t\"imei\": imei,\n\t\t},\n\t})\n... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Convert an Object to a Timestamp, without an Exception | [
"public static java.sql.Timestamp getTimestamp(Object value) {\n try {\n return toTimestamp(value);\n } catch (ParseException pe) {\n pe.printStackTrace();\n return null;\n }\n }"
] | [
"public static PendingResult<TimeZone> getTimeZone(GeoApiContext context, LatLng location) {\n return context.get(\n API_CONFIG,\n Response.class,\n \"location\",\n location.toString(),\n // Java has its own lookup for time -> DST, so we really only need to fetch the TZ id.\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
display for read line Message
@param string $message Message to display
@param string $exit Exit script | [
"public static function outputAsReadLine(string $message, string $exit = \"yes\")\n {\n $colors = self::getManagerColorInstance();\n echo \"\\n\".$colors->getColoredStringReadLine($message, \"yellow\", \"transparent\");\n if ($exit == \"yes\") {\n exit();\n }\n }"
] | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the Github sentence about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Converts aaa-bbb-ccc to aaaBbbCcc | [
"public static String hyphenToCamelCase(String hyphenStr) {\n if (hyphenStr == null || hyphenStr.isEmpty()) return hyphenStr;\n int p = hyphenStr.indexOf('-');\n if (p == -1) return hyphenStr;\n StringBuilder sb = new StringBuilder(hyphenStr);\n do {\n int i = p + 1;\n ... | [
"def process(self, candidates):\n \n for c in candidates[:]:\n if c.locator not in self.good_locators:\n # TODO: search string, i.e. find \"EU_Street_Name\" in \"EU_Street_Name.GBR_StreetName\"\n candidates.remove(c)\n\n return candidates"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Fetch the repo. If the local copy was updated, return True. If the
local copy was already up-to-date, return False. | [
"def _fetch(self):\n '''\n \n '''\n origin = self.repo.remotes[0]\n refs_pre = self.repo.listall_references()\n fetch_kwargs = {}\n # pygit2 radically changed fetchiing in 0.23.2\n if self.remotecallbacks is not None:\n fetch_kwargs['callbacks'] = s... | [
"def update_command(yes, development, development_version):\n \n # enforce that pip MUST be installed\n # Why not just include it in the setup.py requirements? Mostly weak\n # reasons, but it shouldn't matter much.\n # - if someone has installed the CLI without pip, then they haven't\n # followe... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// IP gets the (remote) IP address of the client making the request. | [
"func (r *Request) IP() string {\n\tip, _, err := net.SplitHostPort(r.W.RemoteAddr().String())\n\tif err != nil {\n\t\treturn r.W.RemoteAddr().String()\n\t}\n\treturn ip\n}"
] | [
"function listen(self, address, port, addressType, backlog, exclusive) {\n /* TODO Index servers by a self-assigned identifier and the process\n * identifier so messages intended for previous instances do not pass\n * through. */\n servers[port] = self; // Index servers by port.\n self._port = port... | codesearchnet | {
"query": "Represent the Github text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Unescapes HTTP reserved and unwise characters in +str+ | [
"def unescape_uri(str)\n str = str.dup\n binary_encode(str)\n str.gsub(ESCAPED) { $1.hex.chr }\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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return input_fn wrapped for Estimator. | [
"def make_estimator_input_fn(self,\n mode,\n hparams,\n data_dir=None,\n force_repeat=False,\n prevent_repeat=False,\n dataset_kwargs=None):\n... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link MnType }{@code >}} | [
"@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"mn\")\n public JAXBElement<MnType> createMn(MnType value) {\n return new JAXBElement<MnType>(_Mn_QNAME, MnType.class, null, value);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"@Override\n public Page<Engagement> previousPage(final Page<Engagement> page, \n final TwilioRestClient client) {\n Request request = new Request(\n HttpMethod.GET,\n page.getPreviousPageUrl(\n Domains.STUDIO.toString(),\n ... | [
"@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }"
] | codesearchnet | {
"query": "Represent the text about Twilio:",
"pos": "Represent the code about Twilio:",
"neg": "Represent the code:"
} |
Prepare and run a subprocess cmd, returning a CompletedProcess. | [
"def run(cmd):\n \"\"\"\"\"\"\n print(\"Preparing the following cmd:\")\n cmd = prepare_subprocess_cmd(cmd)\n print(\"Running the following cmd:\")\n print('\\n'.join(cmd))\n return subprocess.run(cmd, stdout=sys.stdout, stderr=sys.stderr)"
] | [
"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 Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Save the facts in the system to the specified file.
The Python equivalent of the CLIPS save-facts command. | [
"def save_facts(self, path, mode=SaveMode.LOCAL_SAVE):\n \n ret = lib.EnvSaveFacts(self._env, path.encode(), mode)\n if ret == -1:\n raise CLIPSError(self._env)\n\n return ret"
] | [
"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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Добавить свойство инфоблока
@throws \Exception | [
"public function add()\n {\n $obj = new \\CIBlockProperty();\n\n $property_id = $obj->Add($this->getFieldsWithDefault());\n\n if (!$property_id) {\n throw new \\Exception($obj->LAST_ERROR);\n }\n\n Logger::log(\"Добавлено свойство инфоблока {$this->fields['CODE']}\",... | [
"final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\... | codesearchnet | {
"query": "Represent the Github comment about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Add a component to container only if this is a standalone instance, without clustering.
@throws IllegalStateException if called from PlatformLevel1, when cluster settings are not loaded | [
"AddIfStandalone addIfStandalone(Object... objects) {\n if (addIfStandalone == null) {\n addIfStandalone = new AddIfStandalone(getWebServer().isStandalone());\n }\n addIfStandalone.ifAdd(objects);\n return addIfStandalone;\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// NewPrometheusResourceMetricCollector returns a prometheus.Collector which exports resource metrics | [
"func NewPrometheusResourceMetricCollector(provider SummaryProvider, config ResourceMetricsConfig) prometheus.Collector {\n\treturn &resourceMetricCollector{\n\t\tprovider: provider,\n\t\tconfig: config,\n\t\terrors: prometheus.NewGauge(prometheus.GaugeOpts{\n\t\t\tName: \"scrape_error\",\n\t\t\tHelp: \"1 if ther... | [
"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 instruction about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
Gets html field for the current set fields.
@return string | [
"public function getHtmlFields()\n {\n $htmlFields = '';\n\n foreach ($this->fields as $field) {\n if (!$field->isOnFormView) {\n continue;\n }\n\n $parser = new ValidationParser($field->validationRules);\n\n if (in_array($field->htmlType, ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
%prog prepare "B. oleracea" *.fastq
Scan input fastq files (see below) and create `in_groups.csv` and
`in_libs.csv`. The species name does not really matter. | [
"def prepare(args):\n \n from jcvi.utils.table import write_csv\n from jcvi.formats.base import write_file\n from jcvi.formats.fastq import guessoffset, readlen\n\n p = OptionParser(prepare.__doc__ + FastqNamings)\n p.add_option(\"--corr\", default=False, action=\"store_true\",\n h... | [
"def prt_qualifiers(self, prt=sys.stdout):\n \"\"\"\"\"\"\n # 13 not colocalizes_with (TBD: CHK - Seen in gene2go, but not gafs)\n # 4 not contributes_to (TBD: CHK - Seen in gene2go, but not gafs)\n self._prt_qualifiers(self.associations, prt)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse
@Route("/whatwedo/table/filter/create", name="whatwedo_table_filter_direct_create", methods="POST") | [
"public function directCreateAction(Request $request)\n {\n $filter = new Filter();\n $filter->setName($request->request->get('filter_name'));\n $filter->setDescription($request->request->get('filter_description'));\n $filter->setState($request->request->getBoolean('filter_public') ? ... | [
"public function make(ICategory $category)\r\n {\r\n //$category->setResponse($this->response->view('admin.categorys.view', compact('category')));\r\n $category->setResponse($this->response->view(\\OogleeBConfig::get('config.category_view.view'), compact('category')));\r\n }"
] | codesearchnet | {
"query": "Represent the instruction about Symfony:",
"pos": "Represent the code about Symfony:",
"neg": "Represent the code about Computer Science:"
} |
// Charm indicates an expected call of Charm | [
"func (mr *MockProfileBackendMockRecorder) Charm(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Charm\", reflect.TypeOf((*MockProfileBackend)(nil).Charm), arg0)\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Add the corresponding RNA node for each protein node and connect them with a translation edge.
:param pybel.BELGraph graph: A BEL graph | [
"def enrich_proteins_with_rnas(graph):\n \n for protein_node in list(graph):\n if not isinstance(protein_node, Protein):\n continue\n\n if protein_node.variants:\n continue\n\n rna_node = protein_node.get_rna()\n graph.add_translation(rna_node, protein_node)"
... | [
"def prt_qualifiers(self, prt=sys.stdout):\n \"\"\"\"\"\"\n # 13 not colocalizes_with (TBD: CHK - Seen in gene2go, but not gafs)\n # 4 not contributes_to (TBD: CHK - Seen in gene2go, but not gafs)\n self._prt_qualifiers(self.associations, prt)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
An implementation of the String.split(String); | [
"public static String[] split(String str, char separator) {\n final int len;\n if (str == null \n || ((len = str.length()) == 0)) {\n return null;\n }\n\n List<String> componentList = new ArrayList<String>();\n int startIndex = 0;\n\n for (int i = 0; i < len; i++) {\n if (str.char... | [
"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:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.