query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// StorageExecutors returns a channel on which new instances of all registered // storage executors can be received.
[ "func StorageExecutors() <-chan types.StorageExecutor {\n\tc := make(chan types.StorageExecutor)\n\tgo func() {\n\t\tstorExecsCtorsRWL.RLock()\n\t\tdefer storExecsCtorsRWL.RUnlock()\n\t\tfor _, ctor := range storExecsCtors {\n\t\t\tc <- ctor()\n\t\t}\n\t\tclose(c)\n\t}()\n\treturn c\n}" ]
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
If arg is a list with 1 element that corresponds to a valid file path, use set_io.grp to read the grp file. Otherwise, check that arg is a list of strings. Args: arg (list or None) Returns: arg_out (list or None)
[ "def _read_arg(arg):\n \n\n # If arg is None, just return it back\n if arg is None:\n arg_out = arg\n\n else:\n # If len(arg) == 1 and arg[0] is a valid filepath, read it as a grp file\n if len(arg) == 1 and os.path.exists(arg[0]):\n arg_out = grp.read(arg[0])\n el...
[ "def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa...
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Removes the given transaction ids from the invalid list. @param invalidTxIds transaction ids @return true if invalid list got changed, false otherwise
[ "public boolean truncateInvalidTx(Set<Long> invalidTxIds) {\n // guard against changes to the transaction log while processing\n txMetricsCollector.rate(\"truncateInvalidTx\");\n Stopwatch timer = new Stopwatch().start();\n this.logReadLock.lock();\n try {\n boolean success;\n synchronized ...
[ "private CompletableFuture<Void> commitTransactions(String scope, String stream, List<Long> segments,\n List<UUID> transactionsToCommit) {\n // Chain all transaction commit futures one after the other. This will ensure that order of commit\n...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
@param string $image @param string $template @return string
[ "public function thumbnailUrl($image, $template)\n {\n if (!$image || !$template) {\n return '';\n }\n\n $parts = explode(';', $image);\n $fileId = $parts[0];\n\n $src = $this->router->generate('frontendmedia_thumbnail', ['fileId' => $fileId, 'template' => $template]...
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Busca y devuelve una ruta que atienda al URI argumentado. @param string $metodo @param string|int $uri @return Ruta
[ "public function buscar($metodo, $uri)\n {\n// echo \"buscando - {$uri}<br/>\";\n // Verificamos si el argumento URI es un estado http\n if (is_int($uri)) {\n // Validamos si el estado http argumentado tiene ruta\n if (isset($this->rutas_simples[$uri])) {\n ...
[ "private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ...
codesearchnet
{ "query": "Represent the Github text about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// SendTextMessage implements the Chat interface.
[ "func (c *chatLocal) SendTextMessage(\n\tctx context.Context, tlfName tlf.CanonicalName, tlfType tlf.Type,\n\tconvID chat1.ConversationID, body string) error {\n\tc.data.lock.Lock()\n\tdefer c.data.lock.Unlock()\n\tconv, ok := c.data.convs[tlfType][tlfName][convID.String()]\n\tif !ok {\n\t\treturn errors.Errorf(\"C...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Populates this table form control with table row form controls (based on the data set with setData).
[ "public function populate(): void\n {\n foreach ($this->data as $data)\n {\n $this->rowFactory->createRow($this, $data);\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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Callback method to interact when the text is set. @param value the value of the table cell @return the string
[ "protected String onSetText(final Object value)\n\t{\n\t\tString text = \"Delete\";\n\t\tif (value != null)\n\t\t{\n\t\t\ttext = value.toString();\n\t\t}\n\t\treturn text;\n\t}" ]
[ "def rowsInserted(self, parent, start, end):\n \n\n super(LogView, self).rowsInserted(parent, start, end)\n\n # IMPORTANT: This must be done *after* the superclass to get\n # an accurate value of the delegate's height.\n self.scrollToBottom()" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetPreSignUp sets the PreSignUp field's value.
[ "func (s *LambdaConfigType) SetPreSignUp(v string) *LambdaConfigType {\n\ts.PreSignUp = &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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Grader report has its own decimal place settings so they are handled elsewhere.
[ "static function format_number($number) {\n $formatted = rtrim(format_float($number, 4),'0');\n if (substr($formatted, -1)==get_string('decsep', 'langconfig')) { //if last char is the decimal point\n $formatted .= '0';\n }\n return $formatted;\n }" ]
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Reads a datagram from the underlying stream. @return the contents of the datagram, or <code>null</code> if the datagram was received out-of-order.
[ "public synchronized Message readDatagram ()\n throws IOException, ClassNotFoundException\n {\n // read in the sequence number and determine if it's out-of-order\n int number = _uin.readInt();\n if (number <= _lastReceived) {\n return null;\n }\n _missedCount ...
[ "def _send_output(self, message_body=None):\n \n self._buffer.extend((bytes(b\"\"), bytes(b\"\")))\n msg = bytes(b\"\\r\\n\").join(self._buffer)\n del self._buffer[:]\n # If msg and message_body are sent in a single send() call,\n # it will avoid performance problems caused...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Close the comments for selected entries.
[ "def close_comments(self, request, queryset):\n \n queryset.update(comment_enabled=False)\n self.message_user(\n request, _('Comments are now closed for selected entries.'))" ]
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// countToRightWord returns then number of characters from the cursor to the // start of the next word.
[ "func (t *Terminal) countToRightWord() int {\n\tpos := t.pos\n\tfor pos < len(t.line) {\n\t\tif t.line[pos] == ' ' {\n\t\t\tbreak\n\t\t}\n\t\tpos++\n\t}\n\tfor pos < len(t.line) {\n\t\tif t.line[pos] != ' ' {\n\t\t\tbreak\n\t\t}\n\t\tpos++\n\t}\n\treturn pos - t.pos\n}" ]
[ "private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param Contracts\QueryEntity $meta @param Builder|null $query @param array $conditions @param string $boolean @return Builder @throws RuntimeException
[ "protected function getSubQuery(\n Contracts\\QueryEntity $meta,\n Builder $query = null,\n array $conditions = [],\n $boolean = 'and'\n ): Builder\n {\n $model = $meta->getModel();\n $query = $query ?? $model->newQuery();\n\n foreach ($conditions as $condition...
[ "public function getAll() : array\n {\n $fieldOptions = call_user_func($this->fieldOptionsLoader);\n TypeMismatchException::verifyAllInstanceOf(__METHOD__, '<return>', $fieldOptions, IFieldOption::class);\n return $fieldOptions;\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Add a response URL to the probe. @param label the string label for the respondTo address @param url the actual URL string
[ "public void addRespondToURL(String label, String url) {\n\n RespondToURL respondToURL = new RespondToURL();\n respondToURL.label = label;\n respondToURL.url = url;\n\n respondToURLs.add(respondToURL);\n\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 comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Development Server -- No Browser
[ "function headless(callback) {\n browserSync.init({\n server: {\n baseDir: \"./docs\"\n },\n open: false\n });\n watch(\"src/sass/**/*.scss\",{ ignoreInitial: false }, compileSass);\n watch(\"src/js/**/*.js\", { ignoreInitial: false }, compileJS);\n watch(\"src/index.html\", { ignoreInitial: fals...
[ "@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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// GetNodeIdFromIp returns a Node Id given an IP.
[ "func (c *ClusterManager) GetNodeIdFromIp(idIp string) (string, error) {\n\taddr := net.ParseIP(idIp)\n\tif addr != nil { // Is an IP, lookup Id\n\t\tc.nodeCacheLock.Lock()\n\t\tdefer c.nodeCacheLock.Unlock()\n\t\treturn c.nodeIdFromIp(idIp)\n\t}\n\n\treturn idIp, nil // return input, assume its an Id\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 Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
Check we're not committing to a blocked branch
[ "def run(files, temp_folder, arg=None):\n \"\"\n parser = get_parser()\n argos = parser.parse_args(arg.split())\n\n current_branch = bash('git symbolic-ref HEAD').value()\n current_branch = current_branch.replace('refs/heads/', '').strip()\n if current_branch in argos.branches:\n return (\"...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Render a dump for a string value. @param Model $model The data we are analysing. @return string The rendered markup.
[ "public function process(Model $model)\n {\n $data = $model->getData();\n\n // Check if this is a possible callback.\n // We are not going to analyse this further, because modern systems\n // do not use these anymore.\n if (function_exists($data) === true) {\n $model...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
@param InputArgument $argument @return array
[ "private function getInputArgumentData(InputArgument $argument)\n {\n return array(\n 'name' => $argument->getName(),\n 'is_required' => $argument->isRequired(),\n 'is_array' => $argument->isArray(),\n 'description' => preg_replace('/\\s*[\\r\\n]\\s*/', ' ', $ar...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// If a peer claims that it has 2/3 majority for given blockKey, call this. // NOTE: if there are too many peers, or too much peer churn, // this can cause memory issues. // TODO: implement ability to remove peers too
[ "func (hvs *HeightVoteSet) SetPeerMaj23(round int, type_ types.SignedMsgType, peerID p2p.ID, blockID types.BlockID) error {\n\thvs.mtx.Lock()\n\tdefer hvs.mtx.Unlock()\n\tif !types.IsVoteTypeValid(type_) {\n\t\treturn fmt.Errorf(\"SetPeerMaj23: Invalid vote type %v\", type_)\n\t}\n\tvoteSet := hvs.getVoteSet(round,...
[ "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 instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Handles updating codemirror with the current selection of themes. @param {CodeMirror} cm is the CodeMirror instance currently loaded
[ "function updateThemes(cm) {\n var newTheme = prefs.get(\"theme\"),\n cmTheme = (cm.getOption(\"theme\") || \"\").replace(/[\\s]*/, \"\"); // Normalize themes string\n\n // Check if the editor already has the theme applied...\n if (cmTheme === newTheme) {\n return;\n ...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// addPod adds the statefulset for the pod to the sync queue
[ "func (ssc *StatefulSetController) addPod(obj interface{}) {\n\tpod := obj.(*v1.Pod)\n\n\tif pod.DeletionTimestamp != nil {\n\t\t// on a restart of the controller manager, it's possible a new pod shows up in a state that\n\t\t// is already pending deletion. Prevent the pod from being a creation observation.\n\t\tss...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
(non-PHPdoc) @see \Zend\Mvc\Controller\AbstractRestfulController::getList()
[ "public function getList()\n {\n $routeMatch = $this->getEvent()->getRouteMatch();\n \n $type = $this->params('type', false);\n \n $alerts = $this->getAlertDataHandler()->getAlertsStructure($type);\n $response = $this->getResponse();\n $response->getHeaders()->add...
[ "public function init($moduleManager)\n {\n $event = $moduleManager->getEvent();\n $container = $event->getParam('ServiceManager');\n $serviceListener = $container->get('ServiceListener');\n\n $serviceListener->addServiceManager(\n 'FilterManager',\n 'filters',\n...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Performs weaving of functions in the current namespace, returns true if functions were processed, false otherwise @param Advisor[] $advisors List of advisors
[ "private function processFunctions(\n array $advisors,\n StreamMetaData $metadata,\n ReflectionFileNamespace $namespace\n ): bool {\n static $cacheDirSuffix = '/_functions/';\n\n $wasProcessedFunctions = false;\n $functionAdvices = $this->adviceMatcher->getAdvicesForFunc...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Swaps the current tab view for the inputed action's type. :param action | <QAction> :return <XView> || None
[ "def switchCurrentView(self, viewType):\n \n if not self.count():\n return self.addView(viewType)\n\n # make sure we're not trying to switch to the same type\n view = self.currentView()\n if type(view) == viewType:\n return view\n\n # create a new view...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// KnownWorkloadStatus returns true if status has a known value for a workload. // It includes every status that has ever been valid for a unit agent. // This is used by the apiserver client facade to filter out unknown values.
[ "func (status Status) KnownWorkloadStatus() bool {\n\tif ValidWorkloadStatus(status) {\n\t\treturn true\n\t}\n\tswitch status {\n\tcase Error: // include error so that we can filter on what the spec says is valid\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Get the qualified name of the given class, with '$' used to separate inner classes; the returned string can be used with Class.forName().
[ "public static String getLoadableName( TypeDeclaration jclass )\n {\n TypeDeclaration containingClass = jclass.getDeclaringType();\n \n if ( containingClass == null )\n {\n return jclass.getQualifiedName();\n }\n else\n {\n return getLoadable...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Expand around the predecessors of the given node in the result graph. :param pybel.BELGraph universe: The graph containing the stuff to add :param pybel.BELGraph graph: The graph to add stuff to :param node: A BEL node
[ "def expand_node_predecessors(universe, graph, node: BaseEntity) -> None:\n \n skip_successors = set()\n for successor in universe.successors(node):\n if successor in graph:\n skip_successors.add(successor)\n continue\n\n graph.add_node(successor, **universe.nodes[succes...
[ "def _collection_function_inclusion_builder(funcs: Iterable[str]) -> NodePredicate:\n \"\"\"\"\"\"\n funcs = set(funcs)\n\n if not funcs:\n raise ValueError('can not build function inclusion filter with empty list of functions')\n\n def functions_inclusion_filter(_: BELGraph, node: BaseEntity) ->...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
A module-level convenience method that creates a default bbcode parser, and renders the input string as HTML.
[ "def render_html(input_text, **context):\n \n global g_parser\n if g_parser is None:\n g_parser = Parser()\n return g_parser.format(input_text, **context)" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Determines that current argument must be of given type @return \Intervention\Image\Commands\Argument
[ "public function type($type)\n {\n $fail = false;\n\n $value = $this->value();\n\n if (is_null($value)) {\n return $this;\n }\n\n switch (strtolower($type)) {\n\n case 'bool':\n case 'boolean':\n $fail = ! is_bool($value);\n ...
[ "public Plugin.Factory.UsingReflection.ArgumentResolver toArgumentResolver() {\n return new Plugin.Factory.UsingReflection.ArgumentResolver.ForIndex.WithDynamicType(index, value);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Todo returns an HTTP 501 Not Implemented "todo" indicating that the // action isn't done yet.
[ "func (c *Controller) Todo() Result {\n\tc.Response.Status = http.StatusNotImplemented\n\tcontrollerLog.Debug(\"Todo: Not implemented function\", \"action\", c.Action)\n\treturn c.RenderError(&Error{\n\t\tTitle: \"TODO\",\n\t\tDescription: \"This action is not implemented\",\n\t})\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\tlog.G(ctx).Warnf(\"task updates not yet supported\")\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...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Applies a linear transformation: Y=XWT+b.
[ "def fully_connected(attrs, inputs, proto_obj):\n \"\"\"\"\"\"\n new_attrs = translation_utils._remove_attributes(attrs, ['axis'])\n\n new_attrs = translation_utils._fix_bias('FullyConnected', new_attrs, len(inputs))\n\n new_attrs = translation_utils._fix_channels('FullyConnected', new_attrs, inputs, pr...
[ "def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// MarshalJSON customizes the JSON representation used when serializing to the // CloudFormation template representation.
[ "func (rule CloudWatchEventsRule) MarshalJSON() ([]byte, error) {\n\truleJSON := map[string]interface{}{}\n\n\tif rule.Description != \"\" {\n\t\truleJSON[\"Description\"] = rule.Description\n\t}\n\tif nil != rule.EventPattern {\n\t\teventPatternString, err := json.Marshal(rule.EventPattern)\n\t\tif nil != err {\n\...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(CreateDirectoryRequest createDirectoryRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createDirectoryRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
获取js api ticket 超时后会自动重新获取JsApiTicket并触发self::EVENT_AFTER_JS_API_TICKET_UPDATE事件 @param bool $force 是否强制获取 @return mixed @throws HttpException
[ "public function getJsApiTicket($force = false)\n {\n $time = time(); // 为了更精确控制.取当前时间计算\n $cache_name = 'wechat_jsapi_ticket_' . $this->corpId . '_' . $this->app;\n if ($this->_jsApiTicket === null || $this->_jsApiTicket['expire'] < $time || $force) {\n $result = $this->_jsApiTic...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// load template into primary storage
[ "func (c *Client) PrepareTemplate(p *PrepareTemplateParameter) (*Template, error) {\n\tobj, err := c.Request(\"prepareTemplate\", convertParamToMap(p))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*Template), err\n}" ]
[ "function (name) {\n // initialize module instance with default module configuration\n _.merge(this, defaultModuleConfig)\n // set app name\n this.name = name\n // set absolute path of base directory for module\n this.base = getBase()\n // store reference to global app\n this.immutableApp = ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Remove an item from the cache. :param key: The cache key :type key: str :rtype: bool
[ "def forget(self, key):\n \n if key in self._storage:\n del self._storage[key]\n\n return True\n\n return False" ]
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Use this API to fetch all the dnsmxrec resources that are configured on netscaler.
[ "public static dnsmxrec[] get(nitro_service service, options option) throws Exception{\n\t\tdnsmxrec obj = new dnsmxrec();\n\t\tdnsmxrec[] response = (dnsmxrec[])obj.get_resources(service,option);\n\t\treturn response;\n\t}" ]
[ "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 description about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code about Software development:" }
// SetBatchReferenceName sets the BatchReferenceName field's value.
[ "func (s *BatchDetachObject) SetBatchReferenceName(v string) *BatchDetachObject {\n\ts.BatchReferenceName = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
@param Path $path @param int $from @param int $to @return Path @throws Exception
[ "public static function createWithoutTransition(Path $path, int $from, int $to): Path\n {\n $fromPlaces = $path->getPlacesAt($from);\n $toPlaces = $path->getPlacesAt($to);\n if (count($fromPlaces) > 1 && count($toPlaces) > 1 && 1 === count(array_diff($fromPlaces, $toPlaces)) &&\n ...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Removes the given foreign key from the table. @param string|array $columns Column(s) @param null|string $constraint Constraint names @return Table
[ "public function dropForeignKey($columns, $constraint = null)\n {\n if (is_string($columns)) {\n $columns = [$columns];\n }\n if ($constraint) {\n $this->getAdapter()->dropForeignKey($this->getName(), [], $constraint);\n } else {\n $this->getAdapter()-...
[ "public function addConstraints()\n {\n if (static::$constraints)\n {\n // Get the parent node's placeholder.\n $parentNode = $this->query->getQuery()->modelAsNode($this->parent->getTable());\n // Tell the query that we need the morph model and the relationship repr...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Update the retry status of a job in a retry array. @param \Laravel\Horizon\JobPayload $payload @param array $retries @param bool $failed @return array
[ "protected function updateRetryStatus(JobPayload $payload, $retries, $failed)\n {\n return collect($retries)->map(function ($retry) use ($payload, $failed) {\n return $retry['id'] === $payload->id()\n ? Arr::set($retry, 'status', $failed ? 'failed' : 'completed')\n ...
[ "public function update(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"patch\", $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 Laravel:", "pos": "Represent the code about Laravel:", "neg": "Represent the code about programming:" }
Reformat the result. @param object $result @return mixed
[ "public function reformatResult($result)\n {\n $collection = new Collection($result);\n \n switch ($this->format) {\n case 'json':\n return $collection->toJson();\n break;\n\n case 'object':\n return json_decode(json_encode($c...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
add a new component to the dictionary @param comp
[ "public void addChemComp(ChemComp comp){\n\n\t\tdictionary.put(comp.getId(),comp);\n\t\tString rep = comp.getPdbx_replaces();\n\t\tif ( (rep != null) && ( ! rep.equals(\"?\"))){\n\t\t\treplaces.put(comp.getId(),rep);\n\t\t}\n\n\t\tString isrep = comp.getPdbx_replaced_by();\n\t\tif ( (isrep != null) && ( ! isrep.equ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parses the request query string for `fields` Converse it into a Mongo friendly `fields` Object Example: `?fields=hello,world,foo.bar` @param {Object} req @return {Object}
[ "function(req) {\n var fields = {};\n\n // Fields\n if (_.isString(req.query.fields)) {\n _.forEach(req.query.fields.split(','), function(field) {\n fields[field] = 1;\n });\n }\n\n return fields;\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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// URL accepts a number of URLs directly.
[ "func (b *Builder) URL(httpAttemptCount int, urls ...*url.URL) *Builder {\n\tfor _, u := range urls {\n\t\tb.paths = append(b.paths, &URLVisitor{\n\t\t\tURL: u,\n\t\t\tStreamVisitor: NewStreamVisitor(nil, b.mapper, u.String(), b.schema),\n\t\t\tHttpAttemptCount: httpAttemptCount,\n\t\t})\n\t}\n\tret...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Opens the storage (if not already open) and returns the storage object. @param storageType @return
[ "private DB openStorage(StorageType storageType) {\n DB storage = storageRegistry.get(storageType);\n if(!isOpenStorage(storage)) {\n DBMaker m;\n if(storageType == StorageType.PRIMARY_STORAGE || storageType == StorageType.SECONDARY_STORAGE) {\n //main storage\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
:parameter `is_function_abi` is used to distinguish function abi from contract abi Returns a dictionary of the transaction that could be used to call this TODO: make this a public API TODO: add new prepare_deploy_transaction API
[ "def prepare_transaction(\n address,\n web3,\n fn_identifier,\n contract_abi=None,\n fn_abi=None,\n transaction=None,\n fn_args=None,\n fn_kwargs=None):\n \n if fn_abi is None:\n fn_abi = find_matching_fn_abi(contract_abi, fn_identifier, fn_args, ...
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetIPSetId sets the IPSetId field's value.
[ "func (s *UpdateIPSetInput) SetIPSetId(v string) *UpdateIPSetInput {\n\ts.IPSetId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Note: copied from CoffeeScript compiled file TODO: redactor
[ "function() {\n var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successR...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
setHiddenProperty - description @param {type} obj target object @param {type} key property name @param {type} value default value @return {type} target object
[ "function setHiddenProperty(obj, key, value) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n value: value\n });\n return value;\n}" ]
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
paralell map for multiprocessing
[ "def parmap(f, X, nprocs=multiprocessing.cpu_count()):\n \n q_in = multiprocessing.Queue(1)\n q_out = multiprocessing.Queue()\n\n proc = [multiprocessing.Process(target=fun, args=(f, q_in, q_out))\n for _ in range(nprocs)]\n for p in proc:\n p.daemon = True\n p.start()\n\n ...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Build header response context.
[ "private function buildHeaderResponse()\n {\n foreach (explode(\n \"\\n\",\n substr($this->output, 0, $this->info['header_size'])\n ) as $val) {\n $val = trim($val);\n if (! empty($val)) {\n $this->headerResponse[] = $val;\n }\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Entry point to the Example. @param args unused
[ "public static void main(String[] args) {\n\t\tStopwatch stopwatch = SimonManager.getStopwatch(\"stopwatch\");\n\t\tfor (int i = 1; i <= 10; i++) {\n\t\t\ttry (Split ignored = SimonManager.getStopwatch(\"stopwatch\").start()) {\n\t\t\t\tExampleUtils.waitRandomlySquared(50);\n\t\t\t}\n\t\t\tSystem.out.println(\"Stop...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
2016-05-08 2017-03-26 Вызов этого метода приводит к добавлению транзакции: https://github.com/mage2pro/core/blob/2.4.2/Payment/W/Nav.php#L100-L114 @used-by dfp_action() @param OP $op @param string $action
[ "final static function action(OP $op, $action) {\n\t\t$op->processAction($action, $o = df_order($op));\n\t\t$op->updateOrder($o, O::STATE_PROCESSING, df_order_ds(O::STATE_PROCESSING), true);\n\t}" ]
[ "function execute(O $o) {\n\t\t$c = df_customer($o['customer']); /** @var Customer $c */\n\t\t$s = df_customer_session(); /** @var Session $s */\n\t\tif ($s->getDfSsoId()) {\n\t\t\t$c[Schema::fIdC($s->getDfSsoProvider())] = $s->getDfSsoId();\n\t\t\t/**\n\t\t\t * 2016-12-04\n\t\t\t * Нельзя использовать здесь @see d...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Finds any method matching the method name and parameter types.
[ "public static Method findDeclaredMethod(Class<?> cl, Method testMethod)\n {\n if (cl == null)\n return null;\n \n for (Method method : cl.getDeclaredMethods()) {\n if (isMatch(method, testMethod))\n return method;\n }\n \n return null;\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Does this permission key have a form (located at elements/permission/keys/<handle>.php)? @return bool
[ "public function hasCustomOptionsForm()\n {\n $app = Application::getFacadeApplication();\n $locator = $app->make(FileLocator::class);\n $pkgHandle = $this->getPackageHandle();\n if ($pkgHandle) {\n $locator->addLocation(new FileLocator\\PackageLocation($pkgHandle));\n ...
[ "def value(self, value):\n \n self.client.nowait(\n 'set_field', (Literal('browser'), self.element, value))" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Makes module asynchronous
[ "function( time, callback ) {\n\t\tvar self = this, timeid;\n\n\t\t// Can only delay an active module\n\t\tself.requireState( munit.ASSERT_STATE_ACTIVE, self.delay );\n\n\t\t// Time parameter is required\n\t\tif ( ! munit.isNumber( time ) ) {\n\t\t\tthrow new munit.AssertionError( \"Time parameter not passed to ass...
[ "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:" }
RAID a list of files / directories @throws InterruptedException
[ "void doRaid(Configuration conf, PolicyInfo info, List<EncodingCandidate> paths)\n throws IOException {\n int targetRepl = Integer.parseInt(info.getProperty(\"targetReplication\"));\n int metaRepl = Integer.parseInt(info.getProperty(\"metaReplication\"));\n Codec codec = Codec.getCodec(info.getCodecId...
[ "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:" }
// Get retrieves the given key if it's present in the key-value store.
[ "func (db *Database) Get(key []byte) ([]byte, error) {\n\tdat, err := db.db.Get(key, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dat, nil\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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns an list containing all of the given elements @param target @return
[ "@SuppressWarnings(\"unchecked\")\n\tpublic static <T, I> List<T> asList(I... target) {\n\t\treturn (List<T>) Arrays.asList(asArray(target));\n\t}" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetHealthCheckPort sets the HealthCheckPort field's value.
[ "func (s *EndpointGroup) SetHealthCheckPort(v int64) *EndpointGroup {\n\ts.HealthCheckPort = &v\n\treturn s\n}" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create a wrapper for the given target. When the target is a directory, then the type overridden with "Directory". @param string $base @param string $type @return AbstractWrapper
[ "protected function getWrapperInstance($base, $type = 'Directory')\n {\n $wrapper = $this->getWrapperClass($type);\n\n if ( ! $wrapper) {\n throw new \\InvalidArgumentException(\n sprintf(\n '<error>Unknown wrapper-type \"%s\"</error>',\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about File management:" }
// putChaincodeCollectionData adds collection data for the chaincode
[ "func (lscc *LifeCycleSysCC) putChaincodeCollectionData(stub shim.ChaincodeStubInterface, cd *ccprovider.ChaincodeData, collectionConfigBytes []byte) error {\n\tif cd == nil {\n\t\treturn errors.New(\"nil ChaincodeData\")\n\t}\n\n\tif len(collectionConfigBytes) == 0 {\n\t\tlogger.Debug(\"No collection configuration...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Set single option @param string $name name of option @param mixed $value value of option @return self
[ "public function setOption($name, $value)\n {\n $method = 'set' . ucfirst($name);\n if (method_exists($this, $method) && $method !== __FUNCTION__) {\n return $this->$method($value);\n }\n\n $this->options[$name] = $value;\n return $this;\n }" ]
[ "public function fields( $name )\n {\n if( $this->fields instanceof FieldCollection ) {\n $this->fields->field($name); //Sets active field\n }\n return $this->fields; // Is a direct access to the property\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Helper for dynamically defining writer method @param [Symbol] k - name of attribute @param [Hash] definition - See docstring for schema above
[ "def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\...
[ "def attributes_properties(**options)\n options_set = Set.new options.keys.map(&:to_s)\n\n unless options_set.subset? Set.new(@fields)\n fail \"You have to provide correct attribute names in\" +\n \"'attributes_properties' for '#{@model}'.\"\n end\n\n # TODO: Check for valid v...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Read returns a charm bundle from the directory. If no bundle exists yet, // one will be downloaded and validated and copied into the directory before // being returned. Downloads will be aborted if a value is received on abort.
[ "func (d *BundlesDir) Read(info BundleInfo, abort <-chan struct{}) (Bundle, error) {\n\tpath := d.bundlePath(info)\n\tif _, err := os.Stat(path); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := d.download(info, path, abort); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Set a dns cache entry. @param expireMillis expire time in milliseconds. @param host host @param ips ips @throws DnsCacheManipulatorException Operation fail
[ "public static void setDnsCache(long expireMillis, String host, String... ips) {\n try {\n InetAddressCacheUtil.setInetAddressCache(host, ips, System.currentTimeMillis() + expireMillis);\n } catch (Exception e) {\n final String message = String.format(\"Fail to setDnsCache for ho...
[ "def get_sds_by_ip(self,ip):\n \n if self.conn.is_ip_addr(ip):\n for sds in self.sds:\n for sdsIp in sds.ipList:\n if sdsIp == ip:\n return sds\n raise KeyError(\"SDS of that name not found\")\n else:\n ra...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS Route 53:" }
// Criticalln is equivalent to log.Criticalln().
[ "func (l *Logger) Criticalln(v ...interface{}) {\n\tl.Fprint(l.flags, LEVEL_CRITICAL, 2, fmt.Sprintln(v...), nil)\n}" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Get a single non-slice index.
[ "def _getitem(self, index):\n \"\"\"\"\"\"\n row = self._records[index]\n if row is not None:\n pass\n elif self.is_attached():\n # need to handle negative indices manually\n if index < 0:\n index = len(self._records) + index\n r...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Create a hyper error given a superagent response @param {Response} res
[ "function HyperError(res) {\n Error.call(this);\n Error.captureStackTrace(this, arguments.callee);\n this.name = 'HyperError';\n this.status = res.status;\n if (res.body && res.body.error) this.message = res.body.error.message;\n else this.message = res.text;\n}" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// IsMaster returns a boolean that represents whether the given // machine's peer address is the primary mongo host for the replicaset
[ "func IsMaster(session *mgo.Session, obj WithAddresses) (bool, error) {\n\taddrs := obj.Addresses()\n\n\tmasterHostPort, err := replicaset.MasterHostPort(session)\n\n\t// If the replica set has not been configured, then we\n\t// can have only one master and the caller must\n\t// be that master.\n\tif err == replica...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Starts with an incomplete set of group generators in `permutations` and expands it to include all possible combinations. Ways to complete group: - combinations of permutations pi x pj - combinations with itself p^k
[ "public void completeGroup() {\n\t\t// Copy initial set to allow permutations to grow\n\t\tList<List<Integer>> gens = new ArrayList<List<Integer>>(permutations);\n\t\t// Keep HashSet version of permutations for fast lookup.\n\t\tSet<List<Integer>> known = new HashSet<List<Integer>>(permutations);\n\t\t//breadth-fir...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// Given a handle to a HCL object, this transforms it into the Terraform config
[ "func loadTerraformHcl(list *ast.ObjectList) (*Terraform, error) {\n\tif len(list.Items) > 1 {\n\t\treturn nil, fmt.Errorf(\"only one 'terraform' block allowed per module\")\n\t}\n\n\t// Get our one item\n\titem := list.Items[0]\n\n\t// This block should have an empty top level ObjectItem. If there are keys\n\t// ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about container management:", "pos": "Represent the code about container management:", "neg": "Represent the code:" }
Get icon size config @param \ElggEntity $entity Entity @param array $icon_sizes Predefined icon sizes @return array
[ "public function getSizes(\\ElggEntity $entity, array $icon_sizes = array()) {\n\n\t\t$defaults = ($entity && $entity->getSubtype() == 'file') ? $this->config->getFileIconSizes() : $this->config->getGlobalIconSizes();\n\t\t$sizes = array_merge($defaults, $icon_sizes);\n\n\t\treturn elgg_trigger_plugin_hook('entity:...
[ "public function forElement(Element $el)\n {\n // Add help\n $this->model($el)->blockhelp($el->help);\n\n // Populate the image array with the image instance. This will create an\n // Image instance from the default value if it doesn't exist.\n $pop = app('former.populator')->...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Compiles the current configuration to a valid PHP snippet. @return string
[ "public function compile()\n {\n $this->doLoad();\n\n $data = (array) $this->data;\n\n $this->removeKey($data, 'include');\n $this->removeKey($data, '__META__');\n\n return var_export($data, true);\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Set the color using an Nx4 array of RGBA floats
[ "def rgba(self, val):\n \"\"\"\"\"\"\n # Note: all other attribute sets get routed here!\n # This method is meant to do the heavy lifting of setting data\n rgba = _user_to_rgba(val, expand=False)\n if self._rgba is None:\n self._rgba = rgba # only on init\n else...
[ "def narray=(image)\n raise ArgumentError, \"Invalid argument 'image'. Expected NArray, got #{image.class}.\" unless image.is_a?(NArray)\n raise ArgumentError, \"Invalid argument 'image'. Expected two-dimensional NArray, got #{image.shape.length} dimensions.\" unless image.shape.length == 2\n raise A...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* Add a task or branch to an existing branch.
[ "function(branch, child) {\n // Validate.\n if (!isBranch(branch)) {\n assert(false);\n }\n if (!isBranchOrTask(child)) {\n assert(false);\n }\n\n // Branch already contains a child with the same name.\n if (branchContainsChild(branch, child)) {\n assert(false);\n }\n\n // Add child and then sort ...
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Perform a new HLR lookup.
[ "def lookup_hlr_create(self, phonenumber, params=None):\n \"\"\"\"\"\"\n if params is None: params = {}\n return HLR().load(self.request('lookup/' + str(phonenumber) + '/hlr', 'POST', params))" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Adds an entity to the repo @param object $entity The entity to add @return void @throws OrmException if the entity could not be added
[ "public function add($entity)\n {\n foreach ($this->restrictions as $preset) {\n if ($preset['op'] == Operator::EQUAL) {\n $property = Normalise::toVariable($preset['field']);\n $entity->$property = $preset['value'];\n }\n }\n\n $t...
[ "public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Yield dependants of `project_name`.
[ "def get_dependants(project_name):\n \"\"\"\"\"\"\n for package in get_installed_distributions(user_only=ENABLE_USER_SITE):\n if is_dependant(package, project_name):\n yield package.project_name" ]
[ "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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetTags sets the Tags field's value.
[ "func (s *CreateHsmClientCertificateInput) SetTags(v []*Tag) *CreateHsmClientCertificateInput {\n\ts.Tags = 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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Partial objects do not serialize correctly in python2.x -- this fixes the bugs
[ "def save_partial(self, obj):\n \"\"\"\"\"\"\n self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Destruye los datos e la session de la base de datos @param string $sessionId @return boolean
[ "public function destroy($sessionId){\n //si la sesión está abierta y tengo lock \n if($this->opened){\n $sql= $this->connection->connection->prepare('DELETE FROM sessions WHERE session_id = :id');\n $sql->bindValue('id', $sessionId);\n return $sql->execute() === TRUE;...
[ "public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{\n DFAgentDescription dfd = new DFAgentDescription();\n ServiceDescription sd = new ServiceDescription();\n \n sd.setType(serviceType);\n sd.setName(serviceName);\n \...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Register checkers.
[ "def register_checkers(linter):\n \"\"\"\"\"\"\n linter.register_checker(ModelChecker(linter))\n linter.register_checker(DjangoInstalledChecker(linter))\n linter.register_checker(JsonResponseChecker(linter))\n linter.register_checker(FormChecker(linter))" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param XMLReader $reader @return string
[ "public static function readerNode(XMLReader $reader)\n {\n switch ($reader->nodeType) {\n case XMLREADER::NONE:\n return '%(0)%';\n\n case XMLReader::ELEMENT:\n return XMLBuild::startTag($reader->name, new XMLAttributeIterator($reader));\n\n ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
{@inheritDoc} initialize the validator. @see javax.validation.ConstraintValidator#initialize(java.lang.annotation.Annotation)
[ "@Override\n public final void initialize(final AlternateSize pconstraintAnnotation) {\n size1 = pconstraintAnnotation.size1();\n size2 = pconstraintAnnotation.size2();\n ignoreWhiteSpaces = pconstraintAnnotation.ignoreWhiteSpaces();\n ignoreMinus = pconstraintAnnotation.ignoreMinus();\n ignoreSlash...
[ "public <T> VoidFunction<T> voidFunction(Class<? extends VoidFunction<T>> springBeanClass) {\n return new SpringVoidFunction<>(springConfigurationClass, springBeanClass);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Factory of callback functions to be used as 'exit' listener by PhantomJS processes. @param {Object} cfg @param {Object} state @param {Integer} n @return {Function}
[ "function (cfg, state, n) {\n // Node 0.8 and 0.10 differently handle spawning errors ('exit' vs 'error'), but errors that happened after\n // launching the command are both handled in 'exit' callback\n return function (code, signal) {\n // See http://tldp.org/LDP/abs/html/exitcodes....
[ "function (err, node, next) {\n var func = node.action + 'Action';\n var obj = eval(func + '(node.params)');\n logger.log('debug', 'M|actionQueue::execute|obj=%j', +obj, meta);\n return null;\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
return the constructor name if "defined" and "valid" of the value, otherwise return Object.prototype.toString @param {*} value @returns {String}
[ "function typeOf(value, options) {\n if (value === undefined) return '#Undefined';\n if (value === null) return '#Null';\n if (options !== 'forceObjectToString') {\n var constructor = getConstructor(value);\n if (constructor !== null) {\n ...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetPlaybackMode sets the PlaybackMode field's value.
[ "func (s *GetHLSStreamingSessionURLInput) SetPlaybackMode(v string) *GetHLSStreamingSessionURLInput {\n\ts.PlaybackMode = &v\n\treturn s\n}" ]
[ "public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
{@inheritDoc} @param result @param report @param reportId @throws IOException
[ "@Override\n protected void loadReport(ReportsConfig result, File report, String reportId) throws IOException {\n // Need to refresh? -- CahcedReport should be made abstract and the type should define which class to use\n // and what refresh checking method is used.\n if (!cache.containsKey(...
[ "@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 post about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code:" }
Create {@link HttpClient} instance. @return HttpClient instance from db properties.
[ "@SneakyThrows\n public HttpClient createHttpClient() {\n val builder = new StdHttpClient.Builder()\n .url(couchDbProperties.getUrl())\n .maxConnections(couchDbProperties.getMaxConnections())\n .maxCacheEntries(couchDbProperties.getMaxCacheEntries())\n .connecti...
[ "public static InternalLogApi getLog(String name) {\n return factoryConfigured\n ? factory.doGetLog(name)\n : new InternalLog(name); // will look up actual logger per log\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SetPermissionsBoundary sets the PermissionsBoundary field's value.
[ "func (s *User) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *User {\n\ts.PermissionsBoundary = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Shows a file chooser and exports the plot to the selected image file. @throws IOException if an error occurs during writing.
[ "public void save() throws IOException {\n JFileChooser fc = FileChooser.getInstance();\n fc.setFileFilter(FileChooser.SimpleFileFilter.getWritableImageFIlter());\n fc.setAcceptAllFileFilterUsed(false);\n fc.setSelectedFiles(new File[0]);\n int returnVal = fc.showSaveDialog(this);...
[ "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Process input text in the PLAINTEXT state @return int The next state index
[ "protected function plaintextState() {\n\t\t$this->emitRawTextRange( true, $this->pos, $this->length - $this->pos );\n\t\treturn self::STATE_EOF;\n\t}" ]
[ "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:" }
// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
[ "func (vun *vun) MonthAbbreviated(month time.Month) string {\n\treturn vun.monthsAbbreviated[month]\n}" ]
[ "func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about datetime:" }
Adds the given triple as a condition. @param string $subject @param string $predicate @param string $object @return self @throws InvalidArgumentException
[ "public function where( $subject, $predicate, $object ) {\n\t\t$this->expressionValidator->validate( $subject,\n\t\t\tExpressionValidator::VALIDATE_VARIABLE | ExpressionValidator::VALIDATE_PREFIXED_IRI\n\t\t);\n\t\t$this->expressionValidator->validate( $predicate,\n\t\t\tExpressionValidator::VALIDATE_VARIABLE | Exp...
[ "public function setMustPass($ref)\n {\n if (null!==$this->getMask($ref)) {\n $this->must_pass = $ref;\n } else {\n throw new \\Exception(sprintf(\"Unknown standard [%s] in Hostname validation!\", $ref));\n }\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// fsRemoveMeta safely removes a locked file and takes care of Windows special case
[ "func fsRemoveMeta(ctx context.Context, basePath, deletePath, tmpDir string) error {\n\t// Special case for windows please read through.\n\tif runtime.GOOS == globalWindowsOSName {\n\t\t// Ordinarily windows does not permit deletion or renaming of files still\n\t\t// in use, but if all open handles to that file wer...
[ "static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Perform Injection. For EE
[ "@Override\n public <T> void aroundInject(final InjectionContext<T> injectionContext) {\n\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"Annotations: \" + injectionContext.getAnnotatedType());\n }\n\n if (TraceComponent.isAnyTracingEnabled() ...
[ "func Beep(freq float64, duration int) (err error) {\n\tdefer func() {\n\t\te := recover()\n\n\t\tif e == nil {\n\t\t\treturn\n\t\t}\n\n\t\tif e, ok := e.(*js.Error); ok {\n\t\t\terr = e\n\t\t} else {\n\t\t\tpanic(e)\n\t\t}\n\t}()\n\n\ta := js.Global().Get(\"document\").Call(\"createElement\", \"audio\")\n\ta.Set(\...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }