query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// getServicePath returns the tenantID and the full path of the service // TODO: update function to include deploymentID in the service path
[ "func (f *Facade) getServicePath(ctx datastore.Context, serviceID string) (tenantID string, servicePath string, err error) {\n\tgs := func(id string) (*service.ServiceDetails, error) {\n\t\treturn f.GetServiceDetails(ctx, id)\n\t}\n\treturn f.serviceCache.GetServicePath(serviceID, gs)\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Check if a provider is already connected, return user record if available. @param \Cake\Network\Request $request Request instance. @return array|bool User array on success, false on failure.
[ "public function getUser(Request $request)\n {\n $this->_init($request);\n\n $providers = Hybrid_Auth::getConnectedProviders();\n foreach ($providers as $provider) {\n $adapter = Hybrid_Auth::getAdapter($provider);\n\n return $this->_getUser($adapter);\n }\n\n ...
[ "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 Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
{@inheritDoc} - extra: Holds a list (array) of files and their in formation (mime-icon, file name, etc). - value: Holds a text containing all file names separated by space.
[ "public function beforeSave(Field $field, $post)\n {\n // FIX Removes the \"dummy\" input from extra if exists, the \"dummy\" input is\n // used to force Field Handler to work when empty POST information is sent\n $extra = [];\n foreach ((array)$field->extra as $k => $v) {\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 summarization about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code about programming:" }
Helper method, adds the given collection of attributes to the given Tag. @param tag Tag to add attributes to. @param attributes The attributes to add.
[ "protected void addAttributes(SXTag tag, Collection<XAttribute> attributes)\n\t\t\tthrows IOException {\n\t\tfor (XAttribute attribute : attributes) {\n\t\t\tSXTag attributeTag;\n\t\t\tif (attribute instanceof XAttributeList) {\n\t\t\t\tattributeTag = tag.addChildNode(\"list\");\n\t\t\t\tattributeTag.addAttribute(\...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Render the panels Description @since 1.0.0 @access public @return string|null HTML of rendered description
[ "public function panel_section() {\n\t\t$output = null;\n\n\t\t// render the section wrapper.\n\t\t$output .= '<div class=\"uix-' . esc_attr( $this->type ) . '-sections uix-sections\">';\n\n\t\t$hidden = 'false';\n\t\tforeach ( $this->child as $section ) {\n\n\t\t\tif ( ! $this->is_section_object( $section ) && ! $...
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Generate a version 1 UUID using the PECL UUID extension @param int|string $node Not used in this context @param int $clockSeq Not used in this context @return string A binary string
[ "public function generate($node = null, $clockSeq = null)\n {\n $uuid = uuid_create(UUID_TYPE_TIME);\n\n return uuid_parse($uuid);\n }" ]
[ "private function randomName($parent)\n {\n // UUIDs are a pre-existing library dependency, so we'll use that instead\n // of adding random_compat or something similar.\n // Generate a UUID, then strip `-` and trim to expected length.\n // @todo revisit once library requires php >= 7....
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Returns true if the Windows terminal supports true color. Note that this does not check an output stream, but relies on environment variables from known implementations, or a PHP and Windows version that supports true color. @return bool
[ "private function isWindowsTrueColor()\n {\n $result = 183 <= getenv('ANSICON_VER')\n || 'ON' === getenv('ConEmuANSI')\n || 'xterm' === getenv('TERM')\n || 'Hyper' === getenv('TERM_PROGRAM');\n\n if (!$result && \\PHP_VERSION_ID >= 70200) {\n $version = s...
[ "def menuconfig(kconf):\n \n global _kconf\n global _conf_filename\n global _conf_changed\n global _minconf_filename\n global _show_all\n\n _kconf = kconf\n\n # Load existing configuration and set _conf_changed True if it is outdated\n _conf_changed = _load_config()\n\n # Filename to s...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
evalute the identifier @access public @author Joel Bout, <joel.bout@tudor.lu> @param values @return boolean
[ "public function evaluate($values)\n {\n //evaluate identifier, starts with letter, contains letters, numbers and _, ends with letter, number\n if(preg_match(\"/^[a-z]+[a-z_0-9]*$/\", $values) === 1){\n return true;\n } else {\n if (!$this->hasOption('message')) {\n ...
[ "final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Handles transaction of type POOL_UPGRADE Can schedule or cancel upgrade to a newer version at specified time :param txn:
[ "def handleUpgradeTxn(self, txn) -> None:\n \n FINALIZING_EVENT_TYPES = [UpgradeLog.Events.succeeded, UpgradeLog.Events.failed]\n\n if get_type(txn) != POOL_UPGRADE:\n return\n\n logger.info(\"Node '{}' handles upgrade txn {}\".format(self.nodeName, txn))\n txn_data = g...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Generate an Excel BIFF XF record (style or cell). @param string $style The type of the XF record ('style' or 'cell'). @return string The XF record
[ "function getXf($style)\r\n {\r\n // Set the type of the XF record and some of the attributes.\r\n if ($style == 'style') {\r\n $style = 0xFFF5;\r\n } else {\r\n $style = $this->_locked;\r\n $style |= $this->_hidden << 1;\r\n }\r\n\r\n // Fla...
[ "function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 gr...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
convert a named granularity into seconds. get value in seconds for named granularities: M1, M5 ... H1 etc. >>> print(granularity_to_time("M5")) 300
[ "def granularity_to_time(s):\n \n mfact = {\n 'S': 1,\n 'M': 60,\n 'H': 3600,\n 'D': 86400,\n 'W': 604800,\n }\n try:\n f, n = re.match(\"(?P<f>[SMHDW])(?:(?P<n>\\d+)|)\", s).groups()\n n = n if n else 1\n return mfact[f] * int(n)\n\n except Exc...
[ "def _string2Duration(text):\n \n if text == \"\" or text == \"zero\":\n return ZERO\n\n amount, interval = re.match(r\"([\\d\\.]*)(.*)\", text).groups()\n amount = int(amount) if amount else 1\n\n if MILLI_VALUES[interval] == None:\n from mo_logs import Log\n Log.error(\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add Elements @param {Object} obj @param {HTMLElement} el @param {HTMLElement} parent
[ "function (obj, el, parent) {\n parent.appendChild(el)\n // Fixed elements that do not suffer removal\n if (obj.undo !== undefined && !obj.undo) return\n // Elements which are removed\n els.push(el)\n }" ]
[ "function(elTh, oColumn) {\n SDT.superclass._initThEl.call(this, elTh, oColumn);\n elTh.id = this.getId() +\"-fixedth-\" + oColumn.getSanitizedKey(); // Needed for getColumn by TH and ColumnDD\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Calculate the hash for the block header. Note that this has the bytes in the opposite order from how the header is usually displayed (so the long string of 00 bytes is at the end, not the beginning).
[ "def hash(self):\n \"\"\"\"\"\"\n if not hasattr(self, \"__hash\"):\n self.__hash = self._calculate_hash()\n return self.__hash" ]
[ "public FP64 extend(char c) {\n byte b1 = (byte)(c & 0xff);\n extend(b1);\n byte b2 = (byte) (c >>> 8);\n // NOTE pdalbora 23-Jul-2009 -- The following check is intentional. We don't extend the high order byte when it's\n // zero, in order to avoid \"weakening\" the fingerprint of primarily ASCII dat...
codesearchnet
{ "query": "Represent the post about Blockchain:", "pos": "Represent the code about Blockchain:", "neg": "Represent the code about programming:" }
@param \ReflectionFunctionAbstract $controller @param RequestParam $annotation @param string $type @return HttpBadRequestException
[ "private function invalidScalarParameterException(\\ReflectionFunctionAbstract $controller, RequestParam $annotation, string $type) : HttpBadRequestException\n {\n return new HttpBadRequestException(sprintf(\n '%s() received an invalid %s value for %s parameter \"%s\" (bound to $%s).',\n ...
[ "static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Set the default params for the type of stub we are working with @param array $stub @return void
[ "protected function _setDefaultParams($stub) {\n\t\t$source = $stub['embed-src'];\n\t\t$flashvars = (isset($stub['flashvars'])) ? $stub['flashvars'] : null;\n\t\t$count = count($this->_match);\n\n\t\tfor ($i = 1; $i <= $count; $i++) {\n\t\t\t$source = str_ireplace('$' . $i, $this->_match[$i - 1], $source);\n\t\t\t$...
[ "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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
return except key data from array @param array $input @param $keys @return array
[ "static public function except(array $input, $keys)\n {\n $keys = is_array($keys) ? $keys : array_slice(func_get_args(),1);\n\n foreach ($keys as $key) {\n unset($input[$key]);\n }\n\n return $input;\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 Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Returns the set of input variables not yet bound by the given test case.
[ "private List<VarDef> getVarsRemaining( FunctionInputDef inputDef, TestCaseDef testCase)\n {\n return getVarsRemaining( new VarDefIterator( inputDef), testCase);\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *GetExportJobInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetExportJobInput\"}\n\tif s.ApplicationId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ApplicationId\"))\n\t}\n\tif s.ApplicationId != nil && len(*s.ApplicationId) < 1 {\n\t\tinvalidParams.Add(r...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// G creates a group of values.
[ "func G(list ...interface{}) ValExprBuilder {\n\tif len(list) == 0 {\n\t\treturn ValExprBuilder{makeErrVal(\"empty group\")}\n\t}\n\treturn ValExprBuilder{makeValTuple(list)}\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Provides the previously set block value respecting the bits range. 0 value and not marked block are treated the same way and 0 is provided.
[ "def getBlockValue(self, block):\n \n if self._bit_count == 0:\n raise Exception( \"The margin '\" + self._name +\n \"' did not allocate any bits for the values\")\n val = block.userState()\n if val in [ 0, -1 ]:\n return 0\n\n # S...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the Github instruction about Blockchain:", "pos": "Represent the Github code about Blockchain:", "neg": "Represent the Github code about programming:" }
Fired when something's been created
[ "def on_created(self, event):\n ''''''\n if self.trigger != \"create\":\n return\n action_input = ActionInput(event, \"\", self.name)\n flows.Global.MESSAGE_DISPATCHER.send_message(action_input)" ]
[ "function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
@param HasResourceContext $object @param string $context_relation_name @param string $context_name @return HasResourceContext
[ "public function addContextRelationToObject($object, $context_name = 'default')\n {\n $context = $this->findContext($context_name);\n\n $object->setContext($context);\n\n return $object;\n }" ]
[ "protected function getRoleSets()\n {\n return Util::getRoleSets($this->getUsername(), new String($this->lookupName), new String($this->rolesQuery), $this);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
// DataVersionAndKind will return the APIVersion and Kind of the given wire-format // encoding of an API Object, or an error.
[ "func (s *Scheme) DataVersionAndKind(data []byte) (version, kind string, err error) {\n\treturn s.raw.DataVersionAndKind(data)\n}" ]
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the instruction about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about Software development:" }
// JSON takes an object, marshals it and make it avaiable for POST and PUT.
[ "func (c *EzClient) JSON(j interface{}) *EzClient {\n\tb, err := json.Marshal(j)\n\tif err == nil {\n\t\tc.body = bytes.NewReader(b)\n\t}\n\n\treturn c\n}" ]
[ "function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, String, java.util.Locale)} @param data @param currencyCode @param locale @return the currency string
[ "public static String formatCurrency(Object data, String currencyCode, Locale locale) {\n return formatCurrency(null, data, currencyCode, locale);\n }" ]
[ "@NonNull\n @SuppressWarnings(\"WeakerAccess\")\n protected String convertToString(CrashReportData report, @NonNull StringFormat format) throws Exception {\n return format.toFormattedString(report, config.reportContent(), \"&\", \"\\n\", true);\n }" ]
codesearchnet
{ "query": "Represent the Github description about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Software development:" }
// ToString returns a string representation of a forwarded port spec, compatible // with OpenSSH's -L flag, i.e. "src_host:src_port:dest_host:dest_port".
[ "func (p *ForwardedPort) ToString() string {\n\tsport := strconv.Itoa(p.SrcPort)\n\tdport := strconv.Itoa(p.DestPort)\n\tif utils.IsLocalhost(p.SrcIP) {\n\t\treturn sport + \":\" + net.JoinHostPort(p.DestHost, dport)\n\t}\n\treturn net.JoinHostPort(p.SrcIP, sport) + \":\" + net.JoinHostPort(p.DestHost, dport)\n}" ]
[ "func Usage(name string) string {\n\tif name == \"\" {\n\t\tname = \"Listen address\"\n\t}\n\tif !strings.HasSuffix(name, \" address\") {\n\t\tname += \" address\"\n\t}\n\treturn name + \"; may be port, :port, ip:port, or FD:<fd_num>\"\n}" ]
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software Development:" }
r""" Adds outflow boundary condition to the selected pores. Outflow condition simply means that the gradient of the solved quantity does not change, i.e. is 0.
[ "def set_outflow_BC(self, pores, mode='merge'):\n \n\n \"\"\"\n # Hijack the parse_mode function to verify mode/pores argument\n mode = self._parse_mode(mode, allowed=['merge', 'overwrite', 'remove'],\n single=True)\n pores = self._parse_indices(pore...
[ "def get_target_volume(self, etheta=0.0, scaled=False):\n \n # TODO: make this a function of d instead of etheta?\n logger.debug(\"determining target volume at t={}, theta={}\".format(self.time, etheta))\n\n # TODO: eventually this could allow us to \"break\" volume conservation\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about mathematics:" }
Return the :class:`Variable` or :class:`List` to watch. Returns ``None`` if it's a block watcher.
[ "def value(self):\n \n if self.kind == 'variable':\n return self.target.variables[self.block.args[0]]\n elif self.kind == 'list':\n return self.target.lists[self.block.args[0]]" ]
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Maps the provided bucket name to the appropriate bucket ID. @param $name @return null
[ "protected function getBucketIdFromName($name)\n {\n $buckets = $this->listBuckets();\n\n foreach ($buckets as $bucket) {\n if ($bucket->getName() === $name) {\n return $bucket->getId();\n }\n }\n\n return null;\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Call after any advancement to bring this.elements into line with this.classes.
[ "private void skipClasslessStackFrames() {\n // skip over any stack trace elements that are unmatched in the classes array\n if (classes.isEmpty()) return;\n while (elements.size() > 0 && !!!elements.peek().getClassName().equals(classes.peek().getName())) {\n elements.pop();\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception\r\n\t{\r\n\t\tsyslog_snmp_responses result = (syslog_snmp_responses) service.get_payload_formatter().string_to_resource(syslog_snmp_responses.class, response);\r\n\t\tif(result.errorcode != 0)\r\n\t\t{\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Auto Generated Code
[ "def vlan_classifier_group_groupid(self, **kwargs):\n \n config = ET.Element(\"config\")\n vlan = ET.SubElement(config, \"vlan\", xmlns=\"urn:brocade.com:mgmt:brocade-vlan\")\n classifier = ET.SubElement(vlan, \"classifier\")\n group = ET.SubElement(classifier, \"group\")\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
Instantiate all configured backends @param array $configuration @return BackendInterface[] @throws \Exception
[ "protected function instantiateBackends(array $configuration)\n {\n $backends = [];\n foreach ($configuration as $backendConfiguration) {\n $class = $backendConfiguration['class'] ?? '';\n $options = $backendConfiguration['options'] ?? [];\n $backends[] = $this->ins...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// addBaseProfiles adds the list of base profiles or diff base profiles to // the source. This function will return an error if both base and diff base // profiles are specified.
[ "func (source *source) addBaseProfiles(flagBase, flagDiffBase []*string) error {\n\tbase, diffBase := dropEmpty(flagBase), dropEmpty(flagDiffBase)\n\tif len(base) > 0 && len(diffBase) > 0 {\n\t\treturn errors.New(\"-base and -diff_base flags cannot both be specified\")\n\t}\n\n\tsource.Base = base\n\tif len(diffBas...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
========== PROPERTY (TO) ==========
[ "protected function toArrayProperty($p, $pn, $policy, Reader $ar, PolicyResolver $pr, \\ReflectionClass $headRefClass) {\n $getter = $policy->getter ?: 'get'.ucfirst($pn);\n $result = null;\n \n // ========== SCALAR TYPES ==========\n if($column = $ar->getPropertyAnnotation($p, 'D...
[ "private void populateMilestone(Row row, Task task)\n {\n task.setMilestone(true);\n //PROJID\n task.setUniqueID(row.getInteger(\"MILESTONEID\"));\n task.setStart(row.getDate(\"GIVEN_DATE_TIME\"));\n task.setFinish(row.getDate(\"GIVEN_DATE_TIME\"));\n //PROGREST_PERIOD\n //SYMBO...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Data management:" }
Returns a generator yielding numpy arrays (float64) of at most `frames` frames
[ "def sndread_chunked(path:str, frames:int=_CHUNKSIZE) -> Iterator[np.ndarray]:\n \n backend = _getBackend(path, key=lambda backend: backend.can_read_chunked)\n if backend:\n logger.debug(f\"sndread_chunked: using backend {backend.name}\")\n return backend.read_chunked(path, frames)\n else:...
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// NewInstance creates a new choria server instance
[ "func NewInstance(fw *choria.Framework) (i *Instance, err error) {\n\ti = &Instance{\n\t\tfw: fw,\n\t\tcfg: fw.Config,\n\t\trequests: make(chan *choria.ConnectorMessage),\n\t\tmu: &sync.Mutex{},\n\t\tstartTime: time.Now(),\n\t\tlastMsgProcessed: time.Unix(0, 0...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Emit all supported features to the logger.
[ "public static void debugLogDOMFeatures ()\n {\n for (final Map.Entry <EXMLDOMFeatureVersion, ICommonsList <String>> aEntry : s_aSupportedFeatures.entrySet ())\n for (final String sFeature : aEntry.getValue ())\n if (LOGGER.isInfoEnabled ())\n LOGGER.info (\"DOM \" + aEntry.getKey ().getID ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Instantiates all descendants of JsDuck::Tag::Tag
[ "def instantiate_tags(tag_classes)\n tag_classes.each do |cls|\n tag = cls.new()\n\n Array(tag.pattern).each do |pattern|\n @patterns[pattern] = tag\n end\n\n if tag.tagname\n @tagnames[tag.tagname] = tag\n end\n\n if tag.signature\n tag.sign...
[ "public void buildSignature(XMLNode node, Content constructorDocTree) {\n constructorDocTree.addContent(\n writer.getSignature(\n (ConstructorDoc) constructors.get(currentConstructorIndex)));\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Check if we should add line breaks inside inline element @param {AbbreviationNode} node @param {OutputProfile} profile @return {Boolean}
[ "function shouldBreakInsideInline(node, profile) {\n\t\tvar hasBlockElems = node.children.some(function(child) {\n\t\t\tif (abbrUtils.isSnippet(child))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn !abbrUtils.isInline(child);\n\t\t});\n\t\t\n\t\tif (!hasBlockElems) {\n\t\t\treturn shouldFormatInline(node, profile);\...
[ "public static ChainableStatement hover(JsScope over, JsScope out)\n\t{\n\t\treturn new DefaultChainableStatement(\"hover\", over.render(), out.render());\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see com.impetus.kundera.property.PropertyAccessor#fromBytes(byte[])
[ "@Override\n public BigDecimal fromBytes(Class targetClass, byte[] bytes)\n {\n if (bytes == null)\n {\n return null;\n }\n int scale = (((bytes[0]) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | ((bytes[3] & 0xff)));\n\n byte[] bibytes = Arrays.c...
[ "@Override\n\t@Deprecated\n\tpublic DataSource dataSourceByName(String dbName) {\n\t\treturn new com.danidemi.jlubricant.embeddable.BasicDataSource(\n\t\t\t\tdbByName(dbName));\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Is this page in the trash? @return bool
[ "public function isInTrash()\n {\n return $this->getCollectionPath() != Config::get('concrete.paths.trash') && strpos($this->getCollectionPath(), Config::get('concrete.paths.trash')) === 0;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
// SetZookeeperNodeInfo sets the ZookeeperNodeInfo field's value.
[ "func (s *NodeInfo) SetZookeeperNodeInfo(v *ZookeeperNodeInfo) *NodeInfo {\n\ts.ZookeeperNodeInfo = 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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Unbinding the instance from securitygroup. @param request The request containing all options for unbinding the instance from securitygroup.
[ "public void unbindInstanceFromSecurityGroup(UnbindSecurityGroupRequest request) {\n checkNotNull(request, \"request should not be null.\");\n checkStringNotEmpty(request.getInstanceId(), \"request instanceId should not be empty.\");\n checkStringNotEmpty(request.getSecurityGroupId(), \"request...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetValue sets the Value field's value.
[ "func (s *TagOptionDetail) SetValue(v string) *TagOptionDetail {\n\ts.Value = &v\n\treturn s\n}" ]
[ "@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 Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
生成项目文件 :return: :rtype:
[ "def gen_opf(self, book_idx):\n \n if self._chapterization:\n title = '{title}-{book_idx}'.format(title=self._title, book_idx=book_idx)\n book = 'book-{book_idx}'.format(book_idx=book_idx)\n toc = 'toc-{book_idx}'.format(book_idx=book_idx)\n else:\n t...
[ "function addEntries(env, webpackConfig) {\n // 指定入口的 js 文件和 html 文件的路径, 默认相对于 src 目录(根目录)\n wieldyWebpack.createEntry('index.js', 'index.html', {\n env: env,\n\n // 如果有多个入口, 则在创建时需要设置 setChunks 为 true\n // setChunks: true,\n\n // 多项目时需要修改 src 目录的根目录\n srcBase: 'src/' + env....
codesearchnet
{ "query": "Represent the text about text analysis:", "pos": "Represent the code about text analysis:", "neg": "Represent the code:" }
// Disassociates a Channel from a Nick.
[ "func (nk *nick) delChannel(ch *channel) {\n\tif _, ok := nk.chans[ch]; ok {\n\t\tdelete(nk.chans, ch)\n\t\tdelete(nk.lookup, ch.name)\n\t} else {\n\t\tlogging.Warn(\"Nick.delChannel(): %s not on %s.\", nk.nick, ch.name)\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Creating record @param HCResourceAuthorRequest $request @return JsonResponse @throws \Exception
[ "public function store(HCResourceAuthorRequest $request): JsonResponse\n {\n $this->connection->beginTransaction();\n\n try {\n $resourceAuthor = $this->service->getRepository()->create($request->getRecordData());\n\n $this->connection->commit();\n } catch (\\Throwable ...
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the summarization about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Software development:" }
Residual discrete autoencoder model.
[ "def autoencoder_residual_discrete():\n \"\"\"\"\"\"\n hparams = autoencoder_residual()\n hparams.bottleneck_bits = 1024\n hparams.bottleneck_noise = 0.05\n hparams.add_hparam(\"discretize_warmup_steps\", 16000)\n hparams.add_hparam(\"bottleneck_kind\", \"tanh_discrete\")\n hparams.add_hparam(\"isemhash_nois...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "public function handle(Request $request, Closure $next)\n {\n $response = $this->router->routePage($request->route()->parameter('location'));\n\n if ($response) {\n return $response;\n }\n\n return $next($request);\n }" ]
[ "public function callAction(string $handler, array $arguments = []): Response\n {\n if (!class_exists($handler)) {\n throw new EndocoreException('Action class not found.');\n }\n\n /** @var \\Bloatless\\Endocore\\Action\\ActionInterface $action */\n $action = new $handler($...
codesearchnet
{ "query": "Represent the Github summarization about Laravel:", "pos": "Represent the Github code about Laravel:", "neg": "Represent the Github code about PHP:" }
Handle the authentication middler @param \Illuminate\Http\Request $request @param \Closure $next @param null|string $guard @return mixed @throws \League\OAuth2\Server\Exception\InvalidRequestException
[ "public function handle(Request $request, Closure $next, $guard = null)\n\t{\n\t\tif (is_null($guard)) {\n\t\t\tthrow new \\LogicException(self::class . ' called with no guard defined.');\n\t\t}\n\n\t\t// Attempt to resolve the application user, throws \\League\\OAuth2\\Server\\Exception\\AccessDeniedException\n\t\...
[ "protected function registerClassAliases()\n {\n $serviceAliases = [\n \\Dingo\\Api\\Http\\Request::class => \\Dingo\\Api\\Contract\\Http\\Request::class,\n 'api.dispatcher' => \\Dingo\\Api\\Dispatcher::class,\n 'api.http.validator' => \\Dingo\\Api\\Http\\RequestValidator:...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Development:" }
Crop image AJAX handler @return array
[ "public function onCropImage()\n {\n $this->abortIfReadOnly();\n\n $imageSrcPath = trim(Input::get('img'));\n $selectionData = Input::get('selection');\n $cropSessionKey = Input::get('cropSessionKey');\n $path = Input::get('path');\n $path = MediaLibrary::validatePath($p...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SortableRuleSlice.
[ "func (in SortableRuleSlice) DeepCopy() SortableRuleSlice {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SortableRuleSlice)\n\tin.DeepCopyInto(out)\n\treturn *out\n}" ]
[ "func (resource *Flag) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Flag\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Flag), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Font Type Detector agent @param content Text to make a detection @param def Default return format; @return unicode ? zawgyi
[ "function fontDetect(content, fallback_font_type, options = {}){\n if (!content) {\n if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.fontDetect.');\n return fallback_font_type || 'en';\n }\n\n\tif (content === '')\n\t\treturn content;\n\n\tif (!mmCharacterRange.test(conte...
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Regular expressions:" }
Convert console command options to ssh program options. @param InputInterface $input @param OutputInterface $output @return array
[ "protected function getProgramOptions(\n InputInterface $input,\n OutputInterface $output\n ) {\n $opts = array();\n\n foreach ($this->getDefinition()->getOptions() as $o) {\n $name = $o->getName();\n if (! array_key_exists($name, $this->programOptions )) {\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Merge all middlewares from group and parent-group. @param RouteGroup $group The first route group. @param array $middleWareList Swap of middlewares. @return array All middlewares.
[ "private function getMiddleWareFromGroup(RouteGroup $group, array $middleWareList = [])\n {\n if ($group->middleWare) {\n $middleWareList = \\array_merge($group->middleWare, $middleWareList);\n }\n if (\\is_null($group->parentGroup)) {\n return $middleWareList;\n ...
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $routeCollection = new RouteCollection();\n $requestContext = $serviceLocator->get('RouterRequestContext');\n $routerOptions = array();\n\n $logger = $serviceLocator->has('logger') ? $serviceLocator->get(...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
QAbstractItemModel method implementation
[ "def data(self, index, role):\n \n if role == Qt.DisplayRole and \\\n index.row() < len(self.words):\n text = self.words[index.row()]\n typed = text[:len(self._typedText)]\n canComplete = text[len(self._typedText):len(self._typedText) + len(self.canCompleteTe...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets the created columns according to the old/new tables. @param \Fridge\DBAL\Schema\Table $oldTable The old table. @param \Fridge\DBAL\Schema\Table $newTable The new tabme. @return array The created columns.
[ "private function getCreatedColumns(Table $oldTable, Table $newTable)\n {\n $createdColumns = array();\n\n foreach ($newTable->getColumns() as $column) {\n if (!$oldTable->hasColumn($column->getName())) {\n $createdColumns[] = $column;\n }\n }\n\n ...
[ "public function getResultingType() : \\Dms\\Core\\Persistence\\Db\\Schema\\Type\\Type\n {\n throw InvalidOperationException::methodCall(__METHOD__, 'Tuple cannot be used a standalone expression');\n }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.joml.Matrix3fc#scale(float, org.joml.Matrix3f)
[ "public Matrix3f scale(float xyz, Matrix3f dest) {\n return scale(xyz, xyz, xyz, dest);\n }" ]
[ "public Se3_F64 decompose( DMatrixRMaj H )\n\t{\n\t\t// step through each calibration grid and compute its parameters\n\t\tDMatrixRMaj h[] = SpecializedOps_DDRM.splitIntoVectors(H, true);\n\n\t\t// lambda = 1/norm(inv(K)*h1) or 1/norm(inv(K)*h2)\n\t\t// use the average to attempt to reduce error\n\t\tCommonOps_DDRM...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Reinitialize the catalogs @return Translator
[ "public function reinitializeCatalogs() {\n\t\t$this->catalogs = [];\n\t\t$this->initializedCatalogs = [];\n\t\t\n\t\tif (! empty($this->preinitLocales) || ! empty($this->preinitDomains)) {\n\t\t\t$this->preinitNeed = true;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about Text translation:", "pos": "Represent the Github code about Text translation:", "neg": "Represent the Github code:" }
Setup and install virtualenv
[ "def _setup_virtualenv():\n \n print(\"Downloading virtualenv...\")\n import gzip, tarfile, io, tempfile, shutil\n tf = tarfile.open(fileobj=io.BytesIO(urlopen(VIRTUALENV_URL).read()))\n temp_folder = tempfile.mkdtemp()\n tf.extractall(temp_folder)\n print(\"Calling virtualenv...\")\n subpro...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
dict (dynamo name) -> obj
[ "def _load(cls, attrs, *, context, **kwargs):\n \n return unpack_from_dynamodb(\n model=cls,\n attrs=attrs or {},\n expected=cls.Meta.columns,\n context=context, **kwargs)" ]
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Who is currently logged in? @param string $type "list" or "nolist" @return string
[ "private function usersLoggedInQuery($type = 'nolist'): string\n {\n $content = '';\n $anonymous = 0;\n $logged_in = [];\n\n foreach ($this->user_service->allLoggedIn() as $user) {\n if (Auth::isAdmin() || $user->getPreference('visibleonline')) {\n $logged_...
[ "def by_user(config):\n \"\"\"\"\"\"\n client = Client()\n client.prepare_connection()\n audit_api = API(client)\n CLI.parse_membership('Groups by User', audit_api.by_user())" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Convert an ISO 3166-1 alpha-3 code to alpha-2 @param {String} alpha3 USA @return {String}
[ "function to2 (alpha3) {\n if (alpha3 && alpha3.length > 1) state = alpha3\n if (state.length !== 3) return state\n return ISOCodes.filter(function (row) {\n return row.alpha3 === state\n })[0].alpha2\n }" ]
[ "function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Java programming:" }
Register the Whoops exception displayer. @return void
[ "protected function registerDebugDisplayer()\n\t{\n\t\t$this->registerWhoops();\n\n\t\t$this->app['exception.debug'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn new WhoopsDisplayer($app['whoops'], $app->runningInConsole());\n\t\t});\n\t}" ]
[ "@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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
read xml object :param url: contents url :param markup: markup provider :param game: MLBAM Game object :return: pitchpx.game.players.Players object
[ "def read_xml(cls, url, markup, game):\n \n return Players._read_objects(MlbamUtil.find_xml(\"\".join([url, cls.FILENAME]), markup) ,game)" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Splits a list by the callable *key* where a negative result will cause the item to be put in the first list and a positive into the second list.
[ "def split_list_by(lst, key):\n \n\n first, second = [], []\n for item in lst:\n if key(item):\n second.append(item)\n else:\n first.append(item)\n return (first, second)" ]
[ "def _weave_conflicting_selectors(prefixes, a, b, suffix=()):\n \n # OK, what this actually does: given a list of selector chains, two\n # \"conflicting\" selector chains, and an optional suffix, return a new list\n # of chains like this:\n # prefix[0] + a + b + suffix,\n # prefix[0] + b + a +...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Remove a settings from database and cache file @param string $key @return void
[ "public function forget($key)\n {\n $keyExp = explode('.', $key);\n\n // get settings value by first key name\n $query = $this->database\n ->table($this->config['db_table'])\n ->where('setting_key', $keyExp[0]);\n\n $row = $query->first(['setting_value']);\n\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 Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
------------------------- Unique ID -------------------------
[ "function uid (length) {\n return new Promise((resolve, reject) => {\n Crypto.randomBytes(length * 2, (err, bytes) => {\n if (err) return reject(err)\n resolve(bytes.toString('base64').replace(/\\+/g, '').replace(/\\//g, '').replace(/=/g, '').substring(0, length))\n })\n })\n}" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
List locks. @return JsonResponse @Route("/list", name="locks_list")
[ "public function listAction()\n {\n $lockManager = $this->get('phlexible_element.element_lock_manager');\n $userManager = $this->get('phlexible_user.user_manager');\n\n $locks = $lockManager->findAll();\n\n $data = [];\n foreach ($locks as $lock) {\n /* @var $lock El...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github text about Sales Channel API:", "pos": "Represent the Github code about Sales Channel API:", "neg": "Represent the Github code:" }
expr : PLUS expr | MINUS expr | NOT expr | BOOLEAN_NOT expr
[ "def p_expr_unary_op(p):\n ''''''\n p[0] = ast.UnaryOp(p[1], p[2], lineno=p.lineno(1))" ]
[ "function isConsistent(t) {\n return t.type === UNARY ? isConsistent (t.types.$1) :\n t.type === BINARY ? isConsistent (t.types.$1) &&\n isConsistent (t.types.$2) :\n /* else */ t.type !== INCONSISTENT;\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
(non-PHPdoc) @see JBBCode.Node::getAsText() Returns the element as text (not including any bbcode markup) @return the plain text representation of this node
[ "public function getAsText() {\n $s = \"\";\n foreach($this->getChildren() as $child)\n $s .= $child->getAsText();\n return $s;\n }" ]
[ "protected function prettifyComment($comment)\n {\n if (empty($comment) === true) {\n return '';\n }\n\n // We split our comment into single lines and remove the unwanted\n // comment chars with the array_map callback.\n // We skip lines with /** and */\n $res...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param $collection @return Model
[ "private function model($collection)\n {\n return $this->model->setConnection($this->connection)->setTable($collection)->useWritePdo();\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Gets the title of the webpage. @return string
[ "public function getTitle()\n {\n $node = $this->html->findFirstTag('title');\n\n return $node ? trim($node->nodeValue) : null;\n }" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Judges whether a table is a wide table or not by considering the width of the table @param tc the object of the table candidates
[ "private void isWideTable(TableCandidate tc) {\r\n\tfloat docWidth = m_docInfo.getMaxX() - m_docInfo.getMinX();\r\n\tif ((((tc.getCaptionX() > ((docWidth - 30) / (float) 4.0)\r\n\t\t+ m_docInfo.getMinX())) && (tc.getCaptionX() < docWidth / 2.5))\r\n\t\t|| (tc.getCaptonEndX() - tc.getCaptionX() > docWidth\r\n\t\t\t/...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param $domain @param $digest @param $url @return mixed
[ "public function formatCamoUrl($domain, $digest, $url)\n {\n return 'https://' . $domain . '/' . $digest . '?url=' . $this->encoder->encode($url);\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetSamplingRuleRecord sets the SamplingRuleRecord field's value.
[ "func (s *UpdateSamplingRuleOutput) SetSamplingRuleRecord(v *SamplingRuleRecord) *UpdateSamplingRuleOutput {\n\ts.SamplingRuleRecord = 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:" }
// MarshalBinary implements the encoding.BinaryMarshaler interface.
[ "func (m MACCommands) MarshalBinary() ([]byte, error) {\n\tvar out []byte\n\tfor _, mac := range m {\n\t\tb, err := mac.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout = append(out, b...)\n\t}\n\treturn out, nil\n}" ]
[ "func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {\n\treturn encoder\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetLicenseCount sets the LicenseCount field's value.
[ "func (s *UpdateLicenseConfigurationInput) SetLicenseCount(v int64) *UpdateLicenseConfigurationInput {\n\ts.LicenseCount = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Iterate through the byte data and fill the summary_frames
[ "def _parse_summary_frames(self, file_obj):\n \"\"\"\"\"\"\n for _ in range(self.n_summary_frames):\n dom_id = unpack('<i', file_obj.read(4))[0]\n dq_status = file_obj.read(4) # probably dom status? # noqa\n dom_status = unpack('<iiii', file_obj.read(16))\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:" }
Set this key of this edge to this value.
[ "def edge_val_set(self, graph, orig, dest, idx, key, branch, turn, tick, value):\n \"\"\"\"\"\"\n if (branch, turn, tick) in self._btts:\n raise TimeError\n self._btts.add((branch, turn, tick))\n graph, orig, dest, key, value = map(self.pack, (graph, orig, dest, key, 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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Check parameter and return types for command finalization hooks.
[ "def _validate_cmdfinalization_callable(cls, func: Callable[[plugin.CommandFinalizationData],\n plugin.CommandFinalizationData]) -> None:\n \"\"\"\"\"\"\n cls._validate_callable_param_count(func, 1)\n signature = inspect.signature(fu...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Update one EventCallbackUrl @param string $id @param EventCallbackUrl $eventCallbackUrl @return array
[ "public function update($id, EventCallbackUrl $eventCallbackUrl)\n {\n $response = $this->mailjet->put(Resources::$Eventcallbackurl, ['id' => $id, 'body' => $eventCallbackUrl->format()]);\n if (!$response->success()) {\n $this->throwError(\"EventCallbackUrlService:update() failed\", $res...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns the default collector settings
[ "def get_default_config(self):\n \n config = super(SqsCollector, self).get_default_config()\n config.update({\n 'path': 'sqs',\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 sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
limit. @param int $start start position or limit. @param int|null $limit @return $this
[ "public function limit($start, $limit = null) {\n if ($limit === null) {\n $limit = intval($start);\n $start = 0;\n } else {\n $start = intval($start);\n $limit = intval($limit);\n }\n if ($start < 0) {\n $start = 0;\n }\n ...
[ "public static function getLinkCount($url = false)\n {\n $data = static::getCols('2048', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['uid'];\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Send all headers at once
[ "public function sendAllHeaders()\n {\n if ($this->status_header !== null) {\n header($this->status_header);\n }\n\n foreach ($this->headers as $name => $value) {\n header($name . ': ' . $value);\n }\n }" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns an array of values that the type may have if the type is an enumeration. @return string[] The valid enumeration values.
[ "public function getEnumerations()\n {\n $enums = array();\n foreach ($this->element->getElementsByTagName('enumeration') as $enum) {\n $enums[] = $enum->getAttribute('value');\n };\n return $enums;\n }" ]
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// DecodeFormats takes a list of output format configurations and merges those, // in the order given, with the Hugo defaults as the last resort.
[ "func DecodeFormats(mediaTypes media.Types, maps ...map[string]interface{}) (Formats, error) {\n\tf := make(Formats, len(DefaultFormats))\n\tcopy(f, DefaultFormats)\n\n\tfor _, m := range maps {\n\t\tfor k, v := range m {\n\t\t\tfound := false\n\t\t\tfor i, vv := range f {\n\t\t\t\tif strings.EqualFold(k, vv.Name) ...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Prepare sort orders for the request builder. @return array()
[ "private function prepareSortOrders()\n {\n $sortOrders = [];\n\n foreach ($this->_orders as $attribute => $direction) {\n $sortParams = ['direction' => $direction];\n $sortField = $attribute;\n $sortOrders[$sortField] = $sortParams;\n }\n\n return $so...
[ "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:" }
// SetNextToken sets the NextToken field's value.
[ "func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetNextToken(v string) *DescribeConfigurationAggregatorSourcesStatusInput {\n\ts.NextToken = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// LOCKS_EXCLUDED(fs.mu)
[ "func (fs *Goofys) ReadDir(\n\tctx context.Context,\n\top *fuseops.ReadDirOp) (err error) {\n\n\t// Find the handle.\n\tfs.mu.Lock()\n\tdh := fs.dirHandles[op.Handle]\n\tfs.mu.Unlock()\n\n\tif dh == nil {\n\t\tpanic(fmt.Sprintf(\"can't find dh=%v\", op.Handle))\n\t}\n\n\tinode := dh.inode\n\tinode.logFuse(\"ReadDir...
[ "public void init(BaseDatabase database, Record record)\n {\n super.init(database, record);\n\n // Call super to set the table property (without calling remote).\n super.setProperty(DBParams.SUPRESSREMOTEDBMESSAGES, DBConstants.TRUE);\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// SophieReader interface
[ "func (ba *RawByteSlice) ReadFrom(r Reader, sz int) error {\n\tif sz < 0 {\n\t\treturn errorsp.WithStacksAndMessage(ErrBadFormat, \"expecting a size but get %d\", sz)\n\t}\n\t*ba = make(RawByteSlice, sz)\n\n\tn, err := io.ReadFull(r, *ba)\n\tif n != sz {\n\t\tlog.Printf(\"RawByteSlice.ReadFrom: exp %d bytes act %d:...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UniqueInputFieldNamesRule Unique input field names // // A GraphQL input object value is only valid if all supplied fields are // uniquely named.
[ "func UniqueInputFieldNamesRule(context *ValidationContext) *ValidationRuleInstance {\n\tknownNameStack := []map[string]*ast.Name{}\n\tknownNames := map[string]*ast.Name{}\n\n\tvisitorOpts := &visitor.VisitorOptions{\n\t\tKindFuncMap: map[string]visitor.NamedVisitFuncs{\n\t\t\tkinds.ObjectValue: {\n\t\t\t\tEnter: f...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the sentence about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Copies values from {@code value}, appending to collections, and skipping empty optionals. @return this {@code Builder} object
[ "public Datatype.Builder mergeFrom(Datatype value) {\n Datatype_Builder defaults = new Datatype.Builder();\n if (defaults._unsetProperties.contains(Property.TYPE)\n || !Objects.equals(value.getType(), defaults.getType())) {\n setType(value.getType());\n }\n if (defaults._unsetProperties.cont...
[ "@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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Nice size. :param size: the size. :type size: int :return: a nicely printed size. :rtype: string
[ "def nice_size(size):\n \n unit = 'B'\n if size > 1024:\n size /= 1024.0\n unit = 'KB'\n if size > 1024:\n size /= 1024.0\n unit = 'MB'\n if size > 1024:\n size /= 1024.0\n unit = 'GB'\n return '%s %s' % (nice_number(siz...
[ "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 sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
Verifies the MultipartBody by reading the individual parts and copying them to a new MultipartBody instance which will be written out in the multipart/mixed format. @param body the incoming MultipartBody @return new MultipartBody
[ "private MultipartBody duplicateMultipartBody(MultipartBody body) {\n \n // It is possible to access individual parts by the Content-Id values\n // This MultipartBody is expected to contain 3 parts, \n // \"book1\", \"book2\" and \"image\". \n \n // These individual parts h...
[ "def _make_read_lob_request(self, readoffset, readlength):\n \n self._connection._check_closed()\n\n request = RequestMessage.new(\n self._connection,\n RequestSegment(\n message_types.READLOB,\n (ReadLobRequest(self._lob_header.locator_id, re...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about software development:" }
Get the tool parameters as a simple dictionary :return: The tool parameters
[ "def parameters_dict(self):\n \n d = {}\n for k, v in self.__dict__.items():\n if not k.startswith(\"_\"):\n d[k] = v\n return d" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parses <Text> @param node: Node containing the <Text> element @type node: xml.etree.Element
[ "def parse_text(self, node):\n \n\n if 'name' in node.lattrib:\n name = node.lattrib['name']\n else:\n self.raise_error('<Text> must specify a name.')\n\n description = node.lattrib.get('description', '')\n\n self.current_component_type.add_text(Text(name, de...
[ "def _MakeGroupFromRootSection(root_section, undefined_str):\n \n group = {}\n for statement in root_section.Statements():\n if isinstance(statement, six.string_types):\n continue\n func, args = statement\n # here the function acts as ID for the block type\n if func i...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Set url (don't use this) @param mixed $path @return void
[ "public static function url(string $path, $uri)\n {\n $path = substr($path, 0, 1) != '/' ? '/' . $path : $path;\n\n $root = isset($_SERVER[\"SCRIPT_NAME\"]) ? $_SERVER['SCRIPT_NAME'] : '';\n $dir = pathinfo($root)['dirname'];\n\n if (isset($_SERVER['HTTP_HOST'])) {\n if (isset($_SERVER['HTTPS']) &...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SvcProviderUpdate invokes switch api
[ "func (p *NodeSvcProxy) SvcProviderUpdate(svcName string, providers []string) {\n\tlog.Infof(\"Node proxy AddSvcSpec: %s %v\", svcName, providers)\n\tp.Mutex.Lock()\n\tdefer p.Mutex.Unlock()\n\t// check if there is at least one local provider\n\tlocalProv := false\n\tfor _, prov := range providers {\n\t\t_, localPr...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }