query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
@return boolean True if the browser is Shiretoko otherwise false | [
"protected function checkBrowserShiretoko()\n {\n if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\\/([^ ]*)/i', $this->_agent, $matches)) {\n $this->setVersion($matches[1]);\n $this->setBrowser(self::BROWSER_SHIRETOKO);\n return true;\n }\n... | [
"public static function getFirefoxOSVersion($ua)\n {\n\n // Find Firefox Browser/Gecko version\n if (preg_match('#\\brv:(\\d+\\.\\d+)#', $ua, $matches) && array_key_exists($matches[1], self::$firefoxOSMap)) {\n return self::$firefoxOSMap[$matches[1]];\n }\n // Set appropria... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Calculate the needed fee for a provided `$transaction` NEM transaction
object.
This method can be used to calculate all needed fees for a given
`transaction` object.
@param \NEM\Models\Transaction $transaction
@return \NEM\Models\Fee | [
"static public function calculateForTransaction(Transaction $transaction)\n {\n // generate each content fee accordingly\n $msgFee = self::calculateForMessage($transaction->message());\n\n // default content fee is XEM amount transfer fee\n $contentFee = Fee::FEE_FACTOR * self::calcul... | [
"final public function transaction(?string $version = null): Contracts\\Bill\\Transaction\n {\n return $this->uses('Bill.Transaction', $version);\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Transaction Management:"
} |
Move by key
@param right {boolean} direction to move | [
"function (right) {\n var p = this.coords.p_pointer;\n var p_step = (this.options.max - this.options.min) / 100;\n p_step = this.options.step / p_step;\n\n if (right) {\n p += p_step;\n } else {\n p -= p_step;\n }\n\n ... | [
"def focus_left(pymux):\n \" \"\n _move_focus(pymux,\n lambda wp: wp.xpos - 2, # 2 in order to skip over the border.\n lambda wp: wp.ypos)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
This function is an exact duplicate of firstNonWhitespacePosition(Slice) except for one line. | [
"private static int firstNonMatchPosition(Slice utf8, int[] codePointsToMatch)\n {\n int length = utf8.length();\n\n int position = 0;\n while (position < length) {\n int codePoint = tryGetCodePointAt(utf8, position);\n if (codePoint < 0) {\n break;\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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Sets global variables array to load.
@param ContainerBuilder $container
@param array $globals | [
"protected function loadWordpressGlobals(ContainerBuilder $container, $globals)\n {\n $coreGlobals = ['wp', 'wp_the_query', 'wpdb', 'wp_query', 'allowedentitynames'];\n $globals = array_merge($globals, $coreGlobals);\n\n $container->setParameter('ekino.wordpress.globals', $globals);\n }"
... | [
"protected function beforeInit()\n {\n parent::beforeInit();\n \n $this->isCli = true;\n \n // load default config\n Config::setDefault(DefaultConfig::console());\n \n // load default definition\n $this->definition = $this->getDefaultDefinition()... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Saves the edited image as a file based on the original images file type | [
"public function toFile()\n {\n\n\n if ($this->type == \"jpg\")\n\n {\n $this->toJpg();\n\n } elseif ($this->type == \"png\") {\n\n $this->toPng();\n\n } elseif ($this->type == \"gif\") {\n\n $this->toGif();\n }\n\n }"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the underlying type of a typedef declaration.
Returns a Type for the typedef this cursor is a declaration for. If
the current cursor is not a typedef, this raises. | [
"def underlying_typedef_type(self):\n \n if not hasattr(self, '_underlying_type'):\n assert self.kind.is_declaration()\n self._underlying_type = \\\n conf.lib.clang_getTypedefDeclUnderlyingType(self)\n\n return self._underlying_type"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Identify the file type, size, etc. Stuff them into context.info and context.extension | [
"function identify(path, callback) {\n return self.identifyLocalImage(path, function(err, info) {\n if (err) {\n return callback(err);\n }\n context.info = info;\n context.extension = info.extension;\n return callback(null);\n });\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 text about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code:"
} |
Index action for viewing a pagination list
@return ViewModel | [
"public function indexAction()\n {\n $query = (string) $this->params()->fromQuery('query', null);\n $query = strlen($query) > 0 ? $query : null;\n\n $orderBy = (string) $this->params()->fromQuery('orderBy', null);\n $orderBy = strlen($orderBy) > 0 ? $orderBy : null;\n\n $sort =... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
将任意格式的 JSON 对象转换为一个 XML 字符串(不是 HTML) | [
"function jsonToXml(json, rootTag) {\n\n\tif (!typeIs(json, 'object', 'array', 'string', 'number')) unsupportedType(json);\n\n\tvar root = new XmlWrapper(rootTag || 'root');\n\troot.setXmlType(true);\n\tif (typeOf(json, 'string')) {\n\t\troot.add(json);\n\t} else {\n\t\tfor (let name in json) {\n\t\t\tif (hasOwnPro... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about text processing:"
} |
Inserts an entity in to the database
@param collection the collection to query against
@param entity the entity to insert
@param wc the WriteConcern to use when deleting
@param <T> the type of the entities
@return the key of entity | [
"public <T> Key<T> insert(final String collection, final T entity, final WriteConcern wc) {\n return insert(getCollection(collection), ProxyHelper.unwrap(entity), new InsertOptions().writeConcern(wc));\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// stop receiving input and process batch function | [
"func (b *batcher) end() {\n\tif !b.finished {\n\t\tclose(b.input)\n\t\tb.finished = true\n\t}\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get an objective. | [
"def _obj(self):\n \n class Objectives(object):\n def __getitem__(_self, name):\n return self.getObjective(name)\n\n def __iter__(_self):\n return self.getObjectives()\n\n return Objectives()"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Render REANA_CVMFS_PVC_TEMPLATE. | [
"def render_cvmfs_pvc(cvmfs_volume):\n \"\"\"\"\"\"\n name = CVMFS_REPOSITORIES[cvmfs_volume]\n rendered_template = dict(REANA_CVMFS_PVC_TEMPLATE)\n rendered_template['metadata']['name'] = 'csi-cvmfs-{}-pvc'.format(name)\n rendered_template['spec']['storageClassName'] = \"csi-cvmfs-{}\".format(name)\... | [
"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:"
} |
queries the database for count
@param string $sql
@param array $vars the query to search for
@return int a count | [
"public function findCount($vars) {\n $sql = $this->buildSelectStatement(array_keys($vars), $sort, $limit, $options);\n return $this->findCountRaw($sql, $vars);\n }"
] | [
"public static function _fetch_handler( &$query )\n\t{\n\t\t// because the model is an object we force the fetch\n\t\t// arguments to obj so that we can still make use of\n\t\t// the group by and forward key functions\n\t\t$query->fetch_arguments = array( 'obj' );\n\n\t\t// Run the query and assign the reults\n\t\t... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param mixed $value
@return mixed | [
"private function return_($value) {\n if (abs($value) === INF) {\n return $value;\n } else if ($value === 'INF') {\n return INF;\n } else if ($value === '-INF') {\n return -INF;\n } else {\n return (float) $value;\n }\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Checks if a given range is within a range
@param $ipAndCidrSub
@param $ipAndCidrSuper
@return bool | [
"static public function IsIPv4SubnetWithinSupernet($ipAndCidrSub, $ipAndCidrSuper)\n {\n\n $ipAndCidrSubMin = static::ConvertIPv4ToDecimal(\n static::GetIPv4NetworkAddress($ipAndCidrSub)\n );\n\n $ipAndCidrSubMax = static::ConvertIPv4ToDecimal(\n static::GetIPv4Broa... | [
"public function setName($value)\n {\n $num = $this->getNumber();\n $this->setCallerIdVariable('name', $value);\n $this->setCallerIdVariable('all', \"$value<$num>\");\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Traverses the permission tree, returning the permission at given permission path. | [
"def _traverse_tree(tree, path):\n \"\"\"\"\"\"\n path_steps = (step for step in path.split('.') if step != '')\n # Special handling for first step, because the first step isn't under 'objects'\n first_step = path_steps.next()\n subtree = tree[first_step]\n\n for step in pa... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Gets all the experiment_summ_ids that map to a given coinc_event_id. | [
"def get_experiment_summ_ids( self, coinc_event_id ):\n\t\t\n\t\texperiment_summ_ids = []\n\t\tfor row in self:\n\t\t\tif row.coinc_event_id == coinc_event_id:\n\t\t\t\texperiment_summ_ids.append(row.experiment_summ_id)\n\t\tif len(experiment_summ_ids) == 0:\n\t\t\traise ValueError(\"'%s' could not be found in the ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the post about Text processing:",
"pos": "Represent the code about Text processing:",
"neg": "Represent the code:"
} |
@param string $search
@param string $replace
@param string $subject
@return string | [
"protected function strReplaceOnce(string $search, string $replace, string $subject): string\n {\n $pos = strpos($subject, $search);\n if ($pos === false) {\n return $subject;\n }\n\n return substr($subject, 0, $pos) . $replace . substr($subject, $pos + strlen($search));\n ... | [
"public function newSection($name, $text)\n\t{\n\t\treturn $this->setSection($text, $section = 'new', $summary = $name, $minor = false);\n\t}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.
@private | [
"function(eventType) {\n var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;\n if (handlers) {\n if (typeof eventType === \"string\" && eventType) {\n copy = handlers[eventType] ? handlers[eventType].slice(0) : [];\n } else {\n copy = _deepCopy(handlers);... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get current output by type.
@param array $options
@param string $url
@param string $type
@return string | [
"protected function _getTypeOutput(array $options, $url, $type)\n {\n $type = Str::low($type);\n if ($type === 'css') {\n return $this->_getCssOutput($options, $url);\n }\n\n return $this->_getScriptOutput($options, $url);\n }"
] | [
"public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir... | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about NLP:"
} |
Move the grid record to this location in the query (taking blank/no blank into consideration).
@param index The position to move to.
@return An error code (or NORMAL_RETURN). | [
"public int moveToIndex(int index)\n {\n int index2 = index;\n int iErrorCode = DBConstants.NORMAL_RETURN;\n if (m_bIncludeBlankOption)\n {\n if (index == 0)\n iErrorCode = DBConstants.ERROR_RETURN;\n index2--; // Offset by one\n }\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
// VerifyAllCombinationsFor9 is for combinations of 9. | [
"func VerifyAllCombinationsFor9(\n\tt Failable,\n\theader string,\n\ttransform func(a, b, c, d, e, f, g, h, i interface{}) string,\n\tcollection1,\n\tcollection2,\n\tcollection3,\n\tcollection4,\n\tcollection5,\n\tcollection6,\n\tcollection7,\n\tcollection8,\n\tcollection9 interface{}) error {\n\n\tif len(header) !... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Remove the oAuth2 pieces from the hash fragment | [
"function(){\n var curHash = $location.hash();\n angular.forEach(hashFragmentKeys,function(hashKey){\n var re = new RegExp('&'+hashKey+'(=[^&]*)?|^'+hashKey+'(=[^&]*)?&?');\n curHash = curHash.replace(re,'');\n });\n\n $location.hash(curHash);\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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Creates a {@link JsonLongDocument} which the document id and content.
@param id the per-bucket unique document id.
@param content the content of the document.
@return a {@link JsonLongDocument}. | [
"public static JsonLongDocument create(String id, Long content) {\n return new JsonLongDocument(id, 0, content, 0, null);\n }"
] | [
"private static void selectJsonRow(CqlSession session) {\n\n // Reading the whole row as a JSON object\n Statement stmt =\n selectFrom(\"examples\", \"json_jsr353_row\")\n .json()\n .all()\n .whereColumn(\"id\")\n .in(literal(1), literal(2))\n .bui... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Reimplement Qt method | [
"def resizeEvent(self, event):\r\n \"\"\"\"\"\"\r\n if not self.isMaximized() and not self.fullscreen_flag:\r\n self.window_size = self.size()\r\n QMainWindow.resizeEvent(self, event)\r\n\r\n # To be used by the tour to be able to resize\r\n self.sig_resized.emit(event)... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns key of cell that merges the cell key
or None if cell key not merged
Parameters
----------
key: 3-tuple of Integer
\tThe key of the cell that is merged | [
"def get_merging_cell(self, key):\n \n\n row, col, tab = key\n\n # Is cell merged\n merge_area = self[key][\"merge_area\"]\n\n if merge_area:\n return merge_area[0], merge_area[1], tab"
] | [
"def augment_cells_no_span(self, rows, source):\n \n # TODO: Hardwired str transform.\n # 4-tuple: morerows, morecols, offset, cellblock\n # - morerows: The number of additional rows this cells spans\n # - morecols: The number of additional columns this cell spans\n # - off... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
//Decode is called to turn a body supplied by the client into an object of the appropriate
//wire type. Note that the interface{} passed here _must_ be pointer. | [
"func (self *JsonDecoder) Decode(body []byte, wireType interface{}) error {\n\terr := json.Unmarshal(body, wireType)\n\treturn err\n}"
] | [
"def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
保存昵称
@return boolean | [
"public function save()\n {\n if ($this->validate() && (bool)$this->getUser()->updateAttributes(['nickname' => $this->nickname])) {\n return $this->getUser();\n }\n return false;\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github post about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
Change all map cells to a specific value.
.. deprecated:: 4.5
Use :any:`tcod.map.Map.transparent` and :any:`tcod.map.Map.walkable`
arrays to set these properties. | [
"def map_clear(\n m: tcod.map.Map, transparent: bool = False, walkable: bool = False\n) -> None:\n \n m.transparent[:] = transparent\n m.walkable[:] = walkable"
] | [
"def set_cmap(self, cmap, callback=True):\n \n self.cmap = cmap\n with self.suppress_changed:\n self.calc_cmap()\n # TEMP: ignore passed callback parameter\n # callback=False in the following because we don't want to\n # recursively invoke set_cmap()\... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(RobotApplicationConfig robotApplicationConfig, ProtocolMarshaller protocolMarshaller) {\n\n if (robotApplicationConfig == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Parses the dotenv file, comments (#) are ignored.
A key must have a '=' to mark it as a key. Strings without a '='
are ignored.
:param dotenv_path:
:return: generator yielding (key,value) | [
"def parse_dotenv(dotenv_path):\n \n with open(dotenv_path) as f:\n for line in f:\n line = line.strip()\n if not line or line.startswith('#') or '=' not in line:\n continue\n k, v = line.split('=', 1)\n\n # Remove any leading and trailing spac... | [
"def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Notify interested listeners that an expression will be evaluated.
@param expression The expression that will be evaluated
@since EL 3.0 | [
"public void notifyBeforeEvaluation(String expression) {\n for (EvaluationListener listener : listeners) {\n try {\n listener.beforeEvaluation(this, expression);\n } catch (Throwable t) {\n Util.handleThrowable(t);\n // Ignore - no option to ... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get a single line of input as a string from a textfield | [
"def line_input(*args, **kwargs):\n '''\n \n '''\n line_input = wtforms.TextField(*args, **kwargs)\n line_input.input_type = 'line'\n return line_input"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param string $name The data item name
@return bool true if the default value has been applied; otherwise, false | [
"protected function applyDefaultValue($name)\n {\n if (!isset($this->defaults[$name])) {\n return false;\n }\n\n $value = $this->defaults[$name];\n if (is_callable($value)) {\n try {\n $this->items[$name] = call_user_func($value, $this->context);\n... | [
"public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
we have different events for each device/browser
determine what we need and set them in the ionic.Gestures.EVENT_TYPES constant | [
"function determineEventTypes() {\n // determine the eventtype we want to set\n var types;\n\n // pointerEvents magic\n if(ionic.Gestures.HAS_POINTEREVENTS) {\n types = ionic.Gestures.PointerEvent.getEvents();\n }\n // on Android, iOS, blackberry, windows mobile we dont want any... | [
"function() {\n if (options.servePacked) {\n ss.bundler.forEach(function(bundler) {\n bundler.useLatestsPackedId();\n });\n }\n ss.bundler.load();\n //TODO convert options.dirs to relative paths stripping the lead '/' if present\n\n // Cache instances of code formatte... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Helper method to load XML document from URL.
@param url source URL,
@param useNamespace flag to control name space awareness.
@return newly created XML document. | [
"private Document loadXML(URL url, boolean useNamespace) {\r\n\t\tInputStream stream = null;\r\n\t\ttry {\r\n\t\t\tstream = url.openConnection().getInputStream();\r\n\t\t\tInputSource source = new InputSource(stream);\r\n\t\t\treturn useNamespace ? loadXMLNS(source) : loadXML(source);\r\n\t\t} catch (Exception e) {... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Returns the rabl template path for Rails, including special lookups for Rails 2 and 3 | [
"def fetch_rails_source(file, options = {})\n # use Rails template resolution mechanism if possible (find_template)\n source_format = request_format if defined?(request_format)\n\n if source_format && context_scope.respond_to?(:lookup_context) # Rails 3\n lookup_proc = lambda do |parti... | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Before find callback
@param Model $model
@param array $query
@return array | [
"public function beforeFind(Model $model, $query) {\n\n\t\t$runtime = $this->runtime[$model->alias];\n\t\tif ($runtime) {\n\t\t\tif (!is_array($query['conditions'])) {\n\t\t\t\t$query['conditions'] = array();\n\t\t\t}\n\t\t\t$conditions = array_filter(array_keys($query['conditions']));\n\n\t\t\t$fields = $this->_no... | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
calculate zone matches and flag settings to determine whether this module should display to customers or not | [
"function update_status() {\n global $order, $db;\n\n if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0) ) {\n $check_flag = false;\n $check_query = $db->Execute(\"select zone_id from \" . TABLE_ZONES_TO_GEO_ZONES . \" where geo_zone_id = '\" . MODULE_PAYMENT_PAYPAL_ZONE . \"' an... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Prepare any pool options for the new pool object.
@param mixed $options Settings for the new pool.
@return array | [
"private function parsePoolOptions($options)\n {\n $defaults = [\n 'pool_class' => $this->poolClass,\n 'item_class' => $this->itemClass,\n 'namespace' => $this->namespace,\n 'logger' => $this->logger,\n ];\n\n if ($options === null) {\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Checks if the argument is a known argument to the task.
@param arg
@return | [
"private boolean isKnownArgument(String arg) {\n final String argName = getArgName(arg);\n for (String key : knownArgs) {\n if (key.equalsIgnoreCase(argName)) {\n return true;\n }\n }\n return false;\n }"
] | [
"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:"
} |
Writes all submissions to datastore. | [
"def _write_to_datastore(self):\n \"\"\"\"\"\"\n # Populate datastore\n roots_and_submissions = zip([ATTACKS_ENTITY_KEY,\n TARGET_ATTACKS_ENTITY_KEY,\n DEFENSES_ENTITY_KEY],\n [self._attacks,\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 text about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code:"
} |
Syncs many to many relationships
@param $attributes Model attributes
@return object Model instance | [
"private function sync($id, $attributes)\n {\n // Return if the ID is invalid, or attributes is not an array\n if (!isset($id) || !isset($attributes) || empty($attributes)) {\n return $this;\n }\n\n // Return if there are no relationships of that type\n if (!isset($t... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetDeploymentId sets the DeploymentId field's value. | [
"func (s *LambdaTarget) SetDeploymentId(v string) *LambdaTarget {\n\ts.DeploymentId = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
validate the incoming token | [
"def lambda_handler(event, context):\n print(\"Client token: \" + event['authorizationToken'])\n print(\"Method ARN: \" + event['methodArn'])\n \"\"\"and produce the principal user identifier associated with the tokenthis could be accomplished in a number of ways:1. Call out to OAuth provider2. Decode a JW... | [
"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:"
} |
// NoUndefinedVariablesRule No undefined variables
//
// A GraphQL operation is only valid if all variables encountered, both directly
// and via fragment spreads, are defined by that operation. | [
"func NoUndefinedVariablesRule(context *ValidationContext) *ValidationRuleInstance {\n\tvar variableNameDefined = map[string]bool{}\n\n\tvisitorOpts := &visitor.VisitorOptions{\n\t\tKindFuncMap: map[string]visitor.NamedVisitFuncs{\n\t\t\tkinds.OperationDefinition: {\n\t\t\t\tEnter: func(p visitor.VisitFuncParams) (... | [
"static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Updates the CSS resources for the selected formatter.<p> | [
"void updateCss() {\n\n String formatterId = m_formatterSelect.getFormValueAsString();\n CmsFormatterConfig formatter = m_elementBean.getFormatters().get(m_containerId).get(formatterId);\n Set<String> cssResources = formatter.getCssResources();\n for (String cssResource : cssResources) {... | [
"@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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Called for all fields related to the target taxonomy that are in a comment Pod
@param string $field_name | [
"private function update_commentmeta( $field_name ) {\n\n\t\t/** @global wpdb $wpdb */\n\t\tglobal $wpdb;\n\n\t\t// Fix up the unserialized data\n\t\t$task = \"update_commentmeta_{$field_name}_unserialized\";\n\t\tif ( ! $this->have_done( $task ) ) {\n\n\t\t\t$table = $wpdb->commentmeta;\n\t\t\t$data ... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Compare two dates, handling null values.
TODO: correct the comparison order to align with Date.compareTo
@param d1 Date instance
@param d2 Date instance
@return int comparison result | [
"public static int compare(Date d1, Date d2)\n {\n int result;\n if (d1 == null || d2 == null)\n {\n result = (d1 == d2 ? 0 : (d1 == null ? 1 : -1));\n }\n else\n {\n long diff = d1.getTime() - d2.getTime();\n result = ((diff == 0) ? 0 : ((diff > 0) ? 1 : -1))... | [
"public static Boolean lte(Object left, Object right) {\n return or(lt(left, right),\n eq(left, right)); // do not use Java || to avoid potential NPE due to FEEL 3vl.\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return a newly added <a:lumMod> child element. | [
"def add_lumMod(self, value):\n \n lumMod = self._add_lumMod()\n lumMod.val = value\n return lumMod"
] | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetSkillId sets the SkillId field's value. | [
"func (s *AssociateSkillWithUsersInput) SetSkillId(v string) *AssociateSkillWithUsersInput {\n\ts.SkillId = &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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Send given message, and return a future | [
"def send(self, msg, timeout=None, callback=None, raw=False):\n '''\n \n '''\n message_id = self._message_id()\n header = {'mid': message_id}\n\n future = tornado.concurrent.Future()\n if callback is not None:\n def handle_future(future):\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Gets the local customer object searching for it in the database or in the newly created entities persisted but
not yet flushed.
@param $stripeCustomerId
@return bool|StripeLocalCustomer false if the StripeLocalCustomer was not found | [
"protected function getLocalCustomer($stripeCustomerId)\n {\n // First try to get the customer from the database\n $localCustomer = $this->getEntityManager()->getRepository('SHQStripeBundle:StripeLocalCustomer')->findOneByStripeId($stripeCustomerId);\n\n // If we found it, return it\n ... | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Process the table to extract Statements. | [
"def extract_statements(self):\n \"\"\"\"\"\"\n for _, (tf, target, effect, refs) in self.df.iterrows():\n tf_agent = get_grounded_agent(tf)\n target_agent = get_grounded_agent(target)\n if effect == 'Activation':\n stmt_cls = IncreaseAmount\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
recover from an existing export run. We do this by
finding the last time change between events, truncate the file
and restart from there | [
"def recover(options):\n \n\n event_format = options.kwargs['omode']\n\n buffer_size = 64*1024\n fpd = open(options.kwargs['output'], \"r+\")\n fpd.seek(0, 2) # seek to end\n fptr = max(fpd.tell() - buffer_size, 0)\n fptr_eof = 0\n\n while (fptr > 0):\n fpd.seek(fptr)\n event_b... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param array $row_data
@param string $field
@return string | [
"protected function replaceTemplateVars(array $row_data, string $field)\n {\n $pairs = [];\n\n foreach ($row_data as $k => $v) {\n if (!$this->isHtmlAllowed()) {\n $v = htmlspecialchars((string)$v, ENT_QUOTES);\n }\n $pairs['{%' . $k . '%}'] = $v;\n ... | [
"protected function map() {return df_map_0(df_sort_a(df_map_r(df_cms_blocks(), function(B $b) {return [\n\t\t$b->getId(), $b->getTitle()\n\t];})), '-- select a CMS block --');}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Compile the LIMIT clause.
@return string | [
"public function sqlPagination()\n {\n $pager = $this->pagination();\n if (!$pager instanceof DatabasePagination) {\n $pager = $this->createPagination($pager->data());\n }\n\n $sql = $pager->sql();\n if (strlen($sql) > 0) {\n $sql = ' '.$sql;\n }\n\... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Registers all client statistics and schedules periodic collection of stats. | [
"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... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Retrieve proper node name
@param \DOMNode $node The configuration XML node to parse
@return string | [
"protected function parseNodeName($node)\n {\n $nodeName = $node->nodeName;\n if ($node->hasAttributes()) {\n $storeCodeNode = $node->attributes->getNamedItem('store_code');\n $containerNameNode = $node->attributes->getNamedItem('name');\n if ($containerNameNode... | [
"protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// CompressorStrategy returns a MergeStrategy that will merge bgzf.Chunks
// that have a distance between BGZF block starts less than or equal
// to near. | [
"func CompressorStrategy(near int64) MergeStrategy {\n\treturn func(chunks []bgzf.Chunk) []bgzf.Chunk {\n\t\tif len(chunks) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tfor c := 1; c < len(chunks); c++ {\n\t\t\tleftChunk := chunks[c-1]\n\t\t\trightChunk := &chunks[c]\n\t\t\tif leftChunk.End.File+near >= rightChunk.Begin.Fi... | [
"public List<Pair<UIEvent, Table>> readEvents() throws IOException {\n //TODO eventually we'll support working out the offset for files that were not written in this session\n Preconditions.checkState(endStaticInfoOffset >= 0, \"Cannot read events - have not written end of static info marker\");\n ... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software Development:"
} |
@param Remote|string $remote
@param Branch|string $branch
@param array $options
@throws \RuntimeException
@return string | [
"public function fetch($remote = null, $branch = null, Array $options = array())\n {\n if ($remote instanceof Remote) {\n $remote = $remote->getName();\n }\n if ($branch instanceof Branch) {\n $branch = $branch->getName();\n }\n $normalizedOptions = $this-... | [
"public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Read file with given file_path line by line,
return the first line that starts with "# SHA1:", like this:
# SHA1:da39a3ee5e6b4b0d3255bfef95601890afd80709 | [
"def parse_hash_comment(file_path):\n \n with open(file_path) as fp:\n for line in fp:\n if line.startswith(\"# SHA1:\"):\n return line\n return None"
] | [
"public static function curve256(): Curve\n {\n $p = \\gmp_init('ffffffff00000001000000000000000000000000ffffffffffffffffffffffff', 16);\n $a = \\gmp_init('ffffffff00000001000000000000000000000000fffffffffffffffffffffffc', 16);\n $b = \\gmp_init('5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Creates the figure and axes for the plotting panel. | [
"def createPlotPanel(self):\n ''''''\n self.figure = Figure()\n self.axes = self.figure.add_subplot(111)\n self.canvas = FigureCanvas(self,-1,self.figure)\n self.canvas.SetSize(wx.Size(300,300))\n self.axes.axis('off')\n self.figure.subplots_adjust(left=0,right=1,top... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
获取Integer
@param key 例如:country.province[13].peopleNums
@return {@link Integer} | [
"public int getIntegerUseEval(String key) {\r\n String string = getStringUseEval(key);\r\n return Checker.isNull(string) ? null : Formatter.stringToInt(string);\r\n }"
] | [
"public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu... | codesearchnet | {
"query": "Represent the Github post about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Software Development:"
} |
Returns an {@code ARRAY<INT64>} value.
@param v the source of element values, which may be null to produce a value for which {@code
isNull()} is {@code true} | [
"public static Value int64Array(@Nullable long[] v) {\n return int64Array(v, 0, v == null ? 0 : v.length);\n }"
] | [
"public final void setSideEffectFlags(int flags) {\n checkState(\n this.isCall() || this.isNew() || this.isTaggedTemplateLit(),\n \"Side-effect flags can only be set on invocation nodes; got %s\",\n this);\n\n // We invert the flags before setting because we also invert the them when gett... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Multicast method | [
"func (client *Client) Multicast(to []string, messages ...SendingMessage) *MulticastCall {\n\treturn &MulticastCall{\n\t\tc: client,\n\t\tto: to,\n\t\tmessages: messages,\n\t}\n}"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Deploys a module component instance in the network's cluster. | [
"private void deployModule(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) {\n log.debug(String.format(\"%s - Deploying %s to %s\", NetworkManager.this, instance.component().asModule().module(), node.address()));\n node.deployModule(instance.component().asModule... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Handles basic authentication.
@param GetResponseEvent $event A GetResponseEvent instance | [
"public function handle(GetResponseEvent $event)\n {\n $request = BridgeRequest::createFromRequest($event->getRequest());\n $response = new BridgeResponse;\n\n if (!$this->oauth2Server->verifyResourceRequest($request, $response)) {\n return;\n }\n\n try {\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
get a /sync response which contains a single e2e room (ROOM_ID), with the
members given
@param {string[]} roomMembers
@return {object} sync response | [
"function getSyncResponse(roomMembers) {\n const stateEvents = [\n testUtils.mkEvent({\n type: 'm.room.encryption',\n skey: '',\n content: {\n algorithm: 'm.megolm.v1.aes-sha2',\n },\n }),\n ];\n\n Array.prototype.push.apply(\n ... | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
注册内容解析器
@param array $mediaTypes
@param callable $parser | [
"protected function registerMediaTypeParser(array $mediaTypes, callable $parser)\n {\n if ($parser instanceof \\Closure) {\n $parser = $parser->bindTo($this);\n }\n\n foreach ($mediaTypes as $mediaType) {\n $this->bodyParsers[$mediaType] = $parser;\n }\n }"
] | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SavePolicy saves the current policy (usually after changed with Casbin API) back to file/database. | [
"func (e *Enforcer) SavePolicy() error {\n\tif e.IsFiltered() {\n\t\treturn errors.New(\"cannot save a filtered policy\")\n\t}\n\tif err := e.adapter.SavePolicy(e.model); err != nil {\n\t\treturn err\n\t}\n\tif e.watcher != nil {\n\t\treturn e.watcher.Update()\n\t}\n\treturn nil\n}"
] | [
"func (c *agentConf) AddFlags(f *gnuflag.FlagSet) {\n\t// TODO(dimitern) 2014-02-19 bug 1282025\n\t// We need to pass a config location here instead and\n\t// use it to locate the conf and the infer the data-dir\n\t// from there instead of passing it like that.\n\tf.StringVar(&c.dataDir, \"data-dir\", util.DataDir,... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get a single property of the Struct
@param string $name
@return Property|null | [
"public function getProperty($name): ?Property\n {\n if ($this->hasProperty($name)) {\n return $this->properties[$name];\n }\n\n return null;\n }"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Performs sys-prop and js evals on the passed value
@param text The value to process
@return the processed value | [
"public static String processConfigValue(CharSequence text) {\n final String pv = evaluate(tokenReplaceSysProps(text));\n return (pv==null || pv.trim().isEmpty()) ? null : pv;\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Print information about one specific job.
@param jobExecutionInfoOptional Job info to print | [
"public static void printJob(Optional<JobExecutionInfo> jobExecutionInfoOptional) {\n if (!jobExecutionInfoOptional.isPresent()) {\n System.err.println(\"Job id not found.\");\n return;\n }\n\n JobExecutionInfo jobExecutionInfo = jobExecutionInfoOptional.get();\n Li... | [
"@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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Checks if the device has a home screen.
@param context the context.
@return {@code true} if the device has a home screen. | [
"@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)\n public static boolean hasHomeScreenFeature(Context context) {\n return hasHomeScreenFeature(context.getPackageManager());\n }"
] | [
"function(terria) {\n CatalogMember.call(this, terria);\n\n this._enabledDate = undefined;\n this._shownDate = undefined;\n this._loadForEnablePromise = undefined;\n this._lastLoadInfluencingValues = undefined;\n\n // The catalog item to show in the Now Viewing when this item is enabled, instead of this item.... | codesearchnet | {
"query": "Represent the summarization about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Software development:"
} |
Bind current request.
@param Request $request | [
"public function bindRequest(Request $request)\n {\n $query = $request->query;\n $session = $request->getSession();\n\n $adminListName = 'listconfig_' . $request->get('_route');\n\n $this->page = $request->query->getInt('page', 1);\n $this->limit = $request->query->getInt('limi... | [
"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:"
} |
Save query cache
@param string $sql
@param mixed $result | [
"final protected function cache_query($sql, $result){\n if( isset($this->query_cache[$sql]) ){\n $this->query_cache[$sql] = $result;\n }elseif( count($this->query_cache) >= $this->cache_limit ){\n // Remove oldest cache\n array_shift($this->query_cache);\n /... | [
"public function send($callback)\n {\n $this->mysqlAsynPool->query($callback, $this->bindId, $this->sql, $this->getContext());\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
This method is used to set the password.
password must be a string. | [
"def set_password(self, password = None):\n \n \n if password is None or type(password) is not str:\n raise KPError(\"Need a new image number\")\n else:\n self.password = password\n self.last_mod = datetime.now().replace(microsecond=0)\n return... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create a {@code Cursor} given its URL safe encoded form. | [
"public static Cursor fromUrlSafe(String urlSafe) {\n try {\n return Cursor.copyFrom(BaseEncoding.base64Url().decode(urlSafe));\n } catch (IllegalArgumentException e) {\n throw new IllegalStateException(\"Unexpected decoding exception\", e);\n }\n }"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Defines validate rules.
@param mixed ...$validate
@return self | [
"public function validate(...$validate)\n {\n if( $this->validate === [] )\n {\n $this->validate = $validate;\n }\n else\n {\n $this->validate = array_merge($this->validate, $validate);\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Asserts the process instance with the provided id is ended.
@param processInstanceId
the process instance's id to check for. May not be <code>null</code> | [
"public static final void assertProcessEnded(final String processInstanceId) {\n Validate.notNull(processInstanceId);\n\n apiCallback.debug(LogMessage.PROCESS_5, processInstanceId);\n try {\n getProcessInstanceAssertable().processIsEnded(processInstanceId);\n } catch (final As... | [
"public boolean isValidEntityObject(Object entity, EntityMetadata metadata)\n {\n if (entity == null)\n {\n log.error(\"Entity to be persisted must not be null, operation failed\");\n return false;\n }\n\n Object id = PropertyAccessorHelper.getId(entity, metadata... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
e.g. confirm in http://confirm | [
"def parse_email_for_explicit_link(email, regex)\n regex = /#{Regexp.escape(regex)}/ unless regex.is_a?(Regexp)\n links_in_email(email).detect { |link| link =~ regex }\n end"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Wrapper that converts PHP errors to exceptions and passes them
to the standard error50x handler. | [
"public function php_error_handler($errno, $errstr, $errfile, $errline)\n {\n $e = new \\Exception($errstr, $errno);\n call_user_func($this->error50x, $e);\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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Starts in the data file folder and recursively looks
in parents for `schema_name` | [
"def _find_data_path_schema(data_path, schema_name):\n \n if not data_path or data_path == '/' or data_path == '.':\n return None\n directory = os.path.dirname(data_path)\n path = glob.glob(os.path.join(directory, schema_name))\n if not path:\n return _find_schema(directory, schema_name... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// verifyNoCycles verifies there are no cycles in the DAG graph | [
"func verifyNoCycles(tmpl *wfv1.Template, nameToTask map[string]wfv1.DAGTask) error {\n\tvisited := make(map[string]bool)\n\tvar noCyclesHelper func(taskName string, cycle []string) error\n\tnoCyclesHelper = func(taskName string, cycle []string) error {\n\t\tif _, ok := visited[taskName]; ok {\n\t\t\treturn nil\n\t... | [
"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 summarization about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code:"
} |
Get all appointments for an episode
@param int|Episode $episode Episode Id or object
@return array appointmentId => appointment object | [
"public function getAppointmentsForEpisode($episode)\n {\n $select = $this->_getAppointmentSelect();\n\n if ($episode instanceof EpisodeOfCare) {\n $episodeId = $episode->getId();\n } else {\n $episodeId = $episode;\n }\n $select->where('gap_id_episode = ?... | [
"@Operation(name=\"$find-matches\", idempotent=true)\n public Parameters findMatchesAdvanced(\n @OperationParam(name=\"dateRange\") DateRangeParam theDate,\n @OperationParam(name=\"name\") List<StringParam> theName,\n @OperationParam(name=\"code\") TokenAndListParam theEnd) {\n \n Paramet... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// basic escaping, will need to be improved or replaced | [
"func escape(s string) string {\n\ts = strings.Replace(s, \"\\n\", \"\\\\n\", -1)\n\ts = strings.Replace(s, \"\\\"\", \"\\\\\\\"\", -1)\n\treturn s\n}"
] | [
"function simulateClick(driver, posX, posY) {\n return browser\n .executeScript(\n driver,\n script.replace(/\\$x/g, posX).replace(/\\$y/g, posY)\n )\n .then(function(el) {\n return Promise.resolve();\n // selenium click at weird places I haven't bothered to figure out why\n // I ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetClusterId sets the ClusterId field's value. | [
"func (s *DescribeClusterInput) SetClusterId(v string) *DescribeClusterInput {\n\ts.ClusterId = &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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Convert allowed state transitions / target states to lowercase. | [
"def _dict_lower(dictionary: dict):\n \"\"\"\"\"\"\n return {key.lower(): [value.lower() for value in value]\n for key, value in dictionary.items()}"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Extract values from an object
@param object $object
@return array
@throws \Exception | [
"public function extract($object)\n {\n if (!$object instanceof Request) {\n throw new \\Exception('$object must be an instance of Request');\n }\n /* @var $object Request */\n $data = parent::extract($object);\n\n return $data;\n }"
] | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Execute the console command.
@return mixed | [
"public function handle()\n {\n $filesystem = new Filesystem;\n $filesystem->copyDirectory(\n __DIR__ . '/stubs/install',\n base_path()\n );\n $this->call('storage:link');\n\n if ($this->option('migrate')) {\n $this->call('migrate', ['--path' =>... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Prepare the HTTP handler, URL, and HTTP headers for all subsequent requests | [
"def init(self):\n \"\"\"\"\"\"\n self.debug('Initializing %r', self)\n proto = self.server.split('://')[0]\n\n if proto == 'https':\n if hasattr(ssl, 'create_default_context'):\n context = ssl.create_default_context()\n\n if self.ssl_verify:\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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Invokes zimbra soap request. | [
"def invoke(self, ns, request_name, params, auth_token, simplify=False):\n \n ZimbraClientTransport.invoke(self,\n ns,\n request_name,\n params,\n auth_token,... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Get a list of all votes for the authenticating client.
@param [Hash] options
@option options Integer :user_id - Only return votes for this user.
@option options Integer :limit - The maximum number of records to return. | [
"def votes(options={})\n response = connection.get do |req|\n req.url \"votes\", options\n end\n return_error_or_body(response)\n end"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
adds a WCheckBoxSelect with LAYOUT_COLUMN in 2 columns. | [
"private void addColumnSelectExample() {\n\t\tadd(new WHeading(HeadingLevel.H3, \"WCheckBoxSelect laid out in columns\"));\n\t\tadd(new ExplanatoryText(\"Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is\"\n\t\t\t\t+ \" determined by the layoutColumnCount pr... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewDefaultRocPForStreamWithSrcLen creates a Rate of Change Percentage Indicator (RocP) for offline usage with a source data stream | [
"func NewDefaultRocPForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocP, err error) {\n\tind, err := NewDefaultRocPWithSrcLen(sourceLength)\n\tpriceStream.AddTickSubscription(ind)\n\treturn ind, err\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Track trusted multifactor authentication attribute.
@param authn the authn
@param attributeName the attribute name | [
"public static void trackTrustedMultifactorAuthenticationAttribute(\n final Authentication authn,\n final String attributeName) {\n\n val newAuthn = DefaultAuthenticationBuilder.newInstance(authn)\n .addAttribute(attributeName, Boolean.TRUE)\n .build();\n LOGGER.deb... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
// Contains implements the StringSet interface. | [
"func (s *stringSet) Contains(v string) bool {\n\t_, ok := s.values[v]\n\treturn ok\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.