query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// Returns a new random level.
[ "func (s SkipList) randomLevel() (n int) {\n\tfor n = 0; n < s.effectiveMaxLevel() && rand.Float64() < p; n++ {\n\t}\n\treturn\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetImportTablesNotStarted sets the ImportTablesNotStarted field's value.
[ "func (s *DescribeResizeOutput) SetImportTablesNotStarted(v []*string) *DescribeResizeOutput {\n\ts.ImportTablesNotStarted = 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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Provides list of files related to the change. @param gerritQueryHandler the query handler, responsible for the queries to gerrit. @param changeId the Gerrit change id. @return list of files from the change, null in case of errors
[ "public static List<String> getFilesByChange(GerritQueryHandler gerritQueryHandler, String changeId) {\n try {\n List<JSONObject> jsonList = gerritQueryHandler.queryFiles(\"change:\" + changeId);\n for (JSONObject json : jsonList) {\n if (json.has(\"type\") && \"stats\".e...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Short description of method buildFromArray @access public @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> @param array array @return common_configuration_Component
[ "public static function buildFromArray($array)\n {\n $returnValue = null;\n\n \n if (!empty($array)){\n \tif (!empty($array['type'])){\n \t\t$acceptedTypes = array('PHPRuntime', 'PHPINIValue', 'PHPExtension', 'PHPDatabaseDriver', 'FileSystemComponent', 'Custom', 'Mock');\n ...
[ "function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Finds the field with id $fieldId in $content. @param int $fieldId @param Content $content @return Field
[ "protected function findFieldInContent($fieldId, Content $content)\n {\n foreach ($content->getFields() as $field) {\n if ($field->id == $fieldId) {\n return $field;\n }\n }\n throw new InvalidArgumentException(\"Field with id $fieldId not found in Conten...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// NavigationEntries is an action to retrieve the page's navigation history // entries.
[ "func NavigationEntries(currentIndex *int64, entries *[]*page.NavigationEntry) Action {\n\tif currentIndex == nil || entries == nil {\n\t\tpanic(\"currentIndex and entries cannot be nil\")\n\t}\n\n\treturn ActionFunc(func(ctx context.Context) error {\n\t\tvar err error\n\t\t*currentIndex, *entries, err = page.GetNa...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param string $serializer @return Serializer
[ "public static function getSerializer(string $serializer): Serializer\n {\n if (!isset(self::$serializers[$serializer])) {\n switch ($serializer) {\n case 'php':\n self::$serializers[$serializer] = new PhpSerializer();\n break;\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Make a withdrawal. @param VendorInterface $vendor @param $amount @param $label @return int @throws Exception
[ "private function withdrawSoap(VendorInterface $vendor, $amount, $label)\n {\n $parameters = array('amount' => $amount, 'label' => $label);\n $parameters = $this->mergeSubAccountParameters($vendor, $parameters);\n $result = $this->callSoap('create', $parameters);\n\n return $result['t...
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Add a new country at once
[ "protected function submitAddCountry()\n {\n $this->setSubmitted(null, $this->getParam());\n $this->setSubmittedJson('format');\n $this->validateComponent('country');\n $this->addCountry();\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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Eval set of hparams for model-free PPO.
[ "def rlmf_eval():\n \"\"\"\"\"\"\n hparams = rlmf_original()\n hparams.batch_size = 8\n hparams.eval_sampling_temps = [0.0, 0.5, 1.0]\n hparams.eval_rl_env_max_episode_steps = -1\n hparams.add_hparam(\"ppo_epoch_length\", 128)\n hparams.add_hparam(\"ppo_optimization_batch_size\", 32)\n hparams.add_hparam(\"...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns whether the token list matches the HTML tree :param selector: A Token list to check :type selector: list of Token objects :returns: True if the token list has matches in self.tree :rtype: bool
[ "def _token_list_matches_tree(self, token_list):\n \n try:\n parsed_selector = cssselect.parse(\n ''.join(token.as_css() for token in token_list))[0]\n\n return bool(\n self.tree.xpath(\n self.xpath_translator.selector_to_xpath(par...
[ "def get_child_content(self, children, element_name):\n \"\"\"\"\"\"\n # Loop through the children and get the specified element.\n for child in children:\n # If the child is the requested element, return its content.\n if child.tag == element_name:\n return...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Process one line from the text format question section.
[ "def _question_line(self, section):\n \"\"\"\"\"\"\n\n token = self.tok.get(want_leading = True)\n if not token.is_whitespace():\n self.last_name = dns.name.from_text(token.value, None)\n name = self.last_name\n token = self.tok.get()\n if not token.is_identifier...
[ "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:" }
@param Request $request @param mixed $data @throws \Exception @return Response
[ "public function editAction(Request $request, $data = null)\n {\n if (null === $data) {\n $data = $this->getDataFromRequest($request);\n }\n $form = $this->getForm($request, $data);\n\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {...
[ "public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================...
codesearchnet
{ "query": "Represent the Github sentence about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Software development:" }
Returns the position of a free block or 0.
[ "int get(int rowSize) {\n\n if (lookup.size() == 0) {\n return -1;\n }\n\n int index = lookup.findFirstGreaterEqualKeyIndex(rowSize);\n\n if (index == -1) {\n return -1;\n }\n\n // statistics for successful requests only - to be used later for midSize\...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Transform y with f using parameter vector psi psi = [[a,b,c]] :math:`f = (y * d) + \\sum_{terms} a * tanh(b *(y + c))`
[ "def f(self, y):\n \n d = self.d\n mpsi = self.psi\n z = d * y.copy()\n for i in range(len(mpsi)):\n a, b, c = mpsi[i]\n z += a * np.tanh(b * (y + c))\n return z" ]
[ "def obfn_cns(self):\n \n \"\"\"\n\n Y = self.obfn_gvar()\n return np.linalg.norm((self.Pcn(Y) - Y))" ]
codesearchnet
{ "query": "Represent the Github post about Mathematics:", "pos": "Represent the Github code about Mathematics:", "neg": "Represent the Github code about programming:" }
If a char sequence is adjacent to an index of matcher, then append the sequence to the pattern of the index of matcher.
[ "static Matcher combineCharSeqAfterIndexOf(Matcher matcher) {\n if (matcher instanceof IndexOfMatcher) {\n IndexOfMatcher m = matcher.as();\n Matcher next = PatternUtils.head(m.next());\n if (next instanceof CharSeqMatcher) {\n String pattern = m.pattern() + next.<CharSeqMatcher>as().patter...
[ "private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetDisableRemoteControl sets the DisableRemoteControl field's value.
[ "func (s *AccountSettings) SetDisableRemoteControl(v bool) *AccountSettings {\n\ts.DisableRemoteControl = &v\n\treturn s\n}" ]
[ "public final void setTemplateMode(final TemplateMode templateMode) {\n Validate.notNull(templateMode, \"Cannot set a null template mode value\");\n // We re-parse the specified template mode so that we make sure we get rid of deprecated values\n this.templateMode = TemplateMode.parse(templateM...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Runs the program and handles command line options
[ "def main(argv=None):\n ''' '''\n parser = get_parser()\n\n # Parse arguments and run the function\n global args\n args = parser.parse_args(argv)\n args.func()" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
获得指定类的单例对象<br> 对象存在于池中返回,否则创建,每次调用此方法获得的对象为同一个对象<br> 注意:单例针对的是类和对象,因此get方法第一次调用时创建的对象始终唯一,也就是说就算参数变更,返回的依旧是第一次创建的对象 @param <T> 单例对象类型 @param className 类名 @param params 构造参数 @return 单例对象
[ "public static <T> T get(String className, Object... params) {\r\n\t\tfinal Class<T> clazz = ClassUtil.loadClass(className);\r\n\t\treturn get(clazz, params);\r\n\t}" ]
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Copied from {@link ResourceImpl#doUnload()} but doesn't call {@link #getContents()} to avoid derived state computation. @since 2.8
[ "@Override\n\tprotected void doUnload() {\n\t\tIterator<EObject> allContents = getAllProperContents(unloadingContents);\n\t\t// This guard is needed to ensure that clear doesn't make the resource become loaded.\n\t\t//\n\t\tif (!doGetContents().isEmpty()) {\n\t\t\tdoGetContents().clear();\n\t\t}\n\t\tgetErrors().cl...
[ "public void deleteTemplate(ThymeLeafTemplateImplementation template) {\n // 1 - unregister the service\n try {\n ServiceRegistration reg = registrations.remove(template);\n if (reg != null) {\n reg.unregister();\n }\n } catch (Exception e) { //NO...
codesearchnet
{ "query": "Represent the description about Technical Support:", "pos": "Represent the code about Technical Support:", "neg": "Represent the code about Metadata management:" }
Draws a handle for the Brush section @return {void}
[ "function drawHandles() {\n let handleFillColor = colorHelper.colorSchemasHuman.grey[1];\n\n // Styling\n handle = chartBrush\n .selectAll('.handle.brush-rect')\n .style('fill', handleFillColor);\n }" ]
[ "final void initDocument(int documentNumber)\n {\n // save masked DTM document handle\n m_docHandle = documentNumber<<DOCHANDLE_SHIFT;\n\n // Initialize the doc -- no parent, no next-sib\n nodes.writeSlot(0,DOCUMENT_NODE,-1,-1,0);\n /...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Short description of method removeType @access public @author Joel Bout, <joel.bout@tudor.lu> @param Resource resource @param Class class @return boolean
[ "public function removeType( core_kernel_classes_Resource $resource, core_kernel_classes_Class $class)\n {\n $returnValue = (bool) false;\n\n \n \n $query = 'DELETE FROM statements \n\t\t \t\tWHERE subject = ? AND predicate = ? AND '. $this->getPersistence()->getPlatForm()->getOb...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// remoteClient returns a client connection to gregord.
[ "func (h *Server) remoteClient() chat1.RemoteInterface {\n\tif h.rc != nil {\n\t\treturn h.rc\n\t}\n\treturn h.serverConn.GetClient()\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Generator that yields prediction objects from an API response.
[ "def predictions(self):\n \"\"\"\"\"\"\n for prediction in self.api.predictions(vid=self.vid)['prd']:\n pobj = Prediction.fromapi(self.api, prediction)\n pobj._busobj = self\n yield pobj" ]
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
`String.prototype.replace` method https://tc39.github.io/ecma262/#sec-string.prototype.replace
[ "function replace(searchValue, replaceValue) {\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }" ]
[ "function es5Plugins(){\n return [\n require('babel-plugin-check-es2015-constants'),\n require('babel-plugin-transform-es2015-arrow-functions'),\n require('babel-plugin-transform-es2015-block-scoped-functions'),\n require('babel-plugin-transform-es2015-block-scoping'),\n require('babel-p...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Retrieves the clan, who matches the given id @param string $param the clan tag @return Clan a Clan object, containing the searched clan
[ "private function _clanById(string $param): Clan\n {\n $curlClient = curl_init(\n self::BASE_URL .\n self::CLANS_URL .\n '/' .\n \\urlencode($param)\n );\n curl_setopt($curlClient, CURLOPT_HTTPHEADER, $this->_curlHeader);\n curl_setopt($curl...
[ "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:" }
Unlocks the container-page in a synchronized RPC call.<p>
[ "protected void unlockContainerpage() {\n\n if (getData().getDetailContainerPage() != null) {\n\n CmsCoreProvider.get().unlock(getData().getDetailContainerPage());\n } else if (unlockResource(CmsCoreProvider.get().getStructureId())) {\n CmsDebugLog.getInstance().printLine(Message...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Will apply conditions defined inside $m onto query $q. @param Model $m @param \atk4\dsql\Query $q @return \atk4\dsql\Query
[ "public function initQueryConditions($m, $q)\n {\n if (!isset($m->conditions)) {\n // no conditions are set in the model\n return $q;\n }\n\n foreach ($m->conditions as $cond) {\n\n // Options here are:\n // count($cond) == 1, we will pass the only...
[ "public static function deleteAll($condition, $params = array())\n {\n if (!is_a($condition, '\\\\mpf\\\\datasources\\\\sql\\\\ModelCondition')) {\n $condition = ModelCondition::getFrom($condition, get_called_class());\n }\n /* @var $condition ModelCondition */\n $condition...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software Development:" }
Create a new GPS {@code Speed} object. @param speed the GPS speed value @param unit the speed unit @return a new GPS {@code Speed} object @throws NullPointerException if the given speed {@code unit} is {@code null}
[ "public static Speed of(final double speed, final Unit unit) {\n\t\trequireNonNull(unit);\n\t\treturn new Speed(Unit.METERS_PER_SECOND.convert(speed, unit));\n\t}" ]
[ "public String getDescriptiveName()\n {\n StringBuilder sb = new StringBuilder(getDistributionName());\n sb.append(\"(\");\n String[] vars = getVariables();\n double[] vals = getCurrentVariableValues();\n \n sb.append(vars[0]).append(\" = \").append(vals[0]);\n \n...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Retrieve the detector file for given detector id If t0set is given, append the calibration data.
[ "def detx(self, det_id, t0set=None, calibration=None):\n \n url = 'detx/{0}?'.format(det_id) # '?' since it's ignored if no args\n if t0set is not None:\n url += '&t0set=' + t0set\n if calibration is not None:\n url += '&calibrid=' + calibration\n\n detx =...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Auxiliary method.
[ "def __del_running_bp(self, tid, bp):\n \"\"\n self.__runningBP[tid].remove(bp)\n if not self.__runningBP[tid]:\n del self.__runningBP[tid]" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the content parsed into html @return string
[ "public function getParsedContentAttribute()\n\t{\n\t\tif (Config::get('core::wardrobe.cache'))\n\t\t{\n\t\t\t$content = $this->attributes['content'];\n\n\t\t\treturn Cache::rememberForever('post-'.$this->attributes['id'], function() use ($content)\n\t\t\t{\n\t\t\t\treturn md($content);\n\t\t\t});\n\t\t}\n\n\t\tret...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetName sets the Name field's value.
[ "func (s *UserPoolDescriptionType) SetName(v string) *UserPoolDescriptionType {\n\ts.Name = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
判断指定异常是否来自或者包含指定异常 @param throwable 异常 @param exceptionClass 定义的引起异常的类 @param checkCause 判断cause @return true 来自或者包含 @since 4.4.1
[ "public static boolean isFromOrSuppressedThrowable(Throwable throwable, Class<? extends Throwable> exceptionClass, boolean checkCause) {\n\t\treturn convertFromOrSuppressedThrowable(throwable, exceptionClass, checkCause) != null;\n\t}" ]
[ "public static Field getDeclaredField(Object object, String fieldName) {\n Field field = null;\n Class<?> clazz = object.getClass();\n for (; clazz != Object.class; clazz = clazz.getSuperclass()) {\n try {\n field = clazz.getDeclaredField(fieldName);\n r...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
Basic ordered parser.
[ "def basic_parser(patterns, with_name=None):\n \n def parse(line):\n output = None\n highest_order = 0\n highest_pattern_name = None\n for pattern in patterns:\n results = pattern.findall(line)\n if results and any(results):\n if pattern.order >...
[ "protected function parentId()\n\t{\n\t\tswitch ( $this->position )\n\t\t{\n\t\t\tcase 'root':\n\t\t\t\treturn null;\n\n\t\t\tcase 'child':\n\t\t\t\treturn $this->target->getKey();\n\n\t\t\tdefault:\n\t\t\t\treturn $this->target->getParentId();\n\t\t}\n\t}" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
// InitDriver returns a new LCOW storage driver.
[ "func InitDriver(dataRoot string, options []string, _, _ []idtools.IDMap) (graphdriver.Driver, error) {\n\ttitle := \"lcowdriver: init:\"\n\n\tcd := filepath.Join(dataRoot, cacheDirectory)\n\tsd := filepath.Join(dataRoot, scratchDirectory)\n\n\td := &Driver{\n\t\tdataRoot: dataRoot,\n\t\toptions: ...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the text about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code:" }
Printable Pseudo Electronic Serial Number. :param number: hexadecimal string >>> print(pesn('1B69B4BA630F34E')) 805F9EF7
[ "def pesn(number, separator=u''):\n '''\n \n '''\n\n number = re.sub(r'[\\s-]', '', meid(number))\n serial = hashlib.sha1(unhexlify(number[:14]))\n return separator.join(['80', serial.hexdigest()[-6:].upper()])" ]
[ "func GetGroup(groupID int) (group *DHGroup, err error) {\n\tif groupID <= 0 {\n\t\tgroupID = 14\n\t}\n\tswitch groupID {\n\tcase 1:\n\t\tp, _ := new(big.Int).SetString(\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E...
codesearchnet
{ "query": "Represent the text about Python programming:", "pos": "Represent the code about Python programming:", "neg": "Represent the code about programming:" }
@param $filename @return \stdClass|null
[ "public function getFileByName($filename)\n {\n $files = $this->getFiles();\n foreach ($files as $file) {\n if ($filename == $file->file) {\n return $file;\n }\n }\n\n return null;\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// NewExtractor creates a new SourceExtractor
[ "func NewExtractor(variable string) (SourceExtractor, error) {\n\tif variable == \"client.ip\" {\n\t\treturn ExtractorFunc(extractClientIP), nil\n\t}\n\tif variable == \"request.host\" {\n\t\treturn ExtractorFunc(extractHost), nil\n\t}\n\tif strings.HasPrefix(variable, \"request.header.\") {\n\t\theader := strings....
[ "@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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
This method has the same effect as by calling get until <code>hasReminder()</code> returns false; @param discard
[ "public void getAll(boolean discard)\r\n {\r\n if (discard)\r\n {\r\n mark = position;\r\n marked = remaining;\r\n }\r\n else\r\n {\r\n marked += remaining;\r\n }\r\n position = (position+remaining) % capacity;\r\n remaining...
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Detects and rewrites renamed columns. @param array &$createdColumns The create columns. @param array &$droppedColumns The dropped columns. @param array &$alteredColumns The altered columns.
[ "private function detectRenamedColumns(array &$createdColumns, array &$droppedColumns, array &$alteredColumns)\n {\n foreach ($createdColumns as $createdIndex => $createdColumn) {\n foreach ($droppedColumns as $droppedIndex => $droppedColumn) {\n $columnDiff = $this->columnCompar...
[ "public function prepare(Mapper $mapper)\n {\n if ($this->isPrepared()) {\n throw new DataSetPreparationException('DataSet is already prepared');\n }\n //Split each row of the dataSet into inputs and outputs based on the mapper and the policies\n //Then re-parse the dataSet...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software Development:" }
Return the content of this block. @return stdClass the content
[ "public function get_content() {\n global $CFG;\n\n require_once($CFG->dirroot.'/calendar/lib.php');\n\n if ($this->content !== null) {\n return $this->content;\n }\n\n $this->content = new stdClass;\n $this->content->text = '';\n $this->content->footer = ...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
==================
[ "@Override\n public <ATTRIBUTE> OptionalThing<ATTRIBUTE> getAttribute(String key, Class<ATTRIBUTE> attributeType) {\n assertArgumentNotNull(\"key\", key);\n final OptionalThing<ATTRIBUTE> foundShared = findAttributeInShareStorage(key, attributeType);\n if (foundShared.isPresent()) {\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 text about Language and Writing:", "pos": "Represent the Github code about Language and Writing:", "neg": "Represent the Github code:" }
Determines if a file entry for a path specification exists. Args: path_spec (PathSpec): a path specification. Returns: bool: True if the file entry exists, false otherwise.
[ "def FileEntryExistsByPathSpec(self, path_spec):\n \n location = getattr(path_spec, 'location', None)\n\n if location is None:\n return False\n\n is_device = False\n if platform.system() == 'Windows':\n # Note that os.path.exists() returns False for Windows device files so\n # instead ...
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// NewUgen is a factory function for creating new Ugen instances. // Panics if rate is not AR, KR, or IR. // Panics if numOutputs <= 0.
[ "func NewUgen(name string, rate int8, specialIndex int16, numOutputs int, inputs ...Input) *Ugen {\n\tCheckRate(rate)\n\n\tif numOutputs <= 0 {\n\t\tpanic(\"numOutputs must be a positive int\")\n\t}\n\t// TODO: validate specialIndex\n\tu := &Ugen{\n\t\tName: name,\n\t\tRate: rate,\n\t\tSpecialIndex:...
[ "function() {\n var isSecondaryImport = this.model.getClockSyncRecordsNamed(\n 'ftrace_importer').length !== 0;\n\n var mSyncs = this.model_.getClockSyncRecordsNamed('monotonic');\n // If this is a secondary import, and no clock syncing records were\n // found, then abort the import. Ot...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// gatherHostportMappings returns all the PortMappings which has hostport for a pod
[ "func gatherHostportMappings(podPortMapping *PodPortMapping) []*PortMapping {\n\tmappings := []*PortMapping{}\n\tfor _, pm := range podPortMapping.PortMappings {\n\t\tif pm.HostPort <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tmappings = append(mappings, pm)\n\t}\n\treturn mappings\n}" ]
[ "public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {\n routes.put(nm, links); // Only one route between two nodes (replace the old route)\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
APIMethod: finishGeometry Finish the geometry and send it back to the control.
[ "function() {\n var index = this.line.geometry.components.length - 1;\n this.line.geometry.removeComponent(this.line.geometry.components[index]);\n this.removePoint();\n this.finalize();\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param string $dir @return SplFileInfo[]|\Iterator
[ "public function getFilesOfDir($dir)\n {\n $iterator = new DirectoryIterator($dir);\n\n $iterator = new CallbackFilterIterator(\n $iterator,\n function (SplFileInfo $current, $key, DirectoryIterator $iterator) {\n return !$iterator->isDot();\n }\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
// Enabled returns if the UI is enabled
[ "func (c *UIConfig) Enabled() bool {\n\tc.l.RLock()\n\tdefer c.l.RUnlock()\n\treturn c.enabled\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(HealthCheckCustomConfig healthCheckCustomConfig, ProtocolMarshaller protocolMarshaller) {\n\n if (healthCheckCustomConfig == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get the search index. @param $create Boolean whether to create the index, if it does not exist (default: _true_) @return An instance of ZendSearch/SearchIndexInterface or null
[ "private function getIndex($create = true) {\n if (!$this->index || $create) {\n $indexPath = $this->getIndexPath();\n\n $analyzer = new LuceneUtf8Analyzer();\n\n // add stop words filter\n $stopWords = $this->getStopWords();\n $stopWordsFilter = new StopWords($stopWords);\n $analyz...
[ "public function initialize() {\n $this->keepSnapshots(true);\n $this->setup(\n array(\n 'exceptionOnFailedSave' => true, //Throw an exception instead of returning false from saves\n 'notNullValidations' => false //Allow empty strings instead of the wtf new \\P...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
InternalSARL.g:9222:1: entryRuleTypeReferenceWithTypeArgs returns [EObject current=null] : iv_ruleTypeReferenceWithTypeArgs= ruleTypeReferenceWithTypeArgs EOF ;
[ "public final EObject entryRuleTypeReferenceWithTypeArgs() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleTypeReferenceWithTypeArgs = null;\n\n\n try {\n // InternalSARL.g:9222:66: (iv_ruleTypeReferenceWithTypeArgs= ruleTypeReferenceWithTypeArgs EOF )\n ...
[ "Rule LocalVariableDeclarationStatement() {\n return Sequence(ZeroOrMore(FirstOf(FINAL, Annotation())), Type(), VariableDeclarators(), SEMI);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about language and writing:" }
Unserialize data collection. @param array $collection @return array
[ "public function unserializeCollection($collection)\n {\n if (is_array($collection)) {\n return array_map(function ($value) {\n return maybe_unserialize(reset($value));\n }, $collection);\n }\n\n return maybe_unserialize($collection);\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Get configuration variable @param $name @param mixed $default @return mixed
[ "public function get($name, $default = null)\n {\n if (is_array($name)) {\n $result = [];\n\n foreach ($name as $key => $value) {\n if (is_int($key)) {\n $result[$value] = $this->_get($value, $default);\n } else {\n ...
[ "public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about NLP:" }
@param $items @param array $options @return string
[ "public static function select( $items, $options = [] ) {\n\t\t$options['tag'] = 'select';\n\t\t$options['item'] = function ( $item, $index ) {\n\t\t\t$itemOptions = [];\n\t\t\tif ( is_array( $item ) ) {\n\t\t\t\t$label = $item['label'];\n $itemOptions['value'] = $item['value'];\n\t\t\t\tif ( ! empty...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get databox CGU's @param integer $databox_id The requested databox @return Response
[ "public function getDatabaseCGU($databox_id)\n {\n return $this->render('admin/databox/cgus.html.twig', [\n 'languages' => $this->app['locales.available'],\n 'cgus' => $this->findDataboxById($databox_id)->get_cgus(),\n 'current_locale' => $this->app['locale'...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Common validations
[ "func (p *ProjectOptions) Validate() error {\n\terrList := []error{}\n\tif p.CheckSelector {\n\t\tif len(p.Selector) > 0 {\n\t\t\tif _, err := labels.Parse(p.Selector); err != nil {\n\t\t\t\terrList = append(errList, errors.New(\"--selector=<project_selector> must be a valid label selector\"))\n\t\t\t}\n\t\t}\n\t\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *StringSource) DeepCopyInto(out *StringSource) {\n\t*out = *in\n\tout.StringSourceSpec = in.StringSourceSpec\n\treturn\n}" ]
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// RunUntil starts a watch and handles watch events. Will restart the watch if it is closed. // RunUntil starts a goroutine and returns immediately. It will exit when stopCh is closed.
[ "func (r *Reflector) RunUntil(stopCh <-chan struct{}) {\n\tgo wait.Until(func() { r.ListAndWatch(stopCh) }, r.period, stopCh)\n}" ]
[ "func (m *Manager) removeProxyServiceLocked(proxyID string) {\n\tstate, ok := m.proxies[proxyID]\n\tif !ok {\n\t\treturn\n\t}\n\n\t// Closing state will let the goroutine we started in Ensure finish since\n\t// watch chan is closed.\n\tstate.Close()\n\tdelete(m.proxies, proxyID)\n\n\t// We intentionally leave poten...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Returns the abc notation string from given input @param {object} input - The parsed input from input file @returns {string}
[ "function convertJsonToAbc(input) {\n var outputData = \"\";\n outputData += \"X:1\\n\";\n if (typeof input.id !== 'undefined') {\n outputData += \"T:\"\n + input.id\n + \"\\n\";\n }\n outputData += \"M:\"\n + input.attributes.time.beats\n + \"/\"\n + input.attributes.time[\"beat-type\"]\...
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Natural Language Processing:" }
Has filter @param string $permission Permission lookup key @return boolean
[ "protected function hasFilter($permission)\n {\n if ($this->cacheHas($permission)\n && true === $this->cache($permission)\n ) {\n return true;\n }\n\n $permissionResult = $this->getPermission($permission);\n\n if ($permissionResult) {\n retu...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Documentation:" }
binds the values of the object obj to the statements parameters
[ "public void bindUpdate(PreparedStatement stmt, ClassDescriptor cld, Object obj) throws java.sql.SQLException\r\n {\r\n if (cld.getUpdateProcedure() != null)\r\n {\r\n this.bindProcedure(stmt, cld, obj, cld.getUpdateProcedure());\r\n }\r\n else\r\n {\r\n i...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Validate validates if BoltConfig is valid
[ "func (bc *BoltConfig) Validate() error {\n\tswitch bc.ContentSharingPolicy {\n\tcase SharingPolicyShared, SharingPolicyIsolated:\n\t\treturn nil\n\tdefault:\n\t\treturn errors.Wrapf(errdefs.ErrInvalidArgument, \"unknown policy: %s\", bc.ContentSharingPolicy)\n\t}\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Send out an event and call it's associated functions :param event: Name of the event to trigger
[ "def emit(self, event, *args, **kwargs):\n \n for func in self._registered_events[event].values():\n func(*args, **kwargs)" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Recursively collects all posted data @param ContainerInterface $container @param array $data
[ "protected function getElementData(\n ContainerInterface $container, &$data = []\n ) {\n foreach ($container as $element) {\n if ($element instanceof InputInterface) {\n $data[$element->getName()] = $element->getValue();\n continue;\n }\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// checkHealth returns a nil error in case it was successful and otherwise // a non-nil error with a meaningful description why the health check failed.
[ "func checkHealth(serverURL *url.URL, backend *BackendConfig) error {\n\treq, err := backend.newRequest(serverURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create HTTP request: %s\", err)\n\t}\n\n\treq = backend.addHeadersAndHost(req)\n\n\tclient := http.Client{\n\t\tTimeout: backend.Options.Timeout,...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Check the retryable exception lists to determine whether the given Exception is retryable.
[ "private boolean isRetryable(Exception e)\r\n\t {\r\n\t final String mName = \"isRetryable\";\r\n\r\n\t String exClassName = e.getClass().getName();\r\n\t \r\n\t boolean retVal = containsException(_retryIncludeExceptions, e) && !containsException(_retryExcludeExceptions, e);\r\n\t \r\n\t if(logge...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Computes the RMS energy of frames
[ "def RMS_energy(frames):\n \"\"\"\"\"\"\n f = frames.flatten()\n return N.sqrt(N.mean(f * f))" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the paths to publish. @param string $provider @param string $group @return array
[ "public static function pathsToPublish( $provider = null, $group = null )\n\t{\n\t\tif ( $provider && $group )\n\t\t{\n\t\t\tif ( empty( static::$publishes[$provider] ) || empty( static::$publishGroups[$group] ) )\n\t\t\t\treturn [];\n\n\t\t\treturn array_intersect_key( static::$publishes[$provider], static::$publi...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// findKubeconfigUser finds the default user for whom we should create a kubeconfig
[ "func (b *KubectlBuilder) findKubeconfigUser() (*fi.User, *fi.Group, error) {\n\tvar users []string\n\tswitch b.Distribution {\n\tcase distros.DistributionJessie, distros.DistributionDebian9:\n\t\tusers = []string{\"admin\", \"root\"}\n\tcase distros.DistributionCentos7:\n\t\tusers = []string{\"centos\"}\n\tdefault...
[ "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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Align circulation with z-axis
[ "def flip_coords(X,loop):\n \n if(loop[0]==1):\n return np.array(map(lambda i: np.array([i[2],i[1],i[0],i[5],i[4],i[3]]),X))\n else:\n return X" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Find and mark current page item. @return void
[ "public function findActiveItem()\n {\n foreach ($this->items as $index => $item) {\n $index++;\n\n if ($item->number == $this->currentPage) {\n $item->active = true;\n }\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Retrieve survey settings {@link https://api.nfieldmr.com/help/api/get-v1-surveys-surveyid-settings}
[ "function getSurveySettings (defOptions, credentials, token, surveyId, callback) {\n \n if (typeof surveyId === 'function') callback = surveyId;\n if (checkRequiredParameter(surveyId)) return Promise.reject(Error(`Missing required parameter 'SurveyId'`)).nodeify(callback);\n \n var options = {\n method : 'G...
[ "def fetch_all_records(self):\n \n \"\"\"\n api = self.doapi_manager\n return map(self._record, api.paginate(self.record_url, 'domain_records'))" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS Route 53:" }
// Helper functions for common node lists. They may be empty.
[ "func walkIdentList(v Visitor, list []*ast.Ident) {\n\tfor i, x := range list {\n\t\twalkToReplace(v, x, func(r ast.Node) {\n\t\t\tlist[i] = r.(*ast.Ident)\n\t\t})\n\t}\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:" }
Marshall the given parameter object.
[ "public void marshall(AddOutputRequest addOutputRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (addOutputRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(addOutputRequest....
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
===============================================================
[ "public void registerService(String serviceName, String instanceName, String devname) throws DevFailed {\n\t\tdatabaseDAO.registerService(this, serviceName, instanceName, devname);\n\t}" ]
[ "public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:...
codesearchnet
{ "query": "Represent the Github sentence about N/A:", "pos": "Represent the Github code about N/A:", "neg": "Represent the Github code about Programming:" }
// ResetExecutionTimeout schedules a Timeout for this Execution. It inspects the // Execution's State to determine which timeout should be set, if any. If no // timeout should be active, this will cancel any existing timeouts for this // Execution.
[ "func ResetExecutionTimeout(c context.Context, e *model.Execution) error {\n\thowLong := time.Duration(0)\n\tswitch e.State {\n\tcase dm.Execution_SCHEDULING:\n\t\thowLong = e.TimeToStart\n\tcase dm.Execution_RUNNING:\n\t\thowLong = e.TimeToRun\n\tcase dm.Execution_STOPPING:\n\t\thowLong = e.TimeToStop\n\t}\n\teid ...
[ "function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Generates the binary excel data @return string @throws CakeException If the excel writer does not exist
[ "protected function output()\n {\n ob_start();\n\n $writer = PHPExcel_IOFactory::createWriter($this->PhpExcel, 'Excel2007');\n\n if (!isset($writer)) {\n throw new Exception('Excel writer not found');\n }\n\n $writer->setPreCalculateFormulas(false);\n $writer-...
[ "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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetEnvironment sets the Environment field's value.
[ "func (s *Build) SetEnvironment(v *ProjectEnvironment) *Build {\n\ts.Environment = 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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Add data at the current position. @param source Source data. @param index The index in the source data. Data from the index is copied. @param length The length of data to copy.
[ "public void put(ByteArray source, int index, int length)\n {\n put(source.mBuffer.array(), index, length);\n }" ]
[ "function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object....
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@SuppressWarnings(\"unchecked\")\r\n\tpublic EList<IfcRelCoversBldgElements> getHasCoverings() {\r\n\t\treturn (EList<IfcRelCoversBldgElements>) eGet(Ifc2x3tc1Package.Literals.IFC_ELEMENT__HAS_COVERINGS, true);\r\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github summarization about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
设置字段列表,用于限制加入的字段的值 @param fieldNames 字段列表 @return 自身
[ "public Entity setFieldNames(String... fieldNames) {\r\n\t\tif (ArrayUtil.isNotEmpty(fieldNames)) {\r\n\t\t\tthis.fieldNames = CollectionUtil.newHashSet(fieldNames);\r\n\t\t}\r\n\t\treturn this;\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 comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
/*~ Returns the descriptor searching upwards the prototype chain.
[ "function descriptorOf(object, name) {\n const descriptor = Object.getOwnPropertyDescriptor(object, name);\n if (descriptor) {\n return descriptor;\n } else {\n const proto = prototypeOf(object);\n if (proto) {\n return descriptorOf(proto, name);\n } else {\n return null;\n }\n }\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Prompts the user to enter new config, using context as a source for the field names and sample values. :param no_input: Prompt the user at command line for manual configuration?
[ "def prompt_for_config(context, no_input=False):\n \n cookiecutter_dict = OrderedDict([])\n env = StrictEnvironment(context=context)\n\n # First pass: Handle simple and raw variables, plus choices.\n # These must be done first because the dictionaries keys and\n # values might refer to them.\n ...
[ "def register_options(cls, register):\n \"\"\"\"\"\"\n super(BundleMixin, cls).register_options(register)\n register('--archive', choices=list(archive.TYPE_NAMES),\n fingerprint=True,\n help='Create an archive of this type from the bundle. '\n 'This option is also d...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Clears the layer.
[ "public void clear()\n {\n if (LienzoCore.get().getLayerClearMode() == LayerClearMode.CLEAR)\n {\n final Context2D context = getContext();\n\n if (null != context)\n {\n context.clearRect(0, 0, getWidth(), getHeight());\n }\n }\n ...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Sends a shutdown signal to the unity environment, and closes the grpc connection.
[ "def close(self):\n \n if self.is_open:\n message_input = UnityMessage()\n message_input.header.status = 400\n self.unity_to_external.parent_conn.send(message_input)\n self.unity_to_external.parent_conn.close()\n self.server.stop(False)\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Look up children in the normal manner, but then customize them for the authenticated user if they support the L{ICustomizable} interface. If the user is attempting to access a private URL, redirect them.
[ "def locateChild(self, ctx, segments):\n \n result = self._getAppStoreResource(ctx, segments[0])\n if result is not None:\n child, segments = result, segments[1:]\n return child, segments\n\n if segments[0] == '':\n result = self.child_(ctx)\n ...
[ "def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Language and programming:" }
// Convert_kops_ClusterList_To_v1alpha1_ClusterList is an autogenerated conversion function.
[ "func Convert_kops_ClusterList_To_v1alpha1_ClusterList(in *kops.ClusterList, out *ClusterList, s conversion.Scope) error {\n\treturn autoConvert_kops_ClusterList_To_v1alpha1_ClusterList(in, out, s)\n}" ]
[ "func Version(url string, kvdbOptions map[string]string) (string, error) {\n\t// Currently we support only v1\n\treturn kvdb.ConsulVersion1, nil\n}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about consul address:" }
Activates a setting @param $key @param null|string $section @return bool
[ "public function activate($key, $section = null)\n {\n if (is_null($section)) {\n $pieces = explode('.', $key);\n $section = $pieces[0];\n $key = $pieces[1];\n }\n return $this->model->activateSetting($section, $key);\n }" ]
[ "private function preconfigured() {return dfc($this, function() {\n\t\t$s = $this->s(); /** @var S $s */\n\t\t/** @var string $key */\n\t\t$key = 'actionFor' . (df_customer_is_new($this->o()->getCustomerId()) ? 'New' : 'Returned');\n\t\t/** @var string $result */\n\t\treturn $s->v($key, null, function() use($s) {re...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Fetches a specific attribute or the whole attribute for an object @param obj @param attr @returns {*}
[ "function getAttr(obj, attr) {\n if (!obj) { return; }\n\n if (Array.isArray(obj)) {\n obj = obj[0];\n }\n\n return (attr && obj['@']) ? obj['@'][attr] : obj['@'];\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:" }
Parses an entire document.
[ "protected function parseDocument()\n {\n $line = $this->readLine();\n\n // BOM is ZERO WIDTH NO-BREAK SPACE (U+FEFF).\n // It's 0xEF 0xBB 0xBF in UTF-8 hex.\n if (3 <= strlen($line)\n && 0xef === ord($line[0])\n && 0xbb === ord($line[1])\n && 0xbf ===...
[ "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 post about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code:" }
获取在线用户的详细连接信息 <br> Map.key 为 SNCP节点地址, 含值为null的key表示没有分布式 Map.value 为 用户客户端的IP @param userid Serializable @return 地址集合
[ "public CompletableFuture<Map<InetSocketAddress, List<String>>> getRpcNodeWebSocketAddresses(final Serializable userid) {\r\n CompletableFuture<Collection<InetSocketAddress>> sncpFuture = getRpcNodeAddresses(userid);\r\n return sncpFuture.thenCompose((Collection<InetSocketAddress> addrs) -> {\r\n ...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// MustFloat32 gets data float32 type
[ "func (c *secureCookies) MustFloat32(key string, defaults ...float32) float32 {\n\tck, err := c.req.Cookie(key)\n\tif err != nil {\n\t\tif len(defaults) > 0 {\n\t\t\treturn defaults[0]\n\t\t}\n\t\treturn 0\n\t}\n\ts := parseSecureCookie(c.secret, ck.Value)\n\tv, err := strconv.ParseFloat(s, 32)\n\tif len(defaults) ...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
[get description]. @return array
[ "public function get()\n {\n $m = $this->model;\n if (!$m) {\n throw $this->exception('Specify model_class or define your method handlers');\n }\n\n if ($m->loaded()) {\n if (!$this->allow_list_one) {\n throw $this->exception('Loading is not allowe...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Throw decoy cookies at session start which are configured exactly as the session cookie. This doesn't contribute in pure security measures, but contribute in hiding server footprints and add a little more confusion to the overall communication.
[ "public function throwDecoys()\n {\n $params = session_get_cookie_params();\n $len = strlen(session_id());\n foreach ($this->decoys as $decoy) {\n $value = Cryptography::randomString($len);\n setcookie(\n $decoy,\n $value,\n ...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(ExtendedS3DestinationConfiguration extendedS3DestinationConfiguration, ProtocolMarshaller protocolMarshaller) {\n\n if (extendedS3DestinationConfiguration == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
-------------------------------------------------------------------------
[ "private Boolean toBoolean(Object value) {\n\t\tif (value == null) {\n\t\t\treturn null;\n\t\t} else if (value instanceof Boolean) {\n\t\t\treturn (Boolean) value;\n\t\t} else if (value instanceof String) {\n\t\t\treturn Boolean.parseBoolean((String) value);\n\t\t} else if (value instanceof Short) {\n\t\t\treturn (...
[ "protected static function showVersion()\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%y+----------------------------------------------------------------------+%N'));\n \\cli\\line(\\cli\\Colors::colorize('%y| Welcome to Doozr\\'s Demo project installer. ...
codesearchnet
{ "query": "Represent the Github description about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Find missing dependencies of a Python package. :param requirement: A :class:`.Requirement` object. :returns: A list of strings with system package names.
[ "def find_missing_dependencies(self, requirement):\n \n known_dependencies = self.find_known_dependencies(requirement)\n if known_dependencies:\n installed_packages = self.find_installed_packages()\n logger.debug(\"Checking for missing dependencies of %s ..\", requirement....
[ "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 instruction about Logistics:", "pos": "Represent the code about Logistics:", "neg": "Represent the code:" }
Set field of an option to a given value.
[ "public void set(SourceCodeLocation sourceCodeLocation, String name, Value value) {\n if (name.length() > 1) {\n int dot;\n if (name.charAt(0) == LPAREN) {\n int start = name.indexOf(RPAREN);\n dot = name.indexOf(DOT, start);\n } else {\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Find common give names of females. @param int $threshold @param int $maxtoshow @return string
[ "public function commonGivenFemaleTable(int $threshold = 1, int $maxtoshow = 10): string\n {\n return $this->commonGivenQuery('F', 'table', false, $threshold, $maxtoshow);\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:" }