query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Load host keys from an openssh :file:`known_hosts`-style file. Can
be called multiple times.
If *filename* is not specified, looks in the default locations i.e. :file:`~/.ssh/known_hosts` and :file:`~/ssh/known_hosts` for Windows. | [
"def load_known_hosts(self, filename=None):\n\n \n\n if filename is None:\n filename = os.path.expanduser('~/.ssh/known_hosts')\n try:\n self._host_keys.load(filename)\n except IOError:\n # for windows\n filename = os.path.e... | [
"def remove_sshkey(host, known_hosts=None):\n '''\n \n '''\n if known_hosts is None:\n if 'HOME' in os.environ:\n known_hosts = '{0}/.ssh/known_hosts'.format(os.environ['HOME'])\n else:\n try:\n known_hosts = '{0}/.ssh/known_hosts'.format(\n ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generate a new key
@param string $hash
@param int $length
@param string $key
@return string | [
"private function newKey($hash, $length, $key = '')\n {\n $generated = $this->hasReq(Hash::secure($length));\n\n if ($hash == 'base64') {\n $key = 'base64:' . base64_encode($generated);\n } else {\n $key = $hash . ':' . $generated;\n }\n\n return $key;\n }"
] | [
"public function generateMerchantSignature($key)\n {\n $key = $this->decodeBase64($key);\n //Generate Merchant Parameters\n $merchant_parameter = $this->generateMerchantParameters();\n // Get key with Order and key\n $key = $this->encrypt_3DES($this->getOrder(), $key);\n ... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Remove a movie from an accounts watch list.
@param sessionId sessionId
@param accountId accountId
@param mediaId mediaId
@param mediaType mediaType
@return StatusCode
@throws MovieDbException exception | [
"public StatusCode removeFromWatchList(String sessionId, int accountId, MediaType mediaType, Integer mediaId) throws MovieDbException {\n return tmdbAccount.modifyWatchList(sessionId, accountId, mediaType, mediaId, false);\n }"
] | [
"@RequestMapping(value = \"/api/profile/{profileIdentifier}\", method = RequestMethod.DELETE)\n public\n @ResponseBody\n HashMap<String, Object> removeFromList(Model model, @PathVariable String profileIdentifier) throws Exception {\n Integer profileId = ControllerUtils.convertProfileIdentifier(profi... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Whitelist the WORKON_HOME strings we're willing to substitute in
to strings that we provide for user's shell to evaluate.
If it smells at all bad, return True. | [
"def scary_path(path):\n \n if not path:\n return True\n assert isinstance(path, bytes)\n return not NOT_SCARY.match(path)"
] | [
"def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Override the $InputWithFrame.__checkCfgConsistency in order to check the invalidText and restore the error
state if needed.
@protected
@override | [
"function () {\n this.$InputWithFrame._checkCfgConsistency.call(this);\n\n var cfg = this._cfg;\n\n if (cfg.autoselect == null) {\n // the default value for autoselect comes from the environment\n cfg.autoselect = ariaWidgetsEnvironmentWidgetSettings.ge... | [
"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 sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Return an array of all (recursive) types known within this type | [
"def sub_types\n # Iterate through the Google::Protobuf::FieldDescriptor list\n entries.map do |fd|\n # fd.name = 'current_entity_to_update'\n # fd.number = 1\n # fd.label = :optional\n # fd.submsg_name = \"com.foo.bar.Baz\"\n # fd.subtype = #<Google::Protobuf::Descripto... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
<p>Liefert den Selbstbezug. </p>
@return time context (usually this instance) | [
"protected T getContext() {\n\n Chronology<T> c = this.getChronology();\n Class<T> type = c.getChronoType();\n\n if (type.isInstance(this)) {\n return type.cast(this);\n } else {\n for (ChronoElement<?> element : c.getRegisteredElements()) {\n if (typ... | [
"def forward_word(self, e): # (M-f)\r\n \"\"\"\r\n self.l_buffer.forward_word(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create empty file and return its info
@param string $dst destination directory
@param string $name file name
@return array|false
@author Dmitry (dio) Levashov | [
"public function mkfile($dst, $name) {\n\t\tif ($this->commandDisabled('mkfile')) {\n\t\t\treturn $this->setError(elFinder::ERROR_PERM_DENIED);\n\t\t}\n\t\t\n\t\tif (!$this->nameAccepted($name)) {\n\t\t\treturn $this->setError(elFinder::ERROR_INVALID_NAME);\n\t\t}\n\t\t\n\t\tif (($dir = $this->dir($dst)) == false) ... | [
"public static function insertTemplatePF ($parser, $template, $spot=''){\n //process additional arguments into a usable array\n $params = array();\n //sanitize the template name\n $template = preg_replace('/[^A-Za-z0-9_\\-]/', '_', $template);\n //this will be stripped out, assuming the skin is based... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
creates aaaa set of aaaa single {@link denominator.model.rdata.AAAAData AAAA} record for the
specified name.
@param name ex. {@code www.denominator.io.}
@param address ex. {@code 1234:ab00:ff00::6b14:abcd} | [
"public static ResourceRecordSet<AAAAData> aaaa(String name, String address) {\n return new AAAABuilder().name(name).add(address).build();\n }"
] | [
"def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Display suggested values
@param integer $bas_id The collection base_id
@return string | [
"public function getSuggestedValues($bas_id)\n {\n /** @var \\databox $databox */\n $databox = $this->app->findDataboxById(\\phrasea::sbasFromBas($this->app, $bas_id));\n $collection = \\collection::getByBaseId($this->app, $bas_id);\n $structFields = $suggestedValues = $basePrefs = []... | [
"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 Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Add program options. | [
"def add_options(self):\n \n super(MetafileChanger, self).add_options()\n\n self.add_bool_option(\"-n\", \"--dry-run\",\n help=\"don't write changes to disk, just tell what would happen\")\n self.add_bool_option(\"-V\", \"--no-skip\",\n help=\"do not skip broken met... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the maximum progress that the animation will end at when playing or looping. | [
"public void setMaxProgress(@FloatRange(from = 0f, to = 1f) final float maxProgress) {\n if (composition == null) {\n lazyCompositionTasks.add(new LazyCompositionTask() {\n @Override\n public void run(LottieComposition composition) {\n setMaxProgress(maxProgress);\n }\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Write unbuffered data to the client. | [
"def write(self, chunk):\n \"\"\"\"\"\"\n if self.chunked_write and chunk:\n chunk_size_hex = hex(len(chunk))[2:].encode('ascii')\n buf = [chunk_size_hex, CRLF, chunk, CRLF]\n self.conn.wfile.write(EMPTY.join(buf))\n else:\n self.conn.wfile.write(chun... | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Create an instance of {@link Kernel}.
@param modules modules to link to the new kernel.
@return the new kernel. | [
"public static final Kernel create(Module... modules) {\n\t\tfinal Injector injector = Guice.createInjector(modules);\n\t\tfinal Kernel k = injector.getInstance(Kernel.class);\n\t\treturn k;\n\t}"
] | [
"private Class<?> resolveClassWithCL(String name) throws ClassNotFoundException {\n SecurityManager security = System.getSecurityManager();\n if (security != null) {\n return Class.forName(name, false, getClassLoader(thisClass));\n }\n\n // The platform classloader is null if ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Show the report for a single pants run. | [
"def _handle_run(self, relpath, params):\n \"\"\"\"\"\"\n args = self._default_template_args('run.html')\n run_id = relpath\n run_info = self._get_run_info_dict(run_id)\n if run_info is None:\n args['no_such_run'] = relpath\n if run_id == 'latest':\n args['is_latest'] = 'none'\n e... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
查询是否允许授权处理,非阻塞,指定是否强制刷新 | [
"public boolean isPermit(boolean reload) {\n if (reload) {// 判断是否需要重新reload\n reload();\n }\n\n boolean result = channelStatus.isStart() && mainStemStatus.isOverTake();\n if (existOpposite) {// 判断是否存在反向同步\n result &= oppositeMainStemStatus.isOverTake();\n }\n... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setNomPtSize(Integer newNomPtSize) {\n\t\tInteger oldNomPtSize = nomPtSize;\n\t\tnomPtSize = newNomPtSize;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FND__NOM_PT_SIZE, oldNomPtSize, nomPtSize));\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github instruction about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// Stop stops the timer and returns true if the timer has not yet fired, or false otherwise. | [
"func (f *fakeTimer) Stop() bool {\n\tf.fakeClock.lock.Lock()\n\tdefer f.fakeClock.lock.Unlock()\n\n\tnewWaiters := make([]fakeClockWaiter, 0, len(f.fakeClock.waiters))\n\tfor i := range f.fakeClock.waiters {\n\t\tw := &f.fakeClock.waiters[i]\n\t\tif w != &f.waiter {\n\t\t\tnewWaiters = append(newWaiters, *w)\n\t\t... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Assigns site properties. | [
"def assign_site_properties(self, slab, height=0.9):\n \n if 'surface_properties' in slab.site_properties.keys():\n return slab\n else:\n surf_sites = self.find_surface_sites_by_height(slab, height)\n surf_props = ['surface' if site in surf_sites\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Decodes a Base64 bytes (or string) input and decompresses it using Gzip
:param data: Base64 (bytes) data to be decoded
:return: Decompressed and decoded bytes | [
"def decompress(data):\n \n\n if isinstance(data, bytes):\n source = data\n elif isinstance(data, str):\n source = bytes(data, encoding='utf-8')\n else:\n raise RuntimeError(\"Compression is only supported for strings and bytes\")\n\n return gzip.decompress(base64.b64decode(sourc... | [
"def fetch_email(M, msg_id):\n \"\"\"\"\"\"\n res, data = M.fetch(msg_id, '(RFC822)')\n if res == 'OK':\n # Data here is a list with 1 element containing a tuple\n # whose 2nd element is a long string containing the email\n # The content is a bytes that must be decoded\n raw_msg... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// MakeNetworkReaderFrom is a helper to transform NetworkPacketReader to io.ReaderFrom. | [
"func MakeNetworkReaderFrom(rp NetworkPacketReader, p *NetworkPacket) io.ReaderFrom {\n\treturn ioutil.ReaderFromFunc(func(r io.Reader) (int64, error) {\n\t\tpacket, err := rp.ReadPacket(r)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t*p = *packet\n\t\treturn packet.Len, nil\n\t})\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Register event handler
@param string $type
@param \Closure|array|string $callback
@return $this | [
"public function on($type, $callback)\n {\n if (!isset($this->callbacks[$type])) {\n $this->callbacks[$type] = [];\n }\n $this->callbacks[$type][] = $callback;\n return $this;\n }"
] | [
"public final function setCellClickEvent(\\Zippy\\Interfaces\\EventReceiver $receiver, $handler)\n {\n $this->cellclickevent = new \\Zippy\\Event($receiver, $handler);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
TODO: remove this method and make the modules bindable *
@deprecated will be removed soon
@return {Array} | [
"function () {\n var modules = [], conf;\n for (var i = 0; i < this.$configurations.length; i++) {\n conf = this.$configurations[i];\n if (conf instanceof ModuleConfiguration) {\n modules.push(conf.$.name);\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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get a key.
@param string $key
@param bool|null $minified
@return string|null
@throws \JosKolenberg\Jory\Exceptions\JoryException | [
"public function get(string $key, bool $minified = null): ?string\n {\n if (is_null($minified)) {\n $minified = $this->minified;\n }\n\n return $minified ? $this->getMinified($key) : $this->getFull($key);\n }"
] | [
"public function makeFromJSON(string $data): \\BearFramework\\Emails\\Email\n {\n return \\BearFramework\\Emails\\Email::fromJSON($data);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Creates a <code>String[]</code> by calling the toString() method of each object in a list.
@deprecated Please use List.toArray(Object[])
@see List#toArray(Object[]) | [
"@Deprecated\n\tpublic static String[] getStringArray(List<?> V) {\n\t\tif(V==null) return null;\n\t\tint len = V.size();\n\t\tString[] SA = new String[len];\n\t\tfor (int c = 0; c < len; c++) {\n\t\t\tObject O=V.get(c);\n\t\t\tSA[c]=O==null?null:O.toString();\n\t\t}\n\t\treturn SA;\n\t}"
] | [
"@SuppressWarnings(\"unchecked\") // Safe as long as the javadocs are followed\n static <K, V> ImmutableMapEntry<K, V>[] createEntryArray(int size) {\n return new ImmutableMapEntry[size];\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Perform a grey erosion with masking | [
"def grey_erosion(image, radius=None, mask=None, footprint=None):\n ''''''\n if footprint is None:\n if radius is None:\n footprint = np.ones((3,3),bool)\n radius = 1\n else:\n footprint = strel_disk(radius)==1\n else:\n radius = max(1, np.max(np.array(... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetBranchName sets the BranchName field's value. | [
"func (s *SubDomainSetting) SetBranchName(v string) *SubDomainSetting {\n\ts.BranchName = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Train an learner using a dataset and return it.
@param \Rubix\ML\Learner $estimator
@param \Rubix\ML\Datasets\Dataset $dataset
@return \Rubix\ML\Learner | [
"public function _train(Learner $estimator, Dataset $dataset) : Learner\n {\n $estimator->train($dataset);\n\n return $estimator;\n }"
] | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetOperatingSystem sets the OperatingSystem field's value. | [
"func (s *PatchBaselineIdentity) SetOperatingSystem(v string) *PatchBaselineIdentity {\n\ts.OperatingSystem = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Builds and return a Manager instance.
@return Manager | [
"public function build()\n {\n $annotationReader = $this->annotationReader;\n if (null === $annotationReader) {\n $annotationReader = new AnnotationReader();\n\n if (null !== $this->cacheDir) {\n $this->createDir($this->cacheDir . '/annotations');\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Perform the appropriate triplet combination function for the current
iteration | [
"def sha1_ft(t, b, c, d)\n return (b & c) | ((~b) & d) if t < 20\n return b ^ c ^ d if t < 40\n return (b & c) | (b & d) | (c & d) if t < 60\n b ^ c ^ d\n end"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
备注
@param openId
@param remark 长度小于30 | [
"public void remark(String openId, String remark) {\r\n String url = WxEndpoint.get(\"url.user.remark\");\r\n String json = String.format(\"{\\\"openid\\\":\\\"%s\\\",\\\"remark\\\":\\\"%s\\\"}\", openId, remark);\r\n logger.debug(\"remark user: {}\", json);\r\n wxClient.post(url, json);... | [
"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 Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Creates an array containing integer line numbers starting from the 'first-line' param.
@return {Array} Returns array of integers. | [
"function(code)\n {\n var lines = [],\n firstLine = parseInt(this.getParam('first-line'))\n ;\n\n eachLine(code, function(line, index)\n {\n lines.push(index + firstLine);\n });\n\n return lines;\n }"
] | [
"function(c, i, array) {\n if (c === undefined || c === null) return;\n // c is the component, type is dimension|attribute,\n // level is dataset|series|observation, i is index,\n // array is the component array\n failed += !iterator.call(context, c, type, level, i, array);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// parseKeyAndInferOperator parse literals.
// in case of no operator '!, in, notin, ==, =, !=' are found
// the 'exists' operator is inferred | [
"func (p *Parser) parseKeyAndInferOperator() (string, Operator, error) {\n\tvar operator Operator\n\ttok, literal := p.consume(Values)\n\tif tok == DoesNotExistToken {\n\t\toperator = DoesNotExistOperator\n\t\ttok, literal = p.consume(Values)\n\t}\n\tif tok != IdentifierToken {\n\t\terr := fmt.Errorf(\"found '%s', ... | [
"def star_expr_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"35\", \"star unpacking (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Compute E_{q(z) q(x)} [log p(z) + log p(x | z) + log p(y | x, z)] | [
"def expected_log_joint_probability(self):\n \n # E_{q(z)}[log p(z)]\n from pyslds.util import expected_hmm_logprob\n elp = expected_hmm_logprob(\n self.pi_0, self.trans_matrix,\n (self.expected_states, self.expected_transcounts, self._normalizer))\n\n # E_{q... | [
"func (k *KMeans) String() string {\n\treturn fmt.Sprintf(\"h(θ,x) = argmin_j | x[i] - μ[j] |^2\\n\\tμ = %v\", k.Centroids)\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Errorf returns an error containing an error code and a description;
// Errorf returns nil if c is OK.
//
// Deprecated: use status.Errorf instead. | [
"func Errorf(c codes.Code, format string, a ...interface{}) error {\n\treturn status.Errorf(c, format, a...)\n}"
] | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
If this event does not already contain location information,
evaluate the event against the expression.
If the expression evaluates to true,
force generation of location information by
calling getLocationInfo.
@param event event
@return Filter.NEUTRAL. | [
"public int decide(final LoggingEvent event) {\n if (expressionRule.evaluate(event, null)) {\n event.getLocationInformation();\n }\n return Filter.NEUTRAL;\n }"
] | [
"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 Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Get possible plural forms from MO header
@access private
@return string plural form header | [
"private function get_plural_forms() {\n // lets assume message number 0 is header\n // this is true, right?\n $this->load_tables();\n\n // cache header field for plural forms\n if (!is_string($this->pluralheader)) {\n if ($this->enable_cache) {\n $header... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
(see Riot::AssertionMacro#evaluate)
@param [Class] expected_class the expected Exception class
@param [String, nil] expected_message an optional exception message or message partial | [
"def evaluate(actual_exception, expected_class, expected_message=nil)\n actual_message = actual_exception && actual_exception.message\n if actual_exception.nil?\n fail new_message.expected_to_raise(expected_class).but.raised_nothing\n elsif expected_class != actual_exception.class\n fai... | [
"def uncomment(key, value, tree)\n # Try to find if it is commented out, so we can replace line\n matcher = Matcher.new(\n collection: \"#comment\",\n # FIXME: this assumes a specific \"=\" syntax, bypassing the lens\n # FIXME: this will match also \"# If you set FOO=bar then...\"\... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
get_authorized_tokens
Returns authorized tokens after they go through the auth_url phase. | [
"def get_authorized_tokens(self):\n \n resp, content = self.client.request(self.access_token_url, \"GET\")\n return dict(urlparse.parse_qsl(content))"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
//////////////////////////////////////////////////////////// | [
"public function generateNewsVisitHitTop($VisitorsID, $limit = 10, $parse = true)\n {\n $arrNewsStatCount = false;\n \n //News Tables exists?\n if (true === $this->getNewstableexists())\n {\n $objNewsStatCount = \\Database::getInstance()\n ... | [
"private void readPacket(Results results) throws SQLException {\n Buffer buffer;\n try {\n buffer = reader.getPacket(true);\n } catch (IOException e) {\n throw handleIoException(e);\n }\n\n switch (buffer.getByteAt(0)) {\n\n //***********************************************************... | codesearchnet | {
"query": "Represent the Github post about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
////////////////////////////////////////////////////////////////////////// helper methods for handling label and axis formatting | [
"function(properties, data) {\n var axisType = data.xAxisType,\n axisProperties = this.parseUtils.getXAxisProperties(properties),\n orientation = (this.axesAreInverted) ? 'vertical' : 'horizontal',\n colorScheme = this.getAxisColorScheme();\n // add... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
initialize a Logger for tracking hits to the server | [
"def init_access_log\n return if access_log_dest.nil?\n\n log = ::Logging.logger['access_log']\n pattern = ::Logging.layouts.pattern(:pattern => ACCESS_LOG_PATTERN)\n\n log.add_appenders(\n ::Logging.appenders.rolling_file(access_log_dest,\n :level => :debug,\n :age => '... | [
"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:"
} |
@param string $schema
@param string $typeName
@param array $criteria
@return array | [
"public function findBy(string $schema, string $typeName, array $criteria = []) : array\n {\n if (!$this->typeExists($schema, $typeName)) {\n return [];\n }\n\n foreach ($this->storage[$schema][$typeName] as $id => $data) {\n if ($this->matchesCriteria($criteria, $data)... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
confidence weighted accuracy assuming the scores are probabilities and using .5 as treshold | [
"public int[] cwaArray() {\r\n int[] arr = new int[numSamples()];\r\n for (int recall = 1; recall <= numSamples(); recall++) {\r\n arr[recall - 1] = logPrecision(recall);\r\n }\r\n return arr;\r\n }"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
today all
Returns:
[type] -- [description] | [
"def get_today_all(output='pd'):\n \n\n data = []\n today = str(datetime.date.today())\n codes = QA_fetch_get_stock_list('stock').code.tolist()\n bestip = select_best_ip()['stock']\n for code in codes:\n try:\n l = QA_fetch_get_stock_day(\n code, today, today, '00'... | [
"def all(self, data={}, **kwargs):\n \"\n return super(Plan, self).all(data, **kwargs)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return args parser
@return program parser | [
"private static OptionParser getParser() {\n OptionParser parser = new OptionParser();\n parser.accepts(\"help\", \"print help information\");\n parser.accepts(\"url\", \"[REQUIRED] bootstrap URL\")\n .withRequiredArg()\n .describedAs(\"bootstrap-url\")\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Generates deployment for given application.
@param type Module type to generate
@param basename Base name of module to generate
@param doFiltering should do basic filtering
@return EnterpriseArchive containing given module and all dependencies | [
"public static EnterpriseArchive getModuleDeployment(ModuleType type, String basename, boolean doFiltering) {\n String name = basename + \".\" + type.getExtension();\n String testJarName = basename + \"-tests.jar\";\n// LOG.debug(\"Creating Arquillian deployment for [\" + name + \"]\");\n ... | [
"public ValidationResult validateConfiguration(@Nonnull AnalysisContext analysisContext) {\n ValidationResult validation = ValidationResult.success();\n\n // even though we're not using the extensions much during validation and we actually don't run any analysis\n // at all, let's just use the ... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Rewrite the ``<c:tx>``, ``<c:xVal>`` and ``<c:yVal>`` child elements
of *ser* based on the values in *series_data*. | [
"def _rewrite_ser_data(self, ser, series_data, date_1904):\n \n ser._remove_tx()\n ser._remove_xVal()\n ser._remove_yVal()\n\n xml_writer = _XySeriesXmlWriter(series_data)\n\n ser._insert_tx(xml_writer.tx)\n ser._insert_xVal(xml_writer.xVal)\n ser._insert_yVal... | [
"def set_form_row\n return :UNHANDLED if @current_component.nil?\n cc = @current_component\n $log.debug \"STACKFLOW #{@name} set_form_row calling sfr for #{cc.name}, r #{cc.row} c: #{cc.col} \"\n $log.debug \" STACKFLOW on enter sfr #{@current_component.name} #{@current_component} \"\n\n @... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Migrate the "fs" backend.
// Migration should happen when formatFSV1.FS.Version changes. This version
// can change when there is a change to the struct formatFSV1.FS or if there
// is any change in the backend file system tree structure. | [
"func formatFSMigrate(ctx context.Context, wlk *lock.LockedFile, fsPath string) error {\n\t// Add any migration code here in case we bump format.FS.Version\n\tversion, err := formatFSGetVersion(wlk)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch version {\n\tcase formatFSVersionV1:\n\t\tif err = formatFSMigrat... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// InitOnboarding will invoke the onboarding / setup wizard | [
"func (s *Action) InitOnboarding(ctx context.Context, c *cli.Context) error {\n\tremote := c.String(\"remote\")\n\tteam := c.String(\"alias\")\n\tcreate := c.Bool(\"create\")\n\tname := c.String(\"name\")\n\temail := c.String(\"email\")\n\tctx = backend.WithCryptoBackendString(ctx, c.String(\"crypto\"))\n\n\t// def... | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// BreakerTimeout is the period of the open state, after which the state of CircuitBreaker becomes half-open.
// If Timeout is 0, the timeout value of CircuitBreaker is set to 60 seconds. | [
"func BreakerTimeout(timeout time.Duration) Option {\n\treturn func(r *Rabbus) error {\n\t\tr.config.breaker.timeout = timeout\n\t\treturn nil\n\t}\n}"
] | [
"private void updateAccountWaitTime(long clientCustomerId, long waitForMillis) {\n final long minWaitTime = millisFromNow(waitForMillis);\n\n // Here we are assuming that the AtomicLong reference isn't changed once inserted. Therefore,\n // the content of this map grows with the number of account rate limi... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Bind data to the view.
@param \Illuminate\Contracts\View\View $view
@return void | [
"public function compose(View $view)\n {\n $displayMetrics = $this->config->get('setting.display_graphs');\n $metrics = $this->getVisibleMetrics($displayMetrics);\n\n $view->withDisplayMetrics($displayMetrics)\n ->withMetrics($metrics);\n }"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@inheritDoc}
@see java.nio.file.Path#toUri() | [
"@Override\n public URI toUri() {\n final URI root = ShrinkWrapFileSystems.getRootUri(this.fileSystem.getArchive());\n // Compose a new URI location, stripping out the extra \"/\" root\n final String location = root.toString() + this.toString().substring(1);\n final URI uri = URI.crea... | [
"Supplier<SymbolicLink> symbolicLinkCreator(JimfsPath target) {\n state.checkOpen();\n return factory.symbolicLinkCreator(target);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
get the attribute name and value as a string
@param {Element} node The element that has the attribute
@param {Attribute} at The attribute
@return {String} | [
"function getAttributeNameValue(node, at) {\n\tconst name = at.name;\n\tlet atnv;\n\n\tif (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {\n\t\tlet friendly = axe.utils.getFriendlyUriEnd(node.getAttribute(name));\n\t\tif (friendly) {\n\t\t\tlet value = encodeURI(friendly);\n\t\t\tif (value) {\n\t\t\t\t... | [
"function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Makes a string URL-compatible
@param string $string String to transform
@return string | [
"private function vulgarize($string)\n {\n return trim(\n preg_replace(\n '/(-+)/',\n '-',\n preg_replace(\n '/([^a-z0-9-]*)/',\n '',\n preg_replace(\n '/((\\s|\\.|\\'|\\... | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Load image as a resource
@param string $path Image filepath to load
@return resource | [
"public static function _Load ($path)\n\t{\n\t\t\n\t\t// Check file exists\n\t\t\n\t\tif (!parent::_Exists ($path))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Set image resource\n\t\t\n\t\t$image\t= FALSE;\n\t\t\n\t\t// Switch image type and load\n\t\t\n\t\tswitch (self::_getMIME ($path))\n\t\t{\n\t\t\t\n\t\t... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Converts angle value to radians.
When value is "deg" suffixed, it means value is in degrees.
@return float|null angle in radians or null | [
"public static function convertAngleValue($value)\n {\n if($value !== null && strpos($value, 'deg') !== false)\n {\n $value = (float) $value;\n $value = deg2rad($value);\n }\n \n return $value !== null ? ((float) $value) : null;\n }"
] | [
"def formatDecimalMark(value, decimalmark='.'):\n \n # We have to consider the possibility of working with decimals such as\n # X.000 where those decimals are important because of the precission\n # and significant digits matters\n # Using 'float' the system delete the extre desimals with 0 as a valu... | codesearchnet | {
"query": "Represent the Github summarization about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Execute the search and return the response. | [
"def execute(self):\n \n r = self._s.execute()\n r._faceted_search = self\n return 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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Load view template with arguments
@param string $slug
@param string $name
@param array $args | [
"public static function view($slug, $name = '', array $args = []){\n $class_name = get_called_class();\n /** @var Controller $instance */\n $instance = $class_name::get_instance();\n $instance->lazy_scripts();\n $instance->load_template($slug, $name, $args);\n }"
] | [
"public function getViewer($action)\n {\n // Answer Viewer Object (from parent):\n \n if (!$this->isCMSPreview()) {\n return parent::getViewer($action);\n }\n \n // Load Page Requirements (uses theme):\n \n PageController::create(Page::create())-... | 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:"
} |
Invokes {@link QuickDiagnose#matches(org.hamcrest.Matcher, java.lang.Object, org.hamcrest.Description, java.lang.String)}
for {@code m},
enclosed in parentheses if necessary.
@param self
@param matcher
@param item
@param mismatch
@param message
@return | [
"public static boolean matches(PrecedencedSelfDescribing self, Matcher<?> matcher, Object item, Description mismatch, String message) {\r\n if (message == null) {\r\n return matches(self, matcher, item, mismatch);\r\n }\r\n boolean paren = useParen(self, matcher);\r\n if (pare... | [
"public CTX soThat(@Nonnull AssertionsCheck assertions) {\n normalCheck(description, caseDescription, preconditioner, assertFunction, assertPreConsumer, a -> assertions.assertionsCheck());\n return context.self();\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Checks if the specified {@code arg} is positive, and throws {@code IllegalArgumentException} if it is not.
@param arg
@param argNameOrErrorMsg
@throws IllegalArgumentException if the specified {@code arg} is negative. | [
"public static int checkArgPositive(final int arg, final String argNameOrErrorMsg) {\r\n if (arg <= 0) {\r\n if (argNameOrErrorMsg.indexOf(' ') == N.INDEX_NOT_FOUND) {\r\n throw new IllegalArgumentException(\"'\" + argNameOrErrorMsg + \"' can not be zero or negative: \" + arg);\r\n ... | [
"public static void isNull (final Object aValue, @Nonnull final Supplier <? extends String> aName)\n {\n if (isEnabled ())\n if (aValue != null)\n throw new IllegalArgumentException (\"The value of '\" + aName.get () + \"' must be null but is \" + aValue);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Returns the url of the forum whose topics will be marked read. | [
"def get_forum_url(self):\n \n return reverse('forum:forum', kwargs={'slug': self.forum.slug, 'pk': self.forum.pk})"
] | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Runs migration against a data set. | [
"def run_migration(data, version_start, version_end):\n \"\"\"\"\"\"\n items = []\n if version_start == 1 and version_end == 2:\n for item in data['accounts']:\n items.append(v2.upgrade(item))\n\n if version_start == 2 and version_end == 1:\n for item in data:\n items... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Creates the text field based date picker with the calendar widget without a model object. | [
"def unobtrusive_date_text_picker_tag(name, date = Date.current, options = {}, html_options = {})\n date ||= Date.current\n options = merge_defaults_for_text_picker(options)\n DateTimePickerSelector.new(date, options, html_options).text_date_picker(name)\n end"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// ChaincodeInfo implements function in interface ledger.DeployedChaincodeInfoProvider | [
"func (p *DeployedCCInfoProvider) ChaincodeInfo(chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error) {\n\tchaincodeDataBytes, err := qe.GetState(lsccNamespace, chaincodeName)\n\tif err != nil || chaincodeDataBytes == nil {\n\t\treturn nil, err\n\t}\n\tchaincodeData := &ccprovi... | [
"func (s *CommonStorageDB) ApplyUpdates(batch *statedb.UpdateBatch, height *version.Height) error {\n\treturn errors.New(\"this function should not be invoked on this type. Please invoke function ApplyPrivacyAwareUpdates\")\n}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param ItemDto[] $data Map[string, ItemDto]
@return $this | [
"public function setData($data)\n {\n foreach ($data as $key => $dtoData) {\n $this->data[$key] = new ItemDto($dtoData);\n }\n \n return $this;\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
/* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.UpstreamControl#sendAckMessage(com.ibm.ws.sib.trm.topology.Cellule, long, int, com.ibm.websphere.sib.Reliability, com.ibm.ws.sib.utils.SIBUuid12) | [
"public void sendAckMessage(\n SIBUuid8 meUuid,\n SIBUuid12 destUuid,\n SIBUuid8 busUuid, \n long ackPrefix,\n int priority,\n Reliability reliability,\n SIBUuid12 streamID,\n boolean consolidate)\n throws SIResourceException\n { \n if (TraceComponent.isAnyTracingEnabled() && tc.is... | [
"protected InvokerExtensionProcessor getInvokerExtensionProcessor(com.ibm.ws.webcontainer.webapp.WebApp app)\n {\n return new com.ibm.ws.webcontainer.osgi.extension.InvokerExtensionProcessor(app, config.getInvokerAttributes());\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Use the Nexpose::Connection to establish a correct HTTPS object. | [
"def https(nsc, timeout = nil)\n http = Net::HTTP.new(nsc.host, nsc.port)\n http.read_timeout = (timeout || nsc.timeout)\n http.open_timeout = nsc.open_timeout\n http.use_ssl = true\n if nsc.trust_store.nil?\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n else\n http.cer... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// extractOperationOptionFromMethodDescriptor extracts the message of type
// swagger_options.Operation from a given proto method's descriptor. | [
"func extractOperationOptionFromMethodDescriptor(meth *pbdescriptor.MethodDescriptorProto) (*swagger_options.Operation, error) {\n\tif meth.Options == nil {\n\t\treturn nil, nil\n\t}\n\tif !proto.HasExtension(meth.Options, swagger_options.E_Openapiv2Operation) {\n\t\treturn nil, nil\n\t}\n\text, err := proto.GetExt... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Stores custom URL alias data for $path to the backup table.
@param int $locationId
@param string $path
@param string $languageCode
@param bool $alwaysAvailable
@param bool $forwarding | [
"protected function storeCustomAliasPath(\n $locationId,\n $path,\n $languageCode,\n $alwaysAvailable,\n $forwarding\n ) {\n $queryBuilder = $this->connection->createQueryBuilder();\n\n $queryBuilder->insert(static::CUSTOM_ALIAS_BACKUP_TABLE);\n $queryBuild... | [
"public function upgradeDatabase()\n {\n $this->refreshDatabaseTables([\n 'FailedLoginAttempts',\n 'LoginControlIpRanges',\n ]);\n $this->connection->executeQuery('DROP TABLE IF EXISTS SignupRequests');\n $this->connection->executeQuery('DROP TABLE IF EXISTS User... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Construct `Config` object and return a list.
:parse filename: A string containing the path to YAML file.
:return: list | [
"def config(filename):\n \n Config = collections.namedtuple('Config', [\n 'git',\n 'lock_file',\n 'version',\n 'name',\n 'src',\n 'dst',\n 'files',\n 'post_commands',\n ])\n\n return [Config(**d) for d in _get_config_generator(filename)]"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
called when a label was clicked.
@param name
name of the lael
@param clickType
the type of click | [
"private void processLabelClicked(final String name, final ClickType clickType) {\n if (logger.isTraceEnabled()) {\n logger.trace(\"JS reports label {} clicked {}\", name, clickType);\n }\n synchronized (mapCoordinateElements) {\n if (mapCoordinateEleme... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// NodeID returns the CN for the certificate encapsulated in this TransportCredentials | [
"func (c *MutableTLSCreds) NodeID() string {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\treturn c.subject.CommonName\n}"
] | [
"def get_finished_record_bytes(cls, tls_version: TlsVersionEnum) -> bytes:\n \n # TODO(AD): The ROBOT poc script uses the same Finished record for all possible client hello (default, GCM,\n # etc.); as the Finished record contains a hashes of all previous records, it will be wrong and will caus... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns an array of files
@return array | [
"protected function getListFile()\n {\n $id = $this->getParam(0);\n\n if (!isset($id)) {\n return $this->file->getList(array('limit' => $this->getLimit()));\n }\n\n if ($this->getParam('type')) {\n return $this->file->getList(array('file_type' => $id, 'limit' => ... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// CountBitsUintReference count 1's in x | [
"func CountBitsUintReference(x uint) int {\n\tc := 0\n\tfor x != 0 {\n\t\tx &= x - 1\n\t\tc++\n\t}\n\treturn c\n}"
] | [
"private void addRawProbabilistic(final long rawValue) {\n // p(w): position of the least significant set bit (one-indexed)\n // By contract: p(w) <= 2^(registerValueInBits) - 1 (the max register value)\n //\n // By construction of pwMaxMask (see #Constructor()),\n // lsb(pwM... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. | [
"func (p *ProjectCard) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}"
] | [
"def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Convert a string of a calculation energy, e.g. '-1.2345 eV' to a float.
Args:
string (str): The string to convert.
Return
(float) | [
"def energy_string_to_float( string ):\n \n energy_re = re.compile( \"(-?\\d+\\.\\d+)\" )\n return float( energy_re.match( string ).group(0) )"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the instruction about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Double Precision Shift Left. | [
"public final void shld(Mem dst, Register src1, Immediate src2)\n {\n emitX86(INST_SHLD, dst, src1, src2);\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Parses an individual tag line
@param string $line
@throws \InvalidArgumentException
@return \gossi\docblock\tags\AbstractTag | [
"protected function parseTag($line) {\n\t\t$matches = [];\n\t\tif (!preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\\s*([^\\s].*)|$)?/us', $line, $matches)) {\n\t\t\tthrow new \\InvalidArgumentException('Invalid tag line detected: ' . $line);\n\t\t}\n\t\t\n\t\t$tagName = $matches[1];\n\t\t$content = isset($matches[... | [
"public function createUiComponent(\\n2n\\impl\\web\\ui\\view\\html\\HtmlView $view, \\rocket\\ei\\util\\Eiu $eiu) {\r\n\t\treturn $view->getHtmlBuilder()->getEsc($eiu->field()->getValue());\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetUsers sets the Users field's value. | [
"func (s *SendUsersMessageRequest) SetUsers(v map[string]*EndpointSendConfiguration) *SendUsersMessageRequest {\n\ts.Users = v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// ListPodSandbox returns a list of PodSandboxes. | [
"func (r *RemoteRuntimeService) ListPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error) {\n\tctx, cancel := getContextWithTimeout(r.timeout)\n\tdefer cancel()\n\n\tresp, err := r.runtimeClient.ListPodSandbox(ctx, &runtimeapi.ListPodSandboxRequest{\n\t\tFilter: filter,\n\t})\n\tif err !... | [
"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:"
} |
Remove event listener from event loop.
@param mixed $fd
@param int $flag
@return bool | [
"public function del($fd, $flag)\n {\n switch ($flag) {\n case EventInterface::EV_READ:\n return $this->removeReadStream($fd);\n case EventInterface::EV_WRITE:\n return $this->removeWriteStream($fd);\n case EventInterface::EV_SIGNAL:\n ... | [
"function init(entry, socket, req) { // {{{2\n/**\n * Class constructor\n *\n * @param entry {Object} Entry of xorg kind\n *\n * @method constructor\n */\n\n this.entry = entry;\n\n O.link.open(this, socket);\n}"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
// NewStatsClient initializes a new stats client | [
"func NewStatsClient(cr statscollector.Collector) (StatsClient, error) {\n\n\tsc := &statsClient{\n\t\tcollector: cr,\n\t\trpchdl: rpcwrapper.NewRPCWrapper(),\n\t\tsecret: os.Getenv(constants.EnvStatsSecret),\n\t\tstatsChannel: os.Getenv(constants.EnvStatsChannel),\n\t\tstatsInterval: defaultStat... | [
"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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetAgentType sets the AgentType field's value. | [
"func (s *AgentInfo) SetAgentType(v string) *AgentInfo {\n\ts.AgentType = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Given a set of quad faces, return them as triangle faces.
Parameters
-----------
quads: (n, 4) int
Vertex indices of quad faces
Returns
-----------
faces : (m, 3) int
Vertex indices of triangular faces | [
"def triangulate_quads(quads):\n \n if len(quads) == 0:\n return quads\n quads = np.asanyarray(quads)\n faces = np.vstack((quads[:, [0, 1, 2]],\n quads[:, [2, 3, 0]]))\n return faces"
] | [
"def get_next_triangle(mesh, T, plane, intersection, dist_tol):\n \n if intersection[0] == INTERSECT_EDGE:\n tris = mesh.triangles_for_edge(intersection[2])\n elif intersection[0] == INTERSECT_VERTEX:\n tris = mesh.triangles_for_vert(intersection[2])\n else:\n assert False, 'Invalid... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
忽略指定的 path
@param {Array} ignores 忽略规则列表
@param {string} pathName 需要判断的 path
@return {boolean} 判断的结果 | [
"function ignoreMatch(ignores, pathName) {\n let result = false;\n\n ignores.forEach(ignore => {\n if (minimatch(pathName, ignore)) {\n result = true;\n }\n });\n\n return result;\n}"
] | [
"function getRequirePath(absolutePath) {\n // 获得 require 这个模块的相对路径\n let relativePath = path.relative(__dirname, absolutePath);\n\n if (path.isAbsolute(relativePath)) {\n // 如果 __dirname 和 absolutePath 不在同一个磁盘中,则 path.relative(__dirname, absolutePath) 会返回后者\n // 因此此处就无需处理相对路径 #128\n }\n\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get disabled algorithm constraints from the specified security property. | [
"private static void loadDisabledAlgorithmsMap(\n final String propertyName) {\n\n String property = AccessController.doPrivileged(\n new PrivilegedAction<String>() {\n public String run() {\n return Security.getProperty(propertyName);\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// WeekdayWide returns the locales wide weekday given the 'weekday' provided | [
"func (lv *lv) WeekdayWide(weekday time.Weekday) string {\n\treturn lv.daysWide[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
Renders the container for the HTML template.
@param string $layout Page layout passed from template.
@param string $title Page title passed from template.
@return string | [
"public function renderContainer($layout = null, $title = null)\n {\n return sprintf(\n \"<div class=\\\"%s\\\">\\n%s</div>\\n\",\n $this->getContainerClass(),\n $this->renderChildren($layout, $title)\n );\n }"
] | [
"public function getTemplateFile($filename, $data)\n {\n $data['getRegion'] = function($name) { \n return $this->getRegion($name); \n }; // This is for mustache compatibility\n\n // Push the data into regions and then pass a pointer to this class to the layout\n // $thi... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
remove blank(or only includes space and tab) item in array
@param array
@returns {*} | [
"function trimEndBlankLines(array) {\n\n if (!array || array.length < 1) {\n return array;\n }\n\n let temp;\n while (array.length > 0) {\n temp = array[array.length - 1];\n if (temp === '' || Str.trim(temp, ' \\t') === '') {\n array.pop();\n } else {\n ... | [
"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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// GenerateJobID returns a random job identifier, prefixed with the given host ID. | [
"func GenerateJobID(hostID, uuid string) string {\n\tif uuid == \"\" {\n\t\tuuid = random.UUID()\n\t}\n\treturn hostID + \"-\" + uuid\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Remove removes a container | [
"func (c *ContainerServer) Remove(ctx context.Context, container string, force bool) (string, error) {\n\tctr, err := c.LookupContainer(container)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tctrID := ctr.ID()\n\n\tcStatus := ctr.State()\n\tswitch cStatus.Status {\n\tcase oci.ContainerStatePaused:\n\t\treturn \... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Draw r-hat for each plotter. | [
"def plot_rhat(self, ax, xt_labelsize, titlesize, markersize):\n \"\"\"\"\"\"\n for plotter in self.plotters.values():\n for y, r_hat, color in plotter.r_hat():\n if r_hat is not None:\n ax.plot(r_hat, y, \"o\", color=color, markersize=markersize, markeredg... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Refresh implementation of terraform.ResourceProvider interface. | [
"func (p *Provider) Refresh(\n\tinfo *terraform.InstanceInfo,\n\ts *terraform.InstanceState) (*terraform.InstanceState, error) {\n\tr, ok := p.ResourcesMap[info.Type]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown resource type: %s\", info.Type)\n\t}\n\n\treturn r.Refresh(s, p.meta)\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
追加子节点
@param ele
@returns {*} | [
"function (ele) {\n var node = this[0];\n //结点类型判断\n if (node.nodeType === 1 || node.nodeType === 11 || node.nodeType === 9) {\n if(ele instanceof vQ){\n ele.each(function(inx,ele){\n node.appendChild(ele);\n ... | [
"public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Assign the dialect.
@param string|object $dialect (string or object with __toString)
@return self | [
"public function setDialect($dialect)\n {\n if (!Type::isStringLike($dialect)) {\n throw new InvalidArgumentException('Dialect hast to be stringlike, not ' . Type::of($dialect));\n }\n $this->dialect = $dialect;\n return $this;\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns new Pooled {@link DataSource} implementation
@param poolProperties pool properties
@return new Pooled {@link DataSource} implementation
@throws SQLException | [
"public static DataSource createDataSource(Properties poolProperties) throws SQLException {\n assertNotNull(poolProperties);\n\n try {\n return BasicDataSourceFactory.createDataSource(poolProperties);\n } catch (Exception e) {\n throw new SQLException(e.getMessage());\n ... | [
"@Override\n\tpublic void init(SecurityContext securityContext, Node dbNode, Class type, final long transactionId) {\n\t\tthrow new UnsupportedOperationException(\"Not supported by this container.\");\n\t}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Export a JWKS as a JSON document.
:param private: Whether it should be the private keys or the public
:param issuer: The entity ID.
:return: A JSON representation of a JWKS | [
"def export_jwks_as_json(self, private=False, issuer=\"\"):\n \n return json.dumps(self.export_jwks(private, issuer))"
] | [
"def encode_id_token(self, id_token):\n \n\n # Encode the ID token using the `client_secret`.\n #\n # TODO: Using the `client_secret` is not ideal, since it is transmitted\n # over the wire in some authentication flows. A better alternative is\n # to use the public key of ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Text processing:"
} |
Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the
GRIDSET record. | [
"private function _writePrintGridlines()\n\t{\n\t\t$record\t = 0x002b;\t\t\t\t\t// Record identifier\n\t\t$length\t = 0x0002;\t\t\t\t\t// Bytes to follow\n\n\t\t$fPrintGrid = $this->_phpSheet->getPrintGridlines() ? 1 : 0;\t// Boolean flag\n\n\t\t$header\t = pack(\"vv\", $record, $length);\n\t\t$data\t = pack(\... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.