query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// Trunks returns a list of trunks.
[ "func (b *BigIP) Trunks() (*Trunks, error) {\n\tvar trunks Trunks\n\terr, _ := b.getForEntity(&trunks, uriNet, uriTrunk)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &trunks, nil\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetNodeGroupsToRetain sets the NodeGroupsToRetain field's value.
[ "func (s *ModifyReplicationGroupShardConfigurationInput) SetNodeGroupsToRetain(v []*string) *ModifyReplicationGroupShardConfigurationInput {\n\ts.NodeGroupsToRetain = 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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Initialize the superuser role. @return void
[ "protected function initSURole() : void\n {\n $this->stdout(\"Init SU role \\n\", Console::FG_YELLOW);\n $this->authManager->removeAll();\n $su = $this->authManager->createRole(Rbac::R_SU);\n $su->description = 'Super User';\n $this->authManager->add($su);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Reads the configuration for a given xpath and stored all results in a list.<p> @param configuration the configuration to read from @param xpath the xpath prefix @return list of CmsContentCheckProperetyObject objects
[ "private List getConfiguredChecks(CmsXmlContent configuration, String xpath) {\n\n List checks = new ArrayList();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_PROPERTY_CONFIG_XPATH_2, xpath, m_locale));\n }\n\n int size = config...
[ "def run(configObj=None, input_dict={}, loadOnly=False):\n \n # If called from interactive user-interface, configObj will not be\n # defined yet, so get defaults using EPAR/TEAL.\n #\n # Also insure that the input_dict (user-specified values) are folded in\n # with a fully populated configObj inst...
codesearchnet
{ "query": "Represent the Github comment about Documentation:", "pos": "Represent the Github code about Documentation:", "neg": "Represent the Github code:" }
// If a byte array is less than the number of bytes specified by // ecdsaPrivateKeySize, left-zero-pad the byte array until // it is the required size.
[ "func ensurePrivateKeySize(payload []byte) []byte {\n\tfinal := payload\n\tif len(payload) < ecdsaPrivateKeySize {\n\t\tfinal = make([]byte, ecdsaPrivateKeySize)\n\t\tcopy(final[ecdsaPrivateKeySize-len(payload):], payload)\n\t}\n\treturn final\n}" ]
[ "@Override\n public Message deserialize(ByteBuffer in) throws ProtocolException, IOException {\n // A Bitcoin protocol message has the following format.\n //\n // - 4 byte magic number: 0xfabfb5da for the testnet or\n // 0xf9beb4d9 for production\n //...
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
Creates an {@code outcome} tag based on the status of the given {@code response}. @param response the container response @return the outcome tag derived from the status of the response
[ "public static Tag outcome(ContainerResponse response) {\n if (response != null) {\n int status = response.getStatus();\n switch (Response.Status.Family.familyOf(status)) {\n case INFORMATIONAL:\n return OUTCOME_INFORMATIONAL;\n\n case SU...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github summarization about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about programming:" }
// WeekdayShort returns the locales short weekday given the 'weekday' provided
[ "func (ml *ml_IN) WeekdayShort(weekday time.Weekday) string {\n\treturn ml.daysShort[weekday]\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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about datetime:" }
{@inheritDoc} @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
[ "public function run(JsUtils $js){\n\t\tif(!isset($this->_bsComponent)){\n\t\t\tif(isset($this->close)){\n\t\t\t\t$js->execOn(\"click\", \"#\".$this->identifier.\" .close\", \"$(this).closest('.message').transition({$this->_closeTransition})\");\n\t\t\t}\n\t\t\tif(isset($this->_timeout)){\n\t\t\t\t$js->exec(\"setTi...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Replacing the former CSS length value with the later one, with adjustment to the length unit.
[ "function replaceCssLength( length1, length2 ) {\r\n\t\tvar parts1 = cssLengthRegex.exec( length1 ),\r\n\t\t\tparts2 = cssLengthRegex.exec( length2 );\r\n\r\n\t\t// Omit pixel length unit when necessary,\r\n\t\t// e.g. replaceCssLength( 10, '20px' ) -> 20\r\n\t\tif ( parts1 ) {\r\n\t\t\tif ( !parts1[ 2 ] && parts2[...
[ "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:" }
Refresh speculative task candidates and running tasks. This needs to be called periodically to obtain fresh values.
[ "void refresh(long now) {\n refreshCandidateSpeculativeMaps(now);\n refreshCandidateSpeculativeReduces(now);\n refreshTaskCountsAndWaitTime(TaskType.MAP, now);\n refreshTaskCountsAndWaitTime(TaskType.REDUCE, now);\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Gets the FriendGroup that contains this friend. @return the FriendGroup that currently contains this Friend or null if this Friend is not in a FriendGroup.
[ "public FriendGroup getGroup() {\r\n\t\tfinal Collection<RosterGroup> groups = get().getGroups();\r\n\t\tif (groups.size() > 0) {\r\n\t\t\treturn new FriendGroup(api, con, get().getGroups().iterator()\r\n\t\t\t\t\t.next());\r\n\t\t}\r\n\t\treturn null;\r\n\t}" ]
[ "function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Extract the s2config and the content from the raw page text.
[ "def _parse_text(self, page_text):\n \"\"\"\"\"\"\n\n # 1 sanitize: remove leading blank lines\n # 2 separate \"config text\" from content, store content\n # 3 convert config text + \\n to obtain Meta, this is the config.\n\n lines = page_text.split('\\n')\n i = 0\n ...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
@param RefClass $refClass @param string $member @return mixed @throws MarkupException
[ "private function getConstantValue(RefClass $refClass, $member)\n {\n if (!isset($refClass->constants[$member])) {\n throw new MarkupException(sprintf('constant %s::%s does not exist', $refClass->name, $member));\n }\n\n return $refClass->constants[$member]->value;\n }" ]
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Sends the initial message to be sent to the proxy server. This method also starts a timeout task which marks the {@link #connectPromise} as failure if the connection attempt does not success within the timeout.
[ "private void sendInitialMessage(final ChannelHandlerContext ctx) throws Exception {\n final long connectTimeoutMillis = this.connectTimeoutMillis;\n if (connectTimeoutMillis > 0) {\n connectTimeoutFuture = ctx.executor().schedule(new Runnable() {\n @Override\n ...
[ "boolean detectAndHandleBackupTimeout(long timeoutMillis) {\n // if the backups have completed, we are done; this also filters out all non backup-aware operations\n // since the backupsAcksExpected will always be equal to the backupsAcksReceived\n boolean backupsCompleted = backupsAcksExpected ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Converts a token to an operation.
[ "private Op compile(Token tok, Op next, boolean reverse) {\r\n\t\tOp ret;\r\n\t\tswitch (tok.type) {\r\n\t\tcase Token.DOT:\r\n\t\t\tret = Op.createDot();\r\n\t\t\tret.next = next;\r\n\t\t\tbreak;\r\n\r\n\t\tcase Token.CHAR:\r\n\t\t\tret = Op.createChar(tok.getChar());\r\n\t\t\tret.next = next;\r\n\t\t\tbreak;\r\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\r\n\tpublic EClass getIfcFlowTreatmentDeviceType() {\r\n\t\tif (ifcFlowTreatmentDeviceTypeEClass == null) {\r\n\t\t\tifcFlowTreatmentDeviceTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(293);\r\n\t\t}\r\n\t\treturn ifcFlowTreatmentDev...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github instruction about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
// Trust returns whether the platform has the root cert in the trusted store.
[ "func (p Platform) Trust(root *x509.Certificate) bool {\n\t// the key store is empty iff the platform doesn't carry a root store and trust whatever root store\n\t// is supplied. An example is Chrome. Such platforms should not show up in the untrusted platform\n\t// list. So always return true here. Also this won't ...
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param AbstractGenerator $proxyGenerator @throws \ReflectionException
[ "protected function generateSetterProxy(AbstractGenerator $proxyGenerator)\n {\n $methodName = 'set'.StringUtil::camelize($this->propertyName);\n if (!$proxyGenerator->getReflection()->hasMethod($methodName)) {\n $proxyGenerator->addError(\n sprintf(\n '...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Stats returns number of bytes transmitted and received. Transmit means bytes // written to dst, receive means bytes written to src.
[ "func (c *Conn) Stats() (txBytes, rxBytes uint64) {\n\treturn c.srcW.Written(), c.dstW.Written()\n}" ]
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Recognize a small set of known-immutable types that are safe for DCL even without a volatile field.
[ "private static boolean isImmutable(Type type, VisitorState state) {\n switch (type.getKind()) {\n case BOOLEAN:\n case BYTE:\n case SHORT:\n case INT:\n case CHAR:\n case FLOAT:\n return true;\n case LONG:\n case DOUBLE:\n // double-width primitives aren't w...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Rebuild indexes affected by the given permission.
[ "def _process_permission(perm):\n \"\"\"\"\"\"\n # XXX: Optimize: rebuild only permissions, not whole document\n codename = perm.permission.codename\n if not codename.startswith('view') and not codename.startswith('owner'):\n return\n\n index_builder.build(perm.content_object)" ]
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get display type for review product. @param int $website @return boolean|string
[ "public function getReviewDisplayType($website)\n {\n return $this->getWebsiteConfig(\n \\Dotdigitalgroup\\Email\\Helper\\Config::XML_PATH_CONNECTOR_DYNAMIC_CONTENT_REVIEW_DISPLAY_TYPE,\n $website\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:" }
// GetIdentity returns the process identity (credentials to the auth server) for a given // teleport Role. A teleport process can have any combination of 3 roles: auth, node, proxy // and they have their own identities
[ "func (process *TeleportProcess) GetIdentity(role teleport.Role) (i *auth.Identity, err error) {\n\tvar found bool\n\n\tprocess.Lock()\n\tdefer process.Unlock()\n\n\ti, found = process.Identities[role]\n\tif found {\n\t\treturn i, nil\n\t}\n\ti, err = process.storage.ReadIdentity(auth.IdentityCurrent, role)\n\tid :...
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Start a new array object using the given name. This emits the JSON text: <pre> "[name]":[ </pre> @param name Name of new array object. @return The same JSONEmitter object, which allows call chaining.
[ "public JSONEmitter startArray(String name) {\r\n checkComma();\r\n write('\"');\r\n write(encodeString(name));\r\n write(\"\\\":[\");\r\n push();\r\n return this;\r\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set tooltip which appears when you hover mouse curson onto icon in system panel.
[ "def tooltip_query(self, widget, x, y, keyboard_mode, tooltip):\n \n tooltip.set_text(subprocess.getoutput(\"acpi\"))\n return True" ]
[ "function showDropdown(position) {\n // If the dropdown is already visible, just return (so the root click handler on html\n // will close it).\n if ($dropdown) {\n return;\n }\n\n Menus.closeAll();\n\n $dropdown = $(renderList())\n .css({\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Build a JSSListData object from response.
[ "def _build_jss_object_list(self, response, obj_class):\n \"\"\"\"\"\"\n response_objects = [item for item in response\n if item is not None and\n item.tag != \"size\"]\n objects = [\n JSSListData(obj_class, {i.tag: i.text for i i...
[ "@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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Fatalf is the equivalent of fmt.Fatalf but runs shutdown functions first.
[ "func Fatalf(format string, v ...interface{}) {\n\th.exit(fmt.Errorf(format, v...), 1, recover())\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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Resolve package path from 'filepath' @param {String} filepath @returns {String}
[ "function resolvePath(filepath) {\n filepath = filepath.replace(RE_TRAILING, '');\n const cwd = process.cwd();\n const npmPackage = filepath.includes('node_modules');\n\n // Find nearest node_modules directory\n if (npmPackage) {\n const parts = filepath.split(path.sep);\n let idx = parts.lastIndexOf('no...
[ "function module (options) {\n options.hash.kind = 'module'\n var result = _identifiers(options)[0]\n return result ? options.fn(result) : 'ERROR, Cannot find module.'\n}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get range information @param {Range} range Range object @param {object} selectionMgr Table selection manager @returns {object}
[ "function getRangeInformation(range, selectionMgr) {\n const $selectedCells = selectionMgr.getSelectedCells();\n let rangeInformation, startCell;\n\n if ($selectedCells.length) {\n rangeInformation = selectionMgr.getSelectionRangeFromTable($selectedCells.first().get(0),\n $selectedCells.last().get(0));\n...
[ "function getPositionByKey(\n opts: Options,\n // The current value\n containerNode: Node,\n // Key of the node in desired position\n key: string\n): TablePosition {\n return TablePosition.create(opts, containerNode, key);\n}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the last send and recv jobs execution time in milliseconds.
[ "def get_times(self):\n \n send_time = ctypes.c_int32()\n recv_time = ctypes.c_int32()\n result = self.library.Par_GetTimes(self.pointer, ctypes.byref(send_time),\n ctypes.byref(recv_time))\n check_error(result, \"partner\")\n return send_t...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {\n\t*out = *in\n\tout.CloudProvider = in.CloudProvider\n\tout.RouteReconciliationPeriod = in.RouteReconciliationPeriod\n\tout.NodeMonitorPeriod = in.NodeMonitorPeriod\n\tif in.ConfigureCloudRoutes != nil {\n\t\tin, out := &in....
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Flush all existing assets @param TridentKernel $kernel @param OutputInterface $output @return boolean
[ "private function flushAssets(\\TridentKernel $kernel, OutputInterface $output)\n {\n $filesystem = new FileSystem();\n\n $output->write('Clearing existing assets');\n\n try {\n if ($filesystem->exists($kernel->getAssetDir())) {\n $filesystem->remove($kernel->getAss...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Restores the column widths from dialog settings. @param settings the settings to read.
[ "private void restoreColumnWidths(IDialogSettings settings) {\n\t\tfinal int columnCount = this.table.getColumnCount();\n\t\tfor (int i = 0; i < columnCount; i++) {\n\t\t\tint width = -1;\n\t\t\ttry {\n\t\t\t\twidth = settings.getInt(getPreferenceContainerID() + getColumnWidthDialogSettingsKey() + i);\n\t\t\t} catc...
[ "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 Github summarization about User interface customization:", "pos": "Represent the Github code about User interface customization:", "neg": "Represent the Github code:" }
Remove an added filter @param string $filterHash @return $this
[ "public function removeFilter($filterHash)\n {\n // Make lower case\n $filterHash = strtolower($filterHash);\n\n // Remove this filter if it has been defined\n if (array_key_exists($filterHash, $this->options['filters'])) {\n unset($this->options['filters'][$filterHash]);\n...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Adds a new language to project
[ "def add_language_to_project(self, project_id, language_code):\n \n self._run(\n url_path=\"languages/add\",\n id=project_id,\n language=language_code\n )\n return True" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Call the Maintenance surface. @return null
[ "private static function maintenance($lumos)\n {\n $files = ['Maintenance'];\n $folder = static::$root.'Maintenance'.'/';\n\n self::call($files, $folder);\n\n if (!$lumos) {\n Maintenance::launch();\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Gets stopwatch from the specified parent stopwatch with the specified task title. @param parent the specified parent @param taskTitle the specified task title @return stopwatch, returns {@code null} if not found
[ "private static Stopwatch get(final Stopwatch parent, final String taskTitle) {\n if (taskTitle.equals(parent.getTaskTitle())) {\n return parent;\n }\n\n for (final Stopwatch leaf : parent.getLeaves()) {\n final Stopwatch ret = get(leaf, taskTitle);\n\n if (null...
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Sets the default item foreground brush. :param column | <int> brush | <QtGui.QBrush> || None
[ "def setBackground(self, column, brush):\r\n \r\n if brush:\r\n self._background[column] = QtGui.QBrush(brush)\r\n elif column in self._background:\r\n self._background.pop(column)" ]
[ "def setColor(self, key, value):\r\n \r\n key = nativestring(key).capitalize()\r\n self._colorSet.setColor(key, value)\r\n \r\n # update the palette information\r\n if ( key == 'Background' ):\r\n palette = self.palette()\r\n palette.setColor( palette....
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// MustParse turns the given string into a query or panics; for tests or others // cases where you know the string is valid.
[ "func MustParse(s string) *Query {\n\tq, err := New(s)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to parse %s: %v\", s, err))\n\t}\n\treturn q\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 summarization about Go programming language:", "pos": "Represent the Github code about Go programming language:", "neg": "Represent the Github code about Software development:" }
Add key value pair as component to ui.<p> @param key string @param value object @param editable boolean
[ "private void addAddInfoLayout(String key, Object value, boolean editable) {\n\n HorizontalLayout res = addInfoLayout(key, value, editable);\n if (editable) {\n m_userinfoGroup.addRow(res);\n } else {\n m_userinfoNoEditGroup.addRow(res);\n }\n }" ]
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Construct a Libor index for a given curve and schedule. @param forwardCurveName @param schedule @return The Libor index or null, if forwardCurveName is null.
[ "private static AbstractIndex constructLiborIndex(String forwardCurveName, Schedule schedule) {\n\n\t\tif(forwardCurveName != null) {\n\n\t\t\t//determine average fixing offset and period length\n\t\t\tdouble fixingOffset = 0;\n\t\t\tdouble periodLength = 0;\n\n\t\t\tfor(int i = 0; i < schedule.getNumberOfPeriods()...
[ "def _timeseries_component(self, series):\n \n # this is only called if the set_component function recognizes a pandas series\n # Todo: raise a warning if extrapolating from the end of the series.\n return lambda: np.interp(self.time(), series.index, series.values)" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetAccountId sets the AccountId field's value.
[ "func (s *Finding) SetAccountId(v string) *Finding {\n\ts.AccountId = &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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Generate a token string from bytes arrays. The token in the session is user specific.
[ "def csrf_token():\n \n if \"_csrf_token\" not in session:\n session[\"_csrf_token\"] = os.urandom(128)\n return hmac.new(app.secret_key, session[\"_csrf_token\"],\n digestmod=sha1).hexdigest()" ]
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
The first section of the fieldtext manipulation process, where the NOTs are handled and the operator is added, are common to both binaryOp methods so this method saves us repeating the code. @param operator
[ "private void addOperator(final String operator) {\n // This should never happen but sanity check...\n Validate.notNull(operator);\n\n if(lastOperator == null) {\n lastOperator = operator;\n }\n\n /* Logic to determine whether to put parentheses around the existing fiel...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Hydrate a part object into a PartEntity object @param stdClass $part @return PartEntity
[ "public static function hydrate(stdClass $part)\n {\n $hydrated = new PartEntity();\n\n if (isset($part->id)) {\n $hydrated->setId($part->id);\n }\n\n if (isset($part->type)) {\n $hydrated->setType($part->type);\n }\n\n if (isset($part->content)) {\...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
单文件上传 @param UploadedFile $file @return array|mixed
[ "private function uploadOne(UploadedFile $file)\n {\n try {\n $uploader = new Uploader(['config' => $this->_config]);\n $uploader->up($file);\n $fileInfo = $uploader->getFileInfo();\n $result = [\n 'name' => Html::encode($file->name),\n ...
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sets the job ID and strips out the job number (job ID minus the "job_" prefix). @param id
[ "private void setJobId(String id) {\n if (id != null && id.startsWith(\"job_\") && id.length() > 4) {\n this.jobNumber = id.substring(4);\n }\n }" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the text about Work management:", "pos": "Represent the code about Work management:", "neg": "Represent the code about Software development:" }
The token serving as the "head" of the mention :getter: the token corresponding to the head :type: corenlp_xml.document.Token
[ "def head(self):\n \n if self._head is None:\n self._head = self.sentence.tokens[self._head_id-1]\n return self._head" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Send a Http request @param string $method @param string|UriInterface $uri @param array $options @return HttpResultInterface @throws \InvalidArgumentException
[ "public function request(string $method, $uri, array $options = []): HttpResultInterface\n {\n $options = $this->prepareDefaults($options);\n $headers = $options['headers'] ?? [];\n $body = $options['body'] ?? null;\n $version = $options['version'] ?? '1.1';\n // Merge the URI ...
[ "public function create($code, $label, $type)\n {\n $transformer = new Create($code, $label, $type);\n $body = $transformer->output();\n\n /** @var \\SkyHub\\Api\\Handler\\Response\\HandlerInterface $responseHandler */\n $responseHandler = $this->service()->post($this->baseUrlPath(), ...
codesearchnet
{ "query": "Represent the Github comment about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about PHP:" }
Parse and set assets path @param string $path Assets path URL (relative or absolute) @param string $fs_dif Assets path in filesystem
[ "public function set_assets_path($path, $fs_dir = null)\n {\n if (empty($path)) {\n return;\n }\n\n $path = rtrim($path, '/') . '/';\n\n // handle relative assets path\n if (!preg_match('|^https?://|', $path) && $path[0] != '/') {\n // save the path to sea...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
获取Model实例对象 @param type $model @param string $table 数据表名 @return Model
[ "public static function obj($model='',$table=null)\r\n\t{\r\n\t\t$ref = new ReflectionClass(ucfirst($model) . 'Model');\r\n\t\t$args = func_get_args();\r\n\t\tunset($args[0]);\r\n\t\treturn $ref->newInstanceArgs($args);\r\n\t}" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Encrypt data @param string $data @return string
[ "public static function encrypt($data)\n {\n $iv_size = openssl_cipher_iv_length(static::$cipher);\n\n $iv = Str::slice(sha1(static::$key), 0, $iv_size);\n\n return openssl_encrypt($data, static::$cipher, static::$key, 0, $iv);\n }" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
checks the response if the server returned an error raises an exception.
[ "def check_response(response):\n \n if response.status_code < 200 or response.status_code > 300:\n raise ServerError('API requests returned with error: %s'\n % response.status_code)\n\n try:\n response_text = loads(response.text)\n except ValueError:\n raise...
[ "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 description about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
Write the config to the writer.
[ "private static <T> void writeConfig(BufferedWriter writer, DatabaseTableConfig<T> config) throws IOException,\n\t\t\tSQLException {\n\t\twriter.append(CONFIG_FILE_START_MARKER);\n\t\twriter.newLine();\n\t\tif (config.getDataClass() != null) {\n\t\t\twriter.append(FIELD_NAME_DATA_CLASS).append('=').append(config.ge...
[ "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 sentence about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code about programming:" }
Retrieve optimizers functions for a given container @param ContainerConfigurationInterface $containerConfiguration Container Configuration @param Collection|OptimizerInterface[] $optimizers Optimizers list @return array
[ "private function getOptimizersFunctions(ContainerConfigurationInterface $containerConfiguration, $optimizers)\n {\n $functions = [];\n\n foreach ($optimizers as $optimizer) {\n $function = $this->getFunction($containerConfiguration, $optimizer);\n\n if ($function !== null) {\...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns the number of set bits in an array of longs.
[ "public static long pop_array(long[] arr, int wordOffset, int numWords) {\n long popCount = 0;\n for (int i = wordOffset, end = wordOffset + numWords; i < end; ++i) {\n popCount += Long.bitCount(arr[i]);\n }\n return popCount;\n }" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
say something to user :param body: :param user: :return:
[ "async def say(self, body, user, options):\n \n return await self.send_text_message_to_all_interfaces(\n recipient=user, text=body, options=options)" ]
[ "def get_user(self, user_id):\n \n if user_id in self._users:\n return self._users.get(user_id)\n else:\n # Load user\n # Save user in cache\n return" ]
codesearchnet
{ "query": "Represent the comment about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Software development:" }
To get URL link @param string $path @return string
[ "public function url($path)\r\n {\r\n $protocol = \"http\" . $this->isSecure();\r\n\r\n return $protocol . $_SERVER['HTTP_HOST'] .$this->getBaseUri() . $path;\r\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
// GetHeart returns the Heart field if it's non-nil, zero value otherwise.
[ "func (r *Reactions) GetHeart() int {\n\tif r == nil || r.Heart == nil {\n\t\treturn 0\n\t}\n\treturn *r.Heart\n}" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates a change object for an edit operation.<p> @param entry the edited sitemap entry @param propertyChanges the list of property changes @return the change object
[ "protected CmsSitemapChange getChangeForEdit(\n CmsClientSitemapEntry entry,\n List<CmsPropertyModification> propertyChanges) {\n\n CmsSitemapChange change = new CmsSitemapChange(entry.getId(), entry.getSitePath(), ChangeType.modify);\n change.setDefaultFileId(entry.getDefaultFileId());\...
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
geo.plot() Returns plot of raster data
[ "def plot(self, figsize=None, ax=None, **kwargs):\n '''\n \n '''\n if ax is None:\n fig, ax = plt.subplots(figsize=figsize)\n ax.set_aspect('equal')\n ax.matshow(self.raster, **kwargs)\n plt.draw()\n return ax" ]
[ "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:" }
// DecodeMsg implements msgp.Decodable
[ "func (z *Archive) DecodeMsg(dc *msgp.Reader) (err error) {\n\tvar field []byte\n\t_ = field\n\tvar zb0001 uint32\n\tzb0001, err = dc.ReadMapHeader()\n\tif err != nil {\n\t\terr = msgp.WrapError(err)\n\t\treturn\n\t}\n\tfor zb0001 > 0 {\n\t\tzb0001--\n\t\tfield, err = dc.ReadMapKeyPtr()\n\t\tif err != nil {\n\t\t\t...
[ "func (jsonFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {\n\t// we need to extract the JSON chunks of data to pass to Decode()\n\treturn framer.NewJSONFramedReader(r)\n}" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Whether the city can be deleted @return bool
[ "protected function canDeleteCity()\n {\n return isset($this->data_city['city_id'])\n && $this->access('city_delete')\n && $this->city->canDelete($this->data_city['city_id']);\n }" ]
[ "def process(self, candidates):\n \n for c in candidates[:]:\n if c.locator not in self.good_locators:\n # TODO: search string, i.e. find \"EU_Street_Name\" in \"EU_Street_Name.GBR_StreetName\"\n candidates.remove(c)\n\n return candidates" ]
codesearchnet
{ "query": "Represent the text about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
// Clone returns a copy.
[ "func Clone(from *Bitset) *Bitset {\n\treturn &Bitset{numBits: from.numBits, bits: from.bits[:]}\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the outputs. @param message the message @param operation the operation @param contextOverrides the context overrides
[ "public static void setOutputs(Message message, KnowledgeOperation operation, Map<String, Object> contextOverrides) {\n try {\n setOutputsOrFaults(message, operation.getOutputExpressionMappings(), contextOverrides, RESULT, false);\n } catch (Exception e) {\n setOutputsOrFaults(me...
[ "def complete(self, stream):\n \n assert not self.is_complete()\n self._marker.addInputPort(outputPort=stream.oport)\n self.stream.oport.schema = stream.oport.schema\n # Update the pending schema to the actual schema\n # Any downstream filters that t...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Create HTML report.
[ "def create_html(self):\n \"\"\"\"\"\"\n\n html_table = \"\"\n columns = [panel.get_html_column() for panel in self.panels]\n trs = len(columns[0])\n html_table += os.linesep.join(\n [\n \"<tr>{}</tr>\".format(\"\".join([\"<td>{}</td>\".format(columns[col...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CollectTraceEvent mocks base method // nolint
[ "func (m *MockCollector) CollectTraceEvent(records []string) {\n\tm.ctrl.Call(m, \"CollectTraceEvent\", records)\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ListKubeContainers lists running k8s CRI pods
[ "func (runtime *CRIRuntime) ListKubeContainers() ([]string, error) {\n\tout, err := runtime.exec.Command(\"crictl\", \"-r\", runtime.criSocket, \"pods\", \"-q\").CombinedOutput()\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"output: %s, error\", string(out))\n\t}\n\tpods := []string{}\n\tpods = append(pod...
[ "func AllHistoryKind() map[HistoryKind]string {\n\treturn map[HistoryKind]string{\n\t\tKindUnit: \"statuses for specified unit and its workload\",\n\t\tKindUnitAgent: \"statuses from the agent that is managing a unit\",\n\t\tKindWorkload: \"statuses for unit's workload\",\n\t\tKindMach...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Setter for $type @param string $type @return Dependency
[ "public function setType($type)\n {\n if (!in_array($type, $this->getAvailableTypes())) {\n throw new \\InvalidArgumentException('Unknown dependency type \"' . $type . '\"');\n }\n $this->type = $type;\n return $this;\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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Write the specified dataset to the specified writer as xml.
[ "public static void write(IDataSet dataSet, Writer writer, String encoding) throws DataSetException {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"write(dataSet={}, writer={}, encoding={}) - start\", new Object[] { dataSet, writer, encoding });\n\t\t}\n\n\t\tFlatXmlWriter datasetWriter = new FlatXmlWri...
[ "@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 post about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code:" }
// connectZoneRailgun connects (true) or disconnects (false) a Railgun for a given zone. // // API reference: https://api.cloudflare.com/#railguns-for-a-zone-connect-or-disconnect-a-railgun
[ "func (api *API) connectZoneRailgun(zoneID, railgunID string, connect bool) (ZoneRailgun, error) {\n\turi := \"/zones/\" + zoneID + \"/railguns/\" + railgunID\n\tparams := struct {\n\t\tConnected bool `json:\"connected\"`\n\t}{\n\t\tConnected: connect,\n\t}\n\tres, err := api.makeRequest(\"PATCH\", uri, params)\n\t...
[ "def cli(verbose):\n \n floyd.floyd_host = floyd.floyd_web_host = \"https://dev.floydhub.com\"\n floyd.tus_server_endpoint = \"https://upload-v2-dev.floydhub.com/api/v1/upload/\"\n configure_logger(verbose)\n check_cli_version()" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// HIncrBy increases the value of field by delta.
[ "func (db *DB) HIncrBy(key []byte, field []byte, delta int64) (int64, error) {\n\tif err := checkHashKFSize(key, field); err != nil {\n\t\treturn 0, err\n\t}\n\n\tt := db.hashBatch\n\tvar ek []byte\n\tvar err error\n\n\tt.Lock()\n\tdefer t.Unlock()\n\n\tek = db.hEncodeHashKey(key, field)\n\n\tvar n int64\n\tif n, e...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Determinate satisfies ProgressDisplay interface.
[ "func (p ProgressDisplayCharSet) Determinate() [101]string {\n\t// TODO everything here works but not pleasing to the eyes\n\t// and probably not optimal.\n\t// This should be cleaner.\n\tvar set [101]string\n\tfor i := range set {\n\t\tset[i] = p[len(p)-1]\n\t}\n\t// assumption is than len(p) <= 101\n\tstep := 101...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Fetches response from APIm endpoint, persists the response to the filesystem '<outdir>/<prefix><etag><postfix>'
[ "function fetch(opts, cb) {\n var options = {\n url: 'https://' + opts.host + ':' + opts.port + opts.path,\n timeout: opts.timeout,\n agentOptions: {\n cert: opts.clicert,\n key: opts.clikey,\n passphrase: opts.clipass,\n ca: opts.srvca,\n // TODO : remove this\n rejectUnauth...
[ "def fetch_all_records(self):\n \n \"\"\"\n api = self.doapi_manager\n return map(self._record, api.paginate(self.record_url, 'domain_records'))" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS Route 53:" }
//GetString returns a string stored at key. //The zero value for string is returned if a string does not exist at key.
[ "func (c *Config) GetString(key string) (s string) {\n\ts, _ = c.GetStringOk(key)\n\treturn\n}" ]
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return an iterator of unicode strings - the tag names which apply to the given object.
[ "def tagsOf(self, obj):\n \n return self.store.query(\n Tag,\n AND(Tag.catalog == self,\n Tag.object == obj)).getColumn(\"name\")" ]
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Schematics validator The provided rtype must match that of the underlying model. :return: str
[ "def validate_rtype(self, value):\n \n\n if not value or value != self.rtype:\n msg = self.messages['rtype'].format(self.rtype, value)\n raise ValidationError(msg)\n return value" ]
[ "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 about text analysis:", "pos": "Represent the Github code about text analysis:", "neg": "Represent the Github code:" }
// helper: given a Service, return tags that identify it
[ "func serviceTags(s *ipvs.Service) map[string]string {\n\tret := map[string]string{\n\t\t\"sched\": s.SchedName,\n\t\t\"netmask\": strconv.Itoa(bits.OnesCount32(s.Netmask)),\n\t\t\"address_family\": addressFamilyToString(s.AddressFamily),\n\t}\n\t// Per the ipvsadm man page, a virtual service is def...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Get the id corresponding to the given value
[ "func (idx *UniqueIndex) Get(value []byte) []byte {\n\treturn idx.IndexBucket.Get(value)\n}" ]
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Construct new ``SDfile`` object from ``Molfile`` object. :param molfile: ``Molfile`` object. :type molfile: :class:`~ctfile.ctfile.Molfile`. :return: ``SDfile`` object. :rtype: :class:`~ctfile.ctfile.SDfile`.
[ "def from_molfile(cls, molfile, data=None):\n \n if not data:\n data = OrderedDict()\n\n if not isinstance(molfile, Molfile):\n raise ValueError('Not a Molfile type: \"{}\"'.format(type(molfile)))\n\n if not isinstance(data, dict):\n raise ValueError('Not...
[ "def generate_topology(non_omm_topology, non_element_types=None,\n residues=None):\n \"\"\"\"\"\"\n if non_element_types is None:\n non_element_types = set()\n\n if isinstance(non_omm_topology, pmd.Structure):\n return _topology_from_parmed(non_omm_topology, non_element_types)\n eli...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Download a created CSV file
[ "protected function downloadCsvExport()\n {\n $file = $this->getQuery('download');\n\n if (!empty($file)) {\n $this->download(gplcart_string_decode($file));\n }\n }" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
stop the current index operation.
[ "public function StopIndex()\n {\n $sIndexTableName = $this->GetIndexRawTableName();\n if (TCMSRecord::TableExists($sIndexTableName)) {\n $query = 'DROP TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($sIndexTableName).'`';\n MySqlLegacySupport::getInstance()->q...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the comment about command or instruction:", "pos": "Represent the code about command or instruction:", "neg": "Represent the code about programming:" }
Run the migrations. @return void
[ "public function up()\n {\n Schema::create('LBSM_item_permissions', function (Blueprint $table) {\n $table->char('item_id', 32)->nullable();\n $table->char('permission_id', 32)->nullable();\n $table->char('created_by', 32)->nullable();\n $table->char('updated_by...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github sentence about Database management:", "pos": "Represent the Github code about Database management:", "neg": "Represent the Github code about programming:" }
// Returns errors which occur when compiling a shader.
[ "func (c *Context) GetShaderInfoLog(shader *js.Object) string {\n\treturn c.Call(\"getShaderInfoLog\", shader).String()\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 Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Parses the ``inherit_image`` setting, checks if the image is present locally and pulls it otherwise. :return: Returns the name and the tag of the image. :raise ArcaMisconfiguration: If the image can't be pulled from registries.
[ "def get_inherit_image(self) -> Tuple[str, str]:\n \n name, tag = str(self.inherit_image).split(\":\")\n\n if self.image_exists(name, tag):\n return name, tag\n try:\n self.client.images.pull(name, tag)\n except docker.errors.APIError:\n raise Arca...
[ "def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do...
codesearchnet
{ "query": "Represent the post about storage:", "pos": "Represent the code about storage:", "neg": "Represent the code:" }
isPlainObject.js ---------------- @flow
[ "function isPlainObject(obj/*: any*/) /*: boolean*/ {\n if (typeof obj !== 'object') return false;\n const proto = Object.getPrototypeOf(obj);\n return (proto === null) || (\n proto\n && proto.constructor === Object\n && proto.constructor instanceof proto.constructor\n );\n}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
===================================================================
[ "public void writePipe(String pipeName, PipeBlob pipeBlob) throws DevFailed {\n deviceProxyDAO.writePipe(this, new DevicePipe(pipeName, pipeBlob));\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 comment about N/A:", "pos": "Represent the code about N/A:", "neg": "Represent the code:" }
Initialize method @param array $config The configuration for the Table. @return void
[ "public function initialize(array $config)\n {\n parent::initialize($config);\n\n $this->table('profiles');\n $this->displayField('name');\n $this->primaryKey('id');\n\n $this->belongsTo('Users', [\n 'foreignKey' => 'user_id',\n 'joinType' => 'INNER',\n ...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Builds a URL with a different scheme @return Url
[ "public function getUrlForScheme($scheme)\n {\n $newUrl = clone $this;\n\n $wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());\n\n $newUrl->_fragments['scheme'] = $scheme;\n if ($wasDefaultPort) {\n $newUrl->_fragments['port'] = $newUrl->getDefaultPort();\...
[ "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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version.
[ "def getmember(self, name):\n \n tarinfo = self._getmember(name)\n if tarinfo is None:\n raise KeyError(\"filename %r not found\" % name)\n return tarinfo" ]
[ "def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re...
codesearchnet
{ "query": "Represent the Github sentence about computer science:", "pos": "Represent the Github code about computer science:", "neg": "Represent the Github code:" }
Processes a local context to update the active context @param mixed $loclctx The local context. @param array $activectx The active context. @param array $remotectxs The already included remote contexts. @throws JsonLdException
[ "public function processContext($loclctx, &$activectx, $remotectxs = array())\n {\n if (is_object($loclctx)) {\n $loclctx = clone $loclctx;\n }\n\n if (false === is_array($loclctx)) {\n $loclctx = array($loclctx);\n }\n\n foreach ($loclctx as $context) {\n...
[ "final public function create()\n {\n\n $self = $this;\n\n $splash = $self->getSplash();\n $sessId = $this->generateId($splash);\n\n session_id($sessId); //Must be called before the sesion start to generate the Id\n session_cache_limiter('none');\n\n session_name(md5($se...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Same as the function above, but should be 3-4 times faster because of the dropped asserts and conversions and because it doesnt use a loop (itertools or zip).
[ "def distance_to_point2(self, p2: \"Point2\") -> Union[int, float]:\n \n return ((self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2) ** 0.5" ]
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
// UnmarshalText implements the TextUnmarshaler interface.
[ "func (datr *DataRate) UnmarshalText(data []byte) error {\n\tparsed, err := ParseDataRate(string(data))\n\tif err != nil {\n\t\treturn err\n\t}\n\t*datr = *parsed\n\treturn nil\n}" ]
[ "func (pl *Payload) Decode(data []byte) error {\n\t// Note that this method can't be named UnmarshalBinary, because the gob encoder would call\n\t// this method, resulting in infinite recursion.\n\treturn pl.ReadBinary(bytes.NewBuffer(data))\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Adds generic locales into a given list. [fr_FR, es, en_GB, en_US] -> [fr_FR, fr, es, en_GB, en_US, en] @param string[] $inputLocales @return string[]
[ "protected function mergeGenericLocales(array $inputLocales)\n {\n $locales = [];\n foreach ($inputLocales as $locale) {\n $locales[] = $locale;\n if (strlen($locale) === 5) {\n $locale = substr($locale, 0, 2);\n $locales[] = $locale;\n ...
[ "def convert_to_duckling_language_id(cls, lang):\n \"\"\"\"\"\"\n\n if lang is not None and cls.is_supported(lang):\n return lang\n elif lang is not None and cls.is_supported(lang + \"$core\"): # Support ISO 639-1 Language Codes (e.g. \"en\")\n return lang + \"$core\"\n ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Throws an exception if value structure is not of expected format. @param \Netgen\TagsBundle\Core\FieldType\Tags\Value $value @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the value does not match the expected structure
[ "protected function checkValueStructure(BaseValue $value)\n {\n if (!is_array($value->tags)) {\n throw new InvalidArgumentType(\n '$value->tags',\n 'array',\n $value->tags\n );\n }\n\n foreach ($value->tags as $tag) {\n ...
[ "public function getResultingType() : \\Dms\\Core\\Persistence\\Db\\Schema\\Type\\Type\n {\n throw InvalidOperationException::methodCall(__METHOD__, 'Tuple cannot be used a standalone expression');\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Finds the item corresponding to the provided identifier in the registry. @param string $identifier @param null $default @return mixed
[ "public function getContentById($identifier, $default = null)\n {\n $this->assertion->keyExists(\n $this->registry[$this->section],\n $identifier,\n 'Requested item ('. $identifier .') is not registered in the current registry.'\n );\n\n return $this->registr...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Documentation:" }
Create a string preference for {@code key}. Default is {@code ""}.
[ "@CheckResult @NonNull\n public Preference<String> getString(@NonNull String key) {\n return getString(key, DEFAULT_STRING);\n }" ]
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
points = read_roi(fileobj) Read ImageJ's ROI format. Points are returned in a nx2 array. Each row is in [row, column] -- that is, (y,x) -- order.
[ "def read_roi(fileobj):\n '''\n \n '''\n # This is based on:\n # http://rsbweb.nih.gov/ij/developer/source/ij/io/RoiDecoder.java.html\n # http://rsbweb.nih.gov/ij/developer/source/ij/io/RoiEncoder.java.html\n\n SPLINE_FIT = 1\n DOUBLE_HEADED = 2\n OUTLINE = 4\n OVERLAY_LABELS = 8\n ...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Scope can be used in: Security, JWTSecurity, OAuth2Security // // Scope defines an authorization scope. Used within SecurityScheme, a description may be provided // explaining what the scope means. Within a Security block, only a scope is needed.
[ "func Scope(name string, desc ...string) {\n\tswitch current := dslengine.CurrentDefinition().(type) {\n\tcase *design.SecurityDefinition:\n\t\tif len(desc) >= 1 {\n\t\t\tdslengine.ReportError(\"too many arguments\")\n\t\t\treturn\n\t\t}\n\t\tcurrent.Scopes = append(current.Scopes, name)\n\tcase *design.SecuritySch...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
获取当前Url地址 @return string
[ "public static function url()\n {\n $http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';\n return $http_type . $_SERVER['SERVER_NAME'] . $_SERVER[\"REQUEST_URI...
[ "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 about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }