query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// walkType adds the type, and any necessary child types. | [
"func (b *Builder) walkType(u types.Universe, useName *types.Name, in tc.Type) *types.Type {\n\t// Most of the cases are underlying types of the named type.\n\tname := tcNameToName(in.String())\n\tif useName != nil {\n\t\tname = *useName\n\t}\n\n\tswitch t := in.(type) {\n\tcase *tc.Struct:\n\t\tout := u.Type(name)... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
:returns: an ArrayWrapper over a 4D array of shape (N, R, M, P) | [
"def make_iml4(R, iml_disagg, imtls=None, poes_disagg=(None,), curves=()):\n \n if imtls is None:\n imtls = {imt: [iml] for imt, iml in iml_disagg.items()}\n N = len(curves) or 1\n M = len(imtls)\n P = len(poes_disagg)\n arr = numpy.zeros((N, R, M, P))\n imts = [from_string(imt) for imt ... | [
"def resolution(self, values):\n \n values = np.asanyarray(values, dtype=np.int64)\n if values.shape != (2,):\n raise ValueError('resolution must be (2,) float')\n # assign passed values to focal length\n self._resolution = values"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Gets the normalization max depth.
@return int|null
@deprecated since version 2.1, to be removed in 3.0. Use {@link self::isMaxDepthEnabled()} instead | [
"public function getMaxDepth()\n {\n if (0 === func_num_args() || func_get_arg(0)) {\n @trigger_error(sprintf('%s is deprecated since version 2.1 and will be removed in 3.0. Use %s::isMaxDepthEnabled() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);\n }\n\n return $this->ma... | [
"final public function getArray()\n {\n $res = $this->getArrayInternal();\n if (!$this->isArray($res) && !$this->isArrayObject($res)) {\n $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';\n $errorMessage .= ' Make sure you have provided a v... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
This method must execute once.. Grab all schemas
representing each targetNamespace. | [
"def gatherNamespaces(self):\n '''\n '''\n if self.usedNamespaces is not None:\n return\n\n self.logger.debug('gatherNamespaces')\n self.usedNamespaces = {}\n \n # Add all schemas defined in wsdl\n # to used namespace and to the Alias dict\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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Check ensures that this value conforms to the given schema. | [
"func (v *Value) Check(s *Schema) error {\n\tcheck, needsCheck := v.Value.(interface {\n\t\tCheck(*Schema) error\n\t})\n\tif !needsCheck {\n\t\treturn nil\n\t}\n\treturn check.Check(s)\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Symkey garbage collection
// a key is removed if:
// - it is not marked as protected
// - it is not in the incoming decryption cache | [
"func (ks *Pss) cleanKeys() (count int) {\n\tks.mx.Lock()\n\tdefer ks.mx.Unlock()\n\tfor keyid, peertopics := range ks.symKeyPool {\n\t\tvar expiredtopics []Topic\n\t\tfor topic, psp := range peertopics {\n\t\t\tif psp.protected {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvar match bool\n\t\t\tfor i := ks.symKeyDecryptCa... | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Instructs the printer to emit a field value as text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType) {\n if (fieldType == null) {\n throw new IllegalArgumentException(\"Field type must not be null\");\n }\n return append0(new TextField(fieldType, false));\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Adds a lazy property identified by the given name. The property
is lazy because it is not evaluated until asked for via __get().
@param string $name
@param callable $factory
@param bool $memoize
@return $this | [
"public function addProperty($name, callable $factory, $memoize = false)\n {\n $this->properties[$name] = ['factory' => \\Closure::bind($factory, $this, $this), 'memoize' => $memoize];\n\n return $this;\n }"
] | [
"protected function addMutatorOpenBody(&$script, Column $column)\n {\n $clo = $column->getLowercasedName();\n $cfc = $column->getPhpName();\n if ($column->isLazyLoad()) {\n $script .= \"\n // explicitly set the is-loaded flag to true for this lazy load col;\n // it d... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns an array of HTMLElement childNodes.
@method getChildren
@param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
@return {Array} A static array of HTMLElements | [
"function(node) {\n node = Y.Dom.get(node);\n if (!node) {\n }\n\n return Y.Dom.getChildrenBy(node);\n }"
] | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Prune the internal cache.
Removes all cached files except for the newest version of each one.
## EXAMPLES
$ wp cli cache prune
Success: Cache pruned.
@subcommand prune | [
"public function cache_prune() {\n\t\t$cache = WP_CLI::get_cache();\n\n\t\tif ( ! $cache->is_enabled() ) {\n\t\t\tWP_CLI::error( 'Cache directory does not exist.' );\n\t\t}\n\n\t\t$cache->prune();\n\n\t\tWP_CLI::success( 'Cache pruned.' );\n\t}"
] | [
"public function run(array $args)\n {\n Index::info('Help Menu');\n Index::info('- `eve generate <schema*> <namespace>` Generates files based on schema');\n Index::info('- `eve database <schema*>` Generates database table/s schema');\n Index::info('- `eve install` ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
// Open creates a new datasource connection | [
"func (c *Connection) Open() error {\n\tif c.Store != nil {\n\t\treturn nil\n\t}\n\tif c.Dialect == nil {\n\t\treturn errors.New(\"invalid connection instance\")\n\t}\n\tdetails := c.Dialect.Details()\n\tdb, err := sqlx.Open(details.Dialect, c.Dialect.URL())\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could 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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// ListenServeAndSignal serves incoming connections and passes nil or error
// when listening. signal can be nil. | [
"func (s *Server) ListenServeAndSignal(signal chan error) error {\n\tln, err := net.Listen(s.net, s.laddr)\n\tif err != nil {\n\t\tif signal != nil {\n\t\t\tsignal <- err\n\t\t}\n\t\treturn err\n\t}\n\ts.ln = ln\n\tif signal != nil {\n\t\tsignal <- nil\n\t}\n\treturn serve(s)\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 Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Delete a project. | [
"public function delete($projectId)\n {\n $this->requireAdmin();\n\n $project = $this->projectStore->getById($projectId);\n $this->projectService->deleteProject($project);\n\n $response = new b8\\Http\\Response\\RedirectResponse();\n $response->setHeader('Location', PHPCI_URL);... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Execute the plural form function.
@param int $n Variable "n" to substitute.
@throws Exception
@return int PluralForms form value. | [
"public function execute($n)\n {\n $stack = array();\n $i = 0;\n $total = count($this->tokens);\n while ($i < $total) {\n $next = $this->tokens[$i];\n $i++;\n if ($next[0] === 'var') {\n $stack[] = $n;\n continue;\n ... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Documentation:"
} |
Get the info of only one image
@param string $image
@param null|array $config
@return array|null | [
"public static function getImageInfo($image, array $config = null)\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $img = new static($image['value'], $finfo, $config);\n\n $curl = $img->getConnection();\n curl_exec($curl);\n curl_close($curl);\n\n $info = $img->getInfo(... | [
"public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
str: func_name(type1,type2) returns (type3)
Return the function signature as a str (contains the return values) | [
"def signature_str(self):\n \n name, parameters, returnVars = self.signature\n return name+'('+','.join(parameters)+') returns('+','.join(returnVars)+')'"
] | [
"def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Return all subjects (tags) in the database except "internal" scheme. | [
"def _get_subject_list_generator(cursor):\n \"\"\"\"\"\"\n subject = None\n last_tagid = None\n cursor.execute(SQL['get-subject-list'])\n for s in cursor.fetchall():\n tagid, tagname, portal_type, count = s\n\n if tagid != last_tagid:\n # It's a new subject, create a new dict... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the summarization about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code:"
} |
执行回调函数,如果函数为null则不执行
@param result 结果
@param body 邮件正文
@param to 邮件接收人
@param title 邮件标题
@param fileParts 邮件附件
@param error 发送邮件中发生的异常,不存在则为null
@param mail 邮箱客户端
@param callback 回调函数 | [
"private void execCallback(boolean result, EmailBody body, String to, String title,\n FilePart[] fileParts, Throwable error, JMail mail,\n JMailCallback callback) {\n if (callback != null) {\n callback.call(result, body, to, title, filePart... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Returns the subpackage key of the specified controller.
If there is no subpackage key set, the method returns NULL.
@return string The subpackage key
@api | [
"public function getControllerSubpackageKey()\n {\n $controllerObjectName = $this->getControllerObjectName();\n if ($this->controllerSubpackageKey !== null && $controllerObjectName !== '') {\n\n // Extract the subpackage key from the controller object name to assure that the case is corr... | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
r"""
Equal to Minowski distance with :math:`p=1`.
See also
--------
minowski | [
"def manhattan(h1, h2): # # 7 us @array, 31 us @list \\w 100 bins\n \n \"\"\"\n h1, h2 = __prepare_histogram(h1, h2)\n return scipy.sum(scipy.absolute(h1 - h2))"
] | [
"def dre_dm(self, pars):\n \n \"\"\"\n self._set_parameters(pars)\n terms = self.num / self.denom\n result = - self.sigmai * terms\n\n return result"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(GetFunctionRequest getFunctionRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getFunctionRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(getFunction... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get an instance by binary uuid.
:param model: a string, model name in rio.models.
:param bin_uuid: a 16-bytes binary string.
:return: None or a SQLAlchemy instance. | [
"def get_instance_by_bin_uuid(model, bin_uuid):\n \n try:\n model = get_model(model)\n except ImportError:\n return None\n\n return model.query.filter_by(**{'bin_uuid': bin_uuid}).first()"
] | [
"def cast_to_python(self, value):\n \"\"\"\"\"\"\n # v2.x does not provide a distinction between users and groups at the field selection level, can only return\n # UserGroup instances instead of specific User or Group instances\n if value is not None:\n value = UserGroup(self.... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Method: serialize.object
Transform an object into a JSON string.
Parameters:
object - {Object} The object to be serialized.
Returns:
{String} A JSON string representing the object. | [
"function(object) {\n // three special objects that we want to treat differently\n if(object == null) {\n return \"null\";\n }\n if(object.constructor == Date) {\n return this.serialize.date.apply(this, [object]);\n }\n ... | [
"function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options.... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about PHP:"
} |
--------------------------------------------------------------------- | [
"@Override\n\tprotected void flush() {\n\t\t// The Kafka 0.8 producer doesn't support flushing, we wait here\n\t\t// until all pending records are confirmed\n\t\tsynchronized (pendingRecordsLock) {\n\t\t\twhile (pendingRecords > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tpendingRecordsLock.wait();\n\t\t\t\t} catch (Interrupted... | [
"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 instruction about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code:"
} |
// CurrentSession implements the KeybaseService interface for
// KeybaseServiceMeasured. | [
"func (k KeybaseServiceMeasured) CurrentSession(ctx context.Context, sessionID int) (\n\tsessionInfo idutil.SessionInfo, err error) {\n\tk.currentSessionTimer.Time(func() {\n\t\tsessionInfo, err = k.delegate.CurrentSession(ctx, sessionID)\n\t})\n\treturn sessionInfo, err\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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SlotTuple returns a slot tuple for the replicated service task. | [
"func (r *Orchestrator) SlotTuple(t *api.Task) orchestrator.SlotTuple {\n\treturn orchestrator.SlotTuple{\n\t\tServiceID: t.ServiceID,\n\t\tSlot: t.Slot,\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 instruction about Elm programming language:",
"pos": "Represent the code about Elm programming language:",
"neg": "Represent the code:"
} |
set port transmit mode
:param mode: request transmit mode
:type mode: ixexplorer.ixe_port.IxeTransmitMode | [
"def set_transmit_mode(self, mode):\n \n\n self.api.call_rc('port setTransmitMode {} {}'.format(mode, self.uri))"
] | [
"def echo(self, data):\n \n return pyhsm.basic_cmd.YHSM_Cmd_Echo(self.stick, data).execute()"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Converts {@link IDataSet} to new {@link Workbook},
then writes this Workbook to new {@link ByteArrayOutputStream}. | [
"static OutputStream toXlsxFile(final IDataSet dataSet) {\n ByteArrayOutputStream xlsx = new ByteArrayOutputStream();\n \n try { toWorkbook(dataSet, (Workbook) null).write(xlsx); }\n catch (IOException e) { throw new CalculationEngineException(e); }\n \n return xlsx;\n }... | [
"@Override\n public InputStream exportAsInputStream() {\n // Create export delegate\n final AbstractExporterDelegate<InputStream> exportDelegate = new ZipExporterDelegate(this.getArchive());\n\n // Export and get result\n return exportDelegate.export();\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Java programming:"
} |
Build Mailgun compatible message array from email entity
Documentation at https://mandrillapp.com/api/docs/messages.php.html
@param EmailEntity $emails
@return array | [
"protected function buildMessage(EmailEntity $email)\n {\n // Create attachments array\n $attachments = json_decode($email->getAttachments(), true) ?: [];\n\n // Convert Mandrill format to Mailgun format\n $attachments = array_map(\n function ($attachment) {\n ... | [
"public function sample1()\n {\n $data = null;\n $template_html = 'sample-1.html';\n\n $mail = new Mail();\n $mail->setMailBody($data, $template_html);\n $mail->sendMail('Test Sample 1 - external HTML template');\n exit('Message Sent!');\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
add new tbody into table having tr,td tags
@param trList List of List for tr,td tags
@return
@throws TagTypeUnmatchException | [
"public TableBuilder addTbody(List<List<Object>> trList)\n throws TagTypeUnmatchException {\n addTbody(trList, null);\n return this;\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Recursively finds all children of node with given id
@param $id
@param $data
@param $hidden | [
"private static function treeGoDown($id, $data, &$hidden)\n {\n foreach ($data as $row) {\n if ($row['parent_id'] == $id) {\n if (false === in_array($row['id'], $hidden)) {\n $hidden[] = $row['id'];\n }\n self::treeGoDown($row['id'... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Increment the number of executions for the current connection.
:param psycopg2.extensions.connection conn: the psycopg2 connection | [
"def _incr_executions(self, conn):\n \n self._pool_manager.get_connection(self.pid, conn).executions += 1"
] | [
"def get_cursor(self, instance, db_key, db_name=None):\n '''\n \n '''\n conn_key = self._conn_key(instance, db_key, db_name)\n try:\n conn = self.connections[conn_key]['conn']\n except KeyError:\n # We catch KeyError to avoid leaking the auth info used... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Removes a directed edge from the network connecting <tt>a</tt> to <tt>b</tt>.
If <tt>a</tt> and <tt>b</tt> are not nodes in the graph, nothing occurs.
@param a the parent node
@param b the child node | [
"public void removeEdge(N a, N b)\n {\n if(!containsBoth(a, b))\n return;\n nodes.get(a).getOutgoing().remove(b);\n nodes.get(b).getIncoming().remove(a);\n }"
] | [
"def node_iterator(self):\n \n return iter(self._node_attributes)\n\n\tdef has_hypernode(self, hypernode):\n \"\"\"Determines if a specific hypernode is present in the hypergraph.\n\n :param node: reference to hypernode whose presence is being checked.\n :returns: bool -- true iff... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Try to get next page link. | [
"def _extract_next_page_link(self):\n \n\n # HEADS UP: we do not abort if next_page_link is already set:\n # we try to find next (eg. find 3 if already at page 2).\n\n for pattern in self.config.next_page_link:\n items = self.parsed_tree.xpath(pattern)\n\n ... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *CognitoIDentityPoolPushSyncList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := CognitoIDentityPoolPushSync{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = CognitoIDentityPoolPushSyncList{item}\n\t\treturn nil\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
NSExpansionAttributeName
:expansion
* 0, :default
* A Float | [
"def expansion_attribute(styles={})\n return nil if styles.nil?\n return nil if styles[:expansion].nil?\n value = styles[:expansion]\n return 0 if [0, :default].include?(value)\n return nil unless value.respond_to?(:to_f)\n return value.to_f\n end"
] | [
"def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Regular expressions:"
} |
Deletes a file on the hard disk.
@access public
@param string $additionalPath
@return boolean | [
"public function deleteFile($additionalPath = '')\n {\n $path = $this->testPath($this->realPath($additionalPath));\n \n if ($path === false) {\n return false;\n }\n \n return unlink($path);\n }"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about File management:"
} |
Get object or sub-object attribute value :
get( {o1:{o2:{o3:{a:1}}}}, "o1.o2.o3.a") => 1
@param obj Object
@param keyName Attribute name
@returns {*} | [
"function get(obj, keyName) {\n if(obj == null || keyName == null) {\n return null;\n }\n if(keyName.indexOf('.') == -1) {\n return obj[keyName];\n }\n var keyNames = keyName.split('.');\n if(keyNames == null) {\n return null;\n }\n for(var i=0; i<keyNames.length; i++) {... | [
"function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Unreserves all the resources for all the slaves for the role. | [
"def unreserve_resources(role):\n \n state = dcos_agents_state()\n if not state or 'slaves' not in state.keys():\n return False\n all_success = True\n for agent in state['slaves']:\n if not unreserve_resource(agent, role):\n all_success = False\n return all_success"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
// NewRepoServerClientset creates new instance of repo server Clientset | [
"func NewRepoServerClientset(address string, timeoutSeconds int) Clientset {\n\treturn &clientSet{address: address, timeoutSeconds: timeoutSeconds}\n}"
] | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Gets the root unsatisfiable classes.
@return A set of classes that represent the root unsatisfiable classes | [
"public Set<OWLClass> getRootUnsatisfiableClasses() throws ExplanationException {\n StructuralRootDerivedReasoner srd = new StructuralRootDerivedReasoner(manager, baseReasoner, reasonerFactory);\n Set<OWLClass> estimatedRoots = srd.getRootUnsatisfiableClasses();\n cls2JustificationMap = new Has... | [
"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 about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Adds a child block to this block
@param int $index The offset of the child block | [
"public function addChild($index) {\n\t\tforeach($this->children as $child) {\n\t\t\tif($child->getID() == $index) return;\n\t\t}\n\t\t$this->children[] = $this->reflector->getBlockByID($index);\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Check if input equals zero within given tolerance | [
"function iszero(x, tolerance) {\n if (tolerance === void 0) { tolerance = constants_1.EPSILON; }\n // the 'less-than-equal' comparision is necessary for correct result\n // when tolerance = 0\n return Math.abs(x) <= tolerance;\n}"
] | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Detect v5r-i irregular form(s)
ある・在る・有る has an irregular negative ( ~ない ) form: ない | [
"private function isIrregularForm_v5ri($verbalForm, $languageForm) {\n if($this->type !== 'v5r-i') {\n return false;\n }\n\n if(in_array($verbalForm, array(Inflector::NON_PAST_FORM, Inflector::PAST_FORM,\n Inflector::PROVISIONAL_CONDITIONAL_FORM, Inflector::CONDITIONAL_FORM), true)\n && $lan... | [
"def special2csa(str)\n {\n \"中断\" => \"CHUDAN\",\n \"投了\" => \"TORYO\",\n \"持将棋\" => \"JISHOGI\",\n \"千日手\" => \"SENNICHITE\",\n \"詰み\" => \"TSUMI\",\n \"不詰\" => \"FUZUMI\",\n \"切れ負け\" => \"TIME_UP\",\n \"反則勝ち\" => \"ILLEGAL_ACTION\", # 直前の手が反則(先頭に+か-で反則... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
JSON parser
@function fromJson
@param {Object} collection - collection model
@param {String} collectionPath - path of collection
@param {Function} next - callback | [
"function fromJson(collection, collectionPath, next) {\n\n var docsBulk = [];\n var docs = fs.readdirSync(collectionPath);\n var last = ~~docs.length, counter = 0;\n if (last === 0) {\n return next(null);\n }\n\n docs.forEach(function(docName) {\n\n var doc, data;\n try {\n data = fs.readFileSyn... | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// Lists all available networks. | [
"func (s *NetworkService) ListNetworks(p *ListNetworksParams) (*ListNetworksResponse, error) {\n\tresp, err := s.cs.newRequest(\"listNetworks\", p.toURLValues())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar r ListNetworksResponse\n\tif err := json.Unmarshal(resp, &r); err != nil {\n\t\treturn nil, err\n\t}... | [
"@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 sentence about network configuration:",
"pos": "Represent the Github code about network configuration:",
"neg": "Represent the Github code:"
} |
Fetches a float parameter via :func:`get_string`. | [
"def get_float(strings: Sequence[str],\n prefix: str,\n ignoreleadingcolon: bool = False,\n precedingline: str = \"\") -> Optional[float]:\n \n return get_float_raw(get_string(strings, prefix,\n ignoreleadingcolon=ignoreleadingcolon,\n ... | [
"def value(self, value):\n \n self.client.nowait(\n 'set_field', (Literal('browser'), self.element, value))"
] | codesearchnet | {
"query": "Represent the instruction about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Get the external ids for a specific person id.
@param personId
@return
@throws MovieDbException | [
"public ExternalID getPersonExternalIds(int personId) throws MovieDbException {\n TmdbParameters parameters = new TmdbParameters();\n parameters.add(Param.ID, personId);\n\n URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.EXTERNAL_IDS).buildUrl(parameters);\n String w... | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Documentation:"
} |
// List owned and collaborated apps (excludes team apps). | [
"func (s *Service) AppListOwnedAndCollaborated(ctx context.Context, accountIdentity string, lr *ListRange) (AppListOwnedAndCollaboratedResult, error) {\n\tvar app AppListOwnedAndCollaboratedResult\n\treturn app, s.Get(ctx, &app, fmt.Sprintf(\"/users/%v/apps\", accountIdentity), nil, lr)\n}"
] | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the comment about App development:",
"pos": "Represent the code about App development:",
"neg": "Represent the code:"
} |
Processes a template string into a Template
@param {string} template Mustache template string
@return {Object} Processed template object | [
"function getTemplate(template, options) {\n stack.clear();\n parser.reset();\n\n let opts = typeof options === 'undefined' ? {} : options;\n opts.strict = typeof opts.strict === 'boolean' ? opts.strict : true;\n opts.preserveWhitespace = typeof opts.preserveWhitespace === 'boolean' ? opts.preserveWhitespace :... | [
"function (content) {\n if (content === null)\n throw new Error(\"Can't render null\");\n if (typeof content === 'undefined')\n throw new Error(\"Can't render undefined\");\n\n if ((content instanceof Blaze.View) ||\n (content instanceof Blaze.Template) ||\n (typeof content === 'function'))\n ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
forms process context entry | [
"def daemon_context_entry(process_name,\n classname,\n token,\n exchange=EXCHANGE_UTILS,\n present_on_boxes=None,\n arguments=None,\n queue=None,\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the name of the instantiable subtype of Geometry of which this
geometric object is an instantiable member. The name of the subtype of Geometry is returned as a string.
@return geometry type | [
"public StringExpression geometryType() {\n if (geometryType == null) {\n geometryType = Expressions.stringOperation(SpatialOps.GEOMETRY_TYPE, mixin);\n }\n return geometryType;\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 Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
设置标签名称,如a、input等
@param unknown $tagName | [
"public function setTagName($tagName)\n\t{\n\t\tif(is_string($tagName))\n\t\t{\n\t\t\t$this->tagName = $tagName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->tagName = substr(get_called_class(),4);\n\t\t}\n\t}"
] | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Raw access to cookies | [
"def raw_cookies(self):\n ''''''\n cookie_data = self.environ.get('HTTP_COOKIE', '')\n cookies = SimpleCookie()\n if not cookie_data:\n return cookies\n cookies.load(cookie_data)\n return cookies"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *ServiceAccountList) DeepCopyInto(out *ServiceAccountList) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tout.ListMeta = in.ListMeta\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]ServiceAccount, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Perform an iteration of the approximation loop. | [
"public void iterate() {\n // build covmat out of fitting matrix by multiplying diagonal elements with\n // 1+lambda\n for(int i = 0; i < numfit; i++) {\n System.arraycopy(alpha[i], 0, covmat[i], 0, numfit);\n covmat[i][i] *= (1.0 + lambda);\n }\n // Solve the equation system (Gauss-Jordan)... | [
"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:"
} |
Parse the xml response into an array,
@param Response $response
The xml response.
@return \DOMDocument
The response array.
@throws \Exception | [
"protected function parseResponse(Response $response)\n {\n $xml = new \\DomDocument();\n $xml->loadXML($response->getBody());\n\n return XML2Array::createArray($xml->saveXML());\n }"
] | [
"final public function getArray()\n {\n $res = $this->getArrayInternal();\n if (!$this->isArray($res) && !$this->isArrayObject($res)) {\n $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';\n $errorMessage .= ' Make sure you have provided a v... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software Development:"
} |
/*
sort(input, property = nil)
Sort elements of the array provide optional property with
which to sort an array of hashes or drops | [
"@Override\n public Object apply(Object value, Object... params) {\n\n if (value == null) {\n return \"\";\n }\n\n if(!super.isArray(value)) {\n throw new RuntimeException(\"cannot sort: \" + value);\n }\n\n Object[] array = super.asArray(value);\n ... | [
"function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Ref : https://github.com/nikic/FastRoute/issues/66#issuecomment-130395124 | [
"protected function generateDataList($namedRoute, array $list = []): string\n {\n $routes = $this->parseRoutePattern($namedRoute);\n\n foreach ($routes as $route) {\n $url = '';\n $paramIdx = 0;\n foreach ($route as $part) {\n if (is_string($part)) {\... | [
"public function applyOrderBy(SelectQuery $query)\n {\n foreach ($this->sortColumns as $column => $direction) {\n $query->orderBy(\n $column,\n $direction === Query::SORT_ASC ? SelectQuery::ASC : SelectQuery::DESC\n );\n }\n // @todo Review... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Adds linebreaks only for text that has a newline character. | [
"def linebreaks_safe(value, autoescape=True):\n \n if isinstance(value, string_types) and '\\n' in value:\n return linebreaks_filter(value, autoescape=autoescape)\n\n return value"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
This method puts INDArray to the flow read by parameter server
@param message | [
"private void forwardToParameterServer(INDArrayMessage message) {\n try {\n incomingFlow.accept(message);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Returns and records an alternative according to the following
precedence:
1. An existing alternative
2. A server-chosen alternative | [
"def get_alternative(self, client, dt=None, prefetch=False):\n \n\n if self.is_archived() or self.is_paused():\n return self.control\n\n if self.is_client_excluded(client):\n return self.control\n\n chosen_alternative = self.existing_alternative(client)\n if ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Implementation of ArrayAccess:offsetExists()
@access public
@author Lionel Lecaque <lionel.lecaque@tudor.lu>
@param Object key
@return boolean | [
"public function offsetExists( common_Object $key)\r\n {\r\n $returnValue = (bool) false;\r\n\r\n \r\n $returnValue = isset($this->sequence[$key]);\r\n \r\n\r\n return (bool) $returnValue;\r\n }"
] | [
"final static function s($m, C $c) {return dfcf(function($m, C $c) {\n\t\t/**\n\t\t * 2017-07-19\n\t\t * Unable to reduce the implementation to:\n\t\t * \t\tdf_new(df_con_hier($m, self::class), $c);\n\t\t * because @uses __construct() is protected.\n\t\t * It is similar to @see \\Df\\Payment\\Facade::s()\n\t\t * ht... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Give the field some data and ask it to return a value using one of many
possible modes.
@param mixed $data
@param integer $mode
@param integer $entry_id
@return array|string|null | [
"public function prepareExportValue($data, $mode, $entry_id = null)\n {\n $modes = (object)$this->getExportModes();\n\n $filepath = $this->getFilePath($data['file']);\n\n // No file, or the file that the entry is meant to have no\n // longer exists.\n if (!isset($data['file']) ... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Return IP interface data. | [
"def get_interfaces_ip(self):\n ''''''\n\n def extract_ip_info(parsed_intf_dict):\n '''\n IPv4:\n - Primary IP is in the '<ip>' tag. If no v4 is configured the return value is 'N/A'.\n - Secondary IP's are in '<addr>'. If no secondaries, this field is no... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
// Get the PCI field of the given PGPU. | [
"func (_class PGPUClass) GetPCI(sessionID SessionRef, self PGPURef) (_retval PCIRef, _err error) {\n\t_method := \"PGPU.get_PCI\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertPGPURefToXe... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetChecksum sets the Checksum field's value. | [
"func (s *ArchiveCreationOutput) SetChecksum(v string) *ArchiveCreationOutput {\n\ts.Checksum = &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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Affichage du formulaire d'ajout/édition
@param array $params Paramètres
@return string HTML | [
"public function formulaireActualites($params = array())\n {\n $html = \"\";\n $f = new formGenerator();\n $d = new dateObject();\n $c = new calqueObject();\n $this->addToJsHeader(\"<script>\".$c->getJSScrollHeight().\"</script>\");\n $html ... | [
"void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// goroutine safe | [
"func (p *Processor) Route(msg interface{}, userData interface{}) error {\n\t// raw\n\tif msgRaw, ok := msg.(MsgRaw); ok {\n\t\ti, ok := p.msgInfo[msgRaw.msgID]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"message %v not registered\", msgRaw.msgID)\n\t\t}\n\t\tif i.msgRawHandler != nil {\n\t\t\ti.msgRawHandler([]interf... | [
"func init() {\n\t// take an output from a print function\n\toutput := pio.Wrap(logrus.Errorf)\n\t// register a new printer with name \"logrus\"\n\t// which will be able to read text and print as string.\n\tpio.Register(\"logrus\", output).Marshal(pio.Text)\n\n\t// p := pio.Register(\"logrus\", output).Marshal(pio.... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Get an instance of Api Networkv6 services facade. | [
"def create_api_network_ipv6(self):\n \"\"\"\"\"\"\n\n return ApiNetworkIPv6(\n self.networkapi_url,\n self.user,\n self.password,\n self.user_ldap)"
] | [
"@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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Creates a everyman client based on the configuration parameters.
@return Client | [
"function getClient()\n {\n $transport = $this->getTransport();\n $transport->setAuth($this->username, $this->password);\n\n return new Client($transport);\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
获取简单的句子列表,其中复合词的标签如果是set中指定的话会被拆分为简单词
@param labelSet
@return | [
"public List<List<Word>> getSimpleSentenceList(Set<String> labelSet)\n {\n List<List<Word>> simpleList = new LinkedList<List<Word>>();\n for (Sentence sentence : sentenceList)\n {\n List<Word> wordList = new LinkedList<Word>();\n for (IWord word : sentence.wordList)\n ... | [
"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 text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about text processing:"
} |
Gives highest level possible, independently on any previous level.
@param Experiences $experiences
@return Level | [
"public function toLevel(Experiences $experiences): Level\n {\n $woundsBonus = $this->toWoundsBonus($experiences);\n\n return new Level($this->bonusToLevelValue($woundsBonus), $this);\n }"
] | [
"def creationTime(item):\n \n forThisItem = _CreationTime.createdItem == item\n return item.store.findUnique(_CreationTime, forThisItem).timestamp"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case NAME:\n return is_set_name();\n case PARALLEL:\n return is_set_parallel();\n case TYPE:\n return is_set_type();\n case TASK_IDS:\n retur... | [
"function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Update chart layout (for example if container is resized) | [
"function() {\n if (scope.chart && scope.svg) {\n if (scope.options.chart.type === 'sunburstChart') {\n scope.svg.datum(angular.copy(scope.data)).call(scope.chart);\n } else {\n ... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Make lazy-init proxy function. | [
"def _mkprox(funcname):\n \n\n def prox(*args, **kwargs):\n _init()\n return getattr(_module, funcname)(*args, **kwargs)\n\n return prox"
] | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Execute the console command.
@return void | [
"public function handle()\n {\n if (! $this->confirmToProceed()) {\n return;\n }\n\n $this->migrator->setConnection($this->option('database'));\n\n $this->migrator->reset(\n $this->getMigrationPaths(), $this->option('pretend')\n );\n\n // Once the m... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns a copy of a function.
:param func: The function to copy.
:returns: The copied function. | [
"def copy_func(func: Callable) -> Callable:\n \n copied = types.FunctionType(\n func.__code__, func.__globals__, name=func.__name__,\n argdefs=func.__defaults__, closure=func.__closure__)\n copied = functools.update_wrapper(copied, func)\n copied.__kwdefaults__ = func.__kwdefaults__\n r... | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Creates a matcher that matches when the examined {@linkplain Date} has the given values <code>year</code>, <code>
id</code> and <code>day</code>. | [
"public static Matcher<Date> hasYearMonthAndDay(final int year, final int month, final int day) {\n return new IsDate(year, month, day);\n }"
] | [
"def process_document(self, doc):\n \n member_descriptions = doc.select_segments(\"members[*].description\")\n members = doc.select_segments(\"members[*]\")\n\n ignore_before = datetime.datetime(1890, 1, 1)\n ignore_after = datetime.datetime(2500, 10, 10)\n relative_base = ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Write funding section. There are likely multiple entries.
:param dict d:
:return none: | [
"def __write_funding(self):\n \n self.__reorganize_funding()\n # if funding is empty, insert a blank entry so that it'll still write the empty section on the template.\n if not self.noaa_data_sorted[\"Funding_Agency\"]:\n self.noaa_data_sorted[\"Funding_Agency\"].append({\"gra... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
we provide a function to compute constants instead of accessing window.* as soon as the module needs it so that we do not compute anything if not needed | [
"function getActions ( ) {\n\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled ? {\n start: 'pointerdown',\n move: 'pointermove',... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Dumps statistics.
@param filename: filename where stats will be dumped, filename is
created and must not exist prior to this call.
@type filename: string | [
"def dump(self, filename):\n \n flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL\n fd = os.open(filename, flags, 0o0600)\n os.write(fd, bytes(self.__str__(), locale.getpreferredencoding()))\n os.close(fd)"
] | [
"def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
/* package-local... let's keep ch.vorburger.exec's API separate from Apache Commons Exec, so it
COULD be replaced | [
"CommandLine getCommandLine() {\n if (getWorkingDirectory() == null) {\n if (commonsExecCommandLine.isFile()) {\n File exec = new File(commonsExecCommandLine.getExecutable());\n File dir = exec.getParentFile();\n if (dir == null) {\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 Github summarization about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about programming:"
} |
// Add adds a new function matcher. | [
"func (m *MockMatcher) Add(fn MatchFunc) {\n\tm.Matchers = append(m.Matchers, fn)\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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets the new numerator (number of items done).
Positional arguments:
numerator -- the new numerator to add to the timing data.
Keyword arguments:
calculate -- calculate the ETA and rate by default. | [
"def set_numerator(self, numerator, calculate=True):\n \n # Validate\n if self._timing_data and numerator < self._timing_data[-1][1]:\n raise ValueError('numerator cannot decrement.')\n\n # Update data.\n now = _NOW()\n if self._timing_data and now == self._timin... | [
"def output(ret, bar, **kwargs): # pylint: disable=unused-argument\n '''\n \n '''\n if 'return_count' in ret:\n val = ret['return_count']\n # Avoid to fail if targets are behind a syndic. In this case actual return count will be\n # higher than targeted by MoM itself.\n # TO... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Isolated cloning. Isolated cloning has two versions: shallow and deep (pass `{ deep: true }` in `opt`). Shallow cloning simply clones the cell and returns a new cell with different ID. Deep cloning clones the cell and all its embedded cells recursively. | [
"function(opt) {\n\n opt = opt || {};\n\n if (!opt.deep) {\n // Shallow cloning.\n\n var clone = Backbone.Model.prototype.clone.apply(this, arguments);\n // We don't want the clone to have the same ID as the original.\n clone.set('id', joint.util.uuid());\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Enables/disables aggresive linksearch
@param bool $mode
@return bool | [
"public function enableAggressiveLinkSearch($mode)\r\n {\r\n if (!is_bool($mode)) return false;\r\n \r\n $this->LinkFinder->aggressive_search = $mode;\r\n return true;\r\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Get the in-RAM zonefile inventory vector.
offset and length are in *bytes* | [
"def atlas_get_zonefile_inventory( offset=None, length=None ):\n \n global ZONEFILE_INV, ZONEFILE_INV_LOCK\n\n with ZONEFILE_INV_LOCK:\n try:\n assert ZONEFILE_INV is not None\n except AssertionError:\n log.error(\"FATAL: zonefile inventory not loaded\")\n os.... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
add() with reordered paameters | [
"def add2(self, target, path_settings, method):\n \n return self.add(method, path_settings, target)"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Validates request and, if the request is approved, returns a list of allowed uses for an automatically created IBMer IaaS account. | [
"func (r Account_Internal_Ibm) GetAccountTypes() (resp []string, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Account_Internal_Ibm\", \"getAccountTypes\", nil, &r.Options, &resp)\n\treturn\n}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the sentence about Access control:",
"pos": "Represent the code about Access control:",
"neg": "Represent the code:"
} |
Call compute actions on observation batches to get next actions.
Returns:
eval_results: dict of policy to compute_action() outputs. | [
"def _do_policy_eval(tf_sess, to_eval, policies, active_episodes):\n \n\n eval_results = {}\n\n if tf_sess:\n builder = TFRunBuilder(tf_sess, \"policy_eval\")\n pending_fetches = {}\n else:\n builder = None\n\n if log_once(\"compute_actions_input\"):\n logger.info(\"Inputs... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds the paths of the turtle to an existing svg container. | [
"def addTurtlePathToSVG(self, svgContainer):\n \n for element in self.getSVGElements():\n svgContainer.addElement(element)\n return svgContainer"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set the query part of the URL
@param QueryString|string|array $query Query to set
@return Url | [
"public function setQuery($query)\n {\n if (is_string($query)) {\n $output = null;\n parse_str($query, $output);\n $this->query = new QueryString($output);\n } elseif (is_array($query)) {\n $this->query = new QueryString($query);\n } elseif ($query... | [
"def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
获取数据.
@param array $con 条件.
@param string $db 数据库
@param \wulaphp\router\UrlParsedInfo $pageInfo 分页信息
@param array $tplvars 模板变量.
@return CtsData 数据. | [
"public final function getList($con, $db, $pageInfo, $tplvars) {\n try {\n $dbx = App::db($db);\n\n $data = $this->getData($con, $dbx, $pageInfo, $tplvars);\n if ($data instanceof CtsData) {\n return $data;\n }\n } catch (\\Exception $e) {\n\n... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return list of automation members
:param offset: Pagination offset.
:param limit: Pagination limit.
:param api: sevenbridges Api instance.
:return: AutomationMember collection | [
"def get_members(self, offset=None, limit=None, api=None):\n \n api = api or self._API\n return AutomationMember.query(\n automation=self.id, offset=offset, limit=limit, api=api\n )"
] | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Retrieve session lifetime
@param \Doctrine_Record $record
@return int | [
"public function _getLifetime(\\Doctrine_Record $record)\n {\n $return = $this->_lifetime;\n\n if (!$this->_overrideLifetime) {\n $return = (int) $record->{$this->_lifetimeColumn};\n }\n\n return $return;\n }"
] | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Documentation:"
} |
Sets current col/row to valid(empty) pos after addCell/Table
@param aLocation a location in the Table | [
"private void setCurrentLocationToNextValidPosition(Point aLocation) {\n // set latest location to next valid position\n int i, j;\n i = aLocation.x;\n j = aLocation.y;\n do {\n if ( (j + 1) == columns ) { // goto next row\n i++;\n j... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Rolls a dice in NdN format. | [
"async def roll(ctx, dice: str):\n \"\"\"\"\"\"\n try:\n rolls, limit = map(int, dice.split('d'))\n except Exception:\n await ctx.send('Format has to be in NdN!')\n return\n\n result = ', '.join(str(random.randint(1, limit)) for r in range(rolls))\n await ctx.send(result)"
] | [
"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:"
} |
// Returns a list of Invoice Items for the specified Customer ID, at the
// specified range.
//
// see https://stripe.com/docs/api#list_invoiceitems | [
"func (self *InvoiceItemClient) CustomerListN(id string, count int, offset int) ([]*InvoiceItem, error) {\n\treturn self.list(id, count, offset)\n}"
] | [
"def customer_source_webhook_handler(event):\n\t\n\tcustomer_data = event.data.get(\"object\", {})\n\tsource_type = customer_data.get(\"object\", {})\n\n\t# TODO: handle other types of sources (https://stripe.com/docs/api#customer_object-sources)\n\tif source_type == SourceType.card:\n\t\tif event.verb.endswith(\"d... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Run the receiver thread | [
"def run(self):\n \n\n while (True):\n if (self.sp):\n break\n try:\n # Blocking until USB data available\n data = self.cfusb.receive_packet()\n if len(data) > 0:\n pk = CRTPPacket(data[0], list(data[1... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.