query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
/* Write a String as a Network Int n, followed by n Bytes Alternative to 16 bit read/writeUTF. Encoding standard is... ?
[ "public static void writeString(DataOutput out, String s) throws IOException {\n if (s != null) {\n byte[] buffer = s.getBytes(\"UTF-8\");\n int len = buffer.length;\n out.writeInt(len);\n out.write(buffer, 0, len);\n } else {\n out.writeInt(-1);\...
[ "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 post about 32-bit integers:", "pos": "Represent the Github code about 32-bit integers:", "neg": "Represent the Github code about programming:" }
Adds a custom header to the mail @param string $key @param string $value @return sFire\Mail\Mail
[ "public function addHeader($key, $value) {\r\n\r\n\t\tif(false === is_string($key)) {\r\n\t\t\treturn trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, \"%s\" given', __METHOD__, gettype($key)), E_USER_ERROR);\r\n\t\t}\r\n\r\n\t\tif(false === is_string($value)) {\r\n\t\t\treturn trigger_e...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Insert value in the keystore. Return the UUID key.
[ "def insert(self, value):\n \"\"\n key = str(uuid4())\n self.set(key, value)\n return key" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns a crontab with jobs from job path It replaces jobs previously generated by this function It preserves jobs not generated by this function
[ "def generate_crontab(current_crontab, path_to_jobs, path_to_app, unique_id):\n \n set_disable_envar = ''\n if os.environ.get('DISABLE_COLLECTORS') == 'true':\n set_disable_envar = 'DISABLE_COLLECTORS={} '.format(\n os.environ.get('DISABLE_COLLECTORS'))\n job_template = '{schedule} ' \...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Append will append a new Value on the end of the internal list
[ "func (list *List) Append(value Value) {\n\tlist.values = append(list.values, value)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Clear the cache for the given authority. @param \Illuminate\Database\Eloquent\Model $authority @return $this
[ "public function refreshFor(Model $authority)\n {\n $this->cache->forget($this->getCacheKey($authority, 'abilities', true));\n $this->cache->forget($this->getCacheKey($authority, 'abilities', false));\n $this->cache->forget($this->getCacheKey($authority, 'roles'));\n\n return $this;\n...
[ "public function boot()\n {\n $manager = new Manager;\n\n // If you have to customize the manager instance, like setting a custom serializer,\n // I strongly suggest you to create your own service provider and add you manager configuration action here\n // Here some example if you wan...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// ReadResponse reads a server response into the received o.
[ "func (o *DestroyOneReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewDestroyOneNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Convert object to a geometry string
[ "def to_s\n str = ''\n if @width > 0\n fmt = @width.truncate == @width ? '%d' : '%.2f'\n str << format(fmt, @width)\n str << '%' if @flag == PercentGeometry\n end\n\n str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)\n\n if @height > 0\n fmt...
[ "@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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check if a user has voted for this entry @param integer $user_id Optinal user ID to set as voter @param string $ip IP Address @return integer
[ "public function ballot($user_id = 0, $ip = null)\n\t{\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$vote = new Vote();\n\t\t\t$vote->set('item_type', 'comment');\n\t\t\t$vote->set('item_id', $this->get('id'));\n\t\t\t$vote->set('created_by', $user_id);\n\t\t\t$vote->set('ip', $ip);\n\n\t\t\treturn $vote;\n\t\t}\n\n\t\t...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Set property as the value. The third argument ``priority`` is not implemented yet.
[ "def setProperty(self, prop: str, value: str, priority: str = None\n ) -> None:\n \n self[prop] = value" ]
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// UnmarshalJSON implements the json.Unmarshaler interface for host // whitelists, taking a comma-separated string of hosts.
[ "func (wl *Basic) UnmarshalJSON(in []byte) error {\n\tif in[0] != '\"' || in[len(in)-1] != '\"' {\n\t\treturn errors.New(\"whitelist: invalid whitelist\")\n\t}\n\n\tif wl.lock == nil {\n\t\twl.lock = new(sync.Mutex)\n\t}\n\n\twl.lock.Lock()\n\tdefer wl.lock.Unlock()\n\n\tnetString := strings.TrimSpace(string(in[1 :...
[ "func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Low power scan results in the background will be delivered via Intent
[ "PendingIntent getScanCallbackIntent() {\n Intent intent = new Intent(mContext, StartupBroadcastReceiver.class);\n intent.putExtra(\"o-scan\", true);\n return PendingIntent.getBroadcast(mContext,0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n }" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Notify this channel of inbound data
[ "def _notify(self, data):\n \"\"\"\"\"\"\n payload = tlv.decode(\n payload=data.get('payload'),\n content_type=data.get('ct'),\n decode_b64=True\n )\n super(CurrentResourceValue, self)._notify(payload)\n # after one response, close the channel\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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Convert a single line of text *m* to a raster image, by rendering it using the font in *font*. A triple of (*width*, *height*, *pixels*) is returned; *pixels* is in boxed row packed pixel format.
[ "def linetoraster(m):\n \n\n # Assumes monospaced font.\n x = 8 * len(m)\n y = 8\n return x, y, [itertools.chain(*row) for row in zip(*map(char, m))]" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns the number of commerce currencies where groupId = &#63; and primary = &#63; and active = &#63;. @param groupId the group ID @param primary the primary @param active the active @return the number of matching commerce currencies
[ "@Override\n\tpublic int countByG_P_A(long groupId, boolean primary, boolean active) {\n\t\tFinderPath finderPath = FINDER_PATH_COUNT_BY_G_P_A;\n\n\t\tObject[] finderArgs = new Object[] { groupId, primary, active };\n\n\t\tLong count = (Long)finderCache.getResult(finderPath, finderArgs, this);\n\n\t\tif (count == n...
[ "function Bid(value) {\n if (this.init_) {\n this.init_();\n }\n /** @property {Array.<number, number>} [sizes] the dimension sizes of the slot bid */\n this.sizes = [];\n /** @property {string} [slot] the slot name */\n this.slot;\n /** @property {string|number} value the bid value. Default: empty strin...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Fit regression model to data :param: time (column of data) :return: predicted points :return: residuals :return: mean residual :return: error
[ "def _get_fit(self, time: int) -> typing.Tuple[np.ndarray, np.ndarray, float, float]:\n \n rawdata = self.averagedata[:, time]\n domain = np.arange(len(rawdata))\n datalength = len(domain)\n coefficients = np.zeros((datalength, self.function_number + 2))\n coefficients[:, 0...
[ "def _results(r):\n \"\"\"\n x, funcalls, iterations, flag = r\n return results(x, funcalls, iterations, flag == 0)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Property which dynamically construct transcript objects for all transcript IDs associated with this gene.
[ "def transcripts(self):\n \n transcript_id_results = self.db.query(\n select_column_names=['transcript_id'],\n filter_column='gene_id',\n filter_value=self.id,\n feature='transcript',\n distinct=False,\n required=False)\n\n # We'...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Remove a specific site from all users Return True or false @param string $propertyName Property name @param string $value Property value with a site @return bool @throws \ByJG\MicroOrm\Exception\InvalidArgumentException
[ "public function removeAllProperties($propertyName, $value = null)\n {\n $updateable = Updatable::getInstance()\n ->table($this->getUserPropertiesDefinition()->table())\n ->where(\"{$this->getUserPropertiesDefinition()->getName()} = :name\", [\"name\" => $propertyName]);\n\n i...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Generates timephased costs from timephased work where multiple cost rates apply to the assignment. @param standardWorkList timephased work @param overtimeWorkList timephased work @return timephased cost
[ "private List<TimephasedCost> getTimephasedCostMultipleRates(List<TimephasedWork> standardWorkList, List<TimephasedWork> overtimeWorkList)\n {\n List<TimephasedWork> standardWorkResult = new LinkedList<TimephasedWork>();\n List<TimephasedWork> overtimeWorkResult = new LinkedList<TimephasedWork>();\n ...
[ "def dependent_on_composite_state(self):\n \n composite_state = NodesCompositeState()\n\n for dependent_on in self.tree.dependent_on:\n node_b = self.find_counterpart_in(dependent_on)\n\n if node_b is None:\n # special case when counterpart tree has no proce...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Implements the "Evaluating operations" section of the spec.
[ "protected static function executeOperation(ExecutionContext $context, $root, OperationDefinition $operation)\n {\n $type = self::getOperationRootType($context->schema, $operation);\n $fields = self::collectFields($context, $type, $operation->get('selectionSet'), new \\ArrayObject(), new \\ArrayObj...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// lexInclude will consume the include value.
[ "func lexInclude(lx *lexer) stateFn {\n\tr := lx.next()\n\tswitch {\n\tcase r == sqStringStart:\n\t\tlx.ignore() // ignore the \" or '\n\t\treturn lexIncludeQuotedString\n\tcase r == dqStringStart:\n\t\tlx.ignore() // ignore the \" or '\n\t\treturn lexIncludeDubQuotedString\n\tcase r == arrayStart:\n\t\treturn lx.e...
[ "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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Merges the properties of the source object onto the target object. Alters the target object. @private @param {object} destination @param {object} source @param {boolean} [deep=false] @param {boolean} [handleErrors=false] @return {void}
[ "function(destination, source, deep, handleErrors) {\n var sourceKeys = [],\n key = '',\n i = -1;\n\n deep = deep || false;\n handleErrors = handleErrors || false;\n\n try {\n if (Array.isArray(source)) {\n ...
[ "function factoryObjectGraph(ParentClassGraph){/**\n * Inherited class. Class with methods for control links in graph.\n * Adapted for array collection.\n * \n * @class\n * @description `import { ObjectGraph as Graph } from 'ancient-graph';`\n */var ObjectGraph=function(_ParentClassGraph){_inherits(Obje...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Set debugger bar info @param string $label Info label @param string|int $value Info value @return $this
[ "public function setBarInfo(string $label, $value)\n {\n /** @var \\Tracy\\DefaultBarPanel $panel */\n $panel = $this->getBarPanel('Tracy:info');\n $panel and $panel->data = ArrayUtils::merge((array) $panel->data, [$label => (string) $value]);\n return $this;\n }" ]
[ "function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
// PeerStatus mocks base method
[ "func (m *MockCluster) PeerStatus(arg0 string) (map[string]api.Status, error) {\n\tret := m.ctrl.Call(m, \"PeerStatus\", arg0)\n\tret0, _ := ret[0].(map[string]api.Status)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
{@inheritDoc} @see org.audit4j.core.schedule.TaskExecutor#execute(java.lang.Runnable)
[ "@Override\n public void execute(Runnable task) {\n Executor executor = getScheduledExecutor();\n try {\n executor.execute(errorHandlingTask(task, false));\n } catch (RejectedExecutionException ex) {\n throw new TaskRejectedException(\"Executor [\" + executor + \"] did ...
[ "@Around(value = \"execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)\")\n public Object doProfilingClass(ProceedingJoinPoint pjp, Monitor monitor) throws Throwable {\n return doProfiling(pjp, monitor.producerId(), monitor.subsystem(), monitor.catego...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Apply formatting.
[ "def format(self, **kwargs):\n \"\"\"\"\"\"\n attrs = self._attrs.copy()\n attrs.update(kwargs)\n return Region(self._geojson, **attrs)" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
Move the turtle to a coordinate. :param x: x coordinate :param y: y coordinate
[ "def move(self, x, y):\n \n if self.brush_on:\n for lx, ly in line(self.pos_x, self.pos_y, x, y):\n self.set(lx, ly)\n\n self.pos_x = x\n self.pos_y = y" ]
[ "def contains(self, x, y) -> bool:\n \"\n if x < self._left or x > self._right or y < self._top or y > self._bottom:\n return False\n return True" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
// ContainerExport writes the contents of the container to the given // writer. An error is returned if the container cannot be found.
[ "func (daemon *Daemon) ContainerExport(name string, out io.Writer) error {\n\tcontainer, err := daemon.GetContainer(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif runtime.GOOS == \"windows\" && container.OS == \"windows\" {\n\t\treturn fmt.Errorf(\"the daemon on this operating system does not support exporti...
[ "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Truncating the file count deletes any files with ids at or above the new count.
[ "public void truncateFileCount(long count) throws IOException {\n if (count < 0) {\n throw new IllegalArgumentException(\"count < 0: \" + count);\n }\n try {\n mFileTableLock.acquireUpgradableLock();\n long oldCount = getFileCount();\n if (count >= ol...
[ "def _create_hashes(self,count):\n \n for i in range(0,count):\n #Get 1/numblocks of the hash\n blocksize = int(len(self.hexdigest) / count)\n currentstart = (1 + i) * blocksize - blocksize\n currentend = (1 +i) * blocksize\n self.hasharray.a...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add new data to a trained model. (trainedmodels.update) @param string $id The unique name for the predictive model. @param Google_Update $postBody @param array $optParams Optional parameters. @return Google_Training
[ "public function update($id, Google_Update $postBody, $optParams = array()) {\n $params = array('id' => $id, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('update', array($params));\n if ($this->useObjects()) {\n return new Google_Training...
[ "@Operation(name=\"$find-matches\", idempotent=true)\n public Parameters findMatchesAdvanced(\n @OperationParam(name=\"dateRange\") DateRangeParam theDate,\n @OperationParam(name=\"name\") List<StringParam> theName,\n @OperationParam(name=\"code\") TokenAndListParam theEnd) {\n \n Paramet...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
if at least one specification is false, return false, else return true.
[ "public function isSatisfiedBy(Item $item): bool\n {\n foreach ($this->specifications as $specification) {\n if (!$specification->isSatisfiedBy($item)) {\n return false;\n }\n }\n\n return true;\n }" ]
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Formats a field definition. @param array $field A partial field definition. @return array A complete field definition.
[ "public function field($field)\n {\n if (!isset($field['name'])) {\n throw new SqlException(\"Missing column name.\");\n }\n if (!isset($field['use'])) {\n if (isset($field['type'])) {\n $field += $this->type($field['type']);\n } else {\n ...
[ "private function getColumnFromName($name)\n {\n foreach ($this->columnConfiguration as $i => $col) {\n if ($col->getName() == $name) {\n return $col;\n }\n }\n\n // This exception should never happen. If it does, something is\n // wrong w/ the rel...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Je aktualni stranka povolena @param string $link @return bool
[ "public function isLinkAllowed(string $link): bool\n\t{\n\t\t$this->prepareLink($link);\n\t\treturn $this->links[$link]->allowed;\n\t}" ]
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
create a directory. @return bool false if the directory did already exist
[ "public static function create($dir, $chmod = null)\n {\n if (!file_exists($dir)) {\n if ($chmod === null) {\n $chmod = self::$defaultChmod;\n }\n mkdir($dir, $chmod, true);\n // php mkdir apply umask on the given mode, so we must to\n ...
[ "def _is_path(instance, attribute, s, exists=True):\n \"\"\n if not s:\n # allow False as a default\n return\n if exists:\n if os.path.exists(s):\n return\n else:\n raise OSError(\"path does not exist\")\n else:\n # how do we tell if it's a path i...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
check the Tax Identification Number number, default modulo 11. @param ptin vat id to check @return true if checksum is ok
[ "private boolean checkModulo11Tin(final String ptin) {\r\n final int checkSum = ptin.charAt(ptin.length() - 1) - '0';\r\n int sum = 10;\r\n for (int i = 0; i < ptin.length() - 1; i++) {\r\n int summe = (ptin.charAt(i) - '0' + sum) % 10;\r\n if (summe == 0) {\r\n summe = 10;\r\n }\r\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
List server images
[ "def image_list(self, name=None):\n '''\n \n '''\n nt_ks = self.compute_conn\n ret = {}\n for image in nt_ks.images.list():\n links = {}\n for link in image.links:\n links[link['rel']] = link['href']\n ret[image.name] = {\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Rollback all inserts when the import throws an error halfway @param Garp_Model $model @param Array $primaryKeys Collection of primary keys @return Void
[ "public function rollback(Garp_Model $model, array $primaryKeys) {\n if (empty($primaryKeys)) {\n return;\n }\n $primaryCols = (array)$model->info(Zend_Db_Table::PRIMARY);\n $where = array();\n foreach ($primaryKeys as $pk) {\n $recordWhere = array();\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 about Database management:", "pos": "Represent the code about Database management:", "neg": "Represent the code:" }
Shortcut for calling {@code Variables.fileValue(name).file(file).mimeType(type).create()}. The name is set to the file name and the mime type is detected via {@link MimetypesFileTypeMap}.
[ "public static FileValue fileValue(File file){\n String contentType = MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file);\n return new FileValueBuilderImpl(file.getName()).file(file).mimeType(contentType).create();\n }" ]
[ "private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// GetRegionID リージョンID 取得
[ "func (p *propZone) GetRegionID() int64 {\n\tif p.Zone == nil {\n\t\treturn -1\n\t}\n\treturn p.Zone.GetRegionID()\n}" ]
[ "function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'sr_Latn_BA'
[ "func (sr *sr_Latn_BA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {\n\treturn locales.PluralRuleOther\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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// List takes label and field selectors, and returns the list of Secrets that match those selectors.
[ "func (c *FakeSecrets) List(opts v1.ListOptions) (result *corev1.SecretList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(secretsResource, secretsKind, c.ns, opts), &corev1.SecretList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github post about Agent Identity Management:", "pos": "Represent the Github code about Agent Identity Management:", "neg": "Represent the Github code about programming:" }
// SetFilters sets the Filters field's value.
[ "func (s *DescribeDBParametersInput) SetFilters(v []*Filter) *DescribeDBParametersInput {\n\ts.Filters = v\n\treturn s\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SetComputerName sets the ComputerName field's value.
[ "func (s *CreateComputerInput) SetComputerName(v string) *CreateComputerInput {\n\ts.ComputerName = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Parse Content-Disposition header string. @param {string} string @return {object} @public
[ "function parse (string) {\n if (!string || typeof string !== 'string') {\n throw new TypeError('argument string is required')\n }\n\n var match = DISPOSITION_TYPE_REGEXP.exec(string)\n\n if (!match) {\n throw new TypeError('invalid type format')\n }\n\n // normalize type\n var index = match[0].length\...
[ "function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Make sure view filename is OK. Same as in twig. @param string $path @throws PathException
[ "private function validatePath(string $path)\n {\n if (empty($path)) {\n throw new PathException('A view path is empty');\n }\n\n if (false !== strpos($path, \"\\0\")) {\n throw new PathException('A view path cannot contain NUL bytes');\n }\n\n $path = ltr...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetUnion adds several values to an array and return it as a set (an array with // distinct values).
[ "func (t Term) SetUnion(args ...interface{}) Term {\n\treturn constructMethodTerm(t, \"SetUnion\", p.Term_SET_UNION, args, map[string]interface{}{})\n}" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Register registers a site-specific importer. It should only be called from init, // and not from concurrent goroutines.
[ "func Register(name string, im Importer) {\n\tif _, dup := importers[name]; dup {\n\t\tpanic(\"Dup registration of importer \" + name)\n\t}\n\tif _, dup := reservedImporterKey[name]; dup {\n\t\tpanic(\"Dup registration of importer \" + name)\n\t}\n\tif pt := im.Properties().PermanodeImporterType; pt != \"\" {\n\t\t...
[ "function() {\n if (options.servePacked) {\n ss.bundler.forEach(function(bundler) {\n bundler.useLatestsPackedId();\n });\n }\n ss.bundler.load();\n //TODO convert options.dirs to relative paths stripping the lead '/' if present\n\n // Cache instances of code formatte...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Evaluate any Closure attributes on the attribute array. @param array $attributes @return array
[ "protected function callClosureAttributes(array $attributes)\n {\n foreach ($attributes as &$attribute) {\n $attribute = $attribute instanceof Closure\n ? $attribute($attributes) : $attribute;\n }\n\n return $attributes;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// NewGitHubRepoVFS creates a new VFS backed by a GitHub downloadable // repository archive.
[ "func NewGitHubRepoVFS(ctx context.Context, repo, rev string) (*ArchiveFS, error) {\n\tif !githubRepoRx.MatchString(repo) {\n\t\treturn nil, fmt.Errorf(`invalid GitHub repo %q: must be \"github.com/user/repo\"`, repo)\n\t}\n\n\turl := fmt.Sprintf(\"https://codeload.%s/zip/%s\", repo, rev)\n\treturn NewZipVFS(ctx, u...
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
得到某个列的数组 @access public @param Query $query 查询对象 @param string $field 字段名 多个字段用逗号分隔 @param string $key 索引 @return array
[ "public function column(Query $query, $field, $key = '')\n {\n $options = $query->getOptions();\n\n if ($this->cache && empty($options['fetch_sql']) && !empty($options['cache'])) {\n // 判断查询缓存\n $cache = $options['cache'];\n\n $guid = is_string($cache['key']) ? $c...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Entry point from the operating system command line. <p>Calls {@link System#exit(int)} with the following status codes: <ul> <li>0: success</li> <li>1: invalid arguments</li> <li>2: help</li> </ul> @param args Command-line arguments
[ "public static void main(String[] args) {\n final PrintWriter out = new PrintWriter(System.out);\n final PrintWriter err = new PrintWriter(System.err);\n final int code = Launcher.main2(out, err, Arrays.asList(args));\n System.exit(code);\n }" ]
[ "public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about writing:" }
Applies a rolling sum operator to the stream. Attributes: sum_attribute_index (int): The index of the attribute to sum (assuming tuple records).
[ "def reduce(self, reduce_fn):\n \n op = Operator(\n _generate_uuid(),\n OpType.Reduce,\n \"Sum\",\n reduce_fn,\n num_instances=self.env.config.parallelism)\n return self.__register(op)" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// ReadyBlock is a thin wrapper around ReadyProvider.Ready() that // handles checking for duplicates.
[ "func ReadyBlock(\n\tctx context.Context, bcache BlockCache, rp ReadyProvider,\n\tkmd libkey.KeyMetadata, block Block, chargedTo keybase1.UserOrTeamID,\n\tbType keybase1.BlockType) (\n\tinfo BlockInfo, plainSize int, readyBlockData ReadyBlockData, err error) {\n\tvar ptr BlockPointer\n\tdirectType := DirectBlock\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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
call after uis clear
[ "function ( n ) { \n\n var i = this.uis.indexOf( n ); \n if ( i !== -1 ) {\n this.inner.removeChild( this.uis[i].c[0] );\n this.uis.splice( i, 1 ); \n }\n\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
TypeNotFoundError Perform type lookup @param [Object] object @return [Object] if found @raise [TypeNotFoundError] otherwise @api private
[ "def call(object)\n current = target = object.class\n while current != Object\n if registry.key?(current)\n return registry.fetch(current)\n end\n current = current.superclass\n end\n\n fail TypeNotFoundError, target\n end" ]
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Close closes the connection to ETCD.
[ "func (db *BytesConnectionEtcd) Close() error {\n\tif db.etcdClient != nil {\n\t\treturn db.etcdClient.Close()\n\t}\n\treturn nil\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the text about Computer Networking:", "pos": "Represent the code about Computer Networking:", "neg": "Represent the code:" }
Returns a valid ObjC string literal (excluding quotes).
[ "public static String escapeStringLiteral(String s) {\n StringBuilder sb = null;\n int len = s.length();\n int lastIndex = 0;\n for (int i = 0; i < len; i++) {\n String replacement = escapeCharacterForStringLiteral(s.charAt(i), s, i);\n if (replacement == null) {\n continue;\n }\n ...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Calculate quantiles.
[ "private void init() {\n quantiles = new double[data.length][8];\n for (int i = 0; i < data.length; i++) {\n int n = data[i].length;\n Arrays.sort(data[i]);\n quantiles[i][1] = data[i][n / 4];\n quantiles[i][2] = data[i][n / 2];\n quantiles[i][3] ...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
XOR a given string ``s`` with the one-time-pad ``pad``
[ "def xor(s, pad):\n ''''''\n from itertools import cycle\n s = bytearray(force_bytes(s, encoding='latin-1'))\n pad = bytearray(force_bytes(pad, encoding='latin-1'))\n return binary_type(bytearray(x ^ y for x, y in zip(s, cycle(pad))))" ]
[ "def genKw(w,msk,z):\n \n # Hash inputs into a string of bytes\n b = hmac(msk, z + w, tag=\"TAG_PYTHIA_KW\")\n\n # Convert the string into a long value (no larger than the order of Gt),\n # then return a BigInt value.\n return BigInt(longFromString(b) % long(orderGt()))" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
For given field name get the actual hint message
[ "public String getWrappingHint(String fieldName) {\n if (isEmpty()) {\n return \"\";\n }\n\n return String.format(\" You can use this expression: %s(%s(%s))\",\n formatMethod(wrappingMethodOwnerName, wrappingMethodName, \"\"),\n formatMethod(copyMethodOw...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parses next double in scientific form @param cs @param beginIndex @param endIndex @return
[ "public static final double findScientific(CharSequence cs, int beginIndex, int endIndex)\r\n {\r\n int begin = CharSequences.indexOf(cs, Primitives::isScientificDigit, beginIndex);\r\n int end = CharSequences.indexOf(cs, (c)->!Primitives.isScientificDigit(c), begin);\r\n return parseDouble(...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Make this MultiValue Immutable. @return MultiValue
[ "public function immutable()\n {\n $this->isImmutable = true;\n\n // Lock nested items.\n foreach ($this->getArrayCopy() as $item) {\n if ($item instanceof MultiValue) {\n $item->immutable();\n }\n }\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetupChain wraps the reader returned by getReader in an http.Handler along // with some middleware that calculates internal metrics about requests.
[ "func SetupChain(ctx context.Context, sink Sink, chainType string, getReader func(Sink) ErrorReader, httpChain web.NextConstructor, logger log.Logger, moreConstructors ...web.Constructor) (http.Handler, sfxclient.Collector) {\n\tzippers := zipper.NewZipper()\n\n\tcounter := &dpsink.Counter{\n\t\tLogger: logg...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Write all the scripts for `dist`, unless scripts are excluded
[ "def install_egg_scripts(self, dist):\n \"\"\"\"\"\"\n if not self.exclude_scripts and dist.metadata_isdir('scripts'):\n for script_name in dist.metadata_listdir('scripts'):\n if dist.metadata_isdir('scripts/' + script_name):\n # The \"script\" is a directo...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Converts laravel rules to jquery validation rules with given $name @see Illuminate\Html\FormBuilder
[ "public function laravelToJquery($inputName)\n\t{\n\t\t$jqueryRules = [];\n\n\t\tif(!$this->doesRuleExist($inputName))\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\t$rules = explode('|', $this->getRule($inputName));\n\t\t$type = $this->getType($rules);\n\n\t\tforeach ($rules as $key => $value) \n\t\t{\n\t\t\t$jqueryRules ...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
attachWss @param \PHPDaemon\Network\Pool $wss @return boolean
[ "public function attachWss($wss)\n {\n if ($this->wss->contains($wss)) {\n return false;\n }\n $this->wss->attach($wss);\n $wss->bind('customTransport', [$this, 'wsHandler']);\n return true;\n }" ]
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
To dispatch a route @param string $method @param string $uri @return mixed @throws Exception
[ "public function dispatch($method, $uri)\r\n {\r\n $routeInfo = $this->dispatcher->dispatch($method, $uri);\r\n\r\n if($routeInfo[0] === Dispatcher::NOT_FOUND) {\r\n\r\n $this->filterRequest('*', $method);\r\n\r\n $routeInfo = $this->dispatcher->dispatch($method, '*');\r\n\r\n...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Programming:" }
Replies the squared distance between this segment and the given point. @param point @return the squared distance.
[ "@Pure\n\tpublic double distanceSquaredSegment(Point3D point) {\n\t\treturn distanceSquaredSegmentPoint(\n\t\t\t\tgetX1(), getY1(), getZ1(),\n\t\t\t\tgetX2(), getY2(), getZ2(),\n\t\t\t\tpoint.getX(), point.getY(), point.getZ());\n\t}" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github summarization about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public RenderingIntentReserved2 createRenderingIntentReserved2FromString(EDataType eDataType, String initialValue) {\n\t\tRenderingIntentReserved2 result = RenderingIntentReserved2.get(initialValue);\n\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enu...
[ "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:" }
Matrix-vector product for Hermitian-packed matrix.
[ "def cublasZhpmv(handle, uplo, n, alpha, AP, x, incx, beta, y, incy):\n \n \n status = _libcublas.cublasZhpmv_v2(handle,\n _CUBLAS_FILL_MODE[uplo], \n n, ctypes.byref(cuda.cuDoubleComplex(alpha.real,\n ...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
<pre> Describes all violations in a client request. </pre> <code>repeated .google.rpc.BadRequest.FieldViolation field_violations = 1;</code>
[ "public java.util.List<com.google.rpc.BadRequest.FieldViolation> getFieldViolationsList() {\n return fieldViolations_;\n }" ]
[ "@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.appengine.v1.FileInfo> getFiles() {\n return getFilesMap();\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Run a console script @param string $controller @param string $action @param array $params
[ "public static function run( $controller, $action = null, $params = array() ) \n\t{\n\t\t// always enable the file infos\n\t\t// this allows CCFile to print an info when a file gets created or deleted.\n\t\tCCFile::enable_infos();\n\n\t\t// execute by default the help action\n\t\tif ( empty( $action ) ) \n\t\t{\n\t...
[ "public function add()\n\t{\n\t\t// Get the alias we're setting\n\t\t$name = $this->arguments->getOpt(3);\n\t\t$path = $this->arguments->getOpt(4);\n\n\t\t// Delete the primary args so they aren't added as top level config values\n\t\t$this->arguments->deleteOpt(3);\n\t\t$this->arguments->deleteOpt(4);\n\n\t\t// Se...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Register a table used in the query @param string $name The name of the table @param string $alias The alias for the table @return $this Provides fluent interface
[ "public function registerTable($name, $alias)\n {\n if (!empty($alias) && empty($name))\n return;\n\n if (!empty($alias) && !empty($this->parent_scope))\n {\n $table = $this->parent_scope->resolveAlias($alias); \n if (!empty($table))\n throw ne...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software Development:" }
Adds current record to result if well formed.
[ "def _AppendRecord(self):\n \"\"\"\"\"\"\n\n # If no Values then don't output.\n if not self.values:\n return\n\n cur_record = []\n for value in self.values:\n try:\n value.OnSaveRecord()\n except SkipRecord:\n self._ClearRecord()\n return\n except SkipValue:\...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Main entry point
[ "def main(args=None):\n \n # parse args\n if args is None:\n args = parse_args(sys.argv[1:])\n\n # set logging level\n if args.verbose > 1:\n set_log_debug()\n elif args.verbose == 1:\n set_log_info()\n\n outpath = os.path.abspath(os.path.expanduser(args.out_dir))\n cach...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Register an {@link ResponseListener} to notify when {@link Response}s are added @param listener the {@link ResponseListener} to register
[ "public void registerListener(ResponseListener listener) {\n\t\tif (! listeners.contains(listener)) {\n\t\t\tboolean unique = true;\n\t\t\t\n\t\t\tfor (ResponseListener existing : listeners) {\n\t\t\t\tif (existing.getClass().equals(listener.getClass())) {\n\t\t\t\t\tunique = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t...
[ "public void init(BaseMessageReceiver messageReceiver, BaseMessageFilter messageFilter)\n {\n if (messageFilter == null)\n {\n if (messageReceiver != null)\n {\n messageFilter = messageReceiver.createDefaultFilter(this); // Add filter to handler\n ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Initialize this converter. @param converter The next converter in the converter chain. @param iFakeLength The maximum field length to return.
[ "public void init(Converter converter, int iFakeLength, int iMinimumLength)\n {\n super.init(converter);\n m_iFakeLength = iFakeLength;\n m_iMinimumLength = iMinimumLength;\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
========================================================================= lang/instanceOf.js =========================================================================
[ "function instanceOf(object, klass) {\n // Handle exceptions where the target object originates from another frame.\n // This is handy for JSON parsing (amongst other things).\n \n if (typeof klass != \"function\") {\n throw new TypeError(\"Invalid 'instanceOf' operand.\");\n }\n\n if (object == null) retu...
[ "func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// getClassForVolume returns StorageClass
[ "func (p *nfsProvisioner) getClassForVolume(pv *v1.PersistentVolume) (*storage.StorageClass, error) {\n\tif p.client == nil {\n\t\treturn nil, fmt.Errorf(\"Cannot get kube client\")\n\t}\n\tclassName := helper.GetPersistentVolumeClass(pv)\n\tif className == \"\" {\n\t\treturn nil, fmt.Errorf(\"Volume has no storage...
[ "@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param string $classname @return ClassDefinition
[ "public function buildFromClass($classname)\n\t{\n\t\t$reflectionClass = new ReflectionClass($classname);\n\n\t\t$classDefinition = new ClassDefinition();\n\t\t$classDefinition->name = $reflectionClass->getName();\n\t\t$classDefinition->namespace = $reflectionClass->getNamespaceName();\n\n\t\t$reflectionProperties ...
[ "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:" }
Retrieve a solution or the solutions list.
[ "@Override\n @Path(\"/{solutionId}\")\n @ApiOperation(value=\"Retrieve a solution or all solutions\",\n notes=\"If {solutionId} is not present, returns all solutions.\",\n response=Solution.class, responseContainer=\"List\")\n public JSONObject get(String path, Map<String,String> headers) thr...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Apply status mapping to a raw API result.
[ "def adjust_status(info: dict) -> dict:\n \"\"\"\"\"\"\n modified_info = deepcopy(info)\n modified_info.update({\n 'level':\n get_nearest_by_numeric_key(STATUS_MAP, int(info['level'])),\n 'level2':\n STATUS_MAP[99] if info['level2'] is None else\n get_nearest_...
[ "@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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Handle pasting inside tables
[ "function onPaste(\n // The plugin options\n opts?: Options,\n event: *,\n change: Change,\n editor: Editor\n): Object {\n // Outside of tables, do not alter paste behavior\n if (!isSelectionInTable(opts, change.value)) {\n return undefined;\n }\n\n const transfer = getEventTransfe...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// middlewareChain executes the middleeware chain setup
[ "func (api *API) middlewareChain(c APIContexter, w http.ResponseWriter, r *http.Request) {\n\tfor _, middleware := range api.middlewares {\n\t\tmiddleware(c, w, r)\n\t}\n}" ]
[ "def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Add a string to the trie. @param input any String
[ "public void add(String input) {\n TrieNode currentNode = root;\n\n for(char c: input.toCharArray()) {\n Map<Character, TrieNode> children = currentNode.getChildren();\n TrieNode matchingNode = children.get(c);\n if(matchingNode != null) {\n currentNode ...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// CallRPC launches a rpc call. // ch is needed to implement timeout for coprocessor streaing, the stream object's // cancel function will be sent to the channel, together with a lease checked by a background goroutine.
[ "func CallRPC(ctx context.Context, client tikvpb.TikvClient, req *Request) (*Response, error) {\n\tresp := &Response{}\n\tresp.Type = req.Type\n\tvar err error\n\tswitch req.Type {\n\tcase CmdGet:\n\t\tresp.Get, err = client.KvGet(ctx, req.Get)\n\tcase CmdScan:\n\t\tresp.Scan, err = client.KvScan(ctx, req.Scan)\n\t...
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Resets internal state of controller, except for the reset signal.
[ "def _reset_internal_state(self):\n \n self.rotation = np.array([[-1., 0., 0.], [0., 1., 0.], [0., 0., -1.]])\n self.pos = np.zeros(3) # (x, y, z)\n self.last_pos = np.zeros(3)\n self.grasp = False" ]
[ "@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:" }
Listener for the login event. @param \Illuminate\Auth\Events\Login $event The event that was fired. @return bool
[ "public function onLogin(Login $event)\n {\n $ip = $this->request->getClientIp();\n\n $this->updateFields($this->auth, $ip);\n }" ]
[ "public function boot(ProviderRepository $providers)\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n }\n\n $this->createAccessTokenProvider($providers);\n\n // Register the middleware as singleton to use the same middleware\n // instance ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
========================== misc junk ====================================
[ "JMenuItem createRecentItem(final File f, final SaveType localSaveType) {\n return mainFrameMenu.createRecentItem(f, localSaveType);\n }" ]
[ "def closeEvent(self, event):\n \n\n self.save_config(self.gui_settings['gui_settings'])\n self.script_thread.quit()\n self.read_probes.quit()\n event.accept()\n\n print('\\n\\n======================================================')\n print('================= Closin...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Prepare the widgets used by this action Model $model
[ "protected function initWidgets($model)\n {\n $config = $model->getFieldConfig();\n $config->model = $model;\n $config->arrayName = class_basename($model);\n $config->context = 'update';\n\n $widget = $this->makeWidget('Backend\\Widgets\\Form', $config);\n $widget->bindT...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Resolves the function name to execution for the environment. @param env The environment @return The function name
[ "protected String resolveFunctionName(Environment env) {\n return env.getProperty(LocalFunctionRegistry.FUNCTION_NAME, String.class, (String) null);\n }" ]
[ "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 post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
essentially, the idea here is that we're gonna find the currently instantiated L.Edit handler, figure out its type, get rid of it, and then replace it with a snapedit instead
[ "function(e) {\n L.EditToolbar.Edit.prototype._enableLayerEdit.call(this, e);\n\n var layer = e.layer || e.target || e;\n\n if (!layer.snapediting) {\n if (layer.hasOwnProperty('_mRadius')) {\n if (layer.editing) {\n layer.editing._markerGroup.clearL...
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add multiple options at once. The input array should be keyed with the primary option string, and the values should be the settings array used by {addOption}. @param array $options An array of options to add @return $this
[ "public function addOptions($options) {\n\t\tforeach ($options as $option => $settings) {\n\t\t\tif (is_numeric($option)) {\n\t\t\t\t$this->_warn('No option string given');\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->addOption($option, $settings);\n\t\t}\n\n\t\treturn $this;\n\t}" ]
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Make sure all fields are mapped in the locale - value way. @param src the source to be edited. @param type the type to be used. @param context the json context to be changed. @return a created json element.
[ "@Override\n public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) {\n JsonObject fields = new JsonObject();\n for (Map.Entry<String, LinkedHashMap<String, Object>> field : src.getFields().entrySet()) {\n LinkedHashMap<String, Object> value = field.getValue();\n if...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
{@inheritdoc} @throws PluginNotInstalledException @throws PluginNotActivatedException
[ "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $io = new SymfonyStyle($input, $output);\n $context = Context::createDefaultContext();\n $plugins = $this->prepareExecution(self::LIFECYCLE_METHOD, $io, $input, $context);\n\n $deactivatedPluginCount = 0...
[ "public Validation validate(@PName(\"context\") Context context, @PName(\"pid\") String pid,\n @PName(\"asOfDateTime\") Date asOfDateTime) throws ServerException {\n throw rejectCallsFromOutsideWhileInRecoveryMode();\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Converts the give HAL Resource to a plain text representation that can be returned in the response. @param string $format @param \Hal\Resource $resource @throws NotAcceptableHttpException @return string
[ "protected function convertResourceToPlainText($format, Resource $resource)\n {\n switch ($format) {\n case 'xml':\n return (string)$resource->getXML()->asXml();\n case 'json':\n return (string)$resource;\n default:\n throw new ...
[ "static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std...
codesearchnet
{ "query": "Represent the post about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Software development:" }
Download given resource_url
[ "async def download(resource_url):\n '''\n \n '''\n scheme = resource_url.parsed.scheme\n if scheme in ('http', 'https'):\n await download_http(resource_url)\n elif scheme in ('git', 'git+https', 'git+http'):\n await download_git(resource_url)\n else:\n raise ValueError('Un...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Pass through to provider SequenceRuleAdminSession.update_sequence_rule
[ "def save_sequence_rule(self, sequence_rule_form, *args, **kwargs):\n \"\"\"\"\"\"\n # Implemented from kitosid template for -\n # osid.resource.ResourceAdminSession.update_resource\n if sequence_rule_form.is_for_update():\n return self.update_sequence_rule(sequence_rule_form,...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the keys of the bound attributes. @return array The keys of the bound attributes
[ "public function getAllKeys()\n {\n\n // initialize the array with keys of all attributes\n $keys = array();\n\n // prepare the pattern to filter the attributes\n $pattern = sprintf('%s-*', $this->getSerial());\n\n // prepare the array with the attribute keys\n foreach (...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
自定义定时任务配置文件路径 @param cronSettingPath 定时任务配置文件路径(相对绝对都可)
[ "public static void setCronSetting(String cronSettingPath) {\n\t\ttry {\n\t\t\tcrontabSetting = new Setting(cronSettingPath, Setting.DEFAULT_CHARSET, false);\n\t\t} catch (SettingRuntimeException | NoResourceException e) {\n\t\t\t// ignore setting file parse error and no config error\n\t\t}\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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }