query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// UpdateSecrets updates the secrets used by the remote enforcer
[ "func (s *RemoteEnforcer) UpdateSecrets(req rpcwrapper.Request, resp *rpcwrapper.Response) error {\n\tvar err error\n\tif !s.rpcHandle.CheckValidity(&req, s.rpcSecret) {\n\t\tresp.Status = \"updatesecrets auth failed\"\n\t\treturn fmt.Errorf(resp.Status)\n\t}\n\n\tcmdLock.Lock()\n\tdefer cmdLock.Unlock()\n\tif s.en...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Check if a server:port combination is a member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort'
[ "def servicegroup_server_exists(sg_name, s_name, s_port=None, **connection_args):\n '''\n \n '''\n return _servicegroup_get_server(sg_name, s_name, s_port, **connection_args) is not None" ]
[ "def activate_backup_image(reset=False):\n '''\n \n\n '''\n\n dn = \"sys/rack-unit-1/mgmt/fw-boot-def/bootunit-combined\"\n\n r = \"no\"\n\n if reset is True:\n r = \"yes\"\n\n inconfig = \"\"\"<firmwareBootUnit dn='sys/rack-unit-1/mgmt/fw-boot-def/bootunit-combined'\n adminState='tri...
codesearchnet
{ "query": "Represent the instruction about SaltStack:", "pos": "Represent the code about SaltStack:", "neg": "Represent the code:" }
Resolves a URL given a path @param {string} url - URL to resolve @param {string} path - Path to append to base URL @return {string} resolvedUrl - A valid URL
[ "function resolveURL(url, path) {\n if (typeof url !== 'string' || typeof path !== 'string') {\n return new Error('url-and-path-required');\n }\n\n /* Remove leading and duplicate slashes */\n url = url.replace(/\\/{2,}/g, '/').replace(/^\\//, '').replace(':/','://');\n\n let parsedUrl = urlModule.parse(url...
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Identify a file object as XML (any format)
[ "def is_xml(origin, filepath, fileobj, *args, **kwargs):\n \n # pylint: disable=unused-argument\n if fileobj is not None:\n loc = fileobj.tell()\n fileobj.seek(0)\n try:\n sig = fileobj.read(5).lower()\n return sig == XML_SIGNATURE\n finally:\n f...
[ "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:" }
List all ARI controlled device states. @return DeviceState[]
[ "public function getDeviceStates()\n {\n $uri = 'deviceStates';\n $response = $this->client->getEndpoint()->get($uri);\n\n $deviceStates = [];\n foreach (\\GuzzleHttp\\json_decode($response->getBody()) as $deviceState) {\n $deviceStates[] = new DeviceState($this->client, $d...
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetDatasetDeletedAfterRequestedSyncCount sets the DatasetDeletedAfterRequestedSyncCount field's value.
[ "func (s *ListRecordsOutput) SetDatasetDeletedAfterRequestedSyncCount(v bool) *ListRecordsOutput {\n\ts.DatasetDeletedAfterRequestedSyncCount = &v\n\treturn s\n}" ]
[ "protected void handleSqlCount(ActionRuntime runtime) {\n final CallbackContext context = CallbackContext.getCallbackContextOnThread();\n if (context == null) {\n return;\n }\n final SqlStringFilter filter = context.getSqlStringFilter();\n if (filter == null || !(filter...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Increments and returns current Adunit counter @param {string} adunit id @returns {number} current adunit count
[ "function incrementCounter(adunit) {\n adUnits[adunit] = adUnits[adunit] || {};\n adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;\n return adUnits[adunit].counter;\n}" ]
[ "function(dvi, di) {\n var dim = msg.structure.dimensions.observation[di];\n // Calculate the key position for the dimension index\n var pos = dimPosition(dim);\n // Update the obskey with the dimension value\n obsKey[pos] = dim.values[dvi].id;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(DescribeSimulationJobRequest describeSimulationJobRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeSimulationJobRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Static method __cutAll @param string $sentence # input sentence @param array $options # other options @return array $words
[ "public static function __cutAll($sentence, $options = array())\n {\n $defaults = array(\n 'mode'=>'default'\n );\n\n $options = array_merge($defaults, $options);\n\n $words = array();\n\n $DAG = self::getDAG($sentence);\n $old_j = -1;\n\n foreach ($DAG...
[ "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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// PathEscape escapes all segemnts of a given path
[ "func PathEscape(path string) string {\n\ts := strings.Split(path, \"/\")\n\tfor i, e := range s {\n\t\ts[i] = url.PathEscape(e)\n\t}\n\treturn strings.Join(s, \"/\")\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Initialize the SSL handshake. @throws SSLException
[ "public void init() throws SSLException {\n if (sslEngine != null) {\n // We already have a SSL engine created, no need to create a new one\n return;\n }\n\n InetSocketAddress peer = (InetSocketAddress) session\n .getAttribute(SslFilter.PEER_ADDRESS);\n ...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about N/A:" }
Can this RecurringCost be enacted
[ "def is_enactable(self, as_of):\n \"\"\"\"\"\"\n return \\\n not self.disabled and \\\n not self.archived and \\\n not self._is_finished(as_of) and \\\n self._is_ready(as_of) and \\\n not self._is_billing_complete()" ]
[ "@Override\n protected CreditCardAuthorizationResult run() {\n // Simulate transitive dependency from CreditCardCommand to GetUserAccountCommand.\n // UserAccount could be injected into this command as an argument (and that would be more accurate)\n // but often in large codebase that ends u...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetAssociationVersion sets the AssociationVersion field's value.
[ "func (s *DescribeAssociationInput) SetAssociationVersion(v string) *DescribeAssociationInput {\n\ts.AssociationVersion = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// ListRoutes lists routes
[ "func (gce *Cloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error) {\n\tvar routes []*cloudprovider.Route\n\tpageToken := \"\"\n\tpage := 0\n\tfor ; page == 0 || (pageToken != \"\" && page < maxPages); page++ {\n\t\tlistCall := gce.service.Routes.List(gce.projectID)\n\n\t\tprefix := truncateClusterNa...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Sorts by the given value. @param string $field @param string $direction @return self
[ "public function sortBy(string $field, string $direction = 'asc'): self\n {\n $this->sortBy = [$field, $direction];\n\n return $this;\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
************************* Synchronization methods **************************
[ "protected function synchronizeIncludes(array $includes): void\n\t{\n\t\tforeach($includes as $include) {\n\t\t\t$rowToAdd = $this->createRow($include);\n\t\t\tHelpers::appendToFile($this->configurationFile, $rowToAdd);\n\t\t}\n\t}" ]
[ "public function description()\n {\n //====================================================================//\n // Stack Trace\n Splash::log()->trace();\n\n //====================================================================//\n // Build & Return Widget Description Array\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
Transforms content of the Statement to n-quads form. @return string N-Quads string containing subject, predicate, object and graph, if available @throws \Exception if this instance is a non-concrete statement @api @since 0.1
[ "public function toNQuads()\n {\n if ($this->isConcrete()) {\n if ($this->isQuad()) {\n return $this->getSubject()->toNQuads().' '.\n $this->getPredicate()->toNQuads().' '.\n $this->getObject()->toNQuads().' '.\n $...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Documentation:" }
medoo::query() @param string $query @param array $map @return \PDOStatement
[ "public function query($query, $map = [])\n {\n $statement = parent::exec($query, $map);\n $lastSQL = parent::last();\n Container::get('logger')->info($lastSQL);\n array_push(self::$queries, $lastSQL);\n return $statement;\n }" ]
[ "final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parse an internet address ``netloc`` and return a tuple with ``host`` and ``port``.
[ "def parse_address(netloc, default_port=8000):\n ''''''\n if isinstance(netloc, tuple):\n if len(netloc) != 2:\n raise ValueError('Invalid address %s' % str(netloc))\n return netloc\n #\n netloc = native_str(netloc)\n auth = None\n # Check if auth is available\n if '@' ...
[ "def get_docs_url(self, role, name):\n \n\n # Expand partial names to full names\n name = self.get_full_name(role, name)\n # Look up domain corresponding to role\n dom = IntersphinxInventory.roledomain[role]\n # Get the inventory entry tuple corresponding to the name\n ...
codesearchnet
{ "query": "Represent the description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Get the object node corresponding to the given _path_. if _create_ is true, the the nodes in the path are created if they do not already exist.
[ "def get_node(path, create = false)\n n = @root\n path.sub(%r{^/}, \"\").split(\"/\").each do |elem|\n if !(n[elem])\n return nil if !create\n n[elem] = Node.new(elem)\n end\n n = n[elem]\n end\n if n.nil?\n DBus.logger.debug \"Warning, unknown objec...
[ "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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Write the entire page by calling:<br> writeHtmlHead(out)<br> writeBodyTag(out)<br> writeElements(out)<br> writeHtmlEnd(out)
[ "public void write(Writer out)\n throws IOException\n {\n writeHtmlHead(out);\n writeBodyTag(out);\n writeElements(out);\n writeHtmlEnd(out);\n }" ]
[ "@Override\n protected String defaultActionHtmlStart() {\n\n StringBuffer result = new StringBuffer(2048);\n result.append(htmlStart(null));\n result.append(getList().listJs());\n result.append(CmsListExplorerColumn.getExplorerStyleDef());\n result.append(\"<script language='Ja...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Adds encryption metadata to the StorageObjectMetadata object
[ "@Override\n public void addEncryptionMetadata(StorageObjectMetadata meta,\n MatDesc matDesc,\n byte[] ivData,\n byte[] encKeK,\n long contentLength)\n {\n meta.addUserMet...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
If there is already a connection for this ssid, return the name of the connection; if there is not, return None.
[ "async def connection_exists(ssid: str) -> Optional[str]:\n \n nmcli_conns = await connections()\n for wifi in [c['name']\n for c in nmcli_conns if c['type'] == 'wireless']:\n res, _ = await _call(['-t', '-f', '802-11-wireless.ssid',\n '-m', 'tabular',\n ...
[ "def _send_raw(self, command):\n \n try:\n self._socket.send(bytearray(command))\n self._sn = (self._sn + 1) % 256\n return True\n except (socket.error, socket.timeout):\n # We can get a socket.error or timeout exception if the bridge is disconnected,...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
TODO Merge into r.addSourceTargetSet, to avoid duplicate testing
[ "void addSourceTargetSet(UnicodeSet filter, UnicodeSet sourceSet, UnicodeSet targetSet) {\n UnicodeSet currentFilter = new UnicodeSet(filter);\n UnicodeSet revisiting = new UnicodeSet();\n int count = ruleVector.size();\n for (int i=0; i<count; ++i) {\n TransliterationRule r =...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// handleMissingDashboardFiles will unprovision or delete dashboards which are missing on disk.
[ "func (fr *fileReader) handleMissingDashboardFiles(provisionedDashboardRefs map[string]*models.DashboardProvisioning, filesFoundOnDisk map[string]os.FileInfo) {\n\t// find dashboards to delete since json file is missing\n\tvar dashboardToDelete []int64\n\tfor path, provisioningData := range provisionedDashboardRefs...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Plot the curve and the knee, if it exists
[ "def plot_knee(self, ):\n \n import matplotlib.pyplot as plt\n\n plt.figure(figsize=(8, 8))\n plt.plot(self.x, self.y)\n plt.vlines(self.knee, plt.ylim()[0], plt.ylim()[1])" ]
[ "def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Collect monomials up to a given degree.
[ "def pick_monomials_up_to_degree(monomials, degree):\n \n ordered_monomials = []\n if degree >= 0:\n ordered_monomials.append(S.One)\n for deg in range(1, degree + 1):\n ordered_monomials.extend(pick_monomials_of_degree(monomials, deg))\n return ordered_monomials" ]
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Read package version
[ "def read_version():\n \n with open('./oi/version.py') as fh:\n for line in fh:\n if line.startswith('VERSION'):\n return line.split('=')[1].strip().strip(\"'\")" ]
[ "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 instruction about Logistics:", "pos": "Represent the code about Logistics:", "neg": "Represent the code:" }
// Append adds an TokenEndpointHandler to this list. Ignores duplicates based on reflect.TypeOf.
[ "func (t *TokenEndpointHandlers) Append(h TokenEndpointHandler) {\n\tfor _, this := range *t {\n\t\tif reflect.TypeOf(this) == reflect.TypeOf(h) {\n\t\t\treturn\n\t\t}\n\t}\n\n\t*t = append(*t, h)\n}" ]
[ "public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Replace oldNode for newNode and returns oldNode. @param {Node} oldNode @param {Node} newNode @return {Node}
[ "function replace(oldNode, newNode){\n return oldNode[PARENT_NODE] ? oldNode[PARENT_NODE].replaceChild(newNode, oldNode) : oldNode;\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 Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Sets the class loader.
[ "@Override\n public void setContextLoader(ClassLoader loader)\n {\n if (loader != null)\n _loaderRef = new WeakReference<ClassLoader>(loader);\n else\n _loaderRef = null;\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:" }
// Table writes a table-formatted representation of the stats in a // ProcessingStats instance to w.
[ "func (s *ProcessingStats) Table(w io.Writer) {\n\ttitleVals := s.toVals()\n\tdata := make([][]string, len(titleVals))\n\tfor i, tv := range titleVals {\n\t\tdata[i] = []string{tv.name, strconv.Itoa(int(tv.val))}\n\t}\n\n\ttable := tablewriter.NewWriter(w)\n\n\ttable.AppendBulk(data)\n\ttable.SetHeader([]string{\"\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code:" }
Executes block if it's its turn, queues the block in the other case.
[ "def wait(i, &block)\n @order[i] = block\n return unless i == @current\n\n while order[@current]\n order.delete(@current).call\n @current += 1\n end\n end" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Text writes a text with an encoding of special runes.
[ "func (w *standardSMLWriter) Text(text string) error {\n\tvar buf bytes.Buffer\n\tfor _, r := range text {\n\t\tswitch r {\n\t\tcase '^':\n\t\t\tbuf.WriteString(\"^^\")\n\t\tcase '{':\n\t\t\tbuf.WriteString(\"^{\")\n\t\tcase '}':\n\t\t\tbuf.WriteString(\"^}\")\n\t\tdefault:\n\t\t\tbuf.WriteRune(r)\n\t\t}\n\t}\n\tre...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// UnmarshalJSON supports json.Unmarshaler interface
[ "func (v *Subscriber) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjson639f989aDecodeCodeCloudfoundryOrgGorouterMbus1(&r, v)\n\treturn r.Error()\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
简单编号. 例如:2653 9689 3739 0570. @return string
[ "public static function simpleCode(): string\r\n {\r\n return join('', array_map(function ($item) {\r\n return substr($item + 1, -1);\r\n }, str_split(str_replace('.', '', array_sum(\r\n explode(' ', microtime())\r\n )) . mt_rand(10, 99))));\r\n }" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about text processing:" }
Dispatch global action to hosting document (if any). This will most likely get picked up by the containing {gui.IframeSpirit} so that it knows what's going on. @param {string} type @param @optional {object} data
[ "function doaction(type, data) {\n\t\tif (gui.hosted) {\n\t\t\tgui.Action.ascendGlobal(document, type, data);\n\t\t}\n\t}" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// transform checks image references on the provided object and returns either a reporter (indicating // that the object was recognized and whether it was updated) or an error.
[ "func (o *MigrateImageReferenceOptions) transform(obj runtime.Object) (migrate.Reporter, error) {\n\tfn := o.Mappings.MapReference\n\tswitch t := obj.(type) {\n\tcase *imagev1.Image:\n\t\tvar changed bool\n\t\tif updated := fn(t.DockerImageReference); updated != t.DockerImageReference {\n\t\t\tchanged = true\n\t\t\...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
获得节点node的key属性的值, 修改自from sizzle...蛋疼啊各浏览器的属性获取
[ "function getAttribute(node, key) {\n var map = attrMap[key];\n if (map) return typeof map === \"function\" ? map(node) : node[map];\n if (checkAttributes) {\n return node.getAttribute(key);\n }\n var attrNode = node.getAttributeNode(key);\n // 对于selected checked 当返回为bool值时 将其标准化为 selected =...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Find all AST nodes at the given filename, line and column.
[ "def find_tokens(self, q):\n \"\"\"\"\"\"\n found_me = []\n if hasattr(self, 'location'):\n if self.location.contains(q):\n found_me = [self]\n elif self._found_by(q):\n found_me = [self]\n\n cs = [n.find_tokens(q) for n in self._children()]\n return found_me + list(itertools.chai...
[ "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:" }
Press backspace key n times. **中文文档** 按退格键 n 次。
[ "def backspace(self, n=1, interval=0, pre_dl=None, post_dl=None):\n \n self.delay(pre_dl)\n self.k.tap_key(self.k.backspace_key, n, interval)\n self.delay(post_dl)" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about text processing:" }
Прнименяет условие на выборку "IN" @param ISelectBuilder $selectBuilder @return $this
[ "protected function applyInCondition(ISelectBuilder $selectBuilder)\n {\n $selectBuilder->expr($this->fieldColumn, $this->operator, $this->placeholder);\n $selectBuilder->bindArray($this->placeholder, $this->expression);\n\n return $this;\n }" ]
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
{@inheritDoc} Note that any values are not on the diagonal are ignored.
[ "public void setRow(int row, double[] values) {\n checkIndices(row, values.length - 1);\n\n values[row] = values[row];\n }" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
----- Public DBService methods: Queries
[ "@Override\n public List<DColumn> getColumns(String storeName, String rowKey,\n String startColumn, String endColumn, int count) {\n String tableName = storeToTableName(storeName);\n Map<String, AttributeValue> attributeMap = m_ddbClient.getItem(tableName, makeDDB...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Stop the daemonized process. If the process is already stopped this call should exit successfully. If the process cannot be stopped this call should exit with code STOP_FAILED.
[ "def stop(self):\n \n if self.pid is None:\n\n return None\n\n try:\n\n while True:\n\n self.send(signal.SIGTERM)\n time.sleep(0.1)\n\n except RuntimeError as err:\n\n if \"No such process\" in str(err):\n\n LO...
[ "def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c...
codesearchnet
{ "query": "Represent the Github post about Container management:", "pos": "Represent the Github code about Container management:", "neg": "Represent the Github code:" }
Get initial yield value, or result of send(name) if name given.
[ "def get(self, name=None):\n \"\"\"\"\"\"\n if name is None:\n return self.init_value\n elif not self.support_name:\n msg = \"generator does not support get-by-name: function {!r}\"\n raise TypeError(msg.format(self.function))\n try:\n value = ...
[ "def push(self, stream, value):\n \n\n raise ArgumentError(\"Attempting to push reading to an invalid stream walker that cannot hold data\", selector=self.selector, stream=stream)" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Data processing:" }
Return a list of VMs with minimal information CLI Example .. code-block:: bash salt-cloud -f list_nodes_min myopenstack
[ "def list_nodes_min(conn=None, call=None):\n '''\n \n\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The list_nodes_min function must be called with -f or --function.'\n )\n if conn is None:\n conn = get_conn()\n ret = {}\n for node in conn.list_ser...
[ "def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat...
codesearchnet
{ "query": "Represent the Github description about SaltStack:", "pos": "Represent the Github code about SaltStack:", "neg": "Represent the Github code:" }
// EntityId returns a unique identifier for a machine across // models.
[ "func (i *MachineInfo) EntityId() EntityId {\n\treturn EntityId{\n\t\tKind: \"machine\",\n\t\tModelUUID: i.ModelUUID,\n\t\tId: i.Id,\n\t}\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Makes a list item from a user.<p> @param user the user @return the list item
[ "protected CmsListItem makeUserItem(CmsUser user) {\n\n CmsListItem item = getList().newItem(user.getId().toString());\n item.set(LIST_COLUMN_LOGIN, user.getName());\n item.set(LIST_COLUMN_NAME, user.getSimpleName());\n item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + user...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NewSpaceService creates a new space service.
[ "func NewSpaceService(context servicecontext.ServiceContext) service.SpaceService {\n\treturn &spaceService{base.NewBaseService(context)}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Parse metadata xml.
[ "def parse_event_xml(self, event_data) -> dict:\n \"\"\"\"\"\"\n event = {}\n\n event_xml = event_data.decode()\n\n message = MESSAGE.search(event_xml)\n if not message:\n return {}\n event[EVENT_OPERATION] = message.group(EVENT_OPERATION)\n\n topic = TOPI...
[ "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:" }
/*! \return the SDK version as a string \param withRelease If true the release version is appended \param withAlias If true the alias is used instead
[ "static function version( $withRelease = true, $asAlias = false, $withState = true )\n {\n if ( $asAlias )\n {\n $versionText = eZPublishSDK::alias();\n if ( $withState && eZPublishSDK::state() )\n $versionText .= \"-\" . eZPublishSDK::state();\n }\n ...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Gets the fallback locales. @return array The fallback locales
[ "public function getFallbackLocales()\n {\n if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {\n return $this->translator->getFallbackLocales();\n }\n\n return [];\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Enter function sequence for doing a function start ins.quad[1] contains size (in bytes) of local variables Use '__fastcall__' as 1st parameter to prepare a fastcall function (no local variables).
[ "def _enter(ins):\n \n output = []\n\n if ins.quad[1] == '__fastcall__':\n return output\n\n output.append('push ix')\n output.append('ld ix, 0')\n output.append('add ix, sp')\n\n size_bytes = int(ins.quad[1])\n\n if size_bytes != 0:\n if size_bytes < 7:\n output.app...
[ "def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// finalize was the only func that did not strobe Done
[ "func (tracker *callTracker) finalize(sn uint32) {\n\ttracker.lck.Lock()\n\tdefer tracker.lck.Unlock()\n\tc, ok := tracker.calls[sn]\n\tif ok {\n\t\tdelete(tracker.calls, sn)\n\t\tc.ContextCancel()\n\t}\n\treturn\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Checks that the specified name is available for use by the specified network. @param name [String] the name to check for @param network [Network] the network to ignore @raise [CommandError] if the name is already taken
[ "def check_name_available_except!(name, network)\n return if name.nil? || network.name_eql?(name) || !find_network(name)\n\n raise CommandError, \"a network with the name #{name.inspect} \" \\\n 'already exists'\n end" ]
[ "func (c StatusSetCmd) Info() *cmd.Info {\n\treturn jujucmd.Info(&cmd.Info{\n\t\tName: StatusSetCmdName,\n\t\tArgs: \"<class> <id> <status>\",\n\t\tPurpose: \"update the status of a payload\",\n\t\tDoc: `\n\"payload-status-set\" is used to update the current status of a registered payload.\nThe <class> and <i...
codesearchnet
{ "query": "Represent the Github instruction about SaltStack:", "pos": "Represent the Github code about SaltStack:", "neg": "Represent the Github code about programming:" }
// SetPolicyName sets the PolicyName field's value.
[ "func (s *DeleteLoadBalancerPolicyInput) SetPolicyName(v string) *DeleteLoadBalancerPolicyInput {\n\ts.PolicyName = &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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// AllDeploymentConfigPipelines returns all the DCPipelines that aren't in the excludes set and the set of covered NodeIDs
[ "func AllDeploymentConfigPipelines(g osgraph.Graph, excludeNodeIDs IntSet) ([]DeploymentConfigPipeline, IntSet) {\n\tcovered := IntSet{}\n\tdcPipelines := []DeploymentConfigPipeline{}\n\n\tfor _, uncastNode := range g.NodesByKind(appsgraph.DeploymentConfigNodeKind) {\n\t\tif excludeNodeIDs.Has(uncastNode.ID()) {\n\...
[ "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 instruction about network configuration:", "pos": "Represent the code about network configuration:", "neg": "Represent the code about Software development:" }
Map field value to a proper Solr representation. @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion @param \EzSystems\EzPlatformSolrSearchEngine\Query\CriterionVisitor $subVisitor @return string
[ "public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)\n {\n $handler = $this->sectionHandler;\n\n $conditions = array_map(\n function ($value) use ($handler) {\n return 'content_section_id_id:\"' . $handler->loadByIdentifier($value)->id . '\"';\...
[ "public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
// Watch returns a watch.Interface that watches the requested runtimeClasses.
[ "func (c *FakeRuntimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {\n\treturn c.Fake.\n\t\tInvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts))\n}" ]
[ "func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// WM_TRANSIENT_FOR set
[ "func WmTransientForSet(xu *xgbutil.XUtil, win xproto.Window,\n\ttransient xproto.Window) error {\n\n\treturn xprop.ChangeProp32(xu, win, \"WM_TRANSIENT_FOR\", \"WINDOW\",\n\t\tuint(transient))\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Initialise the DB This method is called by the platform between the load() and start() calls. There should be no need for a plugin to call this method it's self. :param metadata: the SQLAlchemy metadata for this plugins schema
[ "def _migrateStorageSchema(self, metadata: MetaData) -> None:\n \n\n relDir = self._packageCfg.config.storage.alembicDir(require_string)\n alembicDir = os.path.join(self.rootDir, relDir)\n if not os.path.isdir(alembicDir): raise NotADirectoryError(alembicDir)\n\n self._dbConn = Db...
[ "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:" }
// You should always use this function to get a new AddOpenDaylightControllerParams instance, // as then you are sure you have configured all required params
[ "func (s *NetworkService) NewAddOpenDaylightControllerParams(password string, physicalnetworkid string, url string, username string) *AddOpenDaylightControllerParams {\n\tp := &AddOpenDaylightControllerParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"password\"] = password\n\tp.p[\"physicalnetworkid\"] = phy...
[ "function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Timeout is the time each individual bulk request should wait for shards // that are unavailable.
[ "func (s *DeleteByQueryService) Timeout(timeout string) *DeleteByQueryService {\n\ts.timeout = timeout\n\treturn s\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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Element-wise leaky ReLU function:<br> out = x if x >= 0.0<br> out = alpha * x if x < cutoff<br> Alpha value is most commonly set to 0.01 @param x Input variable @param alpha Cutoff - usually 0.0 @return Output variable
[ "public SDVariable leakyRelu(String name, SDVariable x, double alpha) {\n validateFloatingPoint(\"leaky ReLU\", x);\n SDVariable result = f().leakyRelu(x, alpha);\n return updateVariableNameAndReference(result, name);\n }" ]
[ "def AddTrainingOperators(model, softmax, label):\n \"\"\"\"\"\"\n xent = model.LabelCrossEntropy([softmax, label], 'xent')\n # compute the expected loss\n loss = model.AveragedLoss(xent, \"loss\")\n # track the accuracy of the model\n AddAccuracy(model, softmax, label)\n # use the average loss...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Checks to see if a role has a permission or not @param integer $Role ID @param integer $Permission ID @return boolean @todo: If we pass a Role that doesn't exist the method just returns false. We may want to check for a valid Role.
[ "function hasPermission($Role, $Permission)\n\t{\n\t\t$Res = Jf::sql ( \"\n\t\t\t\t\tSELECT COUNT(*) AS Result\n\t\t\t\t\tFROM {$this->tablePrefix()}rolepermissions AS TRel\n\t\t\t\t\tJOIN {$this->tablePrefix()}permissions AS TP ON ( TP.ID= TRel.PermissionID)\n\t\t\t\t\tJOIN {$this->tablePrefix()}roles AS TR ON ( T...
[ "protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
Get an onion layer function. This function will get the object from a previous layer and pass it inwards @param LayerInterface $nextLayer @param LayerInterface $layer @return Closure
[ "private function createLayer($nextLayer, $layer)\n {\n return function($object) use($nextLayer, $layer){\n return $layer->peel($object, $nextLayer);\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:" }
Adds to the list of paths @param string $type The type of path to add. @param mixed $path The directory or stream, or an array of either, to search. @return object
[ "public function setPath($type, $path)\n\t{\n\t\tif (!array_key_exists($type, $this->paths))\n\t\t{\n\t\t\tthrow new \\Exception(\\App::get('language')->txt('Unknown asset path type of %s given.', $type));\n\t\t}\n\n\t\t$path = trim((string) $path);\n\n\t\t// Add separators as needed\n\t\t$path = DS . trim($path, D...
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Generates a dict of the valid timeout values for the given `const`. The `const` value may change for different versions or types of Pololu boards.
[ "def _genTimeoutList(self, const):\n \n result = {}\n\n for v in range(128):\n x = v & 0x0F\n y = (v >> 4) & 0x07\n\n if not y or (y and x > 7):\n result[const * x * 2**y] = v\n\n self._log and self._log.debug(\"Timeout list: %s\", result)\...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
first we should check if the common ancestor is right
[ "function (commitItems) {\n var msg = 'Squashing commits ' + fromCommit + ' -> ' + toCommit + '\\n',\n i;\n\n for (i = 0; i < commitItems.length; i += 1) {\n msg += '\\n' + commitItems[i][CONSTANTS.MONGO_ID] + ':\\n';\n msg += commitItems[i].message...
[ "function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns a list of sentences from the given string. Punctuation marks are separated from each word by a space.
[ "def find_tokens(self, string, **kwargs):\n \n # \"The cat purs.\" => [\"The cat purs .\"]\n return find_tokens(string,\n punctuation = kwargs.get( \"punctuation\", PUNCTUATION),\n abbreviations = kwargs.get(\"abbreviations\", ABBREVIATIONS),\n re...
[ "def DocToHelp(doc):\n \"\"\"\"\"\"\n\n # Get rid of starting and ending white space. Using lstrip() or even\n # strip() could drop more than maximum of first line and right space\n # of last line.\n doc = doc.strip()\n\n # Get rid of all empty lines.\n whitespace_only_line = re.compile('^[ \\t]+$', re.M)\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
helper ///////////////////////////////////////////////////////////////////
[ "protected String getExpressionTextForLanguage(DmnExpressionImpl expression, String expressionLanguage) {\n String expressionText = expression.getExpression();\n if (expressionText != null) {\n if (isJuelExpression(expressionLanguage) && !StringUtil.isExpression(expressionText)) {\n return \"${\" ...
[ "public static function ws()\n {\n if (!isset(self::core()->soap)) {\n //====================================================================//\n // WEBSERVICE INITIALISATION\n //====================================================================//\n // Initial...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns Manager containing quantiles along an axis for numeric columns. Returns: DataManager containing quantiles of original DataManager along an axis.
[ "def quantile_for_list_of_values(self, **kwargs):\n \n if self._is_transposed:\n kwargs[\"axis\"] = kwargs.get(\"axis\", 0) ^ 1\n return self.transpose().quantile_for_list_of_values(**kwargs)\n axis = kwargs.get(\"axis\", 0)\n q = kwargs.get(\"q\")\n numeric_...
[ "def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re...
codesearchnet
{ "query": "Represent the sentence about Mathematics:", "pos": "Represent the code about Mathematics:", "neg": "Represent the code:" }
// GetCloudGroups is not implemented yet, that needs to return the instances and groups that back a kops cluster.
[ "func (c *VSphereCloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {\n\tglog.V(8).Infof(\"vSphere cloud provider GetCloudGroups not implemented yet\")\n\treturn nil, fmt.Errorf(\"vSphere clou...
[ "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 instruction about AWS Redshift:", "pos": "Represent the code about AWS Redshift:", "neg": "Represent the code about programming:" }
Removes all child profiles from this profile. @return $this
[ "public function removeAll()\n {\n foreach ($this->getProfiles() as $profile => $child) {\n $this->remove($profile);\n }\n\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Switch database. @param string $dbName @return bool
[ "public function setDatabase(string $dbName): bool\n {\n $this->db->exec('USE ' . $this->quoter->quoteName($dbName) . ';');\n\n return true;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Close the GeoPackage @param geoPackage GeoPackage @since 3.1.0
[ "public void close(T geoPackage) {\n\t\tif (geoPackage != null) {\n\t\t\ttry {\n\t\t\t\tgeoPackage.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Error closing GeoPackage: \"\n\t\t\t\t\t\t+ geoPackage.getName(), e);\n\t\t\t\tif (!closeQuietly) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n...
[ "def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Creates a new object with the given kwargs, saving it to the database and returning the created object.
[ "def create(self, **kwargs):\n \n obj = self.model(**kwargs)\n meta = obj.get_meta()\n meta.connection = get_es_connection(self.es_url, self.es_kwargs)\n meta.index=self.index\n meta.type=self.type\n obj.save(force=True)\n return obj" ]
[ "def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Returns two dictionaries: 1) name=>contig length. 2) Second is dictionary of nucmer hits (ignoring self matches). contig name => list of hits
[ "def _load_nucmer_hits(self, infile):\n ''''''\n hits = {}\n lengths = {}\n file_reader = pymummer.coords_file.reader(infile)\n for al in file_reader:\n if al.qry_name == al.ref_name:\n continue\n elif al.qry_name not in hits:\n ...
[ "def check_field_cohesion(self, present_label_fields):\n \n # Ensure all written annotation fields have the same length\n nannots = len(self.sample)\n\n for field in ['sample', 'num', 'subtype', 'chan', 'aux_note']+present_label_fields:\n if getattr(self, field) is not None:\n...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Add a cell to the array, 'resizing' it first if necessary (if it doesn't fit).
[ "private void internalAdd(Cell cell)\n {\n if (cells.length == size)\n cells = Arrays.copyOf(cells, Math.max(MINIMAL_CAPACITY, size * 3 / 2 + 1));\n cells[size++] = cell;\n }" ]
[ "def _set_text(self, value):\n \n working_index = self.working_index\n working_lines = self._working_lines\n\n original_value = working_lines[working_index]\n working_lines[working_index] = value\n\n # Return True when this text has been changed.\n if len(value) != l...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Bootstraps a lovefield binary such that is runnable in nodejs. @param {string} lovefieldBinary The aboslute path of the binary file.
[ "function bootstrap(lovefieldBinary) {\n // Setting \"window\" to be Node's global context.\n global.window = global;\n\n // Setting \"self\" to be Node's global context. This must be placed after\n // global.window.\n global.self = global;\n\n // Setting \"document\" to a dummy object, even though it is not ...
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// WithContext adds the context to the destroy one params
[ "func (o *DestroyOneParams) WithContext(ctx context.Context) *DestroyOneParams {\n\to.SetContext(ctx)\n\treturn o\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 about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Creates the response JSON body
[ "public function createBody()\n {\n $body = array(\n 'isDestructive' => $this->removesRows,\n 'isError' => $this->isError(),\n 'isWarning' => false,\n 'message' => $this->message,\n 'successClasses' => $this->successClasses,\n 'failedClasse...
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns XML for the article corresponding to a PMC ID.
[ "def get_xml(pmc_id):\n \"\"\"\"\"\"\n if pmc_id.upper().startswith('PMC'):\n pmc_id = pmc_id[3:]\n # Request params\n params = {}\n params['verb'] = 'GetRecord'\n params['identifier'] = 'oai:pubmedcentral.nih.gov:%s' % pmc_id\n params['metadataPrefix'] = 'pmc'\n # Submit the request\...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Add a custom header. @param string $name The name of the custom header. @param string $value The value of the custom header. @throws \InvalidArgumentException
[ "public function add(string $name, string $value): void\n {\n $header = $this->make();\n $header->name = $name;\n $header->value = $value;\n $this->set($header);\n }" ]
[ "protected function checkSortableColumnHasAttribute(TableListColumn $column): void\n {\n if (! $column->getAttribute('attribute') && $column->getAttribute('isSortableColumn')) {\n $errorMessage = 'One of the sortable columns has no defined attribute. You have to define a column '\n ...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Find an order value indicated by the given object. <p>The default implementation checks against the {@link Ordered} interface. Can be overridden in subclasses. @param obj the object to check @return the order value, or {@code null} if none found
[ "protected Integer findOrder(Object obj) {\n\t\treturn (obj instanceof Ordered ? ((Ordered) obj).getOrder() : null);\n\t}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return the Euler totient function of n.
[ "def phi( n ):\n \"\"\"\"\"\"\n\n assert isinstance( n, integer_types )\n\n if n < 3: return 1\n\n result = 1\n ff = factorization( n )\n for f in ff:\n e = f[1]\n if e > 1:\n result = result * f[0] ** (e-1) * ( f[0] - 1 )\n else:\n result = result * ( f[0] - 1 )\n return result" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Utility function to decrypt json. @param $ciphertextFileName @param Config|null $config @return mixed @throws \Exception
[ "static public function decryptJson($ciphertextFileName, Config $config = null) {\n $content = self::decrypt($ciphertextFileName, $config);\n $data = json_decode($content, JSON_OBJECT_AS_ARRAY);\n Util::isArrayOrFail(\"Encrypted secrets\", $data);\n return $data;\n }" ]
[ "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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Load scripts into the page, and call a callback when they are loaded. @param {Array} scripts The scripts to be loaded. @param {Function} loadedCallback The function to be called when all the scripts have loaded.
[ "function loadScripts(scripts, loadedCallback) {\n var srcs = [], property, count, i, src,\n countDown = function () {\n count -= 1;\n if (!count) {\n loadedCallback();\n }\n };\n\n for (property in scripts) {\n if (!(property in window)) {\n src...
[ "function ContextMenus(chrome) {\n this.chrome = chrome;\n\n /**\n * The maximum number of top level extension items that can be added to an extension\n * action context menu. Any items beyond this limit will be ignored.\n * @property {undefined}\n */\n this.ACTION_MENU_TOP_LEVEL_LIMIT = null;\n\n /**\n...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates an MP4Box binary adapter. @param null|LoggerInterface $logger @param array|ConfigurationInterface $conf @return MP4Box
[ "public static function create($conf = array(), LoggerInterface $logger = null)\n {\n if (!$conf instanceof ConfigurationInterface) {\n $conf = new Configuration($conf);\n }\n\n $binaries = $conf->get('mp4box.binaries', array('MP4Box'));\n\n return static::load($binaries, $...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Google Discoverability Registers Google Discoverability meta tags declared @return void Register an Google Discoverability property. @param string $property @param string $data
[ "public function renderGoogleOwnerMetaTags() {\r\n\t\tforeach ($this->googleOwnerTags as $type => $value) { // loop through any other OG tags declared\r\n\t\t\t$this->registerGoogleOwner($type, $value);\r\n\t\t}\r\n\t}" ]
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetRejectionStatement sets the RejectionStatement field's value.
[ "func (s *PutIntentOutput) SetRejectionStatement(v *Statement) *PutIntentOutput {\n\ts.RejectionStatement = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Output an error indicating that tags were out of order.
[ "def order_error(subtag, got, expected):\n \n options = SUBTAG_TYPES[expected:]\n if len(options) == 1:\n expect_str = options[0]\n elif len(options) == 2:\n expect_str = '%s or %s' % (options[0], options[1])\n else:\n expect_str = '%s, or %s' % (', '.join(options[:-1]), options[...
[ "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 text about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
Visit ExportDeclaration. Examples: export default = value export default; export DECLARATION export { name, one as other }
[ "function visitExportDeclaration(traverse, node, path, state) {\n var specifier, name, len, i;\n utils.catchup(node.range[0], state);\n\n if (node.declaration) {\n\n // export default = value\n if (Array.isArray(node.declaration)) {\n\n assert(\n node.declaration.length === 1,\n formatEr...
[ "function(schemaName, target, cb) {\n filter(schemaName, target, cb, { FUNCS: COMMANDS, mode: 'remove' })\n}" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
多行文本输入框 @param $name @param $value @param $attrArray @return string
[ "static function text($name,$value='',$attrArray=null)\n\t{\n\t\tif(!isset($attrArray['cols'])) $attrArray['cols'] = 60;\n\t\tif(!isset($attrArray['rows'])) $attrArray['rows'] = 3;\n\t\t$attrStr = self::input_attr($attrArray);\n\t\t$forms = \"<textarea name='{$name}' id='{$name}' $attrStr>$value</textarea>\";\n\t\t...
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
/* (non-Javadoc) @see com.ibm.websphere.logging.hpel.reader.RepositoryLogRecord#getFormattedMessage()
[ "@Override\n\tpublic String getFormattedMessage() {\n\t\tString result = localizedMessage==null ? rawMessage : localizedMessage;\n\t\tif (parameters != null) {\n\t\t\ttry {\n\t\t\t\treturn MessageFormat.format(result, parameters);\n\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t// In case of problem with p...
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Save data to log file @param string $data @param int $execTime @param int $queryNr
[ "protected function save($data, $execTime, $queryNr)\n {\n $filePrefix = ($this->separateConsoleLog &&\n $this->app->runningInConsole()) ? '-artisan' : '';\n\n // save normal query to file if enabled\n if ($this->logStatus) {\n $this->saveLog($data, date('Y-m-d') . $filePre...
[ "public function start()\n {\n $time = microtime(true);\n\n $this->startTime = $time;\n $this->lastTime = $time;\n\n $this->displayLine('step', 'time', 'delta', 'memory', 'peak');\n $this->addStep('Init debug');\n\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software Development:" }
// Override provides a mock function with given fields: newImage, oldImage
[ "func (_m *DFS) Override(newImage string, oldImage string) error {\n\tret := _m.Called(newImage, oldImage)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, string) error); ok {\n\t\tr0 = rf(newImage, oldImage)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}" ]
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns a projection of the categories :param term_doc_mat: a TermDocMatrix :return: CategoryProjection
[ "def project(self, term_doc_mat, x_dim=0, y_dim=1):\n '''\n \n '''\n return self._project_category_corpus(self._get_category_metadata_corpus(term_doc_mat),\n x_dim, y_dim)" ]
[ "def fit(self, dataset):\n \n if not isinstance(dataset, RDD):\n raise TypeError(\"dataset should be an RDD of term frequency vectors\")\n jmodel = callMLlibFunc(\"fitIDF\", self.minDocFreq, dataset.map(_convert_to_vector))\n return IDFModel(jmodel)" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Introspect this object for FFDC output. @return List<String>
[ "public List<String> introspect() {\n List<String> rc = new LinkedList<String>();\n String prefix = getClass().getSimpleName() + \"@\" + hashCode() + \": \";\n rc.add(prefix + \"closed=\" + this.closed);\n rc.add(prefix + \"processClose=\" + this.processClose);\n rc.add(prefix + \...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }