query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Clears the buffer and resets the index to the given index. @return The entry buffer.
[ "public EntryBuffer clear() {\n for (int i = 0; i < buffer.length; i++) {\n buffer[i] = null;\n }\n return this;\n }" ]
[ "int blockForReadSpace(int readLocation) {\n\n // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.\n final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;\n\n // in the for loop below, we are blocked reading unit another ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Persist an entity or an entity collection into the database. @param Mappable|\Traversable|array $entity @throws \InvalidArgumentException @throws MappingException @return Mappable|\Traversable|array
[ "public function store($entity)\n {\n if ($this->manager->isTraversable($entity)) {\n return $this->storeCollection($entity);\n } else {\n return $this->storeEntity($entity);\n }\n }" ]
[ "final protected function constructNewObjectsFromRow(LoadingContext $context, Row $row) : ITypedObject\n {\n return $this->mapping->constructNewObjectFromRow($row);\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:" }
Start from defined cluster number and write data, following allocated cluster chain.
[ "def writeClusters(start, buf, len = buf.length)\n clus = start; num, leftover = len.divmod(@bytesPerCluster); num += 1 if leftover > 0\n 0.upto(num - 1) do |offset|\n local = buf[offset * @bytesPerCluster, @bytesPerCluster]\n if local.length < @bytesPerCluster then local += (\"\\0\" * (@byt...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Simple solr special char escaper. Based on https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser @param {String} str - The string to escape @return {String} - The same string with all special solr chars escaped with '\'
[ "function escapeSolrChars(str) {\n let solrChars = /(\\+|\\-|\\!|\\(|\\)|\\{|\\}|\\[|\\]|\\^|\\\"|\\~|\\*|\\?|\\:|\\/|\\&{2}|\\|{2}|\\s)/gm;\n return str.replace(solrChars, (match) => match.replace(/(.)/gm, '\\\\$1') );\n}" ]
[ "private static String dotsToRegex(String dotsName) {\n /*\n * oops, next line requires JDK 1.5 return dotsName.replace(\"$\",\n * \"\\\\$\").replace(\".\", SEP); could use String.replaceAll(regex, repl)\n * but that can be problematic--javadoc says \"Note that backslashes (\\)\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Get the `logging` module log level from a verbosity. :param verbosity: The number of times the `-v` option was specified. :return: The corresponding log level.
[ "def log_level_from_vebosity(verbosity):\n \n if verbosity == 0:\n return logging.WARNING\n if verbosity == 1:\n return logging.INFO\n return logging.DEBUG" ]
[ "def parse_cli():\n \n\n #\n # 1. parse cli arguments\n #\n\n __docopt__ = \"\"\"\nusage: pykwalify -d FILE -s FILE ... [-e FILE ...]\n [--strict-rule-validation] [--fix-ruby-style-regex] [--allow-assertions] [--encoding ENCODING]\n [-v ...] [-q]\n\noptional arguments:\n -d FILE, --data-...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Finds statistics that correspond to PSM/peptide/protein feature's score. Loops through list of qvality generated scores until it finds values closest to the feature's svm_score.
[ "def lookup_statistic(score, stats):\n \n if score in stats:\n return stats[score]['q'], stats[score]['PEP'], None\n else:\n lower, warning = None, None\n for stat_score in sorted(stats.keys()):\n if score < stat_score:\n break\n lower = stat_score\...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
加载最大熵模型<br> 如果存在缓存的话,优先读取缓存,否则读取txt,并且建立缓存 @param txtPath txt的路径,即使不存在.txt,只存在.bin,也应传入txt的路径,方法内部会自动加.bin后缀 @return
[ "public static MaxEntModel load(String txtPath)\n {\n ByteArray byteArray = ByteArray.createByteArray(txtPath + Predefine.BIN_EXT);\n if (byteArray != null) return create(byteArray);\n return create(txtPath);\n }" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Get retrieves the value for key. If the key doesn't exist in the RequestContext, // Get returns nil.
[ "func (r *RequestContext) Get(key string) interface{} {\n\tr.mutex.RLock()\n\tdefer r.mutex.RUnlock()\n\treturn r.store[key]\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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Example function to process the files uploaded. This one simply displays the files' data.
[ "public function defaultAfterUploadManagement() {\n\t\t$flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files);\n\t\t$flist = $this->classparams['http_flist_start'];\n\t\tforeach ($this->files as $f) {\n\t\t\t//$f is an array, that contains all info about the uploaded file.\n\t\t\t$t...
[ "def handle_request_files_upload(request):\n \n # FILES is a dictionary in Django but Ajax Upload gives the uploaded file\n # an ID based on a random number, so it cannot be guessed here in the code.\n # Rather than editing Ajax Upload to pass the ID in the querystring,\n # note that each upload is a...
codesearchnet
{ "query": "Represent the Github comment about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about Programming:" }
Find the set of files from our parent_dir that we care about
[ "def find_files(self, context, silent_build):\n \n first_layer = [\"'{0}'\".format(thing) for thing in os.listdir(context.parent_dir)]\n output, status = command_output(\"find {0} -type l -or -type f {1} -follow -print\".format(' '.join(first_layer), context.find_options), cwd=context.parent_di...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Handle frames sent to Channel0. :param frame_in: Amqp frame. :return:
[ "def on_frame(self, frame_in):\n \n LOGGER.debug('Frame Received: %s', frame_in.name)\n if frame_in.name == 'Heartbeat':\n return\n elif frame_in.name == 'Connection.Close':\n self._close_connection(frame_in)\n elif frame_in.name == 'Connection.CloseOk':\n ...
[ "def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// AuthList lists SASL auth mechanisms.
[ "func (c *Client) AuthList() (*gomemcached.MCResponse, error) {\n\treturn c.Send(&gomemcached.MCRequest{\n\t\tOpcode: gomemcached.SASL_LIST_MECHS})\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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Initializes logging.
[ "def init_log(log_level):\n \"\"\"\"\"\"\n log_level = log_level or \"INFO\"\n logging.basicConfig(\n format=\"%(name)s:%(levelname)s:%(message)s\",\n level=getattr(logging, log_level.upper(), logging.INFO),\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:" }
Formats text with the the currently-set styles @param string $text The text to format @return string The formatted text
[ "public function format(string $text) : string\n {\n if ($text === '') {\n return $text;\n }\n\n $startCodes = [];\n $endCodes = [];\n\n if ($this->foregroundColor !== null) {\n $startCodes[] = self::$supportedForegroundColors[$this->foregroundColor][0];\n...
[ "protected function prettifyComment($comment)\n {\n if (empty($comment) === true) {\n return '';\n }\n\n // We split our comment into single lines and remove the unwanted\n // comment chars with the array_map callback.\n // We skip lines with /** and */\n $res...
codesearchnet
{ "query": "Represent the description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Include the referenceStreamCount when setting the watermarks (called by BaseMessageItemStream.updateWaterMarks() (which has no concept of referenceStreams) (510343) @param nextLowWatermark @param nextHighWatermark @throws SevereMessageStoreException
[ "@Override\n protected void setWatermarks(long nextLowWatermark, long nextHighWatermark)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"setWatermarks\",\n new Object[] { new Long(nextLowWatermark), new Long(nextHighWatermark)...
[ "public SyncStatement request( Collection<? extends BEvent> toRequest ) {\n return new SyncStatement(getBthread(), toRequest, getWaitFor(), getBlock(), getInterrupt(), isHot(), getData());\n }" ]
codesearchnet
{ "query": "Represent the sentence about Java programming:", "pos": "Represent the code about Java programming:", "neg": "Represent the code about text processing:" }
Converts given rotation matrix to euler angles in radian. Args: rmat: 3x3 rotation matrix axes: One of 24 axis sequences as string or encoded tuple Returns: converted euler angles in radian vec3 float
[ "def mat2euler(rmat, axes=\"sxyz\"):\n \n try:\n firstaxis, parity, repetition, frame = _AXES2TUPLE[axes.lower()]\n except (AttributeError, KeyError):\n firstaxis, parity, repetition, frame = axes\n\n i = firstaxis\n j = _NEXT_AXIS[i + parity]\n k = _NEXT_AXIS[i - parity + 1]\n\n ...
[ "def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ...
codesearchnet
{ "query": "Represent the Github comment about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.jboss.declarchive.api.container.ClassContainer#addClasses(java.lang.Class<?>[])
[ "@Override\n public T addClasses(Class<?>... classes) throws IllegalArgumentException {\n Validate.notNull(classes, \"Classes must be specified\");\n\n for (final Class<?> clazz : classes) {\n Asset resource = new ClassAsset(clazz);\n ArchivePath location = new BasicPath(getCl...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Add a grouping column to the GROUP clause of the query. Usage: $query->group('id'); @param mixed $columns A string or array of ordering columns. @return DatabaseQuery Returns this object to allow chaining. @since 1.0
[ "public function group($columns)\n\t{\n\t\tif (is_null($this->group))\n\t\t{\n\t\t\t$this->group = new Query\\QueryElement('GROUP BY', $columns);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->group->append($columns);\n\t\t}\n\n\t\treturn $this;\n\t}" ]
[ "public function setTable($table)\n {\n if (!is_array($table)\n && !($table instanceof DataTableInterface)\n ) {\n throw new Exception(\"DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.\");\n }\n $this->table = $table;\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Run implements cmd.Command.
[ "func (c *scaleApplicationCommand) Run(ctx *cmd.Context) error {\n\tclient, err := c.newAPIFunc()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Close()\n\n\tif client.BestAPIVersion() < 8 {\n\t\treturn errors.New(\"scaling applications is not supported by this controller\")\n\t}\n\n\tresult, err := client...
[ "func InitDispatcher(d *tq.Dispatcher) {\n\td.RegisterTask(&internal.EmailTask{}, SendEmail, \"email\", nil)\n}" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Assert a WP_Post Entity is an Attachment @param WP_Post $post @param string|null $message @throws InvalidArgumentException
[ "public static function isAttachment(WP_Post $post, string $message = null): void\n {\n $postType = $post->post_type;\n 'attachment' === $postType or static::reportInvalidArgument(\n $message ?: \"Expected Post be an Attachment. Type of {$postType} Given.\"\n );\n }" ]
[ "function validateService($pluginInstance)\n {\n if (!is_object($pluginInstance))\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof iAuthenticator)\n throw new exContainerInvalidServiceType('Invalid Plugin...
codesearchnet
{ "query": "Represent the Github instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Software development:" }
// userInOrg queries the GitHub API for a users' org membership. // // The HTTP passed client is expected to be constructed by the golang.org/x/oauth2 package, // which inserts a bearer token as part of the request.
[ "func (c *githubConnector) userInOrg(ctx context.Context, client *http.Client, userName, orgName string) (bool, error) {\n\t// requester == user, so GET-ing this endpoint should return 404/302 if user\n\t// is not a member\n\t//\n\t// https://developer.github.com/v3/orgs/members/#check-membership\n\tapiURL := fmt.S...
[ "func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets the product-target associations for the given targets, preserving the input order. :API: public :param targets: The targets to lookup products for. :returns: The ordered (product, target) tuples.
[ "def get_product_target_mappings_for_targets(self, targets):\n \n product_target_mappings = []\n for target in targets:\n for product in self._products_by_target[target]:\n product_target_mappings.append((product, target))\n\n return product_target_mappings" ]
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* |-------------------------------------------------------------------------- | Entity |--------------------------------------------------------------------------
[ "function CainiaoInfo(id, messages, destinyId) {\n this.id = id\n this.states = messages\n this.destinyId = destinyId\n this.trackerWebsite = cainiao.getLink(id)\n}" ]
[ "protected static function showVersion()\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%y+----------------------------------------------------------------------+%N'));\n \\cli\\line(\\cli\\Colors::colorize('%y| Welcome to Doozr\\'s Demo project installer. ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Remove tags from a file. Args: filething (filething) Raises: mutagen.MutagenError
[ "def delete(filething):\n \n\n f = FLAC(filething)\n filething.fileobj.seek(0)\n f.delete(filething)" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
--------------------------------------------------------------------------------------------
[ "public static String readString(DataInput in) throws IOException {\n\t\t// the length we read is offset by one, because a length of zero indicates a null value\n\t\tint len = in.readUnsignedByte();\n\t\t\n\t\tif (len == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (len >= HIGH_BIT) {\n\t\t\tint shift = 7;\n\t\t\tint ...
[ "public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col...
codesearchnet
{ "query": "Represent the Github summarization about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code about programming:" }
The checker function: whether there is a newline before THAT operator.
[ "function checkNewlineBefore({\n string,\n globalIndex,\n startIndex,\n endIndex,\n node,\n result\n}) {\n const symbol = string.substring(startIndex, endIndex + 1);\n let newLineBefore = false;\n\n let index = endIndex + 1;\n\n while (index && isWhitespace(string[index])) {\n if (string[index] === \"\...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Send the Request to the Server and return the Response @param BoxRequest $request @return BoxResponse @throws Exceptions\BoxClientException
[ "public function sendRequest(BoxRequest $request)\n {\n //Method\n $method = $request->getMethod();\n\n //Prepare Request\n list($url, $headers, $requestBody, $options) = $this->prepareRequest($request);\n\n //Send the Request to the Server through the HTTP Client\n //an...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Programming:" }
Loops the update list and checks for actionable updates. @param array $result @return array
[ "protected function processImportantUpdates($result)\n {\n $hasImportantUpdates = false;\n\n /*\n * Core\n */\n if (isset($result['core'])) {\n $coreImportant = false;\n\n foreach (array_get($result, 'core.updates', []) as $build => $description) {\n ...
[ "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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
@param string $suffix @return string
[ "public function getPathByConvention($suffix = null)\n {\n $entityName = strtolower($this->getEntityName());\n $entityName = str_replace('\\\\', '_', $entityName);\n if (empty($suffix)) {\n return sprintf('%s_admin_%s', strtolower($this->getBundleName()), $entityName);\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Executes the passed command. Returns True if successful :param str cmd: The command to run :return: True if successful, otherwise False :rtype: bool :raises: Error if command fails or is not supported
[ "def execute_return_success(cmd):\n '''\n \n '''\n\n ret = _run_all(cmd)\n\n if ret['retcode'] != 0 or 'not supported' in ret['stdout'].lower():\n msg = 'Command Failed: {0}\\n'.format(cmd)\n msg += 'Return Code: {0}\\n'.format(ret['retcode'])\n msg += 'Output: {0}\\n'.format(ret...
[ "def check_output_and_strip(cmd): # type: (List[Text]) -> Optional[Text]\n \n try:\n result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)\n return result.strip()\n except (OSError, subprocess.CalledProcessError, TypeError, AttributeError):\n # OSError is raised if command d...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Get formatted label.Appends ellipses if content does not fit the label. @param labelContent content @return Label
[ "public static Label getFormatedLabel(final String labelContent) {\n final Label labelValue = new Label(labelContent, ContentMode.HTML);\n labelValue.setSizeFull();\n labelValue.addStyleName(SPUIDefinitions.TEXT_STYLE);\n labelValue.addStyleName(\"label-style\");\n return labelVal...
[ "def insert_text(self, text):\n \"\"\"\"\"\"\n # Eventually this maybe should wrap to insert_text_to if\n # backspace-handling is required\n self.textCursor().insertText(text, self.default_style.format)" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Use for set/get info about element in your application @param string|null $descr @return WebDriver_Element|string
[ "public function description($descr = null)\n {\n if ($descr === null) {\n return $this->description;\n } else {\n $this->description = $descr;\n return $this;\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Method called to create a new context for iterating all contents of the currentFieldName structured value (JSON array or object) @return A cursor for the children
[ "public final BsonObjectCursor iterateChildren() {\n Object n = currentNode();\n if (n == null) throw new IllegalStateException(\"No current node\");\n if (n instanceof Iterable) { // false since we have already returned START_ARRAY\n return new ArrayCursor((Iterable) n, this);\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
On initial socket connection with the console, listen for commands and send out the config.
[ "function(socket) {\n\n var username = null;\n var permissions = null;\n if (socket.handshake.headers.authorization) {\n username = socket.handshake.headers.authorization.match(/username=\"([^\"]+)\"/)[1];\n permissions = $$config.permissions ? $$config.permissions[usernam...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Is word boolean. @param wordString the word string @return the boolean
[ "public static boolean isWord(String wordString) {\n return Optional.ofNullable(wordPattern)\n .orElseGet(() -> wordPattern = Pattern.compile(WordPattern))\n .matcher(wordString).matches();\n }" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Natural Language Processing:" }
Print a label. @param string $text
[ "public function addPdfLabel(string $text)\n {\n if ($this->countX == $this->xNumber) {\n // Page full, we start a new one\n $this->AddPage();\n $this->countX = 0;\n $this->countY = 0;\n }\n\n $posX = $this->marginLeft + ($this->countX * ($this->wi...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// DeleteTrunk removes a trunk.
[ "func (b *BigIP) DeleteTrunk(name string) error {\n\treturn b.delete(uriNet, uriTrunk, 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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Auto start the GNS3 VM if require
[ "def auto_start_vm(self):\n \n if self.enable:\n try:\n yield from self.start()\n except GNS3VMError as e:\n # User will receive the error later when they will try to use the node\n try:\n yield from self._controller...
[ "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:" }
// isX509Error reports whether the given websocket error // results from an X509 problem.
[ "func isX509Error(err error) bool {\n\tswitch errType := errors.Cause(err).(type) {\n\tcase *websocket.CloseError:\n\t\treturn errType.Code == websocket.CloseTLSHandshake\n\tcase x509.CertificateInvalidError,\n\t\tx509.HostnameError,\n\t\tx509.InsecureAlgorithmError,\n\t\tx509.UnhandledCriticalExtension,\n\t\tx509....
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* (non-Javadoc) @see org.joml.Matrix4x3dc#transformAab(org.joml.Vector3dc, org.joml.Vector3dc, org.joml.Vector3d, org.joml.Vector3d)
[ "public Matrix4x3d transformAab(Vector3dc min, Vector3dc max, Vector3d outMin, Vector3d outMax) {\n return transformAab(min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), outMin, outMax);\n }" ]
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// AllRefs returns a slice of all references in a Git repository located in a // the given working directory "wd", or an error if those references could not // be loaded.
[ "func AllRefsIn(wd string) ([]*Ref, error) {\n\tcmd := gitNoLFS(\n\t\t\"for-each-ref\", \"--format=%(objectname)%00%(refname)\")\n\tcmd.Dir = wd\n\n\toutp, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, lfserrors.Wrap(err, \"cannot open pipe\")\n\t}\n\tcmd.Start()\n\n\trefs := make([]*Ref, 0)\n\n\tscan...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
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:" }
Return md5 from meta, or compute it if absent.
[ "def md5(self):\n \"\"\"\"\"\"\n md5 = self.meta.get(\"md5\")\n if md5 is None:\n md5 = str(hashlib.md5(self.value).hexdigest())\n\n return md5" ]
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the Github summarization about Text processing:", "pos": "Represent the Github code about Text processing:", "neg": "Represent the Github code:" }
// newNode will allocate and return a new node with the entry // provided. maxLevels will determine the length of the forward // pointer list associated with this node.
[ "func newNode(cmp common.Comparator, maxLevels uint8) *node {\n\treturn &node{\n\t\tentry: cmp,\n\t\tforward: make(nodes, maxLevels),\n\t\twidths: make(widths, maxLevels),\n\t}\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Sets the memory limit in megabytes Does not lower the limit. Considers maximum value constrained by suhosin. @param int limit in Megabytes @return bool Whether setting limit was successful
[ "public static function set($limit)\n {\n if (!is_int($limit)) throw new Kwf_Exception('Limit must be an integer');\n if ($limit <= 0) throw new Kwf_Exception('Not allowed setting memory limit to: ' . $limit);\n\n $currentLimit = self::convertToMegabyte(ini_get('memory_limit'));\n if ...
[ "def setupJobAfterFailure(self, config):\n \n self.remainingRetryCount = max(0, self.remainingRetryCount - 1)\n logger.warn(\"Due to failure we are reducing the remaining retry count of job %s with ID %s to %s\",\n self, self.jobStoreID, self.remainingRetryCount)\n # S...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// String returns a string representation of a BlockNode.
[ "func (t *BlockNode) String() string {\n\treturn fmt.Sprintf(\"Block(%s: %s)\", t.Name, t.Body)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Put entity to cache, save to persistence storage operation will be executed in background @param entity Target entity @return Future for put to cache operation
[ "@Override\n public ListenableFuture<Boolean> saveAsync(@NotNull Entry entity) {\n Timer time = getMetrics().getTimer(MetricsType.CACHEABLE_DATA_PROVIDER_PUT_TO_CACHE.name());\n\n long cacheKey = buildHashCode(entity);\n\n cache.put(cacheKey, entity);\n\n time.stop();\n\n retur...
[ "@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Get the instance of the claim when passing the name and value. @param string $name @param mixed $value @return \Tymon\JWTAuth\Claims\Claim
[ "public function get($name, $value)\n {\n if ($this->has($name)) {\n $claim = new $this->classMap[$name]($value);\n\n return method_exists($claim, 'setLeeway') ?\n $claim->setLeeway($this->leeway) :\n $claim;\n }\n\n return new Custom($name...
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// AllowRelativeURLs enables RequireParseableURLs and then permits URLs that // are parseable, have no schema information and url.IsAbs() returns false // This permits local URLs
[ "func (p *Policy) AllowRelativeURLs(require bool) *Policy {\n\n\tp.RequireParseableURLs(true)\n\tp.allowRelativeURLs = require\n\n\treturn p\n}" ]
[ "public boolean isValidStartContextForContentKindLoose(SanitizedContentKind contentKind) {\n switch (contentKind) {\n case URI:\n // Allow contextual templates directly call URI templates, even if we technically need to\n // do HTML-escaping for correct output. Supported browsers recover grac...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param string $input @param array $noise @return string
[ "private function mask($input, array $noise)\n {\n $xord = '';\n\n $input = unpack('C*', $input);\n $inputSize = count($input);\n $noiseSize = count($noise);\n\n $currentByte = 1;\n\n // Parse the string byte by byte and xor against noise\n while ($currentByte <= ...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Split a string that has value and unit as one. :param str line: :return str str:
[ "def __split_name_unit(self, line):\n \n vals = []\n unit = ''\n if line != '' or line != ' ':\n # If there are parenthesis, remove them\n line = line.replace('(', '').replace(')', '')\n # When value and units are a range (i.e. '100 m - 200 m').\n ...
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Получить ассоциативный массив ключ-значение из запроса. В результатах запроса должно быть ровно два столбца!
[ "public function fetchPair($sql, $values = null, $connection = null)\n {\n $st = $this->query($sql, $values, $connection);\n\n return $st->fetchAll(\\PDO::FETCH_KEY_PAIR);\n }" ]
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Incr increases cached int-type value by given key as a counter.
[ "func (c *MemcacheCacher) Incr(key string) error {\n\t_, err := c.c.Increment(key, 1)\n\treturn err\n}" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
GET /pages/new GET /pages/new.json
[ "def new\n @page.parent ||= Page.where(id: params['parent_id']).first\n respond_to do |format|\n format.html { render layout: false if request.xhr? }\n format.json { render json: @page }\n end\n end" ]
[ "def list(self, subid, params=None):\n ''' \n '''\n params = update_params(params, {'SUBID': subid})\n return self.request('/v1/server/list_ipv4', params, 'GET')" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Create a new SNative contract description object by passing a comment, name // and a list of member functions descriptions
[ "func NewSNativeContract(comment, name string,\n\tfunctions ...*SNativeFunctionDescription) *SNativeContractDescription {\n\n\tfunctionsByID := make(map[abi.FunctionID]*SNativeFunctionDescription, len(functions))\n\tfor _, f := range functions {\n\n\t\tf.Abi = *abi.SpecFromStructReflect(f.Name, f.Arguments, f.Retur...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns all the possible combinations of the set in a stream. Heavily Modified code: http://codereview.stackexchange.com/questions/26854/recursive-method-to-return-a-set-of-all-combinations @param elements @param subsetSize @param <T> @return
[ "public static <T> Stream<Set<T>> combinationsStream(Set<T> elements, int subsetSize) {\n if (subsetSize == 0) {\n return Stream.of(new HashSet<>());\n }\n else if (subsetSize <= elements.size()) {\n Set<T> remainingElements = elements;\n\n Iterator<T> it = rema...
[ "def get_mode(self):\n \n # http://stackoverflow.com/questions/10797819/finding-the-mode-of-a-list-in-python\n return max(set(self._entry_scores), key=self._entry_scores.count)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Mathematics:" }
<pre> Use this operation to get SNMP Manager details. </pre>
[ "public static snmp_manager[] get(nitro_service client) throws Exception\r\n\t{\r\n\t\tsnmp_manager resource = new snmp_manager();\r\n\t\tresource.validate(\"get\");\r\n\t\treturn (snmp_manager[]) resource.get_resources(client);\r\n\t}" ]
[ "@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Search containing any sponsored pieces of Content.
[ "def sponsored(self, **kwargs):\n \"\"\"\"\"\"\n eqs = self.search(**kwargs)\n eqs = eqs.filter(AllSponsored())\n published_offset = getattr(settings, \"RECENT_SPONSORED_OFFSET_HOURS\", None)\n if published_offset:\n now = timezone.now()\n eqs = eqs.filter(\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ServeHTTP TODO
[ "func (h httpHandlerCustom) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\th.F(h.ctx, w, r)\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Changing / Assiging new file @param string $file JPEG file to process
[ "function assign($file)\n {\n\n if (!empty($file))\n {\n $this->file = $file;\n }\n\n /** check for existance of file! */\n if (!file_exists($this->file))\n {\n $this->errorno = 1;\n $this->errorstr = \"File '\" . $this->file . \"' does 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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
new @author Tom Haskins-Vaughan <tom@harvestcloud.com> @since 2012-04-12 @param Request $request
[ "public function newAction(Request $request)\n {\n $product = new Product();\n $product->setSeller($this->getCurrentProfile());\n $form = $this->createForm(new ProductType($this->getCurrentProfile()), $product);\n\n // During the Eggbox stage, we'll hard code the Category\n $pr...
[ "protected function generateInfoYamlMetadata($version, $project, $datestamp)\n {\n $core = preg_replace('/^([0-9]).*$/', '$1.x', $version);\n $date = date('Y-m-d', $datestamp);\n $info = <<<METADATA\n\n# Information add by drustack/composer-generate-metadata on {$date}\ncore: \"{$core}\"\npr...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Task 2. <a href="https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html">Create a String to Sign for Signature Version 4</a>
[ "String task2(AwsSigner4Request sr) {\n StringBuilder sb = new StringBuilder(\"AWS4-HMAC-SHA256\\n\")\n .append(sr.getSigningDateTime()).append('\\n')\n .append(sr.getScope()).append('\\n');\n hexEncode(sb, sha256(task1(sr)));\n return sb.toString();\n }" ]
[ "def set_rest_notification(self, url, hit_type_id):\n \n ISO8601 = \"%Y-%m-%dT%H:%M:%SZ\"\n notification_version = \"2006-05-05\"\n API_version = \"2014-08-15\"\n data = {\n \"AWSAccessKeyId\": self.aws_key,\n \"HITTypeId\": hit_type_id,\n \"Notifi...
codesearchnet
{ "query": "Represent the Github summarization about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code:" }
Sets the Resolution of the Calendar. Resolutions decide how many months to show either side, or whether to show a week or work week. @param ResolutionInterface $res Resolution to use @return $this
[ "public function setResolution(ResolutionInterface $res)\n {\n $this->resolution = $res;\n $this->resolution->setDateTime($this->currentDate());\n return $this;\n }" ]
[ "public void setPage(int page) {\n if(page < 0)\n throw new IllegalArgumentException(Bundle.getErrorString(\"PagerModel_IllegalPage\"));\n\n /* todo: need to check that the new 'current' page is in range given the first/last boundaries */\n _currentRow = new Integer(page * getPageSiz...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// ServiceChecks is used to get all the checks for a service
[ "func (h *Health) ServiceChecks(args *structs.ServiceSpecificRequest,\n\treply *structs.IndexedHealthChecks) error {\n\t// Reject if tag filtering is on\n\tif args.TagFilter {\n\t\treturn fmt.Errorf(\"Tag filtering is not supported\")\n\t}\n\n\t// Potentially forward\n\tif done, err := h.srv.forward(\"Health.Servic...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Detected example email addresses. As defined in http://tools.ietf.org/html/rfc2606 @param string $email Address @return boolean|null
[ "public function isExample($email)\n {\n if (! $this->isEmail($email)) {\n return null;\n }\n\n $hostname = $this->hostnameFromEmail($email);\n\n if ($hostname) {\n if (in_array($hostname, $this->exampleDomains)) {\n return true;\n }\n\n...
[ "final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Reads a .lprof file and cleans it
[ "def clean_lprof_file(input_fname, output_fname=None):\n \n # Read the raw .lprof text dump\n text = ut.read_from(input_fname)\n # Sort and clean the text\n output_text = clean_line_profile_text(text)\n return output_text" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// GetStateFromCluster will return the current state of one of the cluster nodes.
[ "func (c *Client) GetStateFromCluster() (*State, error) {\n\tresp, err := c.GetHTTPResponseFromCluster(c.GetURLForStateFile)\n\treturn c.parseStateResponse(resp, err)\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
vectorizes the pdf object's bounding box min_width is the width under which we consider it a line instead of a big rectangle
[ "def vectorize(e, tolerance=0.1):\n \n tolerance = max(tolerance, e.linewidth)\n is_high = e.height > tolerance\n is_wide = e.width > tolerance\n # if skewed towards a line\n if is_wide and not is_high:\n return (e.width, 0.0)\n if is_high and not is_wide:\n return (0.0, e.height)...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// newContext builds a new base Context object.
[ "func newContext(c *cli.Context) (ctx *Context, err error) {\n\tctx = &Context{\n\t\tContext: c,\n\t\tnetCtx: context.Background(),\n\t}\n\n\tctx.reporter, err = newReporter(ctx)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tctx.logger, err = newLogger(ctx)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tctx.stats, err = newS...
[ "@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 Go programming language:", "pos": "Represent the code about Go programming language:", "neg": "Represent the code:" }
Fetch the API description from the remote MAAS instance.
[ "async def fetch_api_description(\n url: typing.Union[str, ParseResult, SplitResult],\n insecure: bool = False):\n \"\"\"\"\"\"\n url_describe = urljoin(_ensure_url_string(url), \"describe/\")\n connector = aiohttp.TCPConnector(verify_ssl=(not insecure))\n session = aiohttp.ClientSession(c...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// createDTOFromEntity copy all data from an entity to a Response DTO
[ "func createDTOFromEntity(entity Entity) (resDTO rest.ResponseDTO, error *servicehelper.Error) {\n\tcopier.Copy(&resDTO, &entity)\n\tlocation, _ := time.LoadLocation(\"UTC\")\n\tresDTO.Birthday = entity.Birthday.In(location).Format(\"2006-01-02\")\n\tuserInfo, err := askUserServiceForUserEmail(entity.UserID)\n\tif ...
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// relation requests relation information from the server.
[ "func (st *State) relation(relationTag, unitTag names.Tag) (params.RelationResult, error) {\n\tnothing := params.RelationResult{}\n\tvar result params.RelationResults\n\targs := params.RelationUnits{\n\t\tRelationUnits: []params.RelationUnit{\n\t\t\t{Relation: relationTag.String(), Unit: unitTag.String()},\n\t\t},\...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Checks if the given statement group contains at least one value of precision +/-1. @param statementGroup @return
[ "protected boolean hasPlusMinusOneValues(StatementGroup statementGroup) {\n\t\tif (statementGroup == null) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (Statement s : statementGroup) {\n\t\t\tQuantityValue qv = (QuantityValue) s.getValue();\n\t\t\tif (qv != null && isPlusMinusOneValue(qv)) {\n\t\t\t\treturn true;\n\t\t\t...
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Regular expressions:" }
Set this matrix to be equivalent to the rotation specified by the given {@link AxisAngle4f}. @param axisAngle the {@link AxisAngle4f} @return this
[ "public Matrix3d set(AxisAngle4f axisAngle) {\n double x = axisAngle.x;\n double y = axisAngle.y;\n double z = axisAngle.z;\n double angle = axisAngle.angle;\n double invLength = 1.0 / Math.sqrt(x*x + y*y + z*z);\n x *= invLength;\n y *= invLength;\n z *= invL...
[ "private void calcReferenceVector() {\n\t\treferenceVector = getReferenceAxisCylic();\n\n\t\tif (referenceVector == null) {\n\t\t\tlogger.warn(\"no reference vector found. Using y-axis.\");\n\t\t\treferenceVector = new Vector3d(Y_AXIS);\n\t\t}\n\t\t// make sure reference vector is perpendicular principal roation ve...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about mathematics:" }
Export the cart as an array. @return array
[ "public function toArray()\n {\n return [\n 'id' => $this->id,\n 'items' => array_map(function (CartItem $item) {\n return $item->toArray();\n }, $this->items),\n ];\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// DeleteFile calls FileManager.DeleteDatastoreFile
[ "func (m *DatastoreFileManager) DeleteFile(ctx context.Context, name string) error {\n\tp := m.Path(name)\n\n\ttask, err := m.FileManager.DeleteDatastoreFile(ctx, p.String(), m.Datacenter)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn m.wait(ctx, task)\n}" ]
[ "def creationTime(item):\n \n forThisItem = _CreationTime.createdItem == item\n return item.store.findUnique(_CreationTime, forThisItem).timestamp" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Duration returns the time duration of the n'th wait cycle in a // backoff policy. This is b.Millis[n], randomized to avoid thundering // herds.
[ "func (b BackoffPolicy) Duration(n int) time.Duration {\n\tif n >= len(b.Millis) {\n\t\tn = len(b.Millis) - 1\n\t}\n\n\treturn time.Duration(jitter(b.Millis[n])) * time.Millisecond\n}" ]
[ "func (tab *Table) doRefresh(done chan struct{}) {\n\tdefer close(done)\n\n\t// Load nodes from the database and insert\n\t// them. This should yield a few previously seen nodes that are\n\t// (hopefully) still alive.\n\ttab.loadSeedNodes()\n\n\t// Run self lookup to discover new neighbor nodes.\n\ttab.net.lookupSe...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Networking:" }
@EXT\Route( "/team/{team}/user/{user}/unregister", name="claro_team_manager_unregister_user", options={"expose"=true} ) @EXT\ParamConverter("manager", options={"authenticatedUser" = true}) @return \Symfony\Component\HttpFoundation\Response
[ "public function managerUnregisterUserFromTeamAction(\n Team $team,\n User $user,\n User $manager\n )\n {\n $workspace = $team->getWorkspace();\n $isWorkspaceManager = $this->isWorkspaceManager($workspace, $manager);\n $isTeamManager = $this->isTeamManager($team, $man...
[ "public function createApplicationPassword(ApplicationPassword $application)\n {\n return $this->createCommand()\n ->setRequest($this->client->post('application'))\n ->setBodyEntity($application, 'json')\n ->setResponseClass('Maba\\OAuthCommerceInternalClient\\Entity\\Appl...
codesearchnet
{ "query": "Represent the Github comment about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about Programming:" }
// SetMaxJobTimeoutMinutes sets the MaxJobTimeoutMinutes field's value.
[ "func (s *AccountSettings) SetMaxJobTimeoutMinutes(v int64) *AccountSettings {\n\ts.MaxJobTimeoutMinutes = &v\n\treturn s\n}" ]
[ "def setupJobAfterFailure(self, config):\n \n self.remainingRetryCount = max(0, self.remainingRetryCount - 1)\n logger.warn(\"Due to failure we are reducing the remaining retry count of job %s with ID %s to %s\",\n self, self.jobStoreID, self.remainingRetryCount)\n # S...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Split data into a sequence of frames.
[ "def frameify(self, state, data):\n \"\"\"\"\"\"\n\n # Pull in any partially-processed data\n data = state.recv_buf + data\n\n # Loop over the data\n while data:\n if not state.frame_start:\n try:\n idx = data.index(self.prefix + self.b...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Moves a particular enum option to be either before or after another specified enum option in the custom field. @param customField Globally unique identifier for the custom field. @return Request object
[ "public ItemRequest<CustomField> insertEnumOption(String customField) {\n \n String path = String.format(\"/custom_fields/%s/enum_options/insert\", customField);\n return new ItemRequest<CustomField>(this, CustomField.class, path, \"POST\");\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
/* Thanks to Aaron Fisher http://www.aaron-fisher.com/articles/web/php/wtf/
[ "public static function wtf($var, $arrayOfObjectsToHide = array(), $fontSize = 12)\n {\n $text = print_r($var, true);\n $text = str_replace('<', '&lt;', $text);\n $text = str_replace('>', '&gt;', $text);\n\n if ($var instanceof \\ErrorException || $var instanceof \\Exception) {\n ...
[ "def cli(verbose):\n \n floyd.floyd_host = floyd.floyd_web_host = \"https://dev.floydhub.com\"\n floyd.tus_server_endpoint = \"https://upload-v2-dev.floydhub.com/api/v1/upload/\"\n configure_logger(verbose)\n check_cli_version()" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
returns true if managed to advance, false if advance failed due to null field
[ "private static boolean navigateContextToNextPortableTokenFromPortableField(PortableNavigatorContext ctx)\n throws IOException {\n BufferObjectDataInput in = ctx.getIn();\n\n // find the field position that's stored in the fieldDefinition int the context and navigate to it\n int pos ...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get a URL for the images resource @return Http\ImagesUrl
[ "public function getImagesUrl() {\n $url = sprintf($this->getBaseUrl() . '/users/%s/images.json', $this->getUser());\n\n return Http\\ImagesUrl::factory(\n $url,\n $this->getConfig('privateKey'),\n $this->getPublicKey()\n );\n }" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about File management:" }
Sets the prefWidth and prefHeight to the specified value.
[ "public Cell<C,T> prefSize (float width, float height) {\r\n\t\tprefWidth = new FixedValue<C, T>(layout.toolkit,width);\r\n\t\tprefHeight = new FixedValue<C, T>(layout.toolkit,height);\r\n\t\treturn this;\r\n\t}" ]
[ "public String getHeader()\n {\n if (this.header == null)\n {\n if (this.headerKeys == null)\n {\n this.headerKeys = new String[2];\n this.headerKeys[0] = getPropertyName() + \".header\";\n this.headerKeys[1] = getPropertyName();\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get all event parameters @return array|\ArrayAccess
[ "public function getParams()\n {\n $params = parent::getParams();\n $params['processor'] = $this->getProcessor();\n $params['message'] = $this->getMessage();\n $params['result'] = $this->getResult();\n return $params;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetSnapshotRetentionLimit sets the SnapshotRetentionLimit field's value.
[ "func (s *ModifyReplicationGroupInput) SetSnapshotRetentionLimit(v int64) *ModifyReplicationGroupInput {\n\ts.SnapshotRetentionLimit = &v\n\treturn s\n}" ]
[ "public final void start() {\n if (!enabled) {\n return;\n }\n\n long periodSeconds = properties.getSeconds(PERIOD_SECONDS);\n if (periodSeconds <= 0) {\n long defaultValue = Long.parseLong(PERIOD_SECONDS.getDefaultValue());\n logger.warning(\"Provided cl...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
:returns: the number of distances required for the given GSIMs
[ "def get_num_distances(gsims):\n \n dists = set()\n for gsim in gsims:\n dists.update(gsim.REQUIRES_DISTANCES)\n return len(dists)" ]
[ "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 comment about Computer programming or scientific field:", "pos": "Represent the code about Computer programming or scientific field:", "neg": "Represent the code about Natural Language Processing:" }
Extracts advertised AS path attributes in the given update message and reconstructs AS_PATH from AS_PATH and AS4_PATH if needed.
[ "def _extract_and_reconstruct_as_path(self, update_msg):\n \"\"\"\"\"\"\n umsg_pattrs = update_msg.pathattr_map\n\n as_aggregator = umsg_pattrs.get(BGP_ATTR_TYPE_AGGREGATOR, None)\n as4_aggregator = umsg_pattrs.get(BGP_ATTR_TYPE_AS4_AGGREGATOR, None)\n if as_aggregator and as4_agg...
[ "def sanitize(self):\n '''\n \n '''\n super(MapReferralMessage, self).sanitize()\n\n # WARNING: http://tools.ietf.org/html/draft-ietf-lisp-ddt-00\n # does not define this field so the description is taken from\n # http://tools.ietf.org/html/draft-ietf-lisp-24\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Indexes a bundle/dataset and all of its partitions :param bundle: A bundle or dataset object :param force: If true, index the document even if it already exists :return:
[ "def index_bundle(self, bundle, force=False):\n \n from ambry.orm.dataset import Dataset\n\n dataset = bundle if isinstance(bundle, Dataset) else bundle.dataset\n\n self.index_dataset(dataset, force)\n\n for partition in dataset.partitions:\n self.index_partition(partit...
[ "def replicate_filter(sources, model, cache=None):\n ''''''\n targets = [replicate_no_merge(source, model, cache=cache)\n for source in sources]\n # Some objects may not be available in target DB (not published), so we\n # have to exclude None from the list.\n return [target for target ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Download-extract `Resource` or url, returns Promise->path.
[ "def _download_extract(self, resource):\n \"\"\"\"\"\"\n if isinstance(resource, six.string_types):\n resource = resource_lib.Resource(url=resource)\n def callback(path):\n resource.path = path\n return self._extract(resource)\n return self._download(resource).then(callback)" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Module containing Raven functions @module Raven
[ "function Raven() {\n\n /**\n * Pull from the rs forums...this can easily break if they stop using the version 4 of the thread\n * http://services.runescape.com/m=forum/forums.ws?75,76,387,65763383\n * @returns {Promise} current viswax\n * @example\n * rsapi.rs.distraction.viswax.getCurrent()...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetAttributes sets the Attributes field's value.
[ "func (s *UpdateStackInput) SetAttributes(v map[string]*string) *UpdateStackInput {\n\ts.Attributes = 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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
@param {Registry} registry The registry object @param {Object} definition The schema definition @param {?number=} opt_depth (internal) Nesting limit inheritance @constructor
[ "function Schema(registry, definition, opt_depth) {\n this._allowUnknownProperties = false;\n this._registry = registry;\n\n this.id = undefined;\n this.type = TYPES.UNKNOWN;\n this.depth = opt_depth || registry.depth;\n\n // possible primitive values or array elements\n this.enum = undefined;\n this.ordere...
[ "function newLocalModel (call) {\n // get clone of call and reset original\n call = resetCall(call)\n // require immutable core\n assert.ok(GLOBAL.immutableCoreModel !== undefined, 'ImmutableAI configuration error: immutableCoreModel required')\n // get model - throws error if not found\n var mode...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Create an immutable object lazily. @param {Object} obj @returns {Object} the immutable object created
[ "function deepFreeze(obj) {\n // if it's already frozen, don't bother going deep into it...\n if (obj === null || typeof obj === 'undefined' || typeof obj.toJS === 'function' || typeof obj !== 'object') {\n return obj;\n }\n\n // Retrieve the property names defined on obj\n let propNames = Obj...
[ "function newLocalModel (call) {\n // get clone of call and reset original\n call = resetCall(call)\n // require immutable core\n assert.ok(GLOBAL.immutableCoreModel !== undefined, 'ImmutableAI configuration error: immutableCoreModel required')\n // get model - throws error if not found\n var mode...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Get the next content elements. @param FormFieldModel $current Current content model. @return FormFieldModel[]
[ "protected function getNextElements($current): array\n {\n $collection = FormFieldModel::findBy(\n [\n 'tl_form_field.pid=?',\n '(tl_form_field.type != ? AND tl_form_field.bs_grid_parent = ?)',\n 'tl_form_field.sorting > ?'\n ],\n ...
[ "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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Make the request to the Twilio API to perform the read. @param client TwilioRestClient with which to make the request @return Day ResourceSet
[ "@Override\n public ResourceSet<Day> read(final TwilioRestClient client) {\n return new ResourceSet<>(this, client, firstPage(client));\n }" ]
[ "@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Twilio:", "pos": "Represent the code about Twilio:", "neg": "Represent the code:" }
To be called from an Activity or Fragment's onCreate method. @param savedInstanceState the previously saved state
[ "public void onCreate(Bundle savedInstanceState) {\n Session session = Session.getActiveSession();\n if (session == null) {\n if (savedInstanceState != null) {\n session = Session.restoreSession(activity, null, callback, savedInstanceState);\n }\n if (se...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set a value. @param string $path The path of the value. @param mixed $value The value to set. @return JsonFile
[ "public function set($path, $value)\n {\n parent::set($path, $value);\n\n $this->save();\n\n return $this;\n }" ]
[ "public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Returns dict with 2 extracted filenames
[ "def _download_extract_archive(self, url):\n \n self.logger.info('Downloading zipfile from ipgeobase.ru...')\n temp_dir = tempfile.mkdtemp()\n archive = zipfile.ZipFile(self._download_url_to_string(url))\n self.logger.info('Extracting files...')\n file_cities = archive.extr...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Define the routes for the application. @param \Illuminate\Routing\Router $router @return void
[ "public function map(Router $router)\n {\n $router->group(['namespace' => $this->namespace], function (Router $router) {\n\n /*\n * Admin routes\n */\n $router->get('admin/groups', ['as' => 'admin.groups.index', 'uses' => 'AdminController@index']);\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }