query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Connect to the database using the constructor parameter and attributes that were collected prior to triggering connection to the database. @return null
[ "private function connect () {\n if ($this->isConnected()) {\n return;\n }\n\n parent::__construct(\n $this->data_source->getDSN(),\n $this->data_source->getUser(),\n $this->data_source->getPassword(),\n $this->data_source->getDriverOptions...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Creates a simple animation backend that cycles through a list of colors. @return the backend to use
[ "public static AnimationBackend createSampleColorAnimationBackend(Resources resources) {\n // Get the animation duration in ms for each color frame\n int frameDurationMs = resources.getInteger(android.R.integer.config_mediumAnimTime);\n // Create and return the backend\n return new ExampleColorBackend(S...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/*[deutsch] <p>Konvertiert ein beliebiges Datumsintervall zu einem Intervall dieses Typs. </p> @param interval any kind of date interval @return DateInterval @since 3.28/4.24
[ "public static DateInterval from(ChronoInterval<PlainDate> interval) {\n\n if (interval instanceof DateInterval) {\n return DateInterval.class.cast(interval);\n } else {\n return new DateInterval(interval.getStart(), interval.getEnd());\n }\n\n }" ]
[ "@Given(\"ich habe eine Aktion mit dem Symbol $sümbol und eine Schwelle von $threshold\")\n public void aStock(@Named(\"sümbol\") String symbol, @Named(\"threshold\") double threshold) {\n stock = new Stock(symbol, threshold);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Value prepares the nullable term for the database
[ "func (term Range) Value() (driver.Value, error) {\n\tif term.IsZero() {\n\t\treturn \"[,]\", nil\n\t}\n\tif term.Start.IsZero() {\n\t\treturn fmt.Sprintf(\"[,'%s']\", term.End), nil\n\t}\n\tif term.End.IsZero() {\n\t\treturn fmt.Sprintf(\"['%s',]\", term.Start), nil\n\t}\n\treturn fmt.Sprintf(\"['%s','%s']\", term...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Update an external account @param resource_root: The root Resource object. @param account: Account to update, account name must be specified. @return: An ApiExternalAccount object, representing the updated external account
[ "def update_external_account(resource_root, account):\n \n return call(resource_root.put,\n EXTERNAL_ACCOUNT_PATH % (\"update\",),\n ApiExternalAccount, False, data=account)" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Unregister a listener for publication events. @param listener The handler to unregister
[ "public void removeItemEventListener(@SuppressWarnings(\"rawtypes\") ItemEventListener listener) {\n StanzaListener conListener = itemEventToListenerMap.remove(listener);\n\n if (conListener != null)\n pubSubManager.getConnection().removeSyncStanzaListener(conListener);\n }" ]
[ "public void away (ClientObject caller, String message)\n {\n BodyObject body = _locator.forClient(caller);\n // we modify this field via an invocation service request because a body object is not\n // modifiable by the client\n body.setAwayMessage(message);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Assert the build outcome @param [Boolean] success True if the build should succeed @param [Array] warnings The warnings expected
[ "def assert_build_result(success, warnings)\n success ? assert_no_error_occurred : assert_error_occurred\n warnings.each do |code|\n expect_warning(code, :warning_only => true)\n end\n end" ]
[ "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 Github post about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see mtas.search.spans.util.MtasSpanQuery#rewrite(org.apache.lucene.index. IndexReader)
[ "@Override\n public MtasSpanQuery rewrite(IndexReader reader) throws IOException {\n MtasSpanQuery newQ1 = (MtasSpanQuery) q1.rewrite(reader);\n MtasSpanQuery newQ2 = (MtasSpanQuery) q2.rewrite(reader);\n if (!newQ1.equals(q1) || !newQ2.equals(q2)) {\n return new MtasSpanNotQuery(newQ1, newQ2).rewrit...
[ "public static GroupAnalyzer createGroupAnalyzer(AreaImpl root)\n {\n //return new org.fit.segm.grouping.op.GroupAnalyzerByGrouping(root);\n //return new org.fit.segm.grouping.op.GroupAnalyzerBySeparators(root);\n //return new org.fit.segm.grouping.op.GroupAnalyzerByGroupingAndSeparators(roo...
codesearchnet
{ "query": "Represent the Github comment about org.archive.wayback.resourceindex:", "pos": "Represent the Github code about org.archive.wayback.resourceindex:", "neg": "Represent the Github code about Deep Learning:" }
Search for a resource.
[ "public IOProvider.Readable getIOProviderFrom(String name, AbstractClassLoader first) {\r\n\t\tif (name.length() == 0) return null;\r\n\t\tif (name.charAt(0) == '/') name = name.substring(1);\r\n\t\tIOProvider.Readable provider = null;\r\n \t// try with the first one\r\n \tif (first != null)\r\n \t\t\tprovi...
[ "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:" }
The class constructor. You need to supply your instance of madlib-settings @function constructor @params settings {Object} madlib-settings instance @return None
[ "function HostMapping(settings) {\n settings.init(\"hostConfig\", {});\n settings.init(\"hostMapping\", {});\n settings.init(\"xdmConfig\", {});\n this.settings = settings;\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Set validates a Ulimit and sets its name as a key in UlimitOpt
[ "func (o *UlimitOpt) Set(val string) error {\n\tl, err := units.ParseUlimit(val)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t(*o.values)[l.Name] = l\n\n\treturn nil\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
//IntQueryParameter returns the value of the query parameter name with a //default value of def. The default value is used if either the parameter //is not present, or cannot be parsed as an int.
[ "func (self *simplePBundle) IntQueryParameter(name string, def int64) int64 {\n\traw, ok := self.Query(name)\n\tif !ok {\n\t\treturn def\n\t}\n\ti, err := strconv.ParseInt(raw, 10, 64)\n\tif err != nil {\n\t\treturn def\n\t}\n\treturn i\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 Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software Development:" }
Read a nested table. Instantiates the supplied reader class to extract the data. @param reader table reader class @return table rows
[ "public List<MapRow> readTable(TableReader reader) throws IOException\n {\n reader.read();\n return reader.getRows();\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Dereferences RefObjects stuck in the hierarchy. This is a bit of an ugly hack.
[ "def dereference(self, data, host=None):\n \"\"\"\"\"\"\n return self.deep_decode(self.deep_encode(data, host), deref=True)" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
/* Skips bytes of input data blocking until all bytes are skipped. Does not assume that the input stream is capable of seeking.
[ "protected void skipBytes(InputStream in, int n) throws IOException { // IA VISIBILITY CHANGE FOR SUBCLASS USE\r\n while (n > 0) {\r\n int len = in.read(tmpbuf, 0, n < tmpbuf.length ? n : tmpbuf.length);\r\n if (len == -1) {\r\n throw new EOFException();\r\n }\...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
Operation getServersAsync @param string $org_id Organization ID (optional) @param string $name Server name (optional) @throws \InvalidArgumentException @return \GuzzleHttp\Promise\PromiseInterface
[ "public function getServersAsync($org_id = null, $name = null)\n {\n return $this->getServersAsyncWithHttpInfo($org_id, $name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }" ]
[ "public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about PHP:" }
@param QueryRelate $queryRelate @param AbstractRepository $repository @return QueryRelate
[ "public function magic(QueryRelate $queryRelate, AbstractRepository $repository): QueryRelate\n {\n // 版本兼容,下个大版本直接删除\n if (method_exists($this, 'magicSearch')) {\n return $this->magicSearch($this->data, $queryRelate);\n }\n\n return $this->dispatch($this->filter($this->gua...
[ "public function entityIdFrom(IEntitySet $entities) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder($this->type(new ObjectIdType(new EntityIdOptions($entities))));\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns the TextFSMValue object natching the requested name.
[ "def _GetValue(self, name):\n \"\"\"\"\"\"\n for value in self.values:\n if value.name == name:\n return value" ]
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
If not already created, a new <code>bean</code> element will be created and returned. Otherwise, the first existing <code>bean</code> element will be returned. @return the instance defined for the element <code>bean</code>
[ "public BeanType<ConstraintMappingsType<T>> getOrCreateBean()\n {\n List<Node> nodeList = childNode.get(\"bean\");\n if (nodeList != null && nodeList.size() > 0)\n {\n return new BeanTypeImpl<ConstraintMappingsType<T>>(this, \"bean\", childNode, nodeList.get(0));\n }\n return cre...
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n XMLEncoder xmlOut = (XMLEncoder)out;\n ControlBean control = (ControlBean)oldInstance;\n\n //\n // If processing a nested control, then use the parent bean's context as the\n // constructor context\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Convert_core_ComponentCondition_To_v1_ComponentCondition is an autogenerated conversion function.
[ "func Convert_core_ComponentCondition_To_v1_ComponentCondition(in *core.ComponentCondition, out *v1.ComponentCondition, s conversion.Scope) error {\n\treturn autoConvert_core_ComponentCondition_To_v1_ComponentCondition(in, out, s)\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Convert to the next higher level summary level
[ "def promote(self, level=None):\n \"\"\"\"\"\"\n\n if level is None:\n\n if len(self.fields) < 2:\n if self.level in ('region', 'division', 'state', 'ua'):\n cls = self.get_class('us')\n else:\n return None\n els...
[ "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:" }
creates matching route @param \stubbles\webapp\routing\CalledUri $calledUri @param \stubbles\webapp\routing\Route $route @return \stubbles\webapp\routing\ResolvingResource
[ "private function resolveResource(CalledUri $calledUri, Route $route): ResolvingResource\n {\n return new ResolvingResource(\n $this->injector,\n $calledUri,\n $this->collectInterceptors($calledUri, $route),\n $this->supportedMimeTypes($route),\n...
[ "public function setupMappingDefinition(\\n2n\\web\\dispatch\\map\\bind\\MappingDefinition $md) {\r\n\t\t$this->decorated->setupMappingDefinition($md);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Processes general help with no specific command requested. @param at table to add help information to @param toHelp the command to help with
[ "protected void specificHelp(AsciiTable at, String toHelp){\n\t\tif(this.skbShell.getCommandMap().containsKey(toHelp)){\n\t\t\t//we have a command to show help for, collect all information and present help\n\t\t\tSkbShellCommand ssc = this.skbShell.getCommandMap().get(toHelp).getCommands().get(toHelp);\n\t\t\tTreeM...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
set cookie from result of handler to HttpServletResponse @param result return object of handler @param response HttpServletResponse
[ "@SuppressWarnings(\"unchecked\")\n\tprivate void setCookie(NativeObject result, HttpServletResponse response) {\n\t\tMap<String, String> cookieMap = ScriptableObject.getTypedProperty(\n\t\t\t\tresult, \"cookie\", Map.class);\n\t\tif (cookieMap == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tIterator<Entry<String, String>>...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Renders source code with highlight.js @example $scope.foo = "var bar = 'baz';"; // <source ng-model="foo" lang="js"></source>
[ "function code($window) {\n return {\n restrict: 'E',\n require: '?ngModel',\n /**\n *\n * @param {$rootScope.Scope} scope Element Scope\n * @param {angular.element} element AngularJS element\n * @param {$compile.directive.Attributes} attrs AngularJS Attributes object\n ...
[ "function render(code, data) {\n var js = '```js' + code + '```'\n return `<div class=\"vomit-snippet\"><div class=\"column\">${marked(js)}</div><div class=\"column\"><script>\n(function() {${code}document.currentScript.parentElement.appendChild(component(${JSON.stringify(data.data)}))\n})()</script></div></div>`...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Find the index of the previous clear bit less than or equal to i. @param i starting index @return index of the previous clear bit
[ "public int prevClearBit(final int i) {\n int x = i >> 6; // i / 64 with sign extension\n long w = ~bitmap.get(x);\n w <<= 64 - i - 1;\n if (w != 0L) {\n return i - Long.numberOfLeadingZeros(w);\n }\n for (--x; x >= 0; --x) {\n long map = ~bitmap.get(x);\n if (map != 0L) {\n ...
[ "int blockForReadSpace(int readLocation) {\n\n // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.\n final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;\n\n // in the for loop below, we are blocked reading unit another ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
/* (non-Javadoc) @see org.joml.Vector3ic#sub(org.joml.Vector3ic, org.joml.Vector3i)
[ "public Vector3i sub(Vector3ic v, Vector3i dest) {\n dest.x = x - v.x();\n dest.y = y - v.y();\n dest.z = z - v.z();\n return dest;\n }" ]
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
K-Means initialization using k-means|| This is algorithm 2 in Scalable K-Means++ (2012).
[ "def init_scalable(\n X, n_clusters, random_state=None, max_iter=None, oversampling_factor=2\n):\n \n\n logger.info(\"Initializing with k-means||\")\n # Step 1: Initialize Centers\n idx = 0\n centers = da.compute(X[idx, np.newaxis])[0]\n c_idx = {idx}\n\n # Step 2: Initialize cost\n cost,...
[ "def path_from_structure(cls, ndivsm, structure):\n \"\"\"\"\"\"\n return cls._path(ndivsm, structure=structure, comment=\"K-path generated automatically from structure\")" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Answers an array of options for the background field. @return array
[ "public function getBackgroundOptions()\n {\n return [\n self::BG_PRIMARY => _t(__CLASS__ . '.PRIMARY', 'Primary'),\n self::BG_LIGHT => _t(__CLASS__ . '.LIGHT', 'Light'),\n self::BG_DARK => _t(__CLASS__ . '.DARK', 'Dark')\n ];\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Move forward to next leaf.
[ "public function next()\n {\n if (is_null($this->current)) {\n $this->current = current($this->children);\n\n return;\n }\n if ($this->current instanceof RecursiveLeafInterface) {\n $this->current->next();\n if ($this->current->valid()) {\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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
pun not intended # TODO: record iteration times for analysis # TODO Incorporate this better # FIXME; pad_stdout into subfunctions import dis dis.dis(ut.ProgressIter.iter_rate)
[ "def iter_rate(self):\n \n #class IterState(object):\n # def __init__(state):\n # state.freq = 1\n # state.freq = 1\n # pass\n adjust = self.autoadjust\n self._cursor_at_newline = not self.backspace\n # SETUP VARIABLES\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 sentence about Deep Learning:", "pos": "Represent the code about Deep Learning:", "neg": "Represent the code about Software development:" }
Stuff property into generic `property` key.
[ "function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var from;\n var isBoolean;\n var isNumber;\n var to;\n\n if (this.waitComponentInitRawProperty(this.updateConfigForDefault)) {\n return;\n }\n\n if (data.from === '') {\n // Infer from.\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Translates day of week number to a string. @param integer $day The numeric day of the week. @param boolean $abbr Return the abbreviated day string? @return string The day of the week.
[ "public function dayToString($day, $abbr=false)\n {\n switch ($day)\n {\n case 0:\n return $abbr ? $this->translate('DAY_SUN') : $this->translate('DAY_SUNDAY');\n case 1:\n return $abbr ? $this->translate('DAY_MON') : $this->translate('DAY_MONDAY');\n case 2:\n return $abb...
[ "function _is_format_valid($date)\n {\n\n // the format we expect the date to be\n // escape characters that would make sense as regular expression\n $format = preg_quote($this->attributes['format']);\n\n // parse the format and extract the characters that define the format\n /...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Read a decimal according to the Four Dot Four encoding specification. @param bb ByteBuffer containing Export stream data @return decoded BigDecimal value
[ "static public BigDecimal decodeDecimal(final ByteBuffer bb) {\n final int scale = bb.get();\n final int precisionBytes = bb.get();\n final byte[] bytes = new byte[precisionBytes];\n bb.get(bytes);\n return new BigDecimal(new BigInteger(bytes), scale);\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
when you "except Exception as e", give me the e and I'll give you a string.
[ "def exceptionToString(e,silent=False):\n \"\"\"\"\"\"\n exc_type, exc_obj, exc_tb = sys.exc_info()\n s=(\"\\n\"+\"=\"*50+\"\\n\")\n s+=\"EXCEPTION THROWN UNEXPECTEDLY\\n\"\n s+=\" FILE: %s\\n\"%os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]\n s+=\" LINE: %s\\n\"%exc_tb.tb_lineno\n s+=\...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
get code map with path from node
[ "function getCodeMap(node) {\n const code_map = node.toStringWithSourceMap();\n\n // patch\n node.walkSourceContents(function (sourceFile, sourceContent) {\n if (!code_map.map._sources.has(sourceFile)) {\n code_map.map._sources.add(sourceFile);\n }\n });\n\n return code_map;\...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Given a path and an index, reads a Segment from the path and updates the index. @param string $path @param int $index @return Segment @throws ValidationException
[ "private static function parseSegmentFromPath($path, &$index)\n {\n if ($index >= strlen($path)) {\n // A trailing '/' has caused the index to exceed the bounds\n // of the string - provide a helpful error message.\n throw self::parseError($path, strlen($path) - 1, \"inval...
[ "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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Documentation:" }
* Reading a single workorder. @param {string} workorderId - The ID of the workorder to read
[ "function read(workorderId) {\n var donePromise = mediator.promise(workorderSyncSubscribers.getTopic(CONSTANTS.TOPICS.READ, CONSTANTS.DONE_PREFIX, workorderId));\n\n var errorPromise = mediator.promise(workorderSyncSubscribers.getTopic(CONSTANTS.TOPICS.READ, CONSTANTS.ERROR_PREFIX, workorderId));\n\n mediator.pu...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Compares local revision to the remote one and builds files to upload and delete @throws Exception if unknown git diff status @return string
[ "public function compare()\n {\n $remoteRevision = null;\n $filesToUpload = array();\n $filesToDelete = array();\n\n // The revision file goes inside the submodule.\n if ($this->isSubmodule) {\n $this->revisionFile = $this->isSubmodule . '/' . $this->revisionFile;\n ...
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Writes single scalar value to Tensorboard.
[ "def _write_scalar(self, name:str, scalar_value, iteration:int)->None:\n \"\"\n tag = self.metrics_root + name\n self.tbwriter.add_scalar(tag=tag, scalar_value=scalar_value, global_step=iteration)" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Implement a DELETE request and return output @param string $url @param array $httpHeaders @return string
[ "public static function delete($url, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n return self::processRequest($ch);\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Creates new bucket with the specified options. @param string $bucketName name of the bucket @param array $options bucket options in format: "name" => "value" @throws Exception @throws \yii\base\InvalidConfigException
[ "public function createBucket($bucketName, $options = [])\n {\n $this->beginProfile($token = \" > create bucket $bucketName ...\");\n\n $this->db->createBucket($bucketName, $options);\n\n $this->endProfile($token);\n }" ]
[ "public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about PHP:" }
Clears cache, regenerates all proxy classes, and updates metadatas in all entity managers
[ "public function refreshEntities()\n {\n\n $metadatas = $this->clearCacheAndProxies();\n\n // Finally, we update the schema\n $tool = new SchemaTool($this->entityManager);\n $tool->updateSchema($metadatas, true);\n }" ]
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github text about Technology:", "pos": "Represent the Github code about Technology:", "neg": "Represent the Github code:" }
Turns this partial function into a plain function returning an Option result. @return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise.
[ "public F0<Option<R>> lift() {\n final F0<R> me = this;\n return new F0<Option<R>>() {\n @Override\n public Option<R> apply() {\n try {\n return some(me.apply());\n } catch (RuntimeException e) {\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// lexString consumes the inner contents of a string. It assumes that the // beginning '"' has already been consumed and ignored.
[ "func lexString(lx *lexer) stateFn {\n\tr := lx.next()\n\t//u.Infof(\"lexString r = %v\", string(r))\n\tswitch {\n\tcase r == '\\\\':\n\t\treturn lexStringEscape\n\t// Termination of non-quoted strings\n\tcase lx.isEnd(lx, r):\n\t\tlx.backup()\n\t\tif lx.isBool() {\n\t\t\tlx.emit(itemBool)\n\t\t} else {\n\t\t\tlx....
[ "function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// AssertCertificateHasClientAuthUsage is a utility function for kubeadm testing that asserts if a given certificate has // the expected ExtKeyUsageClientAuth
[ "func AssertCertificateHasClientAuthUsage(t *testing.T, cert *x509.Certificate) {\n\tfor i := range cert.ExtKeyUsage {\n\t\tif cert.ExtKeyUsage[i] == x509.ExtKeyUsageClientAuth {\n\t\t\treturn\n\t\t}\n\t}\n\tt.Error(\"cert has not ClientAuth usage as expected\")\n}" ]
[ "func (o *SAControllerOptions) AddFlags(fs *pflag.FlagSet) {\n\tif o == nil {\n\t\treturn\n\t}\n\n\tfs.StringVar(&o.ServiceAccountKeyFile, \"service-account-private-key-file\", o.ServiceAccountKeyFile, \"Filename containing a PEM-encoded private RSA or ECDSA key used to sign service account tokens.\")\n\tfs.Int32Va...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Compiles a route string to a regular expression @param string $route The route string to compile @return string
[ "protected function compileRoute($route)\n {\n // First escape all of the non-named param (non [block]s) for regex-chars\n $route = preg_replace_callback(\n static::ROUTE_ESCAPE_REGEX,\n function ($match) {\n return preg_quote($match[0]);\n },\n ...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns number of updates from all {@link #results()}. @return number of updates from all {@link #results()}.
[ "public int numberOfUpdates() {\n final Integer cachedValue = numberOfUpdatesCache;\n\n if (cachedValue != null) {\n return cachedValue;\n }\n\n int numberOfUpdates = 0;\n\n for (T object : results.keySet()) {\n final PutResult putResult = results.get(object)...
[ "public MultipleDataProviderContext<DPO> read(Collection<DataProvider<DPO>> dataProviders) {\n if (dataProviders != null) {\n addedDataProviders.addAll(dataProviders);\n }\n\n // Stay in the same context and re-use the same instance because no type has changed\n return this;\n...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// SetStatus sets the Status field's value.
[ "func (s *UserPoolType) SetStatus(v string) *UserPoolType {\n\ts.Status = &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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@function requireValidSchema validate schema argument @param {object} schema @returns {object} @throws {Error}
[ "function requireValidSchema (schema) {\n // throw error on invalid schema object\n assert.equal(typeof schema, 'object', 'schema must be object')\n assert.equal(typeof schema.columns, 'object', 'schema columns must be object')\n assert.ok(Array.isArray(schema.indexes), 'schema indexes must be array')\n...
[ "function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
It generates an unique UID between the current IP and the user agent. @return string
[ "private function genUID() {\n // HTTP_CLIENT_IP and HTTP_X_FORWARDE‌​D_FOR can be forged.\n // REMOTE_ADDR is the same for all clients connected to a proxy.\n $ip=@$_SERVER['HTTP_CLIENT_IP'].@$_SERVER['HTTP_X_FORWARDE‌​D_FOR'].@$_SERVER['REMOTE_ADDR'];\n // HTTP_USER_AGENT could be forg...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Create a new child {@code Context}. The name must not contain any slashes ({@code '/'}). @throws IllegalArgumentException if a child or key-value pair with the given @{code name} exists.
[ "public Context createChild(String name) {\n Preconditions.checkArgument(name.indexOf('/') == -1, \"name must not contain a slash\");\n Preconditions.checkArgument(!children.containsKey(name), \"child with name '%s' already exists\", name);\n Preconditions.checkArgument(!values.containsKey(name...
[ "@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Checks whether the header can be safely interpreted as data. This is used for the auto header detection. @param state the state of the parser @param headerTokens the header @return true if header should be handled as data
[ "private boolean isFirstLineData(State state, List<String> headerTokens) {\r\n // Check whether the type of the header match the type of the following data\r\n boolean headerCompatible = true;\r\n // Check whether if all types where strings\r\n boolean allStrings = true;\r\n for (...
[ "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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// SetDeferMaintenanceStartTime sets the DeferMaintenanceStartTime field's value.
[ "func (s *ModifyClusterMaintenanceInput) SetDeferMaintenanceStartTime(v time.Time) *ModifyClusterMaintenanceInput {\n\ts.DeferMaintenanceStartTime = &v\n\treturn s\n}" ]
[ "@ManagedAttribute(\n description = \"Number of seconds since cache started\",\n displayName = \"Seconds since cache started\",\n units = Units.SECONDS,\n measurementType = MeasurementType.TRENDSUP,\n displayType = DisplayType.SUMMARY\n )\n @Deprecated\n public long get...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Transforms raw HADS observations into a dict: station code -> [(variable, time, value), ...] Takes into account the var filter (if set).
[ "def _parse_data(self, raw_data, var_filter, time_extents):\n \n\n retval = defaultdict(list)\n p = parser()\n\n begin_time, end_time = time_extents\n\n for line in raw_data.splitlines():\n if len(line) == 0:\n continue\n\n fields = line.split(...
[ "def _timeseries_component(self, series):\n \n # this is only called if the set_component function recognizes a pandas series\n # Todo: raise a warning if extrapolating from the end of the series.\n return lambda: np.interp(self.time(), series.index, series.values)" ]
codesearchnet
{ "query": "Represent the instruction about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code:" }
// GetLocation returns the path and hash of the browsers location api else panics if not in a browser
[ "func GetLocation() (string, string) {\n\tpanicBrowserDetect()\n\tloc := js.Global.Get(\"location\")\n\tpath := loc.Get(\"pathname\").String()\n\thash := loc.Get(\"hash\").String()\n\treturn path, hash\n}" ]
[ "function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu...
codesearchnet
{ "query": "Represent the summarization about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
Creates a model type @class @param {string} name - name of the model @param {string} prefix - file name prefix associated with the model
[ "function ModelType(name, prefix, endp) {\n this.name = name;\n this.prefix = prefix;\n this.endp = endp;\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Check if references are in this file only If yes then select all references
[ "function handleFindRefs (refsResp) {\n if (!refsResp || !refsResp.references || !refsResp.references.refs) {\n return;\n }\n\n var inlineWidget = EditorManager.getFocusedInlineWidget(),\n editor = EditorManager.getActiveEditor(),\n refs ...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param string $name @param ClauseStrategy $query @return $this
[ "public function setClause(string $name, ClauseStrategy $query)\n {\n $this->clauses[$name] = $query;\n\n return $this;\n }" ]
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Establish a queue connection. @param array $config @return Queue
[ "public function connect(array $config)\n\t{\n\t\t$pheanstalk = new Pheanstalk($config['host'], Arr::get($config, 'port', PheanstalkInterface::DEFAULT_PORT));\n\n\t\treturn new BeanstalkdQueue(\n\t\t\t$pheanstalk, $config['queue'], Arr::get($config, 'ttr', Pheanstalk::DEFAULT_TTR)\n\t\t);\n\t}" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Get cached files for anime.
[ "def get_files(conn, aid: int) -> AnimeFiles:\n \"\"\"\"\"\"\n with conn:\n cur = conn.cursor().execute(\n 'SELECT anime_files FROM cache_anime WHERE aid=?',\n (aid,))\n row = cur.fetchone()\n if row is None:\n raise ValueError('No cached files')\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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// WriteRPCResponse pushes a response to the writeChan, and blocks until it is accepted. // It implements WSRPCConnection. It is Goroutine-safe.
[ "func (wsc *wsConnection) WriteRPCResponse(resp types.RPCResponse) {\n\tselect {\n\tcase <-wsc.Quit():\n\t\treturn\n\tcase wsc.writeChan <- resp:\n\t}\n}" ]
[ "func (e *endpoint) Attach(dispatcher stack.NetworkDispatcher) {\n\te.dispatcher = dispatcher\n\t// Link endpoints are not savable. When transportation endpoints are\n\t// saved, they stop sending outgoing packets and all incoming packets\n\t// are rejected.\n\tgo e.dispatchLoop()\n}" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Save translate. @param string $identification @param $message @param null $idLocale @return string @throws \Dibi\Exception
[ "protected function saveTranslate(string $identification, $message, $idLocale = null): string\n {\n $values = [\n 'id_locale' => $idLocale ?: $this->locale->getIdDefault(), // linked to locale\n 'id_ident' => $this->getIdIdentification($identification), // linked to indentity\n ...
[ "public static function backwardsCompatibility(&$oBindTo)\n {\n // @todo (Pablo - 2017-06-07) - Remove these\n $oBindTo->db = Factory::service('Database');\n $oBindTo->encrypt = Factory::service('Encrypt');\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Sets the common default attributes of the elements @return $this The current instance for a fluent interface.
[ "protected function setDefaults()\n {\n $this->setBankLeftAttr(3, 8, 50, 4);\n $this->setBankRightAttr(66, 8, 50, 4);\n $this->setRecipientLeftAttr(3, 23, 50, 4);\n $this->setRecipientRightAttr(66, 23, 50, 4);\n $this->setAccountLeftAttr(27, 43, 30, 4);\n $this->setAccou...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// Return the timestamp of the header
[ "func (h *VHDHeader) TimestampTime() time.Time {\n\ttstamp := binary.BigEndian.Uint32(h.Timestamp[:])\n\treturn time.Unix(int64(946684800+tstamp), 0)\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 Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Return Singleton instance.
[ "public static function getInstance() {\n\n\t\tif( !isset( self::$instance ) ) {\n\n\t\t\tself::$instance\t= new CoreProperties();\n\n\t\t\tself::$instance->init( CoreGlobal::CONFIG_CORE );\n\t\t}\n\n\t\treturn self::$instance;\n\t}" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
// Index renders our ../templates/index.qtpl file using the compiled ../templates/index.qtpl.go file.
[ "func Index(ctx iris.Context) {\n\ttmpl := &templates.Index{}\n\n\t// render the template\n\tExecuteTemplate(ctx, tmpl)\n}" ]
[ "def index():\n \n # Reset current index values when the page is refreshed\n for k, v in current_index.items():\n current_index[k] = 0\n\n logging.info(\"Dashboard refreshed\")\n\n # render the template (below) that will use JavaScript to read the stream\n return render_template(\"crystal_d...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
return the system info with the given name. @param string $sShopInfoName - internal name of the info record @return TdbShopSystemInfo
[ "public function GetShopInfo($sShopInfoName)\n {\n $oInfo = TdbShopSystemInfo::GetNewInstance();\n if (!$oInfo->LoadFromFields(array('shop_id' => $this->id, 'name_internal' => $sShopInfoName))) {\n $oInfo = null;\n }\n\n return $oInfo;\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Get the nn-th value and return it as int. Return 0 if value is NULL or // conversion is impossible.
[ "func (tr Row) ForceInt(nn int) (val int) {\n\tval, _ = tr.IntErr(nn)\n\treturn\n}" ]
[ "def _append(lst, indices, value):\n \n for i, idx in enumerate(indices):\n # We need to loop because sometimes indices can increment by more than 1 due to missing tokens.\n # Example: Sentence with no words after filtering words.\n while len(lst) <= idx:\n # Update max counts ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// IsEqualName compares the value type name with one name.
[ "func IsEqualName(val reflect.Value, tname string) bool {\n\treturn nameof(val.Type()) == tname\n}" ]
[ "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:" }
Get json raw body data @author Adeyemi Olaoye <yemi@cottacush.com> @param bool|false $assoc @return array|bool|stdClass
[ "public function getPostData($assoc = false)\n {\n $postData = $this->request->getJsonRawBody($assoc);\n\n if (!is_object($postData) && !$assoc) {\n return new stdClass();\n }\n\n if (!is_array($postData) && $assoc) {\n return [];\n }\n\n return $po...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Delete an existing mailbox in server REST: DELETE /email/domain/{domain}/account/{accountName} @param domain [required] Name of your domain name @param accountName [required] Name of account
[ "public OvhTaskPop domain_account_accountName_DELETE(String domain, String accountName) throws IOException {\n\t\tString qPath = \"/email/domain/{domain}/account/{accountName}\";\n\t\tStringBuilder sb = path(qPath, domain, accountName);\n\t\tString resp = exec(qPath, \"DELETE\", sb.toString(), null);\n\t\treturn co...
[ "function validateUrl(url, hostname, service, owner, repo) {\n // validate if given url is a valid url\n if (url.hostname !== hostname || !owner || !repo) {\n const errorMessage = `The URL must be a valid ${\n service\n } URL in the following format: https://${\n hostname\n }/serverle...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Delete local directory recursively. @param $dirPath string to directory to be erased. @return bool true on success and false on failure.
[ "private function deleteDir($dirPath)\n\t{\n\t\tif (!is_dir($dirPath)) {\n\t\t\t$success = unlink($dirPath);\n\t\t} else {\n\t\t\t$success = true;\n\t\t\tforeach (array_reverse(elFinderVolumeFTP::listFilesInDirectory($dirPath, false)) as $path) {\n\t\t\t\t$path = $dirPath . DIRECTORY_SEPARATOR . $path;\n\t\t\t\tif(...
[ "def remove_info_file():\n \n try:\n os.unlink(_get_info_file_path())\n except OSError as e:\n if e.errno == errno.ENOENT:\n # The user may have wiped their temporary directory or something.\n # Not a problem: we're already in the state that we want to be in.\n pass\n else:\n raise" ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Calculate score authentication risk score. @param request the request @param authentication the authentication @param service the service @param events the events @return the authentication risk score
[ "protected BigDecimal calculateScore(final HttpServletRequest request,\n final Authentication authentication,\n final RegisteredService service,\n final Collection<? extends CasEvent> events) {\n ...
[ "def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
@param null|string $refreshToken @return void
[ "private function setRefreshToken($refreshToken)\n {\n if (null !== $refreshToken) {\n // refresh-token = 1*VSCHAR\n // VSCHAR = %x20-7E\n if (1 !== \\preg_match('/^[\\x20-\\x7E]+$/', $refreshToken)) {\n throw new AccessTokenException('invalid \"refre...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get keyword args for GoSubDagPlot from self unless they are None.
[ "def get_kws_plt(self):\n \"\"\"\"\"\"\n kws_plt = {}\n for key_plt in self.keys_plt:\n key_val = getattr(self, key_plt, None)\n if key_val is not None:\n kws_plt[key_plt] = key_val\n elif key_plt in self.kws:\n kws_plt[key_plt] = s...
[ "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 sentence about Software Engineering:", "pos": "Represent the Github code about Software Engineering:", "neg": "Represent the Github code:" }
Initializes this factory with a source of certificate authorities and related trust material. @param keyStore The key store or null @throws KeyStoreException if the initialization fails.
[ "@Override\n\tprotected void engineInit(KeyStore keyStore) throws KeyStoreException {\n\t\ttry {\n\t\t\tthis\n\t\t\t\t\t.engineInit(new CertPathTrustManagerParameters(\n\t\t\t\t\t\t\tnew X509ProxyCertPathParameters(keyStore, null,\n\t\t\t\t\t\t\t\t\tnull, false)));\n\t\t} catch (InvalidAlgorithmParameterException e...
[ "private Subject authenticateWithCertificateChain(SSLSession session) throws SSLPeerUnverifiedException, AuthenticationException, CredentialExpiredException, CredentialDestroyedException {\n Subject transportSubject = null;\n if (session != null) {\n Certificate[] certificateChain = session...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// ArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key // value must implement Marshaler
[ "func (enc *Encoder) ArrayKey(key string, v MarshalerJSONArray) {\n\tif enc.hasKeys {\n\t\tif !enc.keyExists(key) {\n\t\t\treturn\n\t\t}\n\t}\n\tif v.IsNil() {\n\t\tenc.grow(2 + len(key))\n\t\tr := enc.getPreviousRune()\n\t\tif r != '{' {\n\t\t\tenc.writeByte(',')\n\t\t}\n\t\tenc.writeByte('\"')\n\t\tenc.writeStrin...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SaveReferrer validates referrer and saves it in DB
[ "func (s *authenticationProviderServiceImpl) SaveReferrer(ctx context.Context, state string, referrer string,\n\tresponseMode *string, validReferrerURL string) error {\n\n\tmatched, err := regexp.MatchString(validReferrerURL, referrer)\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"referrer...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
The render edit component
[ "function (wp) {\n var element = props.onRenderEditElement ? props.onRenderEditElement(wp) : null;\n if (element == null) {\n // Default the element\n element = props.editElement ? React.createElement(props.editElement, { cfg: wp.cfg, cfgElementId: props.cfgElementId }) : null;\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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return the list of source for which energy dispersion should be turned off
[ "def edisp_disable_list(self):\n \n l = []\n for model_comp in self.model_components.values():\n if model_comp.edisp_disable:\n l += [model_comp.info.source_name]\n return l" ]
[ "def replicate_filter(sources, model, cache=None):\n ''''''\n targets = [replicate_no_merge(source, model, cache=cache)\n for source in sources]\n # Some objects may not be available in target DB (not published), so we\n # have to exclude None from the list.\n return [target for target ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// This is a courtesy helper function, which in some cases may not work as expected!
[ "func (s *DomainService) GetDomainChildrenByID(id string, opts ...OptionFunc) (*DomainChildren, int, error) {\n\tp := &ListDomainChildrenParams{}\n\tp.p = make(map[string]interface{})\n\n\tp.p[\"id\"] = id\n\n\tfor _, fn := range append(s.cs.options, opts...) {\n\t\tif err := fn(s.cs, p); err != nil {\n\t\t\treturn...
[ "function isSafeProperty (object, prop) {\n if (!object || typeof object !== 'object') {\n return false\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Obje...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
specific to how a function is dispatched.
[ "private List<Map<String, Result<R>>> handleRetcodeBatchingHack(List<Map<String, Result<R>>> list, Type xor) {\n return list.stream().map(m -> {\n return m.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> {\n return e.getValue().fold(err -> {\n r...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// Convert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester is an autogenerated conversion function.
[ "func Convert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(in *v1.TemplateInstanceRequester, out *template.TemplateInstanceRequester, s conversion.Scope) error {\n\treturn autoConvert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(in, out, s)\n}" ]
[ "private MapperConstructor getMapper(String dName){\r\n\t\treturn new MapperConstructor(destinationType(), sourceType(), dName, dName, getSName(), configChosen, xml,methodsToGenerate);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Adds the given value to the values currently associated with the given key, iff the key isn't already associated with that same value.
[ "public void putIfAbsent(String key, Object value) {\n if (!fields.containsEntry(key, value)) {\n fields.put(key, value);\n }\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetDataSourceId sets the DataSourceId field's value.
[ "func (s *CreateDataSourceFromRedshiftOutput) SetDataSourceId(v string) *CreateDataSourceFromRedshiftOutput {\n\ts.DataSourceId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Generates a sequence of points suitable for plotting. An empirical CDF is a step function; linear interpolation can be misleading. Returns: tuple of (xs, ps)
[ "def Render(self):\n \n xs = [self.xs[0]]\n ps = [0.0]\n for i, p in enumerate(self.ps):\n xs.append(self.xs[i])\n ps.append(p)\n\n try:\n xs.append(self.xs[i + 1])\n ps.append(p)\n except IndexError:\n ...
[ "def normalize(self, inplace=True):\n \n phi = self if inplace else self.copy()\n\n # The pdf of a Joint Gaussian distrinution is always\n # normalized. Hence, no changes.\n if not inplace:\n return phi" ]
codesearchnet
{ "query": "Represent the Github description about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code:" }
Static parse method taking care of basic message element parsing. @param messageElement
[ "public AbstractMessageContentBuilder constructMessageBuilder(Element messageElement) {\n AbstractMessageContentBuilder messageBuilder = null;\n \n if (messageElement != null) {\n messageBuilder = parsePayloadTemplateBuilder(messageElement);\n \n if (messageBuil...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Invokes any termination callbacks. @return Promise
[ "private static function terminate(): Promise\n {\n if (self::$onClose === null) {\n return Promise\\any([]);\n }\n\n if (self::$signalWatchers) {\n foreach (self::$signalWatchers as $watcher) {\n Loop::cancel($watcher);\n }\n }\n\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Assert or de-assert target reset line
[ "def assert_reset(self, asserted):\n \"\"\"\"\"\"\n try:\n self._invalidate_cached_registers()\n self._link.assert_reset(asserted)\n except DAPAccess.Error as exc:\n six.raise_from(self._convert_exception(exc), exc)" ]
[ "def end(self):\n \n\n # Note: Vend is just a macro; use 'Vfinish' instead\n # Note also the the same C function is used to end\n # the VS interface\n _checkErr('vend', _C.Vfinish(self._hdf_inst._id),\n \"cannot terminate V interface\")\n self._hdf_inst = N...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Count the occurrences of value in $this list. @param $value @return int
[ "public function countValue($value)\n {\n $count = 0;\n foreach ($this->source as $arrayVal) {\n if ($arrayVal === $value) {\n ++$count;\n }\n }\n\n return $count;\n }" ]
[ "function check(AE $e) {return\n\t\t// 2016-11-20\n\t\t// !! обязательно, потому что нам нужно вернуть именно true|Phrase|Phrase[]\n\t\t!!df_filter($this->_iso3, function($c) {return df_currency_has_rate($c);}) ?: $this->message()\n\t;}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Get rendered title @return string
[ "public function getRenderedTitle()\n {\n $rendered = $this->getRenderedContent();\n\n if ( $rendered instanceof Content || $rendered instanceof MetaContent )\n {\n return $rendered->title;\n }\n\n return null;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Activate this component. @param ctxt
[ "protected void activate(ComponentContext ctxt) {\n this.bundle = ctxt.getUsingBundle();\n\n if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {\n Tr.event(this, tc, \"Activating for bundle \" + this.bundle);\n }\n\n this.localServlets = new HashSet<Servlet>();\...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Prepare list response. @param DoctrineListBuilder $listBuilder @param string $locale @return array
[ "private function prepareListResponse(DoctrineListBuilder $listBuilder, $locale)\n {\n $listResponse = $listBuilder->execute();\n $listResponse = $this->addAvatars($listResponse, $locale);\n\n $ids = $listBuilder->getIds();\n if (null !== $ids) {\n $comparator = $this->getC...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *GetFindingsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetFindingsInput\"}\n\tif s.DetectorId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DetectorId\"))\n\t}\n\tif s.DetectorId != nil && len(*s.DetectorId) < 1 {\n\t\tinvalidParams.Add(request.NewErrP...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param string $paymentMethodName @throws \SprykerEco\Zed\Payone\Business\Exception\InvalidPaymentMethodException @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
[ "protected function getRegisteredPaymentMethodMapper($paymentMethodName)\n {\n $paymentMethodMapper = $this->findPaymentMethodMapperByName($paymentMethodName);\n if ($paymentMethodMapper === null) {\n throw new InvalidPaymentMethodException(\n sprintf('No registered paymen...
[ "protected function registerApportionmentEntryInterface()\n\t{\n\t\t$this->app->bind('Mgallegos\\DecimaAccounting\\Accounting\\Repositories\\ApportionmentEntry\\ApportionmentEntryInterface', function($app)\n\t\t{\n\t\t\t$AuthenticationManager = $app->make('App\\Kwaai\\Security\\Services\\AuthenticationManagement\\A...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetCreationDate sets the CreationDate field's value.
[ "func (s *OptionStatus) SetCreationDate(v time.Time) *OptionStatus {\n\ts.CreationDate = &v\n\treturn s\n}" ]
[ "function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// YAML marshals the "v" using the yaml marshaler and renders its result to the client.
[ "func (ctx *context) YAML(v interface{}) (int, error) {\n\tout, err := yaml.Marshal(v)\n\tif err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\treturn 0, err\n\t}\n\n\tctx.ContentType(ContentYAMLHeaderValue)\n\treturn ctx.Write(out)\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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Protected is bootstrap group usage
[ "protected function isBootstrapGroupUsage($type)\n {\n if( ($this->settings['group']['class'] ?? NULL) || isset($this->callableGroup) )\n { \n if( ! $this->isCheckboxOrRadio($type) )\n {\n if( ! isset($this->settings['attr']['class']) )\n {\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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetSendEmailNotification sets the SendEmailNotification field's value.
[ "func (s *UserStackAssociation) SetSendEmailNotification(v bool) *UserStackAssociation {\n\ts.SendEmailNotification = &v\n\treturn s\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }