query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Write the extension to the DerOutputStream.
@param out the DerOutputStream to write the extension to.
@exception IOException on error. | [
"public void encode(DerOutputStream out) throws IOException {\n if (isEmpty()) {\n return;\n }\n\n DerOutputStream temp = new DerOutputStream();\n for (GeneralName gn : names) {\n gn.encode(temp);\n }\n out.write(DerValue.tag_Sequence, temp);\n }"
] | [
"public void writeOut(Writer out) throws IOException {\n\t if (writer == null) {\n\t out.write(strBuffer.toString()); // PK33136\n\t // Flush not called as the writer passed could be a BodyContent and\n\t // it doesn't allow to flush.\n\t }\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about writing:"
} |
// read from a file descriptor | [
"func fdRead(fd C.int, d []byte) (n int, err error) {\n buff := make([]C.uchar, len(d))\n res := C.uchar_read(fd, &buff[0], C.size_t(len(d)))\n if res == C.ssize_t(-1) {\n err = errors.New(\"read returned -1\")\n } else {\n n = int(res)\n for i, b := range buff[:n] {\n d[i] = byte(b)\n }\n }\n... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about programming:"
} |
get cached value in time or return value
@param $value value or object to cache
@param $id key for cache
@return object | [
"public function cacheVal($value, $id = null) {\r\n if ($id == null) {\r\n if (is_object($value))\r\n $id = $this->getIDfromOjb($value);\r\n\r\n if ($id == null && $this->getConfig('debug')) {\r\n echo \"no caching key\";\r\n return $value;\r... | [
"function loadUncached () {\n // debug\n debug('view:id:collection:loadUncached', this.idCacheKey)\n // create new select for only uncached ids without view applied\n var select = sql.select(this.query.model, {\n all: true,\n where: {id: this.ids},\n })\n // replace original select i... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Convert the main dataframe to html
:return: html data
:rtype: str
:example: ``ds.to_html_()`` | [
"def to_html_(self) -> str:\n \n try:\n renderer = pytablewriter.HtmlTableWriter\n data = self._build_export(renderer)\n return data\n except Exception as e:\n self.err(e, \"Can not convert data to html\")"
] | [
"def convert(self, *args, **kwargs):\n \n\n self.strings()\n self.metadata()\n\n # save file\n self.result.save(self.output())"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Determine if the model or given attribute(s) have been modified.
@param array|string|null $attributes
@return bool | [
"public function isDirty($attributes = null): bool\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n if (parent::isDirty($attributes)) {\n return true;\n }\n\n foreach ($this->translationCache as $translation) {\n if ($translation->is... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns URL of a promo block page.
@param string $sPageCode
@return string | [
"public function getPageUrl($sPageCode = 'promo-block')\n {\n //Get URL params\n $arParamList = $this->getPageParamList($sPageCode);\n\n //Generate page URL\n $sURL = CmsPage::url($sPageCode, $arParamList);\n\n return $sURL;\n }"
] | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the summarization about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
// Add adds the series id to the set. | [
"func (s *SeriesIDSet) Add(id SeriesID) {\n\ts.Lock()\n\tdefer s.Unlock()\n\ts.AddNoLock(id)\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
http://jqueryui.com/themeroller
@param string $icon der Name des Icons ohne ui-icon- davor | [
"public function setRightIcon($icon) {\n $this->rightIcon = $icon;\n $this->widgetOptions['icons']['secondary'] = 'ui-icon-'.$this->rightIcon;\n return $this;\n }"
] | [
"protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {\n $dataName = 'layoutManager';\n \n if (isset($requestData->$dataName) && count($requestData->$dataName) > 0) {\n $serialized = $requestData->$dataName;\n } /*else {\n throw $this->err->validationE... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
OnCreateViewHolder implementation for parent items. The desired ParentViewHolder should
be inflated here
@param parent for inflating the View
@return the user's custom parent ViewHolder that must extend ParentViewHolder | [
"@UiThread\n @NonNull\n @Override\n public HorizontalParentViewHolder onCreateParentViewHolder(@NonNull ViewGroup parent, int viewType) {\n View view = mInflater.inflate(R.layout.list_item_parent_horizontal, parent, false);\n return new HorizontalParentViewHolder(view);\n }"
] | [
"@SuppressWarnings(\"unchecked\") // we know that return value type is a child of view, and V is bound to a child of view.\n public static <V extends View> V findViewById(Activity activity, int id) {\n return (V) activity.findViewById(id);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Parser for the International TAF forcast varient | [
"def parse_in_line(txt: str, units: Units) -> typing.Dict[str, str]:\n \n retwx = {}\n wxdata = txt.split(' ')\n wxdata, _, retwx['wind_shear'] = core.sanitize_report_list(wxdata)\n wxdata, retwx['type'], retwx['start_time'], retwx['end_time'] = core.get_type_and_times(wxdata)\n wxdata, retwx['win... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Look up a key in a potentially nested object `root` by its `sep`-separated
path. Returns `default` if the key is not found.
Example:
access_key({'foo': {'bar': 1}}, 'foo.bar') -> 1 | [
"def access_key(root, key, sep='.', default=None):\n '''\n \n '''\n props = key.split('.')\n props.reverse()\n while props and root:\n prop = props.pop()\n root = access(root, prop, default=default)\n return root"
] | [
"def validate_extra_context(ctx, param, value):\n \"\"\"\"\"\"\n for s in value:\n if '=' not in s:\n raise click.BadParameter(\n 'EXTRA_CONTEXT should contain items of the form key=value; '\n \"'{}' doesn't match that form\".format(s)\n )\n\n # Co... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Go programming language:"
} |
Return an array of lower bounds for each bucket in the histogram. | [
"def ranges(self):\n \"\"\"\"\"\"\n bucket_fns = {\n 'boolean': linear_buckets,\n 'flag': linear_buckets,\n 'count': linear_buckets,\n 'enumerated': linear_buckets,\n 'categorical': linear_buckets,\n 'linear': linear_buckets,\n ... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github summarization about Data analysis:",
"pos": "Represent the Github code about Data analysis:",
"neg": "Represent the Github code:"
} |
// SetNamespace sets the Namespace field's value. | [
"func (s *UpdateUserInput) SetNamespace(v string) *UpdateUserInput {\n\ts.Namespace = &v\n\treturn s\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
资金授权解冻接口
@param model
{AlipayFundAuthOrderUnfreezeModel}
@return {AlipayFundAuthOrderUnfreezeResponse}
@throws {AlipayApiException} | [
"public static AlipayFundAuthOrderUnfreezeResponse authOrderUnfreezeToResponse(\n\t\t\tAlipayFundAuthOrderUnfreezeModel model) throws AlipayApiException {\n\t\tAlipayFundAuthOrderUnfreezeRequest request = new AlipayFundAuthOrderUnfreezeRequest();\n\t\trequest.setBizModel(model);\n\t\treturn AliPayApiConfigKit.getAl... | [
"public String appPay(AppPayDetail appPayDetail){\n checkNotNullAndEmpty(alipay.appPriKey, \"app private key\");\n Map<String, String> appPayParams = buildAppPayParams(appPayDetail);\n return buildRsaPayString(appPayParams);\n }"
] | codesearchnet | {
"query": "Represent the text about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code about programming:"
} |
Remove bidi marks from affix | [
"private static String trimMarksFromAffix(String affix) {\n boolean hasBidiMark = false;\n int idx = 0;\n for (; idx < affix.length(); idx++) {\n if (isBidiMark(affix.charAt(idx))) {\n hasBidiMark = true;\n break;\n }\n }\n if (!... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds a required capability which all results will be checked against
@param string $capability
@param int|null $user | [
"final public function require_capability($capability, $user = null) {\n if (!is_int($user)) {\n $user = null;\n }\n $this->requiredcapabilities[] = array(\n 'capability' => $capability,\n 'user' => $user\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Fetch basis.js options from script's `basis-config` or `data-basis-config` attribute. | [
"function fetchConfig(){\n var config = __config;\n\n if (!config)\n {\n if (NODE_ENV)\n {\n // node.js env\n basisFilename = process.basisjsFilename || __filename.replace(/\\\\/g, '/');\n\n /** @cut */ if (process.basisjsConfig)\n /** @cut */ {\n /** @cut */ ... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a "post-run" dependent task item for this task item.
@param dependent the "post-run" dependent task item.
@return key to be used as parameter to taskResult(string) method to retrieve result of root
task in the given dependent task group | [
"public String addPostRunDependent(FunctionalTaskItem dependent) {\n Objects.requireNonNull(dependent);\n return this.taskGroup().addPostRunDependent(dependent);\n }"
] | [
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ... | codesearchnet | {
"query": "Represent the Github text about Data management:",
"pos": "Represent the Github code about Data management:",
"neg": "Represent the Github code:"
} |
// StartConsuming is a common part of StartConsuming method | [
"func (b *Broker) StartConsuming(consumerTag string, concurrency int, taskProcessor iface.TaskProcessor) {\n\tif b.retryFunc == nil {\n\t\tb.retryFunc = retry.Closure()\n\t}\n\n\tb.stopChan = make(chan int)\n\tb.retryStopChan = make(chan int)\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Allows to set listeners with standard Yii configuration system
@param array[] $listeners
@return $this
@throws InvalidConfigException | [
"public function setListeners(array $listeners = [])\n {\n foreach ($listeners as $listener) {\n if (!isset($listener['event']) || !isset($listener['listener'])) {\n throw new InvalidConfigException('Both \"event\" and \"listener\" properties are required to attach a listener.');... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns unique token for method and params | [
"public function getCsrfToken(string $control, string $method, array $params): string\n\t{\n\t\treturn Helpers::getCsrfToken($this->getSession(), $control, $method, $params);\n\t}"
] | [
"@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:"
} |
--------------------------------------------------------------------- | [
"@Override\n public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {\n return activity.getActivityContext().getMessageSource().getMessage(code, args, defaultMessage, locale);\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 comment about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
Extract a list of exif infos | [
"def extract_exif(self):\n '''\n \n '''\n width, height = self.extract_image_size()\n make, model = self.extract_make(), self.extract_model()\n orientation = self.extract_orientation()\n geo = self.extract_geo()\n capture = self.extract_capture_time()\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
获取插件路径和类名
返回值为一个数组
第一项为插件路径,第二项为类名
@access public
@param string $pluginName 插件名
@param string $path 插件目录
@return array
@throws \Exception | [
"public static function portal($pluginName, $path) {\n $className = ucfirst($pluginName);\n switch (true) {\n case file_exists($pluginFileName = $path . $pluginName . '/'.$className.'.php'): //file_exists($pluginFileName = $path . '/' . $pluginName . '/Plugin.php'):\n $clas... | [
"public static String getAbsolutePath(String path, Class<?> baseClass) {\r\n\t\tString normalPath;\r\n\t\tif (path == null) {\r\n\t\t\tnormalPath = StrUtil.EMPTY;\r\n\t\t} else {\r\n\t\t\tnormalPath = normalize(path);\r\n\t\t\tif (isAbsolutePath(normalPath)) {\r\n\t\t\t\t// 给定的路径已经是绝对路径了\r\n\t\t\t\treturn normalPat... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about text processing:"
} |
验证签名
@param $prestr 需要签名的字符串数据
@param $sign 签名结果
@param $key 私钥
return 签名结果 | [
"public function verifySign($data, $sign) \n\t{\n\t\t$data = $data . self::getSecretKey() . self::getPrivateKey();\n\t\t$vsgin = md5($data);\n\t\tif($vsgin == $sign) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}"
] | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return the header field at the given index. The first and newest entry is always at index 1,
and the oldest entry is at the index length(). | [
"public HpackHeaderField getEntry(int index) {\n if (index <= 0 || index > length()) {\n throw new IndexOutOfBoundsException();\n }\n int i = head - index;\n if (i < 0) {\n return hpackHeaderFields[i + hpackHeaderFields.length];\n } else {\n return... | [
"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 description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Computer Science:"
} |
Soft assert for whether the text if visible in the current window/frame
:params text: the string to search for
:params msg: (Optional) msg explaining the difference | [
"def verify_text_present(self, text, msg=None):\n \n try:\n self.assert_text_present(text, msg)\n except AssertionError, e:\n if msg:\n m = \"%s:\\n%s\" % (msg, str(e))\n else:\n m = str(e)\n self.verification_erorrs.appe... | [
"def error(self, message):\n \n if (\n \"not allowed\" in message\n or \"ignored\" in message\n or \"expected\" in message\n or \"invalid\" in message\n or self.add_help\n ):\n # when we have \"help\" then we must also have prope... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the minimum free thread count.
@param pMaxConcurrentThreadCount | [
"public void setMaxConcurrentThreadCount(String pMaxConcurrentThreadCount) {\r\n if (!StringUtil.isEmpty(pMaxConcurrentThreadCount)) {\r\n try {\r\n maxConcurrentThreadCount = Integer.parseInt(pMaxConcurrentThreadCount);\r\n }\r\n catch (NumberFormatException n... | [
"def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get **sort** command of current request.
@return array | [
"public function getSort()\n {\n $sorts = $get = $this->request->get('!sort') ?: array();\n\n foreach ($sorts as $key => &$value) {\n $value = (int) $value;\n }\n\n return $sorts;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetOptionGroupName sets the OptionGroupName field's value. | [
"func (s *RestoreDBClusterFromS3Input) SetOptionGroupName(v string) *RestoreDBClusterFromS3Input {\n\ts.OptionGroupName = &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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Interpret the results of the attribute preg_match_all(). Emit errors as
appropriate and return an associative array.
@param array $matches
@return array | [
"protected function interpretAttribMatches( $matches ) {\n\t\t$attributes = [];\n\t\tforeach ( $matches as $m ) {\n\t\t\tif ( strlen( $m[self::MA_SLASH][0] ) ) {\n\t\t\t\t$this->error( 'unexpected bare slash', $m[self::MA_SLASH][1] );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = $m[self::MA_NAME][0];\n\t\t\t$isSimple... | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Set map zoom level.
@param integer $value
@throws MapperArgumentException
@return void | [
"public function setZoom($value)\n\t{\n\t\tif (!is_numeric($value)) {\n\t\t\tthrow new MapperArgumentException('Zoom level must be an integer.');\n\t\t}\n\n\t\tif ($value < 1 || $value > 20) {\n\t\t\tthrow new MapperArgumentException('A zoom level must be between 1 and 20.');\n\t\t}\n\n\t\t$this->zoom = $value;\n\t... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
(non-Javadoc)
@see XcapClient#deleteIfNoneMatch(java.net.URI,
java.lang.String, Header[],
Credentials) | [
"public XcapResponse deleteIfNoneMatch(URI uri, String eTag,\r\n\t\t\tHeader[] additionalRequestHeaders, Credentials credentials)\r\n\t\t\tthrows IOException {\r\n\t\tcheckState();\r\n\t\treturn ra.getClient().deleteIfNoneMatch(uri, eTag,\r\n\t\t\t\tadditionalRequestHeaders, credentials);\r\n\t}"
] | [
"public void changeEndpoint(String endpoint) throws ConnectionEndpointArray.UnknownSchemeException {\n changeEndpoints(new Endpoints(new ConnectionEndpointArray().addEndpoint(endpoint).toArray(new ConnectionEndpoint[1]), new TrustedKey[0]));\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Extracts INDRA statements from the RDF graph via SPARQL queries. | [
"def extract_statements(self):\n \n\n # Look for events that have an AGENT and an AFFECTED, and get the\n # start and ending text indices for each.\n query = prefixes + \"\"\"\n SELECT\n ?agent_start\n ?agent_end\n ?affected_start\n ?aff... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Sends a "Cache-Control" HTTP header.
@param boolean $doCache Use caching?
@param boolean $mustRevalidate Should be checked on each request, if a used cache is valid? | [
"public static function SendCacheControl( bool $doCache = false, bool $mustRevalidate = true )\n {\n\n \\header(\n 'Cache-Control: '\n . ( $doCache ? 'cache' : 'no-cache' )\n . ( $mustRevalidate ? ', must-revalidate' : '' )\n );\n\n }"
] | [
"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 description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
make the cxf ClientImpl.close works, and we should close all clients too | [
"@Override\n public void close() {\n if (closed.compareAndSet(false, true)) {\n super.close();\n synchronized (baseClients) {\n for (WebClient wc : baseClients) {\n wc.close();\n }\n }\n\n String moduleName = getM... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Clip the tensor to be lower bounded by a given minimum.
@param float $min
@return mixed | [
"public function clipLower(float $min)\n {\n $b = [];\n\n foreach ($this->a as $value) {\n if ($value < $min) {\n $b[] = $min;\n\n continue 1;\n }\n\n $b[] = $value;\n }\n\n return static::quick($b);\n }"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
this method splits a video into n chunks defined by the frames array.
$frames = array(array(0, 12), array(13, 110), array(111, 200));
ffmpeg -i quickns.mov -an -vf "select=between(n\,110\,200),setpts=PTS-STARTPTS" grg.mov | [
"public function splitVideo($source, $frames, $target)\n {\n if (empty($frames)) {\n $frames = array();\n }\n $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);\n \n $i=1;\n foreach ($frames as $frame) {\n $this->serviceLocat... | [
"def _get_audio_sample_bit(self, audio_abs_path):\n \n sample_bit = int(\n subprocess.check_output(\n (\"\"\"sox --i {} | grep \"{}\" | awk -F \" : \" '{{print $2}}' | grep -oh \"^[^-]*\" \"\"\").format(audio_abs_path, \"Precision\"),\n shell=True, universal_newli... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Signal Processing:"
} |
Extracts a tuple from a string.
Args:
str_in (string) that contains python tuple
Returns:
(dict) or None if no valid tuple was found
Raises:
- | [
"def str2tuple(str_in):\n '''\n \n '''\n tuple_out = safe_eval(str_in)\n if not isinstance(tuple_out, tuple):\n tuple_out = None\n return tuple_out"
] | [
"def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set the HTTP response code
@param int $code The HTTP status code to send
@return $this | [
"public function setCode( $code = null)\n\t{\n\t\t// Require that the response be unlocked before changing it\n\t\t$this->requireUnlocked();\n\t\t$this->status = new Status($code);\n\t\treturn $this;\n\t}"
] | [
"public function tokenAction(Request $request)\n {\n /** @var PropertyAccess $config */\n $config = $this->app['conf'];\n\n if ( ! $request->isSecure() && $config->get(['main', 'api_require_ssl'], true) == true) {\n throw new HttpException(400, 'This route requires the use of the ... | codesearchnet | {
"query": "Represent the sentence about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Programming:"
} |
:param eopatch: Input EOPatch.
:type eopatch: EOPatch
:return: Transformed eo patch
:rtype: EOPatch | [
"def execute(self, eopatch):\n \n feature_type, feature_name = next(self.feature(eopatch))\n\n good_idxs = self._get_filtered_indices(eopatch[feature_type][feature_name] if feature_name is not ... else\n eopatch[feature_type])\n\n for feature... | [
"def extend(self, ampal_container):\n \"\"\"\"\"\"\n if isinstance(ampal_container, AmpalContainer):\n self._ampal_objects.extend(ampal_container)\n else:\n raise TypeError(\n 'Only AmpalContainer objects may be merged with '\n 'an AmpalContai... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Create a response frame based on this frame.
:param data: Data section of response as bytearray. If None, request data section is kept.
:return: ModbusTCPFrame instance that represents a response | [
"def create_response(self, data=None):\n \n frame = deepcopy(self)\n if data is not None:\n frame.data = data\n frame.length = 2 + len(frame.data)\n return frame"
] | [
"def reset(self):\n \n self.getsCounter = 0\n\n # dictionary of processed requests for each client. Value for each\n # client is a dictionary with request id as key and transaction id as\n # value\n self.processedRequests = {} # type: Dict[str, Dict[int, str]]\n\n #... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
@param string $attribute
@param string $value
@return $this | [
"public function setAttribute(string $attribute, string $value = '')\n {\n $this->htmlAttributes->setAttribute($attribute, $value);\n\n return $this;\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// GetCall uses Twilio to get information about a voice call.
// See https://www.twilio.com/docs/voice/api/call | [
"func (twilio *Twilio) GetCall(sid string) (*VoiceResponse, *Exception, error) {\n\tvar voiceResponse *VoiceResponse\n\tvar exception *Exception\n\ttwilioUrl := twilio.BaseUrl + \"/Accounts/\" + twilio.AccountSid + \"/Calls/\" + sid + \".json\"\n\n\tres, err := twilio.get(twilioUrl)\n\tif err != nil {\n\t\treturn n... | [
"def taskrouter(self):\n \n if self._taskrouter is None:\n from twilio.rest.taskrouter import Taskrouter\n self._taskrouter = Taskrouter(self)\n return self._taskrouter"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Twilio:"
} |
// LongestActive returns the ID of the peer that has been active for the longest
// length of time. | [
"func (t *Transport) LongestActive() (uint64, error) {\n\tp, err := t.longestActive()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn p.id, nil\n}"
] | [
"function ClientState(client) {\n\n /**\n * The associated client instance.\n *\n * @property client\n * @type Client\n */\n this.client = client;\n\n /**\n * The time (in milliseconds) to wait before the next request\n * may be sent to the API; this value is only updated upon\n * reception of a ... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Method registerCallbackOnNewExpression
Adds a list of matching consumers in a new entry to the appropriate wildcard
or exact expression table.
@param topicExpression
@param isWildcarded
@param callback
@param matchingConsumers
@return | [
"public boolean registerCallbackOnNewExpression(\n ConnectionImpl connection,\n String topicExpression,\n boolean isWildcarded,\n ConsumerSetChangeCallback callback,\n ArrayList matchingConsumers)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(\n ... | [
"private void registerPackageInTypeInterestFactory(String pkg)\n {\n TypeInterestFactory.registerInterest(pkg + \"_pkg\", pkg.replace(\".\", \"\\\\.\"), pkg, TypeReferenceLocation.IMPORT);\n // TODO: Finish the implementation\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Serve a rueckenwind application | [
"def serv(args):\n \"\"\"\"\"\"\n if not args.no_debug:\n tornado.autoreload.start()\n\n extra = []\n\n if sys.stdout.isatty():\n # set terminal title\n sys.stdout.write('\\x1b]2;rw: {}\\x07'.format(' '.join(sys.argv[2:])))\n\n if args.cfg:\n extra.append(os.path.abspath(a... | [
"function(hljs) {\n return {\n lexemes: /[!#@\\w]+/,\n keywords: {\n keyword: //ex command\n // express version except: ! & * < = > !! # @ @@\n 'N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea brea... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Pass in a domain name or a name server. | [
"def reverse_name_server(self, query, limit=None, **kwargs):\n \"\"\"\"\"\"\n return self._results('reverse-name-server', '/v1/{0}/name-server-domains'.format(query),\n items_path=('primary_domains', ), limit=limit, **kwargs)"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Get ticket.
@param ticketId the ticket id
@param encodedTicketId the encoded ticket id
@return the ticket | [
"public Ticket get(final String ticketId, final String encodedTicketId) {\n val metadata = this.ticketCatalog.find(ticketId);\n if (metadata != null) {\n val keys = new HashMap<String, AttributeValue>();\n keys.put(ColumnNames.ID.getColumnName(), new AttributeValue(encodedTicketI... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// newIPCConnection will connect to a named pipe with the given endpoint as name. | [
"func newIPCConnection(ctx context.Context, endpoint string) (net.Conn, error) {\n\ttimeout := defaultPipeDialTimeout\n\tif deadline, ok := ctx.Deadline(); ok {\n\t\ttimeout = deadline.Sub(time.Now())\n\t\tif timeout < 0 {\n\t\t\ttimeout = 0\n\t\t}\n\t}\n\treturn npipe.DialTimeout(endpoint, timeout)\n}"
] | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified
{@link StringBuilder} that is easy to read by humans. | [
"public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf) {\n appendPrettyHexDump(dump, buf, buf.readerIndex(), buf.readableBytes());\n }"
] | [
"@Nonnull\n public String getLine() {\n if (preLoaded) {\n if (bufferOffset >= 0) {\n int lineStart = bufferOffset;\n if (linePos > 0) {\n lineStart -= linePos - 1;\n }\n int lineEnd = bufferOffset;\n ... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Handle a resource loader.
@param resourceLoader
the resource loader
@param classLoader
the classloader
@param classpathOrderOut
the classpath order
@param scanSpec
the scan spec
@param log
the log | [
"private static void handleResourceLoader(final Object resourceLoader, final ClassLoader classLoader,\n final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) {\n if (resourceLoader == null) {\n return;\n }\n // PathResourceLoader has root fiel... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeJobExecutionRequest describeJobExecutionRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeJobExecutionRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMars... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Computes the dot product of this vector with the other vector. | [
"public float dot(IntFloatVector y) {\n if (y instanceof IntFloatSortedVector) {\n IntFloatSortedVector other = ((IntFloatSortedVector) y);\n float dot = 0;\n int oc = 0;\n for (int c = 0; c < used; c++) {\n while (oc < other.used) {\n ... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github comment about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
// Exists checks if the pod's cgroup already exists | [
"func (m *podContainerManagerImpl) Exists(pod *v1.Pod) bool {\n\tpodContainerName, _ := m.GetPodContainerName(pod)\n\treturn m.cgroupManager.Exists(podContainerName)\n}"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Create redirect
@param Request $request
@return RedirectResponse|Response | [
"public function createAction(Request $request)\n {\n $manager = $this->get('opifer.redirect.redirect_manager');\n\n $redirect = $manager->createNew();\n\n $form = $this->createForm(RedirectType::class, $redirect);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() ... | [
"public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ... | codesearchnet | {
"query": "Represent the comment about Laravel:",
"pos": "Represent the code about Laravel:",
"neg": "Represent the code:"
} |
// Get retrieves the actual value of the option parameter. | [
"func (o *DecompoundedAttributesOption) Get() map[string][]string {\n\tif o == nil {\n\t\treturn map[string][]string{}\n\t}\n\treturn o.value\n}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Not supported at this time. | [
"@Override\r\n public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {\r\n throw new UnsupportedOperationException(\"Not supported...\");\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:"
} |
Ensures that all parameters in a list of 2-element tuples are encoded to
bytestrings using UTF-8 | [
"def encode_params_utf8(params):\n \n encoded = []\n for k, v in params:\n encoded.append((\n k.encode('utf-8') if isinstance(k, unicode_type) else k,\n v.encode('utf-8') if isinstance(v, unicode_type) else v))\n return encoded"
] | [
"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:"
} |
Generate the AuthNetReceiver::Transaction model fields from the given JSON data | [
"def fields_from_json(json)\n fields = {\n :transaction_id => json['x_trans_id'],\n :invoice_num => json['x_invoice_num'],\n :subscription_id => json['x_subscription_id'],\n :subscription_paynum => json['x_subscription_paynum'],\n :transaction_type => json['x_type'],\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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
getter for case - gets Case
@generated
@return value of the feature | [
"public String getCase() {\n if (PronounFeats_Type.featOkTst && ((PronounFeats_Type)jcasType).casFeat_case == null)\n jcasType.jcas.throwFeatMissing(\"case\", \"de.julielab.jules.types.PronounFeats\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((PronounFeats_Type)jcasType).casFeatCode_case);}"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Obtain block size given 3 or more blocks | [
"private static long getBlockSize(LocatedBlocks lbs) throws IOException {\n List<LocatedBlock> locatedBlocks = lbs.getLocatedBlocks();\n long bs = -1;\n for (LocatedBlock lb: locatedBlocks) {\n if (lb.getBlockSize() > bs) {\n bs = lb.getBlockSize();\n }\n }\n return bs;\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 comment about Blockchain:",
"pos": "Represent the code about Blockchain:",
"neg": "Represent the code about Natural Language Processing:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *CompleteMultipartUploadInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CompleteMultipartUploadInput\"}\n\tif s.Bucket == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Bucket\"))\n\t}\n\tif s.Bucket != nil && len(*s.Bucket) < 1 {\n\t\tinvalidParams.Add(request... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// AllServiceGroups returns all the ServiceGroups that aren't in the excludes set and the set of covered NodeIDs | [
"func AllServiceGroups(g osgraph.Graph, excludeNodeIDs IntSet) ([]ServiceGroup, IntSet) {\n\tcovered := IntSet{}\n\tservices := []ServiceGroup{}\n\n\tfor _, uncastNode := range g.NodesByKind(kubegraph.ServiceNodeKind) {\n\t\tif excludeNodeIDs.Has(uncastNode.ID()) {\n\t\t\tcontinue\n\t\t}\n\n\t\tservice, covers := N... | [
"func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus... | codesearchnet | {
"query": "Represent the Github comment about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about Software development:"
} |
Observe the target for changes and update the handlers accordingly | [
"function (changeset) {\n\t\t\t\t\tchangeset.forEach(function(change) {\n\t\t\t\t\t\tif(change.name!==\"__target__\") {\n\t\t\t\t\t\t\tif(change.type===\"delete\") {\n\t\t\t\t\t\t\t\tdelete proxy[change.name];\n\t\t\t\t\t\t\t} else if(change.type===\"update\") { // update handler if target key value changes from fu... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get all dashboards which a user has created.
@param string $userLogin login of the user
@return \array[] | [
"private function getUserDashboards($userLogin)\n {\n $userDashboards = $this->dashboard->getAllDashboards($userLogin);\n\n $dashboards = array();\n\n foreach ($userDashboards as $userDashboard) {\n $widgets = $this->getVisibleWidgetsWithinDashboard($userDashboard);\n $... | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get the projected size (in bytes) of the exported data from this Block instance. | [
"def get_size( self ):\n \"\"\"\"\"\"\n klass = self.__class__\n size = 0\n for name in klass._fields:\n size = max( size, klass._fields[name].get_end_offset( self._field_data[name], parent=self ) )\n for check in klass._checks.values():\n size = max( size, c... | [
"@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 AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.GSCS__LCID:\n\t\t\t\tsetLCID(LCID_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\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 summarization about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Visits provided relative path using provided or default session.
@param string $path
@param string|null $sessionName | [
"public function visitPath($path, $sessionName = null)\n {\n $this->getSession($sessionName)->visit($this->locatePath($path));\n }"
] | [
"protected function configureApp ()\n {\n $this->envData['APP_ENV'] = $this->choice (\"Choose environment. [local|production]\", ['local', 'production'], 0);\n $this->envData['APP_KEY'] = \"\";\n $this->envData['APP_DEBUG'] = $this->confirm (\"Enable debugging?\", 'yes') ? \"true\" : \"f... | codesearchnet | {
"query": "Represent the sentence about file transfer:",
"pos": "Represent the code about file transfer:",
"neg": "Represent the code about Software development:"
} |
// Origin parses Origin header in "req".
// If origin is "null", returns (nil, nil). | [
"func Origin(config *Config, req *http.Request) (*url.URL, error) {\n\tvar origin string\n\tswitch config.Version {\n\tcase ProtocolVersionHybi13:\n\t\torigin = req.Header.Get(\"Origin\")\n\t}\n\tif origin == \"null\" {\n\t\treturn nil, nil\n\t}\n\treturn url.ParseRequestURI(origin)\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 summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about Computer Science:"
} |
Adds entries to the classpath.
@param cp List to which the new entries are appended.
@param entries New classpath entries (separated by File.pathSeparator). | [
"private void addToClassPath(Set<String> cp, String entries) {\n if (isEmpty(entries)) {\n return;\n }\n String[] split = entries.split(Pattern.quote(File.pathSeparator));\n for (String entry : split) {\n if (!isEmpty(entry)) {\n if (new File(entry).isDirectory() && !entry.endsWith(File... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Delete a record from the database.
@return mixed | [
"public function delete()\n {\n if (isset($this->onDelete)) {\n return call_user_func($this->onDelete, $this);\n }\n\n $this->forceDelete();\n }"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Database management:",
"pos": "Represent the Github code about Database management:",
"neg": "Represent the Github code about File management:"
} |
Filters out all pages who's status is set to "Deleted".
@see {@link SiteTree::getStatusFlags()}
@return SS_List | [
"public function getFilteredPages()\n {\n $pages = Versioned::get_including_deleted(SiteTree::class);\n $pages = $this->applyDefaultFilters($pages);\n\n $pages = $pages->filterByCallback(function (SiteTree $page) {\n // Doesn't exist on either stage or live\n return $pa... | [
"public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Stringify column expressions
@param {Array} columns
@return {string} | [
"function columnsToSQL(columns, tables) {\n if (!columns) return\n const baseTable = Array.isArray(tables) && tables[0]\n let isDual = false\n if (baseTable && baseTable.type === 'dual') isDual = true\n return columns\n .map(column => {\n const { expr } = column\n if (isDual) expr.isDual = isDual\... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
This method is intended for internal use only. Returns the marshaled request configured with additional
parameters to enable operation dry-run. | [
"@Override\n public Request<GetTransitGatewayRouteTableAssociationsRequest> getDryRunRequest() {\n Request<GetTransitGatewayRouteTableAssociationsRequest> request = new GetTransitGatewayRouteTableAssociationsRequestMarshaller().marshall(this);\n request.addParameter(\"DryRun\", Boolean.toString(tru... | [
"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 comment about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
reformat the text to be stripped of noise | [
"def reformat_cmd(self, text):\n \n # remove az if there\n text = text.replace('az', '')\n # disregard defaulting symbols\n if text and SELECT_SYMBOL['scope'] == text[0:2]:\n text = text.replace(SELECT_SYMBOL['scope'], \"\")\n\n if self.shell_ctx.default_command:... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Unregisters the given client from this CacheManager.
@param client The client to unregister. | [
"public void unregister(Client client) {\n if (this.closed.get()) {\n // We are done. Nothing to do here.\n return;\n }\n\n Preconditions.checkNotNull(client, \"client\");\n synchronized (this.clients) {\n this.clients.remove(client);\n }\n\n ... | [
"@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Get the underlying message object
@return The underlying message object | [
"@Override\n public JsMessage getMessage()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"getMessage\");\n\n // We hold a reference to the root JsMessage so that an individual subscription\n // can choose to release its reference to i... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Show Sitemap as tree and save new order if necessary.
@Route("/reorganize", name="victoire_sitemap_reorganize", options={"expose"=true})
@return JsonResponse | [
"public function reorganizeAction(Request $request)\n {\n if ($request->isMethod('POST')) {\n $this->get('victoire_sitemap.sort.handler')->handle(\n $request->request->get('sorted')\n );\n $response['message'] = $this->get('translator')->trans('sitemap.chang... | [
"func (app App) ConfigureApplication(application *application.Application) {\n\tcontroller := &Controller{View: render.New(&render.Config{AssetFileSystem: application.AssetFS.NameSpace(\"products\")}, \"app/products/views\")}\n\n\tfuncmapmaker.AddFuncMapMaker(controller.View)\n\tapp.ConfigureAdmin(application.Admin... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Gets the individual path elements building up the canonical path to the given file. | [
"public static String[] getCanonicalPathElements (File file)\n throws IOException\n {\n file = file.getCanonicalFile();\n\n // If we were a file, get its parent\n if (!file.isDirectory()) {\n file = file.getParentFile();\n }\n\n return file.getPath().split(Fil... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
@param string $field
@param array $values
@return static | [
"public function whereIn($field, $values)\n {\n foreach ($this->queries as $query) {\n $query->whereIn($field, $values);\n }\n\n return $this;\n }"
] | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handle multiple requests if necessary. | [
"def handle(self):\n \"\"\"\"\"\"\n self.close_connection = 1\n\n self.handle_one_request()\n while not self.close_connection:\n self.handle_one_request()"
] | [
"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 Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code about programming:"
} |
// SetLimit sets the Limit field's value. | [
"func (s *ListVirtualRoutersInput) SetLimit(v int64) *ListVirtualRoutersInput {\n\ts.Limit = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param Node\Stmt\Function_ $declaredFunction
@return bool | [
"private function isFunctionExistenceChecked(Node\\Stmt\\Function_ $declaredFunction)\n {\n /** @var Node\\Stmt\\If_ $ifStatement */\n foreach ($this->ifStatementStack as $ifStatement) {\n $condition = $ifStatement->cond;\n\n $isConditionNegatedFunctionExistsCall = $condition\... | [
"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:"
} |
Parse raw log lines and convert it to a dictionary with extracted features. | [
"def _extract_line_features(self):\n \n for line in self.line_iterator:\n m = re.search(GENERIC_IPV4_REGEX, line)\n\n data = {\n 'raw': line\n }\n\n if m:\n data['ip'] = m.group('ip')\n\n self.parsed_lines.append(data... | [
"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 sentence about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
加载插件的各项资源
@param string $id | [
"protected function initResources($id = null)\n {\n $id || $id = $this->getId();\n $plugin = $this->plugin->getById($id);\n $basePath = $plugin->getBasePath();\n\n $class = get_class($this);\n $namespace = substr($class, 0, strrpos($class, '\\\\'));\n\n // 1. 加载项目配置\n ... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
/* response: raw response from server | [
"function serverResponseToRESPONSE (response) {\n\ttry {\n\t\tconst obj = JSON.parse(response);\n\t\tif (obj.result === RESPONSE_UNKNOWN) {\n\t\t\treturn RESPONSE_UNKNOWN;\n\t\t} else {\n\t\t\treturn obj.result.result;\n\t\t}\n\t} catch (e) {\n\t\treturn RESPONSE_INVALID;\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 Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// applyTxRwset records the upsertion/deletion of a kv and updatation/deletion
// of asociated metadata present in a txrwset | [
"func (txops txOps) applyTxRwset(rwset *rwsetutil.TxRwSet) error {\n\tfor _, nsRWSet := range rwset.NsRwSets {\n\t\tns := nsRWSet.NameSpace\n\t\tfor _, kvWrite := range nsRWSet.KvRwSet.Writes {\n\t\t\ttxops.applyKVWrite(ns, \"\", kvWrite)\n\t\t}\n\t\tfor _, kvMetadataWrite := range nsRWSet.KvRwSet.MetadataWrites {\... | [
"func (p *propertySet) setTargetAttributeWithCount(targetAttribute string, allowedCount uint64, taskGroup string) {\n\t// Store that this is for a task group\n\tif taskGroup != \"\" {\n\t\tp.taskGroup = taskGroup\n\t}\n\n\t// Store the constraint\n\tp.targetAttribute = targetAttribute\n\n\tp.allowedCount = allowedC... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
import parsed data from raw json
@param array|object $data
@return jsonq | [
"public function collect($data)\n {\n $this->_map = $this->objectToArray($data);\n $this->_baseContents = &$this->_map;\n\n return $this;\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the post about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code:"
} |
Export as string.
@param bool $verbose Add additional text output.
@return string | [
"public function export(bool $verbose = false): string {\n openssl_csr_export($this->getHandle(), $output, !$verbose);\n return $output;\n }"
] | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Converts value to field type or use original | [
"def use_value(self, value):\n \"\"\"\"\"\"\n if self.check_value(value):\n return value\n return self.convert_value(value)"
] | [
"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 Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Create the request's Tree structure
@return void | [
"protected function populateStructure()\n {\n $treeStructure = [\n 'blacklist_request' => [\n 'card_number' => $this->card_number,\n 'terminal_token' => $this->terminal_token\n ]\n ];\n\n $this->treeStructure = \\Genesis\\Utils\\Common::... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Warns if an assignment expression uses operator assignment shorthand.
@param {ASTNode} node An AssignmentExpression node.
@returns {void} | [
"function prohibit(node) {\n if (node.operator !== \"=\") {\n context.report({\n node,\n messageId: \"unexpected\",\n fix(fixer) {\n if (canBeFixed(node.left)) {\n const operatorToken... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Create an interactive python console | [
"def interact_plain(header=UP_LINE, local_ns=None,\n module=None, dummy=None,\n stack_depth=1, global_ns=None):\n \n frame = sys._getframe(stack_depth)\n\n variables = {}\n\n if local_ns is not None:\n variables.update(local_ns)\n else:\n variables.up... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param mixed $other
@return bool | [
"public function compareTo($other): bool {\n if(!($other instanceof $this)) {\n return FALSE;\n }\n if($this->getHost() !== $other->getHost()) {\n return FALSE;\n }\n if($this->getPort() !== $other->getPort()) {\n return FALSE;\n }\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Prints the Pixy blocks data. | [
"def print_pixy_blocks(blocks):\n \n print(\"Detected \" + str(len(blocks)) + \" Pixy blocks:\")\n if len(blocks) > 0 and not \"signature\" in blocks[0]:\n print(\"Something went wrong. This does not appear to be a printable block.\")\n board.shutdown()\n return\n for block_index i... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Checks if scenario or outline matches specified filter.
@param ScenarioInterface $scenario Scenario or Outline node instance
@return Boolean | [
"public function isScenarioMatch(ScenarioInterface $scenario)\n {\n if ('/' === $this->filterString[0] && 1 === preg_match($this->filterString, $scenario->getTitle())) {\n return true;\n } elseif (false !== mb_strpos($scenario->getTitle(), $this->filterString, 0, 'utf8')) {\n ... | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerArgument('resultSet', SearchResultSet::class, 'The context searchResultSet', true);\n $this->registerArgument('document', SearchResult::class, 'The document to highlight', true);\n $this->regi... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Computer Science:"
} |
Returns the appropriate Swagger Property instance for a given object class.
@param swagger
@param objectClass
@return a SwaggerProperty instance | [
"protected Property getSwaggerProperty(Swagger swagger, Class<?> objectClass) {\n Property swaggerProperty = null;\n if (byte.class == objectClass || Byte.class == objectClass) {\n // STRING\n swaggerProperty = new StringProperty(\"byte\");\n } else if (char.class == objec... | [
"public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
(Internal) Exits the ISNode Process | [
"function() {\n\t\tvar currentDate = new Date();\n\t\tcurrentDate = currentDate.toISOString();\n\t\tconsole.log(currentDate + \" (shutdown) Shutdown Complete\");\n\t\tprocess.exit();\n\t}"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SlaveWasRestarted is part of the tmclient.TabletManagerClient interface. | [
"func (client *FakeTabletManagerClient) SlaveWasRestarted(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias) error {\n\treturn nil\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.