query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Initialize session table primary key value assignment
@return void
@throws Zend_Session_SaveHandler_Exception | [
"protected function _setupPrimaryAssignment()\n {\n if ($this->_primaryAssignment === null) {\n $this->_primaryAssignment = array(1 => self::PRIMARY_ASSIGNMENT_SESSION_ID);\n } else if (!is_array($this->_primaryAssignment)) {\n $this->_primaryAssignment = array(1 => (string) $... | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
判断当前activity是否为全屏
@param activity 当前activity
@return 是否全屏 | [
"public static boolean isActivityFullscreen(Activity activity)\r\n {\r\n WindowManager.LayoutParams attrs = activity.getWindow().getAttributes();\r\n if ((attrs.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN)\r\n {\r\n return true... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the summarization about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Get solr search options for this query
@param bool $spellcheck True if we should include spellcheck support
@return array | [
"protected function getSearchOptions($spellcheck)\n {\n $options = $this->config()->get('search_options');\n if ($spellcheck) {\n $options = array_merge($options, $this->config()->get('spellcheck_options'));\n }\n return $options;\n }"
] | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Get the value of this property key.
@param strParam The key to lookup.
@return The value for this key. | [
"public String getProperty(String strProperty)\n {\n String strValue = null;\n if (m_properties != null)\n if (m_properties.get(strProperty) != null)\n strValue = m_properties.get(strProperty).toString();\n if (strValue == null)\n \tif (m_sApplet != null)\t//... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// StartChain will start a chain process, all the functions you add after this will be part of the same chain. | [
"func (bot *TgBot) StartChain() *TgBot {\n\tbot.ChainConditionals = append(bot.ChainConditionals, NewChainStructure())\n\tbot.BuildingChain = true\n\treturn bot\n}"
] | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
Parse the /config/pods/foo.cf configuration file. The configuration
is merged with the running PodsConfig. | [
"private void parseConfigFile(PodsConfig podsConfig, String path)\n {\n String configDir = \"/config/pods\";\n \n PathImpl configPath = VfsOld.lookup(\"bfs://\" + configDir + \"/\" + path);\n \n /*\n ConfigContext config = new ConfigContext();\n\n try {\n podsConfig.setCurrentDepend(new D... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Technology:"
} |
// New creates a new App and sets app id and secret. | [
"func New(appID, appSecret string) *App {\n\treturn &App{\n\t\tAppId: appID,\n\t\tAppSecret: appSecret,\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Output As config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException | [
"@Override\n void writeAsConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException\n {\n writeRequireConfigPropsXml(props, out, indent);\n writeConfigPropsXml(props, out, indent);\n }"
] | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Scale based on min,max
@param dataFrame the dataframe to scale
@return the normalized dataframe per column | [
"public static DataRowsFacade normalize(DataRowsFacade dataFrame, List<String> skipColumns) {\n return normalize(dataFrame, 0, 1, skipColumns);\n }"
] | [
"def _timeseries_component(self, series):\n \n # this is only called if the set_component function recognizes a pandas series\n # Todo: raise a warning if extrapolating from the end of the series.\n return lambda: np.interp(self.time(), series.index, series.values)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The username of the issuer. | [
"def username(self):\n \"\"\"\"\"\"\n entry = self._proto.commandQueueEntry\n if entry.HasField('username'):\n return entry.username\n return None"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
This method returns Build's properties according to property filters.
:param props: Properties as a dict (from db)
:param filters: Desired properties keys as a list (from API URI) | [
"def _generate_filtered_properties(self, props, filters):\n \n # by default no properties are returned\n if props and filters:\n return (props\n if '*' in filters\n else dict(((k, v) for k, v in props.items() if k in filters)))"
] | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see cyclops2.monads.transformers.values.ListT#scanRight(cyclops2.function.Monoid) | [
"@Override\n public ListT<W,T> scanRight(final Monoid<T> monoid) {\n\n return (ListT<W,T>) FoldableTransformerSeq.super.scanRight(monoid);\n }"
] | [
"public static <T> Reducer<PersistentList<T>,T> toPersistentListReversed() {\n return Reducer.fromMonoid(Monoids.concatPersistentCollection(Seq.empty()), a -> Seq.of(a));\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Cassandra database:"
} |
https://developers.coinbase.com/api/v2#list-payment-methods | [
"def get_payment_methods(self, **params):\n \"\"\"\"\"\"\n response = self._get('v2', 'payment-methods', params=params)\n return self._make_api_object(response, PaymentMethod)"
] | [
"private function setUrl()\n {\n $sandbox = $this->sandbox ? 'sandbox.' : '';\n\n $url = [\n 'preApprovalRequest' => 'https://ws.'.$sandbox.'pagseguro.uol.com.br/v2/pre-approvals/request',\n 'preApproval' => 'https://ws.'.$sandbox.'pagseguro.uol.co... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
getConfiguration
Return current configuration settings.
@return array
@throws ConnectionException | [
"public function getConfiguration()\n {\n $configuration = $this->configuration->getParameter('configuration');\n\n if (!is_array($configuration)) {\n throw new ConnectionException(\n sprintf(\n \"Invalid configuration. It should be an array of settings,... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Compute the complementary terms of the equation of the equinoxes.
`jd_tt` - Terrestrial Time: Julian date float, or NumPy array of floats | [
"def equation_of_the_equinoxes_complimentary_terms(jd_tt):\n \n # Interval between fundamental epoch J2000.0 and current date.\n\n t = (jd_tt - T0) / 36525.0\n\n # Build array for intermediate results.\n\n shape = getattr(jd_tt, 'shape', ())\n fa = zeros((14,) if shape == () else (14, shape[0]))\n... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Moves the current position to 'position' and rotates the context according to 'direction'
:param context: Cairo context
:param direction: Direction enum | [
"def _rotate_context(context, direction):\n \n if direction is Direction.UP:\n pass\n elif direction is Direction.RIGHT:\n context.rotate(deg2rad(90))\n elif direction is Direction.DOWN:\n context.rotate(deg2rad(180))\n elif direction is Direction.... | [
"def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string $value
@throws DomainException
@return $this | [
"public function setStatus($value)\n {\n $allowedStatuses = self::allowedStatuses();\n\n if (!in_array($value, $allowedStatuses, true)) {\n throw new DomainException(sprintf(self::MSG_UNEXPECTED_STATUS, implode(', ', $allowedStatuses)));\n }\n\n return $this->setAttribute('... | [
"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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Determine if a CharSequence can be parsed as an Integer.
@param self a CharSequence
@return true if the CharSequence can be parsed
@see #isInteger(String)
@since 1.8.2 | [
"public static boolean isInteger(CharSequence self) {\n try {\n Integer.valueOf(self.toString().trim());\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }"
] | [
"public ByteBuffer getByteBuffer() throws InvalidRequestException\n {\n switch (type)\n {\n case STRING:\n return AsciiType.instance.fromString(text);\n case INTEGER:\n return IntegerType.instance.fromString(text);\n case UUID:\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Возвращает хабы на которые подписан пользователь
@param string $login Логин пользователя на сайте
@return array
@throws IncorrectUsageException | [
"public function getUserHubs($login)\n {\n $this->checkAliasName($login);\n\n return $this->adapter->get(sprintf('/users/%s/hubs', $login));\n }"
] | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the Github comment about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Programming:"
} |
Programmatically perform action on textfield.This does the same
thing as if the user had pressed enter key in textfield.
@param textField textField on which action to be preformed | [
"public static void doAction(JTextField textField){\n String command = null;\n if(textField.getAction()!=null)\n command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);\n ActionEvent event = null;\n \n for(ActionListener listener: textField.getActio... | [
"public static void bindLabel (final Value<String> value, final HasText target)\n {\n value.addListenerAndTrigger(new Value.Listener<String>() {\n public void valueChanged (String value) {\n // avoid updating the target if the value is already the same; in the case where\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
//--------------------
// LOGGING
//--------------------
// Debugf logs a message at debug level. | [
"func Debugf(format string, args ...interface{}) {\n\tlogMux.RLock()\n\tdefer logMux.RUnlock()\n\tif logLevel <= LevelDebug {\n\t\tinfo := retrieveCallInfo().verboseFormat()\n\t\tmsg := fmt.Sprintf(format, args...)\n\n\t\tif shallLog(LevelDebug, info, msg) {\n\t\t\tlogBackend.Debug(info, msg)\n\t\t}\n\t}\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets the color that will be used for the glow indicator
@param GLOW_COLOR | [
"public void setGlowColor(final Color GLOW_COLOR) {\n getModel().setGlowColor(GLOW_COLOR);\n init(getInnerBounds().width, getInnerBounds().height);\n repaint(getInnerBounds());\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public String convertTextFidelityRepTxtExToString(EDataType eDataType, Object instanceValue) {\n\t\treturn instanceValue == null ? null : instanceValue.toString();\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github summarization about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Download object from objectstore.
object_meta_data is an object retured when
using 'get_full_container_list' | [
"def get_object(connection, object_meta_data: dict, dirname: str):\n \n return connection.get_object(dirname, object_meta_data['name'])[1]"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns whether the ID is valid.
@param id the ID to check
@return true if valid | [
"public boolean check(int id) {\n for (Tag tag: getTags()) {\n if (tag.getID() == id)\n\treturn true;\n }\n return false;\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Fetches the account history from
most recent back | [
"def get_my_history(self, account=None, limit=10000):\n ''' \n '''\n if not account:\n account = self.mainaccount\n try:\n h = self.steem_instance().get_account_history(\n account, -1, limit)\n except Exception as e:\n self.msg.error... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Upserts an object into the collection. Since update and inserts are the same logic,
this method handles both.
@param object $object
@param string $id
@return void | [
"private function _upsert($object, $id = null)\n {\n $object = $this->_writeObjectToDb($object, $id);\n $this->_updateObjectIndexes($object);\n $this->_commitObject($object->__id, $object->__revision);\n return $object;\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
List or manage workflows with subcommands. | [
"def workflow(ctx, client):\n \"\"\"\"\"\"\n if ctx.invoked_subcommand is None:\n from renku.models.refs import LinkReference\n\n names = defaultdict(list)\n for ref in LinkReference.iter_items(client, common_path='workflows'):\n names[ref.reference.name].append(ref.name)\n\n ... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Store every defined webfonts.
Webfont are stored with sort on their name.
Args:
webfonts (dict): Dictionnary of webfont settings from
``settings.ICOMOON_WEBFONTS``. | [
"def fetch(self, webfonts):\n \n sorted_keys = sorted(webfonts.keys())\n for webfont_name in sorted_keys:\n self.get(webfont_name, webfonts[webfont_name])"
] | [
"def get_model_indices(cls, index):\n '''\n \n '''\n try:\n return cls._idx_name_to_mdl_to_mdlidx[index].values()\n except KeyError:\n raise KeyError('Could not find any index named {}. Is this index defined in BUNGIESEARCH[\"INDICES\"]?'.format(index))"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Submits a metric to the collector
@param value The value
@param isIncrement True if the value in an increment | [
"protected void submit(final double value, final boolean isIncrement) {\n\t\t\n\t\tMetricCollector collector = MetricManager.getCollector();\n\t\t\n\t\tif (collector != null) {\n\t\t\tMetric.Builder builder = Metric.newBuilder();\n\t\t\tbuilder.identity(identity);\n\t\t\tbuilder.value(value);\n\t\t\tbuilder.isIncre... | [
"public void add(final DataPoints dps) {\n metric_uids.add(dps.metricUID());\n \n // TODO - tags intersection\n \n for (final byte[] tagk : dps.getAggregatedTagUids()) {\n aggregated_tags.add(tagk);\n }\n \n tsuids.addAll(dps.getTSUIDs());\n // TODO - this ain't right. We need to num... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
hql.
@param hql a {@link java.lang.String} object.
@param <E> a E object.
@return a {@link org.beangle.commons.dao.query.builder.OqlBuilder} object. | [
"public static <E> OqlBuilder<E> hql(final String hql) {\n OqlBuilder<E> query = new OqlBuilder<E>();\n query.statement = hql;\n return query;\n }"
] | [
"public static <T> JDOQuery<T> select(Expression<T> expr) {\n return new JDOQuery<Void>().select(expr);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
// ReadEntries returns all index entries for a key. | [
"func (d *indirectIndex) ReadEntries(key []byte, entries []IndexEntry) ([]IndexEntry, error) {\n\td.mu.RLock()\n\tdefer d.mu.RUnlock()\n\n\titer := d.ro.Iterator()\n\texact, _ := iter.Seek(key, &d.b)\n\tif !exact {\n\t\treturn nil, nil\n\t}\n\n\tentries, err := readEntries(d.b.access(iter.EntryOffset(&d.b), 0), ent... | [
"@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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetRecordMarkerFailedEventAttributes sets the RecordMarkerFailedEventAttributes field's value. | [
"func (s *HistoryEvent) SetRecordMarkerFailedEventAttributes(v *RecordMarkerFailedEventAttributes) *HistoryEvent {\n\ts.RecordMarkerFailedEventAttributes = 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:"
} |
@private
Hack to help determine Glitch WebSocket port
@param {Object} ctx
@param {number} port - server port number
@return {number} WebSocket port number | [
"function _websocketPort(ctx, port) {\n const forwarded = ctx.header['x-forwarded-proto'];\n const protocol = forwarded ? forwarded.split(',')[0] : undefined;\n return protocol === 'https' ? 443 : port;\n}"
] | [
"function TcpStreamConnect () {\n this.simulator.Debug (3, 'Dispatcher connected to %s:%s', simulator.opts.host, simulator.opts.port);\n ActiveClients[this] = this; // register on remote server in active socket list\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Splits on multiple given separators. | [
"def multi_split(s, split):\n # type: (S, Iterable[S]) -> List[S]\n \"\"\"\"\"\"\n for r in split:\n s = s.replace(r, \"|\")\n return [i for i in s.split(\"|\") if len(i) > 0]"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
XML書き込み
@param document xml document
@throws IOException IOエラー
@throws TransformerException XML書き込みエラー | [
"private void write(final Document document) throws IOException, TransformerException {\n\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\ttransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\ttransformer.... | [
"public Map<String, Object> toMap(StreamMessage message) throws ConvertFailException\r\n {\r\n if (this.propUtilBean == null)\r\n {\r\n this.propUtilBean = new PropertyUtilsBean();\r\n }\r\n\r\n // デフォルト動作としてソースコード上の記述順に\r\n // Key(フィールド名)、Value(フィールド値)を取得する。\r\n ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. | [
"func (u *UserLDAPMapping) GetAvatarURL() string {\n\tif u == nil || u.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.AvatarURL\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Deletes files from your account.
@param mixed $fileIDs IDs of files you want to delete. Array or integer.
@return boolean | [
"public function delete($fileIDs)\n {\n if (is_array($fileIDs)) {\n $fileIDs = implode(',', $fileIDs);\n }\n\n $data = [\n 'file_ids' => $fileIDs\n ];\n\n return $this->post('files/delete', $data, \\true);\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 post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns a hash of 'id:012345' => Term
@return [Hash] a hash of {id => Term} for the file | [
"def id_index \n @terms.inject({}) {|sum, t| sum.update(t.id.value => t)}\n end"
] | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets the lock icon.<p>
@param icon the icon to use
@param iconTitle the icon title | [
"public void setLockIcon(LockIcon icon, String iconTitle) {\n\n if (m_lockIcon == null) {\n m_lockIcon = new HTML();\n m_lockIcon.addClickHandler(m_iconSuperClickHandler);\n m_contentPanel.add(m_lockIcon);\n }\n switch (icon) {\n case CLOSED:\n ... | [
"public String getHeader()\n {\n if (this.header == null)\n {\n if (this.headerKeys == null)\n {\n this.headerKeys = new String[2];\n this.headerKeys[0] = getPropertyName() + \".header\";\n this.headerKeys[1] = getPropertyName();\n ... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// SetMasterUsername sets the MasterUsername field's value. | [
"func (s *DBInstanceAutomatedBackup) SetMasterUsername(v string) *DBInstanceAutomatedBackup {\n\ts.MasterUsername = &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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Retrieve an item from the cache by key.
@param string $key
@return mixed | [
"public function get($key)\n\t{\n\t\tif ($value = $this->memcache->get($this->prefix.$key)) {\n\t\t return $value;\n\t\t}\n\t}"
] | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// ProvisioningInfo returns the provisioning info for specified applications in this model. | [
"func (f *Facade) ProvisioningInfo(args params.Entities) (params.KubernetesProvisioningInfoResults, error) {\n\tmodel, err := f.state.Model()\n\tif err != nil {\n\t\treturn params.KubernetesProvisioningInfoResults{}, errors.Trace(err)\n\t}\n\tresults := params.KubernetesProvisioningInfoResults{\n\t\tResults: make([... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Generate input mask from bytemask | [
"def _gen_input_mask(mask):\n \"\"\"\"\"\"\n return input_mask(\n shift=bool(mask & MOD_Shift),\n lock=bool(mask & MOD_Lock),\n control=bool(mask & MOD_Control),\n mod1=bool(mask & MOD_Mod1),\n mod2=bool(mask & MOD_Mod2),\n mod3=bool(mask & MOD_Mod3),\n mod4=bo... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get the current number of desktops.
Uses ``_NET_NUMBER_OF_DESKTOPS`` of the EWMH spec.
:param ndesktops:
pointer to long where the current number of desktops is stored | [
"def get_number_of_desktops(self):\n \n ndesktops = ctypes.c_long(0)\n _libxdo.xdo_get_number_of_desktops(self._xdo, ctypes.byref(ndesktops))\n return ndesktops.value"
] | [
"def _GetStat(self):\n \n stat_object = super(VShadowFileEntry, self)._GetStat()\n\n if self._vshadow_store is not None:\n # File data stat information.\n stat_object.size = self._vshadow_store.volume_size\n\n # Ownership and permissions stat information.\n\n # File entry type stat informat... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Creates a 32-bit integer valued column
@param name the column name | [
"public RowBuilder int32(String name)\n {\n ColumnInt32 column = new ColumnInt32(_columns.size(), name, _offset);\n \n _offset += column.length();\n _columns.add(column);\n \n return this;\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
r"""
Given a Python string ``original``, remove unsupported characters, map characters
to integers and return a numpy array representing the processed string. | [
"def text_to_char_array(original, alphabet):\n \n \"\"\"\n return np.asarray([alphabet.label_from_string(c) for c in original])"
] | [
"def _set_text(self, value):\n \n working_index = self.working_index\n working_lines = self._working_lines\n\n original_value = working_lines[working_index]\n working_lines[working_index] = value\n\n # Return True when this text has been changed.\n if len(value) != l... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Converts the provided FQCN into a file name by replacing all slashes with dots.
@param string $fqnn
@return string | [
"public function fromNamespace($fqnn)\n {\n $name = str_replace('\\\\', '.', ltrim((string) $fqnn, '\\\\'));\n\n // convert root namespace to default; default is a keyword and no namespace CAN be named as such\n if ($name === '') {\n $name = 'default';\n }\n\n return... | [
"@Deprecated\n public static GoogleLogger forInjectedClassName(String className) {\n checkArgument(!className.isEmpty(), \"injected class name is empty\");\n // The injected class name is in binary form (e.g. java/util/Map$Entry) to re-use\n // constant pool entries.\n return new GoogleLogger(Platform.... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Genera el path estándar de un catálogo en un filesystem. | [
"def get_catalog_path(catalog_id, catalogs_dir=CATALOGS_DIR, fmt=\"json\"):\n \"\"\"\"\"\"\n\n base_path = os.path.join(catalogs_dir, \"catalog\", catalog_id)\n if fmt == \"json\":\n return os.path.join(base_path, \"data.json\")\n elif fmt == \"xlsx\":\n return os.path.join(base_path, \"ca... | [
"def create_card\n raise StandardError, 'Cliente null' if @client.nil?\n # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta\n card = PayuLatam::Card.new(@client)\n # hay un metodo card_params que genera el objeto a enviar con los datos correctos\n # s... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Get looks up a word from h's Word map and should be used
// in place of a direct map lookup. The only caveat is that
// it will always return the 'success' boolean | [
"func (m *concurrentMap) Get(w string) (Word, bool) {\n\tm.RLock()\n\tresult, ok := m.words[w]\n\tm.RUnlock()\n\treturn result, ok\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
send the request, return response obj | [
"def _request(self, typ, id=0, method='GET', params=None, data=None,\n url=None):\n \n backend, backend_version = peeringdb.get_backend_info()\n user_agent = 'PeeringDB/{} {}/{}'.format(peeringdb.__version__,\n backend, backend_ver... | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Adds multipule emoticons to the parser. Should be in
emoticon_key => image_url format.
@param Array $emoticons
@param bool $replace If to replace another emoticon with the same key | [
"public function add_emoticons(Array $emoticons, $replace=true)\n\t{\n\t\tforeach($emoticons as $key => $url)\n\t\t\t$this->add_emoticon($key, $url, $replace);\n\t}"
] | [
"def harvest(self, text):\n \"\"\"\"\"\"\n for match in self.harvest_regex.finditer(text):\n # TODO: optionally validate before yielding?\n # TODO: keep a list of harvested but not validated?\n yield match.group().replace('..', '.')"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Compute this * 10 ^ n.
Needed mainly to allow special casing to trap zero value | [
"private BigInteger bigMultiplyPowerTen(int n) {\n if (n <= 0)\n return this.inflated();\n\n if (intCompact != INFLATED)\n return bigTenToThe(n).multiply(intCompact);\n else\n return intVal.multiply(bigTenToThe(n));\n }"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
-------------------------------------------------------------------------- | [
"@Override\n\tpublic void activateOptions() {\n\t\t// Jeśli określono lokalizację pliku z ustawieniami, parametry połączenia\n\t\t// określamy na podstawie wartości przypisanych do odpowiednich kluczy:\n\t\tif(StringUtils.isNotEmpty(propertiesLocation)) {\n\t\t\tLogLog.debug(\"Loading appender [\" + this.name + \"]... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the Github post about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code about programming:"
} |
Little utility method that handles pagination and returns
all objects in given bucket. | [
"def get_all_objects_in_bucket(\n aws_bucket_name,\n s3_client=None,\n max_keys=1000\n):\n \n logger.debug(\"Retrieving bucket object list\")\n\n if not s3_client:\n s3_client, s3_resource = get_s3_client()\n\n obj_dict = {}\n paginator = s3_client.get_paginator('list_obje... | [
"@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 description about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code:"
} |
Tests a string and returns true if the string counts as a reserved token in the Java language.
@param value the {@code String} to be tested.
@return {@code true} if the {@code String} is a reserved token; {@code false} otherwise. | [
"private boolean isToken(String value) {\n int len = value.length();\n for (int i = 0; i < len; i++) {\n char c = value.charAt(i);\n if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {\n return false;\n }\n }\n\n return true;\n }"... | [
"function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// List lists the files matching prefix from stor using the stor's default consistency strategy. | [
"func List(stor StorageReader, prefix string) ([]string, error) {\n\treturn ListWithRetry(stor, prefix, stor.DefaultConsistencyStrategy())\n}"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github summarization about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code:"
} |
fetch method
@method fetch
@param mixed key | [
"public function fetch($key) : Collection\n {\n $extr = [];\n foreach ($this->list as $list) {\n if (is_array($list) && key_exists($key, $list)) {\n $extr[] = $list[$key];\n }\n }\n\n return self::from(...$extr);\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// Symbols returns nested symbols.
//
// If `flavors` is not empty, it specifies what kinds of symbols to keep.
// Possible variants: "func", "var", "inv", "struct". | [
"func (s *symbol) Symbols(flavors ...string) (out []*symbol, err error) {\n\tstrct, _ := s.Symbol.(*symbols.Struct)\n\tif strct == nil {\n\t\treturn nil, fmt.Errorf(\"%q is not a struct\", s.FullName)\n\t}\n\n\tkeepFlavors := stringset.NewFromSlice(flavors...)\n\n\tfor _, sym := range strct.Symbols() {\n\t\tfullNam... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
2 different parameter setups (value, alpha, sd, n) (value, alpha, array) | [
"function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2... | [
"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:"
} |
Read a line from the stream up to the maximum allowed buffer length
@param StreamInterface $stream Stream to read from
@param int $maxLength Maximum buffer length
@return string|bool | [
"public static function readline(StreamInterface $stream, $maxLength = null)\n {\n $buffer = '';\n $size = 0;\n\n while (!$stream->eof()) {\n if (false === ($byte = $stream->read(1))) {\n return $buffer;\n }\n $buffer .= $byte;\n // ... | [
"public void init(Rec record, int iKeyDup, String strKeyName)\n {\n super.init(record, iKeyDup, strKeyName);\n m_iKeyActualLength = 0; // Actual Byte length\n m_iKeyByteLength = 0; // Key length (0-64 bytes) (including trailer bytes)\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
Converts the iterator into a string.
@param \Generator $Input
@return string | [
"public static final function collect(\\Generator $Input){\n\t\treturn self::join(PHP_EOL, array_map(function(){\n\t\t\treturn self::unbreak(self::cast(func_get_arg(0)), 1);\n\t\t}, iterator_to_array($Input, false)));\n\t}"
] | [
"def bind(self, fn: \"Callable[[Any], Reader]\") -> 'Reader':\n \n \"\"\"\n return Reader(lambda x: fn(self.run(x)).run(x))"
] | codesearchnet | {
"query": "Represent the Github text about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
// PointAt returns the point, in the bound, corresponding to
// this grid coordinate. x in [0, s.Width()-1], y in [0, s.Height()-1] | [
"func (s *Surface) PointAt(x, y int) *Point {\n\tif x >= s.Width || y >= s.Height {\n\t\tpanic(\"geo: x, y outside of grid range\")\n\t}\n\n\tp := NewPoint(0, 0)\n\n\tp[0] = s.bound.sw.X() + float64(x)*s.gridBoxWidth()\n\tp[1] = s.bound.sw.Y() + float64(y)*s.gridBoxHeight()\n\n\treturn p\n}"
] | [
"def numberOfTilesAtZoom(self, zoom):\n \"\"\n [minRow, minCol, maxRow, maxCol] = self.getExtentAddress(zoom)\n return (maxCol - minCol + 1) * (maxRow - minRow + 1)"
] | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
copy from Array.deepHashCode0 | [
"private int _hashCode(Object values) {\n int valueHash = 0;\n if (values instanceof Object[])\n valueHash = Arrays.deepHashCode((Object[]) values);\n else if (values instanceof byte[])\n valueHash = Arrays.hashCode((byte[]) values);\n else if (values instanceof sho... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// ListMachines returns an array of all currently running machines. | [
"func (c *Conn) ListMachines() ([]MachineStatus, error) {\n\tresult := make([][]interface{}, 0)\n\tif err := c.object.Call(dbusInterface+\".ListMachines\", 0).Store(&result); err != nil {\n\t\treturn nil, err\n\t}\n\n\tmachs := []MachineStatus{}\n\tfor _, i := range result {\n\t\tmachine, err := machineFromInterfac... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// processChecks is a common helper for taking a set of health checks and
// using them to update our alias. This is abstracted since the checks can
// come from both the remote server as well as local state. | [
"func (c *CheckAlias) processChecks(checks []*structs.HealthCheck) {\n\thealth := api.HealthPassing\n\tmsg := \"No checks found.\"\n\tfor _, chk := range checks {\n\t\tif c.Node != \"\" && chk.Node != c.Node {\n\t\t\tcontinue\n\t\t}\n\n\t\t// We allow ServiceID == \"\" so that we also check node checks\n\t\tif chk.... | [
"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 instruction about Data management:",
"pos": "Represent the code about Data management:",
"neg": "Represent the code about Software development:"
} |
Zero pad a number to a specified length
@param buffer buffer to use for padding
@param value the integer value to pad if necessary.
@param length the length of the string we should zero pad | [
"private static void padInt(StringBuilder buffer, int value, int length) {\n String strValue = Integer.toString(value);\n for (int i = length - strValue.length(); i > 0; i--) {\n buffer.append('0');\n }\n buffer.append(strValue);\n }"
] | [
"def _filterByPaddingNum(cls, iterable, num):\n \n _check = DISK_RE.match\n\n for item in iterable:\n # Add a filter for paths that don't match the frame\n # padding of a given number\n matches = _check(item)\n if not matches:\n if num ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// MustNewMVCCStore is used for testing, use NewMVCCLevelDB instead. | [
"func MustNewMVCCStore() MVCCStore {\n\tmvccStore, err := NewMVCCLevelDB(\"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn mvccStore\n}"
] | [
"public void open() throws DBException\n {\n if (this.isOpen())\n return; // Ignore if already open\n this.getRecord().handleInitialKey(); // Set up the smaller key\n this.getRecord().handleEndKey(); // Set up the larger key\n // You can't ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
find ANSI escape sequences in text and remove them
:param text: str
:return: list, should be passed to ListBox | [
"def strip_from_ansi_esc_sequences(text):\n \n # esc[ + values + control character\n # h, l, p commands are complicated, let's ignore them\n seq_regex = r\"\\x1b\\[[0-9;]*[mKJusDCBAfH]\"\n regex = re.compile(seq_regex)\n start = 0\n response = \"\"\n for match in regex.finditer(text):\n ... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Parses the following strings: key1 = value1, value2, value3; key2 = value4, value5
@param data a string of the specified format
@return a map with parsed keys and values | [
"public static Map<String, Set<String>> parseAssignment(String data) {\n Map<String, Set<String>> ret = new HashMap<>();\n if (data != null) {\n StringTokenizer stringTokenizer = new StringTokenizer(data, String.format(\"%s%s%s\", EQUALITY, COMMA, SEMICOLON), true);\n String key ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Registers the given message type in the local database.
Calls to GetSymbol() and GetMessages() will return messages registered here.
Args:
message: a message.Message, to be registered.
Returns:
The provided message. | [
"def RegisterMessage(self, message):\n \n\n desc = message.DESCRIPTOR\n self._classes[desc.full_name] = message\n self.pool.AddDescriptor(desc)\n return message"
] | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Update the generator code.
@param {!Blockly.Block} block Rendered block in preview workspace. | [
"function updateGenerator(block) {\n function makeVar(root, name) {\n name = name.toLowerCase().replace(/\\W/g, '_');\n return ' var ' + root + '_' + name;\n }\n var language = document.getElementById('language').value;\n var code = [];\n code.push(\"Blockly.\" + language + \"['\" + block.type +\n ... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@throws Exception
@return array | [
"private function getOptions()\n {\n $required = [\n 'token' => $this->getToken(),\n 'url' => $this->getUrl()[0],\n ];\n\n $optional = [];\n if (null != $this->alias) {\n $optional['key'] = $this->getAlias();\n }\n if (null != $this->fo... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Po obiekcie i id
@param string $object
@param string $objectId
@param string $class
@return CmsFileQuery | [
"public static function byObjectAndClass($object = null, $objectId = null, $class = 'image')\n {\n //zapytanie o pliki po obiektach i id\n return (new self)\n ->whereObject()->equals($object)\n ->andFieldObjectId()->equals($objectId)\n ->whereClass()->eq... | [
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Close will close all active clients and close the backend. The return value
// denotes if the timeout has been reached. | [
"func (m *MemoryBackend) Close(timeout time.Duration) bool {\n\t// acquire global mutex\n\tm.globalMutex.Lock()\n\n\t// set closing\n\tm.closing = true\n\n\t// prepare list\n\tvar clients []*Client\n\n\t// close temporary sessions\n\tfor _, sess := range m.temporarySessions {\n\t\tsess.owner.Close()\n\t\tclients = ... | [
"def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *DeploymentLog) DeepCopyInto(out *DeploymentLog) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\treturn\n}"
] | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns if the column with the given property id is visible and not collapsed.<p>
@param propertyId the property id
@return <code>true</code> if the column is visible | [
"public boolean isColumnVisible(CmsResourceTableProperty propertyId) {\n\n return Arrays.asList(m_fileTable.getVisibleColumns()).contains(propertyId)\n && !m_fileTable.isColumnCollapsed(propertyId);\n }"
] | [
"function (obj) {\n\n if (!(ariaUtilsType.isObject(obj) || ariaUtilsType.isArray(obj))) {\n this.$logError(this.INVALID_TYPE_OF_ARGUMENT);\n return;\n }\n\n /**\n * Contains the initial array or map from which the view is built. This can be ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Process query with joined data
@param object $row One row of data
@return Database | [
"protected function join($row)\r\n {\r\n $keys['local'] = $this->keys['local'];\r\n $keys['foreign'] = $this->keys['foreign'];\r\n\r\n if ($this->relationType == 'hasAndBelongsToMany')\r\n {\r\n $join = Database::table($this->getJunction())\r\n ->groupB... | [
"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:"
} |
@param string $name
@return Pierrre\EncrypterBundle\Util\Encrypter
@throws \InvalidArgumentException | [
"public function get($name)\n {\n $this->checkNameIsString($name);\n\n if (isset($this->encrypters[$name])) {\n $encrypter = $this->encrypters[$name];\n } else {\n if (isset($this->configs[$name])) {\n $config = $this->configs[$name];\n $en... | [
"public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())... | codesearchnet | {
"query": "Represent the comment about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about Programming:"
} |
Serialize the dataframe as a tsv | [
"def df_to_tsv(df, tsvfile, suffix):\n \n tsvfile += suffix\n columns = [\"SampleKey\"] + sorted(x for x in df.columns\n if x.endswith(suffix))\n tf = df.reindex_axis(columns, axis='columns')\n tf.sort_values(\"SampleKey\")\n tf.to_csv(tsvfile, sep='\\t', index=... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param array $args
@param array $options
@return void | [
"public function execute(array $args = [], array $options = [])\n {\n $argv = $_SERVER['argv'];\n array_shift($argv);\n array_shift($argv);\n\n $argvString = '';\n foreach ($argv as $arg) {\n $argvString .= ($argvString ? ' ' : '').'\"'.str_replace('\"', '\\\\\"', $a... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Does not guarantee ordering of elements in resulting list. | [
"@Nonnull\n public ImmutableList<T> toList() {\n return this.foldAbelian((v, acc) -> acc.cons(v), ImmutableList.empty());\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Remove the directory specified by `path`. Because we can't determine
directly if the path is in use, and on Windows, it's not possible to
remove a path if it is in use, retry a few times until the call
succeeds. | [
"def _robust_remove(path):\n \n tries = itertools.count()\n max_tries = 50\n while os.path.isdir(path):\n try:\n shutil.rmtree(path)\n except WindowsError:\n if next(tries) >= max_tries:\n raise\n time.... | [
"public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
// stateRightDelim scans the right delimiter, which is known to be present. | [
"func stateRightDelim(l *lexer) stateFn {\n\tl.seek(len(l.rightDelim))\n\tl.emit(tokenRightDelim)\n\treturn stateText\n}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
member: pairDef COMMA? | [
"def visitMember(self, ctx: jsgParser.MemberContext):\n \n self._strict = ctx.COMMA() is None\n self.visitChildren(ctx)"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
实现ApplicationContextAware接口的回调方法,设置上下文环境
@param applicationContext
@throws BeansException | [
"@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\r\n\t\tlogger.debug(\"Inject ApplicationContext: {} into SpringContextsUtil\", applicationContext);\r\n\t\tSpringContextsUtil.applicationContext = applicationContext;\r\n\t}"
] | [
"public static IPool getPool(String host, Integer port, String database, String... userPwd) {\n //暂未启用\n throw new RuntimeException(\"未找到指定的数据库连接池\");\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// While deprecated dir is supported, to add extra protection around #69015
// we will explicitly blacklist kubernetes.io directory. | [
"func (w *Watcher) containsBlacklistedDir(path string) bool {\n\treturn strings.HasPrefix(path, w.deprecatedPath+\"/kubernetes.io/\") ||\n\t\tpath == w.deprecatedPath+\"/kubernetes.io\"\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
@see IblockFinder::getValue()
@param array $cache
@param array $filter
@return int|string
@throws ValueNotFoundException | [
"protected function getValueIblockShard(array $cache, array $filter)\n {\n switch ($filter['type']) {\n case 'type':\n $value = (string)$cache['TYPE'];\n\n if (strlen($value) <= 0) {\n throw new ValueNotFoundException('Iblock type', 'iblock #' . ... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Check to make sure a release is in the valid range of
Ensembl releases. | [
"def check_release_number(release):\n \n try:\n release = int(release)\n except:\n raise ValueError(\"Invalid Ensembl release: %s\" % release)\n\n if release < MIN_ENSEMBL_RELEASE or release > MAX_ENSEMBL_RELEASE:\n raise ValueError(\n \"Invalid Ensembl releases %d, must ... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Replaces all problematic characters from a String with their escaped
versions to make it SQL conform.
@param str
unescaped String
@return SQL safe escaped String | [
"public static String sqlEscape(String str) {\n\t\tfinal int len = str.length();\n\t\tbuffer.setLength(0);\n\t\tStringBuilder sql = buffer;\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tchar c = str.charAt(i);\n\t\t\tswitch (c) {\n\t\t\tcase '\\u0000':\n\t\t\t\tsql.append('\\\\').append('0');\n\t\t\t\tbreak;\n\t\t\... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github summarization about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
1. the maximum match rule
this rule will return the chunks that own the largest word length | [
"public static IChunk[] getMaximumMatchChunks(IChunk[] chunks) \n {\n int maxLength = chunks[0].getLength();\n int j;\n //find the maximum word length\n for ( j = 1; j < chunks.length; j++ ) {\n if ( chunks[j].getLength() > maxLength ) \n maxLength = chunks[j... | [
"def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(ListAliasesRequest listAliasesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listAliasesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(listAliases... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
bind
@param array $data
@return static | [
"public function bind($data)\n {\n foreach ($this->fields as $name => $field) {\n $value = FormHelper::getByPath($data, $name);\n\n if ($value !== null) {\n $field->setValue($value);\n }\n }\n\n return $this;\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
receives the last known state of the proxy | [
"private String recvStatus()\n {\n if (!agent.sign()) {\n return EXITED;\n }\n // receive the status response\n final ZMsg msg = agent.recv();\n\n if (msg == null) {\n return EXITED;\n }\n\n String status = msg.popString();\n msg.destr... | [
"@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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Convert to Capital.
@return string | [
"public function toCapital(): string\n {\n @list($intPart, $decimalPart) = explode('.', $this->money, 2);\n if (0.0 === floatval($this->money)) {\n return '零元';\n }\n $result = $this->getIntPart($intPart);\n $result .= $this->getDecimalPart($decimalPart);\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 Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check that the image is in one of the given *modes*, raise an exception otherwise. | [
"def _check_modes(self, modes):\n \"\"\"\"\"\"\n if not isinstance(modes, (tuple, list, set)):\n modes = [modes]\n if self.mode not in modes:\n raise ValueError(\"Image not in suitable mode, expected: %s, got: %s\" % (modes, self.mode))"
] | [
"def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Allocate sets the AllocationInfo for the resource, panics if role is "". | [
"func (r *Resource) Allocate(role string) {\n\tif role == \"\" {\n\t\tpanic(fmt.Sprintf(\"cannot allocate resource to an empty-string role: %q\", r))\n\t}\n\tr.AllocationInfo = &Resource_AllocationInfo{Role: &role}\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetFramerateControl sets the FramerateControl field's value. | [
"func (s *H264Settings) SetFramerateControl(v string) *H264Settings {\n\ts.FramerateControl = &v\n\treturn s\n}"
] | [
"public final void setTemplateMode(final TemplateMode templateMode) {\n Validate.notNull(templateMode, \"Cannot set a null template mode value\");\n // We re-parse the specified template mode so that we make sure we get rid of deprecated values\n this.templateMode = TemplateMode.parse(templateM... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Output handler that displays some progress while soaking output
@param string $string
@param int $flags
@return string | [
"private function progress($string, $flags) {\n\t\tstatic $counter = 0;\n\t\tstatic $symbols = [\"\\\\\",\"|\",\"/\",\"-\"];\n\n\t\t$this->output .= $string;\n\t\t\n\t\tif (false !== strpos($string, \"\\n\")) {\n\t\t\t++$counter;\n\t\t}\n\n\t\treturn $flags & PHP_OUTPUT_HANDLER_FINAL\n\t\t\t? \" \\r\"\n\t\t\t: sp... | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetSignature sets the Signature field's value. | [
"func (s *GetBuiltinIntentInput) SetSignature(v string) *GetBuiltinIntentInput {\n\ts.Signature = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.