query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// DefineDataProperty is a Go equivalent of Object.defineProperty(o, name, {value: value, writable: writable,
// configurable: configurable, enumerable: enumerable}) | [
"func (o *Object) DefineDataProperty(name string, value Value, writable, configurable, enumerable Flag) error {\n\treturn tryFunc(func() {\n\t\to.self.defineOwnProperty(newStringValue(name), propertyDescr{\n\t\t\tValue: value,\n\t\t\tWritable: writable,\n\t\t\tConfigurable: configurable,\n\t\t\tEnumerabl... | [
"function check (value) {\n var validator = Validator();\n var checker = Object.create(Check, {\n value: {enumerable: true, value: value},\n validator: {enumerable: true, value: validator}\n });\n return checker;\n}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get Layout path, ex. application/Modules/Crm/Layouts/Account
@param string $entityType
@param bool $isCustom - if need to check custom folder
@return string | [
"protected function getLayoutPath($entityType, $isCustom = false)\n {\n $path = $this->paths['customPath'];\n\n if (!$isCustom) {\n $moduleName = $this->getMetadata()->getScopeModuleName($entityType);\n\n $path = $this->paths['corePath'];\n if ($moduleName !== false... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// mapServerToNodeName maps an OpenStack Server to a k8s NodeName | [
"func mapServerToNodeName(server *servers.Server) types.NodeName {\n\t// Node names are always lowercase, and (at least)\n\t// routecontroller does case-sensitive string comparisons\n\t// assuming this\n\treturn types.NodeName(strings.ToLower(server.Name))\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 Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Specify an index for the label properties.
@param string|array $properties
@return \Illuminate\Support\Fluent | [
"public function index($properties)\n {\n $properties = (array) $properties;\n\n foreach ($properties as $property)\n {\n $this->addCommand('index', ['property' => $property]);\n }\n }"
] | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
same as get_children_of except if any of the children are orbits, this will recursively
follow the tree to return a list of all children (grandchildren, etc) stars under that orbit | [
"def get_stars_of_children_of(self, component):\n \n\n stars = self.get_stars()\n orbits = self.get_orbits()\n stars_children = []\n\n for child in self.get_children_of(component):\n if child in stars:\n stars_children.append(child)\n elif chil... | [
"def check_next_match(self, match, new_relations, subject_graph, one_match):\n \"\"\"\"\"\"\n # only returns true for ecaxtly one set of new_relations from all the\n # ones that are symmetrically equivalent\n if not (self.criteria_sets is None or one_match):\n for check in sel... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(ListThingPrincipalsRequest listThingPrincipalsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listThingPrincipalsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshal... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set an option to the config
@param string $name
@param string $value
@return bool | [
"public function set($name, $value = null, $dontMarkDirty = false)\n {\n if (is_object($name)) {\n $name = get_object_vars($name);\n }\n\n if (!is_array($name)) {\n $name = array($name => $value);\n }\n\n foreach ($name as $key => $value) {\n if... | [
"public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about NLP:"
} |
Implementation of control logic in handleRequest. | [
"public void copy() {\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\tsb.append(\"Text 1 = \");\n\t\tif (tf1.getText() != null) {\n\t\t\tsb.append(tf1.getText());\n\t\t}\n\t\tsb.append(\"\\nText 2 = \");\n\t\tif (tf2.getText() != null) {\n\t\t\tsb.append(tf2.getText());\n\t\t}\n\t\tsb.append(\"\\nText 3 = \");\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 comment about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about Programming:"
} |
Add RoutesRefine to Router
@param routes_refine [Flame::Router::RoutesRefine] refined routes | [
"def add(routes_refine)\n\t\t\troutes.deep_merge! routes_refine.routes\n\t\t\treverse_routes.merge! routes_refine.reverse_routes\n\t\tend"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link Object }{@code >} | [
"@XmlElementDecl(namespace = \"http://www.opengis.net/citygml/vegetation/1.0\", name = \"_GenericApplicationPropertyOfVegetationObject\")\n public JAXBElement<Object> create_GenericApplicationPropertyOfVegetationObject(Object value) {\n return new JAXBElement<Object>(__GenericApplicationPropertyOfVegetati... | [
"@XmlElementDecl(namespace = \"http://www.opengis.net/gml\", name = \"_Curve\", substitutionHeadNamespace = \"http://www.opengis.net/gml\", substitutionHeadName = \"_GeometricPrimitive\")\n public JAXBElement<AbstractCurveType> create_Curve(AbstractCurveType value) {\n return new JAXBElement<AbstractCurve... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see javax.slee.Sbb#unsetSbbContext() | [
"public void unsetSbbContext() {\n\t\tthis.sbbContext = null;\n\t\tthis.tracer = null;\n\t\tthis.timerFacility = null;\n\t\tthis.nullACIFactory = null;\n\t\tthis.nullActivityFactory = null;\n\t\tthis.sipProvider = null;\n\t}"
] | [
"def addLocalCacheService(self):\n \"\"\n _cache = self.getCacheService()\n _cache.setName('cache_proxy')\n _cache.setServiceParent(self.hendrix)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set alias
@param string $alias alias
@param string $path path
@throws \InvalidArgumentException | [
"public static function setAlias(string $alias, string $path = null)\n {\n if ($alias[0] !== '@') {\n $alias = '@' . $alias;\n }\n\n // Delete alias\n if (!$path) {\n unset(self::$aliases[$alias]);\n\n return;\n }\n\n // $path 不是别名,直接设置\n... | [
"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 description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
@param array $data
@param Text $text
@return Text | [
"public function deserialize($data, Text $text)\n {\n $user = $this->tokenStorage->getToken()->getUser();\n\n if (isset($data['content'])) {\n $revision = new Revision();\n $revision->setContent($data['content']);\n $revision->setUser('anon.' === $user ? null : $use... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Updates the moving averages as needed. | [
"private void tickIfNecessary() {\n final long oldTick = lastTick.get();\n final long newTick = clock.tick();\n final long age = newTick - oldTick;\n if (age > TICK_INTERVAL) {\n final long newIntervalStartTick = newTick - age % TICK_INTERVAL;\n if (lastTick.compare... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Change window size | [
"def resize(self, width, height):\n \"\"\"\"\"\"\n SetWindowPos(self._hwnd, None, 0, 0, width, height, SWP_NOMOVE)"
] | [
"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:"
} |
Load a grammar with its dependencies
@param {string} lang
@param {function=} success
@param {function=} error | [
"function (lang, success, error) {\n\t\tvar load = function () {\n\t\t\tvar force = false;\n\t\t\t// Do we want to force reload the grammar?\n\t\t\tif (lang.indexOf('!') >= 0) {\n\t\t\t\tforce = true;\n\t\t\t\tlang = lang.replace('!', '');\n\t\t\t}\n\n\t\t\tvar data = lang_data[lang];\n\t\t\tif (!data) {\n\t\t\t\td... | [
"function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
https://github.com/decred/dcrd/blob/master/txscript/script.go | [
"def sighash_single(self, index, script=None,\n anyone_can_pay=False):\n '''\n \n '''\n copy_tx = self._sighash_prep(\n index=index,\n script=script)\n\n try:\n copy_tx_outs = copy_tx.tx_outs[:index + 1]\n copy_tx_o... | [
"def activate_script(self):\n \"\"\"\"\"\"\n\n # must be rethought\n # ./scripts\n # deploydir/./scripts\n self._add_scope(\"script\")\n self.scripts = {}\n self.script_files = [\n \"./scripts/script_*.txt\", \"~/.cloudmesh/scripts/script_*.txt\"]\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Auto Generated Code | [
"def system_monitor_compact_flash_threshold_marginal_threshold(self, **kwargs):\n \n config = ET.Element(\"config\")\n system_monitor = ET.SubElement(config, \"system-monitor\", xmlns=\"urn:brocade.com:mgmt:brocade-system-monitor\")\n compact_flash = ET.SubElement(system_monitor, \"compa... | [
"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 comment about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about File management:"
} |
Cuts the image proportionally and centered.
@access public
@param int $width Width crop.
@param int $height Height crop.
@return \GImage\Image | [
"public function centerCrop($width, $height)\n {\n $pwidth = $this->getPropWidth($height);\n $pheight = $this->getPropHeight($width);\n\n if ($pwidth == $width && $pheight == $height) {\n $this->resizeToWidth($width);\n } else {\n if ($pheight > $height) {\n ... | [
"public function isSmall() :bool {\n // Invoke cropToStyle, to get info about the size.\n $this->cropToStyle($this->configFactory->get('social_group.settings')->get('default_hero'));\n // Return info about the size.\n return $this->isSmall;\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about NLP:"
} |
Checks the foreignkeys of all references in the model.
@param modelDef The model
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the value for foreignkey is invalid | [
"private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException\r\n {\r\n if (CHECKLEVEL_NONE.equals(checkLevel))\r\n {\r\n return;\r\n }\r\n\r\n ClassDescriptorDef classDef;\r\n ReferenceDescriptorDef refDef;\r\n\r\n ... | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetCredentials sets the Credentials field's value. | [
"func (s *GetFederationTokenOutput) SetCredentials(v *Credentials) *GetFederationTokenOutput {\n\ts.Credentials = 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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Searches for a single real root inside the range. Only one root is assumed to be inside
@param l lower value of search range
@param u upper value of search range
@param index | [
"private void bisectionRoot( double l , double u , int index ) {\n\t\t// use bisection until there is an estimate within tolerance\n\t\tint iter = 0;\n\t\twhile( u-l > boundTolerance*Math.abs(l) && iter++ < maxBoundIterations) {\n\t\t\tdouble m = (l+u)/2.0;\n\t\t\tint numRoots = sturm.countRealRoots(m,u);\n\t\t\tif... | [
"def dimension(self):\n \n if self.dim > -1:\n return self.dim\n d = None\n if self.dim != -1 and not self._estimated: # fixed parametrization\n d = self.dim\n elif self._estimated: # parametrization finished. Dimension is known\n dim = len(self.... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $path
@param string $visibility
@return bool | [
"public function setVisibility($path, $visibility)\n {\n return (bool) $this->client->PutObjectAcl([\n 'Bucket' => $this->getBucket(),\n 'Key' => $path,\n 'ACL' => $this->normalizeVisibility($visibility),\n ]);\n }"
] | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get index of runs and assets for a given plugin.
Args:
plugin_name: Name of the plugin we are checking for.
Returns:
A dictionary that maps from run_name to a list of plugin
assets for that run. | [
"def PluginAssets(self, plugin_name):\n \n with self._accumulators_mutex:\n # To avoid nested locks, we construct a copy of the run-accumulator map\n items = list(six.iteritems(self._accumulators))\n\n return {run: accum.PluginAssets(plugin_name) for run, accum in items}"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the **Restore_Geometry_On_Layout_Change_checkBox** Widget. | [
"def __Restore_Geometry_On_Layout_Change_checkBox_set_ui(self):\n \n\n # Adding settings key if it doesn't exists.\n self.__settings.get_key(\"Settings\", \"restore_geometry_on_layout_change\").isNull() and \\\n self.__settings.set_key(\"Settings\", \"restore_geometry_on_layout_change\",... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Floor number with specific precision
@param int|float|string|Decimal $op operand
@return Decimal | [
"public function floor($prec = 0)\n {\n $dst = clone $this;\n $dst->value = $this->_floor($this->value, $prec);\n return $dst;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
BER encode the flags.
@return flags BER encoded. | [
"private byte[] berEncodedValue() {\n final ByteBuffer buff = ByteBuffer.allocate(5);\n buff.put((byte) 0x30); // (Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);\n buff.put((byte) 0x03); // size\n buff.put((byte) 0x02); // 4bytes int tag\n buff.put((byte) 0x01); // int size\n buf... | [
"def t_ATOM(self, t):\n '\n t.type = LDLfLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Regular expressions:"
} |
// TruncateWordsToWholeSentence takes content and truncates to whole sentence
// limited by max number of words. It also returns whether it is truncated. | [
"func (c *ContentSpec) TruncateWordsToWholeSentence(s string) (string, bool) {\n\tvar (\n\t\twordCount = 0\n\t\tlastWordIndex = -1\n\t)\n\n\tfor i, r := range s {\n\t\tif unicode.IsSpace(r) {\n\t\t\twordCount++\n\t\t\tlastWordIndex = i\n\n\t\t\tif wordCount >= c.summaryLength {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Call the adb executable from the SDK, passing the given commands as
arguments. | [
"def _adb(self, commands):\n \"\"\"\"\"\"\n ctx = self.ctx\n ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir,\n user_ndk_dir=self.ndk_dir,\n user_android_api=self.android_api,\n ... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetAllowedOrigins sets the AllowedOrigins field's value. | [
"func (s *CorsRule) SetAllowedOrigins(v []*string) *CorsRule {\n\ts.AllowedOrigins = v\n\treturn s\n}"
] | [
"public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {\n return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns all dependencies defined in dependency management of the root pom.
@return | [
"private Set<Artifact> getProjectDependencyManagement() {\n Set<Artifact> result = new LinkedHashSet<Artifact>();\n DependencyManagement dependencyManagement = getProject().getDependencyManagement();\n if (dependencyManagement != null) {\n for (Dependency dependency : dependencyManag... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Implementation of the ``cli`` method, just separated out for unit testing purposes | [
"def do_cli(ctx, location, runtime, dependency_manager, output_dir, name, no_input):\n \n LOG.debug(\"Init command\")\n click.secho(\"[+] Initializing project structure...\", fg=\"green\")\n\n no_build_msg = \"\"\"\nProject generated: {output_dir}/{name}\n\nSteps you can take next within the project fol... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Performs selection of provided item from Web List
@params option - string item name | [
"def select_option(self, option):\n \n items_list = self.get_options()\n for item in items_list:\n if item.get_attribute(\"value\") == option:\n item.click()\n break"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
A freedom port for a user-accessable api.
@class Consumer
@implements Port
@uses handleEvents
@param {Object} interfaceCls The api interface exposed by this consumer.
@param {Debug} debug The debugger to use for logging.
@constructor | [
"function (interfaceCls, debug) {\n this.id = Consumer.nextId();\n this.interfaceCls = interfaceCls;\n this.debug = debug;\n util.handleEvents(this);\n\n this.ifaces = {};\n this.closeHandlers = {};\n this.errorHandlers = {};\n this.emits = {};\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
查询字符串索引编号
@param str 字符串
@param indent 间隔
@return 字符串索引编号,-1表示词典中不存在字符串 | [
"public int lookupIndex(String str, int indent) {\r\n\t\tif (indent < 1)\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Invalid Argument in FeatureAlphabet: \" + indent);\r\n\r\n\t\tint ret = data.get(str);\r\n\r\n\t\tif (ret==-1 && !frozen) {//字典中没有,并且允许插入\r\n\t\t\tsynchronized (this) {\r\n\t\t\t\tdat... | [
"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 Github description about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about text processing:"
} |
/*
(non-Javadoc)
@see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream) | [
"public void encode(AsnOutputStream aos) throws EncodeException {\n\n if (acn == null)\n throw new EncodeException(\"Error encoding DialogResponseAPDU: Application Context Name must not be null\");\n if (result == null)\n throw new EncodeException(\"Error encoding DialogResponseA... | [
"@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ... | codesearchnet | {
"query": "Represent the Github comment about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code:"
} |
@param string $uri
@param MailboxRequest $mailboxRequest
@return Mailbox[]|PagedCollection | [
"private function loadMailboxes(string $uri, MailboxRequest $mailboxRequest): PagedCollection\n {\n /** @var HalPagedResources */\n $mailboxResources = $this->restClient->getResources(Mailbox::class, 'mailboxes', $uri);\n $mailboxes = $mailboxResources->map(function (HalResource $mailboxReso... | [
"public function create( models\\Call\\ContactEmail $ContactEmail){\n $rest = $this->getService( self::API_EMAIL);\n $rest->POST( $ContactEmail);\n\n return $rest->getResult( models\\Call\\ContactEmail::class);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software Development:"
} |
// MouseAction is a mouse action. | [
"func MouseAction(typ input.MouseType, x, y int64, opts ...MouseOption) Action {\n\tme := input.DispatchMouseEvent(typ, float64(x), float64(y))\n\n\t// apply opts\n\tfor _, o := range opts {\n\t\tme = o(me)\n\t}\n\n\treturn me\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetCurrentSubchain takes the given sigchain and walks backward until it
// finds the start of the current subchain, returning all the links in the
// subchain. See isSubchainStart for the details of the logic here. | [
"func (sc *SigChain) GetCurrentSubchain(m MetaContext, eldest keybase1.KID) (ChainLinks, error) {\n\treturn cropToRightmostSubchain(m, sc.chainLinks, eldest, sc.uid)\n}"
] | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
append `saltenv` to `url` as a query parameter to a 'salt://' url | [
"def add_env(url, saltenv):\n '''\n \n '''\n if not url.startswith('salt://'):\n return url\n\n path, senv = parse(url)\n return create(path, saltenv)"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Translates a list of dictionaries into internal list of variables | [
"def _translate_space(self, space):\n \n self.space = []\n self.dimensionality = 0\n self.has_types = d = {t: False for t in self.supported_types}\n\n for i, d in enumerate(space):\n descriptor = deepcopy(d)\n descriptor['name'] = descriptor.get('name', 'var_... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns a random given length size alphabetic string.
@param stringLength the length of the random string you want.
@return a random given length size alphabetic string. | [
"public static String getRandomString(final int stringLength) {\n\n StringBuilder stringBuilder = getStringBuild();\n for (int i = 0; i < stringLength; i++) {\n stringBuilder.append(getRandomAlphabetic());\n }\n return stringBuilder.toString();\n }"
] | [
"protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about AWS S3:"
} |
Find a child node of a given type in a parent struct, or return null. | [
"public static Node<PluralType> findChild(Struct<PluralType> parent, PluralType type) {\n for (Node<PluralType> n : parent.nodes()) {\n if (n.type() == type) {\n return n;\n }\n }\n return null;\n }"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retrieve an instance of an {@link ISonarConverter} object.
@return A singleton instance of {@link ISonarConverter}. | [
"public static ISonarConverter getConverterInstance() {\n\n if (converterInstance == null) {\n\n synchronized (DefaultSonarConverter.class) {\n\n if (converterInstance == null)\n converterInstance = new DefaultSonarConverter();\n }\n }\n\n ... | [
"@Help(help = \"Find the object of type {#} through the id\")\n public T findById(final String id) throws SDKException {\n return (T) requestGet(id, clazz);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
get the main component/interface from the Page
@return
@throws TransformerException | [
"private TagCIObject getTagCFObject(TagCIObject defaultValue) {\n\tif (_comp != null) return _comp;\n\n\t// first look for main\n\tIterator<Statement> it = getStatements().iterator();\n\tStatement s;\n\tTagCIObject t, sub = null;\n\n\twhile (it.hasNext()) {\n\t s = it.next();\n\t if (s instanceof TagCIObject)... | [
"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:"
} |
Save the taxonomy from the package to the cache location
@param string $cacheLocation
@return boolean | [
"public function saveTaxonomy( $cacheLocation )\r\n\t{\r\n\t\t// Initialize the context\r\n\t\t$context = XBRL_Global::getInstance();\r\n\t\t$context->useCache = true;\r\n\t\t$context->cacheLocation = $cacheLocation;\r\n\t\t$context->initializeCache();\r\n\r\n\t\t$this->determineSchemaFile();\r\n\r\n\t\t// Find the... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void eSet(int featureID, Object newValue) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.MDD__XM_BASE:\n\t\t\t\tsetXmBase((Integer)newValue);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.MDD__YM_BASE:\n\t\t\t\tsetYmBase((Integer)newValue);\n\t\t\t\tretur... | [
"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 post about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Returns a URL of the iCal feed
@param string $base_url Base URL
@param array $params Additional params
@return string | [
"public function getIcalURL($base_url = '', array $params = array()) {\n\n\t\t$user = elgg_get_logged_in_user_entity();\n\n\t\t$params['view'] = 'ical';\n\t\t$params['u'] = $user->guid;\n\t\t$params['t'] = $this->getUserToken($user->guid);\n\n\t\t$url = elgg_http_add_url_query_elements($base_url, $params);\n\t\tret... | [
"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 Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setRepTxtEx(Integer newRepTxtEx) {\n\t\tInteger oldRepTxtEx = repTxtEx;\n\t\trepTxtEx = newRepTxtEx;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.TEXT_FIDELITY__REP_TXT_EX, oldRepTxtEx, repTxtEx));\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 post about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Get a BO's attribute.
@param attrName
@return | [
"public Object getAttribute(String attrName) {\n Lock lock = lockForRead();\n try {\n return attributes != null ? attributes.get(attrName) : null;\n } finally {\n lock.unlock();\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Populate the source with the destination tags only if they
match the pattern rules for the tags
@param source The source to check
@param destination The destination to fill
@return The destination updated | [
"private static Set<String> populateTickets(Set<String> source, Set<String> destination) {\n\t\tfor (String ticket : source) {\n\t\t\tif (destination.contains(ticket)) {\n\t\t\t\tLOGGER.info(\"The ticket {} is already present in the collection and is ingored\", ticket);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdestination.a... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Stage seven saving of proto-network.
@param pn Proto-network
@param doc {@link Document}, the document
@return boolean true if success, false otherwise | [
"private boolean stage7(final ProtoNetwork pn, final Document doc) {\n beginStage(PHASE1_STAGE7_HDR, \"7\", NUM_PHASES);\n final StringBuilder bldr = new StringBuilder();\n\n bldr.append(\"Saving proto-network for \");\n bldr.append(doc.getName());\n stageOutput(bldr.toString());\... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the instruction about Data management:",
"pos": "Represent the code about Data management:",
"neg": "Represent the code:"
} |
// PasswordFieldFromInstance creates and initializes a password field based on its name, the reference object instance and field number. | [
"func PasswordFieldFromInstance(val reflect.Value, t reflect.Type, fieldNo int, name string) *Field {\n\tret := PasswordField(name)\n\tret.SetValue(fmt.Sprintf(\"%s\", val.Field(fieldNo).String()))\n\treturn ret\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set IP Block List
@param array|\Traversable $list
@return $this | [
"function setBlockList($list)\n {\n if ($list instanceof \\Traversable)\n $list = \\Poirot\\Std\\cast($list)->toArray();\n\n if (! is_array($list) )\n throw new \\InvalidArgumentException(sprintf(\n 'List must instanceof Traversable or array; given (%s).'\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
E.g. 4 2016 becomes 2016_4 | [
"private String getKeyForCalendarEvent(Calendar cal) {\n return cal.get(Calendar.YEAR) + \"_\" + cal.get(Calendar.MONTH);\n }"
] | [
"def new_station(self, _id, callSign, name, affiliate, fccChannelNumber):\n \"\"\"\"\"\"\n\n if self.__v_station:\n # [Station: 11440, WFLX, WFLX, Fox Affiliate, 29]\n # [Station: 11836, WSCV, WSCV, TELEMUNDO (HBC) Affiliate, 51]\n # [Station: 11867, TBS, Turner Broadc... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets comments in a box with the provided attributes.
Args:
box_key key for box
return (status code, list of comment dicts) | [
"def get_box_comments(self, box_key):\n\t\t'''\n\t\t'''\n\t\turi = '/'.join([\n\t\t\t\t\t\tself.api_uri,\n\t\t\t\t\t\tself.boxes_suffix,\n\t\t\t\t\t\tbox_key,\n\t\t\t\t\t\tself.comments_suffix\n\t\t\t\t\t\t])\n\t\treturn self._req('get', uri)"
] | [
"def all(self, data={}, **kwargs):\n \"\n return super(Invoice, self).all(data, **kwargs)"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Populate member data used by the rest of the reader.
@param reader parent file reader
@param file parent MPP file
@param root Root of the POI file system. | [
"private void populateMemberData(MPPReader reader, ProjectFile file, DirectoryEntry root) throws IOException\n {\n m_reader = reader;\n m_root = root;\n m_file = file;\n m_eventManager = file.getEventManager();\n\n m_calendarMap = new HashMap<Integer, ProjectCalendar>();\n m_projectD... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Given a string, split on a section, and return the two sections as a tuple.
:param word:
:param section:
:return:
>>> split_on('hamrye', 'ham')
('ham', 'rye') | [
"def split_on(word: str, section: str) -> Tuple[str, str]:\n \n return word[:word.index(section)] + section, word[word.index(section) + len(section):]"
] | [
"def handle_whitespace(text):\n \n \"\"\"\n text = re_retab.sub(sub_retab, text)\n text = re_whitespace.sub('', text).strip()\n return text"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetSampleRate sets the SampleRate field's value. | [
"func (s *Eac3Settings) SetSampleRate(v int64) *Eac3Settings {\n\ts.SampleRate = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
this methods should be moved to Models\Accounts but that would break backward compatiblity | [
"public static function getFirstEnabledWithLogin(string $posted_login) :?Accounts {\n\t\treturn \\Models\\Accounts::_select()\n\t\t\t->first()\n\t\t\t->where([\n\t\t\t\t'login'\t\t=> $posted_login,\n\t\t\t\t'is_enabled'=> 1\n\t\t\t])\n\t\t\t->execute();\n\t}"
] | [
"def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param ResourceInterface $resource
@return Definition | [
"private function createControllerDefinition(ResourceInterface $resource)\n {\n $definition = new Definition($resource->getController(), [\n new Reference('lug.resource.'.$resource->getName()),\n ]);\n\n $definition->addMethodCall('setContainer', [new Reference('service_container'... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Update table dataframe, and append a new column
Parameters
----------
label : str
Returns
---------
last_col: int
index column number of added col | [
"def add_col(self, label):\n \n self.table.dataframe[label] = ''\n self.AppendCols(1, updateLabels=False)\n last_col = self.table.GetNumberCols() - 1\n self.SetColLabelValue(last_col, label)\n self.col_labels.append(label)\n self.size_grid()\n return last_col"... | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\r\n\tpublic EEnum getIfcPumpTypeEnum() {\r\n\t\tif (ifcPumpTypeEnumEEnum == null) {\r\n\t\t\tifcPumpTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()\r\n\t\t\t\t\t.get(1044);\r\n\t\t}\r\n\t\treturn ifcPumpTypeEnumEEnum;\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 sentence about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see tuwien.auto.calimero.dptxlator.DPTXlator#getAllValues() | [
"@Override\n\tpublic String[] getAllValues()\n\t{\n\t\tfinal String[] buf = new String[data.length / 2];\n\t\tfor (int i = 0; i < buf.length; ++i)\n\t\t\tbuf[i] = makeString(i);\n\t\treturn buf;\n\t}"
] | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sends the http headers for csv file | [
"protected function renderHeader()\n {\n $fileName = Piwik::translate('General_Export');\n\n $period = Common::getRequestVar('period', false);\n $date = Common::getRequestVar('date', false);\n if ($period || $date) {\n // in test cases, there are no request params set\n\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 Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Technology:"
} |
Find and return all the references | [
"def refs(soup):\n \"\"\"\"\"\"\n tags = raw_parser.ref_list(soup)\n refs = []\n position = 1\n\n article_doi = doi(soup)\n\n for tag in tags:\n ref = {}\n\n ref['ref'] = ref_text(tag)\n\n # ref_id\n copy_attribute(tag.attrs, \"id\", ref)\n\n # article_title\n ... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
return a handle for FASTQ writing, handling gzipped files | [
"def write_fastq(filename):\n \n if filename:\n if filename.endswith('gz'):\n filename_fh = gzip.open(filename, mode='wb')\n else:\n filename_fh = open(filename, mode='w')\n else:\n filename_fh = None\n return filename_fh"
] | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Run inference on this set of sequences and compute error | [
"def runInference(exp, sequences, enableFeedback=True):\n \n if enableFeedback:\n print \"Feedback enabled: \"\n else:\n print \"Feedback disabled: \"\n\n error = 0\n activityTraces = []\n responses = []\n for i,sequence in enumerate(sequences):\n (avgActiveCells, avgPredictedActiveCells, activityTr... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Give back an array to the pool.
This will reset the array to the original length and make all values
undefined.
@param {Array} array An array that was gotten from this pool before. | [
"function giveBack(array) {\n\n // Don't return arrays that didn't originate from this pool\n if (!array.hasOwnProperty('originalLength')) return;\n\n // Reset all the elements\n for (var i = array.length; i--;) {\n array[i] = undefined;\n }\n\n // Reset the length\n array.length = array.originalLength;\n... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about File management:"
} |
Get platform specific group_concat token for provided column.
@param string $column
@param string $alias
@param QueryBuilder $query
@throws StorageException
@return string | [
"protected function getPlatformGroupConcat($column, $alias, QueryBuilder $query)\n {\n $platform = $query->getConnection()->getDatabasePlatform()->getName();\n switch ($platform) {\n case 'mysql':\n return \"GROUP_CONCAT($column) as $alias\";\n case 'sqlite':\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get scan statistics, including node and vulnerability breakdowns.
@param [Fixnum] scan_id Scan ID to retrieve statistics for.
@return [ScanSummary] ScanSummary object providing statistics for the scan. | [
"def scan_statistics(scan_id)\n r = execute(make_xml('ScanStatisticsRequest', 'scan-id' => scan_id))\n if r.success\n ScanSummary.parse(r.res.elements['//ScanSummary'])\n else\n false\n end\n end"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Test if all parameters used in the report are defined
@param report report object
@throws ParameterNotFoundException if a parameter used in the report is not defined | [
"public void parametersAreDefined(Report report) throws ParameterNotFoundException {\n String[] paramNames;\n String sql = report.getSql();\n if (sql == null) {\n sql = report.getQuery().toString();\n }\n Query query = new Query(sql);\n paramNames = query.getPara... | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetSecurityPolicyForBetaGlobalBackendService sets the given
// SecurityPolicyReference for the BackendService identified by the given name. | [
"func (g *Cloud) SetSecurityPolicyForBetaGlobalBackendService(backendServiceName string, securityPolicyReference *computebeta.SecurityPolicyReference) error {\n\tctx, cancel := cloud.ContextWithCallTimeout()\n\tdefer cancel()\n\n\tmc := newBackendServiceMetricContextWithVersion(\"set_security_policy\", \"\", comput... | [
"private static Credential getCredentialFromAccessTokenProvider(\n AccessTokenProvider accessTokenProvider, Collection<String> scopes)\n throws IOException, GeneralSecurityException {\n Preconditions.checkArgument(\n accessTokenProvider.getAccessToken() != null, \"Access Token cannot be null!\")... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Escape each completion result for the specified shell
@param string $result - Completion results that should appear in the shell
@param string $shellType - Valid shell type from HookFactory
@return string | [
"protected function escapeForShell($result, $shellType)\n {\n switch ($shellType) {\n // BASH requires special escaping for multi-word and special character results\n // This emulates registering completion with`-o filenames`, without side-effects like dir name slashes\n c... | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// NewChunkReader returns a ChunkReader to read from r, limiting the reads to
// the provided chunks. The provided bgzf.Reader will be put into Blocked mode. | [
"func NewChunkReader(r *bgzf.Reader, chunks []bgzf.Chunk) (*ChunkReader, error) {\n\tb := r.Blocked\n\tr.Blocked = true\n\tif len(chunks) != 0 {\n\t\terr := r.Seek(chunks[0].Begin)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &ChunkReader{r: r, wasBlocked: b, chunks: chunks}, nil\n}"
] | [
"public List<Pair<UIEvent, Table>> readEvents() throws IOException {\n //TODO eventually we'll support working out the offset for files that were not written in this session\n Preconditions.checkState(endStaticInfoOffset >= 0, \"Cannot read events - have not written end of static info marker\");\n ... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software Development:"
} |
Run the on_failure step group if it exists.
This function will swallow all errors, to prevent obfuscating the error
condition that got it here to begin with. | [
"def run_failure_step_group(pipeline, context):\n \n logger.debug(\"starting\")\n try:\n assert pipeline\n # if no on_failure exists, it'll do nothing.\n run_step_group(pipeline_definition=pipeline,\n step_group_name='on_failure',\n context=c... | [
"def eliot_friendly_generator_function(original):\n \n @wraps(original)\n def wrapper(*a, **kw):\n # Keep track of whether the next value to deliver to the generator is\n # a non-exception or an exception.\n ok = True\n\n # Keep track of the next value to deliver to the generato... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Offsets specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". | [
"func (s *MultiTermvectorService) Offsets(offsets bool) *MultiTermvectorService {\n\ts.offsets = &offsets\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Requests Paylands API to pay a previously created order.
@param string $ip
@param string $orderUuid
@param string $cardUuid
@return array
@throws ErrorException | [
"public function directPayment($ip, $orderUuid, $cardUuid)\n {\n $request = $this\n ->apiRequestFactory\n ->createDirectPaymentRequest($ip, $orderUuid, $cardUuid);\n\n return $this->send($request);\n }"
] | [
"public function paymentPage($mdxi)\n {\n $this->integrityCheck();\n\n libxml_use_internal_errors(true);\n\n if (!$mdxi || !$mdxi instanceof Mpay24Order) {\n $this->mpay24Sdk->dieWithMsg(\"To be able to use the Mpay24Api you must create an Mpay24Order object (Mpay24Order.php) and ... | codesearchnet | {
"query": "Represent the summarization about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about programming:"
} |
For the destination represented by the named mbean, add the destination to the registry.
@param destName name of the destination. | [
"protected void onFoundDestination (String destName) {\n if ( ( destName != null ) && ( ! destName.isEmpty() ) ) {\n DestinationState destState =\n this.registry.putIfAbsent(destName, new DestinationState(destName, this.brokerId));\n\n //\n // If it was alr... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// expandBlockdata decompresses the block's compressed data. | [
"func (b *Block) expandBlockdata() ([]byte, error) {\n\tswitch b.method {\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"cram: unknown method: %v\", b.method))\n\tcase rawMethod:\n\t\treturn b.blockData, nil\n\tcase gzipMethod:\n\t\tgz, err := gzip.NewReader(bytes.NewReader(b.blockData))\n\t\tif err != nil {\n\t\t\treturn ni... | [
"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 summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
@class SuperController
@package Gina
@namespace
@author Rhinostone <gina@rhinostone.com>
@api Public | [
"function SuperController(options) {\n this.name = 'SuperController';\n\n //private\n var self = this;\n var local = {\n req : null,\n res : null,\n next : null,\n options : options || null,\n query : {},\n _data : {}\n };\n\n var ports = {\... | [
"public function show($start)\n {\n if (!$start) {\n if (!empty(config('app.project'))) {\n $this->line(config('app.project'));\n }\n if (!empty(config('app.owner'))) {\n $this->line('by '.config('app.owner'));\n }\n $thi... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns hooks for the chosen event.
@param string $event Event name
@return array | [
"public function getHooks(string $event): array\n\t{\n\t\treturn isset(static::$traitHooks[static::class][$event]) ? $this->bindHooks(static::$traitHooks[static::class][$event]) : [];\n\t}"
] | [
"protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Create a node for FileItem/FilePath
:return: A IndicatorItem represented as an Element node | [
"def make_fileitem_filepath(filepath, condition='contains', negate=False, preserve_case=False):\n \n document = 'FileItem'\n search = 'FileItem/FilePath'\n content_type = 'string'\n content = filepath\n ii_node = ioc_api.make_indicatoritem_node(condition, document, search, content_type, content,\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 about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Return the data key for the data item.
If no data key has been defined yet, this will call generate_data_key() to generate a new key on the fly.
@return string The secret key for this data item. | [
"public function fetch_data_key() {\n global $CFG, $DB;\n\n // Only generate a key if Inbound Message is actually enabled, and the handler is enabled.\n if (!isset($CFG->messageinbound_enabled) || !$this->handler || !$this->handler->enabled) {\n return null;\n }\n\n if ... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
a -> b [a1=x,a2=y]; | [
"def write_rule(self, a, b, **attrs):\n if self.reverse:\n a, b = b, a\n \"\"\n with self.rule():\n self.write('%s -> %s' % (self._nodename(a), self._nodename(b)))\n self._delattr(attrs, 'weight', 1)\n self._delattr(attrs, 'minlen', 1)\n se... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(UpdateParameterGroupRequest updateParameterGroupRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (updateParameterGroupRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMars... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(StopDeliveryStreamEncryptionRequest stopDeliveryStreamEncryptionRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (stopDeliveryStreamEncryptionRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
In this case, args aren't used, since this information is taken
directly from the corpus categories.
Returns
-------
np.array, scores | [
"def get_scores(self, *args):\n\t\t'''\n\t\t\n\t\t'''\n\t\tif self.tdf_ is None:\n\t\t\traise Exception(\"Use set_category_name('category name', ['not category name', ...]) \" +\n\t\t\t \"to set the category of interest\")\n\n\t\tavgdl = self.tdf_.sum(axis=0).mean()\n\n\t\tdef idf(cat):\n\t\t\t# Numb... | [
"def component(self, *components):\n \n \"\"\"\n for component in components:\n self._component.append(component)\n return self"
] | codesearchnet | {
"query": "Represent the sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Cleanup all build artifacts | [
"def clean(docs=False, bytecode=False, extra=''):\n ''''''\n patterns = ['build', 'dist', 'cover', 'docs/_build', '**/*.pyc', '*.egg-info', '.tox', '**/__pycache__']\n for pattern in patterns:\n print('Removing {0}'.format(pattern))\n lrun('rm -rf {0}'.format(pattern))"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Converts the cookies array to the correct string format
@return string | [
"protected function prepareCookies()\n {\n $cookiesString = '';\n\n foreach ($this->cookies as $cookie => $value) {\n $cookiesString .= $cookie.'='.$value.'; ';\n }\n\n return $cookiesString;\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
指定したロケールのリソースを取得する。
<p>該当するロケールのリソースが存在しない場合は、デフォルトのリソースを返す。
@param locale ロケールがnullの場合は、デフォルトのリソースを返す。
@return | [
"MessageResource loadResource(final Locale locale) {\r\n\r\n if(locale == null) {\r\n return defaultResource;\r\n }\r\n\r\n if(resources.containsKey(locale)) {\r\n return resources.get(locale);\r\n }\r\n\r\n MessageResource localeResource = null;\r\n s... | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github post about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Software development:"
} |
Creates a collection
@link http://www.php.net/manual/en/mongodb.createcollection.php
@param string $name The name of the collection.
@param array $options
@return MongoCollection Returns a collection object representing the new collection. | [
"public function createCollection($name, $options = [])\n {\n try {\n if (isset($options['capped'])) {\n $options['capped'] = (bool) $options['capped'];\n }\n\n $this->db->createCollection($name, $options);\n } catch (\\MongoDB\\Driver\\Exception\\Exc... | [
"public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
save index_day
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"def QA_SU_save_index_day(client=DATABASE, ui_log=None, ui_progress=None):\n \n\n __index_list = QA_fetch_get_stock_list('index')\n coll = client.index_day\n coll.create_index(\n [('code',\n pymongo.ASCENDING),\n ('date_stamp',\n pymongo.ASCENDING)]\n )\n err = []\... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Expands the node to the closes contentEditable false element if it exists | [
"function findParentContentEditable(node) {\n var parent = node;\n\n while (parent) {\n if (parent.nodeType === 1 && getContentEditable(parent)) {\n return getContentEditable(parent) === \"false\" ? parent : node;\n }\n\n parent = parent.parentNode;\n ... | [
"function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Retrieve information about a blog | [
"func GetBlogInfo(client ClientInterface, name string) (*Blog, error) {\n\tresponse, err := client.Get(blogPath(\"/blog/%s/info\", name))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tblog := struct {\n\t\tResponse struct {\n\t\t\tBlog Blog `json:\"blog\"`\n\t\t} `json:\"response\"`\n\t}{}\n\t//blog := blogRespon... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetTapeStatus sets the TapeStatus field's value. | [
"func (s *TapeRecoveryPointInfo) SetTapeStatus(v string) *TapeRecoveryPointInfo {\n\ts.TapeStatus = &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:"
} |
Try to json_decode the response body
@return string
@throws RuntimeException | [
"public function json()\n {\n $json = json_decode($this->getBody(), true);\n if ($json === null) {\n throw new RuntimeException(sprintf(\n \"Can't decode response as JSON: %s\",\n function_exists('json_last_error_msg')?\n json_last_error_m... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Writes string into stream.
@param outString string
@param outStream stream
@throws IOException {@link IOException} | [
"private void simpleWriteString(String outString, OutputStream outStream) throws IOException\n {\n for (int i = 0; i < outString.length(); i++)\n {\n int charCode = outString.charAt(i);\n outStream.write(charCode & 0xFF);\n outStream.write((charCode >> 8) & 0xFF);\n }\n }"... | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Convert collection to the datatables structure.
@param \Illuminate\Http\Request $request
@param array|Collection $collection
@param int $totalCount
@param int $filteredCount
@return array | [
"protected function prepareDatatablesStructure(\n \\Illuminate\\Http\\Request $request,\n Collection $collection,\n $totalCount,\n $filteredCount\n ) {\n $columns = $this->getColumns();\n\n $result = [];\n $result['draw'] = $request->input('draw', 0);\n $re... | [
"public function compose(View $view)\n {\n /**\n * @var \\Carbon\\Carbon $start\n * @var \\Carbon\\Carbon $end\n * @var \\Illuminate\\Support\\Collection $range\n */\n extract(DateRange::getCurrentMonthDaysRange());\n\n $v... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Renomeia o endereço do Model para o controller
@param $stub
@return $this | [
"private function replaceModelPath(&$stub)\n {\n\n $model_name = $this->getAppNamespace() . $this->scaffoldCommandObj->getObjName('Name');\n $stub = str_replace('{{model_path}}', $model_name, $stub);\n\n return $this;\n\n }"
] | [
"private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.