query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Removes all labels for a given client. Args: client_id: The client_id. labels: A list of labels to remove.
[ "def RemoveClientLabels(self, client_id, labels):\n \n for label in labels:\n keyword = self._NormalizeKeyword(label)\n # This might actually delete a keyword with the same name as the label (if\n # there is one).\n data_store.REL_DB.RemoveClientKeyword(client_id, keyword)\n data_stor...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns eZTagsObject for given ID, using the main translation of the tag @static @param int $id @return eZTagsObject
[ "static public function fetchWithMainTranslation( $id )\n {\n $tags = self::fetchList( array( 'id' => $id ), null, null, true );\n\n if ( is_array( $tags ) && !empty( $tags ) )\n return $tags[0];\n\n return false;\n }" ]
[ "static function expireCache()\n {\n $http = eZHTTPTool::instance();\n\n $http->removeSessionVariable( 'CanInstantiateClassList' );\n $http->removeSessionVariable( 'ClassesCachedForUser' );\n\n // Expire user (role) cache\n eZUser::cleanupCache();\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Technology:" }
Return "after" and "before" children, based on contextual View and its Templates. @return array
[ "public function getChildren(WidgetMap $widgetMap, View $view = null)\n {\n $positions = [WidgetMap::POSITION_BEFORE, WidgetMap::POSITION_AFTER];\n $children = [];\n foreach ($positions as $position) {\n $matchingChildren = [];\n\n //Position is null by default\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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Make server sockets @throws SocketException|\Exception @return void
[ "protected function makeSocket(): void\n {\n if ($this->useSSL) {\n if (!file_exists($this->cert)) {\n throw new \\Exception('Cert file not found');\n }\n\n $context = stream_context_create([\n 'ssl' => [\n 'local_cert' ...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Creates a Kint instances based on static settings. Also calls setStatesFromStatics for you @param array $statics array of statics as returned by getStatics @return null|\Kint\Kint
[ "public static function createFromStatics(array $statics)\n {\n $mode = false;\n\n if (isset($statics['enabled_mode'])) {\n $mode = $statics['enabled_mode'];\n\n if (true === $statics['enabled_mode'] && isset($statics['mode_default'])) {\n $mode = $statics['mode...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Increase page number and get next results batch return array
[ "public function getNext()\n {\n if (count($this->pagination) == 0) {\n $this->get();\n }\n \n if ($this->page < $this->pagination['total_pages']) {\n $this->page++;\n return $this->get();\n }\n \n return false;\n }" ]
[ "function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Tells whether the backend process is running. :return: True if the process is running, otherwise False
[ "def running(self):\n \n try:\n return (self._process is not None and\n self._process.state() != self._process.NotRunning)\n except RuntimeError:\n return False" ]
[ "def connectTo(self, remoteRouteName):\n \n self.remoteRouteName = remoteRouteName\n # This route must not be started before its router is started. If\n # sender is None, then the router is not started. When the router is\n # started, it will start this route.\n if self.r...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<pre> Use this operation to add SNMP Manager. </pre>
[ "public static snmp_manager add(nitro_service client, snmp_manager resource) throws Exception\r\n\t{\r\n\t\tresource.validate(\"add\");\r\n\t\treturn ((snmp_manager[]) resource.perform_operation(client, \"add\"))[0];\r\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
We need to deal with possible null values and exceptions. This is a simple placeholder implementation that covers it all by working on the entry.
[ "@Override\n public Map<K, V> peekAll(final Iterable<? extends K> keys) {\n Map<K, CacheEntry<K, V>> map = new HashMap<K, CacheEntry<K, V>>();\n for (K k : keys) {\n CacheEntry<K, V> e = execute(k, SPEC.peekEntry(k));\n if (e != null) {\n map.put(k, e);\n }\n }\n return heapCache....
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// Backends requests a list of all backends that are configured on the cluster.
[ "func (c *engineRPC) Backends() (map[string]*seesaw.Backend, error) {\n\tvar bm seesaw.BackendMap\n\tif err := c.client.Call(\"SeesawECU.Backends\", c.ctx, &bm); err != nil {\n\t\treturn nil, err\n\t}\n\treturn bm.Backends, nil\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the description about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about Software development:" }
save fence points to a file
[ "def save(self, filename):\n ''''''\n f = open(filename, mode='w')\n for p in self.points:\n f.write(\"%f\\t%f\\n\" % (p.lat, p.lng))\n f.close()" ]
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
mutate opts obj by normalizing Key values into form [ { path:x },... ] qualify relative paths against basedir
[ "function normalizeOpts(obj, basedir, pkg) {\n obj = obj || {};\n\n u.each(OPTSKEYS, function(key) {\n obj[key] = normalizeOptsKey(obj[key], basedir, pkg);\n });\n\n normalizeFqImages(obj);\n\n return obj;\n }" ]
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update or crate a record and return the entity @param array $identifiers columns to search for @param array $data @return mixed
[ "public function updateOrCreate(array $identifiers, array $data)\n {\n $existing = $this->model->where(array_only($data, $identifiers))->first();\n\n if ($existing) {\n $existing->update($data);\n\n return $existing;\n }\n\n return $this->create($data);\n }" ]
[ "protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Set the default metadata cache @param string|Zend_Cache_Core $cache @return void
[ "protected function setDefaultMetadataCache($cache, ServiceLocatorInterface $serviceLocator)\n {\n $metadataCache = null;\n\n if (is_string($cache)) {\n if ($serviceLocator->has($cache)) {\n $metadataCache = $serviceLocator->get($cache);\n }\n } else if (...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Add scale 'sc' and remove any previous scales that cover the same aesthetics
[ "def append(self, sc):\n \n ae = sc.aesthetics[0]\n cover_ae = self.find(ae)\n if any(cover_ae):\n warn(_TPL_DUPLICATE_SCALE.format(ae), PlotnineWarning)\n idx = cover_ae.index(True)\n self.pop(idx)\n # super() does not work well with reloads\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Collect number values from db.serverStatus() and db.engineStatus()
[ "def collect(self):\n \"\"\"\"\"\"\n\n if pymongo is None:\n self.log.error('Unable to import pymongo')\n return\n\n # we need this for backwards compatibility\n if 'host' in self.config:\n self.config['hosts'] = [self.config['host']]\n\n # convert...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
returns list of parameters @return \stubbles\webapp\routing\api\Parameter[] @since 6.1.0
[ "public function parameters(): array\n {\n return array_map(\n function($parameter)\n {\n $param = new Parameter(\n $parameter->getName(),\n $parameter->getDescription(),\n $pa...
[ "public function setupMappingDefinition(\\n2n\\web\\dispatch\\map\\bind\\MappingDefinition $md) {\r\n\t\t$this->decorated->setupMappingDefinition($md);\r\n\t}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get a list of staged (in-progress) imports. :return: :class:`imports.Import <imports.Import>` list
[ "def list(self):\n \n schema = ImportSchema()\n resp = self.service.list(self.base)\n return self.service.decode(schema, resp, many=True)" ]
[ "def fetch_all_records(self):\n \n \"\"\"\n api = self.doapi_manager\n return map(self._record, api.paginate(self.record_url, 'domain_records'))" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS Route 53:" }
// FieldNames return the names of fields in the table as a slice
[ "func (dt *DbfTable) FieldNames() []string {\n\tnames := make([]string, 0)\n\n\tfor _, field := range dt.Fields() {\n\t\tnames = append(names, field.name)\n\t}\n\n\treturn names\n}" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github text about Text analysis:", "pos": "Represent the Github code about Text analysis:", "neg": "Represent the Github code:" }
// ExecuteShards please see vtgateconn.Impl.ExecuteShard
[ "func (conn *FakeVTGateConn) ExecuteShards(ctx context.Context, sql string, keyspace string, shards []string, bindVars map[string]*querypb.BindVariable, tabletType topodatapb.TabletType, session *vtgatepb.Session, options *querypb.ExecuteOptions) (*vtgatepb.Session, *sqltypes.Result, error) {\n\tvar s *vtgatepb.Ses...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\r\n\tpublic EEnum getIfcAlarmTypeEnum() {\r\n\t\tif (ifcAlarmTypeEnumEEnum == null) {\r\n\t\t\tifcAlarmTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(912);\r\n\t\t}\r\n\t\treturn ifcAlarmTypeEnumEEnum;\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 description about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
// NewFromTokens returns an authenticator.Request or an error
[ "func NewFromTokens(tokens map[string]*user.DefaultInfo) authenticator.Request {\n\treturn bearertoken.New(tokenfile.New(tokens))\n}" ]
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Recursive function to get all associations in inheritance @param ClassMetadata $class @param array $associations @return array
[ "private function getInheritanceAssociations(ClassMetadata $class, $associations = array())\n {\n if ($parent = $this->classStore->getParent($class)) {\n foreach ($parent->getAssociationNames() as $association) {\n if (!in_array($association, $associations)) {\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 sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(BatchWriteOperation batchWriteOperation, ProtocolMarshaller protocolMarshaller) {\n\n if (batchWriteOperation == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(batchWri...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Bifurcation section lengths in a collection of neurites
[ "def section_bif_lengths(neurites, neurite_type=NeuriteType.all):\n ''''''\n return map_sections(_section_length, neurites, neurite_type=neurite_type,\n iterator_type=Tree.ibifurcation_point)" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Log a message object at the WARNING level. @param msg - the message object to be logged
[ "public void warn(String msg) {\n if (logger.isLoggable(Level.WARNING)) {\n log(SELF, Level.WARNING, msg, null);\n }\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Populates a field based on baseline and actual values. @param container field container @param target target field @param baseline baseline field @param actual actual field
[ "private void populateField(FieldContainer container, FieldType target, FieldType baseline, FieldType actual)\n {\n Object value = container.getCachedValue(actual);\n if (value == null)\n {\n value = container.getCachedValue(baseline);\n }\n container.set(target, value);\n }" ]
[ "def run(configObj=None, input_dict={}, loadOnly=False):\n \n # If called from interactive user-interface, configObj will not be\n # defined yet, so get defaults using EPAR/TEAL.\n #\n # Also insure that the input_dict (user-specified values) are folded in\n # with a fully populated configObj inst...
codesearchnet
{ "query": "Represent the text about Data transformation:", "pos": "Represent the code about Data transformation:", "neg": "Represent the code:" }
DeleteShift Deletes a `Shift`. @param id UUID for the &#x60;Shift&#x60; being deleted. @param [Hash] opts the optional parameters @return [DeleteShiftResponse]
[ "def delete_shift(id, opts = {})\n data, _status_code, _headers = delete_shift_with_http_info(id, opts)\n return data\n end" ]
[ "def delete(node)\n # => Make sure the Node Exists\n return 'Node not found on Chef Server' unless Node.exists?(node)\n\n # => Initialize the Admin API Client Settings\n admin_api_client\n\n # => Delete the Client & Node Object\n Client.delete(node)\n Node.delete(node)\n 'Cli...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software Development:" }
// checkBitmapFile performs a consistency check on path for a roaring bitmap file.
[ "func (cmd *CheckCommand) checkBitmapFile(path string) (err error) {\n\t// Open file handle.\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"opening file\")\n\t}\n\tdefer f.Close()\n\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"statting file\")\n\t}\n\n\t// M...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Opens the dao's connection. Dn and credentials are used for authentication. Throws an {@link LdapDaoException} in case of IO error or invalid dn.
[ "public void connect(String dn, String credentials) {\n BindRequest bindRequest = new BindRequestImpl();\n bindRequest.setCredentials(credentials);\n try {\n bindRequest.setDn(new Dn(dn));\n connection.connect();\n connection.bind(bindRequest);\n ((Ld...
[ "@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n...
codesearchnet
{ "query": "Represent the sentence about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
Handles ajax responses for flash notifications. callback fn is passed with 3 params, 1. {Boolean} true if success 2. {String} message either success or error 3. {Object} json given by server @param {Function} fn
[ "function (fn) {\n return function (response) {\n fn(response.status === \"success\" ? true : false, response.message, response.data);\n };\n }" ]
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Update replaces a dashboard from the file system directory
[ "func (d *Dashboards) Update(ctx context.Context, dashboard chronograf.Dashboard) error {\n\tboard, _, err := d.idToFile(dashboard.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := d.Delete(ctx, board); err != nil {\n\t\treturn err\n\t}\n\tfile := dashboardFile(d.Dir, dashboard)\n\treturn d.Create(file, da...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// You should always use this function to get a new UpdateCloudToUseObjectStoreParams instance, // as then you are sure you have configured all required params
[ "func (s *ImageStoreService) NewUpdateCloudToUseObjectStoreParams(provider string) *UpdateCloudToUseObjectStoreParams {\n\tp := &UpdateCloudToUseObjectStoreParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"provider\"] = provider\n\treturn p\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns the formatted price with TAX. @param int $decimals @param string $decimalPoint @param string $thousandSeperator @return string
[ "public function priceTax($decimals = null, $decimalPoint = null, $thousandSeperator = null)\n {\n return $this->numberFormat($this->priceTax, $decimals, $decimalPoint, $thousandSeperator);\n }" ]
[ "public function filter($value)\n {\n if (empty($value)) {\n return $value;\n }\n\n return number_format(floatval($value), $this->decimals, $this->decimalPoint, $this->thousandSeparator);\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
This method only returns a list of sub-components. Properties are ignored. @return array
[ "public function getComponents()\n {\n $result = [];\n\n foreach ($this->children as $childGroup) {\n foreach ($childGroup as $child) {\n if ($child instanceof self) {\n $result[] = $child;\n }\n }\n }\n\n return $...
[ "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 Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Concatenate the object list @param $objects
[ "public function concatenateObjectList()\n {\n //Short circuit if cache is disabled\n if (empty($this->cache) || empty($this->cacheKey) || empty($this->cacheTime)) {\n $this->source = 'raw';\n $this->output = $this->concatenateObjects();\n return;\n }\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Converts rdata to a String
[ "String\nrrToString()\n{\n\tStringBuffer sb = new StringBuffer();\n\tsb.append(next);\n\tif (!types.empty()) {\n\t\tsb.append(' ');\n\t\tsb.append(types.toString());\n\t}\n\treturn sb.toString();\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:" }
// SetName sets the Name field's value.
[ "func (s *MemberSummary) SetName(v string) *MemberSummary {\n\ts.Name = &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:" }
// Archive stores the
[ "func (s *WMailServer) Archive(env *whisper.Envelope) {\n\tkey := NewDbKey(env.Expiry-env.TTL, env.Hash())\n\trawEnvelope, err := rlp.EncodeToBytes(env)\n\tif err != nil {\n\t\tlog.Error(fmt.Sprintf(\"rlp.EncodeToBytes failed: %s\", err))\n\t} else {\n\t\terr = s.db.Put(key.raw, rawEnvelope, nil)\n\t\tif err != nil...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence about computer science:", "pos": "Represent the code about computer science:", "neg": "Represent the code:" }
// NewWriter returns a new Writer writing a zip file to w.
[ "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{cw: &countWriter{w: bufio.NewWriter(w)}}\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about programming:" }
// ExecuteSQL - // databaseId - // query - // Returns - columnNames - values - sqlError -
[ "func (c *Database) ExecuteSQL(databaseId string, query string) ([]string, []interface{}, *DatabaseError, error) {\n\tvar v DatabaseExecuteSQLParams\n\tv.DatabaseId = databaseId\n\tv.Query = query\n\treturn c.ExecuteSQLWithParams(&v)\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Generate a thumbnail for a given image file. :param file file: The source image file to thumbnail :param int size: The thumbnail size in pixels (Thumbnails are squares) :param tuple bbox: An optionnal Bounding box definition for the thumbnail
[ "def make_thumbnail(file, size, bbox=None):\n '''\n \n '''\n image = Image.open(file)\n if bbox:\n thumbnail = crop_thumbnail(image, size, bbox)\n else:\n thumbnail = center_thumbnail(image, size)\n return _img_to_file(thumbnail)" ]
[ "def _find_regular_images(container, contentsinfo):\n \n\n for pdfimage, xobj in _image_xobjects(container):\n\n # For each image that is drawn on this, check if we drawing the\n # current image - yes this is O(n^2), but n == 1 almost always\n for draw in contentsinfo.xobject_settings:\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
get/set baseURI @param string $href @return string
[ "public function baseURI($href = null)\n {\n if (func_num_args() < 1) {\n $href = @$this->_prop['baseURI'];\n } else {\n if ($href) {\n $t = self::get_url_base($href, true);\n if (!$t) {\n return false;\n }\n\n ...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github description about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// SetRestoreDateTime sets the RestoreDateTime field's value.
[ "func (s *RestoreSummary) SetRestoreDateTime(v time.Time) *RestoreSummary {\n\ts.RestoreDateTime = &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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
//NewServer returns a new server
[ "func NewServer(codec ServerCodec, defaultHandler interface{}) *Server {\n\tvalue := reflect.ValueOf(defaultHandler)\n\tif !validHandler(value, reflect.TypeOf(defaultHandler).Name()) {\n\t\tpanic(\"NewServer: invalid default handler\")\n\t}\n\n\ts := &Server{\n\t\tclosed: new(int32),\n\t\trooms: make(map[string]...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Transform Orc column types into H2O type. @param s Orc data type @return a byte representing H2O column type @throws IllegalArgumentException if schema is not supported
[ "public static byte schemaToColumnType(String s) {\n switch (s.toLowerCase()) {\n case \"boolean\":\n case \"smallint\":\n case \"tinyint\":\n case \"bigint\": // FIXME: make sure this is fixed by Tomas.\n case \"int\":\n case \"float\":\n ...
[ "public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {\n throw new UnsupportedOperationException(\"Not implemented. This method is kept only for backwards compatibility...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Setup TravisCi configurations. @return self @throws \Exception @throws \Psr\Container\ContainerExceptionInterface @throws \Psr\Container\NotFoundExceptionInterface
[ "public function phpTravisCi()\n {\n $this->executeCommandHook(__FUNCTION__, 'before');\n $this->getProjectInstance()\n ->setupTravisCi();\n $this->executeCommandHook(__FUNCTION__, 'after');\n\n return $this;\n }" ]
[ "protected function addSql($sql, array $params = [], array $types = [])\n {\n $message = 'Calling method \"addSql\" is not allowed. Use \"sql\" method instead';\n throw new \\Shopsys\\MigrationBundle\\Component\\Doctrine\\Migrations\\Exception\\MethodIsNotAllowedException($message);\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Change the window's classname and or class. :param name: The new class name. If ``None``, no change. :param class_: The new class. If ``None``, no change.
[ "def set_window_class(self, window, name, class_):\n \n _libxdo.xdo_set_window_class(self._xdo, window, name, class_)" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
fetches the setup for each of the columns assigns a default setup if there is none available @param string $layoutId The selected backend layout of the grid container @return array The adjusted TypoScript setup for the container or a default setup
[ "public function getTypoScriptSetup($layoutId)\n {\n $typoScriptSetup = [];\n\n if ($layoutId == '0' && isset($this->typoScriptSetup['setup.']['default.'])) {\n $typoScriptSetup = $this->typoScriptSetup['setup.']['default.'];\n } elseif ($layoutId && isset($this->typoScriptSetup['...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Check if the user have access to the comment @param integer $commentID Comment ID @return boolean True if the user is admin or is the owner of the comment
[ "public function hasAccessToComment($commentID)\n {\n\n $this->isLoggedIn();\n\n $userid = $this->di->get(\"session\")->get(\"userid\");\n $comment = new Comment();\n $comment->setDb($this->di->get(\"db\"));\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n...
[ "protected function meetsConditions()\n {\n // If profile visibility is public, it can be display\n // for everyone, so users can edit own profiles.\n if (isset($this->visibility) && $this->visibility === 'public') {\n return true;\n }\n\n // Profile is hidden. Can b...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about NLP:" }
Gathers Extension Information @return array
[ "private function gatherInformation()\n {\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(ObjectManager::class);\n /** @var ListUtility $service */\n $service = $objectManag...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
我的金币 @param int $id @return string
[ "public function actionIndex($id)\n {\n $model = $this->findModel($id);\n $dataProvider = new ActiveDataProvider([\n 'query' => Coin::find()->where(['user_id' => $model->id])->orderBy(['created_at' => SORT_DESC]),\n ]);\n return $this->render('index', [\n 'model'...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetWorkflowExecutionRetentionPeriodInDays sets the WorkflowExecutionRetentionPeriodInDays field's value.
[ "func (s *DomainConfiguration) SetWorkflowExecutionRetentionPeriodInDays(v string) *DomainConfiguration {\n\ts.WorkflowExecutionRetentionPeriodInDays = &v\n\treturn s\n}" ]
[ "private static void updateDeliveryStream() throws Exception {\n DeliveryStreamDescription deliveryStreamDescription = describeDeliveryStream(deliveryStreamName);\n \n LOG.info(\"Updating DeliveryStream Destination: \" + deliveryStreamName + \" with new configuration options\");\n // get...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Reset restores the Bloom filter to its original state. It returns the filter // to allow for chaining.
[ "func (p *PartitionedBloomFilter) Reset() *PartitionedBloomFilter {\n\tfor _, partition := range p.partitions {\n\t\tpartition.Reset()\n\t}\n\treturn p\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Helper method to check whether a given resource is a folder.<p> @param resource the resouce to check @return true if the resource is a folder @throws CmsLoaderException if the resource type couldn't be found
[ "protected static boolean isFolder(CmsResource resource) throws CmsLoaderException {\n\n I_CmsResourceType resourceType = OpenCms.getResourceManager().getResourceType(resource.getTypeId());\n return resourceType.isFolder();\n }" ]
[ "protected static RuntimeException unsettable(String view, String attribute, boolean create) {\n // This matches the behavior of the real file system implementations: if the attempt to set the\n // attribute is being made during file creation, throw UOE even though the attribute is one\n // that cannot be ...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Filter nested context array. @param array $properties @return array
[ "protected function filterNestedContext(array $properties = [])\n {\n $func = function($value, $key) {\n return ($value && $key !== '@context');\n };\n\n if (!defined('ARRAY_FILTER_USE_BOTH')) {\n $return = [];\n foreach ($properties as $k => $v) {\n ...
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
returns all the connected CMSIS-DAP devices
[ "def get_all_connected_interfaces():\n \n all_devices = hid.find_all_hid_devices()\n\n # find devices with good vid/pid\n all_mbed_devices = []\n for d in all_devices:\n if (d.product_name.find(\"CMSIS-DAP\") >= 0):\n all_mbed_devices.append(d)\n\n ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Reconstruct a serialized object from the specified byte array. @param buffer the buffer from which the object should be reconstructed @return a serialized object from the specified byte array
[ "@SuppressWarnings(\"unchecked\")\n private P byteBufferToPage(ByteBuffer buffer) {\n try (InputStream bais = new ByteBufferInputStream(buffer);\n ObjectInputStream ois = new ObjectInputStream(bais)) {\n int type = ois.readInt();\n if (type == EMPTY_PAGE) {\n return null;\n } else i...
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the translated messages for the given keys. @param array $messageKeys @param $locale @return array The translated messages as [ <message id> => <translation>, ... ]
[ "protected function getTranslatedMessages(array $messageKeys, $locale)\n {\n $translatedMessages = [];\n\n foreach ($messageKeys as $key) {\n $translation = Lang::get($key, [], $locale);\n\n if (is_array($translation)) {\n $flattened = $this->flattenTranslations...
[ "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 PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// CreateConfigMap creates a ConfigMap with the generic kubelet configuration. // Used at "kubeadm init" and "kubeadm upgrade" time
[ "func CreateConfigMap(cfg *kubeletconfig.KubeletConfiguration, k8sVersionStr string, client clientset.Interface) error {\n\n\tk8sVersion, err := version.ParseSemantic(k8sVersionStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tconfigMapName := kubeadmconstants.GetKubeletConfigMapName(k8sVersion)\n\tfmt.Printf(\"[ku...
[ "func GetAPIServerProbeAddress(endpoint *kubeadmapi.APIEndpoint) string {\n\t// In the case of a self-hosted deployment, the initial host on which kubeadm --init is run,\n\t// will generate a DaemonSet with a nodeSelector such that all nodes with the label\n\t// node-role.kubernetes.io/master='' will have the API s...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Computer Science:" }
// --------------------------------------------------------------------- // Destructor
[ "func (mdcli *Mdcli) Close() (err error) {\n\tif mdcli.client != nil {\n\t\terr = mdcli.client.Close()\n\t\tmdcli.client = nil\n\t}\n\treturn\n}" ]
[ "func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the long value of the specified field, by returning the corresponding value on the saved scan. @see org.vanilladb.core.remote.jdbc.RemoteResultSet#getLong(java.lang.String)
[ "@Override\r\n\tpublic long getLong(String fldName) throws RemoteException {\r\n\t\ttry {\r\n\t\t\tfldName = fldName.toLowerCase(); // to ensure case-insensitivity\r\n\t\t\treturn (Long) s.getVal(fldName).castTo(BIGINT).asJavaVal();\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\trconn.rollback();\r\n\t\t\tthrow e;\...
[ "@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Support function for iat(). Find cutting time, when gammas become negative.
[ "def _cut_time(gammas):\n \"\"\"\"\"\"\n\n for i in range(len(gammas) - 1):\n\n if not ((gammas[i + 1] > 0.0) & (gammas[i + 1] < gammas[i])):\n return i\n\n return i" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// ScheduledJobs returns a list of ScheduledJob's. The page param is 1-based; each page is 20 items. The total number of items (not pages) in the list of scheduled jobs is also returned.
[ "func (c *Client) ScheduledJobs(page uint) ([]*ScheduledJob, int64, error) {\n\tkey := redisKeyScheduled(c.namespace)\n\tjobsWithScores, count, err := c.getZsetPage(key, page)\n\tif err != nil {\n\t\tlogError(\"client.scheduled_jobs.get_zset_page\", err)\n\t\treturn nil, 0, err\n\t}\n\n\tjobs := make([]*ScheduledJo...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
@return NodeInterface @throws \RuntimeException
[ "public function getParentNode()\n {\n if (!$this->parentNode) {\n throw new \\RuntimeException(sprintf(\n 'Trying to retrieve parent node when no parent node has been set. An event ' .\n 'listener should have set the node when persisting document \"%s\"',\n ...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// deriveCloneCoord returns a clone of the src parameter.
[ "func deriveCloneCoord(src Coord) Coord {\n\tif src == nil {\n\t\treturn nil\n\t}\n\tdst := make(Coord, len(src))\n\tderiveDeepCopy_(dst, src)\n\treturn dst\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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Poisson function a -> height of the curve's peak b -> position of the center of the peak c -> standard deviation d -> offset
[ "def poisson(x, a, b, c, d=0):\r\n '''\r\n \r\n '''\r\n from scipy.misc import factorial #save startup time\r\n lamb = 1\r\n X = (x/(2*c)).astype(int)\r\n return a * (( lamb**X/factorial(X)) * np.exp(-lamb) ) +d" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetId sets the Id field's value.
[ "func (s *Group) SetId(v string) *Group {\n\ts.Id = &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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// GetBandwidth returns details bandwidth data for the requested relays/bridges
[ "func GetBandwidth(query map[string]string, lastModifiedSince string) (*Bandwidth, string, error) {\n\tbandwidth := new(Bandwidth)\n\n\tif lastModified, err := executeRequest(\"bandwidth\", query, lastModifiedSince, &bandwidth); err != nil {\n\t\treturn nil, \"\", err\n\t} else {\n\t\treturn bandwidth, lastModified...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github description about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code about Software development:" }
Returns the likeliest variable to be the time coordiante variable :param netCDF4.Dataset ds: An open netCDF4 Dataset
[ "def get_time_variable(ds):\n '''\n \n '''\n for var in ds.variables:\n if getattr(ds.variables[var], 'axis', '') == 'T':\n return var\n else:\n candidates = ds.get_variables_by_attributes(standard_name='time')\n if len(candidates) == 1:\n return candidates[...
[ "def run(configObj=None, input_dict={}, loadOnly=False):\n \n # If called from interactive user-interface, configObj will not be\n # defined yet, so get defaults using EPAR/TEAL.\n #\n # Also insure that the input_dict (user-specified values) are folded in\n # with a fully populated configObj inst...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
generate the current restore key @param User $user @return string
[ "public function restore_key( $user ) \n\t{\n\t\treturn \\CCStr::hash( $user->password.'@'.$user->{$this->config->user_key}.'%'.\\CCIn::client()->agent );\n\t}" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
/* For test purposes only.
[ "boolean isPredecessorOf(final ControlFlowBlock possibleSuccessor) {\n boolean result = false;\n for (final ControlFlowBlock directSuccessor : successors) {\n if (directSuccessor.equals(possibleSuccessor) || directSuccessor.isPredecessorOf(possibleSuccessor)) {\n result = tru...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Подготавливает запрос, включающий IN (:array) плейсхолдеры @param string $sql @return string $sql @throws IException
[ "protected function prepareArrayPlaceholders($sql)\n {\n if (!count($this->arrays)) {\n return $sql;\n }\n foreach ($this->arrays as $placeholder => $array) {\n if (strpos($sql, $placeholder) === false) {\n continue;\n }\n\n $placeho...
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\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:" }
/* (non-Javadoc) @see org.joml.Quaterniondc#integrate(double, double, double, double, org.joml.Quaterniond)
[ "public Quaterniond integrate(double dt, double vx, double vy, double vz, Quaterniond dest) {\n double thetaX = dt * vx * 0.5;\n double thetaY = dt * vy * 0.5;\n double thetaZ = dt * vz * 0.5;\n double thetaMagSq = thetaX * thetaX + thetaY * thetaY + thetaZ * thetaZ;\n double s;\n...
[ "public Vector4d transform(Vector4dc vec, Vector4d dest) {\n return transform(vec.x(), vec.y(), vec.z(), dest);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// New initializes a new certs monitor.
[ "func New(certFile, keyFile string, loadCert LoadX509KeyPairFunc) (*Certs, error) {\n\tcertFileIsLink, err := checkSymlink(certFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeyFileIsLink, err := checkSymlink(keyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc := &Certs{\n\t\tcertFile: certFile,\n\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the present export files on the server to show in the combo box.<p> The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p> @return the present export files on the server to show in the combo box
[ "protected List getComboExportFiles() {\n\n List result = new ArrayList(8);\n Iterator i = CmsDatabaseImportFromServer.getFileListFromServer(true).iterator();\n while (i.hasNext()) {\n String fileName = (String)i.next();\n String helpText = key(Messages.GUI_EDITOR_HELP_EXP...
[ "public boolean showElementLanguageSelector() {\n\n List<Locale> locales = OpenCms.getLocaleManager().getAvailableLocales(getCms(), getParamResource());\n if ((locales == null) || (locales.size() < 2)) {\n // for less than two available locales, do not create language selector\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Override the implementation of scanDir, to look for additional files based upon any specified source extensions
[ "protected void scanDir(File srcDir, File destDir, String[] files, String ext)\n\t{\n\t\t// If no source path was specified, we effectively created one by adding the generation\n\t\t// path. Because of this, we need to be sure and add all source dirs to the path too.\n\t\tif (!_hasSourcepath)\n\t\t{\n\t\t\tPath s...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
分页. 如果$pageNo等于null,那么直接读取page[page]做为$pageNo和page[size]做为$size. @param int|null $pageNo 页数,从1开始. @param int $size 默认每页20条 @return $this @see QueryBuilder::limit()
[ "public function page($pageNo = null, $size = 20) {\n if ($pageNo === null) {\n $pageNo = irqst('pager.page', 1);\n $size = irqst('pager.size', 20);\n }\n $pageNo = intval($pageNo);\n if ($pageNo <= 0) {\n $pageNo = 1;\n }\n\n return $this...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetVpceServiceName sets the VpceServiceName field's value.
[ "func (s *CreateVPCEConfigurationInput) SetVpceServiceName(v string) *CreateVPCEConfigurationInput {\n\ts.VpceServiceName = &v\n\treturn s\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
@param $value @return string
[ "private function getName($value)\n {\n if (is_object($value)) {\n return get_class($value);\n }\n if (is_array($value)) {\n return $this->getArrayName();\n }\n\n return $this->getScalarName($value);\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
@param \Symfony\Component\HttpFoundation\Request $request @return \Symfony\Component\HttpFoundation\Response
[ "public function loginAction(Request $request)\n {\n\n if ($this->container->getParameter('database_password') === null) {\n return $this->redirect($this->generateUrl('install_license'));\n } else {\n $request = $this->getRequest();\n $sessio...
[ "public function objectMethods($builder)\n {\n $array = $this->getParameters();\n if (empty($array)) {\n throw new InvalidArgumentException('Please, define your rules for validation.');\n }\n $this->cleanupParameters();\n\n $this->builder = $builder;\n $this->...
codesearchnet
{ "query": "Represent the Github summarization about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code:" }
The function that gets passed to the optimizers.
[ "def func(self, p):\n \n self._set_stochastics(p)\n try:\n return -1. * self.logp\n except ZeroProbability:\n return Inf" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
undocumented function @return void @author
[ "public static function getLikeViewData($itemId)\n {\n\t\t$totalCount = TotalLike::where('item_id', $itemId)->first();\n\t\tif($totalCount == NULL) {\n\t\t\t$totalCount = new TotalLike;\n\t\t\t$totalCount->item_id = $itemId;\n\t\t\t$totalCount->total_like = 0;\n\t\t\t$totalCount->total_dislike = 0;\n\n\t\t\t$tot...
[ "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:" }
// Swap implements sort.Interface interface.
[ "func (us *UnionScanExec) Swap(i, j int) {\n\tus.addedRows[i], us.addedRows[j] = us.addedRows[j], us.addedRows[i]\n}" ]
[ "public static <T extends Comparable<? super T>> void sort(List<T> list) {\n\t\tsort(list, QuickSort.<T>naturalOrder()); // JAVA_8 replace with Comparator.naturalOrder() (and cleanup) \n\t}" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Delete all RTree Index extensions for the table. Drops the triggers, RTree tables, and deletes the extensions. @param tableName table name @since 3.2.0
[ "public void delete(String tableName) {\n\t\ttry {\n\t\t\tif (extensionsDao.isTableExists()) {\n\t\t\t\tList<Extensions> extensions = extensionsDao.queryByExtension(\n\t\t\t\t\t\tEXTENSION_NAME, tableName);\n\t\t\t\tfor (Extensions extension : extensions) {\n\t\t\t\t\tdelete(extension.getTableName(), extension.getC...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about AWS Auto Scaling:" }
Generate folder to files temporary of themes This function replace true folder (that has all themes) by one folder public, when accessed by request HTTP.
[ "public function buildPublicTmp ( $path ) {\n \n //repository of all themes \n $repository = $this->themeRepository();\n $repository = Filter::realPath($repository);\n \n //repository to access files of themes (symbolically)\n $repository_tmp = $this->getFol...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns Torrent object created from a file or a directory. :param str src_path: :rtype: Torrent
[ "def create_from(cls, src_path):\n \n is_dir = isdir(src_path)\n target_files, size_data = cls._get_target_files_info(src_path)\n\n SIZE_MIN = 32768 # 32 KiB\n SIZE_DEFAULT = 262144 # 256 KiB\n SIZE_MAX = 1048576 # 1 MiB\n\n CHUNKS_MIN = 1000 # todo use those lim...
[ "def _parse_singlefile(self, desired_type: Type[T], file_path: str, encoding: str, logger: Logger,\n options: Dict[str, Dict[str, Any]]) -> T:\n \n raise Exception('Not implemented since this is a MultiFileParser')" ]
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
// NewDBConnNoPool creates a new DBConn without a pool.
[ "func NewDBConnNoPool(params *mysql.ConnParams, dbaPool *dbconnpool.ConnectionPool) (*DBConn, error) {\n\tc, err := dbconnpool.NewDBConnection(params, tabletenv.MySQLStats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DBConn{\n\t\tconn: c,\n\t\tinfo: params,\n\t\tdbaPool: dbaPool,\n\t\tpool: nil...
[ "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:" }
// NOTE: the conn must be *muxBindClientConn.
[ "func (c *socks5MuxBindConnector) Connect(conn net.Conn, addr string, options ...ConnectOption) (net.Conn, error) {\n\taccepter, ok := conn.(Accepter)\n\tif !ok {\n\t\treturn nil, errors.New(\"wrong connection type\")\n\t}\n\n\treturn accepter.Accept()\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Use this API to delete gslbsite resources of given names.
[ "public static base_responses delete(nitro_service client, String sitename[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (sitename != null && sitename.length > 0) {\n\t\t\tgslbsite deleteresources[] = new gslbsite[sitename.length];\n\t\t\tfor (int i=0;i<sitename.length;i++){\n\t\t\t\tdeleteresour...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the text about Technical Support:", "pos": "Represent the code about Technical Support:", "neg": "Represent the code about Natural Language Processing:" }
Text from item. @param item Item @return Text contents of item @throws IOException If some problem inside
[ "@SuppressWarnings(\"PMD.AssignmentInOperand\")\n private String text(final T item) throws IOException {\n final String text;\n try (\n InputStream input = this.itemBody(item);\n ByteArrayOutputStream output = new ByteArrayOutputStream()\n ) {\n // @checkstyl...
[ "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 description about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code about programming:" }
Return all substitutes from contextual View (already loaded WidgetMaps) Ideally must return only one WidgetMap per View. @return WidgetMap[]
[ "public function getContextualSubstitutes()\n {\n $substitutesWidgetMaps = [];\n $viewWidgetMaps = $this->getContextualView()->getWidgetMapsForViewAndTemplates();\n\n foreach ($viewWidgetMaps as $viewWidgetMap) {\n if ($viewWidgetMap->getReplaced() == $this) {\n $su...
[ "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 sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Pauses the input stream. @return $this
[ "public function pause()\n {\n if ($this->paused) { return $this; }\n $this->input->pause();\n $this->paused = true;\n $this->emit('pause');\n return $this;\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
You can modify the container here before it is dumped to PHP code. @param ContainerBuilder $container @api
[ "public function process(ContainerBuilder $container)\n {\n if (\n $container->hasDefinition(\"nelmio_api_doc.parser.jms_metadata_parser\") &&\n (\n $container->getAlias(\"fos_rest.serializer\") == \"tpg_extjs.orm_serializer\" ||\n $container->getAlias(\...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Runs the widget. This registers the necessary JavaScript code and renders the form open and close tags. @throws InvalidCallException if `beginField()` and `endField()` calls are not matching.
[ "public function run()\n {\n if (!empty($this->_fields)) {\n throw new InvalidCallException('Each beginField() should have a matching endField() call.');\n }\n\n $content = ob_get_clean();\n $html = Html::beginForm($this->action, $this->method, $this->options);\n $ht...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
============================================================================= /* Resource Protection Closures
[ "function NotLoggedIn(req, res) {\n req.session.redirectTo = req.originalUrl;\n//debug(\"NotLoggedIn: %s -> %s\", req.session.redirectTo, req.originalUrl)\n res.redirect(redirectOptions.failureRedirect);\n }" ]
[ "public static function local()\n {\n //====================================================================//\n // Initialize Local Core Management Class\n if (isset(self::core()->localcore)) {\n return self::core()->localcore;\n }\n //==============================...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
Registers a device using the device's unique device ID. @param context @param properties @return a Device object if success
[ "public Device registerDeviceForPush(UUID deviceId,\n String notifier,\n String token,\n Map<String, Object> properties) {\n if (properties == null) {\n properties = new HashMap<String,...
[ "@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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Update counter grant @see http://api.yandex.ru/metrika/doc/beta/management/grants/editgrantold.xml @param int $counterId @param string $userLogin @param Models\Grant $grant @return Models\Grant
[ "public function updateGrant($counterId, $userLogin, Models\\Grant $grant)\n {\n $resource = 'counter/' . $counterId . '/grant/' . $userLogin;\n $response = $this->sendPutRequest($resource, [\"grant\" => $grant->toArray()]);\n $grantResponse = new Models\\UpdateGrantResponse($response);\n ...
[ "public function update( models\\Call\\ContactNumber $ContactNumber){\n $rest = $this->getService( self::API_NUMBER . $ContactNumber->getId());\n $rest->PUT( $ContactNumber);\n\n return $rest->getResult( models\\Call\\ContactNumber::class);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// ValidateExistingModelCredential checks if the cloud credential that a given model uses is valid for it.
[ "func ValidateExistingModelCredential(backend PersistentBackend, callCtx context.ProviderCallContext) (params.ErrorResults, error) {\n\tmodel, err := backend.Model()\n\tif err != nil {\n\t\treturn params.ErrorResults{}, errors.Trace(err)\n\t}\n\n\tcredentialTag, isSet := model.CloudCredential()\n\tif !isSet {\n\t\t...
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the Github text about container management:", "pos": "Represent the Github code about container management:", "neg": "Represent the Github code:" }
Parse dmesg boot log
[ "public function getDevs()\n {\n\n // Time?\n if (!empty($this->settings['timer'])) {\n $t = new Timer('Hardware Devices');\n }\n\n $hw = new Hwpci(null, '/usr/share/misc/pci_vendors');\n $hw->work('dragonfly');\n\n return $hw->result();\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 text:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }