query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Get an entry from the Special sensor log.
:param index: Index for the sensor log entry to be obtained.
:return: Response containing the sensor log entry, or None if not found. | [
"async def async_get_sensor_log(self, index: int) -> Optional[SensorLogResponse]:\n \n\n response = await self._protocol.async_execute(\n GetSensorLogCommand(index))\n if isinstance(response, SensorLogResponse):\n return response\n return None"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Get decision value for a consent campaign
REST: GET /me/consent/{campaignName}/decision
@param campaignName [required] Consent campaign name | [
"public OvhConsent consent_campaignName_decision_GET(String campaignName) throws IOException {\n\t\tString qPath = \"/me/consent/{campaignName}/decision\";\n\t\tStringBuilder sb = path(qPath, campaignName);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\treturn convertTo(resp, OvhConsent.class);\... | [
"def get_event(self, event_id):\n \n mask = \"\"\"mask[\n acknowledgedFlag,\n attachments,\n impactedResources,\n statusCode,\n updates,\n notificationOccurrenceEventType]\n \"\"\"\n return self.client.call('Notification_O... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// IPv6 generates random IPv6 address | [
"func (internet Internet) IPv6(v reflect.Value) (interface{}, error) {\n\treturn internet.ipv6(), nil\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
https://github.com/defunctzombie/node-uuid/blob/master/uuid.js | [
"function unparse(buf, offset) {\n var i = offset || 0;\n return buf[i++].toString(16) + buf[i++].toString(16) +\n buf[i++].toString(16) + buf[i++].toString(16) + '-' +\n buf[i++].toString(16) + buf[i++].toString(16) + '-' +\n buf[i++].toString(16) + buf[i++].toString(16) + '-' +\n ... | [
"function getUrl(version = current) {\n\tconst name = `native-ext-v${version}-${os}-${arch}.${ext}`;\n\treturn `https://github.com/NiklasGollenstede/native-ext/releases/download/v${version}/`+ name;\n}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Defines the object mappers registered in the orm.
@param OrmDefinition $orm
@return void | [
"protected function define(OrmDefinition $orm)\n {\n $orm->valueObjects([\n Directory::class => DirectoryMapper::class,\n File::class => FileMapper::class,\n Image::class => ImageMapper::class,\n ]);\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Decide if the recently fetched data are still fresh enough
@param int $now current timestamp
@return bool true if no need to re-fetch, false otherwise | [
"protected function cron_has_fresh_fetch($now) {\n $recent = $this->get_last_timefetched();\n\n if (empty($recent)) {\n return false;\n }\n\n if ($now < $recent) {\n $this->cron_mtrace('The most recent fetch is reported to be in the future, this is weird!');\n ... | [
"def time_to_run(self, class_, time_):\n \n app_name = class_.app_name\n try:\n info = self.job_state_database[app_name]\n except KeyError:\n if time_:\n h, m = [int(x) for x in time_.split(':')]\n # only run if this hour and minute is ... | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Normalize numerical columns.
Args:
X (numpy.array) : numerical columns to normalize
Returns:
X (numpy.array): normalized numerical columns | [
"def fit_transform(self, X, y=None):\n \n\n self.ecdfs = [None] * X.shape[1]\n\n for col in range(X.shape[1]):\n self.ecdfs[col] = ECDF(X[:, col])\n X[:, col] = self._transform_col(X[:, col], col)\n\n return X"
] | [
"def transform(self, X):\n \n\n extracted = []\n for columns, transformer in self.mapping:\n if transformer is not None:\n feature = transformer.transform(self._get_columns(X, columns))\n else:\n feature = self._get_columns(X, columns)\n\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Redirect to the {@link cancelUrl} or simply close the popup window. | [
"public function cancel($url = null)\n\t{\n\t\t$this->component->redirect(isset($url) ? $url : $this->cancelUrl, !$this->component->popup);\n\t}"
] | [
"public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch.... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// NumServers takes out an internal "read lock" and returns the number of
// servers. numServers includes both healthy and unhealthy servers. | [
"func (m *Manager) NumServers() int {\n\tl := m.getServerList()\n\treturn len(l.servers)\n}"
] | [
"func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}"
] | codesearchnet | {
"query": "Represent the sentence about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code about programming:"
} |
// Retrieve a POST request field as a string.
// Returns `MissingFieldError` if requested field is missing. | [
"func GetStringField(r *http.Request, fieldName string) (string, error) {\n\tif _, ok := r.Form[fieldName]; !ok {\n\t\treturn \"\", MissingFieldError{fieldName}\n\t}\n\treturn r.FormValue(fieldName), nil\n}"
] | [
"function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options.... | codesearchnet | {
"query": "Represent the summarization about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about PHP:"
} |
Returns height of the (sub)tree, without considering
empty leaf-nodes
>>> create(dimensions=2).height()
0
>>> create([ (1, 2) ]).height()
1
>>> create([ (1, 2), (2, 3) ]).height()
2 | [
"def height(self):\n \n\n min_height = int(bool(self))\n return max([min_height] + [c.height()+1 for c, p in self.children])"
] | [
"def createThreeObjects():\n \n objectA = zip(range(10), range(10))\n objectB = [(0, 0), (2, 2), (1, 1), (1, 4), (4, 2), (4, 1)]\n objectC = [(0, 0), (1, 1), (3, 1), (0, 1)]\n return [objectA, objectB, objectC]"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Turns a dictionary into a bencoded str with alphabetized keys
e.g., {'spam': 'eggs', 'cow': 'moo'} --> d3:cow3:moo4:spam4:eggse | [
"def bencode(canonical):\n '''\n \n '''\n in_dict = dict(canonical)\n\n def encode_str(in_str):\n out_str = str(len(in_str)) + ':' + in_str\n return out_str\n\n def encode_int(in_int):\n out_str = str('i' + str(in_int) + 'e')\n return out_str\n\n def encode_list(... | [
"def main():\n \"\"\n\n actions = \"\"\"\n {LWIN}\n {PAUSE .25}\n r\n {PAUSE .25}\n Notepad.exe{ENTER}\n {PAUSE 1}\n Hello{SPACE}World!\n {PAUSE 1}\n %{F4}\n {PAUSE .25}\n n\n \"\"\"\n SendKeys(actions, pause = .1)\n\n k... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// createFile is a helper function to call [Nt]CreateFile to get a handle to
// the file or directory. | [
"func createFile(name string, isDir bool) (syscall.Handle, error) {\n\tnamep := syscall.StringToUTF16(name)\n\tda := uint32(desiredAccessReadControl | desiredAccessWriteDac)\n\tsm := uint32(shareModeRead | shareModeWrite)\n\tfa := uint32(syscall.FILE_ATTRIBUTE_NORMAL)\n\tif isDir {\n\t\tfa = uint32(fa | syscall.FIL... | [
"func (f *FS) GetVolumeInformation(ctx context.Context) (dokan.VolumeInformation, error) {\n\t// TODO should this be explicitely refused to other users?\n\t// As the mount is limited to current session there is little need.\n\treturn vinfo, nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about File management:"
} |
Execute the console command.
@return void | [
"public function fire()\n\t{\n\t\tif ($this->downForMaintenance()) return;\n\n\t\t$queue = $this->option('queue');\n\n\t\t$delay = $this->option('delay');\n\n\t\t// The memory limit is the amount of memory we will allow the script to occupy\n\t\t// before killing it and letting a process manager restart it for us, ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Lists all the debuggees that the user has access to.
@param \Google\Cloud\Debugger\V2\ListDebuggeesRequest $argument input argument
@param array $metadata metadata
@param array $options call options | [
"public function ListDebuggees(\\Google\\Cloud\\Debugger\\V2\\ListDebuggeesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.devtools.clouddebugger.v2.Debugger2/ListDebuggees',\n $argument,\n ['\\Google\\Cloud\\Debugger\\V2\\ListDebuggeesResponse... | [
"public function GetSshPublicKey(\\Google\\Cloud\\OsLogin\\V1\\GetSshPublicKeyRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.oslogin.v1.OsLoginService/GetSshPublicKey',\n $argument,\n ['\\Google\\Cloud\\OsLogin\\Common\\SshPublicKey', 'd... | codesearchnet | {
"query": "Represent the instruction about Cloud Foundry API:",
"pos": "Represent the code about Cloud Foundry API:",
"neg": "Represent the code about accounts.authinfo:"
} |
保存数据
@param array $option 参数 | [
"public function save($fileName = null)\r\n\t{\r\n\t\tfile_put_contents(empty($fileName) ? $this->fileName : $fileName, json_encode($this->data), LOCK_EX);\r\n\t}"
] | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set indicator name.
@param string|null $indicator Symbolic name of indicator to use or null for no indicator
@return $this | [
"public function setIndicator( $indicator = null ) {\n\t\tif ( $this->indicatorName !== null ) {\n\t\t\t$this->indicator->removeClasses( [ 'oo-ui-indicator-' . $this->indicatorName ] );\n\t\t}\n\t\tif ( $indicator !== null ) {\n\t\t\t$this->indicator->addClasses( [ 'oo-ui-indicator-' . $indicator ] );\n\t\t}\n\n\t\... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *CodeBuildProjectEnvironmentList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := CodeBuildProjectEnvironment{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = CodeBuildProjectEnvironmentList{item}\n\t\treturn nil\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get campaign ids, membership id and full name from SESSION.
@param int $campaignId
Campaign node ID.
@return array MemberCampaign data from SESSION. | [
"public static function getMemberCampaignData($campaignId) {\n $request = \\Drupal::request();\n $session = $request->getSession();\n\n $openyCampaignSession = $session->get('openy_campaign', [\n 'campaign_ids' => [],\n 'member_ids' => [],\n 'membership_ids' => [],\n 'full_names' => [],... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Return the parent scope.
:return: FoldScope or None | [
"def parent(self):\n \n if TextBlockHelper.get_fold_lvl(self._trigger) > 0 and \\\n self._trigger.blockNumber():\n block = self._trigger.previous()\n ref_lvl = self.trigger_level - 1\n while (block.blockNumber() and\n (not TextBlockHel... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates a request from a method function call. | [
"def make_request(self, method, *args, **kwargs):\n \"\"\"\"\"\"\n if args and not use_signature:\n raise NotImplementedError(\"Only keyword arguments allowed in Python2\")\n\n new_kwargs = {kw: unwrap(value) for kw, value in kwargs.items()}\n\n if use_signature:\n new_args = tuple(unwrap(... | [
"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 instruction about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about Software development:"
} |
Generates cryptographically strong pseudo-random data.
@param {Numbers} length How many bytes of data you want.
@return {Buffer} The random data as a Buffer. | [
"function(length) {\n var array, byte, _i, _len, _results;\n array = new Uint8Array(length);\n window.crypto.getRandomValues(array);\n _results = [];\n for (_i = 0, _len = array.length; _i < _len; _i++) {\n byte = array[_i];\n _results.push(byte);\n }\n return _resul... | [
"function spawnPrng() {\n var ctx = forge.prng.create(prng_aes);\n\n /**\n * Gets random bytes. If a native secure crypto API is unavailable, this\n * method tries to make the bytes more unpredictable by drawing from data that\n * can be collected from the user of the browser, eg: mouse movement.\n *\n ... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Survey source synchronization check function
@param string $sourceSurveyId
@param int $surveyId
@param int $userId
@return mixed message string or array of messages | [
"public function checkSurvey($sourceSurveyId, $surveyId, $userId)\n {\n $changed = 0;\n $created = false;\n $deleted = false;\n $deletedFile = false;\n $survey = $this->tracker->getSurvey($surveyId);\n\n // Get OpenRosa data\n if ($sourceSurveyId)... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
Finds and initializes the phpDocumentor installation | [
"private function initializePhpDocumentor()\n {\n $phpDocumentorPath = '';\n\n if (!empty($this->pharLocation)) {\n include_once 'phar://' . $this->pharLocation . '/vendor/autoload.php';\n\n if (!class_exists('phpDocumentor\\\\Bootstrap')) {\n throw new BuildExc... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns the maximum bounds of the ripple relative to the ripple center. | [
"public void getBounds(Rect bounds) {\n final int outerX = (int) mTargetX;\n final int outerY = (int) mTargetY;\n final int r = (int) mTargetRadius + 1;\n bounds.set(outerX - r, outerY - r, outerX + r, outerY + r);\n }"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetQueryLoggingConfigs sets the QueryLoggingConfigs field's value. | [
"func (s *ListQueryLoggingConfigsOutput) SetQueryLoggingConfigs(v []*QueryLoggingConfig) *ListQueryLoggingConfigsOutput {\n\ts.QueryLoggingConfigs = 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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Reverse-finds all files and directories with a given name/subpath
@param string $name
@param boolean $reload
@param string $type | [
"public function findAllReversed($name, $reload = false, $type = 'all')\n\t{\n\t\treturn $this->findAll($name, $reload, true, $type);\n\t}"
] | [
"def isdir(path):\n \n system = get_instance(path)\n\n # User may use directory path without trailing '/'\n # like on standard file systems\n return system.isdir(system.ensure_dir_path(path))"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Performs encoding of url matrix parameters from dictionary to
a string.
See http://www.w3.org/DesignIssues/MatrixURIs.html for specs. | [
"def encode_matrix_parameters(parameters):\n \n result = []\n\n for param in iter(sorted(parameters)):\n if isinstance(parameters[param], (list, tuple)):\n value = (';%s=' % (param)).join(parameters[param])\n else:\n value = parameters[param]\n\n result.append(\"%... | [
"func (this *Request) Get(f string) string {\n\n\t/*\n\t Possible future bug.\n\t http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n\t Message headers are case-insensitive.\n\t*/\n\n\treturn this.Header.Get(f)\n}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Web development:"
} |
// PeekNextTokenType returns only the token type
// of the next character and it does not move forward the cursor.
// It's being used by parser to recognise empty functions, i.e `even()`
// as valid functions with zero input arguments. | [
"func (l *Lexer) PeekNextTokenType() token.Type {\n\tif len(l.input)-1 > l.pos {\n\t\tch := l.input[l.pos]\n\t\treturn resolveTokenType(ch)\n\t}\n\treturn resolveTokenType(0) // EOF\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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Construct a unique selector for the `el` element within this view. `prevSelector` is being collected through the recursive call. No value for `prevSelector` is expected when using this method. | [
"function(el, prevSelector) {\n\n var selector;\n\n if (el === this.el) {\n if (typeof prevSelector === 'string') selector = '> ' + prevSelector;\n return selector;\n }\n\n if (el) {\n\n var nthChild = V(el).index() + 1;\n selector = el.tagName... | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Builds SQL for selecting articles by price
@param double $dPriceFrom Starting price
@param double $dPriceTo Max price
@return string | [
"protected function _getPriceSelect($dPriceFrom, $dPriceTo)\n {\n $oBaseObject = $this->getBaseObject();\n $sArticleTable = $oBaseObject->getViewName();\n $sSelectFields = $oBaseObject->getSelectFields();\n\n $sSelect = \"select {$sSelectFields} from {$sArticleTable} where oxvarminpri... | [
"private void createAndSetFilter(final Scanner scanner) {\n QueryUtil.setDataTableScanFilter(scanner, group_bys, row_key_literals, \n explicit_tags, enable_fuzzy_filter, \n (end_time == UNSET\n ? -1 // Will scan until the end (0xFFF...).\n : (int) getScanEndTimeSeconds()));\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Read a grp file at the path specified by in_path.
Args:
in_path (string): path to GRP file
Returns:
grp (list) | [
"def read(in_path):\n \n assert os.path.exists(in_path), \"The following GRP file can't be found. in_path: {}\".format(in_path)\n\n with open(in_path, \"r\") as f:\n lines = f.readlines()\n # need the second conditional to ignore comment lines\n grp = [line.strip() for line in lines if... | [
"def start_index(self, value):\n \"\"\"\"\"\"\n # TODO: Validate contents? (May want to set before adding the data.)\n if not isinstance(value, dict):\n raise TypeError('start_index attribute must be a dict.')\n self._start_index = value"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// CmdStart start cmdFile. | [
"func (c *Cmd) CmdStart() error {\n\n\tvar err error\n\n\t// CmdLine check\n\tif c.CmdLine != \"\" && c.Cmd == nil {\n\t\tparseCmd, err := shellwords.Parse(c.CmdLine)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Cmd = exec.Command(parseCmd[0], parseCmd[1:]...)\n\t}\n\tif c.CmdLine == \"\" {\n\t\tc.CmdLine =... | [
"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:"
} |
Return configuration value by key
@param string $configKey The identifier to read configuration
of application.
@return array Configuration value | [
"protected function _getConfigValueArray($configKey = null) {\n\t\t$result = [];\n\t\tif (empty($configKey)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$configPath = 'CakeInstaller.' . $configKey;\n\t\tif (!Configure::check($configPath)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$configValue = (array)Configure::read($conf... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Imports the media library to the cloud.
@when after_wp_load
@param $args
@param $assoc_args | [
"public function import($args, $assoc_args) {\n\t $this->debugMode = (\\WP_CLI::get_config('debug') == 'mediacloud');\n\n\t // Force the logger to initialize\n\t Logger::instance();\n\n\t\t/** @var StorageTool $storageTool */\n\t\t$storageTool = ToolsManager::instance()->tools['storage'];\n\n\t\tif (!$stor... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Executes an SQL query on the storage engine. Should be used for SELECT
only.
@access public
@author Jerome Bogaerts, <jerome@taotesting.com>
@param string statement
@param array params
@return PDOStatement | [
"public function query($statement, $params = array())\r\n {\r\n $returnValue = null;\r\n\r\n \r\n// $trace=debug_backtrace();\r\n// $caller=array_shift($trace);\r\n// $caller=array_shift($trace);\r\n// common_Logger::d('trace : '. $caller['function'] .$caller['class'... | [
"protected function setDb($transportType = '')\n {\n $transportType = trim($transportType);\n\n // if extension is specified, use it; else use default db.\n $extensionName = ($transportType) ? $transportType : DBPROTOCOL;\n\n if (!extension_loaded($extensionName)) {\n throw... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Exports the {@link MutationState} into a universal format, which can be used either to serialize it into
a N1QL query or to send it over the network to a different application/SDK.
@return the exported {@link JsonObject}. | [
"public JsonObject export() {\n JsonObject result = JsonObject.create();\n for (MutationToken token : tokens) {\n JsonObject bucket = result.getObject(token.bucket());\n if (bucket == null) {\n bucket = JsonObject.create();\n result.put(token.bucket(... | [
"@Override\n protected List<SuperColumn> loadSuperColumns(String keyspace, String columnFamily, String rowId,\n String... superColumnNames) {\n throw new UnsupportedOperationException(\n \"Support for super columns is not available with DS java driver. Either use Thrift or pelops for the... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Reads a private key from keystore
@param alias
@param password
@return
@throws UnrecoverableKeyException
@throws KeyStoreException
@throws NoSuchAlgorithmException | [
"public Key getPrivateKey(String alias, String password) throws UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException {\n\t\treturn this.keystore.getKey(alias, password.toCharArray());\n\t}"
] | [
"protected X509Certificate wireUpSslWithCyberVilliansCAOdo(String host, SslListener listener) {\n host = requestOriginalHostName.get();\n\n // Add cybervillians CA(from browsermob)\n try {\n // see https://github.com/webmetrics/browsermob-proxy/issues/105\n String escapedH... | codesearchnet | {
"query": "Represent the Github sentence about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code about Software development:"
} |
(Lazy)load list of all supported symbols (sorted)
Look into `_data()` for all currency symbols, then sort by length and
unicode-ord (A-Z is not as relevant as ֏).
Returns:
List[unicode]: Sorted list of possible currency symbols. | [
"def _symbols():\n \n global _SYMBOLS\n if _SYMBOLS is None:\n tmp = [(s, 'symbol') for s in _data()['symbol'].keys()]\n tmp += [(s, 'alpha3') for s in _data()['alpha3'].keys()]\n tmp += [(s.name, 'name') for s in _data()['alpha3'].values()]\n _SYMBOLS = sorted(\n tmp... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetInitiator sets the Initiator field's value. | [
"func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput {\n\ts.Initiator = 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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
/*
(non-Javadoc)
@see org.fcrepo.server.access.FedoraAPIA#resumeFindObjects(String
sessionToken )* | [
"@Override\n public org.fcrepo.server.types.gen.FieldSearchResult resumeFindObjects(String sessionToken) {\n MessageContext ctx = context.getMessageContext();\n Context context = ReadOnlyContext.getSoapContext(ctx);\n assertInitialized();\n try {\n org.fcrepo.server.search.... | [
"public List<ISubmission> getExternalSubmissions(String resourceUrl, String verb) throws Exception{\n\t\treturn new SubmitterSubmissionsFilter().omit(new NormalizingFilter(verb).filter(getSubmissions(resourceUrl)), submitter);\n\t}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about PHP:"
} |
Attempts to label this invoice with a status. Note that an invoice can be more than one of the choices.
We just set a priority on which status appears. | [
"def status(self):\n\t\t\n\n\t\tif self.paid:\n\t\t\treturn self.STATUS_PAID\n\t\tif self.forgiven:\n\t\t\treturn self.STATUS_FORGIVEN\n\t\tif self.closed:\n\t\t\treturn self.STATUS_CLOSED\n\t\treturn self.STATUS_OPEN"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
直接读取对象成员值,无视 private/protected 修饰符,不经过 getter 函数。
@param target
目标对象
@param name
成员名
@param <T>
期待的成员值类型
@return 成员值 | [
"public static <T> T getFieldValue(final Object target, final String name) {\r\n\t\tField field = FieldUtils.getDeclaredField(target.getClass(), name, true);\r\n\r\n\t\tif (field == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Could not find field [\" + name + \"] on target [\" + target + ']');\r\n\t\t}\r\... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
(non-Javadoc)
@see
javax.persistence.criteria.CriteriaBuilder#or(javax.persistence.criteria
.Expression, javax.persistence.criteria.Expression) | [
"@Override\n public Predicate or(Expression<Boolean> arg0, Expression<Boolean> arg1)\n {\n // TODO Auto-generated method stub\n if (arg0 != null && arg1 != null)\n {\n if (arg0.getClass().isAssignableFrom(ComparisonPredicate.class) && arg1.getClass().isAssignableFrom(Comparison... | [
"@SuppressWarnings(\"unchecked\")\n protected Set<E> queryForSet(String jpaql)\n {\n return new HashSet<E>(getEntityManager().createQuery(jpaql).getResultList());\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about language and writing:"
} |
Check if table exists
@param string $table
@return bool | [
"public function hasTable($table)\n {\n $parts = explode('.', $table);\n if (count($parts) == 1) {\n $db = $this->db->getDbname();\n $table = $parts[0];\n } else {\n list($db, $table) = $parts;\n }\n\n $tableExistsSql = $this->checkTableSqls[$th... | [
"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:"
} |
parse route file and put data in an array
@access protected
@param $src string
@param $controller string
@param $annotation array
@since 3.0
@package Gcs\Framework\Core\Config | [
"protected function _parseAnnotationRoute($src, $controller, $annotation) {\n foreach ($annotation['methods'] as $action => $annotationMethods) {\n $data = [];\n\n foreach ($annotationMethods as $annotationMethod) {\n if ($annotationMethod['annotation'] == 'Routing') {\n ... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
------------------------------------------------------------------------ | [
"public JobClient getJobClient(JobGraph jobGraph) throws Exception {\n\t\tConfiguration configuration = jobGraph.getJobConfiguration();\n\t\tconfiguration.setString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, \"localhost\");\n\t\tconfiguration.setInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, jobManagerRpcPort)... | [
"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 post about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
// contains returns true and the offset if the label is in the range (and aligned), and false
// and nil otherwise. | [
"func (r *Allocator) contains(label *mcs.Label) (bool, uint64) {\n\treturn r.r.Offset(label)\n}"
] | [
"private void init() {\n // defaults for internal bookkeeping\n index = 0; // internal index always starts at 0\n count = 1; // internal count always starts at 1\n status = null; // we clear status on release()\n item = null; // item w... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
Return the record for the ip_address in the MaxMind DB
Arguments:
ip_address -- an IP address in the standard string notation | [
"def get(self, ip_address):\n \n address = ipaddress.ip_address(ip_address)\n\n if address.version == 6 and self._metadata.ip_version == 4:\n raise ValueError('Error looking up {0}. You attempted to look up '\n 'an IPv6 address in an IPv4-only database.'.f... | [
"def cast_to_python(self, value):\n \"\"\"\"\"\"\n # v2.x does not provide a distinction between users and groups at the field selection level, can only return\n # UserGroup instances instead of specific User or Group instances\n if value is not None:\n value = UserGroup(self.... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
setup observations from PEST-style SMP file pairs | [
"def setup_smp(self):\n \n if self.obssim_smp_pairs is None:\n return\n if len(self.obssim_smp_pairs) == 2:\n if isinstance(self.obssim_smp_pairs[0],str):\n self.obssim_smp_pairs = [self.obssim_smp_pairs]\n for obs_smp,sim_smp in self.obssim_smp_pairs... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Check that commands are either lower case or upper case, but not both | [
"def CheckUpperLowerCase(filename, linenumber, clean_lines, errors):\n \n line = clean_lines.lines[linenumber]\n if ContainsCommand(line):\n command = GetCommand(line)\n if IsCommandMixedCase(command):\n return errors(\n filename,\n linenumber,... | [
"function normalizeSeparators (p) {\n p = p || \"\";\n\n if (path.sep === \"\\\\\") {\n // Replace backslashes with forward slashes\n return p.replace(/\\\\/g, \"/\");\n }\n else {\n // Return the path as-is, since it should already have proper URL separators.\n // If it DOES contain backslashes, th... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Perform batch import into database. | [
"private void batchImport() {\r\n m_jdbcTemplate.batchUpdate(createInsertQuery(),\r\n new BatchPreparedStatementSetter() {\r\n public void setValues(\r\n PreparedStatement ps, int i)\r\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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<p>
The Amazon Resource Names (ARN) of one or more principals. Permissions are revoked for principals in this list.
</p>
@return The Amazon Resource Names (ARN) of one or more principals. Permissions are revoked for principals in this
list. | [
"public java.util.List<String> getRemoveAllowedPrincipals() {\n if (removeAllowedPrincipals == null) {\n removeAllowedPrincipals = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return removeAllowedPrincipals;\n }"
] | [
"function MobileServiceSyncTable(tableName, client) {\n Validate.isString(tableName, 'tableName');\n Validate.notNullOrEmpty(tableName, 'tableName');\n\n Validate.notNull(client, 'client');\n\n /**\n * Gets the name of the local table.\n * \n * @returns {string} The name of the table.\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Index sets the indices on which to perform the delete operation. | [
"func (s *DeleteByQueryService) Index(index ...string) *DeleteByQueryService {\n\ts.index = append(s.index, index...)\n\treturn s\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
取消刷新
@param appid appid
@param types ticket 类型 [jsapi,wx_card] | [
"public static void destroyed(String appid,String... types){\r\n\t\tfor(String type : types){\r\n\t\t\tString key = appid + KEY_JOIN + type;\r\n\t\t\tif(futureMap.containsKey(key)){\r\n\t\t\t\tfutureMap.get(key).cancel(true);\r\n\t\t\t\tlogger.info(\"destroyed appid:{} type:{}\",appid,type);\r\n\t\t\t}\r\n\t\t}\r\n... | [
"function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns the processed response to PUBSUB NUMSUB.
@param array $channels List of channels
@return array | [
"protected static function processNumsub(array $channels)\n {\n $processed = array();\n $count = count($channels);\n\n for ($i = 0; $i < $count; ++$i) {\n $processed[$channels[$i]] = $channels[++$i];\n }\n\n return $processed;\n }"
] | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Check Qt binding requirements | [
"def check_qt():\r\n \"\"\"\"\"\"\r\n qt_infos = dict(pyqt5=(\"PyQt5\", \"5.6\"))\r\n try:\r\n import qtpy\r\n package_name, required_ver = qt_infos[qtpy.API]\r\n actual_ver = qtpy.PYQT_VERSION\r\n if LooseVersion(actual_ver) < LooseVersion(required_ver):\r\n show_war... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a new metrics to the registry
@param metricsName - the name
@param theMetricsObj - the metrics
@throws IllegalArgumentException if a name is already registered | [
"public void add(final String metricsName, final MetricsBase theMetricsObj) {\n if (metricsList.putIfAbsent(metricsName, theMetricsObj) != null) {\n throw new IllegalArgumentException(\"Duplicate metricsName:\" + metricsName);\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
returns a list of countries and there codes
@return array | [
"public static function countriesList()\n {\n $path = dirname(realpath(__FILE__)).DIRECTORY_SEPARATOR.'data/countries.json';\n $countries = self::readJson($path, true);\n\n $listCountries = [];\n\n foreach ($countries['Names'] as $code => $value) {\n $listCountries[$code] =... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Free frees the RWops structure allocated by AllocRW().
// (https://wiki.libsdl.org/SDL_FreeRW) | [
"func (rwops *RWops) Free() error {\n\tif rwops == nil {\n\t\treturn ErrInvalidParameters\n\t}\n\n\tC.SDL_FreeRW(rwops.cptr())\n\treturn nil\n}"
] | [
"func LoadDollarTemplates(t TouchID, src *RWops) int {\n\treturn int(C.SDL_LoadDollarTemplates(t.c(), src.cptr()))\n}"
] | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Get totp status for the supplied identifier
@param string $identifier
@return Totp
@throws Exception | [
"public function getTotp($identifier)\n {\n $totp = $this->factory->createEmptyTotp();\n $totp->populate($identifier);\n\n return $totp;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the physical volume mda count. | [
"def mda_count(self):\n \n self.open()\n mda = lvm_pv_get_mda_count(self.handle)\n self.close()\n return mda"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// LitByte renders a byte literal. | [
"func (g *Group) LitByte(v byte) *Statement {\n\ts := LitByte(v)\n\tg.items = append(g.items, s)\n\treturn s\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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
@param string $path
@param array $params
@param string $method
@param null $body
@param array $headers
@return \Psr\Http\Message\ResponseInterface | [
"public function request(string $path, array $params = null, string $method = null, $body = null, array $headers = null):ResponseInterface{\n\n\t\tparse_str(parse_url($this->apiURL.$path, PHP_URL_QUERY), $query);\n\n\t\t$query['v'] = $this::API_VERSIONDATE;\n\t\t$query['m'] = 'foursquare';\n\n\t\treturn parent::req... | [
"public function execute(Client $client)\n {\n if (!$this->request instanceof Request) {\n throw new \\InvalidArgumentException('request is not an instanceof \\GuzzleHttp\\Message\\Request');\n }\n\n $this->copyClientDefaults($client);\n\n return $client->send($this->reques... | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
Custom read() function
@access private | [
"function read($session_id)\n {\n\n // get the lock name, associated with the current session\n $this->session_lock = $this->_mysql_real_escape_string('session_' . $session_id);\n\n // try to obtain a lock with the given name and timeout\n $result = $this->_mysql_query('SELECT GET_LOC... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetStyle sets the style (e.g.: BASE, BOOTSTRAP) of the field, correctly populating the Widget field. | [
"func (f *Field) SetStyle(style string) FieldInterface {\n\tf.tmplStyle = style\n\tf.Widget = widgets.BaseWidget(style, f.fieldType, f.tmpl)\n\treturn f\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set key pattern
@param null|string $keyPattern
@throws Exception\InvalidArgumentException
@return AdapterOptions | [
"public function setKeyPattern($keyPattern)\n {\n $keyPattern = (string)$keyPattern;\n if ($this->keyPattern !== $keyPattern) {\n // validate pattern\n if ($keyPattern !== '') {\n ErrorHandler::start(E_WARNING);\n $result = preg_match($keyPattern,... | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code:"
} |
// see interface | [
"func (s *schedule) GetOption(timestamp uint32, length uint32) (id string, score uint) {\n\tid = random.String(32)\n\tscore = s.getConflicts(timestamp, length)\n\titem := &scheduledItem{\n\t\tid: id,\n\t\tdeadlineAt: s.realtime(timestamp).Add(-1 * Deadline),\n\t\ttimestamp: timestamp,\n\t\tlength: leng... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Simple class helper
@param {Function} Constructor Constructor function
@param {Object} members Members dictionary
@param {Function} [Base] Base class
@return {Function} New class constructor
@private | [
"function _class (Constructor, members, Base) {\n var ResultConstructor;\n if (Base) {\n ResultConstructor = function () {\n Base.apply(this, arguments);\n Constructor.apply(this, arguments);\n };\n ResultConstructor.prototype = new Base();\n } else {\n Res... | [
"function () {\n var\n newClass,\n newPrototype,\n baseClassDef;\n\n // The new class constructor\n newClass = _getOldNewClassConstructor(this);\n this._Constructor = newClass;\n newClass[_GPF_CLASSDEF_MARKER] = this._uid;\n\n // Basic JavaS... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
gets a horiztonal line | [
"def get_hline():\n \n return Window(\n width=LayoutDimension.exact(1),\n height=LayoutDimension.exact(1),\n content=FillControl('-', token=Token.Line))"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the value at the specified position.
@param row
index of the row
@param col
index of the column
@return string representation of the specified field | [
"@Override\n\tpublic Object getValueAt(final int row, final int col)\n\t{\n\n\t\tswitch (col) {\n\t\tcase 0:\n\t\t\treturn archives.get(row).getType();\n\t\tcase 1:\n\t\t\treturn archives.get(row).getStartPosition();\n\t\tcase 2:\n\t\t\treturn archives.get(row).getPath();\n\t\t}\n\n\t\treturn \"---\";\n\t}"
] | [
"function parseFormulaData (nulls, operation, result) {\n /**\n * @description\n * Object containing formula data\n *\n * @typedef {object} carto.dataview.FormulaData\n * @property {number} nulls - Number of null values in the column\n * @property {string} operation - Operation used\n * @property {nu... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
************************ utility methods *************************** | [
"private static Parser<Expression> compare(\n Parser<Expression> operand, String name, Op op) {\n return Parsers.sequence(\n operand, term(name).retn(op), operand,\n BinaryExpression::new);\n }"
] | [
"protected function welcomeMessage ()\n {\n $this->comment ('');\n $this->comment ('**************************************************');\n $this->comment (' Welcome to HoneyComb CMS initial configuration!!!');\n $this->comment ('**************************************************');\n... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
A memorization decorator for class properties.
It implements the above `classproperty` decorator, with
the difference that the function result is computed and attached
to class as direct attribute. (Lazy loading and caching.) | [
"def cached_classproperty(fun):\n \n @functools.wraps(fun)\n def get(cls):\n try:\n return cls.__cache[fun]\n except AttributeError:\n cls.__cache = {}\n except KeyError: # pragma: no cover\n pass\n ret = cls.__cache[fun] = fun(cls)\n ret... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parses command-line and directs to sub-commands.
@param args Command-line input
@throws Exception | [
"public static void executeCommand(String[] args) throws Exception {\n String subCmd = (args.length > 0) ? args[0] : \"\";\n args = AdminToolUtils.copyArrayCutFirst(args);\n if(subCmd.equals(\"list\")) {\n SubCommandScheduledList.executeCommand(args);\n } else if(subCmd.equals... | [
"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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Interrupt the thread and then log and re-throw an InterruptedException
as an IOException.
@param msg The message to log and include when re-throwing
@param e The actual exception instances
@throws IOException | [
"public static void interruptedException(String msg, InterruptedException e)\n throws IOException {\n Thread.currentThread().interrupt();\n LOG.error(msg, e);\n throw new IOException(msg, e);\n }"
] | [
"@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 Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates an exception for a server name that was not found.
@param string $serverName The server name.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"public static function serverNotFound($serverName, Exception $cause = null)\n {\n return new static(sprintf(\n 'The asset server \"%s\" does not exist.',\n $serverName\n ), self::SERVER_NOT_FOUND, $cause);\n }"
] | [
"public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even... | codesearchnet | {
"query": "Represent the Github description about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Includes the file corresponding with the class name to be autoloaded
@param string $class Class name as defined by PHP autoloading
@return void | [
"protected function includeClass($class)\n {\n $this->updateLog(\"info\", \"Setting up {$class} class for inclusion.\");\n\n $class_bits = explode(\"\\\\\", $class);\n\n $package = \"\";\n $package_stack = array();\n\n foreach ($class_bits as $bit) {\n $package... | [
"public function addEnvironmentReader(array $arguments = [])\n {\n // Full namespace: <EXTENSION_NAMESPACE>\\Environment\\<EXTENSION_CONFIG_KEY>EnvironmentReader.\n // For example we have registered extension at namespace: \"Behat\\TqExtension\". Class, which\n // implements extension interf... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Creates Guava's {@link FutureCallback} from provided Actions | [
"public static <A> FutureCallback<A> futureCallback(final Action<A> success, final Action<Throwable> failure) {\n return new FutureCallback<A>() {\n @Override public void onSuccess(A result) {\n checkNotNull(success).apply(result);\n }\n\n @Override public void... | [
"@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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// walletLock handles a walletlock request by locking the all account
// wallets, returning an error if any wallet is not encrypted (for example,
// a watching-only wallet). | [
"func walletLock(icmd interface{}, w *wallet.Wallet) (interface{}, error) {\n\tw.Lock()\n\treturn nil, nil\n}"
] | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see com.ibm.ws.webcontainer.webapp.IWebAppDispatcherContext#getPathTranslated() | [
"public String getPathTranslated()\n {\n String pathInfo = getPathInfo();\n\n if (pathInfo == null)\n {\n return null;\n }\n else\n {\n return getWebApp().getRealPath(pathInfo);\n }\n }"
] | [
"@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com.... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Decide whether a file/directory is too small to raid. | [
"public static boolean shouldRaid(Configuration conf, FileSystem srcFs, \n FileStatus stat, Codec codec, List<FileStatus> lfs) throws IOException {\n Path p = stat.getPath();\n long blockNum = 0L;\n if (stat.isDir() != codec.isDirRaid) {\n return false;\n }\n \n if (tooNewForRaid(stat)) ... | [
"static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Segment the rest of the text taking into account some exceptions for
periods as sentence breakers. It decides when a period marks an end of
sentence.
@param lines
the segmented sentences so far
@return all the segmented sentences | [
"public String[] segmenterExceptions(final String[] lines) {\n final List<String> sentences = new ArrayList<>();\n for (final String line : lines) {\n final String segmentedLine = segmenterNonBreaker(line);\n final String[] lineSentences = segmentedLine.split(\"\\n\");\n for (final String lineS... | [
"public static String getSummary(String document, int max_length, String sentence_separator)\n {\n // Parameter size in this method refers to the string length of the summary required;\n // The actual length of the summary generated may be short than the required length, but never longer;\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
calculate square sum.
@param pvalue value to calculate square sum for
@return square sum | [
"private static int squareSum(final int pvalue) {\r\n int result = 0;\r\n for (final char valueDigit : String.valueOf(pvalue).toCharArray()) {\r\n result += Character.digit(valueDigit, 10);\r\n }\r\n return result;\r\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 Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Sector matrix in X
:param theta: bend angle, in [rad]
:param rho: bend radius, in [m]
:return: 2x2 numpy array | [
"def funTransSectX(theta, rho):\n \n return np.matrix([[np.cos(theta), rho * np.sin(theta)], [-np.sin(theta) / rho, np.cos(theta)]], dtype=np.double)"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Initializes the widget.
If you override this method, make sure you call the parent implementation first. | [
"public function init()\n {\n parent::init();\n //checks for the element id\n if (!isset($this->options['id'])) \n {\n $this->options['id'] = $this->getId();\n }\n echo Html::beginTag('div', ['id' => $this->options['id']]); //opens the container\n }"
] | [
"public static HTML embedFlashObject (Panel container, String htmlString)\n {\n // Please note: the following is a work-around for an IE7 bug. If we create a Flash object\n // node *before* attaching it to the DOM tree, IE will silently fail to register\n // the Flash object's callback funct... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see org.deckfour.xes.util.XRegistry#areEqual(java.lang.Object, java.lang.Object) | [
"@Override\n\tprotected boolean areEqual(XSerializer a, XSerializer b) {\n\t\treturn a.getClass().equals(b.getClass());\n\t}"
] | [
"@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
https://url.spec.whatwg.org/#url-miscellaneous | [
"function getDefaultPortFromScheme( scheme ) {\n var port = null;\n if ( scheme === 'ftp') {\n port = 21;\n }\n else if ( scheme === 'gopher' ) {\n port = 70;\n }\n else if ( scheme === 'http' || scheme === 'ws' ) {\n port = 80;\n }\n else if ( scheme === 'https' || scheme === 'wss' ) {\n port =... | [
"async def text(self, *, encoding: Optional[str]=None) -> str:\n \"\"\"\"\"\"\n data = await self.read(decode=True)\n # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA\n # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttpreques... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the timestamp for first day of the year for the given date.
@param timestamp
@return timestamp | [
"public static function firstDayOfYear($ts = null)\n\t{\n\t\t// default to now\n\t\tif ($ts === null) $ts = sfDateTimeToolkit::now();\n\t\t\n\t\treturn sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), date('m', $ts) - 1);\n\t}"
] | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get configured server.
@return Server | [
"public function getServer()\n {\n if (!$this->server) {\n $server = new Server(\n $this->getSource(),\n $this->getCache(),\n $this->getApi()\n );\n\n $server->setSourcePathPrefix($this->sourcePathPrefix);\n $server->... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetClientCAList sets the list of CAs sent to the client when requesting a
// client certificate for Ctx. See
// https://www.openssl.org/docs/ssl/SSL_CTX_set_client_CA_list.html | [
"func (c *Ctx) SetClientCAList(caList *StackOfX509Name) {\n\tC.SSL_CTX_set_client_CA_list(c.ctx, caList.stack)\n\tcaList.shared = true\n}"
] | [
"def create_tls_context(self):\n \n # Create context manually, as we're going to set our own options.\n tls_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n\n # Load client/server certificate.\n if self.tls_certificate_file:\n tls_context.load_cert_chain(self.tls_certifi... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
初始化各种连接池
@throws \Server\CoreBase\SwooleException | [
"protected function initAsynPools()\n {\n if ($this->config->get('redis.enable', true)) {\n get_instance()->addAsynPool('redisPool', new RedisAsynPool($this->config, $this->config->get('redis.active')));\n }\n if ($this->config->get('mysql.enable', true)) {\n get_instan... | [
"public function handle(PacketEventParam $e)\n {\n if(!Worker::isWorkerStartAppComplete())\n {\n $GLOBALS['WORKER_START_END_RESUME_COIDS'][] = Coroutine::getuid();\n Coroutine::suspend();\n }\n // 上下文创建\n RequestContext::create();\n RequestContext::... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Build ``query_string`` object from ``q``.
:param q: q of type String
:param default_field: default_field
:return: dictionary object. | [
"def _build_query_string(q, default_field=None, default_operator='AND'):\n \n def _is_phrase_search(query_string):\n clean_query = query_string.strip()\n return clean_query and clean_query.startswith('\"') and clean_query.endswith('\"')\n\n def _get_phrase(query_string):\n return query... | [
"def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Renders the control as a HTML string.
@method renderHtml
@return {String} HTML representing the control. | [
"function () {\n var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;\n var value = self.state.get('value') || '';\n var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';\n\n if (\"spellcheck\" in settings) {\n extraAttrs += ' spellc... | [
"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 description about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
// SetInstanceIds sets the InstanceIds field's value. | [
"func (s *DescribeAutoScalingInstancesInput) SetInstanceIds(v []*string) *DescribeAutoScalingInstancesInput {\n\ts.InstanceIds = 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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
This function is called when the application has provided a response
and needs it to be sent to the client. | [
"def confirmation(self, apdu):\n \"\"\"\"\"\"\n if _debug: ServerSSM._debug(\"confirmation %r\", apdu)\n\n # check to see we are in the correct state\n if self.state != AWAIT_RESPONSE:\n if _debug: ServerSSM._debug(\" - warning: not expecting a response\")\n\n # abor... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about File management:"
} |
Change the current(default) theme
Parameters
----------
new : theme
New default theme
Returns
-------
out : theme
Previous theme | [
"def theme_set(new):\n \n if (not isinstance(new, theme) and\n not issubclass(new, theme)):\n raise PlotnineError(\"Expecting object to be a theme\")\n\n out = get_option('current_theme')\n set_option('current_theme', new)\n return out"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Format values for the API
@param mixed $value
@param bool $exclude [optional] If true, value will be excluded from datastore indexes.
@param int $meaning [optional] The Meaning value. Maintained only for backwards compatibility.
@return array | [
"public function valueObject($value, $exclude = false, $meaning = null)\n {\n switch (gettype($value)) {\n case 'boolean':\n $propertyValue = [\n 'booleanValue' => $value\n ];\n\n break;\n\n case 'integer':\n ... | [
"protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
Inserts the specified objects at the specified index in the array.
@param items The objects to insert into the array.
@param index The index at which the object must be inserted. | [
"public void addAll(int index, T... items) {\n List<T> collection = Arrays.asList(items);\n synchronized (mLock) {\n if (mOriginalValues != null) {\n mOriginalValues.addAll(index, collection);\n } else {\n mObjects.addAll(index, collection);\n ... | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param \Interpro\Extractor\Contracts\Db\CMapper
@return void | [
"public function registerCMapper(CMapper $mapper)\n {\n $family = $mapper->getFamily();\n\n if(array_key_exists($family, $this->mappersC))\n {\n throw new ExtractorException('Маппер простых(С) типов пакета '.$family.' уже зарегестрирована в медиаторе!');\n }\n\n $thi... | [
"public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->_fieldsDefinition = $this->tracker->createTrackClass('Engine\\\\FieldsDefinition', $this->_trackId);\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Reads the data from the input stream and writes to the
output stream.
@param inputStream
The inputStream to read from
@param outputStream
The output stream to write to
@throws IOException
Any IO exception | [
"public static void readAndWriteStreams(InputStream inputStream,OutputStream outputStream) throws IOException\n {\n byte[] buffer=new byte[5000];\n int read=-1;\n try\n {\n do\n {\n //read next buffer\n read=inputStream.read(buffer);... | [
"@Override\n public List<Writable> next() {\n List<String> next = dataIter.next();\n invokeListeners(next);\n List<Writable> ret = new ArrayList<>();\n for (String s : next)\n ret.add(new Text(s));\n return ret;\n }\n\n /**\n * Check whether there are anymo... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.