query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Returns all <code>attribute</code> elements
@return list of <code>attribute</code> | [
"public List<UicomponentAttributeType<UicomponentAttributeType<T>>> getAllAttribute()\n {\n List<UicomponentAttributeType<UicomponentAttributeType<T>>> list = new ArrayList<UicomponentAttributeType<UicomponentAttributeType<T>>>();\n List<Node> nodeList = childNode.get(\"attribute\");\n for(Node nod... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Quick {@link EntitySystem} retrieval. | [
"@SuppressWarnings(\"unchecked\")\n\tpublic <T extends EntitySystem> T getSystem(Class<T> systemType) {\n\t\treturn systemManager.getSystem(systemType);\n\t}"
] | [
"@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 instruction about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code:"
} |
Writes one or more String columns as a line to the CsvWriter.
@param columns
the columns to write
@throws IllegalArgumentException
if columns.length == 0
@throws IOException
If an I/O error occurs
@throws NullPointerException
if columns is null | [
"protected void writeRow(final String... columns) throws IOException {\n\t\t\n\t\tif( columns == null ) {\n\t\t\tthrow new NullPointerException(String.format(\"columns to write should not be null on line %d\", lineNumber));\n\t\t} else if( columns.length == 0 ) {\n\t\t\tthrow new IllegalArgumentException(String.for... | [
"private String performSplitting(String source, String splitString, String indexString)\n throws TransformationOperationException {\n try {\n Integer index = Integer.parseInt(indexString);\n return source.split(splitString)[index];\n } catch (NumberFormatException e) {\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Page footer
Used internally by FPDF | [
"public function Footer()\n {\n $this->SetY(-15);\n $this->billetSetFont('footer');\n $this->Cell(88.5, 5, $this->PageNo() . \" / $this->AliasNbPages\");\n $this->Cell(88.5, 5, date('Y-m-d H:i:s O'), 0, 0, 'R');\n }"
] | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// connectedTo returns true if connected services.Server passed in. | [
"func (a *Agent) connectedTo(proxy services.Server) bool {\n\tprincipals := a.getPrincipals()\n\tproxyID := fmt.Sprintf(\"%v.%v\", proxy.GetName(), a.ClusterName)\n\tif _, ok := principals[proxyID]; ok {\n\t\treturn true\n\t}\n\treturn false\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 Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Returns the SQL for an update statement
@param SQLStatement $update
@return string | [
"public function update(SQLStatement $update): string\n {\n $sql = 'UPDATE ';\n $sql .= $this->handleTables($update->getTables());\n $sql .= $this->handleJoins($update->getJoins());\n $sql .= $this->handleSetColumns($update->getColumns());\n $sql .= $this->handleWheres($update-... | [
"@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// rollbackTxs marks the transactions contained in recently rolled back blocks
// as rolled back. It also removes any positional lookup entries. | [
"func (pool *TxPool) rollbackTxs(hash common.Hash, txc txStateChanges) {\n\tbatch := pool.chainDb.NewBatch()\n\tif list, ok := pool.mined[hash]; ok {\n\t\tfor _, tx := range list {\n\t\t\ttxHash := tx.Hash()\n\t\t\trawdb.DeleteTxLookupEntry(batch, txHash)\n\t\t\tpool.pending[txHash] = tx\n\t\t\ttxc.setState(txHash,... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the comment about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about Software development:"
} |
Get the next controller while iterating.
:return: a dict with the keys: id, type, name, available. | [
"def tdController(self):\n \n cid = c_int()\n ctype = c_int()\n name = create_string_buffer(255)\n available = c_int()\n\n self._lib.tdController(byref(cid), byref(ctype), name, sizeof(name),\n byref(available))\n return {'id': cid.value... | [
"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 post about AWS Route 53:",
"pos": "Represent the code about AWS Route 53:",
"neg": "Represent the code:"
} |
Initialize data packet
@since 3.0.0
@param string $filter
@param string $key
@return null | [
"protected function initDataPacket($filter, $key)\n {\n if (!array_key_exists($key, $_POST)) {\n $this->errorMessage = $this->config->messages[$key];\n $this->ajax_response_handler();\n }\n $this->dataPacket[$key] = $filter($_POST[$key]);\n }"
] | [
"def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Draw a feature layer. | [
"def draw_feature_layer(self, surf, feature):\n \"\"\"\"\"\"\n layer = feature.unpack(self._obs.observation)\n if layer is not None:\n surf.blit_np_array(feature.color(layer))\n else: # Ignore layers that aren't in this version of SC2.\n surf.surf.fill(colors.black)"
] | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Returns nil connection and nil error if no connection could be established
// for valid reasons. | [
"func (cl *Client) establishOutgoingConnEx(t *Torrent, addr IpPort, ctx context.Context, obfuscatedHeader bool) (c *connection, err error) {\n\tdr := cl.dialFirst(ctx, addr.String())\n\tnc := dr.Conn\n\tif nc == nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif c == nil || err != nil {\n\t\t\tnc.Close()\n\t\t}\n\t}(... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get current position using HTML5 Geolocation and resolve promise once it has returned. | [
"function(options){\n if (typeof window !== 'undefined' && window.navigator.geolocation) {\n\n // Have default options, but allow to extend with custom.\n var geolocationOptions = this.extend({\n maximumAge: 0,\n timeout: 10000,\n enableHighAccuracy: true\n }, op... | [
"function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
复制图片
@param string $oldImg
@param string $newImg
@param string $subFolder
@param boolean $returnStatic
@return string | [
"public static function copyImg($oldImg, $newImg = '', $subFolder = '', $returnStatic = false)\n {\n if(substr($oldImg, 0, 4) != 'http'){\n $oldImgStatic = Folder::getStatic($oldImg);\n\n if(!$oldImg || !file_exists($oldImgStatic)){\n return $oldImg;\n }\n ... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Guaranteed to throw an exception and leave the table unmodified.
@throws UnsupportedOperationException always
@deprecated Unsupported operation. | [
"@Deprecated\n @Override\n public boolean removeAll(@Nullable final Object rowKey, @Nullable final Object columnKey) {\n throw new UnsupportedOperationException();\n }"
] | [
"public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the comment about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about N/A:"
} |
Return a td with the formated value or action for headers | [
"def render_cell_thead\n if @ask\n cell_value = (@ask.is_a?(Symbol)) ? I18n.t(@ask, {}, :header) : @ask\n else\n cell_value = @block\n end\n if @can_sort\n sort_on = @options[:sort_as] || @ask\n @html_options.merge!(:class => \"#{@html_options[:class]} #{sorting_html_... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param $collection
@param $count
@return string | [
"private function formatCommaSeparated($collection, $count)\n {\n $display = \\array_map(function ($element) {\n return (string) $element;\n }, \\array_slice($collection, 0, $count - 1));\n\n return $this->translator->trans('comma_separated', [\n '%list%' => \\implode('... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
This is where RESTful routes are mapped by Klein | [
"private function addRoutesForModels()\n {\n foreach ($this->_models as $model) {\n $modelName = strtolower($model);\n $mainUrl = '/' . $modelName;\n $resourceUrl = '/' . $modelName . '/' . '[:id]';\n $controllerName = $model . 'Controller';\n\n $cont... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Append a value to the given resultset
@param string $name name of the result containing a list of values
@param mixed $value value to add as another item in that result | [
"private function add_result_item($name, $value) {\n\n $results = $this->task->get_results();\n\n if (isset($results[$name])) {\n if (!is_array($results[$name])) {\n throw new coding_exception('Unable to append a result item into a non-array structure.');\n }\n ... | [
"public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software Development:"
} |
// SetStatus sets the Status field's value. | [
"func (s *AgentListEntry) SetStatus(v string) *AgentListEntry {\n\ts.Status = &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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Init the stats history (dict of GlancesAttribute). | [
"def init_stats_history(self):\n \"\"\"\"\"\"\n if self.history_enable():\n init_list = [a['name'] for a in self.get_items_history_list()]\n logger.debug(\"Stats history activated for plugin {} (items: {})\".format(self.plugin_name, init_list))\n return GlancesHistory()"
] | [
"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 about computer science:",
"pos": "Represent the Github code about computer science:",
"neg": "Represent the Github code:"
} |
// Set implements the flag.Value interface. | [
"func (a *Addr) Set(v string) error {\n\ta.s = v\n\n\tif strings.HasPrefix(v, \"FD:\") {\n\t\tfdStr := v[len(\"FD:\"):]\n\t\tfd, err := strconv.ParseUint(fdStr, 10, 32)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid file descriptor %q: %v\", fdStr, err)\n\t\t}\n\t\treturn a.listenOnFD(uintptr(fd))\n\t}\n\n... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Renders the form Tab and Content for the modal
@return \MelisCms\Controller\ViewModel | [
"public function renderTreeSitesModalFormHandlerAction()\n {\n $data = array();\n \n $sourcePageId = (int) $this->params()->fromQuery('sourcePageId', '');\n \n $melisKey = $this->params()->fromRoute('melisKey', '');\n // declare the Tool service that we will be using to comp... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Pretty indicates that the JSON response be indented and human readable. | [
"func (s *IndicesOpenService) Pretty(pretty bool) *IndicesOpenService {\n\ts.pretty = pretty\n\treturn s\n}"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// utility to mount a disk based filesystem | [
"func diskSetUp(manager diskManager, b rbdMounter, volPath string, mounter mount.Interface, fsGroup *int64) error {\n\tglobalPDPath := manager.MakeGlobalPDName(*b.rbd)\n\tnotMnt, err := mounter.IsLikelyNotMountPoint(globalPDPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\tklog.Errorf(\"cannot validate mountpoin... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Returns the instantiated action fluents in canonical order.
Returns:
Sequence[Tuple[str, List[str]]]: A tuple of pairs of fluent name
and a list of instantiated fluents represented as strings. | [
"def action_fluent_variables(self) -> FluentParamsList:\n '''\n '''\n fluents = self.domain.action_fluents\n ordering = self.domain.action_fluent_ordering\n return self._fluent_params(fluents, ordering)"
] | [
"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 description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Set Headers Plugin Manager
@param PluginsHttpHeader $pluginsManager | [
"static function givePluginManager(PluginsHttpHeader $pluginsManager)\n {\n if ( self::$pluginManager !== null )\n throw new exImmutable('Header Factory Has Plugin Manager, and can`t be changed.');\n\n self::$pluginManager = $pluginsManager;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
// authenticate forces authentication set by RegisterDefaultAuth. | [
"func (s *Server) authenticate() router.Middleware {\n\ta := s.Authenticator\n\tif a == nil {\n\t\ta = GetDefaultAuth()\n\t\tif a == nil {\n\t\t\tpanic(\"prpc: no custom Authenticator was provided and default authenticator was not registered.\\n\" +\n\t\t\t\t\"Either explicitly set `Server.Authenticator = NoAuthent... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Removes a single project permission from user | [
"public void deleteProjectPermission(DbSession dbSession, int userId, String permission, long projectId) {\n mapper(dbSession).deleteProjectPermission(userId, permission, projectId);\n }"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Imports an XML combined search definition that defines the matching
criteria for this rule.
@param queryDef
A combined raw query definition serialized as XML. | [
"public void importQueryDefinition(XMLWriteHandle queryDef) {\n List<XMLEvent> importedList = Utilities.importFromHandle(queryDef);\n // modify XMLEvent list if the imported XML was a structured query.\n XMLEvent firstEvent = importedList.get(0);\n if (firstEvent.getEventType() == XMLStreamConstants.ST... | [
"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:"
} |
Returns the corresponding midi events for a multi note. | [
"public MidiEvent[] getMidiEventsFor(MultiNote notes, KeySignature key, long elapsedTime) throws InvalidMidiDataException\r\n {\r\n Vector notesVector = notes.getNotesAsVector();\r\n MidiEvent[] events = new MidiEvent[2*notesVector.size()+1];\r\n for (int j=0; j<notesVector.size(); j++)\r\n {\r\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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewSafeID returns a new instance of an IDGenerator which is safe for
// concurrent use by multiple goroutines. | [
"func NewSafeID(startID int) IDGenerator {\n\treturn &safeID{\n\t\tnextID: startID,\n\t\tmutex: &sync.Mutex{},\n\t}\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Finishes module action
@param mixed $result | [
"protected function finishActionModule($result)\n {\n if ($result === true) {\n $this->redirect('', $this->text('Module has been updated'), 'success');\n }\n\n $message = $result ? $result : $this->text('Operation unavailable');\n $this->redirect('', $message, 'danger');\n ... | [
"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:"
} |
Get one log from the log queue. | [
"async def pop_log(self):\n \"\"\"\"\"\"\n self._check_receive_loop()\n res = self.log_queue.get()\n self._check_error(res)\n return res"
] | [
"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:"
} |
// Limit generate LIMIT start, limit statement | [
"func (statement *Statement) Limit(limit int, start ...int) *Statement {\n\tstatement.LimitN = limit\n\tif len(start) > 0 {\n\t\tstatement.Start = start[0]\n\t}\n\treturn statement\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// NewImageManagerAPI creates a new server-side imagemanager API end point. | [
"func NewImageManagerAPI(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ImageManagerAPI, error) {\n\t// Only clients can access the image manager service.\n\tif !authorizer.AuthClient() {\n\t\treturn nil, common.ErrPerm\n\t}\n\treturn &ImageManagerAPI{\n\t\tstate: getState(st),\n\... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Camel format string
@param str
@param isFirstCapitalized
@return String in camelFormat | [
"private static String camelFormat(String str, boolean isFirstCapitalized) {\n\t\tStringBuilder builder = new StringBuilder(str.length());\n\t\tString[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);\n\t\tfor (int i = 0; i < tokens.length; i++) {\n\t\t\tString lowerCased = StringUtils.lowerCase(tokens[i]);\n\t\t\tif (... | [
"def desc(self, description):\n ''''''\n return self | Parser(lambda _, index: Value.failure(index, description))"
] | codesearchnet | {
"query": "Represent the Github description about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Data processing:"
} |
dynamic/optional/multiple. May be called at any time and in any order
@param reference reference to AdminObjectService service | [
"@Reference(name = REFERENCE_ADMIN_OBJECT_SERVICES,\n service = AdminObjectService.class,\n policy = ReferencePolicy.DYNAMIC,\n cardinality = ReferenceCardinality.MULTIPLE)\n protected synchronized void addAdminObjectService(ServiceReference<AdminObjectService> reference... | [
"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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// returns true if the HTTP response contains a bearer challenge | [
"func hasBearerChallenge(resp *http.Response) bool {\n\tauthHeader := resp.Header.Get(bearerChallengeHeader)\n\tif len(authHeader) == 0 || strings.Index(authHeader, bearer) < 0 {\n\t\treturn false\n\t}\n\treturn true\n}"
] | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the summarization about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Software development:"
} |
doc: http://open.youku.com/docs/doc?id=85 | [
"def search_show_address_unite(self, progammeId,\n source_site=None, type=None):\n \n url = 'https://openapi.youku.com/v2/searches/show/address_unite.json'\n params = {\n 'client_id': self.client_id,\n 'progammeId': progammeId,\n ... | [
"func (bc *BaiduClient) BaiduLogin(username, password, verifycode, vcodestr string) (lj *LoginJSON) {\n\tlj = &LoginJSON{}\n\tenpass, err := bdcrypto.RSAEncryptOfWapBaidu(bc.rsaPublicKeyModulus, []byte(password+bc.serverTime))\n\tif err != nil {\n\t\tlj.ErrInfo.No = \"-1\"\n\t\tlj.ErrInfo.Msg = \"RSA加密失败, \" + err.... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param array $replacements
@param array $input
@return array | [
"private static function replaceKeys(array &$replacements, array $input)\n {\n $return = [];\n foreach ($input as $key => $value) {\n $key = \\str_replace(\\array_keys($replacements), \\array_values($replacements), $key);\n\n if (\\is_array($value)) {\n $value =... | [
"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:"
} |
/*
Init the element "elem" on the map (drawing text, setting attributes, events, tooltip, ...)
@param id the id of the element
@param type the type of the element (area, plot, link)
@param elem object the element object (with mapElem), it will be updated | [
"function (id, type, elem) {\n var self = this;\n var $mapElem = $(elem.mapElem.node);\n\n // If an HTML link exists for this element, add cursor attributes\n if (elem.options.href) {\n elem.options.attrs.cursor = \"pointer\";\n if (elem.opti... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Run filename
args: command line arguments (string) | [
"def runfile(self, filename, args=None):\r\n \r\n if args is not None and not is_text_string(args):\r\n raise TypeError(\"expected a character buffer object\")\r\n self.namespace['__file__'] = filename\r\n sys.argv = [filename]\r\n if args is not None:\r\n fo... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Generate the dependency tree object | [
"def __generate_dependency_tree(self):\n \n dependency_dict = {}\n for s in self.manifest.sections():\n if s != \"config\":\n if self.manifest.has_option(s, 'depends'):\n dependency_list = [d.strip() for d in re.split('\\n|,', self.manifest.get(s, 'd... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Reads all values from a node and returns them as a Node array.
Returns only nodes, literal values are skipped.
@param Node $node The node to work on.
@param string|object $property The property to read.
@return array<Node> | [
"public function getAllValuesNode(Node $node = null, $property) {\n $allValues = $this->getAllValues($node, $property);\n $output = [];\n foreach ($allValues as $a)\n if (is_a($a, 'ML\\JsonLD\\Node'))\n $output[] = $a;\n\n return $output;\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Assign the language for the retrieved object. | [
"def get_object(self, queryset=None):\n \n object = super(LanguageChoiceMixin, self).get_object(queryset)\n if isinstance(object, TranslatableModelMixin):\n object.set_current_language(self.get_language(), initialize=True)\n return object"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Make headers from worksheet | [
"def make_headers(worksheet):\n \n headers = {}\n cell_idx = 0\n while cell_idx < worksheet.ncols:\n cell_type = worksheet.cell_type(0, cell_idx)\n if cell_type == 1:\n header = slughifi(worksheet.cell_value(0, cell_idx))\n if not header.startswith(\"_\"):\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the sections to the given list of Section objects. The
sections will be used to colorize areas with a special
meaning such as the red area in a rpm gauge.
Sections in the Medusa library
usually are less eye-catching than Areas.
@param SECTIONS | [
"public void setSections(final List<Section> SECTIONS) {\n sections.setAll(SECTIONS);\n Collections.sort(sections, new SectionComparator());\n fireUpdateEvent(SECTION_EVENT);\n }"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/*
(non-Javadoc)
@see com.sporniket.libre.ui.swing.paper.SheetOfPaper#setWidth(int) | [
"public void setWidth(int width)\n\t{\n\t\tif (1 > width)\n\t\t{\n\t\t\tString _message = \"The specified width ({0}) is incorrect, it must be greater or equal than 1.\";\n\t\t\tObject[] _parameters =\n\t\t\t{\n\t\t\t\tnew Integer(width)\n\t\t\t};\n\t\t\tthrow new IllegalArgumentException(MessageFormat.format(_mess... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// UpdateMachineMetadata updates the metadata for a given machine.
// Any metadata keys passed in here are created if they do not exist, and
// overwritten if they do.
// See API docs: http://apidocs.joyent.com/cloudapi/#UpdateMachineMetadata | [
"func (c *Client) UpdateMachineMetadata(machineID string, metadata map[string]string) (map[string]interface{}, error) {\n\tvar resp map[string]interface{}\n\treq := request{\n\t\tmethod: client.POST,\n\t\turl: makeURL(apiMachines, machineID, apiMetadata),\n\t\treqValue: metadata,\n\t\tresp: &resp,\n\t}\n... | [
"func (c *Cloud) buildSelfAWSInstance() (*awsInstance, error) {\n\tif c.selfAWSInstance != nil {\n\t\tpanic(\"do not call buildSelfAWSInstance directly\")\n\t}\n\tinstanceID, err := c.metadata.GetMetadata(\"instance-id\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching instance-id from ec2 metadata ... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
// SetDocumentCookieDisabledWithParams - | [
"func (c *Emulation) SetDocumentCookieDisabledWithParams(v *EmulationSetDocumentCookieDisabledParams) (*gcdmessage.ChromeResponse, error) {\n\treturn gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: \"Emulation.setDocumentCookieDisabled\", Params: ... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about File management:"
} |
@param array $stack
@return string | [
"protected function getType(array $stack)\n {\n if (!isset($stack['function'])) {\n return null;\n }\n\n if (isset($stack['namespace']) && isset($stack['class'])) {\n return $stack['namespace'] . '\\\\' . $stack['class'] . $stack['type'] . $stack['function'];\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Public: renders the page content.
options - The Hash containing the values to use inside the template.
Returns: the rendered page content. | [
"def render_content(options={})\n layout = ::Liquid::Template.parse(\"{{content}}\").render({\"content\" => page.content})\n result = ::Liquid::Template.parse(layout).render(optional_data(options), :registers => {:controller => controller}).html_safe\n rescue => e\n log_error(e)\n ensure\n ... | [
"def note(id, type, options = {})\n # Welguisz: No idea why this is here, but keeping it here because it follows other blocks\n _notes\n # Create a new note and place it in the notes 2-D Hash\n @_notes[id][type] = Note.new(id, type, options)\n end"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Validate ID Token
@param $idToken
@return mixed
@throws Exception | [
"protected function validateIdToken($idToken) {\n $segments = explode('.', $idToken);\n if (count($segments) != 3) {\n throw new InvalidIdTokenException('Invalid Token');\n }\n $header = json_decode($this->decodeBase64Url($segments[0]), true);\n if (empty($header)) {\n ... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// Set is required to set parameters from command line string | [
"func (p *IntParam) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp.val = &v\n\treturn nil\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Sets the progress bar image and its scale type.
@param progressBarDrawable drawable to be used as progress bar image
@param progressBarImageScaleType scale type for the progress bar image
@return modified instance of this builder | [
"public GenericDraweeHierarchyBuilder setProgressBarImage(\n Drawable progressBarDrawable, @Nullable ScalingUtils.ScaleType progressBarImageScaleType) {\n mProgressBarImage = progressBarDrawable;\n mProgressBarImageScaleType = progressBarImageScaleType;\n return this;\n }"
] | [
"public void onTransformChanged() {\n Log.v(Log.SUBSYSTEM.WIDGET, TAG, \"onTransformChanged(): %s mPreventTransformChanged = %b\",\n getName(), mPreventTransformChanged);\n\n // Even if the calling code that altered the transform doesn't request a\n // layout, we'll do a layout t... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set the message body converters to use. These converters are used to
convert objects to MIME parts. | [
"public void setPartConverters(List<HttpMessageConverter> partConverters) {\n checkNotNull(partConverters, \"'partConverters' must not be null\");\n checkArgument(!partConverters.isEmpty(), \"'partConverters' must not be empty\");\n this.partConverters = partConverters;\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Создаёт инстансы для всех приложений, описанных в разделе "applications" конфига.
@return ApplicationInterface[] | [
"public function instanceAllApps(): array\n {\n $allAppIds = $this->applicationConfig->getAllApplicationIds();\n\n return array_map(function (string $id) {\n return $this->instanceAppById($id);\n }, $allAppIds);\n }"
] | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the post about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about Programming:"
} |
Get an array representation of a single customer's current subscription
@throws CheddarGetter_Response_Exception if the response type is incompatible or if a $code
is not provided and the response contains more than one customer
@return array | [
"def customer_active?(code = nil)\n subscription = customer_subscription(code)\n if subscription[:canceledDatetime] && subscription[:canceledDatetime] <= Time.now\n false\n else\n true\n end\n end"
] | [
"@Override\n protected CreditCardAuthorizationResult run() {\n // Simulate transitive dependency from CreditCardCommand to GetUserAccountCommand.\n // UserAccount could be injected into this command as an argument (and that would be more accurate)\n // but often in large codebase that ends u... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
print some status information in between. | [
"def print_update(self):\n \n print(\"\\r\\n\")\n now = datetime.datetime.now()\n print(\"Update info: (from: %s)\" % now.strftime(\"%c\"))\n\n current_total_size = self.total_stined_bytes + self.total_new_bytes\n\n if self.total_errored_items:\n print(\" * WARNI... | [
"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:"
} |
Pause. Any notification delivered here will be suspended. | [
"public void pause() {\n if (hasState(TICKING) && !hasState(PAUSED)) {\n if (DBG) Log.v(TAG, \"pause. \" + mEntries.size());\n mContentView.animate().cancel();\n addState(PAUSED);\n cancel(-1);\n }\n }"
] | [
"public List<Rule> findRulesToExecute() {\n\n\t\tthis.logger.fine( \"Looking for rules to execute after an event was recorded for application \" + this.app );\n\t\tList<Rule> result = new ArrayList<> ();\n\t\tlong now = System.nanoTime();\n\n\t\t/*\n\t\t * For all the rules, find if there are events that should tri... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Waits until the specified pattern is not visible on screen.
If ``seconds`` pass and the pattern is still visible, raises FindFailed exception.
Sikuli supports OCR search with a text parameter. This does not (yet). | [
"def waitVanish(self, pattern, seconds=None):\n \n r = self.clipRegionToScreen()\n if r is None:\n raise ValueError(\"Region outside all visible screens\")\n return None\n if seconds is None:\n seconds = self.autoWaitTimeout\n if not isinstance(pat... | [
"def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// ParseReader takes an io.Reader and returns Queries or an error. | [
"func ParseReader(reader io.Reader) (Queries, error) {\n\tvar (\n\t\tlastTag Tag\n\t\tlastLine parsedLine\n\t)\n\n\tqueries := make(Queries)\n\tscanner := bufio.NewScanner(reader)\n\n\tfor scanner.Scan() {\n\t\tline := parseLine(scanner.Text())\n\n\t\tswitch line.Type {\n\n\t\tcase lineBlank, lineComment:\n\t\t\t/... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
mhx
说明:
@param int $page
@param array $C 必须是索引数组 , 返回的数组 同$C 循序相同
@param int $pagesize
@return mixed | [
"public static function multiPage(int $page ,array $C , int $pagesize = 10 ):array\n {\n if(!self::is_indexArray($C)){\n throw new \\Exception('Tools multiPage throw : $C must is indexed array!');\n }\n //区间数组\n $scopeC = array();\n //区间指针记录\n $scopePointInteg... | [
"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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Create the default plugin stack based on user settings.
Disable a plugin by passing the name of the plugin + ` plugin`
to `app.disable()`,
**Example:**
```js
app.disable('src:foo plugin');
app.disable('src:bar plugin');
``` | [
"function createStack(app, plugins) {\n if (app.enabled('minimal config')) {\n return es.pipe.apply(es, []);\n }\n function enabled(acc, plugin, name) {\n if (plugin == null) {\n acc.push(through.obj());\n }\n if (app.enabled(name + ' plugin')) {\n acc.push(plugin);\n }\n return acc;\... | [
"function install(req, res /*, next */) {\n res.writeln('Add the following to your profile:');\n res.writeln('eval \"$(%s --completion)\"', req.program);\n res.end();\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the given filesystem's admin configset.
@param string $ident The filesystem identifier.
@return array|null Returns the filesystem configset
or NULL if the filesystem is not found. | [
"protected function getFilesystemAdminConfig($ident)\n {\n if ($this->hasFilesystem($ident) === false) {\n return null;\n }\n\n $elfConfig = $this->getAdminConnectorOptions();\n if (isset($elfConfig['roots'][$ident])) {\n return $elfConfig['roots'][$ident];\n ... | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Importing A Theme From A Template | [
"function importTheme(req, res, next) {\n req.appformsResultPayload = req.appformsResultPayload || {};\n var themeData = (req.appformsResultPayload.data && req.appformsResultPayload.type === constants.resultTypes.themeTemplate) ? req.appformsResultPayload.data : undefined ;\n\n var importThemeParams = {\n the... | [
"public function getViewer($action)\n {\n // Answer Viewer Object (from parent):\n \n if (!$this->isCMSPreview()) {\n return parent::getViewer($action);\n }\n \n // Load Page Requirements (uses theme):\n \n PageController::create(Page::create())-... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// ArrayOfSize - Create a new JSON array of a particular size at a path. Returns an error if the
// path contains a collision with a non object type. | [
"func (g *Container) ArrayOfSize(size int, path ...string) (*Container, error) {\n\ta := make([]interface{}, size)\n\treturn g.Set(a, path...)\n}"
] | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
This function is called by the server plugin when we have a request and we need to
process it. The plugin should handle translating the server platform specific values
into our routeInfo
@param routeInfo
@param callbacks | [
"function processWebRequest(routeInfo, callbacks) {\n var appName = routeInfo.appName;\n var serverOnly = !!routeInfo.query.server;\n var page = injector.loadModule('app/' + appName + '/pages/' + routeInfo.name + '.page');\n\n // get the callbacks\n var serverPreprocessing = callbacks.serverPreproces... | [
"@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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Checks for environment variables that can cause problems with supernova | [
"def check_environment_presets():\n \n presets = [x for x in os.environ.copy().keys() if x.startswith('NOVA_') or\n x.startswith('OS_')]\n if len(presets) < 1:\n return True\n else:\n click.echo(\"_\" * 80)\n click.echo(\"*WARNING* Found existing environment variables ... | [
"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:"
} |
Callback for uasort() that implements correct
locale-aware case-sensitive sorting | [
"protected function sort_folder_comparator($str1, $str2)\n {\n if ($this->sort_folder_collator === null) {\n $this->sort_folder_collator = false;\n\n // strcoll() does not work with UTF8 locale on Windows,\n // use Collator from the intl extension\n if (stripos(... | [
"def serialize_identity(self, identity):\n \n section, check, iterargs = identity\n values = map(\n # separators are without space, which is the default in JavaScript;\n # just in case we need to make these keys in JS.\n partial(json.dumps, separators=(',', ':'))\n # iterargs ar... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return html representation. | [
"def html(self) -> str:\n \"\"\"\"\"\"\n if isinstance(self.value, bool):\n val = 'true' if self.value else 'false'\n else:\n val = str(self.value)\n return 'draggable=\"{}\"'.format(val)"
] | [
"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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set Flags
@param int $flags
@return bool | [
"public function setFlags($flags)\n {\n $flags = Utility::ParseFlags($flags);\n\n $this->setDup($flags['dup']);\n $this->setQos($flags['qos']);\n $this->setRetain($flags['retain']);\n return true;\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// ToProto converts the RPC into a protobuf message | [
"func (ps *GetProcedureState) ToProto() proto.Message {\n\treturn &pb.GetProcedureResultRequest{ProcId: &ps.procID}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Parse named parameter as Long.
@param name
parameter name
@return Long value
@throws RepositoryConfigurationException | [
"public Long getParameterLong(String name) throws RepositoryConfigurationException\n {\n try\n {\n return StringNumberParser.parseLong(getParameterValue(name));\n }\n catch (NumberFormatException e)\n {\n throw new RepositoryConfigurationException(name + \": unparseable Lo... | [
"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 Github summarization about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about Software development:"
} |
Unwrap the padded ciphertext producing plaintext and integrity value.
@param string $ciphertext Ciphertext
@param string $kek Encryption key
@return array Tuple of plaintext <code>{P1, P2, ..., Pn}</code> and
integrity value <code>A</code> | [
"protected function _unwrapPaddedCiphertext(string $ciphertext, string $kek): array\n {\n // split to blocks\n $C = str_split($ciphertext, 8);\n $n = count($C) - 1;\n // if key consists of only one block, recover AIV and padded key as:\n // A | P[1] = DEC(K, C[0] | C[1])\n ... | [
"def verify2(self, atv_public_key, data):\n \"\"\"\"\"\"\n self._check_initialized()\n log_binary(_LOGGER, 'Verify', PublicSecret=atv_public_key, Data=data)\n\n # Generate a shared secret key\n public = curve25519.Public(atv_public_key)\n shared = self._verify_private.get_s... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Object id unique.
This function will corrupt the original array.
Correct usage: a=idUnique(a);
@param {[Object]} NonPrimitive Array | [
"function idUnique(a) {\n var i,j,l=a.length,p,\n guid=(Math.random()*1E10).toString(32)+(+new Date).toString(32);\n for (i=j=0;i<l;i++) {\n p = a[i];\n if (p==null) continue;\n if (p.hasOwnProperty(guid)) continue;\n Object.defineProperty(p,guid,{\n value:1,enumerable:false\n });\n a[... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initializes the Hooks and loads them within the Environment. | [
"def load_hooks(self, context):\n \n for hook in self.configuration.get('hooks', ()):\n config = hook.get('configuration', {})\n config.update(self.configuration.get('configuration', {}))\n\n try:\n self._load_hook(hook['name'], config, context)\n ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Устанавливает путь к файлу.
@param string $filePath путь к файлу
@throws InvalidArgumentException если файл не существует или находится не в заданной директории
@return $this | [
"public function setFilePath($filePath)\n {\n $splFileInfo = new \\SplFileInfo($filePath);\n if (!$realFilePath = $splFileInfo->getRealPath()) {\n throw new InvalidArgumentException(\n sprintf('Cannot set file path. File \"%s\" does not exist.', $filePath)\n );\... | [
"final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
270 271 Returns a comparator that represents the sort specification (but not // 272 including a possible geoquery distance tie-breaker). // 273 | [
"function () { // 274\n var self = this; // 275\n ... | [
"public static Boolean lte(Object left, Object right) {\n return or(lt(left, right),\n eq(left, right)); // do not use Java || to avoid potential NPE due to FEEL 3vl.\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Pass through to provider GradeEntrySearchSession.get_grade_entries_by_search | [
"def get_grade_entries_by_search(self, grade_entry_query, grade_entry_search):\n \"\"\"\"\"\"\n # Implemented from azosid template for -\n # osid.resource.ResourceSearchSession.get_resources_by_search_template\n if not self._can('search'):\n raise PermissionDenied()\n r... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetArtifacts sets the Artifacts field's value. | [
"func (s *UpdateProjectInput) SetArtifacts(v *ProjectArtifacts) *UpdateProjectInput {\n\ts.Artifacts = 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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Download file from (s)FTP to local filesystem. | [
"def get(self, path, local_path):\n \n normpath = os.path.normpath(local_path)\n folder = os.path.dirname(normpath)\n if folder and not os.path.exists(folder):\n os.makedirs(folder)\n\n tmp_local_path = local_path + '-luigi-tmp-%09d' % random.randrange(0, 1e10)\n\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
把视图组件转为可绑定 value 的组件
@param component 原始组件
@param _valueProp 原组件的值的属性名称,默认(一般)为 value, 可以根据原组件的情况设为 checked 等 | [
"function makeBindable(component, _valueProp) {\n var Bind = /** @class */ (function (_super) {\n __extends(Bind, _super);\n function Bind() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onChange = function (newValue) {\n var ... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Java 8: javafx.scene.text.Text.impl_selectionFillProperty()
Java 9+: javafx.scene.text.Text.selectionFillProperty() | [
"@SuppressWarnings(\"unchecked\")\n static ObjectProperty<Paint> Text_selectionFillProperty(Text text) {\n try {\n if (mText_selectionFillProperty == null) {\n mText_selectionFillProperty = Text.class.getMethod(\n isJava9orLater ? \"selectionFillProperty\" ... | [
"public static void addInputMap(Node node, InputMap<?> im) {\n // getInputMap calls init, so can use unsafe setter\n setInputMapUnsafe(node, InputMap.sequence(im, getInputMap(node)));\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/* Math Transform Functions */
// Acos - Vector Trigonometric ACOS | [
"func Acos(inReal []float64) []float64 {\n\toutReal := make([]float64, len(inReal))\n\tfor i := 0; i < len(inReal); i++ {\n\t\toutReal[i] = math.Acos(inReal[i])\n\t}\n\treturn outReal\n}"
] | [
"func (x LinXFade2) Rate(rate int8) Input {\n\tCheckRate(rate)\n\t(&x).defaults()\n\t// Not sure why Level doesn't show up in sclang's synthdefs that use LinXFade2\n\treturn NewInput(\"LinXFade2\", rate, 0, 1, x.A, x.B, x.Pan)\n}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Returns an AST where all operations of lower precedence are finalized. | [
"def _start_operation(self, ast, operation, precedence):\n \n if TRACE_PARSE:\n print(' start_operation:', repr(operation), 'AST:', ast)\n\n op_prec = precedence[operation]\n while True:\n if ast[1] is None:\n # [None, None, x]\n if T... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Seal indicates an expected call of Seal | [
"func (mr *MockSealerMockRecorder) Seal(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Seal\", reflect.TypeOf((*MockSealer)(nil).Seal), arg0, arg1, arg2, arg3)\n}"
] | [
"@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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
expr : expr GE expr | [
"def p_expr_GE_expr(p):\n \n p[0] = make_binary(p.lineno(2), 'GE', p[1], p[3], lambda x, y: x >= y)"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a human readable representation of the units in this number.
For complex units this takes the form of:
numerator_unit1 * numerator_unit2 / denominator_unit1 * denominator_unit2
@return [String] a string that represents the units in this number | [
"def unit_str\n rv = @numerator_units.sort.join(\"*\")\n if @denominator_units.any?\n rv << \"/\"\n rv << @denominator_units.sort.join(\"*\")\n end\n rv\n end"
] | [
"def is_dimensionless_standard_name(xml_tree, standard_name):\n '''\n \n '''\n # standard_name must be string, so if it is not, it is *wrong* by default\n if not isinstance(standard_name, basestring):\n return False\n found_standard_name = xml_tree.find(\".//entry[@id='{}']\".format(standar... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Ensures the HID function in the USB Android gadget driver is active | [
"async function enableHID() {\n const usbConfig = getstrprop('sys.usb.state');\n if (!usbConfig.startsWith('hid,')) {\n log.warn('HID function does not seem to be enabled.');\n const usbConfigWithHid = `hid,${usbConfig}`;\n log.info(`changing USB config to ${usbConfigWithHid}`);\n\n // WARNING! If th... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Create completely fresh Access + Refresh tokens.
@TODO Implement proper error handling
@return array | [
"protected function createNewTokens()\n {\n $logger = $this->getLogger();\n $logger->debug('Starting request to create fresh access & refresh tokens');\n\n $body = [\n 'client_id' => 'anonymous',\n 'grant_type' => 'password',\n 'response_type' => 'token',\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Get locale
Will extract locale from application, trying to get one from babel
first, then, if not available, will get one from app config | [
"def get_locale(self):\n \n if not self.locale:\n try:\n import flask_babel as babel\n self.locale = str(babel.get_locale()).lower()\n except ImportError:\n from flask import current_app\n self.locale = current_app.confi... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Language and programming:"
} |
// InheritedFlags returns all flags which were inherited from parent commands. | [
"func (c *Command) InheritedFlags() *flag.FlagSet {\n\tc.mergePersistentFlags()\n\n\tif c.iflags == nil {\n\t\tc.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\t\tif c.flagErrorBuf == nil {\n\t\t\tc.flagErrorBuf = new(bytes.Buffer)\n\t\t}\n\t\tc.iflags.SetOutput(c.flagErrorBuf)\n\t}\n\n\tlocal := c.Loca... | [
"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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// expandPath returns the absolute path of dir, relative to base if dir is relative path.
// base is expected to be an absolute path | [
"func expandPath(base, dir string) string {\n\tif filepath.IsAbs(dir) {\n\t\treturn filepath.Clean(dir)\n\t}\n\n\treturn filepath.Clean(filepath.Join(base, dir))\n}"
] | [
"def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
-------------------args----------------------------------------- | [
"def raw= (args)\n @original = args\n case args\n when String\n parse_from_string(args)\n when Hash\n args = { :area_code => PhoneNumber.default_area_code }.merge(args)\n NUMBER_PARTS.each do |key|\n send(\"#{key}=\", args[key]) if args[key]\n end\n when... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Print the diff to the last time the state of objects was measured.
keyword arguments
ignore -- list of objects to ignore | [
"def print_diff(self, ignore=[]):\n \n # ignore this and the caller frame\n ignore.append(inspect.currentframe()) #PYCHOK change ignore\n diff = self.get_diff(ignore)\n print(\"Added objects:\")\n summary.print_(summary.summarize(diff['+']))\n print(\"Removed objects... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// Init returns a new AUFS driver.
// An error is returned if AUFS is not supported. | [
"func Init(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {\n\t// Try to load the aufs kernel module\n\tif err := supportsAufs(); err != nil {\n\t\tlogger.Error(err)\n\t\treturn nil, graphdriver.ErrNotSupported\n\t}\n\n\t// Perform feature detection on /var/lib/docker/a... | [
"func (f *FS) GetVolumeInformation(ctx context.Context) (dokan.VolumeInformation, error) {\n\t// TODO should this be explicitely refused to other users?\n\t// As the mount is limited to current session there is little need.\n\treturn vinfo, nil\n}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
Submit ham that is incorrectly tagged as spam.
Using this function will make you a good citizen as it helps Akismet to learn from its mistakes. This will improve the service for everybody. | [
"public function submitHam()\n {\n $this->sendRequest($this->getQueryString(), $this->wordPressAPIKey . '.' . $this->akismetServer, '/' . $this->akismetVersion . '/submit-ham');\n }"
] | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// Finds the prefix of the given namespace if it has been declared
// in this node or in one of its parent | [
"func (node *Element) namespacePrefix(uri string) string {\n\tfor _, ns := range node.namespaces {\n\t\tif ns.Uri == uri {\n\t\t\treturn ns.Prefix\n\t\t}\n\t}\n\tif node.parent == nil {\n\t\treturn \"\"\n\t}\n\treturn node.parent.namespacePrefix(uri)\n}"
] | [
"void appendGoogRequiresTo(StringBuilder sb) {\n for (GoogRequire require : googRequires.values()) {\n // TODO(lukes): we need some namespace management here... though really we need namespace\n // management with all declarations... The problem is that a require could introduce a name\n // alias ... | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Display the traces and spikes in a given interval. | [
"def set_interval(self, interval=None, change_status=True,\n force_update=False):\n \"\"\"\"\"\"\n if interval is None:\n interval = self._interval\n interval = self._restrict_interval(interval)\n if not force_update and interval == self._interval:\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.