query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Start piping data from input to output.
@param name pipe name
@return pipe instance | [
"public synchronized Pipe start( final String name )\n {\n if( null == m_pump && null != m_in && null != m_out )\n {\n // might re-use a pump\n m_pump = startPump( m_in );\n m_pump.setName( name );\n m_pump.connect( m_out );\n }\n return thi... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
r"""Each comma, semicolon or colon should be followed by whitespace.
Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}] | [
"def missing_whitespace(logical_line):\n \n \"\"\"\n line = logical_line\n for index in range(len(line) - 1):\n char = line[index]\n if char in ',;:' and line[index + 1] not in WHITESPACE:\n before = line[:index]\n if char == ':' and before.count('[') > before.count('... | [
"def main():\n \"\"\n\n actions = \"\"\"\n {LWIN}\n {PAUSE .25}\n r\n {PAUSE .25}\n Notepad.exe{ENTER}\n {PAUSE 1}\n Hello{SPACE}World!\n {PAUSE 1}\n %{F4}\n {PAUSE .25}\n n\n \"\"\"\n SendKeys(actions, pause = .1)\n\n k... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the Corporation Wallet Divisions for a Corporation.
@param $corporation_id
@return mixed | [
"public function getCorporationWalletDivisions(int $corporation_id): Collection\n {\n\n return CorporationDivision::where('corporation_id', $corporation_id)\n ->where('type', 'wallet')\n ->orderBy('division')\n ->get();\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// cancelRunningRollouts cancels existing rollouts when the latest deployment does not
// exists yet to allow new rollout superceded by the new config version. | [
"func (c *DeploymentConfigController) cancelRunningRollouts(config *appsv1.DeploymentConfig, existingDeployments []*v1.ReplicationController, cm *RCControllerRefManager) error {\n\tawaitingCancellations := false\n\tfor i := range existingDeployments {\n\t\tdeployment := existingDeployments[i]\n\t\t// Skip deploymen... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly
@private | [
"function(datasetIndex) {\n\t\tvar ringWeightOffset = 0;\n\n\t\tfor (var i = 0; i < datasetIndex; ++i) {\n\t\t\tif (this.chart.isDatasetVisible(i)) {\n\t\t\t\tringWeightOffset += this._getRingWeight(i);\n\t\t\t}\n\t\t}\n\n\t\treturn ringWeightOffset;\n\t}"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Makes a reverse geocoding
@param LatLng $coord
@param array $params parameters for the request. These override [GeocodingRequest::params].
@return mixed|null | [
"public function reverse(LatLng $coord, $params = [])\n {\n $params['latlng'] = $coord->__toString();\n\n $this->params = ArrayHelper::merge($this->params, $params);\n\n return parent::request();\n }"
] | [
"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 Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Documentation:"
} |
If request was with auth token, returned data is encrypted, otherwise it's plain ol' json | [
"function prepareResponse(response) {\n Safe.log('Received response: ', response);\n return response.text().then(function(text) {\n // If we get a 2xx...\n Safe.log('Launcher returned status '+response.status);\n if (response.ok) {\n // If not an authorized request, or not encrypted, no decryption n... | [
"def get(resource, params: {}, key: Steam.apikey)\n params[:key] = key\n response = @conn.get resource, params\n JSON.parse(response.body)\n rescue JSON::ParserError\n # If the steam web api returns an error it's virtually never in json, so\n # lets pretend that we're getting some sort... | codesearchnet | {
"query": "Represent the sentence about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about Programming:"
} |
/*[deutsch]
Erzeugt eine {@code CalendarPeriod} für die angegebene Quartalsspanne.
@param q1 first quarter year
@param q2 last quarter year (inclusive)
@return CalendarPeriod | [
"public static CalendarPeriod<CalendarQuarter> between(\n CalendarQuarter q1,\n CalendarQuarter q2\n ) {\n\n return new FixedCalendarPeriod<>(q1, q2, FixedCalendarTimeLine.forQuarters());\n\n }"
] | [
"@Given(\"ich habe eine Aktion mit dem Symbol $sümbol und eine Schwelle von $threshold\")\n public void aStock(@Named(\"sümbol\") String symbol, @Named(\"threshold\") double threshold) {\n stock = new Stock(symbol, threshold);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Create CSS style (PHPExcel_Style_Fill)
@param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill
@return array | [
"private function createCSSStyleFill(PHPExcel_Style_Fill $pStyle)\n {\n // Construct HTML\n $css = array();\n\n // Create CSS\n $value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ?\n 'white' : '#' . $pStyle->getStartColor()->getRGB();\n $css['backgroun... | [
"public function setBorderBottom(PHPRtfLite_Border_Format $borderFormat)\n {\n $borderFormat->setColorTable($this->_rtf->getColorTable());\n $this->_borderBottom = $borderFormat;\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
calculate cardinality, total and average string length | [
"def __learn_oneself(self):\r\n \"\"\"\"\"\"\r\n if not self.__parent_path or not self.__text_nodes:\r\n raise Exception(\"This error occurred because the step constructor\\\r\n had insufficient textnodes or it had empty string\\\r\n for... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Remove children
@param \Fulgurio\LightCMSBundle\Entity\Page $children | [
"public function removeChild(\\Fulgurio\\LightCMSBundle\\Entity\\Page $children)\n {\n $this->children->removeElement($children);\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the initialized product controller
@param \Aimeos\MW\View\Iface $view View instance
@return \Aimeos\Controller\Frontend\Product\Iface Initialized product controller | [
"protected function getController( \\Aimeos\\MW\\View\\Iface $view )\n\t{\n\t\t$context = $this->getContext();\n\t\t$cntl = \\Aimeos\\Controller\\Frontend::create( $context, 'product' );\n\n\t\t/** client/jsonapi/product/levels\n\t\t * Include products of sub-categories in the product list of the current category\n... | [
"public function getTree( $level = \\Aimeos\\MW\\Tree\\Manager\\Base::LEVEL_TREE )\n\t{\n\t\treturn $this->controller->getTree( $level );\n\t}"
] | codesearchnet | {
"query": "Represent the description about Aimeos:",
"pos": "Represent the code about Aimeos:",
"neg": "Represent the code about Computer Science:"
} |
Creates the outline page used with this editor.
@return the created Java outline page | [
"protected VdmContentOutlinePage createOutlinePage() {\n\t\t// VdmContentOutlinePage page= new\n\t\t// VdmContentOutlinePage(fOutlinerContextMenuId, this);\n\t\tVdmContentOutlinePage page = new VdmContentOutlinePage(this);\n\t\tsetOutlinePageInput(page, getEditorInput());\n\t\tpage.addSelectionChangedListener(creat... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Flatten nested sequences into one. | [
"def flatten(*sequence):\n \"\"\"\"\"\"\n result = []\n for entry in sequence:\n if isinstance(entry, list):\n result += Select.flatten(*entry)\n elif isinstance(entry, tuple):\n result += Select.flatten(*entry)\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
:param config:
:type config: yowsup.config.base.config.Config
:return:
:rtype: bytes | [
"def serialize(self, config):\n \n for transform in self._transforms:\n config = transform.transform(config)\n return config"
] | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Send a string of data followed by a newline symbol | [
"def send_data(str)\n if !connected?\n if !@socket.nil? && @reconnect == false\n raise Munin::ConnectionError, \"Not connected.\"\n else\n open\n end\n end\n\n begin\n with_timeout { @socket.puts(\"#{str.strip}\\n\") }\n rescue Timeout::Error\n ... | [
"def generate_optimized_y_move_down_x_SOL(y_dist):\n \n\n # Optimization to move N lines and go to SOL in one command. Note that some terminals \n # may not support this so we might have to remove this optimization or make it optional \n # if that winds up mattering for terminals we care about. If we ha... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the value for the given field or null
@param field field to check
@return value or null | [
"public String getValue(final String field)\n {\n FieldValue fieldValue = Iterables.find\n (\n fieldValues,\n new Predicate<FieldValue>()\n {\n @Override\n public boolean apply(FieldValue fv)\n {\n retu... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Execute the console command.
@return void | [
"public function handle()\n {\n $fullPath = $this->createBaseMigration();\n\n $this->files->put($fullPath, $this->files->get(__DIR__ .DS .'stubs' .DS .'database.stub'));\n\n $this->info('Migration created successfully!');\n\n $this->call('optimize');\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param null $vendor_name
@param null $vendor_id
@param null $success
@param null $errors
@return array | [
"public static function buildResultDataDefault(\n $vendor_name = null,\n $vendor_id = null,\n $success = null,\n $errors = null\n ) {\n return [\n self::P_RESULT_DATA_VENDOR_NAME => $vendor_name,\n self::P_RESULT_DATA_VENDOR_ID => $vendor_id,\n ... | [
"public function createMessage(DataObject $object, $identifier)\n {\n $this->changeMessage(sprintf('Creating %s.%s', get_class($object), $identifier), 'created');\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Passes the signal over to the Dispatcher
@Flow\AfterReturning("methodAnnotatedWith(Neos\Flow\Annotations\Signal)")
@param JoinPointInterface $joinPoint The current join point
@return void | [
"public function forwardSignalToDispatcher(JoinPointInterface $joinPoint)\n {\n $signalName = lcfirst(str_replace('emit', '', $joinPoint->getMethodName()));\n $this->dispatcher->dispatch($joinPoint->getClassName(), $signalName, $joinPoint->getMethodArguments());\n }"
] | [
"public function routeByObject($object) : array\n {\n Assert::isObject($object, \"Passed non object value to Commmand Bus: \" . TypeDescriptor::createFromVariable($object)->toString() . \". Did you wanted to use convertAndSend?\");\n\n $className = get_class($object);\n if (!array_key_exists... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
/*!
Verify that we have a valid currency before the the order can continue. | [
"function checkCurrency( $orderID )\n {\n $returnStatus = array( 'status' => eZModuleOperationInfo::STATUS_CONTINUE );\n $order = eZOrder::fetch( $orderID );\n $productCollection = $order->attribute( 'productcollection' );\n $currencyCode = $productCollection->attribute( 'currency_cod... | [
"function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// String returns all fields listed as a human readable string.
// Conveniently, exactly the format that ParseSelector takes. | [
"func (ls Set) String() string {\n\tselector := make([]string, 0, len(ls))\n\tfor key, value := range ls {\n\t\tselector = append(selector, key+\"=\"+value)\n\t}\n\t// Sort for determinism.\n\tsort.StringSlice(selector).Sort()\n\treturn strings.Join(selector, \",\")\n}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the description about Redis command documentation:",
"pos": "Represent the code about Redis command documentation:",
"neg": "Represent the code about programming:"
} |
Print the terraform outputs. | [
"def _show_outputs(self):\n \n outs = self._get_outputs()\n print(\"\\n\\n\" + '=> Terraform Outputs:')\n for k in sorted(outs):\n print('%s = %s' % (k, outs[k]))"
] | [
"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 summarization about computer science:",
"pos": "Represent the code about computer science:",
"neg": "Represent the code:"
} |
Filter query based on given value
@see \Zend\Filter\FilterInterface::filter() | [
"public function filter($value, SolrDisMaxQuery $query = null, Facets $facets = null)\n {\n if (null === $query) {\n throw new DomainException('$query must not be null');\n }\n \n if (null === $facets) {\n throw new DomainException('$facets must not be null');\n ... | [
"public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// evalInt evals PERIOD_ADD(P,N).
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_period-add | [
"func (b *builtinPeriodAddSig) evalInt(row chunk.Row) (int64, bool, error) {\n\tp, isNull, err := b.args[0].EvalInt(b.ctx, row)\n\tif isNull || err != nil {\n\t\treturn 0, true, err\n\t}\n\n\tif p == 0 {\n\t\treturn 0, false, nil\n\t}\n\n\tn, isNull, err := b.args[1].EvalInt(b.ctx, row)\n\tif isNull || err != nil {... | [
"public function formatSQL($sql = '')\n {\n // Reserved SQL Keywords Data\n $reserveSqlKey = 'select|insert|update|delete|truncate|drop|create|add|except|percent|all|exec|plan|alter|execute|precision|and|exists|primary|any|exit|print|as|fetch|proc|asc|file|procedure|authorization|fillfactor|public|... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Sets the element list, and updates the parent of each element.
Replaces any existing elements.
@param elements the element list. Can be {@code null}. | [
"public void setElements(List<ObjectProperty> elements) {\n if (elements == null) {\n this.elements = null;\n } else {\n if (this.elements != null)\n this.elements.clear();\n for (ObjectProperty o : elements)\n addElement(o);\n }\n ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about programming:"
} |
[START run_asset_discovery] | [
"static void runAssetDiscovery(OrganizationName organizationName) {\n try (SecurityCenterClient client = SecurityCenterClient.create()) {\n // Call the API. Note calls to runAssetDiscovery are throttled if too many requests\n // are made.\n OperationFuture<Empty, Empty> result = client.runAssetDi... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns PayPal IPN host.
@return string | [
"public function getPayPalIpnHost()\n {\n if (empty($this->payPalIpnHost)) {\n $this->payPalIpnHost = self::OEPAYPAL_IPN_HOST;\n }\n\n return $this->payPalIpnHost;\n }"
] | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get environment variables for the container.
@return The environment variables. | [
"public Map<String, String> containerEnv() {\n final Map<String, String> env = Maps.newHashMap(envVars);\n\n // Put in variables that tell the container where it's exposed\n for (final Entry<String, Integer> entry : ports.entrySet()) {\n env.put(\"HELIOS_PORT_\" + entry.getKey(), host + \":\" + entry.... | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Ask a question to the user and then remove the question & answer.
@param InputInterface $input
@param OverwritableOutputInterface $output
@param Question $question
@return mixed|string The user answer | [
"public function askThenRemove(InputInterface $input, OverwritableOutputInterface $output, Question $question)\n {\n // Following suit of ask().\n if (!$input->isInteractive()) {\n return $question->getDefault();\n }\n\n $this->remove = true;\n $this->question = $que... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
clear all layers
@method
@memberof Kinetic.Stage.prototype | [
"function() {\n var layers = this.children,\n len = layers.length,\n n;\n\n for(n = 0; n < len; n++) {\n layers[n].clear();\n }\n return this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Tokens implements the APITokener interface. This is the only implementer, but it's
// a pretty unusual case --- the provisioned device is giving us, the provisionee,
// a session and CSRF token to use for the server. | [
"func (e *Kex2Provisionee) Tokens() (token, csrf string) {\n\treturn string(e.sessionToken), string(e.csrfToken)\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 Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
获得表单规则
@return array
@throws FormBuilderException | [
"public function getRules()\n {\n $rules = [];\n $fields = [];\n foreach ($this->fields as $field) {\n $component = $this->components[$field];\n if (!($component instanceof FormComponentDriver))\n continue;\n $field = $component->getField();\n ... | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
synchronized so that concurrent (read-only) accessors don't mess the internal state. | [
"private synchronized void sortCells()\n {\n if (isSorted)\n return; // Just sorted by a previous call\n\n Comparator<Cell> comparator = reversed\n ? getComparator().columnReverseComparator()\n : getComparator().column... | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GetRoleMaskFromMSPRoles Receive a list of roles to combine in a single bitmask | [
"func getRoleMaskFromMSPRoles(roles []*m.MSPRole) int {\n\tmask := 0\n\tfor _, role := range roles {\n\t\tmask = mask | getIdemixRoleFromMSPRole(role)\n\t}\n\treturn mask\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Updates the TPS. | [
"public void update() {\n final long time = System.currentTimeMillis();\n elapsedTime += time - lastUpdateTime;\n lastUpdateTime = time;\n frameCount++;\n if (elapsedTime >= 1000) {\n tps = frameCount;\n frameCount = 0;\n elapsedTime = 0;\n ... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Unserialize a message from the given input stream | [
"public static AbstractMessage unserializeFrom( RawDataBuffer rawIn , boolean asInternalCopy )\n {\n \tint size = rawIn.readInt();\n \t\n \t// Extract a sub buffer\n \tRawDataBuffer rawMessage = new RawDataBuffer(rawIn.readBytes(size));\n byte type = rawMessage.readByte(); \n AbstractMe... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the comment about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code:"
} |
Returns a Cells RDD from a HDFS or S3 ExtractorConfig.
@param config ExtractorConfig for HDFS or S3.
@return RDD of Cells.
@throws IllegalArgumentException | [
"public RDD textFile(ExtractorConfig<Cells> config) throws IllegalArgumentException {\n if(ExtractorConstants.HDFS.equals(config.getExtractorImplClassName())) {\n return createHDFSRDD(config);\n } else if(ExtractorConstants.S3.equals(config.getExtractorImplClassName())) {\n retur... | [
"@Override\n public List<SearchResult> searchInInvertedIndex(String columnFamilyName, EntityMetadata m,\n Map<Boolean, List<IndexClause>> indexClauseMap) {\n throw new UnsupportedOperationException(\"Support available only for thrift/pelops.\");\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Delete removes the current key/value under the cursor from the bucket.
// Delete fails if current key/value is a bucket or if the transaction is not writable. | [
"func (c *Cursor) Delete() error {\n\tif c.bucket.tx.db == nil {\n\t\treturn ErrTxClosed\n\t} else if !c.bucket.Writable() {\n\t\treturn ErrTxNotWritable\n\t}\n\n\tkey, _, flags := c.keyValue()\n\t// Return an error if current value is a bucket.\n\tif (flags & bucketLeafFlag) != 0 {\n\t\treturn ErrIncompatibleValue... | [
"boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ... | codesearchnet | {
"query": "Represent the Github post about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about programming:"
} |
Configure filters | [
"public function buildFilters()\n {\n $this->addFilter('title', new StringFilterType('title'), 'article.page.list.filter.title')\n ->addFilter('online', new BooleanFilterType('online'), 'article.page.list.filter.online')\n ->addFilter('created', new DateFilterType('created', 'nv'), '... | [
"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:"
} |
Send the API request.
@param mixed $data
@return RestCompletePurchaseResponse | [
"public function sendData($data)\n {\n $httpResponse = $this->sendRequest(\n 'get',\n '/orders/' . $data['transactionId']\n );\n\n $this->response = new RestCompletePurchaseResponse(\n $this,\n json_decode($httpResponse->getBody()->getContents(), t... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Plots the distribution of the data and Nbest distribution | [
"def summary(self, Nbest=5, lw=2, plot=True):\n \n if plot:\n pylab.clf()\n self.hist()\n self.plot_pdf(Nbest=Nbest, lw=lw)\n pylab.grid(True)\n\n Nbest = min(Nbest, len(self.distributions))\n try:\n names = self.df_errors.sort_value... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Use {@link #getScriptVariablesMap()} instead. | [
"@java.lang.Deprecated\n public java.util.Map<java.lang.String, java.lang.String> getScriptVariables() {\n return getScriptVariablesMap();\n }"
] | [
"@Override\n @Deprecated\n public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {\n throw new UnsupportedOperationException(\"Use `execute(parameters, body, output)`\");\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Gets allowable values of the enum
@return string[] | [
"public function getSecondPartyTypeAllowableValues()\n {\n return [\n self::SECOND_PARTY_TYPE_CHARACTER,\n self::SECOND_PARTY_TYPE_CORPORATION,\n self::SECOND_PARTY_TYPE_ALLIANCE,\n self::SECOND_PARTY_TYPE_FACTION,\n self::SECOND_PARTY_TYPE_SYSTEM,\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the controllers annotations reader dependency.
@return \Asgard\Http\AnnotationReader | [
"public function getControllersAnnotationReader() {\n\t\t$AnnotationReader = new \\Asgard\\Http\\AnnotationReader;\n\t\tif($this->getCache())\n\t\t\t$AnnotationReader->setCache($this->getCache());\n\t\t$AnnotationReader->setDebug($this->getConfig()['debug']);\n\t\treturn $AnnotationReader;\n\t}"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Does the same like generateProcessingTypesIfNotExist but overrides any existing type classes.
Use this method with care.
@param string $dbname
@param string $table
@param Connection $connection
@return array | [
"private function replaceProcessingTypes($dbname, $table, Connection $connection)\n {\n $dbNsName = $this->titleize($dbname);\n $rowClassName = $this->titleize($table);\n $collectionClassName = $rowClassName . \"Collection\";\n $namespace = 'Prooph\\Link\\Application\\DataType\\SqlCon... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
firstPassReferences | [
"function canResolve (reference, components) {\n const refParts = findParts(reference)\n return components[refParts[0]] &&\n ((refParts.length === 2) || (refParts.length === 3))\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Declination of words.
@param $number
@param $suffix
@return mixed | [
"static public function declination($number, $suffix)\n {\n $keys = array(2, 0, 1, 1, 1, 2);\n $mod = $number % 100;\n $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)];\n return $suffix[$suffix_key];\n }"
] | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
/*
setup_account_integration()
Create, upload and store the Heroku SSH key.
<api_key> Heroku API key.
<callback> function callback with args error, response, body. | [
"function setup_account_integration(api_key, callback) {\n var keyname = \"/tmp/heroku-key-\" + Math.floor(Math.random() * 1024 * 1024);\n\n Step(\n // Create keypair\n function() {\n console.log(\"Generating Heroku SSH keypair\");\n ssh.generate_keypair(keyname, this);\n },\n function(code)... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Reset the files list, before build another part
@return void
@since 1.0 | [
"public function resetFiles()\n\t{\n\t\tself::$backendFiles = array();\n\t\tself::$backendLanguageFiles = array();\n\t\tself::$frontendFiles = array();\n\t\tself::$frontendLanguageFiles = array();\n\t\tself::$mediaFiles = array();\n\t}"
] | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Perform message extraction.
@param mixed $subscriber_id
@param int $limit
@param int $mode one of: self::GET_DELETE, self::GET_RESERVE or self::GET_PEEK
@return models\DbMessage[]
@throws \yii\db\Exception | [
"protected function receiveInternal($subscriber_id = null, $limit = -1, $mode = self::GET_RESERVE)\n {\n $primaryKey = models\\DbMessage::primaryKey();\n $trx = models\\DbMessage::getDb()->transaction !== null ? null : models\\DbMessage::getDb()->beginTransaction();\n $messages = models\\DbM... | [
"protected function showExceptionUser (\\Exception $exception)\n {\n // todo set HTTP status and constant\n $this->lang = new Lang(get_class ());\n\n ShowError ($this->lang->getMessage ('BBC_COMPONENT_CATCH_EXCEPTION'));\n }"
] | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Software development:"
} |
Extract class name.
@param fullName the full name
@return the string | [
"public static String extractClassName(String fullName) {\n\t\tint l = fullName.lastIndexOf(\".\");\n\n\t\treturn fullName.substring(l + 1);\n\t}"
] | [
"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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Processes configuration
@param array $configuration | [
"protected function processConfigurationTraitUpload(&$configuration)\n {\n //check parameters\n if(!isset($configuration['subjects'][$this->name]['Upload']) || empty($configuration['subjects'][$this->name]['Upload'])) {\n throw new \\Exception(sprintf('missing Upload fields definitions i... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the fields displayed by the resource.
@param \Illuminate\Http\Request $request
@return array | [
"public function fields(Request $request)\n {\n return array_merge([\n Sortable::make('Sort', 'id'),\n MorphTo::make('Repeatable')->types(array_wrap(static::getMorphToArray()))->onlyOnDetail(),\n Text::make('Name'),\n Polymorphic::make('Type')->types($request, $... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Initialize a new `Request` with the given `method` and `url`.
@param {String} method
@param {String} url
@api public | [
"function Request (method, url) {\n var self = this\n Emitter.call(this)\n this._query = this._query || []\n this.method = method\n this.url = url\n this.header = {}\n this._header = {}\n this.on('end', function (){\n var err = null\n var res = null\n\n t... | [
"function define(File, utils) {\n return class JSONFile extends File {\n /**\n * Constructor\n * @param {String} id\n * @param {String} filepath\n * @param {Object} options\n * - {Function} buildFactory\n * - {Object} fileCache\n * - {Object} fileExtensions\n * - {Function} f... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// Retrieves current Aurora leader from ZK. | [
"func LeaderFromZK(cluster Cluster) (string, error) {\n\treturn LeaderFromZKOpts(ZKEndpoints(strings.Split(cluster.ZK, \",\")...), ZKPath(cluster.SchedZKPath))\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Get the appropriate choices using the choiceCallback.
Used internally by the command service. Not intended to be overridden or called
externally. | [
"function(items, handler, userData) {\n\t\t\tif (this.choiceCallback) {\n\t\t\t\treturn this.choiceCallback.call(handler, items, userData);\n\t\t\t}\n\t\t\treturn null;\n\t\t}"
] | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Assert that the email that has been sent has the given properties.
@Then an email with the following properties should have been sent: | [
"public function assertEmailSentWithProperties(TableNode $table) {\n $last_mail = $this->getLastEmail();\n foreach ($table->getRowsHash() as $name => $value) {\n Assert::keyExists($last_mail, $name);\n Assert::eq($last_mail[$name], $value);\n }\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Splits the id and the content for each application identifiers (AIs).
@param string $text
@param int $cmpt
@return bool | [
"private function parseContent($text) {\r\n /* $yAlreadySet has 3 states: */\r\n /* null: There is no variable in the ID; true: the variable is already set; false: the variable is not set yet; */\r\n $content = null;\r\n $yAlreadySet = null;\r\n $realNameId = null;\r\n $sep... | [
"def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Copy a directory from one location to another.
@param string $directory
@param string $destination
@param bool $force
@return bool | [
"public function copyDirectory($directory, $destination)\n {\n if (! $this->isDirectory($directory)) {\n return false;\n }\n\n if (! $this->files->isDirectory($destination)) {\n $this->makeDirectory($destination, 0777, true);\n }\n\n $items = new Filesyste... | [
"private function show($process, $extra)\n {\n $path = $this->name($extra);\n\n $this->title('New View command :');\n //\n if ($process == 1) {\n $this->info(\"\\nThe view was created\");\n $this->comment(\" -> Path : resources/views/$path\\n\");\n } elsei... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public String convertIfcElementAssemblyTypeEnumToString(EDataType eDataType, Object instanceValue) {\r\n\t\treturn instanceValue == null ? null : instanceValue.toString();\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 comment about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Batch update models using the attrs names of the first model in modelList.
Ensure all the models can use the same sql as the first model. | [
"public int[] batchUpdate(List<? extends Model> modelList, int batchSize) {\r\n \tif (modelList == null || modelList.size() == 0)\r\n \t\treturn new int[0];\r\n \t\r\n \tModel model = modelList.get(0);\r\n \tTable table = TableMapping.me().getTable(model.getClass());\r\n \tString[] pKeys = table.g... | [
"def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d... | codesearchnet | {
"query": "Represent the Github comment about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about Software Development:"
} |
Set attributes.
:param obj: requested object.
:param attributes: dictionary of {attribute: value} to set | [
"def set_attributes(self, obj, **attributes):\n \n\n attributes_url = '{}/{}/attributes'.format(self.session_url, obj.ref)\n attributes_list = [{u'name': str(name), u'value': str(value)} for name, value in attributes.items()]\n self._request(RestMethod.patch, attributes_url, headers={'Co... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
指定字段的值+1
@param string $key 操作的key user-id-1
@param int $val
@param string $field 要改变的字段
@param mixed $tablePrefix 表前缀 不传则获取配置中配置的前缀
@return bool | [
"public function increment($key, $val = 1, $field = null, $tablePrefix = null)\n {\n list($tableName, $condition) = $this->parseKey($key, true);\n if (is_null($field) || empty($tableName) || empty($condition)) {\n $this->clearBindParams();\n return false;\n }\n $... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Register a squashed change to a particular path
Args:
path (list): The path of what has changed, relative from Block
data (object): The new data | [
"def add_squashed_change(self, path, data):\n # type: (List[str], Any) -> None\n \n assert self._squashed_count, \"Called while not squashing changes\"\n self._squashed_changes.append([path[1:], data])"
] | [
"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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
/*
Runs the position algorithm on the given graph with the configuration
set in the instance of the position algorithm. | [
"function graph(g) {\n init(g);\n\n var xs = [upperLeft(g), upperRight(g), lowerRight(g), lowerLeft(g)];\n\n g.nodes().forEach(function(u) {\n var xArray = [];\n for (var i = 0; i < xs.length; ++i) {\n xArray.push(xs[i][u]);\n }\n xArray.sort();\n g.node(u).x = (xArray[1] + ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Controller filter to process to the authentication.
@param mixed $route
@param Request $request
@return void|Response | [
"public function processAuthentication($route, $request)\n {\n if (\\App::isDownForMaintenance()) {\n return $this->jsonErrorResponse(\"We're currently down for maintenance.\", 503);\n }\n\n $user = null;\n\n try {\n $credentials = array(\n 'login'... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Create posttype.
@param \Assely\Contracts\Singularity\Model\ModelInterface $model
@return \Assely\Posttype\PosttypeSingularity | [
"public function create(ModelInterface $model)\n {\n $posttype = $this->container->make(PosttypeSingularity::class);\n\n $posttype\n ->setModel($model)\n ->boot();\n\n return $posttype;\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Determines whether this {@link Mention} contains the specified {@link Mention}
@param mention
@return <code>true</code> if this {@link Mention} contains the specified {@link Mention}, <code>false</code> otherwise | [
"public boolean contains(Mention mention)\r\n {\r\n return sentence.equals(mention.sentence) && start <= mention.start && end >= mention.end;\r\n }"
] | [
"public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about writing:"
} |
Extract known columns and save the rest as attributes.
@param mixed $level
@param string $message
@param array $context
@return null|void | [
"public function log($level, $message, array $context = []) {\n $realMessage = rtrim(static::interpolate($message, $context), \"\\n\");\n $levelC = strtoupper(substr($level,0,1));\n $realMessage = sprintf(\"[ %1s ] %s\\n\", $levelC, $realMessage);\n\n fwrite($this->fr, $realMessage);\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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Cancel transfers for segments we no longer own.
@param removedSegments segments to be cancelled | [
"protected void cancelTransfers(IntSet removedSegments) {\n synchronized (transferMapsLock) {\n List<Integer> segmentsToCancel = new ArrayList<>(removedSegments);\n while (!segmentsToCancel.isEmpty()) {\n int segmentId = segmentsToCancel.remove(0);\n List<InboundTransferTa... | [
"def ObjectInitializedEventHandler(analysis, event):\n \n\n # Initialize the analysis if it was e.g. added by Manage Analysis\n wf.doActionFor(analysis, \"initialize\")\n\n # Try to transition the analysis_request to \"sample_received\". There are\n # some cases that can end up with an inconsistent s... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Use this API to add cachecontentgroup. | [
"public static base_response add(nitro_service client, cachecontentgroup resource) throws Exception {\n\t\tcachecontentgroup addresource = new cachecontentgroup();\n\t\taddresource.name = resource.name;\n\t\taddresource.weakposrelexpiry = resource.weakposrelexpiry;\n\t\taddresource.heurexpiryparam = resource.heurex... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code:"
} |
parse the relations of entites .
@param persistenceUnit
@param tableInfos
@param entityMetadata
@param tableInfo
@param relations | [
"private void parseRelations(String persistenceUnit, List<TableInfo> tableInfos, EntityMetadata entityMetadata,\n TableInfo tableInfo, List<Relation> relations)\n {\n for (Relation relation : relations)\n {\n if (relation != null)\n {\n Class entityCl... | [
"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 instruction about Data parsing:",
"pos": "Represent the code about Data parsing:",
"neg": "Represent the code:"
} |
{ "id": "<20180611195133.1.10869F48B8AD29FF@yourdomain.com>", "message": "Queued. Thank you."} | [
"private String getMessageId(String response) {\n\t\tif (StringUtils.isNullOrEmptyTrimmed(response)) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tMailGunSendResponse res = JsonUtils.fromJson(response, MailGunSendResponse.class);\n\t\t\treturn res != null ? res.id : null;\n\t\t}\n\t\tcatch (IllegalArgumentExcept... | [
"def _load_secret(self, creds_file):\n ''''''\n try:\n with open(creds_file) as fp:\n creds = json.load(fp)\n return creds\n except Exception as e:\n sys.stderr.write(\"Error loading oauth secret from local file called '{0}'\\n\".format(creds_file... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetThingName sets the ThingName field's value. | [
"func (s *DetachThingPrincipalInput) SetThingName(v string) *DetachThingPrincipalInput {\n\ts.ThingName = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
注册路由请求
@param string $method 请求方法
@param array $args 请求的参数,当参数超过2个的时候,中间的参数为中间件,该中间件仅在此次运行中执行 | [
"public function setRoute($method, $args)\n {\n $pattern = array_shift($args);\n $callable = array_pop($args);\n\n //包含额外的参数\n if (count($args) > 0) {\n //额外的参数为单独的调用中间件\n foreach ($args as $call) {\n if (!is_callable($call)) {\n ... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create table
@param $tableName
@param $fieldString
@return string | [
"public function createTable($tableName, $fieldString) {\n try {\n $sql = 'CREATE table ' . $tableName . ' ('. $fieldString . ') ENGINE=InnoDB CHARACTER SET=utf8;';\n $this->dbh->exec($sql);\n } catch (PDOException $e) {\n return $e->getMessage();\n }\n }"
] | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
/*
Instance serialization. | [
"private void writeObject(java.io.ObjectOutputStream out) throws IOException\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n Tr.entry(tc, \"writeObject : \" + ivPuId + \", \" + ivJ2eeName);\n\n out.writeObject(ivPuId);\n out.writeObject(ivJ2eeName); // d51... | [
"@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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates a NumberMap for Doubles.
@param <K>
@return NumberMap<K, Double> | [
"public static <K> NumberMap<K, Double> newDoubleMap() {\n\t\treturn new NumberMap<K, Double>() {\n\t\t\t@Override\n\t\t\tpublic void add(K key, Double addend) {\n\t\t\t\tput(key, containsKey(key) ? (get(key) + addend) : addend);\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void sub(K key, Double subtrahend) {\n\t\t\t\t... | [
"public static <W extends WitnessType<W>,A> ListT<W,A> of(final AnyM<W,? extends IndexedSequenceX<A>> monads) {\n return new ListT<>(\n monads);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// UnsubscribeDeviceEvents unsubscribes from the events that were subscribed to by SubscribeDeviceEvents | [
"func (c *DefaultClient) UnsubscribeDeviceEvents(appID string, devID string, eventType types.EventType) Token {\n\ttopic := DeviceTopic{appID, devID, DeviceEvents, string(eventType)}\n\treturn c.unsubscribe(topic.String())\n}"
] | [
"private void onDataSetStaleEvent(@Observes DataSetStaleEvent event) {\n checkNotNull(\"event\",\n event);\n String uuid = event.getDataSetDef().getUUID();\n\n // Remove any stale data existing on the client.\n // This will force next lookup requests to push a refresh... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@inheritdoc}
@throws \BadMethodCallException | [
"public function stream_seek(int $offset, int $whence = SEEK_SET): bool\n {\n $this->notAllowed(__FUNCTION__);\n\n return false;\n }"
] | [
"public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Add a new project
returns a project complexmodel | [
"def add_project(project,**kwargs):\n \n user_id = kwargs.get('user_id')\n\n existing_proj = get_project_by_name(project.name,user_id=user_id)\n\n if len(existing_proj) > 0:\n raise HydraError(\"A Project with the name \\\"%s\\\" already exists\"%(project.name,))\n\n #check_perm(user_id, 'add_... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Start a depth first search at vertex _u_. The block _b_ is called on
each finish_vertex event. | [
"def depth_first_visit (u, vis = DFSVisitor.new(self), &b)\n vis.color_map[u] = :GRAY\n vis.handle_examine_vertex(u)\n each_adjacent(u) { |v|\n vis.handle_examine_edge(u, v)\n if vis.follow_edge?(u, v) # (u,v) is a tree edge\n vis.handle_tree_edge(u, v) # als... | [
"function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// SetTrigger sets the Trigger field's value. | [
"func (s *UpdateTriggerOutput) SetTrigger(v *Trigger) *UpdateTriggerOutput {\n\ts.Trigger = 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:"
} |
Tahtanın görebileceği ihale idlerini tarihlerine göre listeler
Tarih aralığı verilmezse tüm ihale idler verilirse tarih aralığındaki ihale idler array olarak döner
@param {integer} _tahta_id
@param {integer} _tarih1
@param {integer} _tarih2
@returns {*} | [
"function f_idler_aktif_tarih_araligindakiler(_tahta_id, _tarih1, _tarih2) {\r\n console.log(\"f_idler_aktif_tarih_araligindakiler\")\r\n return f_tahta_ihale_idler_aktif(_tahta_id)\r\n .then(function (_ihale_idler) {\r\n var tarih1 = _tarih1 ? _tarih1 : \"-inf\",\r\n ... | [
"function f_urunun_kazandigi_teklif_fiyatlari(_tahta_id, _urun_id, _parabirim_id) {\r\n //l.info(\"f_db_urunun_kazandigi_teklif_fiyatlari\");\r\n //ürünün kazandığı teklifleri bul\r\n //bu tekliflerin fiyatlarını getir\r\n return f_urunun_teklif_fiyatlari_onay_durumuna_gore(_tahta_id, _u... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Determines if a package is a GovCMS theme.
@param array $package
The package info.
@return bool
True if the package is a GovCMS theme, otherwise FALSE. | [
"protected function isGovCMSTheme(array $package) {\n // Exlucde package theme from custom repos.\n if ($package['name'] == 'govcms-custom/govcms8_uikit' || $package['name'] == 'govcms-custom/govcms8_uikit_starter') {\n return FALSE;\n }\n\n $package_types = [\n 'drupal-theme',\n ];\n re... | [
"public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about PHP programming:"
} |
Interprete the file
@param string $path
@param string $templateName
@throws Exception
@return string | [
"public function render($path, $templateName)\n {\n set_error_handler(array($this, 'error'));\n\n try {\n ob_start();\n include $path . $templateName;\n $content = ob_get_clean();\n } catch (EnvironnementNotDefinedException $e) {\n restore_error_ha... | [
"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 description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about NLP:"
} |
A subset of the :attr:`entries` dictionary, filtered down to only
those entries of type :class:`SecretKeyEntry`. | [
"def secret_keys(self):\n \"\"\"\"\"\"\n return dict([(a, e) for a, e in self.entries.items()\n if isinstance(e, SecretKeyEntry)])"
] | [
"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:"
} |
Set the API key
@param string $apiKey API request key | [
"public function setApiKey($apiKey)\n {\n $key = base64_decode($apiKey, true);\n if ($key === false) {\n throw new \\InvalidArgumentException('Invalid API key');\n }\n\n $this->apiKey = $key;\n return $this;\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Output this screen using HTML. | [
"public void printHtmlLink(PrintWriter out, String strTag, String strParams, String strData)\n {\n String strRecordClass = m_recDetail.getClass().getName();\n String strLink = HtmlConstants.SERVLET_LINK;\n strLink = Utility.addURLParam(strLink, DBParams.RECORD, strRecordClass);\n strL... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// FinalizeCloud is part of the environs.CloudFinalizer interface. | [
"func (p *environProvider) FinalizeCloud(\n\tctx environs.FinalizeCloudContext,\n\tin cloud.Cloud,\n) (cloud.Cloud, error) {\n\tvar endpoint string\n\tresolveEndpoint := func(name string, ep *string) error {\n\t\t// If the name doesn't equal \"localhost\" then we shouldn't resolve\n\t\t// the end point, instead we ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Main launches a node with the specified parameters. | [
"func Main(port int, peers []string, diskAllocated int) {\n\ts, err := newServer(port, peers, diskAllocated)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tbitcoin.NewClient()\n\n\ts.Fatal(s.network.Listen())\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Memproses kata dasar yang ada dalam nama entri.
:param dasar: ResultSet untuk label HTML dengan class="rootword"
:type dasar: ResultSet | [
"def _init_kata_dasar(self, dasar):\n \n\n for tiap in dasar:\n kata = tiap.find('a')\n dasar_no = kata.find('sup')\n kata = ambil_teks_dalam_label(kata)\n self.kata_dasar.append(\n kata + ' [{}]'.format(dasar_no.text.strip()) if dasar_no else... | [
"def as_dict(self):\n \n opt_info = {}\n opt_info[\"type\"] = \"value\"\n opt_info[\"name\"] = self.name\n opt_info[\"value\"] = self.value\n opt_info[\"otype\"] = self.otype.as_dict()\n #TODO: est-ce que l'on ne met pas a plat et les attr de otype et ceux de l'optio... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about AWS Route 53:"
} |
// NewMockNetworkEntity creates a new mock instance | [
"func NewMockNetworkEntity(ctrl *gomock.Controller) *MockNetworkEntity {\n\tmock := &MockNetworkEntity{ctrl: ctrl}\n\tmock.recorder = &MockNetworkEntityMockRecorder{mock}\n\treturn mock\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Whether the country state can be deleted
@param integer $state_id
@return boolean | [
"public function canDelete($state_id)\n {\n $sql = 'SELECT address_id FROM address WHERE state_id=?';\n $result = $this->db->fetchColumn($sql, array($state_id));\n return empty($result);\n }"
] | [
"public function delete($id)\n {\n $this->innerHandler->delete($id);\n // Delete by primary key will remove the object, so we don't need to clear `ez-language-code-` here.\n $this->cache->deleteMulti(['ez-language-' . $id, 'ez-language-list']);\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software Development:"
} |
Chop up C{initial_value} according to the list of C{factors} and return a
formatted string. | [
"def redivmod(initial_value, factors):\n \n result = []\n value = initial_value\n for divisor, label in factors:\n if not divisor:\n remainder = value\n if not remainder:\n break\n else:\n value, remainder = divmod(value, divisor)\n ... | [
"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 post about Data transformation:",
"pos": "Represent the code about Data transformation:",
"neg": "Represent the code about Natural Language Processing:"
} |
Delete the step.
@param int $stepid The ID of the step to remove. | [
"protected function delete_step($stepid) {\n require_sesskey();\n\n $step = step::instance($stepid);\n $tour = $step->get_tour();\n\n $step->remove();\n redirect($tour->get_view_link());\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Creates new document from markup.
Chainable.
@param unknown_type $markup
@return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery | [
"public static function newDocumentXHTML($markup = null, $charset = null) \n {\n $contentType = $charset\n ? \";charset=$charset\"\n : '';\n return self::newDocument($markup, \"application/xhtml+xml{$contentType}\");\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// handleHelp implements the help command. | [
"func handleHelp(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {\n\tc := cmd.(*btcjson.HelpCmd)\n\n\t// Provide a usage overview of all commands when no specific command\n\t// was specified.\n\tvar command string\n\tif c.Command != nil {\n\t\tcommand = *c.Command\n\t}\n\tif command ... | [
"@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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get an iterable list of source files for the root package of the given
Composer instance.
@param Composer $composer
@return FileIteratorInterface | [
"public function create(Composer $composer): FileIteratorInterface\n {\n $config = $composer->getConfig();\n $autoloadGenerator = $composer->getAutoloadGenerator();\n $installationManager = $composer->getInstallationManager();\n $package = $composer->getPack... | [
"public function addEnvironmentReader(array $arguments = [])\n {\n // Full namespace: <EXTENSION_NAMESPACE>\\Environment\\<EXTENSION_CONFIG_KEY>EnvironmentReader.\n // For example we have registered extension at namespace: \"Behat\\TqExtension\". Class, which\n // implements extension interf... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"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.