query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Returns user-defined-attribute -1 if not found. @param path @param attribute @param options @return @throws IOException
[ "public static final int getIntAttribute(Path path, String attribute, LinkOption... options) throws IOException\r\n {\r\n return getIntAttribute(path, attribute, -1, options);\r\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code:" }
Return a python dict representation of this page for use as part of a JSON export.
[ "def dump_json_data(page):\n \n def content_langs_ordered():\n \"\"\"\n Return a list of languages ordered by the page content\n with the latest creation date in each. This will be used\n to maintain the state of the language_up_to_date template\n tag when a page is restore...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Initialize a new gettext class @param string $directory @param string $domain @param string $locale @return TranslatorInterface|null
[ "public function translator(string $locale, string $domain, string $directory): ?TranslatorInterface\n {\n $class = GETTEXT_EXTENSION ? GettextTranslator::class : Translator::class;\n\n $previous = self::$translator;\n self::$translator = new $class($locale, $domain, $directory);\n\n ...
[ "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Write writes the profile as a gzip-compressed marshaled protobuf.
[ "func (p *Profile) Write(w io.Writer) error {\n\tzw := gzip.NewWriter(w)\n\tdefer zw.Close()\n\t_, err := zw.Write(serialize(p))\n\treturn err\n}" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return True if filter matches item.
[ "def match(self, item):\n \n val = getattr(item, self._name)\n if val is not None:\n for fileinfo in val:\n if fnmatch.fnmatchcase(fileinfo.path.lower(), self._value):\n return True\n return False" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* Parse each templates to replace stub instruction with valueGenerator functions Arg: - templates (Array) Return: templates (Array) stub instruction is replaced with function
[ "function prepareTemplates(templates){\n var valueGeneratorsDict = {\n select: function(obj){\n var types = {\n random:function(){\n return obj.choice[Math.floor(Math.random() * obj.choice.length)];\n },\n liner: function(){\n var el = obj.choice.shift();\n o...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
returns a Promise
[ "function installPluginsFromConfigXML(args) {\n events.emit('verbose', 'Checking config.xml for saved plugins that haven\\'t been added to the project');\n\n //Install plugins that are listed on config.xml\n var projectRoot = cordova_util.cdProjectRoot();\n var configPath = cordova_util.projectConfig(pr...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Updates an existing category with given params @param int $updateid @param int $newparent @param string $newname @param string $newinfo @param int $newinfoformat @param int $idnumber @param bool $redirect @return int
[ "public function update_category($updateid, $newparent, $newname, $newinfo, $newinfoformat = FORMAT_HTML,\n $idnumber = null, $redirect = true) {\n global $CFG, $DB;\n if (empty($newname)) {\n print_error('categorynamecantbeblank', 'question');\n }\n\n // Get the re...
[ "private function adminUpdateImage()\n {\n /* @var Gallery_Entity_Table_Image $table */\n $table = ORM::getTable($this, 'Image');\n /* @var Gallery_Entity_Image $image */\n $image = $table->find(arg('update', 'int'));\n\n $new_section = arg('section', 'int');\n if ($new_...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Removes a temporary copy of the MAGICC version shipped with Pymagicc.
[ "def remove_temp_copy(self):\n \n if self.is_temp and self.root_dir is not None:\n shutil.rmtree(self.root_dir)\n self.root_dir = None" ]
[ "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:" }
Update custom values between delimiter with real values @param $file
[ "protected function userDefinedVars($file)\n {\n $start = $this->delimiter[0];\n $end = $this->delimiter[1];\n\n if ($this->customData !== null) {\n $customVars = explode(';', $this->customData);\n foreach ($customVars as $rawVar) {\n $arrayVar = explode(...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
(Re)set the parent of this Namespace context. This is separate from the c'tor because it's re-applied when a Context2 is reused by push-after-pop. @param context The parent Namespace context object.
[ "void setParent (Context2 parent)\n {\n this.parent = parent;\n parent.child = this; // JJK: Doubly-linked\n declarations = null;\n prefixTable = parent.prefixTable;\n uriTable = parent.uriTable;\n elementNameTable = parent.elementNameTable;\n attributeName...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Constructs an ACL INI section key from a given Request. @param array $params The request params @return string Hash with named keys for controller, plugin and prefix
[ "protected function _constructIniKey($params) {\n\t\t$res = $params['controller'];\n\t\tif (!empty($params['prefix'])) {\n\t\t\t$res = $params['prefix'] . \"/$res\";\n\t\t}\n\t\tif (!empty($params['plugin'])) {\n\t\t\t$res = $params['plugin'] . \".$res\";\n\t\t}\n\t\treturn $res;\n\t}" ]
[ "def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Return an analysis list without duplicated or nested analyses
[ "function _generateUniqueAnalysisList (analysisList) {\n var analysisIds = {};\n return _.reduce(analysisList, function (list, analysis) {\n if (!analysisIds[analysis.get('id')] && !_isAnalysisPartOfOtherAnalyses(analysis, analysisList)) {\n analysisIds[analysis.get('id')] = true; // keep a set of already...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns an array of articles belonging to the Items in the basket @return array of oxArticle
[ "public function getArticles()\n {\n $aRes = [];\n $aItems = $this->getItems();\n if (is_array($aItems)) {\n foreach ($aItems as $sId => $oItem) {\n $oArticle = $oItem->getArticle($sId);\n $aRes[$this->_getItemKey($oArticle->getId(), $oItem->getSelLis...
[ "protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
display this screen in html input format. @return The HTML options. @exception DBException File exception.
[ "public int getPrintOptions()\n throws DBException\n {\n int iHtmlOptions = HtmlConstants.HTML_DISPLAY;\n if (((BaseGridScreen)this.getScreenField()).getEditing())\n iHtmlOptions |= HtmlConstants.HTML_INPUT;\n String strParamForm = this.getProperty(HtmlConstants.FORMS); ...
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetDbiResourceId sets the DbiResourceId field's value.
[ "func (s *DeleteDBInstanceAutomatedBackupInput) SetDbiResourceId(v string) *DeleteDBInstanceAutomatedBackupInput {\n\ts.DbiResourceId = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Converts the parambag instance of the native extension format @param \Danzabar\Config\Data\ParamBag $paramBag @return Mixed @author Dan Cox
[ "public function toNative(ParamBag $paramBag)\n\t{\n\t\t// We can assume the extension exists, since it has already been used\n\t\t$ext = $this->extensionMap->get($this->extension);\n\t\t$native = $ext->load($paramBag->all())->toNative();\n\n\t\treturn $native;\n\t}" ]
[ "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:" }
// compact writes multiple smaller TSM files into 1 or more larger files.
[ "func (c *Compactor) compact(fast bool, tsmFiles []string) ([]string, error) {\n\tsize := c.Size\n\tif size <= 0 {\n\t\tsize = MaxPointsPerBlock\n\t}\n\n\tc.mu.RLock()\n\tintC := c.compactionsInterrupt\n\tc.mu.RUnlock()\n\n\t// The new compacted files need to added to the max generation in the\n\t// set. We need t...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the channel type. @return string Either 'text' or 'voice'.
[ "public function getChannelType()\n {\n switch ($this->type) {\n case self::TYPE_TEXT:\n case self::TYPE_VOICE:\n return $this->type;\n break;\n default:\n return self::TYPE_TEXT;\n break;\n }\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Format this error into a JSON response. Args: error_list_tag: A string specifying the name of the tag to use for the error list. Returns: A dict containing the reformatted JSON error response.
[ "def __format_error(self, error_list_tag):\n \n error = {'domain': self.domain(),\n 'reason': self.reason(),\n 'message': self.message()}\n error.update(self.extra_fields() or {})\n return {'error': {error_list_tag: [error],\n 'code': self.status_code(),\n ...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Runs a method on an object and returns the result @param obj the object to run the method on @param methodName the name of the method @return the results of the method run
[ "private static Object _runMethod(Object obj, String methodName)\n {\n try\n {\n Method sessionIdMethod = obj.getClass().getMethod(methodName);\n return sessionIdMethod.invoke(obj);\n }\n catch (Exception e)\n {\n return null;\n }\n\n ...
[ "function buildMockAttribute (val) {\n // if value is not a function then this is a property not a method\n // if value is a regular function then it is a custom method\n if (typeof val !== 'function' || val.toString().match(/^\\s*function/)) {\n return val\n }\n // if value is an arrow functi...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Called when the server receive a Http request. @param \Lawoole\Server\Server $server @param \Lawoole\Server\ServerSockets\ServerSocket $serverSocket @param \Swoole\Http\Request $request @param \Swoole\Http\Response $response
[ "public function onRequest($server, $serverSocket, $request, $response)\n {\n try {\n $serializer = $this->getSerializer($serverSocket);\n\n $message = $serializer->deserialize($request->rawcontent());\n\n $result = $this->dispatcher->handleMessage($message);\n\n ...
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Called when the RabbitMQ accepts the channel open request. :param pika.channel.Channel channel: The channel opened with RabbitMQ
[ "def on_rabbitmq_channel_open(self, channel):\n \n LOGGER.info('Channel %i is opened for communication with RabbitMQ',\n channel.channel_number)\n self._set_rabbitmq_channel(channel)\n self._publish_deferred_messages()" ]
[ "def close(self):\n \n # If we aren't already closed ask for server to close\n if not self.is_closed():\n self._closing = True\n # Let the ChannelActor do the actual close operations.\n # It will do the work on CloseOK\n self.sender.send_Close(\n ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Networking:" }
Get the dimensions (width and height) of an image as an array. @return array
[ "public function getDimensions(): array\n {\n if ($this->dimensions === null) {\n $this->dimensions = getimagesize($this->file->getPathname());\n }\n\n return $this->dimensions;\n }" ]
[ "function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Remove an existing recurring application charge @link https://help.shopify.com/api/reference/recurringapplicationcharge#destroy @param RecurringApplicationCharge $recurringApplicationCharge @return void
[ "public function delete(RecurringApplicationCharge $recurringApplicationCharge)\n {\n $endpoint= '/admin/recurring_application_charges/'.$recurringApplicationCharge->id.'.json';\n $response = $this->request($endpoint, 'DELETE');\n }" ]
[ "public function create(RecurringApplicationCharge &$recurringApplicationCharge)\n {\n $data = $recurringApplicationCharge->exportData();\n $endpoint = '/admin/recurring_application_charges.json';\n $response = $this->request(\n $endpoint, 'POST', array(\n 'recurring_ap...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// decapitalise makes a camel-case string which starts with a lower case character.
[ "func decapitalise(input string) string {\n\tif len(input) == 0 {\n\t\treturn input\n\t}\n\n\tgoForm := abi.ToCamelCase(input)\n\treturn strings.ToLower(goForm[:1]) + goForm[1:]\n}" ]
[ "function(modelName) {\n\n modelName = _.camelCase(modelName); // Model variable name are always in one word with no seprator\n modelName = pluralize.singular(modelName); // Model variable name are always singular\n modelName = _.upperFirst(modelName); // Model variable name always have their first letter ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Concatenate multiple serialized binders into one byte string.
[ "def merge_bytes(binder_strings):\n \"\"\"\"\"\"\n output = None\n for byte_string in binder_strings:\n binder = Binder().from_bytes(byte_string)\n if output is None:\n output = binder\n else:\n output.merge(binder)\n return output.to_bytes()" ]
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Performs a primitive conversion of <code>java.util.Date</code> to <code>java.sql.Timestamp</code> based on the time value. @param name name of field. @param date date value. @deprecated use {@link #setTimestamp(String, Object)} instead.
[ "@Deprecated\n public void setTS(String name, java.util.Date date) {\n if(date == null) {\n set(name, null);\n } else {\n set(name, new java.sql.Timestamp(date.getTime()));\n }\n }" ]
[ "@Override\n public Query setParameter(Parameter<Calendar> paramParameter, Calendar paramCalendar, TemporalType paramTemporalType)\n {\n throw new UnsupportedOperationException(\"setParameter is unsupported by Kundera\");\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Obtains a lock on the H2 database. @throws H2DBLockException thrown if a lock could not be obtained
[ "public void lock() throws H2DBLockException {\n try {\n final File dir = settings.getDataDirectory();\n lockFile = new File(dir, \"odc.update.lock\");\n checkState();\n int ctr = 0;\n do {\n try {\n if (!lockFile.exists...
[ "@Override\n public void checkin(K key, V resource) {\n super.checkin(key, resource);\n // NB: Blocking checkout calls for synchronous requests get the resource\n // checked in above before processQueueLoop() attempts checkout below.\n // There is therefore a risk that asynchronous re...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// ResetPackets blocks until the head of packets buffer is reset, causing the // packets to be redelivered in order.
[ "func (m *memoryMailBox) ResetPackets() error {\n\tpktDone := make(chan struct{})\n\tselect {\n\tcase m.pktReset <- pktDone:\n\t\treturn m.signalUntilReset(pktCourier, pktDone)\n\tcase <-m.quit:\n\t\treturn ErrMailBoxShuttingDown\n\t}\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the comment about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code about File management:" }
Validate the Service Instance address. It must be the ip address of the node. @param address the address. @return OK if match the ip pattern.
[ "public static ErrorCode isAddressValid(String address){\n if (!isMustFieldValid( address, ipRegEx)) {\n return ErrorCode.SERVICE_INSTANCE_ADDRESS_FORMAT_ERROR;\n }\n return ErrorCode.OK;\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 Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
>>> make_cmd_invocation('path/program', ['arg1', 'arg2'], {'darg': 4}) ['./giotto-cmd', '/path/program/arg1/arg2/', '--darg=4']
[ "def make_cmd_invocation(invocation, args, kwargs):\n \n if not invocation.endswith('/'):\n invocation += '/'\n if not invocation.startswith('/'):\n invocation = '/' + invocation\n\n cmd = invocation\n\n for arg in args:\n cmd += str(arg) + \"/\"\n\n rendered_kwargs = []\n ...
[ "def usage(asked_for=0):\n ''''''\n exit = fsq.const('FSQ_SUCCESS') if asked_for else\\\n fsq.const('FSQ_FAIL_PERM')\n f = sys.stdout if asked_for else sys.stderr\n shout('{0} [opts] src_queue trg_queue host item_id [item_id [...]]'.format(\n os.path.basename(_PROG)), f)\n if...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Reports an unexpected use of a bitwise operator. @param {ASTNode} node Node which contains the bitwise operator. @returns {void}
[ "function report(node) {\n context.report({ node, messageId: \"unexpected\", data: { operator: node.operator } });\n }" ]
[ "func (s *numericCompilerVisitor) AcceptNegation(v tree.Negation) {\n\ts.err = errors.New(\"a boolean negation was found in a numeric expression - this is likely a programmer error\")\n}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Convert_storage_VolumeAttachmentStatus_To_v1_VolumeAttachmentStatus is an autogenerated conversion function.
[ "func Convert_storage_VolumeAttachmentStatus_To_v1_VolumeAttachmentStatus(in *storage.VolumeAttachmentStatus, out *v1.VolumeAttachmentStatus, s conversion.Scope) error {\n\treturn autoConvert_storage_VolumeAttachmentStatus_To_v1_VolumeAttachmentStatus(in, out, s)\n}" ]
[ "func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// LSet updates an element in the list by its index.
[ "func (t *TxStructure) LSet(key []byte, index int64, value []byte) error {\n\tif t.readWriter == nil {\n\t\treturn errWriteOnSnapshot\n\t}\n\tmetaKey := t.encodeListMetaKey(key)\n\tmeta, err := t.loadListMeta(metaKey)\n\tif err != nil || meta.IsEmpty() {\n\t\treturn errors.Trace(err)\n\t}\n\n\tindex = adjustIndex(i...
[ "@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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Remove tracks specified by `track_indices`. Parameters ---------- track_indices : list The indices of the tracks to be removed.
[ "def remove_tracks(self, track_indices):\n \n if isinstance(track_indices, int):\n track_indices = [track_indices]\n self.tracks = [track for idx, track in enumerate(self.tracks)\n if idx not in track_indices]" ]
[ "def _get_recording(self, index):\n \"\"\"\"\"\"\n assert index >= 0\n recs = np.nonzero((index - self.offsets[:-1]) >= 0)[0]\n if len(recs) == 0: # pragma: no cover\n # If the index is greater than the total size,\n # return the last recording.\n return...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets all interpolation tokens that are contained to the given range. @param {number} start - The start of range. @param {number} end - The end of range. @returns {Token[]} Array of objects representing tokens.
[ "function getTemplateTags(start, end) {\n const results = []\n for (const token of microTemplateService.getMicroTemplateTokens()) {\n if (token.range[1] <= start) {\n continue\n }\n if (end <= token.range[0]) {\n ...
[ "function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {nu...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Return specific search setting from Django conf.
[ "def get_setting(key, *default):\n \"\"\"\"\"\"\n if default:\n return get_settings().get(key, default[0])\n else:\n return get_settings()[key]" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n public Object eGet(int featureID, boolean resolve, boolean coreType)\n {\n switch (featureID)\n {\n case SimpleExpressionsPackage.METHOD_CALL__VALUE:\n return getValue();\n }\n return super.eGet(featureID, resolve, coreType);\n }" ]
[ "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 instruction about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Function that returns a Python callback to pretty print the events.
[ "def print_event(attributes=[]):\n \n def python_callback(event):\n cls_name = event.__class__.__name__\n attrs = ', '.join(['{attr}={val}'.format(attr=attr, val=event.__dict__[attr])\n for attr in attributes])\n print('{cls_name}({attrs})'.format(cls_name=cls_name, ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Performs a request @param url the URL to query @param additionalHeaders additional HTTP request headers (may be null) @return the response @throws IOException if the request was not successful
[ "protected Response performRequest(String url,\n\t\t\tMap<String, String> additionalHeaders) throws IOException {\n\t\tif (accessToken == null) {\n\t\t\tthrow new UnauthorizedException(\"Access token has not yet been requested\");\n\t\t}\n\t\tURL u = new URL(url);\n\t\treturn auth.request(u, Method.GET, accessToken...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the description about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about programming:" }
Служит для отображения одного случайного баннера из указанного баннерного места Пример использования:: {% one_banner 'place_slug' %} :param slug: символьный код баннерного места :return:
[ "def one_banner(slug):\n \n place = BannerPlace.objects.published().get(slug=slug)\n banner = place.banner_set.published().order_by('?').first()\n renderer = get_renderer(banner)\n return renderer(banner)" ]
[ "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:" }
// NewRow takes a width percentage and either a widget or a Row or Column
[ "func NewRow(ratio float64, i ...interface{}) GridItem {\n\t_, ok := i[0].(Drawable)\n\tentry := i[0]\n\tif !ok {\n\t\tentry = i\n\t}\n\treturn GridItem{\n\t\tType: row,\n\t\tEntry: entry,\n\t\tIsLeaf: ok,\n\t\tratio: ratio,\n\t}\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
TODO: Move this to some global class
[ "function constrain(value, max, size) {\n if (value < 0) {\n return 0;\n }\n\n if (value + size > max) {\n value = max - size;\n return value < 0 ? 0 : value;\n }\n\n return value;\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// DelPort remove specified port from port list.
[ "func (c *LinkManagerContext) DelPort(p LinkPort) {\n\tfor i, port := range c.Ports {\n\t\tif port.Port == p.Port {\n\t\t\tc.Ports = append(c.Ports[:i], c.Ports[i+1:]...)\n\t\t\treturn\n\t\t}\n\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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets the name of the field representing the foreign key to the source table. @return string
[ "public function getForeignKey()\n {\n if ($this->_foreignKey === null) {\n $this->_foreignKey = $this->_modelKey($this->getSource()->getTable());\n }\n\n return $this->_foreignKey;\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Allow user defined fields to sort on in addition to introspected fields
[ "def search_on(column_source, methods)\n Array(methods).each do |method_name|\n join column_source\n self.searches += [{column_source: column_source.to_s, method_name: method_name.to_s}]\n end\n end" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Init implements cmd.Command.Init.
[ "func (c *budgetCommand) Init(args []string) error {\n\tif len(args) < 1 {\n\t\treturn errors.New(\"value required\")\n\t}\n\n\twallet, limit, err := budgetDefinition(args[0])\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tif _, err := strconv.ParseInt(limit, 10, 32); err != nil {\n\t\treturn errors.New(\...
[ "func InitDispatcher(d *tq.Dispatcher) {\n\td.RegisterTask(&internal.EmailTask{}, SendEmail, \"email\", nil)\n}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Tell report module to print the report detail. <p>Note: This does not maintain an independent variable, I fake that the screen fields have been modified, because this signals the report module to print. @param bPrintReport If true, set print report.
[ "public void setPrintReport(boolean bPrintReport)\n {\n if (bPrintReport)\n if (this.getScreenRecord() != null) // This tells the RecordHtmlScreen to display the data\n this.getScreenRecord().getField(Constants.MAIN_FIELD).setModified(true); // Flag screen record, so toolbar k...
[ "def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added...
codesearchnet
{ "query": "Represent the post about Technical writing:", "pos": "Represent the code about Technical writing:", "neg": "Represent the code:" }
rDual(x,v) := gradF(X)+[A]T*V (p 532)
[ "private DoubleMatrix1D rDual(DoubleMatrix1D X, DoubleMatrix1D V, DoubleMatrix1D gradX) {\r\n\t\tif(getA()==null){\r\n\t\t\treturn gradX;\r\n\t\t}\r\n\t\t//return getAT().zMult(V, gradX.copy(), 1., 1, false);\r\n\t\treturn ColtUtils.zMult(getAT(), V, gradX, 1);\r\n\t}" ]
[ "def ystep(self):\n \n \"\"\"\n\n self.Y = sp.prox_l1(self.AX - self.S + self.U, self.Wdf / self.rho)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
*******************BEGINNING OF FUNCTION********************//
[ "public static boolean is_kavarganta(String str)\n {\n\n // System.out.print(\"Entered is_kavarganta, returning: \");\n String s1 = VarnaUtil.getAntyaVarna(str);\n // System.out.print(\"s1 == \" + s1);\n if (is_kavarga(s1))\n {\n // Log.logInfo(\"true\");\n ...
[ "protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about PHP programming:" }
compile TALES expression according to current talesMode @return string with PHP code or array with expressions for TalesChainExecutor
[ "public function evaluateExpression($expression)\n {\n if ($this->getTalesMode() === 'php') {\n return PHPTAL_Php_TalesInternal::php($expression);\n }\n return PHPTAL_Php_TalesInternal::compileToPHPExpressions($expression, false);\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:" }
@param QueryInterface $query @return Result|null @throws Exception
[ "public function process(QueryInterface $query)\n {\n if (!$query instanceof ShowQuery || $query->getObject() !== ShowQuery::EXPRESSION_CREATE_TABLE) {\n return null;\n }\n\n $table = $query->getCreateObjectExpression(ShowQuery::EXPRESSION_CREATE_TABLE);\n\n if (!$table) {\...
[ "public function objectFromIndex(IObjectSetWithIdentityByIndex $objects) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder(\n $this->type(new ObjectIdType(new ObjectIndexOptions($objects), $loadAsObjects = true))\n );\n }" ]
codesearchnet
{ "query": "Represent the Github post about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Software development:" }
@param mixed $selected @return array
[ "public function parseValue($selected)\n {\n if (is_string($selected) && strpos($selected, ':::') !== false) {\n return explode(':::', $selected);\n }\n\n return $selected;\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 text about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
// CurrentBlockHeight returns the block height from POV of the router subsystem. // // NOTE: This method is part of the ChannelGraphSource interface.
[ "func (r *ChannelRouter) CurrentBlockHeight() (uint32, error) {\n\t_, height, err := r.cfg.Chain.GetBestBlock()\n\treturn uint32(height), err\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Fallback filters for non-power-of-2 textures
[ "def filter_fallback(filter)\n \t\tif filter == NearestFilter || filter == NearestMipMapNearestFilter || f == NearestMipMapLinearFilter\n \t\t\tGL_NEAREST\n \t\tend\n\n GL_LINEAR\n \tend" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// hasIdenticalPerVersionColumns returns true if a CRD sets identical non-nil values // to all per-version columns
[ "func hasIdenticalPerVersionColumns(versions []apiextensions.CustomResourceDefinitionVersion) bool {\n\tif len(versions) == 0 {\n\t\treturn false\n\t}\n\tvalue := versions[0].AdditionalPrinterColumns\n\tfor _, v := range versions {\n\t\tif len(v.AdditionalPrinterColumns) == 0 || !apiequality.Semantic.DeepEqual(v.Ad...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Return a new Options object that is filtered by the specified list of keys. Mutating self.kwargs to filter is unsafe due to the option expansion that occurs on initialization.
[ "def filtered(self, allowed):\n \n kws = {k:v for k,v in self.kwargs.items() if k in allowed}\n return self.__class__(key=self.key,\n allowed_keywords=self.allowed_keywords,\n merge_keywords=self.merge_keywords, **kws)" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Builds an IQ stanza containing a specific command with given body, ready to send to the hub. @param command @param body @returns {Stanza}
[ "function buildCommandIqStanza (command, body) {\n debug('buildCommandIqStanza for command \"' + command + '\" with body ' + body)\n\n return xmppUtil.buildIqStanza(\n 'get'\n , 'connect.logitech.com'\n , 'vnd.logitech.harmony/vnd.logitech.harmony.engine?' + command\n , body\n )\n}" ]
[ "public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Add rows. @param array $data The row data. @return FakeResult
[ "public function addRows($data)\n {\n foreach ($data as $key => $row) {\n $this->addRow($row, isset($row['id']) ? $row['id'] : $key);\n }\n\n return $this;\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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Gets the min start position. @param docId the doc id @param position the position @return the min start position @throws IOException Signals that an I/O exception has occurred.
[ "public int getMinStartPosition(int docId, int position) throws IOException {\n if (ignoreSpans != null && docId == currentDocId) {\n if (position < minimumPosition) {\n throw new IOException(\n \"Unexpected position, should be >= \" + minimumPosition + \"!\");\n } else {\n com...
[ "@Override\n public int getHeaderLength() {\n try {\n final byte b = this.headers.getByte(0);\n // length is encoded as the number of 32-bit words, so to get number of bytes we must multiply by 4\n return (b & 0x0F) * 4;\n } catch (final IOException e) {\n ...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
This method initializes filterReplaceDialog @return org.parosproxy.paros.extension.filter.FilterReplaceDialog
[ "private FilterChangeUserAgentDialog getFilterChangeUserAgentDialog() {\r\n\t\tif (filterChangeUserAgentDialog == null) {\r\n\t\t filterChangeUserAgentDialog = new FilterChangeUserAgentDialog(getView().getMainFrame(), true);\r\n\t\t}\r\n\t\treturn filterChangeUserAgentDialog ;\r\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// RemoveBackup is part of the BackupStorage interface
[ "func (fbs *FileBackupStorage) RemoveBackup(ctx context.Context, dir, name string) error {\n\tp := path.Join(*FileBackupStorageRoot, dir, name)\n\treturn os.RemoveAll(p)\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "func (in *APIServiceList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}" ]
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Iteration function. Note that it is possible to yield dangling ack packets as well, so user can detect if the sniffer missed the previous packet.
[ "def next(self):\n \n\n try:\n self._fetch()\n pkt = self.pkt_queue.popleft()\n try:\n self._infer_acked(pkt)\n except:\n pass\n try:\n self._infer_retry(pkt)\n except:\n pass\...
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Match and render the sucessfull value. Checks the given list if it has the given value in its list items. @param string $value List item value @param string $list Name of the list @return void
[ "public function renderValue(string $value, string $list) : void\n {\n /**\n * @var \\CsvMigrations\\Model\\Table\\DblistsTable\n */\n $table = $this->loadModel('CsvMigrations.Dblists');\n $this->_createList($list);\n\n $query = $table->find()\n ->enableHydr...
[ "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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Return the tile image GID for this location :param x: x coordinate :param y: y coordinate :param layer: layer number :rtype: surface if found, otherwise ValueError
[ "def get_tile_gid(self, x, y, layer):\n \n try:\n assert (x >= 0 and y >= 0 and layer >= 0)\n except AssertionError:\n raise ValueError\n\n try:\n return self.layers[int(layer)].data[int(y)][int(x)]\n except (IndexError, ValueError):\n m...
[ "def _find_associated_colorbar(obj):\n \n for child in obj.get_children():\n try:\n cbar = child.colorbar\n except AttributeError:\n continue\n if cbar is not None: # really necessary?\n # if fetch was successful, cbar contains\n # (reference t...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// List returns all available config repos, these are config repositories that // are present in the in `cruise-config.xml`
[ "func (crs *ConfigRepoService) List(ctx context.Context) (repos []*ConfigRepo, resp *APIResponse, err error) {\n\tr := &ConfigReposListResponse{}\n\t_, resp, err = crs.client.getAction(ctx, &APIClientRequest{\n\t\tPath: \"admin/config_repos\",\n\t\tResponseBody: r,\n\t\tAPIVersion: apiV1,\n\t})\n\n\tfor _...
[ "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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Setter for content-id @param int $id @return \Grid\Menu\Model\Menu\Structure\Content
[ "public function setContentId( $id )\n {\n $this->contentId = empty( $id ) ? null : (int) $id;\n $this->_uriCache = null;\n $this->_visible = null;\n return $this;\n }" ]
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
This is a delegate function of all top-level parsing functions. It does nothing but call a proper function to parse the given model.
[ "def _parse_model(topology, scope, model, inputs=None, outputs=None):\n '''\n \n '''\n\n if inputs is None:\n inputs = list()\n if outputs is None:\n outputs = list()\n\n model_type = model.WhichOneof('Type')\n if model_type in ['pipeline', 'pipelineClassifier', 'pipelineRegressor...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Put the heavy alignment ranges calculation called on demand and then cached
[ "def alignment_ranges(self):\n \"\"\"\"\"\"\n if not self.is_aligned(): raise ValueError(\"you can't get alignment ranges from something that didn't align\")\n if self._alignment_ranges: return self._alignment_ranges\n self._alignment_ranges = self._get_alignment_ranges()\n return self._alignmen...
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Remove a link between two processes
[ "def unlink_intermediate(self, sourceId, targetId):\n \n \n source = self.database['items'][(self.database.get('name'), sourceId)]\n target = self.database['items'][(self.database.get('name'), targetId)]\n\n production_exchange = [x['input'] for x in source['exchanges'] if x['type...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Read an NwInput from a string. Currently tested to work with files generated from this class itself. Args: string_input: string_input to parse. Returns: NwInput object
[ "def from_string(cls, string_input):\n \n directives = []\n tasks = []\n charge = None\n spin_multiplicity = None\n title = None\n basis_set = None\n basis_set_option = None\n theory_directives = {}\n geom_options = None\n symmetry_options...
[ "def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Serialize the instance. @param mixed $instance @param string $name @return array
[ "protected function serializeWith($instance, string $name)\n {\n $serializer = $this->getVersionedResourceClassName('Serializers', $name);\n\n if (\\class_exists($serializer)) {\n return \\call_user_func(app($serializer), $instance);\n }\n\n if ($instance instanceof Fluent)...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
The Field has Changed. @param bDisplayOption If true, display the change. @param iMoveMode The type of move being done (init/read/screen). @return The error code (or NORMAL_RETURN if okay).
[ "public int fieldChanged(boolean bDisplayOption, int iMoveMode)\n {\n int result = DBConstants.NORMAL_RETURN;\n Record record = m_fldTarget.getRecord();\n boolean bSetDirty = true;\n if (m_bIfNewRecord) if (record.getEditMode() == Constants.EDIT_ADD)\n bSetDirty = true;\n ...
[ "public void setToLimit(int iAreaDesc) // Set this field to the largest or smallest value\n {\n // Override this!!\n String filler = Constants.BLANK;\n if (iAreaDesc == DBConstants.END_SELECT_KEY)\n { // \\376 is consistently the largest in the character set\n filler = ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Record metrics on a Redisson cache. @param registry - registry to bind metrics to @param cache - cache to instrument @param tags - tags to apply to all recorded metrics @return cache
[ "public static RedissonCache monitor(MeterRegistry registry, RedissonCache cache, Iterable<Tag> tags) {\n new RedissonCacheMetrics(cache, tags).bindTo(registry);\n return cache;\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// QueueRPC will add an rpc call to the queue for processing by the writer goroutine
[ "func (c *client) QueueRPC(rpc hrpc.Call) {\n\tif b, ok := rpc.(hrpc.Batchable); ok && c.rpcQueueSize > 1 && !b.SkipBatch() {\n\t\t// queue up the rpc\n\t\tselect {\n\t\tcase <-rpc.Context().Done():\n\t\t\t// rpc timed out before being processed\n\t\tcase <-c.done:\n\t\t\treturnResult(rpc, nil, ErrClientClosed)\n\t...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Call a function on every item in a list and return the resulting list. @param callable $function @param array|Traversable $traversable @return array
[ "public static function map(callable $function, $traversable)\n {\n $aggregation = [];\n\n foreach ($traversable as $key => $value) {\n $aggregation[$key] = $function($value, $key);\n }\n\n return $aggregation;\n }" ]
[ "public function concat()\n {\n $args = func_get_args();\n array_unshift($args, $this->sfa);\n\n // Concat this iterator, and variadic args\n $class = new ReflectionClass('Qaribou\\Iterator\\ConcatIterator');\n $concatIt = $class->newInstanceArgs($args);\n\n // Create as...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set value using type conversions @param value @see org.vesalainen.util.ConvertUtility#convert(java.lang.Class, java.lang.Object)
[ "@Override\r\n public void set(Object value)\r\n {\r\n try\r\n {\r\n Object v = ConvertUtility.convert(type, value);\r\n if (field != null)\r\n {\r\n field.set(getBase(), v);\r\n }\r\n else\r\n {\r\n ...
[ "public static <T> Level0ArrayOperator<java.sql.Date[],java.sql.Date> onArrayFor(final java.sql.Date... elements) {\r\n return onArrayOf(Types.forClass(java.sql.Date.class), VarArgsUtil.asRequiredObjectArray(elements));\r\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// Section 12.2.5.4.16.
[ "func inSelectIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\t// Stop parsing.\n\t\treturn true\n\tcase TextToken:\n\t\tp.addText(strings.Replace(p.tok.Data, \"\\x00\", \"\", -1))\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Option:...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetPageToken sets the PageToken field's value.
[ "func (s *ListProvisionedProductPlansInput) SetPageToken(v string) *ListProvisionedProductPlansInput {\n\ts.PageToken = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Add a time off history entry @param string $employeeId @param string $requestId @param string $date @param string $note @return \BambooHR\Api\Response
[ "public function addHistoryEntry($employeeId, $requestId, string $date, string $note)\n {\n $xml = \"\n <history>\n <date>{$date}</date>\n <eventType>used</eventType>\n <timeOffRequestId>{$requestId}</timeOffRequestId>\n <note>{$note}<...
[ "public function getTasks($limit = 100, $offset = 0)\n {\n /** @var TaskFbApi $response */\n $response = $this->call(new Request('task.get', array(), $limit, $offset), 'DVelopment\\FastBill\\Model\\TaskFbApi');\n\n return $response->getResponse()->getTasks();\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Removes unnecessary parens throughout the steps. TODO: Ideally this would happen in NodeStatus instead.
[ "function removeUnnecessaryParensInStep(nodeStatus) {\n if (nodeStatus.substeps.length > 0) {\n nodeStatus.substeps.map(removeUnnecessaryParensInStep);\n }\n\n nodeStatus.oldNode = removeUnnecessaryParens(nodeStatus.oldNode, true);\n nodeStatus.newNode = removeUnnecessaryParens(nodeStatus.newNode, true);\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
render a tag @param string tag to render @param array attributes for the tag @param string contents of tag when not self closing @param bool close the tag? @return string
[ "public function tag($tag, $attr = null, $content = null, $close = false)\n {\n $tag = strtolower($tag);\n\n if (! empty($attr) && is_array($attr)) {\n $attr = $this->Attr->attr($attr);\n }\n\n if ($close) {\n return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $conte...
[ "def javascript(value = nil, attributes = {})\n if value.is_a?(Hash)\n attributes = value\n value = nil\n elsif block_given? && value\n raise ArgumentError, \"You can't pass both a block and a value to javascript -- please choose one.\"\n end\n\n script(attributes.merge...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Ex.: <pre> MATCH (n:hibernate_sequences:TABLE_BASED_SEQUENCE) WHERE n.sequence_name = {sequenceName} RETURN n </pre>
[ "private String getTableQuery(IdSourceKey idSourceKey) {\n\t\tString query = queryCache.get( idSourceKey.getTable() );\n\t\tif ( query == null ) {\n\t\t\tquery = \"MATCH (n\" + labels( idSourceKey.getTable(), NodeLabel.TABLE_BASED_SEQUENCE.name() ) + \") WHERE n.\" + idSourceKey.getMetadata().getKeyColumnName() + \...
[ "protected function assembleQuery($initial, $recursive)\n {\n $tmp_tbl = 'name_tree';\n $recursive = str_replace(':tmp_tbl', $tmp_tbl, $recursive);\n\n $final = \"select distinct * from $tmp_tbl\";\n\n if (DB::connection()->getDriverName() == 'mysql') {\n return \"Call WITH...
codesearchnet
{ "query": "Represent the sentence about SQL:", "pos": "Represent the code about SQL:", "neg": "Represent the code about programming:" }
// SetAudioSelectors sets the AudioSelectors field's value.
[ "func (s *Input) SetAudioSelectors(v map[string]*AudioSelector) *Input {\n\ts.AudioSelectors = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Verify verifies the signature over Payload stored in Sig
[ "func (m *SignedMessage) Verify(verifier Signer) (bool, error) {\n\tif verifier == nil {\n\t\treturn false, errors.New(\"nil verifier\")\n\t}\n\n\tsig := m.Sig\n\tm.Sig = nil\n\tdefer func() {\n\t\tm.Sig = sig\n\t}()\n\n\tbytes, err := json.Marshal(m)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"sign er...
[ "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:" }
Gets the values of the properties to check. @protected @method getValues @param * object The object to inspect @return Array The values of the properties in the same order
[ "function (object) {\n\t\t\tvar values = [];\n\t\t\tfor (var i = 0; i < this.properties.length; i = i + 1) {\n\t\t\t\tif (object == null) {\n\t\t\t\t\tvalues.push(undefined);\n\t\t\t\t} else {\n\t\t\t\t\tvalues.push(object[this.properties[i]]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn values;\n\t\t}" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Try to dispatch the request. :return object: result
[ "def dispatch(self, request, **resources):\n \n\n # Fix PUT and PATH methods in Django request\n request = fix_request(request)\n\n # Set self identifier\n self.identifier = request.META.get('REMOTE_ADDR', 'anonymous')\n\n # Send ADREST started signal\n api_request_s...
[ "def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp" ]
codesearchnet
{ "query": "Represent the sentence about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code about Computer Science:" }
Extract Word (SSE).
[ "public final void pextrw(Register dst, MMRegister src, Immediate imm8)\n {\n emitX86(INST_PEXTRW, dst, src, imm8);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a default configuration object, with all parameters filled
[ "def create_default_config():\n \n config = configparser.RawConfigParser()\n config.add_section('global')\n config.set('global', 'env_source_rc', False)\n config.add_section('shell')\n config.set('shell', 'bash', \"true\")\n config.set('shell', 'zsh', \"true\")\n config.set('shell', 'gui', \...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Check if based on the API result we should try to re-run the same request with HTTP instead of HTTPS. @author Vova Feldman (@svovaf) @since 1.1.6 @param $result @return bool
[ "private static function should_try_with_http( $result ) {\r\n\t\t\tif ( ! Freemius_Api_WordPress::IsHttps() ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn ( ! is_object( $result ) ||\r\n\t\t\t ! isset( $result->error ) ||\r\n\t\t\t ! isset( $result->error->code ) ||\r\n\t\t\t !...
[ "def get_value_from_session(key):\n \n def value_from_session_function(service, message):\n \"\"\"Actual implementation of get_value_from_session function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa...
codesearchnet
{ "query": "Represent the Github description about htbridge.com:", "pos": "Represent the Github code about htbridge.com:", "neg": "Represent the Github code about Software development:" }
// SetCode sets the Code field's value.
[ "func (s *ClusterStateChangeReason) SetCode(v string) *ClusterStateChangeReason {\n\ts.Code = &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:" }
:param event_detail: :return:
[ "def event_detail(self, event_detail):\n \n if event_detail is not None:\n if isinstance(event_detail, str):\n self._event_detail = event_detail\n else:\n try:\n for key, val in event_detail.items():\n if isi...
[ "def get_pointer_mapping(self):\n \"\"\"\"\"\"\n r = request.GetPointerMapping(display = self.display)\n return r.map" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Function calls and similar constructs
[ "protected function pExpr_FuncCall(Expr\\FuncCall $node)\n {\n $functionName = $this->pCallLhs($node->name);\n\n $this->securityManager->checkFunctionCall($functionName, $node->args);\n\n return $functionName\n . '(' . $this->pMaybeMultiline($node->args) . ')';\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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// ExcludeArchived sets the value for optional excludeArchived parameter
[ "func (c *GroupsListCall) ExcludeArchived(excludeArchived bool) *GroupsListCall {\n\tc.excludeArchived = excludeArchived\n\treturn c\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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
The suffix list may contain construction variable expansions, so we have to evaluate the individual strings. To avoid doing this over and over, we memoize the results for each construction environment.
[ "def subst_src_suffixes(self, env):\n \n memo_key = id(env)\n try:\n memo_dict = self._memo['subst_src_suffixes']\n except KeyError:\n memo_dict = {}\n self._memo['subst_src_suffixes'] = memo_dict\n else:\n try:\n return m...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
:calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: bool
[ "def has_in_members(self, member):\n \n assert isinstance(member, github.NamedUser.NamedUser), member\n status, headers, data = self._requester.requestJson(\n \"GET\",\n self.url + \"/members/\" + member._identity\n )\n return status == 204" ]
[ "def organization_memberships(self, user):\n \n return self._query_zendesk(self.endpoint.organization_memberships, 'organization_membership', id=user)" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Executes the command.
[ "public function execute(): void\n\t{\n\t\t$migrations = $this->getOutstanding();\n\n\t\tif(empty($migrations))\n\t\t{\n\t\t\t$this->write('<blue>There are no outstanding migrations.</blue>');\n\n\t\t\treturn;\n\t\t}\n\n\t\t$batch = $this->builder()->max('batch') + 1;\n\n\t\tforeach($migrations as $migration)\n\t\t...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Increments counts in the given ``counter`` for all of the vocabulary items in all of the ``Fields`` in this ``Instance``.
[ "def count_vocab_items(self, counter: Dict[str, Dict[str, int]]):\n \n for field in self.fields.values():\n field.count_vocab_items(counter)" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }