query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Helper function for token handling. @param tokenizer Tokenizer @throws IOException
[ "private void nextToken(StreamTokenizer tokenizer) throws IOException {\n tokenizer.nextToken();\n if((tokenizer.ttype == '\\'') || (tokenizer.ttype == '\"')) {\n tokenizer.ttype = StreamTokenizer.TT_WORD;\n }\n else if((tokenizer.ttype == StreamTokenizer.TT_WORD) && (tokenizer.sval.equals(\"?\")))...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about N/A:" }
Builds a SQL statement from the given criteria object and resets the Criteria @param Criteria $criteria @return string fully formed SQL statement
[ "public function GetSQL($criteria)\r\n\t{\r\n\t\t// start building the sql statement\r\n\t\t$sql = \"select \" . $this->GetColumnNames() . \"\";\r\n\r\n\t\t$sql .= $this->GetTableJoinSQL($criteria);\t\t\r\n\r\n\t\t$sql .= $criteria->GetJoin();\r\n\t\t\t\t\r\n\t\t$sql .= $this->GetWhereSQL($criteria);\r\n\t\t\r\n\t\...
[ "public static QueryBuilderFind fromType(Class<? extends WindupVertexFrame> type)\n {\n final Query query = new Query();\n // this query is going to be added after evaluate() method, because in some cases we need gremlin and in some\n // frames\n query.searchType = type;\n retu...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
Parse the Tophat alignment log file.
[ "def parse_tophat_log (self, raw_data):\n \n\n if 'Aligned pairs' in raw_data:\n # Paired end data\n regexes = {\n 'overall_aligned_percent': r\"([\\d\\.]+)% overall read mapping rate.\",\n 'concordant_aligned_percent': r\"([\\d\\.]+)% concordant pai...
[ "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:" }
// NeedMoreAddresses returns whether or not the address manager needs more // addresses.
[ "func (a *AddrManager) NeedMoreAddresses() bool {\n\ta.mtx.Lock()\n\tdefer a.mtx.Unlock()\n\n\treturn a.numAddresses() < needAddressThreshold\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the comment about Address:", "pos": "Represent the code about Address:", "neg": "Represent the code about Software development:" }
/*[deutsch] <p>Siehe {@link #floorModulo(int, int)}. </p> @param value numerator @param divisor divisor @return remainder of division (never negative if divisor is positive)
[ "public static int floorModulo(\n long value,\n int divisor\n ) {\n\n long ret = (value - divisor * (floorDivide(value, divisor)));\n return (int) ret; // Type-Cast hier wegen modulo-Semantik sicher\n\n }" ]
[ "public void setDivisor(int radix, short exponent) {\n divisor = NFRule.power(radix, exponent);\n\n if (divisor == 0) {\n throw new IllegalStateException(\"Substitution with divisor 0\");\n }\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Process StepStartedEvent. New step will be created and added to stepStorage. @param event to process
[ "public void fire(StepStartedEvent event) {\n Step step = new Step();\n event.process(step);\n stepStorage.put(step);\n\n notifier.fire(event);\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Initializes the publish list, ensuring all internal lists are in the right order.<p>
[ "protected void initialize() {\n\n if (m_folderList != null) {\n // ensure folders are sorted starting with parent folders\n Collections.sort(m_folderList, I_CmsResource.COMPARE_ROOT_PATH);\n }\n\n if (m_fileList != null) {\n // ensure files are sorted starting ...
[ "function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add a Filter to the available filter list Throws an Exception if the Closure $filter does not produce a Filter object @param $filterName @param \Closure $filter @throws \Exception
[ "protected function addFilter($filterName, \\Closure $filter) {\n $filter = call_user_func($filter);\n if(!is_a($filter, 'SypherLev\\Blueprint\\Elements\\Filter')) {\n throw (new \\Exception('Filter named '.$filterName. ' could not be added; Closure does not return a valid Filter object'));...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// Shutdown implements the MDServer interface for MDServerMemory.
[ "func (md *MDServerMemory) Shutdown() {\n\tmd.lock.Lock()\n\tdefer md.lock.Unlock()\n\tmd.handleDb = nil\n\tmd.latestHandleDb = nil\n\tmd.branchDb = nil\n\tmd.truncateLockManager = nil\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// AbortMultipartUpload aborts a ongoing multipart upload
[ "func (l *s3Objects) AbortMultipartUpload(ctx context.Context, bucket string, object string, uploadID string) error {\n\terr := l.Client.AbortMultipartUpload(bucket, object, uploadID)\n\treturn minio.ErrorRespToObjectError(err, bucket, object)\n}" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about AWS S3:" }
=========================================================================
[ "public static function parse_version_string($versionString) {\n\t\tif(is_null($versionString) || !strlen($versionString)) {\n\t\t\tthrow new Exception(__METHOD__ .\": invalid version string ($versionString)\");\n\t\t}\n\t\t\n\t\t$suffix = \"\";\n\t\t$explodeThis = $versionString;\n\t\tif(preg_match('/-[A-Z]{2,5}[0...
[ "public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:...
codesearchnet
{ "query": "Represent the instruction about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code about Programming:" }
commits files in the src/ dir as a patch or tarball update
[ "def commit_sources(message, new_tarball)\n from_directory do\n comments = \"#{message}\\n\"\n if new_tarball\n comments << \"\\ntetra: sources-tarball\"\n @git.disable_special_files(\"src\")\n end\n @git.commit_directories([\"src\"], comments)\n end\n end"...
[ "def examples():\n \n script = \"Continuous Integration Automation Server\"\n explain = (\"For complex codes with many collaborators, it is often difficult to maintian \"\n \"a pristine code that everyone can rely on. If every developer has power to \"\n \"commit to master, unin...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the isotope pattern normalized to the highest abundance. @param isotopeP The IsotopePattern object to normalize @return The IsotopePattern normalized
[ "public static IsotopePattern normalize(IsotopePattern isotopeP) {\n IsotopeContainer isoHighest = null;\n\n double biggestAbundance = 0;\n /* Extraction of the isoContainer with the highest abundance */\n for (IsotopeContainer isoContainer : isotopeP.getIsotopes()) {\n double...
[ "def add (data, label)\n raise \"No meaningful label associated with data\" unless ([:positive, :negative].include? label)\n \n #Create a data point in the vector space from the datum given\n data_point = Eluka::DataPoint.new(data, @analyzer)\n \n #Add the data point to the feature spa...
codesearchnet
{ "query": "Represent the Github sentence about Signal Processing:", "pos": "Represent the Github code about Signal Processing:", "neg": "Represent the Github code:" }
// OnCDOTAUserMsg_ItemFound registers a callback for EDotaUserMessages_DOTA_UM_ItemFound
[ "func (c *Callbacks) OnCDOTAUserMsg_ItemFound(fn func(*dota.CDOTAUserMsg_ItemFound) error) {\n\tc.onCDOTAUserMsg_ItemFound = append(c.onCDOTAUserMsg_ItemFound, fn)\n}" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Syncs self::$metaHeaders with a flipped headers array @param array $headersFlipped flipped headers array @return void
[ "protected function updateFlippedMetaHeaders(array $headersFlipped)\n {\n foreach ($this->metaHeaders as $name => $key) {\n if (!isset($headersFlipped[$key])) {\n unset($this->metaHeaders[$name]);\n }\n }\n\n foreach ($headersFlipped as $key => $name) {\n...
[ "public function setRequestHeader($name, $value) {\n $header = array();\n $header[$name] = $value;\n //TODO: as a limitation of the driver it self, we will send permanent for the moment\n $this->browser->addHeader($header, true);\n }" ]
codesearchnet
{ "query": "Represent the sentence about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// EnsurePlurality returns a ComparablePrincipalSet such that plurality requirements over // the contained ComparablePrincipalSet in the comparablePrincipalSetPair hold
[ "func (pair comparablePrincipalSetPair) MergeWithPlurality() ComparablePrincipalSet {\n\tvar principalsToAdd []*ComparablePrincipal\n\tused := make(map[int]struct{})\n\t// Iterate over the contained set and for each principal\n\tfor _, principal := range pair.contained {\n\t\tvar covered bool\n\t\t// Search a princ...
[ "public UnfilledDependency replaceObject(IndexedPredicate newObject) {\n return new UnfilledDependency(subject, subjectSyntax, subjectFunctionVarIndex,\n subjectArgIndex, newObject, -1);\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Creates a new Cipher @return Cipher implementation
[ "public static Cipher getCipher(final @NotNull Key key, int mode) {\n try {\n Cipher cipher = Cipher.getInstance(key.getAlgorithm());\n cipher.init(mode, key);\n return cipher;\n } catch (NoSuchAlgorithmException | InvalidKeyException | NoSuchPaddingException e) {\n ...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
These are the three 'f' functions. See RFC 2144, section 2.2.
[ "function f1(d, m, r) {\n const t = m + d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] ^ sBox[1][(I >>> 16) & 255]) - sBox[2][(I >>> 8) & 255]) + sBox[3][I & 255];\n }" ]
[ "protected function getParameters(array $additionnal_parameters = array())\n {\n return array_filter(\n array_merge(array(\n /*\n * -- system type\n * Must be set to value: H\n */\n 'S' => 'H',\n /*\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// BuildKeyValueYARPCProcedures prepares an implementation of the KeyValue service for YARPC registration.
[ "func BuildKeyValueYARPCProcedures(server KeyValueYARPCServer) []transport.Procedure {\n\thandler := &_KeyValueYARPCHandler{server}\n\treturn protobuf.BuildProcedures(\n\t\tprotobuf.BuildProceduresParams{\n\t\t\tServiceName: \"uber.yarpc.internal.examples.protobuf.example.KeyValue\",\n\t\t\tUnaryHandlerParams: []pr...
[ "@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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see qc.automation.framework.widget.IElement#getLocationY()
[ "@Override\n\tpublic int getLocationY() throws WidgetException {\n\t\ttry {\n\t\t\tPoint p = findElement().getLocation();\n\t\t\treturn p.getY();\n\t\t} catch (Exception e) {\n\t\t\tthrow new WidgetException(\"Error while fetching Y location\", locator, e);\n\t\t}\n\t}" ]
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewCodeStore creates a new CodeStore from an IDStore.
[ "func NewCodeStore(idStore *IDStore, options CodeStoreOptions) (*CodeStore, error) {\n\treturn newCodeStore(idStore, options)\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create a DateInterval from an PHP Dateinterval @param DateInterval $interval @return DateInterval
[ "public static function createFromDateInterval(\\DateInterval $interval) {\n if ($interval instanceof DateInterval) return $interval;\n \n $ret = new DateInterval($interval->format('P%yY%mM%dDT%hH%iM%sS'));\n $ret->invert = $interval->invert;\n \n return $ret;\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* Add a new heading Cell in the current row. Adds to the table after this call and before next call to newRow, newCell or newHeader are added to the cell. @return This table for call chaining
[ "public Table addHeading(Object o,String attributes)\n {\n addHeading(o);\n cell.attribute(attributes);\n return this;\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Turns relative paths in absolute paths without realpath() Since the dirs might not exist yet we can not call realpath or it will fail. @param string $path @return string
[ "private function realpath($path)\n {\n if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {\n return $path;\n }\n\n return $this->baseDir . '/' . $path;\n }" ]
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Checks whether query has a parameter or its empty @param string $key, [...] @return boolean
[ "public function hasQuery()\n {\n if (func_num_args() == 0) {\n return !empty($this->query);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->query, $key)) {\n return false;\n }\n }\n\n return true;\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 about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Documentation:" }
Performs synchronous speech recognition: receive results after all audio has been sent and processed. @param \Google\Cloud\Speech\V1p1beta1\RecognizeRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "public function Recognize(\\Google\\Cloud\\Speech\\V1p1beta1\\RecognizeRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.speech.v1p1beta1.Speech/Recognize',\n $argument,\n ['\\Google\\Cloud\\Speech\\V1p1beta1\\RecognizeResponse', 'decode']...
[ "public function GetSessionEntityType(\\Google\\Cloud\\Dialogflow\\V2\\GetSessionEntityTypeRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.v2.SessionEntityTypes/GetSessionEntityType',\n $argument,\n ['\\Google\\Cloud\\Dialogflo...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets a {@link ProjectModel} with the given name.
[ "public ProjectModel getByName(String name)\n {\n return getUnique(getQuery().getRawTraversal().has(ProjectModel.NAME, name));\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Returns all defined languages as a flat array @return array
[ "public function getAllFlat()\n {\n $aOut = [];\n $aLanguages = $this->getAll();\n\n foreach ($aLanguages as $oLanguage) {\n $aOut[$oLanguage->code] = $oLanguage->label;\n }\n\n return $aOut;\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 post about database:", "pos": "Represent the code about database:", "neg": "Represent the code about Documentation:" }
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "@XmlElementDecl(namespace = \"http://www.ibm.com/websphere/wim\", name = \"departmentNumber\")\n public JAXBElement<String> createDepartmentNumber(String value) {\n return new JAXBElement<String>(_DepartmentNumber_QNAME, String.class, null, value);\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
helper to apply bindings, wait, and check result
[ "function(bindingString, data, children, callback, containerless) {\n container = document.createElement(\"div\");\n if (!containerless) {\n container.setAttribute(\"data-bind\", bindingString);\n container.innerHTML = children || \"\";\n }\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Path gets the absolute path of c separated by sep. If c is a root-Config an // empty string will be returned.
[ "func (c *Config) Path(sep string) string {\n\treturn c.ctx.path(sep)\n}" ]
[ "def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Do not override this function. @return Page
[ "public function showLoginForm()\n {\n $this->app->template->trySet('page_title', 'Login');\n if ($this->app->layout && $this->login_layout_class) {\n $this->app->layout->destroy();\n $this->app->add($this->login_layout_class);\n /** @type Page $p */\n $p...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code:" }
Parse the title,body from data. @param string $data @return array
[ "protected function _parseData($data)\n {\n $output = array('title' => '','body' => '');\n $matches = array();\n\n if (preg_match_all('#<data name=\"([^\"]+)\">(.*?)<\\/data>#si', $data, $matches)) {\n $attributes = $matches[1];\n $contents = $matches[2];\n\n ...
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the comment about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
<code>optional string report_call = 2;</code> <pre> name of function(ID = &lt;numeric function id&gt;); used to inform the harness about a function call </pre>
[ "public java.lang.String getReportCall() {\n java.lang.Object ref = reportCall_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8...
[ "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 Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
sig-->bytes msg-->str or bytes Returns-->boolean
[ "def verify(self, sig, msg):\n '''\n \n '''\n return lib.ed25519_VerifySignature(\n sig, self.__verifyingkey, msg, len(msg)) == 1" ]
[ "def db_check( block_id, opcode, op, txid, vtxindex, checked, db_state=None ):\n \n print \"\\nreference implementation of db_check\\n\"\n return False" ]
codesearchnet
{ "query": "Represent the Github text about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Blockchain:" }
// SetFleet sets the Fleet field's value.
[ "func (s *UpdateFleetOutput) SetFleet(v *Fleet) *UpdateFleetOutput {\n\ts.Fleet = v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
@param $filename @return bool|resource @throws ExtensionException
[ "private function openStream($filename)\n {\n if (!file_exists($filename)) {\n throw new ExtensionException(sprintf('File path (%s) doesn\\'t exist', $filename));\n }\n \n if (!is_readable($filename)) {\n throw new ExtensionException(sprintf('File path (%s) doesn...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
获取Entity的DELETE SQL @param bean Entity对象 @return String
[ "public String getDeletePrepareSQL(T bean) {\r\n if (this.tableStrategy == null) return deletePrepareSQL;\r\n return deletePrepareSQL.replace(\"${newtable}\", getTable(bean));\r\n }" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Restores original state of a specified object in group @private @method _restoreObjectState @param {fabric.Object} object @return {fabric.Group} thisArg
[ "function(object) {\n\n var groupLeft = this.get('left'),\n groupTop = this.get('top'),\n groupAngle = this.getAngle() * (Math.PI / 180),\n objectLeft = object.get('originalLeft'),\n objectTop = object.get('originalTop'),\n rotatedTop = Math.cos(groupAngle) * object...
[ "function (p) {\n/*Line 57 - 'AtomPostButton.js' */ AtomBinder.setValue(caller, \"postResult\", p.value());\n/*Line 58 - 'AtomPostButton.js' */ caller.invokeAction(caller._next);\n/*Line 59 - 'AtomPostButton.js' */ }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* ////////////////////////////////////////////////////////// Stax2, Factory methods //////////////////////////////////////////////////////////
[ "@Override\n public XMLValidationSchema createSchema(InputStream in, String encoding,\n String publicId, String systemId)\n throws XMLStreamException\n {\n InputSource src = new InputSource(in);\n src.setEncoding(encoding);\n src.setPublicI...
[ "function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Java programming:" }
Check if a float hour is a possible hour for this analysis period.
[ "def is_possible_hour(self, hour):\n \"\"\"\"\"\"\n if hour > 23 and self.is_possible_hour(0):\n hour = int(hour)\n if not self._is_overnight:\n return self.st_time.hour <= hour <= self.end_time.hour\n else:\n return self.st_time.hour <= hour <= 23 or \\\...
[ "@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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
获取父级的Class <p>Function: getSignificantSupperClass</p> <p>Description: </p> @param classType @return @author acexy@thankjava.com @date 2015年6月18日 上午10:02:35 @version 1.0
[ "public static Class<?> getSignificantSupperClass(Class<?> classType) {\n Class<?> supperClass = classType;\n while (classType != null) {\n classType = classType.getSuperclass();\n if (Object.class == classType || null == classType) {\n break;\n }\n ...
[ "def _build_msg_content(self, msgtype='text', **kwargs):\n \n data = {'msgtype': msgtype}\n if msgtype == 'text':\n data[msgtype] = {'content': kwargs.get('content')}\n elif msgtype == 'image' or msgtype == 'voice' or msgtype == 'file':\n data[msgtype] = {'media_id'...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
This method injects a {@link List} of {@link ValueConverter}s to use as default. @param converterList is the list of converters to register.
[ "@Inject\n public void setConverters(List<ValueConverter<?, ?>> converterList) {\n\n getInitializationState().requireNotInitilized();\n this.converters = new ArrayList<>(converterList.size());\n for (ValueConverter<?, ?> converter : converterList) {\n if (!(converter instanceof ComposedValueConverter...
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// InitDefaultHelpFlag adds default help flag to c. // It is called automatically by executing the c or by calling help and usage. // If c already has help flag, it will do nothing.
[ "func (c *Command) InitDefaultHelpFlag() {\n\tc.mergePersistentFlags()\n\tif c.Flags().Lookup(\"help\") == nil {\n\t\tusage := \"help for \"\n\t\tif c.Name() == \"\" {\n\t\t\tusage += \"this command\"\n\t\t} else {\n\t\t\tusage += c.Name()\n\t\t}\n\t\tc.Flags().BoolP(\"help\", \"h\", false, usage)\n\t}\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
/Storing An Item In The Session
[ "function(key, value, delay){\n $ExpressSESSION.session.store[key] = value;\n if(delay && is_number(delay) && delay > 0){\n var vkey = self.id()+'_'+key;\n if($ExpressSESSION.session.expires[key]) clearTimeout(sesssion_expires[vkey]);\n sesssion_exp...
[ "public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// GetTargetHTTPProxy returns the UrlMap by name.
[ "func (g *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error) {\n\tctx, cancel := cloud.ContextWithCallTimeout()\n\tdefer cancel()\n\n\tmc := newTargetProxyMetricContext(\"get\")\n\tv, err := g.c.TargetHttpProxies().Get(ctx, meta.GlobalKey(name))\n\treturn v, mc.Observe(err)\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Custom label names for request properties (like SReg data)
[ "def property_label_text(property)\n case property.to_sym\n when :image_default then t(:image_url)\n when :web_default then t(:website_url)\n when :web_blog then t(:blog_url)\n else t(property.to_sym)\n end\n end" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Should be implemented for each renderer itself (just default). @return int
[ "public function getCurrentPageNumber()\n {\n $request = $this->getRequest();\n\n $optionsRenderer = $this->getOptionsRenderer();\n $parameterNames = $optionsRenderer['parameterNames'];\n if ($request->getParam($parameterNames['currentPage']) != '') {\n return (int) $reques...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Creates new and updates existing items using the data array @param array $data Data array @return \Aimeos\MShop\Service\Item\Iface New service item object
[ "protected function fromArray( array $data )\n\t{\n\t\t$conf = [];\n\n\t\tif( isset( $data['config']['key'] ) )\n\t\t{\n\t\t\tforeach( (array) $data['config']['key'] as $idx => $key )\n\t\t\t{\n\t\t\t\tif( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) )\n\t\t\t\t{\n\t\t\t\t\tif( ( $val = json_decode(...
[ "protected function addOrderStatus( $orderId, $value )\n\t{\n\t\t$orderStatusManager = \\Aimeos\\MShop::create( $this->getContext(), 'order/status' );\n\n\t\t$statusItem = $orderStatusManager->createItem()->setParentId( $orderId )->setValue( $value )\n\t\t\t->setType( \\Aimeos\\MShop\\Order\\Item\\Status\\Base::EMA...
codesearchnet
{ "query": "Represent the Github post about Aimeos:", "pos": "Represent the Github code about Aimeos:", "neg": "Represent the Github code about programming:" }
// filter returns those entries from an MirrorInfo array for which the given // match function returns true. It preserves order.
[ "func (entries MirrorInfoSlice) filter(match func(*MirrorInfo) bool) MirrorInfoSlice {\n\tresult := MirrorInfoSlice{}\n\tfor _, mirrorInfo := range entries {\n\t\tif match(&mirrorInfo) {\n\t\t\tresult = append(result, mirrorInfo)\n\t\t}\n\t}\n\treturn result\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 post about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
Draws the scoreboard for the current iteration.
[ "protected function drawScoreboard()\n {\n $size = count($this->teams);\n $this->preamble($size);\n\n foreach ($this->teams as $key => $team) {\n $this->write(sprintf(\n \" %s%sm%s%s\\n\",\n\n self::ESC,\n $team->getColor(),\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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return a characters current Skill Queue. @param int $character_id @return \Illuminate\Support\Collection
[ "public function getCharacterSkillQueue(int $character_id): Collection\n {\n\n return CharacterSkillQueue::where('characterID', $character_id)\n ->where('queue_position', '>', 0)\n ->orderBy('queue_position')\n ->get();\n\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\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:" }
Instrument an existing Jersey client @param client Jersey client @return an instrumented Jersey client
[ "public Client build(final Client client) {\n client.register(TracingClientFilter.create(tracing));\n return client;\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// String returns a human-readable string of the BucketFilter, // particularly useful for error messages.
[ "func (f BucketFilter) String() string {\n\t// There should always be exactly 2 fields set, but if it's somehow more, that's fine.\n\tparts := make([]string, 0, 2)\n\tif f.ID != nil {\n\t\tparts = append(parts, \"Bucket ID: \"+f.ID.String())\n\t}\n\tif f.Name != nil {\n\t\tparts = append(parts, \"Bucket Name: \"+*f...
[ "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 post about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code about Software development:" }
Internal method to get a scalar value from server. @return mixed
[ "public function requestValue($name)\n {\n $response = $this->client->request('GET', sprintf('/session/%s/%s', $this->sessionId, $name));\n $content = json_decode($response->getContent(), true);\n\n if (!isset($content['value'])) {\n throw new LibraryException('Malformed response:...
[ "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 instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Bootstrap application service.
[ "public function boot()\n {\n $configPath = __DIR__ . '/../config/api-debugger.php';\n $this->publishes([$configPath => config_path('api-debugger.php')]);\n $this->mergeConfigFrom($configPath, 'api-debugger');\n\n // Register collections only for debug environment.\n $config = ...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
lhsAnd := LEFT_PAREN AND lhsUnary+ RIGHT_PAREN | lhsUnary (AND lhsUnary)* @param ce @throws org.antlr.runtime.RecognitionException
[ "private BaseDescr lhsAnd(final CEDescrBuilder<?, ?> ce,\n boolean allowOr) throws RecognitionException {\n BaseDescr result = null;\n if (input.LA(1) == DRL6Lexer.LEFT_PAREN && helper.validateLT(2,\n DroolsSoftKeywords.AND)) {\n // prefixed AND\n CEDesc...
[ "function varMatchingAny(varnameAtom) {\n return sl.list(sl.atom(\"::\", {token: varnameAtom}), varnameAtom, sl.str(\"any\"));\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about PHP programming:" }
Return the head of the list.
[ "public function head() : Box\n {\n // keep track of visited boxes for cycle detection\n $touched = [];\n for ($b = $this; $b->prev !== null; $b = $b->visit($touched)->prev);\n return $b;\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
truncate this fastqSequence in-place so it is only <size> nucleotides long :param size: the number of nucleotides to truncate to.
[ "def truncate(self, size):\n \n if size > len(self):\n raise NGSReadError(\"Trying to truncate NGS read to size \" + str(size) +\n \", but read is only \" + str(len(self)) +\n \" nucleotides long\")\n if size < 0:\n raise NGSReadError(\"Trying to tr...
[ "def translations(self):\n \n rc = self.reverseComplement().sequence\n for reverseComplemented in False, True:\n for frame in 0, 1, 2:\n seq = rc if reverseComplemented else self.sequence\n # Get the suffix of the sequence for translation. I.e.,\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Text translation:" }
Uploads a snap. @todo Fix media ID generation; it looks like they're GUIDs now. @param int $type The media type, i.e. MEDIA_IMAGE or MEDIA_VIDEO. @param data $data The file data to upload. @return mixed The ID of the uploaded media or FALSE on failure.
[ "public function upload($type, $data) {\n\t\t// Make sure we're logged in and have a valid access token.\n\t\tif (!$this->auth_token || !$this->username) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// To make cURL happy, we write the data to a file first.\n\t\t$temp = tempnam(sys_get_temp_dir(), 'Snap');\n\t\tfile_put_con...
[ "public function parameters()\n {\n $parameters = parent::parameters();\n if (!isset($parameters['VALUE']) && in_array($this->name, ['URL', 'PHOTO'])) {\n // If we are encoding a URI value, and this URI value has no\n // VALUE=URI parameter, we add it anyway.\n //\n...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// CreateDeviceQueueItem adds the given item to the device queue.
[ "func CreateDeviceQueueItem(db sqlx.Queryer, qi *DeviceQueueItem) error {\n\tif err := qi.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tnow := time.Now()\n\tqi.CreatedAt = now\n\tqi.UpdatedAt = now\n\n\terr := sqlx.Get(db, &qi.ID, `\n insert into device_queue (\n created_at,\n upda...
[ "@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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Make and return a new ExpressiveDate instance with defined year, month, and day. @param int $year @param int $month @param int $day @param string|DateTimeZone $timezone @return ExpressiveDate
[ "public static function makeFromDate($year = null, $month = null, $day = null, $timezone = null)\n\t{\n\t\treturn static::makeFromDateTime($year, $month, $day, null, null, null, $timezone);\n\t}" ]
[ "public function convertTo($zone, $format = null)\n {\n Argument::i()\n //argument 1 must be a string\n ->test(1, 'string')\n //argument 1 must be a timezone identifier\n ->test(1, 'location', 'utc', 'abbr')\n //argument 2 must be a string or null\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
获取可被 subprogress 执行的 git 参数 list。 :param str path: git 仓库文件夹路径。 :param \*args: git 的附加参数。 :param bare: 是否视为 bare 库
[ "def get_args(path, *args, work_tree=True, bare=False):\n \n base = [ 'git' ]\n if path:\n base.append('-C')\n base.append(path)\n if bare:\n base.append('--bare')\n base.append(\"--git-dir=\"+path)\n else:\n base.append(\"--git-dir=\"+os.path.jo...
[ "function getRequirePath(absolutePath) {\n // 获得 require 这个模块的相对路径\n let relativePath = path.relative(__dirname, absolutePath);\n\n if (path.isAbsolute(relativePath)) {\n // 如果 __dirname 和 absolutePath 不在同一个磁盘中,则 path.relative(__dirname, absolutePath) 会返回后者\n // 因此此处就无需处理相对路径 #128\n }\n\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set the blacklist of characters which are allowed for this field. This can either be an array or a string. @param array|\ArrayObject|string $blacklist @throws \Exception
[ "public function setBlacklist($blacklist)\n {\n if (is_array($blacklist)) {\n $this->blacklist = array_map('strval', $blacklist);\n } elseif ($blacklist instanceof \\ArrayObject && true) {\n $this->blacklist = array_map('strval', $blacklist->getArrayCopy());\n } elseif ...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// SetupIngress setups ingress networking. // The function returns a channel which will signal the caller when the programming is completed.
[ "func (daemon *Daemon) SetupIngress(create clustertypes.NetworkCreateRequest, nodeIP string) (<-chan struct{}, error) {\n\tip, _, err := net.ParseCIDR(nodeIP)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdone := make(chan struct{})\n\tdaemon.enqueueIngressJob(&ingressJob{&create, ip, done})\n\treturn done, nil\n...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Returns a rot13 encrypted string as well as a JavaScript decoder function. http://snipplr.com/view/6037/ @param string $string Value to be encoded @return mixed An encoded string and javascript decoder function
[ "public function encodeRot13($string)\n {\n $rot13encryptedString = str_replace('\"', '\\\"', str_rot13($string));\n\n $uniqueId = uniqid('sproutencodeemail-', true);\n $countId = $this->count++;\n $ajaxId = Craft::$app->getRequest()->isAjax ? '-ajax' : '';\n\n $encodeId = $uni...
[ "protected function getSnippetArrayFor($template, array $vars, $emailLocale)\n {\n // add a code snippet to reference the random image you added in the getParamArrayFor() method.\n // in the mean time it has been base64-encoded and attached as mime-part to your email.\n $vars['sampleSnippetW...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetSchedule sets the Schedule field's value.
[ "func (s *UpdateMaintenanceWindowInput) SetSchedule(v string) *UpdateMaintenanceWindowInput {\n\ts.Schedule = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetRepositoryName sets the RepositoryName field's value.
[ "func (s *Repository) SetRepositoryName(v string) *Repository {\n\ts.RepositoryName = &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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
rubocop:enable Metrics/PerceivedComplexity,Style/ConditionalAssignment
[ "def read_symbol\n logger.debug \" read symbol\"\n skip_whitespace\n r = \"\"\n while !empty? && (c = text[position]) =~ /[-a-zA-Z_0-9]/\n r << c\n increase\n end\n s = STRING_TO_TOKEN[r]\n s = r.to_sym unless s\n s = true if s == :true\n s = false if s ==...
[ "def plugins():\n \n return (\n ClassFactoring,\n ConstantLogic,\n ExceptStatements,\n FutureCompatibility,\n ImportOrder,\n Indentation,\n MissingContextManager,\n NewStyleClasses,\n Newlines,\n PrintStatements,\n TrailingWhitespace,\n PEP8VariableNames,\n PyflakesChecker,\...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
It's designed for field/method/class/column/table names. and source and target Strings will be cached. @param str @return
[ "public static String toLowerCaseWithUnderscore(final String str) {\r\n if (N.isNullOrEmpty(str)) {\r\n return str;\r\n }\r\n\r\n String result = lowerCaseWithUnderscorePropNamePool.get(str);\r\n\r\n if (result == null) {\r\n result = StringUtil.toLowerCaseWithUnder...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
change pernmissions of path
[ "def chmod(path, mode):\n \"\"\"\"\"\"\n import os, stat\n st = os.stat(path)\n return os.chmod(path, mode)" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Pluralize or Singularize a string @param string $string @param int $pluralize @return string
[ "public function inflect(string $string, $pluralize = 0) : string\n {\n return ($pluralize) ? Inflect::pluralize($string) : Inflect::singularize($string);\n }" ]
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// MarkPodAsCritical adds the required annotations for a pod to be considered critical
[ "func MarkPodAsCritical(pod *v1.Pod) {\n\tif pod.ObjectMeta.Annotations == nil {\n\t\tpod.ObjectMeta.Annotations = make(map[string]string)\n\t}\n\tpod.ObjectMeta.Annotations[\"scheduler.alpha.kubernetes.io/critical-pod\"] = \"\"\n\n\ttoleration := v1.Toleration{\n\t\tKey: \"CriticalAddonsOnly\",\n\t\tOperator:...
[ "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 post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Deletes all charts. @return string Returns the file path. @throws Exception
[ "public function deleteCharts()\n {\n //check whether workshett name is set or not\n if ($this->worksheetName == '')\n throw new Exception('Worksheet name not specified');\n $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetNa...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// GetByIndex gets the key and value at the specified index.
[ "func (t *ImmutableTree) GetByIndex(index int64) (key []byte, value []byte) {\n\tif t.root == nil {\n\t\treturn nil, nil\n\t}\n\treturn t.root.getByIndex(t, index)\n}" ]
[ "function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object....
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
写出图像为指定格式 @param image {@link Image} @param imageType 图片类型(图片扩展名) @param destImageStream 写出到的目标流 @param quality 质量,数字为0~1(不包括0和1)表示质量压缩比,除此数字外设置表示不压缩 @return 是否成功写出,如果返回false表示未找到合适的Writer @throws IORuntimeException IO异常 @since 4.3.2
[ "public static boolean write(Image image, String imageType, ImageOutputStream destImageStream, float quality) throws IORuntimeException {\r\n\t\tif (StrUtil.isBlank(imageType)) {\r\n\t\t\timageType = IMAGE_TYPE_JPG;\r\n\t\t}\r\n\r\n\t\tfinal ImageWriter writer = getWriter(image, imageType);\r\n\t\treturn write(toBu...
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Programming:" }
//const RegistryURL = "http://localhost:8082/servicecontroller/registerService" /* RegisterService handles service registartion with Piazza for external services. */
[ "func RegisterService(m ResourceMetadata) error {\n\tdata, err := json.Marshal(m)\n\tif err != nil {\n\t\treturn errors.New(\"Error marshaling ResourceMetadata\")\n\t}\n\n\tresponse, err := http.Post(\n\t\tRegistryURL, ContentTypeJSON, bytes.NewBuffer(data),\n\t)\n\tif err != nil {\n\t\treturn errors.New(\"Error po...
[ "@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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *CreateInsightInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateInsightInput\"}\n\tif s.Filters == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Filters\"))\n\t}\n\tif s.GroupByAttribute == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"GroupBy...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks if is generated entity. @param fullName the full name @return true, if is generated entity
[ "private boolean isGeneratedEntity(String fullName) {\n\t\tfor (GeneratedTypeElement item : this.generatedEntities) {\n\t\t\tif (item.getQualifiedName().equals(fullName)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// UnmarshalJSON sets the object from the provided JSON representation
[ "func (l *EMRClusterInstanceTypeConfigList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := EMRClusterInstanceTypeConfig{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = EMRClusterInstanceTypeConfigList{item}\n\t\treturn ni...
[ "@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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get events for the given query.
[ "def get_filter_events(\n self,\n contract_address: Address,\n topics: List[str] = None,\n from_block: BlockSpecification = 0,\n to_block: BlockSpecification = 'latest',\n ) -> List[Dict]:\n \n logs_blocks_sanity_check(from_block, to_block)\n ...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Upgrades the data and settings for this module if needed. The install now checks for the data model and can do an upgrade instead of a clean install. @return bool Whether the upgrade was successful. @throws \Exception
[ "protected function doUpgrade()\n {\n //Install/update datamodel first.\n $result = $this->doInstall();\n\n $this->registry->load->model('setting/setting');\n $setting = $this->registry->model_setting_setting->getSetting('acumulus_siel');\n $currentDataModelVersion = isset($set...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about AWS Auto Scaling:" }
Dump the content from the last response. @return void
[ "public function dump()\n {\n $content = $this->response->getContent();\n\n $json = json_decode($content);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n $content = $json;\n }\n\n dd($content);\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about File management:" }
record behavior. @param statistics {Array} sum, max, min, count, avg @param aggregations {Array} dy (day in week each year), hm(hour of day each month).
[ "function record(name, num, statistics, aggregations, timestamp, callback) {\n timestamp = timestamp || Date.now();\n function recordStats(key) {\n statistics && statistics.forEach(function(stat) {\n if(stat == 'sum') {\n multi.hincrby(key, 'sum', n...
[ "function(c, i, array) {\n if (c === undefined || c === null) return;\n // c is the component, type is dimension|attribute,\n // level is dataset|series|observation, i is index,\n // array is the component array\n failed += !iterator.call(context, c, type, level, i, array);\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Purge clears everything from the cache
[ "func (lru *TTLRUCache) Purge() {\n\tlru.lock.Lock()\n\tdefer lru.lock.Unlock()\n\n\tlru.mapping = make(map[interface{}]*triple)\n\tlru.order = list.New()\n\tlru.timeorder = list.New()\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 description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Gets the function that is passed to the rendering environment. @return mixed|\Closure
[ "public function getFunction()\n {\n return function ($pathName) {\n $data = $this->context->getData();\n\n if (array_key_exists('sys_pathNames', $data)) {\n if (array_key_exists($pathName, $data['sys_pathNames'])) {\n return $this->context->renderSt...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
<p> The Scheduled Instance IDs. </p> @param scheduledInstanceIds The Scheduled Instance IDs.
[ "public void setScheduledInstanceIds(java.util.Collection<String> scheduledInstanceIds) {\n if (scheduledInstanceIds == null) {\n this.scheduledInstanceIds = null;\n return;\n }\n\n this.scheduledInstanceIds = new com.amazonaws.internal.SdkInternalList<String>(scheduledIns...
[ "public function setNotificationType($s) {\n if (is_string($s)){\n $this->options['Subscription.NotificationType'] = $s;\n $this->options['NotificationType'] = $s;\n } else {\n return false;\n }\n /*\n * List of valid Notification Types:\n ...
codesearchnet
{ "query": "Represent the summarization about AWS Redshift:", "pos": "Represent the code about AWS Redshift:", "neg": "Represent the code about programming:" }
// SetRemoteAccessAllowed sets the RemoteAccessAllowed field's value.
[ "func (s *AssociateTeamMemberInput) SetRemoteAccessAllowed(v bool) *AssociateTeamMemberInput {\n\ts.RemoteAccessAllowed = &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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Initial query or getMore. Returns a Future.
[ "def _get_more(self):\n \"\"\"\"\"\"\n if not self.alive:\n raise pymongo.errors.InvalidOperation(\n \"Can't call get_more() on a MotorCursor that has been\"\n \" exhausted or killed.\")\n\n self.started = True\n return self._refresh()" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get time zone of the browser client to be used as default.
[ "private static String getClientTimeZone() {\n return ZonedDateTime.now(SPDateTimeUtil.getTimeZoneId(SPDateTimeUtil.getBrowserTimeZone())).getOffset().getId()\n .replaceAll(\"Z\", \"+00:00\");\n }" ]
[ "public static PendingResult<TimeZone> getTimeZone(GeoApiContext context, LatLng location) {\n return context.get(\n API_CONFIG,\n Response.class,\n \"location\",\n location.toString(),\n // Java has its own lookup for time -> DST, so we really only need to fetch the TZ id.\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// SetNextToken sets the NextToken field's value.
[ "func (s *DescribeLaunchConfigurationsOutput) SetNextToken(v string) *DescribeLaunchConfigurationsOutput {\n\ts.NextToken = &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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Generates a nested Hash object which is a copy of existing configuration
[ "def to_hash\n _copy = {}\n @table.each { |key, value| _copy[key] = value.is_a?(HashStruct) ? value.to_hash : value }\n _copy\n end" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Flickr API need a hash string which made using post arguments :param args: Arguments of the flickr request :type args: list of sets :return: api_sig, ex: ('api_sig', 'abcdefg') :rtype: tuple
[ "def _get_api_sig(args):\n \n tmp_sig = api_secret\n for i in args:\n tmp_sig = tmp_sig + i[0] + i[1]\n api_sig = hashlib.md5(tmp_sig.encode('utf-8')).hexdigest()\n return 'api_sig', api_sig" ]
[ "def restore(self):\n ''\n #\n #\n # As of 2016-06-15, Jottacloud.com has changed their restore api\n # To restore, this is what's done\n #\n # HTTP POST to https://www.jottacloud.com/web/restore/trash/list\n # Data:\n # hash:undefined\n # ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Retrieve a user by the given credentials. @param array $credentials @return \Illuminate\Auth\UserInterface|null
[ "public function retrieveByCredentials(array $credentials)\n\t{\n\t\tKinvey::setAuthMode('admin');\n\t\t$result = parent::retrieveByCredentials($credentials);\n\t\tKinvey::setAuthMode('app');\n\n\t\treturn $result;\n\t}" ]
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Sets the user info of the URL to userInfo. @param string|null $userInfo @return \MToolkit\Network\MUrl
[ "public function setUserInfo( $userInfo )\n {\n $userInfoParts = explode( \":\", $userInfo );\n $this->user = $userInfoParts[0];\n $this->password = $userInfoParts[1];\n\n return $this;\n }" ]
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
/////////////////////////////////////// // API helper methods /////////////////////////////////////// // CancelActiveOffers ...
[ "func (api *API) CancelActiveOffers() (err error) {\n\toffers, err := api.ActiveOffers()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor _, o := range offers {\n\t\terr = api.CancelOffer(o.ID)\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}" ]
[ "function init(config) {\n exports.config = config;\n MainViewManager\n .on(\"currentFileChange\", _onFileChange);\n DocumentManager\n .on(\"documentSaved\", _onDocumentSaved)\n .on(\"dirtyFlagChange\", _onDirtyFlagChange);\n ProjectManager\n ....
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Read json file (not in django fixture format) and create the appropriate records using the provided database model.
[ "def import_json(path, model, batch_len=100, db_alias='default', start_batch=0, end_batch=None, ignore_errors=False, verbosity=2):\n \"\"\"\"\"\"\n\n # TODO: use a generator to save memory for large json files/databases\n if verbosity > 0:\n print('Reading json records (dictionaries) from {0}.'.form...
[ "def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Return the name of the jb_sceneNode, that describes the current scene or None if there is no scene node. :returns: the full name of the node or none, if there is no scene node :rtype: str | None :raises: None
[ "def get_current_scene_node():\n \n c = cmds.namespaceInfo(':', listOnlyDependencyNodes=True, absoluteName=True, dagPath=True)\n l = cmds.ls(c, type='jb_sceneNode', absoluteName=True)\n if not l:\n return\n else:\n for n in sorted(l):\n if not cmds.listConnections(\"%s.reftra...
[ "def interface_required(interface):\n \n def _interface_required(func):\n \"\"\"Internal decorator that wraps around the decorated function.\n\n Args:\n func (function): function being decorated\n\n Returns:\n The wrapper function.\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Layout component for Messages @param BreadcrumbItem $mainItem @param Breadcrumb $breadcrumb @return string
[ "public function breadcrumb(BreadcrumbItem $mainItem, Breadcrumb $breadcrumb)\n {\n $this->dataCollection->add('mainItem', $mainItem);\n $this->dataCollection->add('breadcrumb', $breadcrumb);\n\n return $this->render('Breadcrumb');\n }" ]
[ "public function addSubMenu($label)\n {\n // we use MenuSeparator tag here just to put View_Popover outside of UL list.\n // Otherwise it breaks correct HTML and CSS.\n /** @type View_Popover $f */\n $f = $this->add('View_Popover');\n $this->addMenuItem($f->showJS('#'.$this->na...
codesearchnet
{ "query": "Represent the Github instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about text processing:" }
getter for importance - gets how important is this trigger for the event @generated @return value of the feature
[ "public String getImportance() {\n if (EventTrigger_Type.featOkTst && ((EventTrigger_Type)jcasType).casFeat_importance == null)\n jcasType.jcas.throwFeatMissing(\"importance\", \"de.julielab.jules.types.EventTrigger\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((EventTrigger_Type)jcasType).casFea...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }