query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Return the callbacks associated with a message template. | [
"def get_callbacks_from_message(self, msg):\n \"\"\"\"\"\"\n callbacks = []\n for key in self._find_matching_keys(msg):\n for callback in self[key]:\n callbacks.append(callback)\n return callbacks"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Find Denon and marantz devices advertising their services by upnp.
@param {function} callback .
@constructor | [
"function MarantzDenonUPnPDiscovery(callback) {\n var that = this;\n var foundDevices = {}; // only report a device once\n\n // create socket\n var socket = dgram.createSocket({type: 'udp4', reuseAddr: true});\n socket.unref();\n const search = ... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// ListSnapshots lists all the snapshot files in a particular directory and returns
// the snapshot files in reverse lexical order (newest first) | [
"func ListSnapshots(dirpath string) ([]string, error) {\n\tdirents, err := ioutil.ReadDir(dirpath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar snapshots []string\n\tfor _, dirent := range dirents {\n\t\tif strings.HasSuffix(dirent.Name(), \".snap\") {\n\t\t\tsnapshots = append(snapshots, dirent.Name())\n\... | [
"def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about AWS S3:"
} |
Update the active marker on the marker Canvas | [
"def update_active(self):\n \"\"\"\"\"\"\n if self.active is not None:\n self.update_state(self.active, \"normal\")\n if self.current_iid == self.active:\n self._active = None\n return\n self._active = self.current_iid\n if self.active is not None:... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Tuns passive mode on or off.
@param bool $pasv The passive mode.
@return FTPClient Returns this FTP client.
@throws FTPException Throws a FTP exception if an I/O error occurs. | [
"public function pasv($pasv) {\n if (false === @ftp_pasv($this->getConnection(), $pasv)) {\n throw $this->newFTPException(sprintf(\"pasv from %d to %d failed\", !$pasv, $pasv));\n }\n return $this;\n }"
] | [
"private function __sendRequest($urlPath, $method, $param)\n {\n // Check Curl function if is enabled to send request\n if (function_exists('curl_version'))\n return self::__sendCurl($urlPath, $method, $param);\n\n // Check file_get_contents function if is enabled to send request\... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
encodes a String to Base64 String
@param plain String to encode
@return encoded String
@throws CoderException
@throws UnsupportedEncodingException | [
"public static String encodeFromString(String plain, String charset) throws CoderException, UnsupportedEncodingException {\n\treturn encode(plain.getBytes(charset));\n }"
] | [
"public String getName() {\n if (null == this.name && null != this.byteArray) {\n try {\n this.name = new String(this.byteArray, HeaderStorage.ENGLISH_CHARSET);\n } catch (UnsupportedEncodingException uee) {\n // no FFDC required\n // Invalid... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
// Encode converts a TagValue to the format in the connection. | [
"func (v TagValue) Encode() string {\n\tret := &bytes.Buffer{}\n\n\tfor _, c := range v {\n\t\tif replacement, ok := tagEncodeMap[c]; ok {\n\t\t\tret.WriteString(replacement)\n\t\t} else {\n\t\t\tret.WriteRune(c)\n\t\t}\n\t}\n\n\treturn ret.String()\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Terms returns which languages the source repository was
// built with | [
"func (info *SourceRepositoryInfo) Terms() []string {\n\tterms := []string{}\n\tfor i := range info.Types {\n\t\tterms = append(terms, info.Types[i].Term())\n\t}\n\treturn terms\n}"
] | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Acquire a MethodDesc from a type descriptor. | [
"public static MethodDesc forDescriptor(String desc) \n throws IllegalArgumentException\n {\n try {\n int cursor = 0;\n char c;\n\n if ((c = desc.charAt(cursor++)) != '(') {\n throw invalidDescriptor(desc);\n }\n\n StringBuffer b... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetRevisionId sets the RevisionId field's value. | [
"func (s *CreateRobotApplicationOutput) SetRevisionId(v string) *CreateRobotApplicationOutput {\n\ts.RevisionId = &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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Process callbacks from `call_from_executor` in eventloop. | [
"def _process_callbacks(self):\n \n # Flush all the pipe content.\n os.read(self._schedule_pipe[0], 1024)\n\n # Process calls from executor.\n calls_from_executor, self._calls_from_executor = self._calls_from_executor, []\n for c in calls_from_executor:\n c()"
] | [
"def push(self):\r\n \"\"\"\"\"\"\r\n print `request.body`\r\n yield request.environ['cogen.call'](pubsub.publish)(\r\n \"%s: %s\" % (session['client'].name, request.body)\r\n )\r\n # the request.environ['cogen.*'] objects are the the asynchronous\r\n # make the ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Technology:"
} |
Clean and fire onWsConnect().
@param Swoole\Request $request
@param Swoole\Response $response | [
"function afterResponse(Swoole\\Request $request, Swoole\\Response $response)\n {\n if ($request->isWebSocket())\n {\n $conn = array('header' => $request->header, 'time' => time());\n $this->connections[$request->fd] = $conn;\n\n if (count($this->connections) > $thi... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Creates a Memcached instance from the session options.
@param OptionsBag $sessionOptions
@return Memcached | [
"public function create(OptionsBag $sessionOptions)\n {\n $options = $this->parseOptions($sessionOptions);\n\n $connections = $this->parse($sessionOptions);\n\n $persistentId = null;\n if ($options['persistent']) {\n $persistentId = $this->parsePersistentId($connections, $o... | [
"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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Publication state.
@return string | [
"public function published()\n {\n $class = $this->entity->published ? 'fa fa-check-circle-o' : 'fa fa-circle-o';\n $state = $this->entity->published ? 'Published' : 'Unpublished';\n\n return html()->tag('i', '', [\"class\" => $class, \"data-toggle\" => \"tooltip\", \"data-title\" => $state]... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Callback for 'routesTrigger' event.
@param ModuleEvent $e
@throws \Exception if the module returns an invalid route type
@return $this | [
"public function routesTrigger(ModuleEvent $e)\n {\n $module = $e->getModule();\n\n if (is_callable(array($module, 'getRoutes'))) {\n $routes = $module->getRoutes();\n $this->routes[$e->getModuleName()] = $routes;\n }\n\n return $this;\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Set the low and high watermarks for the read buffer. | [
"def set_buffer_limits(self, high=None, low=None):\n \"\"\"\"\"\"\n if high is None:\n high = self.default_buffer_size\n if low is None:\n low = high // 2\n self._buffer_high = high\n self._buffer_low = low"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
GetMethodVariables. | [
"public String getMethodVariables(String strMethodInterface)\n {\n int endChar = 0, startChar = 0;\n String strMethodVariables = \"\";\n int i = 0;\n boolean bBracketFound = false;\n for (i = 0; i < strMethodInterface.length(); i++)\n {\n if (strMethodInterfac... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Tests if an alert is present
@return: True if alert is present, False otherwise | [
"def is_alert_present(self):\n \n current_frame = None\n try:\n current_frame = self.driver.current_window_handle\n a = self.driver.switch_to_alert()\n a.text\n except NoAlertPresentException:\n # No alert\n return False\n exc... | [
"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 Github instruction about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
Generate a unique ID - that is friendly for a URL or file system
@return a unique id | [
"public String generateSanitizedId() {\n String result = this.generateId();\n result = result.replace(':', '-');\n result = result.replace('_', '-');\n result = result.replace('.', '-');\n return result;\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Build and return package.xml | [
"func (pb PackageBuilder) PackageXml() []byte {\n\tp := createPackage()\n\n\tfor _, metaType := range pb.Metadata {\n\t\tp.Types = append(p.Types, metaType)\n\t}\n\n\tbyteXml, _ := xml.MarshalIndent(p, \"\", \" \")\n\tbyteXml = append([]byte(xml.Header), byteXml...)\n\t//if err := ioutil.WriteFile(\"mypackage.xm... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get all configuration values in a Properties object
@return the properties | [
"public Properties asProperties() {\n final Properties props = new Properties();\n other.forEach(props::setProperty);\n props.setProperty(\"bootstrap.servers\", bootstrapServers);\n return props;\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 Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Main `ybt` console script entry point - run YABT from command-line. | [
"def main():\n \"\"\"\"\"\"\n conf = init_and_get_conf()\n logger = make_logger(__name__)\n logger.info('YaBT version {}', __version__)\n handlers = {\n 'build': YabtCommand(func=cmd_build, requires_project=True),\n 'dot': YabtCommand(func=cmd_dot, requires_project=True),\n 'test... | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
returns the home folder and program root depending on OS | [
"def get_root_folder():\n \n locations = {\n 'linux':{'hme':'/home/duncan/', 'core_folder':'/home/duncan/dev/src/python/AIKIF'},\n 'win32':{'hme':'T:\\\\user\\\\', 'core_folder':'T:\\\\user\\\\dev\\\\src\\\\python\\\\AIKIF'},\n 'cygwin':{'hme':os.getcwd() + os.sep, 'core_folder':os.getcwd()}... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Technology:"
} |
</editor-fold>//GEN-END:initComponents | [
"private void menuAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAboutActionPerformed\n JOptionPane.showMessageDialog(Main.getApplicationFrame(), new AboutPanel(), \"About\", JOptionPane.PLAIN_MESSAGE);\n }"
] | [
"private void formWindowOpened(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowOpened\n {//GEN-HEADEREND:event_formWindowOpened\n\n spDetails.setVisible(false);\n pack();\n validate();\n\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Returns the next color. Currently returns a random
color from the Colorbrewer 11-class diverging BrBG palette.
Returns
-------
next_rgb_color: tuple of ImageColor | [
"def next_color(self):\n \n next_rgb_color = ImageColor.getrgb(random.choice(BrBG_11.hex_colors))\n return next_rgb_color"
] | [
"def _enforceDataType(self, data):\n \n qColor = QtGui.QColor(data) # TODO: store a RGB string?\n if not qColor.isValid():\n raise ValueError(\"Invalid color specification: {!r}\".format(data))\n return qColor"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetContributor sets the Contributor field's value. | [
"func (s *CommentMetadata) SetContributor(v *User) *CommentMetadata {\n\ts.Contributor = 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:"
} |
Remove tags from a file.
Args:
filething (filething)
Raises:
mutagen.MutagenError | [
"def delete(filething):\n \n\n dsf_file = DSFFile(filething.fileobj)\n\n if dsf_file.dsd_chunk.offset_metdata_chunk != 0:\n id3_location = dsf_file.dsd_chunk.offset_metdata_chunk\n dsf_file.dsd_chunk.offset_metdata_chunk = 0\n dsf_file.dsd_chunk.write()\n\n filething.fileobj.see... | [
"def set_inode(self, ino):\n # type: (inode.Inode) -> None\n '''\n \n '''\n if not self._initialized:\n raise pycdlibexception.PyCdlibInternalError('El Torito Entry not yet initialized')\n self.inode = ino"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Filter the array according callback
@param array $arr The array to be used
@param callable $callback Function fired in array elements
@return array The array filtered | [
"public static function filter(array $arr, callable $callback): array\n {\n $arrResult = [];\n\n foreach ($arr as $index => $value) {\n if ($callback($value, $index) === true) {\n $arrResult[] = $value;\n }\n }\n\n return $arrResult;\n }"
] | [
"public static function noConstraints(Closure $callback)\n {\n static::$constraints = false;\n\n // When resetting the relation where clause, we want to shift the first element\n // off of the bindings, leaving only the constraints that the developers put\n // as \"extra\" on the rela... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Fills the struct with the default parameter values as defined in provided
parameter definition collection. | [
"private function fillDefault(ParameterDefinitionCollectionInterface $definitionCollection): void\n {\n foreach ($definitionCollection->getParameterDefinitions() as $name => $definition) {\n $this->setParameterValue($name, $definition->getDefaultValue());\n\n if ($definition instance... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param mixed $val
@return float
@throws \frictionlessdata\tableschema\Exceptions\FieldValidationException; | [
"protected function validateCastValue($val)\n {\n if (isset($this->descriptor()->bareNumber) && $this->descriptor()->bareNumber === false) {\n return mb_ereg_replace('((^\\D*)|(\\D*$))', '', $val);\n }\n $isPercent = false;\n if (is_string($val)) {\n if (substr($... | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Registers all provider implementations for this {@code ServiceRegistry}
found in the application classpath.
@throws ServiceConfigurationError if an error occurred during registration | [
"public void registerApplicationClasspathSPIs() {\r\n ClassLoader loader = Thread.currentThread().getContextClassLoader();\r\n Iterator<Class<?>> categories = categories();\r\n\r\n while (categories.hasNext()) {\r\n Class<?> category = categories.next();\r\n\r\n try {\r\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get indices of neighbour simplices for each simplex and arc indices.
Identical to get_neighbour_simplices() but also returns an array
of indices that reside on boundary hull, -1 denotes no neighbour. | [
"def neighbour_and_arc_simplices(self):\n \n nt, ltri, lct, ierr = _tripack.trlist(self.lst, self.lptr, self.lend, nrow=9)\n if ierr != 0:\n raise ValueError('ierr={} in trlist\\n{}'.format(ierr, _ier_codes[ierr]))\n ltri = ltri.T[:nt] - 1\n return ltri[:,3:6], ltri[:,6... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns {@code true} if succeed to drop table, otherwise {@code false} is returned.
@param tableName
@return | [
"public boolean dropTableIfExists(final String tableName) {\r\n Connection conn = getConnection();\r\n\r\n try {\r\n return JdbcUtil.dropTableIfExists(conn, tableName);\r\n } finally {\r\n closeQuietly(conn);\r\n }\r\n }"
] | [
"@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
@param bool $reset
@return array | [
"protected function getPins( $reset = false ) {\n\t\tif ( $reset ) {\n\t\t\t$this->_pins = [];\n\t\t}\n\t\tif ( empty( $this->_pins ) ) {\n\t\t\t$pins = get_transient( self::PIN );\n\t\t\tif ( ! is_array( $pins ) ) {\n\t\t\t\t$pins = [];\n\t\t\t}\n\t\t\t$this->_pins = $pins;\n\t\t}\n\t\treturn $this->_pins;\n\t}"
] | [
"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:"
} |
Returns a dict that represents the user who prints the ws
Keys: username, fullname, email | [
"def _printedby_data(self, ws):\n \n data = {}\n member = self.context.portal_membership.getAuthenticatedMember()\n if member:\n username = member.getUserName()\n data['username'] = username\n data['fullname'] = to_utf8(self.user_fullname(username))\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 Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Execute a set of batched queries on the lighthouse schema and return a
collection of ExecutionResults.
@param \Nuwave\Lighthouse\Execution\GraphQLRequest $request
@return mixed[] | [
"public function executeRequest(GraphQLRequest $request): array\n {\n $result = $this->executeQuery(\n $request->query(),\n $this->createsContext->generate(\n app('request')\n ),\n $request->variables(),\n null,\n $request->o... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
// Run implements Command.Run. | [
"func (c *ListCommand) Run(ctx *cmd.Context) error {\n\treturn c.RunWithAPI(ctx, func(api SpaceAPI, ctx *cmd.Context) error {\n\t\tspaces, err := api.ListSpaces()\n\t\tif err != nil {\n\t\t\tif errors.IsNotSupported(err) {\n\t\t\t\tctx.Infof(\"cannot list spaces: %v\", err)\n\t\t\t}\n\t\t\treturn errors.Annotate(er... | [
"@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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
TODO: move this to IonConstants or IonUTF8 | [
"static final public int makeUTF8IntFromScalar(int c) throws IOException\n {\n // TO DO: check this encoding, it is from:\n // http://en.wikipedia.org/wiki/UTF-8\n // we probably should use some sort of Java supported\n // library for this. this class might be of interest:\n ... | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// RankMatchFold is a case-insensitive version of RankMatch. | [
"func RankMatchFold(source, target string) int {\n\treturn rank(source, target, unicode.ToLower)\n}"
] | [
"private Counter<L> logProbabilityOfRVFDatum(RVFDatum<L, F> example) {\r\n // NB: this duplicate method is needed so it calls the scoresOf method\r\n // with an RVFDatum signature!! Don't remove it!\r\n // JLS: type resolution of method parameters is static\r\n Counter<L> scores = scoresOfRVFDatum(exam... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Is column searched
@param string $column
@return bool | [
"public function isColumnSearched( $column )\n {\n $store = $this->getStore();\n\n if ( isset( $store['search'][$column] ) )\n {\n foreach ( $store['search'][$column] as $search )\n {\n if ( ! empty( $search ) )\n {\n ret... | [
"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:"
} |
// DefineStatus converts the check result status from an integer to a string. | [
"func DefineStatus(status int) string {\n\teCode := \"UNDEFINED_STATUS\"\n\n\tfor k, v := range sensuutil.MonitoringErrorCodes {\n\t\tif status == v {\n\t\t\teCode = k\n\t\t}\n\t}\n\treturn eCode\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided | [
"func (da *da_DK) WeekdayNarrow(weekday time.Weekday) string {\n\treturn da.daysNarrow[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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
Method called once every second by the scheduled job.
@see #start(ScheduledExecutorService) | [
"@SuppressWarnings( \"fallthrough\" )\n private void rollup() {\n DateTime now = timeFactory.create();\n Window largest = null;\n for (DurationHistory history : durations.values()) {\n largest = history.rollup();\n }\n for (ValueHistory history : values.values()) {\n... | [
"def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $name
@param string $locale
@return AttributeValueTranslation | [
"protected function createAttributeValueTranslation($name, $locale)\n {\n $translation = new AttributeValueTranslation();\n $translation->setName($name);\n $translation->setLocale($locale);\n\n return $translation;\n }"
] | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EClass getIfcRadiusDimension() {\r\n\t\tif (ifcRadiusDimensionEClass == null) {\r\n\t\t\tifcRadiusDimensionEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(419);\r\n\t\t}\r\n\t\treturn ifcRadiusDimensionEClass;\r\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 description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Sets the device_key of this DeviceData.
The fingerprint of the device certificate.
:param device_key: The device_key of this DeviceData.
:type: str | [
"def device_key(self, device_key):\n \n if device_key is not None and len(device_key) > 512:\n raise ValueError(\"Invalid value for `device_key`, length must be less than or equal to `512`\")\n\n self._device_key = device_key"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
1. Fetch URL
2. Run automation.
3. Return HTML.
4. Close the tab. | [
"def fetch(self, conf):\n \n url = conf['url']\n # If Firefox is broken, it will raise here, causing kibitzr restart:\n self.driver.set_window_size(1366, 800)\n self.driver.implicitly_wait(2)\n self.driver.get(url)\n try:\n self._run_automation(conf)\n ... | [
"def delete_state(node)\n # => Find the Node\n existing = find_state(node)\n return 'Node not present in state' unless existing\n # => Delete the Node from State\n state.delete(existing)\n # => Write Out the Updated State\n write_state\n # => Return the Deleted Node\n ex... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
/*Rocr100 - Rate of change ratio 100 scale: (price/prevPrice)*100
Input = double
Output = double
Optional Parameters
-------------------
optInTimePeriod:(From 1 to 100000)
Number of period
*/ | [
"func Rocr100(real []float64, timePeriod int32) []float64 {\n\tvar outBegIdx C.int\n\tvar outNBElement C.int\n\toutReal := make([]float64, len(real))\n\tC.TA_ROCR100(0, C.int(len(real)-1), (*C.double)(unsafe.Pointer(&real[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))\... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates a FLUSH_REQ message.
@param body the data of the request.
@return a protobuf message. | [
"public static Message buildFlushRequest(ByteBuffer body) {\n ZabMessage.FlushRequest flushReq =\n ZabMessage.FlushRequest.newBuilder().setBody(ByteString.copyFrom(body))\n .build();\n return Message.newBuilder().setType(MessageType.FLUSH_REQ)\n ... | [
"def _make_read_lob_request(self, readoffset, readlength):\n \n self._connection._check_closed()\n\n request = RequestMessage.new(\n self._connection,\n RequestSegment(\n message_types.READLOB,\n (ReadLobRequest(self._lob_header.locator_id, re... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about software development:"
} |
Brand parent API URL arg.
@since 160629 Brand URL args.
@param string $arg Arg to create.
@return string URL arg. | [
"public function brandParentApiArg(string $arg = ''): string\n {\n return $this->App->Parent ? $this->App->Parent->Utils->§BrandUrl->brandApiArg($arg) : $this->brandApiArg($arg);\n }"
] | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Natural Language Processing:"
} |
Parse PDF files text content for keywords.
Args:
path: PDF file path.
Returns:
match: set of unique occurrences of every match. | [
"def grepPDF(self, path):\n \n with open(path, 'rb') as pdf_file_obj:\n match = set()\n text = ''\n pdf_reader = PyPDF2.PdfFileReader(pdf_file_obj)\n pages = pdf_reader.numPages\n for page in range(pages):\n page_obj = pdf_reader.getPage(page)\n text += '\\n' + page_obj.... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Keys returns a new Array object that may be used to inspect objects keys.
//
// Example:
// object := NewObject(t, map[string]interface{}{"foo": 123, "bar": 456})
// object.Keys().ContainsOnly("foo", "bar") | [
"func (o *Object) Keys() *Array {\n\tkeys := []interface{}{}\n\tfor k := range o.value {\n\t\tkeys = append(keys, k)\n\t}\n\treturn &Array{o.chain, keys}\n}"
] | [
"func Remember(index Index, keys []string, values []interface{}) {\n\tfor i, k := range keys {\n\t\tindex.Put(k, values[i])\n\t}\n\terr := index.NillableRet()\n\tif err != nil {\n\t\tlog.Fatalf(\"Woah! %v\", err)\n\t}\n\tif len(keys) > 0 && keys[0] == \"a\" {\n\t\tindex.Ellip(\"%d\", 0, 1, 1, 2, 3)\n\t\tindex.Ellip... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Add a route for DOM event - IOS bugfix version
@param {string} event_name
@param {_cTarget} target | [
"function(event_name, target) {\n\n\t\tif (this._is_inDOM && event_name == 'click' && !(event_name in this._events)) {\n\t\t\tthis.getDOMElement().onclick = Lava.noop;\n\t\t}\n\t\tthis.addEventTarget_Normal(event_name, target)\n\n\t}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// PingHandler is a simple handler that always responds with pong as text | [
"func PingHandler(w http.ResponseWriter, r *http.Request) {\n\tif methodSupported(w, r) {\n\t\tfmt.Fprintf(w, \"pong\")\n\t}\n\n}"
] | [
"def _send_raw(self, command):\n \n try:\n self._socket.send(bytearray(command))\n self._sn = (self._sn + 1) % 256\n return True\n except (socket.error, socket.timeout):\n # We can get a socket.error or timeout exception if the bridge is disconnected,... | codesearchnet | {
"query": "Represent the Github summarization about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code about Computer Science:"
} |
Defines wich actions will be inherited from the inherited controller.
Syntax is borrowed from resource_controller.
actions :index, :show, :edit
actions :all, :except => :index | [
"def actions(*actions_to_keep)\n raise ArgumentError, 'Wrong number of arguments. You have to provide which actions you want to keep.' if actions_to_keep.empty?\n\n options = actions_to_keep.extract_options!\n actions_to_remove = Array(options[:except])\n actions_to_remove += ACTIONS - a... | [
"def update\n upsert do\n # NOTE:\n # 1. update ++then++ valid to set new values in @record to draw form.\n # 1. user_scoped may have joins so that record could be\n # ActiveRecord::ReadOnlyRecord so that's why access again from\n # model.\n @record = model.find... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gather all information about dimensions and available space,
called before every repositioning
@private
@returns {object} | [
"function() {\n\t\t\n\t\tvar\tself = this,\n\t\t\t$target = self._$origin,\n\t\t\toriginIsArea = self._$origin.is('area');\n\t\t\n\t\t// if this._$origin is a map area, the target we'll need\n\t\t// the dimensions of is actually the image using the map,\n\t\t// not the area itself\n\t\tif (originIsArea) {\n\t\t\t\n... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetSuccessCount returns the number of successful controller runs | [
"func (c *Controller) GetSuccessCount() int {\n\tc.mutex.RLock()\n\tdefer c.mutex.RUnlock()\n\n\treturn c.successCount\n}"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// Update DataMin and DataMax according to the RangeModes. | [
"func (r *Range) autoscale(x float64) {\n\n\tif x < r.DataMin && !r.MinMode.Fixed {\n\t\tif !r.MinMode.Constrained {\n\t\t\t// full autoscaling\n\t\t\tr.DataMin = x\n\t\t} else {\n\t\t\tr.DataMin = fmin(fmax(x, r.MinMode.Lower), r.DataMin)\n\t\t}\n\t}\n\n\tif x > r.DataMax && !r.MaxMode.Fixed {\n\t\tif !r.MaxMode.C... | [
"@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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render layout from view
@since 1.0
@return string|bool Return View content if success or false if error | [
"public function render()\n {\n $viewPath = $this->getDirectory() . '/'. $this->getName() . '.' . $this->getExtension();\n if (!file_exists($viewPath)) {\n trigger_error('View file \"' . $viewPath . '\" doesn\\'t exist.', E_USER_ERROR);\n return false;\n }\n if (... | [
"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 sentence about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Software development:"
} |
format phone number in E123 national format with cursor position handling.
@param pphoneNumber phone number as String to format with cursor position
@param pcountryCode iso code of country
@return formated phone number as String with new cursor position | [
"public final ValueWithPos<String> formatE123NationalWithPos(\n final ValueWithPos<String> pphoneNumber, final String pcountryCode) {\n return valueWithPosDefaults(\n this.formatE123NationalWithPos(this.parsePhoneNumber(pphoneNumber, pcountryCode)),\n pphoneNumber);\n }"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GetAWSBatchJobDefinitionWithName retrieves all AWSBatchJobDefinition items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found. | [
"func (t *Template) GetAWSBatchJobDefinitionWithName(name string) (*resources.AWSBatchJobDefinition, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSBatchJobDefinition:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github description about Cloud Foundry API:",
"pos": "Represent the Github code about Cloud Foundry API:",
"neg": "Represent the Github code about Software development:"
} |
// HasIP provides a mock function with given fields: ctx, poolID, ipAddr | [
"func (_m *FacadeInterface) HasIP(ctx datastore.Context, poolID string, ipAddr string) (bool, error) {\n\tret := _m.Called(ctx, poolID, ipAddr)\n\n\tvar r0 bool\n\tif rf, ok := ret.Get(0).(func(datastore.Context, string, string) bool); ok {\n\t\tr0 = rf(ctx, poolID, ipAddr)\n\t} else {\n\t\tr0 = ret.Get(0).(bool)\n... | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
@param Validator $validator
@param mixed $object
@param $forScenario
@return bool | [
"public function validate(Validator $validator, $object, $forScenario)\n {\n if (!is_array($object) && !$object instanceof \\Traversable) {\n return false;\n }\n\n foreach ($object as $v) {\n if(!$this->rule->validate($validator, $v, $forScenario)) {\n re... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Called when new data received
@return void | [
"protected function onRead()\n {\n start:\n if ($this->getInputLength() < 5) {\n return;\n }\n /* @TODO: refactoring Binary::* to support direct buffer calls */\n $pct = $this->read(4096);\n $h = Binary::getDWord($pct);\n if ($h !== 0xFFFFFFFF) {\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Useful for triggering a subset of the benchmark in a profiler. | [
"public static void main(String[] argv) throws Exception {\n StreamingResponseBandwidthBenchmark bench = new StreamingResponseBandwidthBenchmark();\n bench.setup();\n Thread.sleep(30000);\n bench.teardown();\n System.exit(0);\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"public function handle($request, Closure $next)\n {\n $route = Route::currentRouteName();\n $method = $request->method();\n $parameters = Route::current()->parameters();\n $hackedRoute = routeHack($route,$parameters);\n\n // if user destroy route\n if (\n $me... | [
"abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ... | codesearchnet | {
"query": "Represent the Github description about Laravel:",
"pos": "Represent the Github code about Laravel:",
"neg": "Represent the Github code:"
} |
returns an array of every folder that is a component | [
"def components\n return @components if @components\n\n @components = {}\n app_folders do |app_folder|\n Dir[\"#{app_folder}/*\"].sort.each do |folder|\n if File.directory?(folder)\n folder_name = folder[/[^\\/]+$/]\n\n # Add in the folder if it's not alreay in t... | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Function to extract the template lists
@static
@access public
@param string $sListName
@return void | [
"public static function ExtractList($sListName){\n $oThis = self::CreateInstanceIfNotExists();\n $iStart = strpos($oThis->sBuffer, \"{list:{$sListName}}\");\n\n if($iStart > 0)\n $iEnd = strpos($oThis->sBuffer, \"{end}\", $iStart);\n\n if($iStart > 0 && $iE... | [
"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 implements resource create | [
"func (command HelloWorldResource) Create(awsSession *session.Session,\n\tevent *CloudFormationLambdaEvent,\n\tlogger *logrus.Logger) (map[string]interface{}, error) {\n\n\trequestPropsErr := json.Unmarshal(event.ResourceProperties, &command)\n\tif requestPropsErr != nil {\n\t\treturn nil, requestPropsErr\n\t}\n\tl... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase SarlPackage.SARL_BEHAVIOR__EXTENDS:\n\t\t\t\tsetExtends((JvmParameterizedTypeReference)null);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\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 summarization about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Add the requested post parameters to the Request.
@param request Request to add post params to | [
"private void addPostParams(final Request request) {\n if (language != null) {\n request.addPostParam(\"Language\", language);\n }\n\n if (taggedText != null) {\n request.addPostParam(\"TaggedText\", taggedText);\n }\n\n if (sourceChannel != null) {\n ... | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Write log
@param string $state State of the payment process
@param array $data Data of the log
@param string $orderId External ID of order
@return void | [
"public function logFunc($state = '', $data = array(), $orderId = 0)\n {\n\n if ($this->logger) {\n $date = @date('Y-m-d H:i:s', time());\n $logFile = $this->logPath . '/' . @date('Ymd', time()) . '.log';\n\n if (!is_writable($this->logPath)) {\n $msg = 'LOG... | [
"public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about API documentation:"
} |
This method validates if the user object is valid. A user is valid if
username and password exist OR oauth integration exists. | [
"def valid_user\n if (self.username.blank? || self.password_digest.blank?) &&\n (self.oauth_provider.blank? || self.oauth_uid.blank?)\n errors.add(:username, \" and password OR oauth must be specified\")\n end\n end"
] | [
"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:"
} |
Marshall the given parameter object. | [
"public void marshall(LambdaFunctionFailedEventAttributes lambdaFunctionFailedEventAttributes, ProtocolMarshaller protocolMarshaller) {\n\n if (lambdaFunctionFailedEventAttributes == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeNotebookInstanceRequest describeNotebookInstanceRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeNotebookInstanceRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Generates a TSIG record with a specific error for a message and adds it
to the message.
@param m The message
@param error The error
@param old If this message is a response, the TSIG from the request | [
"public void\napply(Message m, int error, TSIGRecord old) {\n\tRecord r = generate(m, m.toWire(), error, old);\n\tm.addRecord(r, Section.ADDITIONAL);\n\tm.tsigState = Message.TSIG_SIGNED;\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 Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Iterate is a set of helpers for iteration. Context may be used to cancel execution.
// Iterator will be optimized and closed after execution.
//
// By default, iteration has no limit and includes sub-paths. | [
"func Iterate(ctx context.Context, it Iterator) *IterateChain {\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\treturn &IterateChain{\n\t\tctx: ctx, it: it,\n\t\tlimit: -1, paths: true,\n\t\toptimize: true,\n\t}\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Given the H,S,B (equivalent to H,S,V) values for the HSB color mode,
convert them into the R,G,B values for the RGB color mode and return a
color tuple. This conversion is necessary because Cairo understands
only RGB(A). | [
"def colorHSB(h, s, b):\n \n H, S, B = float(h), float(s/100), float(b/100)\n if S == 0.0:\n return (B, B, B) # achromatic (grey)\n h = H / 60\n i = math.floor(h)\n f = h - i\n v = B\n p = v * (1 - S)\n q = v * (1 - S * f)\n t = v * (1... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// readStats reads the query statisitcs off the response trailers. | [
"func (s *statsResultIterator) readStats() {\n\tdata := s.resp.Trailer.Get(queryStatisticsTrailer)\n\tif data != \"\" {\n\t\ts.err = json.Unmarshal([]byte(data), &s.statisitcs)\n\t}\n}"
] | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// Return a context that inherits all values from the parent ctx and specifies
// the login provider name given here. Intended to be invoked before calls to
// Login(). | [
"func WithLoginProvider(ctx context.Context, providerName string) context.Context {\n\treturn context.WithValue(ctx, loginProviderNameKey, providerName)\n}"
] | [
"function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L... | codesearchnet | {
"query": "Represent the Github text about Go programming language:",
"pos": "Represent the Github code about Go programming language:",
"neg": "Represent the Github code about Software development:"
} |
Attach a remote entry to a local entry | [
"def attach(self, remote_entry):\n \"\"\"\"\"\"\n self.name = remote_entry.name\n self.sha = remote_entry.sha\n self.url = remote_entry.url\n self.author = remote_entry.author\n return self"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Convert bytes into a human-readable format.
For example: $bytes = 1024 would return 1KB, $bytes = 1048576 would return 1MB, etc.
@param int $bytes The number of bytes to convert.
@return string The human readable representation of the bytes. | [
"public static function make_human_readable_filesize($bytes) {\n\t\t$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');\n\t\t$num_units = count($units);\n\t\t$size = $bytes;\n\t\tforeach ($units as $i => $unit) {\n\t\t\tif ($size < 1024 || (($i + 1) === $num_units)) {\n\t\t\t\treturn round($size, 2).$unit;\n\t\t\t}\... | [
"def validate_instance_size(self, size):\n ''' '''\n try:\n int(size)\n except ValueError:\n return '*** Error: size must be a whole number between 5 and 1024.'\n if int(size) < 5 or int(size) > 1024:\n return '*** Error: size must be between 5-1024 GB.'... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Renames the specified document.
Args:
- did (str): Document ID
- name (str): New document name
Returns:
- requests.Response: Onshape response data | [
"def rename_document(self, did, name):\n '''\n \n '''\n\n payload = {\n 'name': name\n }\n\n return self._api.request('post', '/api/documents/' + did, body=payload)"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Converts the input single value into the expected Python data type,
raising django.core.exceptions.ValidationError if the data can't be
converted. Returns the converted value. Subclasses should override
this. | [
"def value_to_python(self, value):\n \n if not isinstance(value, bytes):\n raise tldap.exceptions.ValidationError(\"should be a bytes\")\n\n try:\n value = int(value)\n except (TypeError, ValueError):\n raise tldap.exceptions.ValidationError(\"is invalid ... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Extract required data only from CIU database
@param {Object} data Raw Can I Use database
@return {Object} Optimized database | [
"function optimize(data) {\n\t\tif (typeof data == 'string') {\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\n\t\treturn {\n\t\t\tvendors: parseVendors(data),\n\t\t\tcss: parseCSS(data),\n\t\t\tera: parseEra(data)\n\t\t};\n\t}"
] | [
"def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// CryptEncoderSSHA1 encodes a password with SHA1 with the
// configured salt. | [
"func CryptEncoderSSHA1(salt string) func(pass []byte, hash interface{}) []byte {\n\treturn func(pass []byte, hash interface{}) []byte {\n\t\ts := []byte(salt)\n\t\tp := append(pass, s...)\n\t\th := sha1.Sum(p)\n\t\treturn h[:]\n\t}\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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param string $fid
@return array
@throws InvalidFidException | [
"public static function getTypes($fid)\n {\n $parts = explode(':', $fid);\n switch(count($parts))\n {\n case 5:\n return [$parts[1], $parts[2]];\n case 4:\n return [$parts[1], $parts[1]];\n default:\n throw new InvalidFidException(\"Invalid FID Passed '$fid'\", 500);\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github post about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about programming:"
} |
Add listeners
@param \Illuminate\Events\Dispatcher $obEvent | [
"public function subscribe($obEvent)\n {\n parent::subscribe($obEvent);\n\n Product::extend(function ($obModel) {\n /** @var Product $obModel */\n $bSlugIsTranslatable = Settings::getValue('slug_is_translatable');\n if ($bSlugIsTranslatable) {\n $obMo... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// HasKey calls a HasKey method to RPC server. | [
"func (s *GlobalStore) HasKey(addr common.Address, key []byte) bool {\n\tvar has bool\n\tif err := s.client.Call(&has, \"mockStore_hasKey\", addr, key); err != nil {\n\t\tlog.Error(fmt.Sprintf(\"mock store HasKey: addr %s, key %064x: %v\", addr, key, err))\n\t\treturn false\n\t}\n\treturn has\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Create a function that can be used to insert nodes after the one given as argument. | [
"function pointAt(node){\n var parent = node.parentNode;\n var next = node.nextSibling;\n return function(newnode) {\n parent.insertBefore(newnode, next);\n };\n }"
] | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Getter EVRs dictionary | [
"def evrs(self):\n \"\"\"\"\"\"\n if self._evrs is None:\n import ait.core.evr as evr\n self._evrs = evr.getDefaultDict()\n\n return self._evrs"
] | [
"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:"
} |
Registers a {@link MessageHandler} that handles the received messages of
the specified <code>type</code>.
@return the old handler if there is already a registered handler for
the specified <tt>type</tt>. <tt>null</tt> otherwise. | [
"@SuppressWarnings(\"unchecked\")\n public <E> MessageHandler<? super E> addReceivedMessageHandler(Class<E> type,\n MessageHandler<? super E> handler) {\n receivedMessageHandlerCache.clear();\n return (MessageHandler<? super E>) receivedMessageHandlers.put(type, handler);\n }"
] | [
"private void buildCommandChain(ICommand command) {\n\t\tICommand next = command;\n\t\tfor (int i = _interceptors.size() - 1; i >= 0; i--)\n\t\t\tnext = new InterceptedCommand(_interceptors.get(i), next);\n\n\t\t_commandsByName.put(next.getName(), next);\n\t}\n\n\t/**\n\t * Rebuilds execution chain for all register... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Read bits and interpret as an octal string. | [
"def _readoct(self, length, start):\n \"\"\"\"\"\"\n if length % 3:\n raise InterpretError(\"Cannot convert to octal unambiguously - \"\n \"not multiple of 3 bits.\")\n if not length:\n return ''\n # Get main octal bit by converting f... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Method: clone
Create a clone of this layer
Paramters:
obj - {Object} An optional layer (is this ever used?)
Returns:
{<OpenLayers.Layer.Image>} An exact copy of this layer | [
"function(obj) {\n \n if(obj == null) {\n obj = new OpenLayers.Layer.Image(this.name,\n this.url,\n this.extent,\n this.size,\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the referrer hostname. | [
"def _get_cookie_referrer_host(self):\n ''''''\n referer = self._original_request.fields.get('Referer')\n\n if referer:\n return URLInfo.parse(referer).hostname\n else:\n return None"
] | [
"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 text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
返回用户感兴趣的标签
对应API:{@link http://open.weibo.com/wiki/2/tags/suggestions tags/suggestions}
@access public
@param int $count 单页大小。缺省值10,最大值10。可选。
@return array | [
"function get_suggest_tags( $count = 10)\n\t{\n\t\t$params = array();\n\t\t$params['count'] = intval($count);\n\t\treturn $this->oauth->get( 'tags/suggestions', $params );\n\t}"
] | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Done action.
@param Request $request
@return Response | [
"public function doneAction(Request $request)\n {\n $debug = $this->container->getParameter('kernel.debug');\n\n $token = $this->getHttpRequestVerifier()->verify($request);\n\n $gateway = $this->getPayum()->getGateway($token->getGatewayName());\n\n $gateway->execute($done = new Done($... | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the Github text about Symfony:",
"pos": "Represent the Github code about Symfony:",
"neg": "Represent the Github code about Software development:"
} |
Create a PHP script returning the cached value
@param mixed $value
@param int|null $ttl
@return string | [
"public function createScript($value, ?int $ttl): string\n {\n $macro = var_export($value, true);\n\n if (strpos($macro, 'stdClass::__set_state') !== false) {\n $macro = preg_replace_callback(\"/('([^'\\\\\\\\]++|''\\\\.)')|stdClass::__set_state/\", $macro, function($match) {\n ... | [
"final public function create()\n {\n\n $self = $this;\n\n $splash = $self->getSplash();\n $sessId = $this->generateId($splash);\n\n session_id($sessId); //Must be called before the sesion start to generate the Id\n session_cache_limiter('none');\n\n session_name(md5($se... | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Deprecated. Returns the data as a `list` | [
"def data(self):\n \"\"\"\"\"\"\n import warnings\n warnings.warn(\n '`data` attribute is deprecated and will be removed in a future release, '\n 'use %s as an iterable instead' % (PaginatedResponse,),\n category=DeprecationWarning,\n stacklevel=2 # ... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Remove routing group from the storage. | [
"def group_remove(name, **kwargs):\n \n ctx = Context(**kwargs)\n ctx.execute_action('group:remove', **{\n 'storage': ctx.repo.create_secure_service('storage'),\n 'name': name,\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.