query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
/*! get value of some record's propery
@param name
name of record's property ( name of db field or alias )
@return
value of related property | [
"function get_value($name){\r\n\t\tif (!array_key_exists($name,$this->data)){\r\n\t\t\tLogMaster::log(\"Incorrect field name used: \".$name);\r\n\t\t\tLogMaster::log(\"data\",$this->data);\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\treturn $this->data[$name];\r\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Extract delegates to opentracing.Tracer. | [
"func (t *Tracing) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error) {\n\treturn t.tracer.Extract(format, carrier)\n}"
] | [
"func init() {\n\t// take an output from a print function\n\toutput := pio.Wrap(logrus.Errorf)\n\t// register a new printer with name \"logrus\"\n\t// which will be able to read text and print as string.\n\tpio.Register(\"logrus\", output).Marshal(pio.Text)\n\n\t// p := pio.Register(\"logrus\", output).Marshal(pio.... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Execution loop
:param ifile: Input file object. Unused.
:type ifile: file
:return: `None`. | [
"def _execute(self, ifile, process):\n \n if self._protocol_version == 2:\n result = self._read_chunk(ifile)\n\n if not result:\n return\n\n metadata, body = result\n action = getattr(metadata, 'action', None)\n\n if action != 'exec... | [
"def _add_stage(self, name):\n \n def stage_func(self, *args, **kwargs):\n \"\"\" Stage function.\n\n :param args: Positional arguments.\n :param kwargs: Keyword arguments.\n :return: Pipeline (for method chaining).\n \"\"\"\n self._pip... | codesearchnet | {
"query": "Represent the sentence about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code:"
} |
Update the log summary. Triggered by logging of an exception/incident
via {@link #logSummary(boolean)}, or by daily log rolling {@link #rollLogs()}
@param incidents Thread-safe list that should be used to write summary contents | [
"private void logSummary(final List<IncidentImpl> incidents) {\n if (incidents.isEmpty())\n return;\n\n // summaryFile can be replaced so hold on to a local copy\n File outFile = summaryFile;\n\n if (outFile == null) {\n outFile = summaryFile = createNewSummaryFile(... | [
"@Scheduled(initialDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER, fixedDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER)\n public void autoAssignScheduler() {\n LOGGER.debug(\"auto assign schedule checker has been triggered.\");\n // run this code in system code privileged to have the necessary\n ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Delete event listener returns true on success
@param {Object} event
@param {Function} callback
@param {number} [idx]
@returns {boolean} | [
"function deleteListener(event, callback, idx) {\n if ((idx = event.listeners.indexOf(callback)) >= 0) {\n event.listeners.splice(idx, 1);\n event.meta.delete(callback);\n return true;\n }\n return false;\n}"
] | [
"function Message_post(body, // @arg Any - message body, instanceList[id]#inbox(,body,)\n callback) { // @arg Function = null - callback(err:Error, buffer:Array):void\n // @desc post to message asynchronously.\n//{@dev\n $valid($type(callback, \"Functio... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
create array of factories
@return array<*,\Closure>
@access protected | [
"protected function getFactories()\n {\n $escaper = $this->escaper;\n $input = (new AuraFactory())->newInputInstance();\n\n $factories = [\n 'escape' => function () use ($escaper) {\n return $escaper;\n },\n 'input' => function () use ($input... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
convenience methods | [
"@Override\n\tpublic void setAll(boolean value) {\n\t\tcheckMutable();\n\t\tif (value) {\n\t\t\tperformAdjSet(start, finish);\n\t\t} else {\n\t\t\tperformAdjClear(start, finish);\n\t\t}\n\t}"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Changes the contents of the section.
@param {String|DomNode} content | [
"function(content){\n\t\t\tif (typeof content === 'string') { //$NON-NLS-0$\n\t\t\t\tthis._contentParent.innerHTML = content;\n\t\t\t} else {\n\t\t\t\tthis._contentParent.innerHTML = \"\"; //NON-NLS-0$\n\t\t\t\tthis._contentParent.appendChild(content);\n\t\t\t}\n\t\t}"
] | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param $entityName
@param $where
@param array $joinConditions
@return int | [
"public function getTotalNumberOfElements($entityName, $where, $joinConditions = [])\n {\n $this->totalNumberOfElements = $this->getRepository($entityName)->getCount($where, $joinConditions);\n\n return $this->totalNumberOfElements;\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Scrape the node content and return the html
@return string Formatted string with all HTML | [
"private function cleanupHtml(): string {\n $topNode = $this->article()->getTopNode();\n\n if (empty($topNode)) {\n return '';\n }\n\n $this->removeParagraphsWithFewWords($topNode);\n\n $html = $this->convertToHtml($topNode);\n\n return str_replace(['<p></p>', '<... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initialize the connection
@return Builder
@throws | [
"public static function query()\n {\n if (static::$builder instanceof Builder) {\n if (static::$builder->getModel() == static::class) {\n return static::$builder;\n }\n }\n\n // Reflection action\n $reflection = new \\ReflectionClass(static::class)... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Pop instructions off `stack` until we pop all instructions that will
produce values popped by `instr`. | [
"def pop_arguments(instr, stack):\n \n needed = instr.stack_effect\n if needed >= 0:\n raise DecompilationError(\n \"%s is does not have a negative stack effect\" % instr\n )\n\n for popcount, to_pop in enumerate(reversed(stack), start=1):\n needed += to_pop.stack_effect\... | [
"def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Change database helper | [
"public function switchDb($db_name)\n {\n $self = $this;\n\n return $this->app['mongo'] = $this->app->share(\n function () use ($db_name, $self) {\n return new Db($db_name, $self->client, $self->app);\n }\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Instantiate class associated to the given property key
@param propertyKey property key
@param <T> class parameter type
@return class instance | [
"private <T> T instantiateClass(PropertyKey propertyKey) {\n T object = null;\n String property = properties.getProperty(propertyKey.getKey());\n if (property != null) {\n try {\n Class<T> clazz = ClassLoaderUtils.loadClass(property);\n LOGGER.debug(\"In... | [
"@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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
checks if the libmagic library installed is more recent than a given
version.
:param version: minimum version expected in the form XYY (i.e. 5.14 -> 514)
with XYY >= 513 | [
"def libmagic_version_at_least(version):\n \n if hasattr(magic, 'open'):\n magic_wrapper = magic._libraries['magic']\n elif hasattr(magic, 'from_buffer'):\n magic_wrapper = magic.libmagic\n else:\n raise Exception('Unknown magic API')\n\n if not hasattr(magic_wrapper, 'magic_vers... | [
"def has_stable_releases(self):\n \n nonzeroes = self.stable_families\n # Nothing but 0.x releases -> yup we're prehistory\n if not nonzeroes:\n return False\n # Presumably, if there's >1 major family besides 0.x, we're at least\n # one release into the 1.0 (or w... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the property value as a Timestamp.
@throws DatastoreException if no such property
@throws ClassCastException if value is not a Timestamp | [
"@SuppressWarnings(\"unchecked\")\n public Timestamp getTimestamp(String name) {\n return ((Value<Timestamp>) getValue(name)).get();\n }"
] | [
"protected static RuntimeException unsettable(String view, String attribute, boolean create) {\n // This matches the behavior of the real file system implementations: if the attempt to set the\n // attribute is being made during file creation, throw UOE even though the attribute is one\n // that cannot be ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
Return the default config for the handler | [
"def get_default_config(self):\n \n config = super(MQTTHandler, self).get_default_config()\n\n config.update({\n })\n\n return config"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Check the authorization for the command | [
"def check_auth(self, name):\n \n if name in self.auths:\n # if the command name is in the **need authorization list**\n # get the authorization for the command\n auth = self.auths[name]\n if self.args.auth is None:\n # if we didn't pass the a... | [
"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 sentence about Access control:",
"pos": "Represent the code about Access control:",
"neg": "Represent the code:"
} |
Deletes all possibles task files in directory, to allow to change the format | [
"def delete_all_possible_task_files(self, courseid, taskid):\n \n if not id_checker(courseid):\n raise InvalidNameException(\"Course with invalid name: \" + courseid)\n if not id_checker(taskid):\n raise InvalidNameException(\"Task with invalid name: \" + taskid)\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
获取前几个关键句子
@param size 要几个
@return 关键句子的下标 | [
"public int[] getTopSentence(int size)\n {\n Collection<Integer> values = top.values();\n size = Math.min(size, values.size());\n int[] indexArray = new int[size];\n Iterator<Integer> it = values.iterator();\n for (int i = 0; i < size; ++i)\n {\n indexArray[i]... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
Web service per la restituzione di un breadcrumbs in base ad un id
@return ViewModel | [
"public function breadcrumbsAction() \n\t{\n\t $default = 'dashboard';\n\t $id = $this->getRequest()->getQuery('id', $default);\n\t $pos = strpos($id, '/');\n\t $id = false !== $pos ? substr($id, 0, $pos) : $id;\n $view = $this->getServiceLocator()->get('Zend\\View\\Renderer\\PhpRenderer');\n ... | [
"public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{\n DFAgentDescription dfd = new DFAgentDescription();\n ServiceDescription sd = new ServiceDescription();\n \n sd.setType(serviceType);\n sd.setName(serviceName);\n \... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Execute.
@throws Exception the exception | [
"public void execute() throws Exception {\n final var jsonFile = new File(buildDir, \"classes/java/main/META-INF/spring-configuration-metadata.json\");\n if (!jsonFile.exists()) {\n throw new RuntimeException(\"Could not locate file \" + jsonFile.getCanonicalPath());\n }\n fin... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about N/A:"
} |
Return ``True`` if the given ``module`` object was imported from bootstrap code.
:param module: The module to check the provenance of.
:type module: :class:`types.ModuleType`
:rtype: bool | [
"def imported_from_bootstrap(self, module):\n \n\n # A vendored module.\n path = getattr(module, '__file__', None)\n if path and os.path.realpath(path).startswith(self._realpath):\n return True\n\n # A vendored package.\n path = getattr(module, '__path__', None)\n if path and any(os.path.r... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
A function that returns decorator that set scopes to some class/function
.. code-block:: python
@egg()
@scopes(SINGLETON_SCOPE)
class DepImpl:
pass
:param scope_type: Which scope should be used
:return: | [
"def scope(scope_type: str) -> Callable:\n \n\n def dec(egg_: T) -> T:\n egg_.__haps_custom_scope = scope_type\n return egg_\n\n return dec"
] | [
"def _add_stage(self, name):\n \n def stage_func(self, *args, **kwargs):\n \"\"\" Stage function.\n\n :param args: Positional arguments.\n :param kwargs: Keyword arguments.\n :return: Pipeline (for method chaining).\n \"\"\"\n self._pip... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetStateMachineArn sets the StateMachineArn field's value. | [
"func (s *DescribeStateMachineOutput) SetStateMachineArn(v string) *DescribeStateMachineOutput {\n\ts.StateMachineArn = &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:"
} |
We will implement writeObject in order to controll
the marshalling for this object.
Note, this is overriding the default implementation of
the Serializable interface.
@see java.io.Serializable | [
"private void writeObject(ObjectOutputStream out) throws IOException\n {\n try\n {\n out.defaultWriteObject();\n\n // p113380 - start of change\n // write out the header information\n out.write(EYECATCHER);\n out.writeShort(PLATFORM);\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 summarization about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code about programming:"
} |
// Compile compiles a package and returns the path to the compiled binary. | [
"func (p *Package) Compile(bin string) (string, error) {\n\tgobin, err := exec.LookPath(\"go\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(`failed to find a go compiler, looked in \"%s\"`, os.Getenv(\"PATH\"))\n\t}\n\tif runtime.GOOS == \"windows\" {\n\t\tbin += \".exe\"\n\t}\n\tc := exec.Cmd{\n\t\tPath: gobin... | [
"void appendGoogRequiresTo(StringBuilder sb) {\n for (GoogRequire require : googRequires.values()) {\n // TODO(lukes): we need some namespace management here... though really we need namespace\n // management with all declarations... The problem is that a require could introduce a name\n // alias ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Read a text based configuration file out of the force field mm2 file
@exception Exception Description of the Exception | [
"private void setForceFieldDefinitions() throws Exception {\n String sid = st.nextToken();\n String svalue = st.nextToken();\n if (sid.equals(\">bontunit\")) {\n try {\n double value1 = new Double(svalue).doubleValue();\n key = sid.substring(1);\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Copies a file/dir
@param {String} from From path
@param {String} to To path
@param {Function} callback Callback | [
"function(from, to, callback) {\n fse.copy(from, to, function (err) {\n if (err) {\n callback(err);\n } else {\n callback(null);\n }\n });\n}"
] | [
"function define(File, utils) {\n return class JSONFile extends File {\n /**\n * Constructor\n * @param {String} id\n * @param {String} filepath\n * @param {Object} options\n * - {Function} buildFactory\n * - {Object} fileCache\n * - {Object} fileExtensions\n * - {Function} f... | codesearchnet | {
"query": "Represent the description about file transfer:",
"pos": "Represent the code about file transfer:",
"neg": "Represent the code about Software development:"
} |
Override this mothod to deal with events for leader election.
@param event the ZooKeeper event | [
"@Override\n public void process(WatchedEvent event) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Received ZooKeeper Event, \" + \"type=\" + event.getType() + \", \" + \"state=\"\n + event.getState() + \", \" + \"path=\" + event.getPath());\n }\n\n switch (event.getType()) {\n case None:... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Plots three masks | [
"def plot_masks(mask_1, mask_2, mask_3):\n \"\"\"\"\"\"\n fig, ((ax1, ax2, ax3)) = plt.subplots(1, 3, figsize=(12, 5))\n for ax in [ax1, ax2, ax3]:\n ax.grid(False)\n ax.set_xticks([])\n ax.set_yticks([])\n ax1.set_title(\"Type 1\")\n ax1.imshow(mask_1, cmap='viridis')\n ax2.s... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Возвращает значение суммы
@return string Сумма | [
"public function getValue()\n {\n if ($this->_value < 10) {\n return '0.0' . $this->_value;\n } elseif ($this->_value < 100) {\n return '0.' . $this->_value;\n } else {\n return substr($this->_value, 0, -2) . '.' . substr($this->_value, -2);\n }\n }... | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
iterator utility | [
"function each (obj, func) {\n if (obj.forEach) {\n obj.forEach(func);\n } else {\n var p;\n for (p in obj) {\n if (obj.hasOwnProperty(p)) {\n func.call(obj, obj[p], p, obj);\n }\n }\n }\n}"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generate a documentation skeleton for the package key
@param string $packageKey The package key
@return array An array of generated filenames | [
"public function generateDocumentation($packageKey)\n {\n $documentationPath = Files::concatenatePaths([$this->packageManager->getPackage($packageKey)->getPackagePath(), 'Documentation']);\n $contextVariables = [];\n $contextVariables['packageKey'] = $packageKey;\n\n $templatePathAndF... | [
"def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Pop returns a message from the buffer | [
"func (channel MessageQueue) Pop() (*Message, bool) {\n\tmsg, more := <-channel\n\treturn msg, more\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
/*
Write a Java object value into the payload Stream.
<p>
Note that this method only works for the objectified primitive
object types (Integer, Double, Long ...), String's and byte arrays.
Javadoc description supplied by JsJmsMessage interface. | [
"public void writeObject(Object value) throws UnsupportedEncodingException {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, \"writeObject\", value);\n getBodyList().add(value);\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, ... | [
"@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 post about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code about Software development:"
} |
Setup icon options.
@param array $options
@param array $iconOptions
@return array | [
"protected function _setIconOptions(array $options = [], array $iconOptions = [])\n {\n $icon = $options['icon'];\n if (Arr::key('iconInline', $options)) {\n $iconPrefix = $this->_configRead('iconPref');\n $options = $this->_addClass($options, implode(' ', [\n $... | [
"public function getViewer($action)\n {\n // Answer Viewer Object (from parent):\n \n if (!$this->isCMSPreview()) {\n return parent::getViewer($action);\n }\n \n // Load Page Requirements (uses theme):\n \n PageController::create(Page::create())-... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Return a URL string in which the port is always specified. | [
"private static String normalizeURL(String urlString)\n throws MalformedURLException {\n URL url = new URL(urlString);\n if (url.getPort() == -1) {\n return url.getProtocol() + \"://\" + url.getHost() + \":\"\n + url.getDefaultPort() + url.getFile()\n ... | [
"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 Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Removes a symbol from the array of symbols.
It is recommended to only remove custom symbols
(that have been added via the addSymbol() method)
@param AbstractSymbol $symbol
@return void | [
"public function remove(AbstractSymbol $symbol)\n {\n if (! in_array($symbol, $this->symbols)) {\n throw new \\InvalidArgumentException('Error: Cannot remove symbol, because it is unknown');\n }\n\n unset($this->symbols[get_class($symbol)]);\n\n $this->validate();\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Wraps a job.perform() call with timeout logic and exception handlers.
This is the first call happening inside the greenlet. | [
"def perform_job(self, job):\n \n\n if self.config[\"trace_memory\"]:\n job.trace_memory_start()\n\n set_current_job(job)\n\n try:\n job.perform()\n\n except MaxConcurrencyInterrupt:\n self.log.error(\"Max concurrency reached\")\n job._s... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// newRequestTracker creates a new tracker for an RPC request (client or server). | [
"func newRequestTracker(req requestDescriptor, profile *StatsProfile) *tracker {\n\treturn &tracker{\n\t\tprofile: profile,\n\t\tmethod: req.Endpoint(),\n\t\tservice: req.Service(),\n\t}\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// Less implements sort.Interface. | [
"func (t byTime) Less(i, j int) bool {\n\treturn t[i].Time.Before(t[j].Time)\n}"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Trunks retrieves the list of child Trunks of the VPort | [
"func (o *VPort) Trunks(info *bambou.FetchingInfo) (TrunksList, *bambou.Error) {\n\n\tvar list TrunksList\n\terr := bambou.CurrentSession().FetchChildren(o, TrunkIdentity, &list, info)\n\treturn list, err\n}"
] | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Natural Language Processing:"
} |
Method to determine how to handle the request.
Uses the currency service to set the active currency
@param \SS_HTTPRequest $request
@return array | [
"public function process(\\SS_HTTPRequest $request)\n {\n if ($identifier = $request->param('ID')) {\n if ($this->currencyService->setActiveCurrency(new Identifier($identifier))) {\n return [\n 'Success' => true\n ];\n }\n }\n\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 description about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about Programming:"
} |
expr is an EachOf and there is some partition of T into T1, T2,… such that for every expression
expr1, expr2,… in shapeExprs, matches(Tn, exprn, m). | [
"def matchesEachOf(cntxt: Context, T: RDFGraph, expr: ShExJ.EachOf, _: DebugContext) -> bool:\n \n\n return EachOfEvaluator(cntxt, T, expr).evaluate(cntxt)"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get facts.
@return array | [
"public function getFacts()\n {\n if ($this->facts === null) {\n $this->setFacts($this->nodeService->getNodeFacts($this->getName()));\n }\n return $this->facts;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
End $.fn.SPServices.SPXmlToJson | [
"function attrToJson(v, objectType) {\n function identity(x) { return x; }\n\n var result = {\n\n /* Generic [Reusable] Functions */\n \"Integer\": intToJsonObject,\n \"Number\": floatToJsonObject,\n \"Boolean\": booleanToJsonObject,\n \"DateTime\... | [
"def getSearch(self):\n \"\"\"\"\"\"\n return Search(self.getColumns(), Sitools2Abstract.getBaseUrl(self) + self.getUri())"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Creates the following structure:
/plugins
__init__.py
hello.py
/templates
blank.html
.gitignore
run_will.py
requirements.txt
Procfile
README.md | [
"def main():\n \n\n print_head()\n puts(\"Welcome to the will project generator.\")\n puts(\"\")\n\n if args.config_dist_only:\n print(\"Generating config.py.dist...\")\n\n else:\n print(\"\\nGenerating will scaffold...\")\n\n current_dir = os.getcwd()\n plugins_dir = os.path.j... | [
"def prepare(self):\n ''''''\n self.__make_scubadir()\n\n if self.is_remote_docker:\n '''\n Docker is running remotely (e.g. boot2docker on OSX).\n We don't need to do any user setup whatsoever.\n\n TODO: For now, remote instances won't have any .scub... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// FromEnv uses environment variables to set the tracer's Configuration | [
"func FromEnv() (*Configuration, error) {\n\tc := &Configuration{}\n\n\tif e := os.Getenv(envServiceName); e != \"\" {\n\t\tc.ServiceName = e\n\t}\n\n\tif e := os.Getenv(envRPCMetrics); e != \"\" {\n\t\tif value, err := strconv.ParseBool(e); err == nil {\n\t\t\tc.RPCMetrics = value\n\t\t} else {\n\t\t\treturn nil, ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetTags sets the Tags field's value. | [
"func (s *GetLicenseConfigurationOutput) SetTags(v []*Tag) *GetLicenseConfigurationOutput {\n\ts.Tags = 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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the search results as a list of JSON objects. | [
"def json(self):\n \"\"\"\"\"\"\n if self.search_results is None:\n return None\n\n result = []\n for row in self.search_results['rows']:\n obj = {}\n for index in range(0, len(self.search_results['fields'])):\n obj[self.search_results['fie... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param NodeBuilder $node
@return NodeBuilder | [
"protected function getChildren(NodeBuilder $node)\n {\n $node = $this->getOptionsNodes($node);\n $node = $this->getConnectionsNodes($node);\n $node = $this->getOverridesNodes($node);\n\n return $node;\n }"
] | [
"public void buildSignature(XMLNode node, Content constructorDocTree) {\n constructorDocTree.addContent(\n writer.getSignature(\n (ConstructorDoc) constructors.get(currentConstructorIndex)));\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Once the process exits successfully, we call this function | [
"function openSerialPortDevice(readFd) {\n\t\t//Save TTY streams\n\t\tself._readStream = new tty.ReadStream(readFd);\n\t\tself._readStream.setRawMode(true);\n\t\tself._writeStream = self._readStream;\n\t\t//Setup error handlers\n\t\tself._readStream.on(\"error\", function(err) {\n\t\t\tself.emit(\"error\", err);\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Clicks an element using pure JS. Does not use jQuery. | [
"def __js_click(self, selector, by=By.CSS_SELECTOR):\n \n selector, by = self.__recalculate_selector(selector, by)\n css_selector = self.convert_to_css_selector(selector, by=by)\n css_selector = re.escape(css_selector)\n css_selector = self.__escape_quotes_if_needed(css_selector)\... | [
"function showDropdown(position) {\n // If the dropdown is already visible, just return (so the root click handler on html\n // will close it).\n if ($dropdown) {\n return;\n }\n\n Menus.closeAll();\n\n $dropdown = $(renderList())\n .css({\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Send command and wait for single line output. | [
"def send_command_return(self, obj, command, *arguments):\n \n index_command = obj._build_index_command(command, *arguments)\n return obj._extract_return(command, self.chassis_list[obj.chassis].sendQuery(index_command))"
] | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
// Accepts a sorted slice of durations in nanoseconds
// Returns a Stats struct of millisecond statistics | [
"func Get(data []int) Stats {\n\tif len(data) == 0 {\n\t\treturn Stats{}\n\t}\n\tmin, max := minmax(data)\n\n\treturn Stats{\n\t\tAvg: avg(data) / msFactor,\n\t\tMin: min / msFactor,\n\t\tMax: max / msFactor,\n\t\tP50: p(data, 0.5) / msFactor,\n\t\tP75: p(data, 0.75) / msFactor,\n\t\tP90: p(data, 0.9) / msFactor,\n... | [
"void drainBuffers() {\n // A mostly strict ordering is achieved by observing that each buffer\n // contains tasks in a weakly sorted order starting from the last drain.\n // The buffers can be merged into a sorted array in O(n) time by using\n // counting sort and chaining on a collisio... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Parse out a hash from a list of key=value strings | [
"def cli_hash(list_of_kv):\n \"\"\"\"\"\"\n ev_obj = {}\n for extra_var in list_of_kv:\n ev_list = extra_var.split('=')\n key = ev_list[0]\n val = '='.join(ev_list[1:]) # b64 and other side effects\n ev_obj[key] = val\n\n return ev_obj"
] | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// getAgentStatus return overall agent status + status of the plugins
// the method takes into account non-fatal plugin settings | [
"func (p *Plugin) getAgentStatus() ExposedStatus {\n\n\texposedStatus := ExposedStatus{\n\t\tAgentStatus: p.StatusCheck.GetAgentStatus(),\n\t\tPluginStatus: p.StatusCheck.GetAllPluginStatus(),\n\t\tNonFatalPlugins: p.NonFatalPlugins,\n\t}\n\n\t// check whether error is caused by one of the plugins in NonFata... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Technology:"
} |
Flatten all files which also flattens the filenames (groups) with dots.
Note: This will remove any empty language files
@return \Illuminate\Support\Collection | [
"public function flatten()\n {\n return $this->translations->map(function ($values, $groupkey) {\n return $this->prependGroupkey($values, $groupkey);\n })->collapse();\n }"
] | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Retrieves a file for the controller by querying the nearest station.
@param AbstractHourlyService $service
@param DWDStation $nearestStation
@param bool $forceDownloadFile
@return string filePath | [
"public function retrieveFile(AbstractHourlyService $service, DWDStation $nearestStation, $forceDownloadFile = false)\n {\n $config = DWDConfiguration::getConfiguration();\n $ftpConfig = $config->ftp;\n\n\n $fileName = $service->getFileName($nearestStation->getId());\n $ftpPath = $ser... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Return the 1-based index of the first item on this page. | [
"def start_index(self):\n \"\"\"\"\"\"\n paginator = self.paginator\n # Special case, return zero if no items.\n if paginator.count == 0:\n return 0\n elif self.number == 1:\n return 1\n return (\n (self.number - 2) * paginator.per_page + pa... | [
"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 Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Set of hyperparameters.
languagemodel_wiki_scramble1k50, 1gpu, 7k steps (10min): log(ppl)_eval = 2.60
12.0 steps/sec on P100
8gpu (8x batch), 7k steps: log(ppl)_eval = 2.00
Returns:
a hparams object | [
"def aligned_base():\n \n hparams = common_hparams.basic_params1()\n hparams.hidden_size = 512\n hparams.batch_size = 5000\n hparams.max_length = 0\n hparams.min_length_bucket = 1024\n hparams.dropout = 0.0\n hparams.layer_prepostprocess_dropout = 0.0\n hparams.label_smoothing = 0.0\n hparams.clip_grad_no... | [
"def _results(r):\n \"\"\"\n x, funcalls, iterations, flag = r\n return results(x, funcalls, iterations, flag == 0)"
] | codesearchnet | {
"query": "Represent the post about Deep Learning:",
"pos": "Represent the code about Deep Learning:",
"neg": "Represent the code about programming:"
} |
Read configuration file line by line
@param string $filename
@return array Array with count of total and read lines | [
"public function read(string $filename): array\n {\n $lines = ['total' => 0, 'read' => 0];\n\n // Open file as SPL object\n $file = new \\SplFileObject($filename);\n\n // Read line by line\n while (!$file->eof()) {\n $line = $file->fgets();\n // Save line ... | [
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get the set with the corresponding name.
Args:
name: Name of the set to be found.
Raises:
TypeError: if the specified set does not exist. | [
"def getSet(self, name):\n \n return lock_and_call(\n lambda: Set(self._impl.getSet(name)),\n self._lock\n )"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Follow a given blog
@param blogName The name of the blog to follow | [
"public void follow(String blogName) {\n Map<String, String> map = new HashMap<String, String>();\n map.put(\"url\", JumblrClient.blogUrl(blogName));\n requestBuilder.post(\"/user/follow\", map);\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
<p>Get PrcPurchaseReturnLineCreate (create and put into map).</p>
@param pAddParam additional param
@return requested PrcPurchaseReturnLineCreate
@throws Exception - an exception | [
"protected final PrcPurchaseReturnLineCreate<RS>\n lazyGetPrcPurchaseReturnLineCreate(\n final Map<String, Object> pAddParam) throws Exception {\n @SuppressWarnings(\"unchecked\")\n PrcPurchaseReturnLineCreate<RS> proc = (PrcPurchaseReturnLineCreate<RS>)\n this.processorsMap.get(PrcPurchaseReturn... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the comment about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about programming:"
} |
Retrieves the data associated to a path.
Args:
path (str): path of the file entry.
Returns:
bytes: data or None if not available. | [
"def GetDataByPath(self, path):\n \n _, path_data = self._paths.get(path, (None, None))\n return path_data"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
converts unicode HTML to real Unicode | [
"def convert_unicode(text):\n\t\n\tif isPython2:\n\t\th = HTMLParser()\n\t\ts = h.unescape(text)\n\telse:\n\t\ttry:\n\t\t\ts = unescape(text)\n\t\texcept Exception:\n\t\t\t# Python 3.3 and below\n\t\t\t# https://stackoverflow.com/a/2360639/2295672\n\t\t\ts = HTMLParser().unescape(text)\n\treturn s"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns the probability of k of a specific number of tries n and probability p
@param k
@param p
@param n
@return | [
"public static double binomial(int k, double p, int n) {\n if(k<0 || p<0 || n<1) {\n throw new IllegalArgumentException(\"All the parameters must be positive and n larger than 1.\");\n }\n \n k = Math.min(k, n); \n \n /*\n //Slow and can't handle large nu... | [
"def mdl(ll, k, data):\n \n\n \"\"\"\n N - no. of genes\n n - no. of cells \n k - no. of cell types\n R - sum(Dataset) i.e. total no. of reads\n\n function TotCost = TotBits(N,m,p,R,C)\n # C is the cost from the cost function\n TotCost = C + (N*m + m*p)*(log(R/(N*p)));\n \"\"\"... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get all the nodes that are common to both networks. | [
"def get_shared_nodes(G1: nx.DiGraph, G2: nx.DiGraph) -> List[str]:\n \"\"\"\"\"\"\n return list(set(G1.nodes()).intersection(set(G2.nodes())))"
] | [
"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 Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
statement : BORDER expr | [
"def p_statement_border(p):\n \n p[0] = make_sentence('BORDER',\n make_typecast(TYPE.ubyte, p[2], p.lineno(1)))"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create and return a LinkedList of a combination of both scids and siids.
This is a method that is used primarily in the creation of split packets.
@return combined LikedList | [
"public LinkedList<ProbeIdEntry> getCombinedIdentifierList() {\n LinkedList<ProbeIdEntry> combinedList = new LinkedList<ProbeIdEntry>();\n\n for (String id : this.getProbeWrapper().getServiceContractIDs()) {\n combinedList.add(new ProbeIdEntry(\"scid\", id));\n }\n for (String id : this.getProbeWra... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Read lines list.
@param resourceClasspath the resource classpath
@param charsetName the charset name
@return the list | [
"public static List<String> readLines(String resourceClasspath,\n String charsetName) {\n return JMInputStream\n .readLines(getResourceInputStream(resourceClasspath),\n charsetName);\n }"
] | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the summarization about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@SuppressWarnings(\"unchecked\")\r\n\tpublic EList<Double> getCoordinates() {\r\n\t\treturn (EList<Double>) eGet(Ifc2x3tc1Package.Literals.IFC_CARTESIAN_POINT__COORDINATES, true);\r\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github instruction about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see org.apache.pluto.container.PortletURLProvider#write(java.io.Writer, boolean) | [
"@Override\n public void write(Writer out, boolean escapeXML) throws IOException {\n final String url = this.toURL();\n if (escapeXML) {\n StringEscapeUtils.escapeXml(out, url);\n } else {\n out.write(url);\n }\n }"
] | [
"@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com.... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Scan image standrad infos
@return array An array of retrieved image's infos | [
"public function getImageInfos()\n {\n if (!$this->exists()) {\n return false;\n }\n $data = getimagesize($this->getRealPath());\n $result = array();\n if (!empty($data)) {\n if (!empty($data[0])) {\n $result['width'] = $data[0];\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// Get returns the complex64 value or an error if not present. | [
"func (c Complex64) Get() (complex64, error) {\n\tif !c.Present() {\n\t\tvar zero complex64\n\t\treturn zero, errors.New(\"value not present\")\n\t}\n\treturn *c.value, nil\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Unlock the read lock | [
"func (p *Pool) ReadUnlock(ctx context.Context, id uint64) {\n\tp.lock.RUnlock(id)\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
set the value to the position of the tuple | [
"private void setTupleValue(Tuple tuple, int position, Object value, AbstractType<?> validator) throws ExecException\n {\n if (validator instanceof CollectionType)\n setCollectionTupleValues(tuple, position, value, validator);\n else\n setTupleValue(tuple, position, value);\n ... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the absolute path of a file.
@param path
@return String
@throws SshException | [
"public String getAbsolutePath(String path) throws SftpStatusException,\n\t\t\tSshException {\n\t\ttry {\n\t\t\tUnsignedInteger32 requestId = nextRequestId();\n\t\t\tPacket msg = createPacket();\n\t\t\tmsg.write(SSH_FXP_REALPATH);\n\t\t\tmsg.writeInt(requestId.longValue());\n\t\t\tmsg.writeString(path, CHARSET_ENCO... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Run the migrations.
@return void | [
"public function up()\n {\n //\n Schema::create('value_sets', function (Blueprint $table) {\n $table->increments('id');\n $table->string('key')->unique();\n $table->string('resource');\n $table->string('connection');\n $table->timestamps();\n ... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github comment about Database management:",
"pos": "Represent the Github code about Database management:",
"neg": "Represent the Github code about programming:"
} |
// RegisteredNotifiers returns a slice of all currently registered notifiers.
//
// NOTE: This function is safe for concurrent access. | [
"func RegisteredNotifiers() []*NotifierDriver {\n\tregisterMtx.Lock()\n\tdefer registerMtx.Unlock()\n\n\tdrivers := make([]*NotifierDriver, 0, len(notifiers))\n\tfor _, driver := range notifiers {\n\t\tdrivers = append(drivers, driver)\n\t}\n\n\treturn drivers\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 text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
// SetArtifactsOverride sets the ArtifactsOverride field's value. | [
"func (s *StartBuildInput) SetArtifactsOverride(v *ProjectArtifacts) *StartBuildInput {\n\ts.ArtifactsOverride = 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:"
} |
Load public key from the serialized blob.
Raise ValueError on parsing error. | [
"def decompress_pubkey(pubkey, curve_name):\n \n vk = None\n if len(pubkey) == 33:\n decompress = {\n CURVE_NIST256: _decompress_nist256,\n CURVE_ED25519: _decompress_ed25519,\n ECDH_CURVE25519: _decompress_ed25519,\n }[curve_name]\n vk = decompress(pub... | [
"def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Gets the previous and next page for a specific page in the treeview
@param int $idPage The page id
@param int $publishedOnly Only active pages will be taken in consideration | [
"public function getPrevNextPage($idPage, $publishedOnly = 1) {\n\t\n\t $output = array(\n\t 'prev' => null,\n\t 'next' => null\n\t );\n\t\n\t $melisPage = $this->getServiceLocator()->get('MelisEnginePage');\n\t $datasPagePublished = $melisPage->getDatasPage($idPage, 'published');\n\t $... | [
"protected function showsTopParentsOnly()\n {\n $relation = $this->getModelInformation()->list->default_top_relation;\n\n // If the default is to restrict to top-level only,\n // or the reverse with a user-initiated reversal (relation = false):\n // Restrict the query to top level.\n\... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Validate some assumptions about the new LocPathIterator and it's
owner and the state of the list. | [
"private static void validateNewAddition(Vector paths, ExpressionOwner owner, \n LocPathIterator path) \n\t\tthrows RuntimeException \n {\n \tassertion(owner.getExpression() == path, \"owner.getExpression() != path!!!\");\n\tint n = paths.size();\n\t// There should never b... | [
"@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:"
} |
// SetAllowSelfManagement sets the AllowSelfManagement field's value. | [
"func (s *UpdateUserProfileInput) SetAllowSelfManagement(v bool) *UpdateUserProfileInput {\n\ts.AllowSelfManagement = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
add the proper resources into the environment | [
"def __add_paths(self, config):\n \n bin_path = os.path.join(self.directory.install_directory(self.feature_name), 'bin')\n whitelist_executables = self._get_whitelisted_executables(config)\n for f in os.listdir(bin_path):\n for pattern in BLACKLISTED_EXECUTABLES:\n ... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
// NewProjectCreateCommand returns a new instance of an `argocd proj create` command | [
"func NewProjectCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {\n\tvar (\n\t\topts projectOpts\n\t)\n\tvar command = &cobra.Command{\n\t\tUse: \"create PROJECT\",\n\t\tShort: \"Create a project\",\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tif len(args) == 0 {\n\t\t\t\tc.HelpFu... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Initializes the module.
Note that if the module has learned parameters, those will be
reset. | [
"def initialize_module(self):\n \n kwargs = self._get_params_for('module')\n module = self.module\n is_initialized = isinstance(module, torch.nn.Module)\n\n if kwargs or not is_initialized:\n if is_initialized:\n module = type(module)\n\n if (i... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// NewSsoChangeLoginUrlType returns a new SsoChangeLoginUrlType instance | [
"func NewSsoChangeLoginUrlType(Description string) *SsoChangeLoginUrlType {\n\ts := new(SsoChangeLoginUrlType)\n\ts.Description = Description\n\treturn s\n}"
] | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Show configuration form for given area.
@param UserConfigurationListener $listener
@param AreaContract $area
@return type | [
"public function configure(UserConfigurationListener $listener, AreaContract $area)\n {\n $provider = $this->twoFactorProvidersService->getEnabledInArea($area);\n $userConfig = $this->userConfigService->saveConfig($provider);\n\n\n $form = $this->presenter->configure($userConfig, $area, $p... | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Documentation:"
} |
Wrapper around mkdir -pv
Returns a list of directories created | [
"def mkdirs(remote_dir, use_sudo=False):\n \n func = use_sudo and sudo or run\n result = func(' '.join(['mkdir -pv',remote_dir])).split('\\n')\n #extract dir list from [\"mkdir: created directory `example.com/some/dir'\"]\n if result[0]: result = [dir.split(' ')[3][1:-1] for dir in result if dir]\n ... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Collapses the expandable content
@returns {ExpandableTransition} An instance. | [
"function collapse() {\n previousHeight = element.scrollHeight;\n element.style.maxHeight = '0';\n _baseTransition.applyClass( classObject.COLLAPSED );\n\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
the way to add items to the set. | [
"def add(*args)\n args.flatten! # allow [] as a param\n args.each do |arg|\n arg = arg.to_sym if arg.is_a? String\n @set << arg unless @set.include? arg # avoid duplicates\n end\n end"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns the field names of the specified object.
@return array | [
"public function getFieldNames($objectName)\n {\n $fieldNames = array();\n $modelConfiguration = $this->getModelConfiguration($objectName);\n if (isset($modelConfiguration['__field_index'])) {\n $fieldNames = array_keys($modelConfiguration['__field_index']);\n }\n\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Documentation:"
} |
cminv ch=chname
Invert the color map in the channel/viewer | [
"def cmd_cminv(self, ch=None):\n \n viewer = self.get_viewer(ch)\n if viewer is None:\n self.log(\"No current viewer/channel.\")\n return\n\n viewer.invert_cmap()"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add validator error from validator classes and methods. This error
reset on every re-validation
@param string $fieldName dot-notated field name
@param string $ruleName name of validation rule
@param string $message error message
@return Structure | [
"public function addError($fieldName, $ruleName, $message)\n {\n $this->errors[$fieldName][$ruleName] = $message;\n\n return $this;\n }"
] | [
"public function validate() {\n if ($this->initializer) {\n Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);\n }\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
<pre>
Performs generic data validation for the operation to be performed
</pre> | [
"protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Invokes the interceptor on the object, then returns the object | [
"public function tap($object=null, $interceptor=null) {\n list($object, $interceptor) = self::_wrapArgs(func_get_args(), 2);\n \n $interceptor($object);\n return self::_wrap($object);\n }"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.