query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Creates the dialog HTML for all defined widgets of the named dialog (page).<p>
@param dialog the dialog (page) to get the HTML for
@return the dialog HTML for all defined widgets of the named dialog (page) | [
"@Override\n protected String createDialogHtml(String dialog) {\n\n StringBuffer result = new StringBuffer(1024);\n\n // create table\n result.append(createWidgetTableStart());\n\n // show error header once if there were validation errors\n result.append(createWidgetErrorHeader... | [
"function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// handleCheckNotification processes a checkNotification, bringing
// destinations, services, and vservers up or down appropriately. | [
"func (v *vserver) handleCheckNotification(n *checkNotification) {\n\tif !v.enabled {\n\t\tlog.Infof(\"%v: ignoring healthcheck notification %s (vserver disabled)\", v, n.description)\n\t\treturn\n\t}\n\n\tcheck := v.checks[n.key]\n\tif check == nil {\n\t\tlog.Warningf(\"%v: unknown check key %v\", v, n.key)\n\t\tr... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// SetDeploymentStyle sets the DeploymentStyle field's value. | [
"func (s *CreateDeploymentGroupInput) SetDeploymentStyle(v *DeploymentStyle) *CreateDeploymentGroupInput {\n\ts.DeploymentStyle = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Verifies the provided Event and fires it off to the registered listeners.
@param event the Event instance to handle
@throws GitLabApiException if the event is not supported | [
"public void handleEvent(Event event) throws GitLabApiException {\r\n\r\n LOGGER.info(\"handleEvent: object_kind=\" + event.getObjectKind());\r\n\r\n switch (event.getObjectKind()) {\r\n case BuildEvent.OBJECT_KIND:\r\n case IssueEvent.OBJECT_KIND:\r\n case MergeRequestEvent.OBJEC... | [
"@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Send reload request to devices | [
"async function reload() {\n const requestOptions = {\n hostname: 'localhost',\n port: 8081,\n path: '/reloadapp',\n method: 'HEAD',\n };\n\n const req = http.request(requestOptions, () => {\n clear();\n logger.done('Sent reload request');\n req.end();\n });\n\n req.on('error', e => {\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
r'''
Returns the VM's size.
vm\_
The VM to get the size for. | [
"def get_vm_size(vm_):\n \n '''\n vm_size = config.get_cloud_config_value('size', vm_, __opts__)\n ram = avail_sizes()[vm_size]['RAM']\n\n if vm_size.startswith('Linode'):\n vm_size = vm_size.replace('Linode ', '')\n\n if ram == int(vm_size):\n return ram\n else:\n raise Sa... | [
"def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about AWS S3:"
} |
// PathParam gets named path parameters and their values from the request
//
// the path '/users/:name' given '/users/andrew' will have `PathParam(r, "name")` => `"andrew"`
// unset values return an empty stringRoutes | [
"func PathParam(req *http.Request, name string) (value string) {\n\tex := getRequestExecution(req)\n\treturn ex.params[name]\n}"
] | [
"function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Completely clear all rendering of this layer and redraw. | [
"public void refresh() {\n\t\tif (layer instanceof RasterLayer) {\n\t\t\tRasterLayer rLayer = (RasterLayer) layer;\n\t\t\trLayer.setVisible(false);\n\t\t\trLayer.getStore().clear();\n\t\t\trLayer.setVisible(true);\n\t\t} else if (layer instanceof org.geomajas.gwt.client.map.layer.VectorLayer) {\n\t\t\torg.geomajas.... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
A Mixin call, with an optional argument list #mixins > .square(#fff); .rounded(4px, black); .button; The `while` loop is there because mixins can be namespaced, but we only support the child and descendant selector for now. | [
"function () {\n var s = input.charAt(i), important = false, index = i, elemIndex,\n elements, elem, e, c, args;\n\n if (s !== '.' && s !== '#') { return; }\n\n save(); // stop us absorbing part of an invalid selector\n\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Register the "reset" migration command.
@return void | [
"protected function registerResetCommand(): void\n {\n $this->app->singleton('orchestra.commands.tenanti.reset', function (Application $app) {\n return new ResetCommand($app->make('orchestra.tenanti'));\n });\n }"
] | [
"public function Upgrade182to183()\n {\n $this->_batch->addTask('Db_CreateNewTables');\n $this->_batch->addTask('Db_AddPatches', 61);\n\n // Use AddTask task to execute after patches\n $this->_batch->addTask('AddTask', 'Echo', $this->_('Make sure to read the changelog as it contains i... | codesearchnet | {
"query": "Represent the sentence about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code:"
} |
Handle an incoming request.
@param string $output
@return mixed | [
"public function output ($output)\n {\n $request = Craft::$app->getRequest();\n\n if ( $request->isCpRequest || $request->isLivePreview || $request->getAcceptsJson() ) {\n return $output;\n }\n\n return $this->generateAndAttachLinkHeaders($output);\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 text about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Programming:"
} |
Reads a single character.
@return The character read, or -1 if the end of the stream has been
reached
@exception IOException
If an I/O error occurs | [
"@Override\n public int read()\n throws IOException\n {\n synchronized ( lock )\n {\n ensureOpen();\n if ( next >= length )\n return -1;\n return seq.charAt( next++ );\n }\n }"
] | [
"function XUserDefinedDecoder(options) {\n var fatal = options.fatal;\n /**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)} The next code point(s)\n * decoded, or null if not ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Execute commands in automate namespace | [
"def cmd_exec(self, cmd):\n \n\n if not cmd:\n return\n ns = self.cmd_namespace\n import copy\n rval = True\n nscopy = copy.copy(ns)\n try:\n r = eval(cmd, ns)\n if isinstance(r, SystemObject) and not r.system:\n r.setu... | [
"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:"
} |
Take a string of the form 'fedmsg.consumers.ircbot:IRCBotConsumer'
and return the IRCBotConsumer class. | [
"def load_class(location):\n \n mod_name, cls_name = location = location.strip().split(':')\n tokens = mod_name.split('.')\n\n fromlist = '[]'\n if len(tokens) > 1:\n fromlist = '.'.join(tokens[:-1])\n\n module = __import__(mod_name, fromlist=fromlist)\n\n try:\n return getattr(mo... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Start long-polling
:param timeout:
:param relax:
:param limit:
:param reset_webhook:
:param fast:
:return: | [
"async def start_polling(self,\n timeout=20,\n relax=0.1,\n limit=None,\n reset_webhook=None,\n fast: typing.Optional[bool] = True,\n error_sleep: int = 5... | [
"def plugin_wait_time(seconds: float, item_session: ItemSession, error: Optional[Exception]=None) -> float:\n '''\n '''\n return seconds"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return the url of the web server or None if not running | [
"def web_address(self):\n \n port = self._current_web_port()\n address = self.address or '127.0.0.1'\n if port is None:\n return None\n return 'http://{0}:{1}/'.format(\n address if address and not is_boot2docker() else docker_host(),\n port)"
] | [
"def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets the rotation count for the {@link IBlockState}
@param state the state
@return the rotation count | [
"public static int getRotationCount(IBlockState state)\n\t{\n\t\tEnumFacing direction = DirectionalComponent.getDirection(state);\n\t\treturn EnumFacingUtils.getRotationCount(direction);\n\t}"
] | [
"function setSlotKey(slot, key) {\n slot.key = key;\n\n // Add the slot to the keyMap, so it is possible to quickly find the slot given its key\n keyMap[slot.key] = slot;\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
获取指定日期偏移指定时间后的时间
@param date 基准日期
@param dateField 偏移的粒度大小(小时、天、月等){@link DateField}
@param offset 偏移量,正数为向后偏移,负数为向前偏移
@return 偏移后的日期 | [
"public static DateTime offset(Date date, DateField dateField, int offset) {\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tcal.setTime(date);\r\n\t\tcal.add(dateField.getValue(), offset);\r\n\t\treturn new DateTime(cal.getTime());\r\n\t}"
] | [
"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 Github instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about text processing:"
} |
Merge the range cells into one region in the worksheet.
:param bool across: Optional. Set True to merge cells in each row of the
specified range as separate merged cells. | [
"def merge(self, across=False):\n \n url = self.build_url(self._endpoints.get('merge_range'))\n return bool(self.session.post(url, data={'across': across}))"
] | [
"function assignGroupMarginsAndHeaders(offset) {\n if (options.last) {\n // When looking for the *last* group, the *trailing* header and margin belong to the group.\n return offset - that._getHeaderSizeGroupAdjustment() - that._sizes.items... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/* ------------------------------------------------------------ | [
"public List getMethods()\n {\n if (_umMethods == null && _methods != null)\n _umMethods= Collections.unmodifiableList(LazyList.getList(_methods));\n return _umMethods;\n }"
] | [
"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 Github sentence about N/A:",
"pos": "Represent the Github code about N/A:",
"neg": "Represent the Github code about Software Development:"
} |
returns the offset based on UTC
@param *string $zone The timezone to calculate the offset with
@return string|int | [
"protected function getOffsetFromUtc(string $zone)\n {\n $zone = str_replace(['GMT','UTC'], '', $zone);\n $zone = str_replace(':', '', $zone);\n\n $add = $zone[0] == '+';\n $zone = substr($zone, 1);\n\n switch (strlen($zone)) {\n case 1:\n case 2:... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Runs a compiled Statement, i.e prepare
@return object Statement | [
"final public function prepare()\n {\n\n $DB = $this->DBO;\n $QUERY = $this->compile();\n\n //echo $QUERY;\n //Compile the query;\n $STATEMENT = $DB->prepare($QUERY);\n\n //Return the Result Object;\n return $STATEMENT;\n }"
] | [
"@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Accessor for record tags (metadata).
:param val: record tags | [
"def tags(self, val: str) -> None:\n \n\n if not StorageRecord.ok_tags(val):\n LOGGER.debug('StorageRecord.__init__ <!< Tags %s must map strings to strings', val)\n raise BadRecord('Tags {} must map strings to strings'.format(val))\n\n self._tags = val or {}"
] | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the cache data for the given $key.
@param string|array $key Name of the cache key.
@param mixed $ttlLeft = (ttl - time()) of key. Use to exclude dog-pile effect, with lock/unlock_key methods.
@return mixed | [
"public function read($key, &$ttlLeft = -1)\n {\n $key = md5($key);\n\n if (isset($this->cache[$key])) {\n return $this->cache[$key];\n }\n\n return false;\n }"
] | [
"public function clear(): void\n {\n // On purpose does not check if enabled, in case of prior phase being enabled we clear cache when someone asks.\n $this->cache = $this->cacheIndex = $this->cacheExpiryTime = $this->cacheAccessCount = [];\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Serialize to the given stream, closing it when finished. If
skipNonOverrides is true, any configuration whose values are all null
will not be written. | [
"public void toStream(boolean skipNonOverrides, OutputStream out)\n throws Exception {\n PrintWriter writer = null;\n try {\n writer = new PrintWriter(new OutputStreamWriter(out, \"UTF-8\"));\n write(skipNonOverrides, true, writer);\n } finally {\n tr... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Provides the necessary information to establish an AWS VPC Peering
// with your private space. | [
"func (s *Service) PeeringInfoInfo(ctx context.Context, spaceIdentity string) (*PeeringInfo, error) {\n\tvar peeringInfo PeeringInfo\n\treturn &peeringInfo, s.Get(ctx, &peeringInfo, fmt.Sprintf(\"/spaces/%v/peering-info\", spaceIdentity), nil, nil)\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Stores a function's assumptions as an attribute. | [
"def assumes(*args):\n ''''''\n args = tuple(args)\n\n def decorator(func):\n func.assumptions = args\n return func\n return decorator"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// save will try to marshal, seal and write to disk | [
"func save(filename, passphrase string, data map[string]string) error {\n\tbuf, err := seal(data, passphrase)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(filename, buf, 0600)\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
ASCIIHexDecode
Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data.
@param $data (string) Data to decode.
@return Decoded data string.
@since 1.0.000 (2011-05-23)
@public static | [
"public static function decodeFilterASCIIHexDecode($data) {\n\t\t// intialize string to return\n\t\t$decoded = '';\n\t\t// all white-space characters shall be ignored\n\t\t$data = preg_replace('/[\\s]/', '', $data);\n\t\t// check for EOD character: GREATER-THAN SIGN (3Eh)\n\t\t$eod = strpos($data, '>');\n\t\tif ($e... | [
"def _encode(segments, error, version, mask, eci, boost_error, sa_info=None):\n \n is_micro = version < 1\n sa_mode = sa_info is not None\n buff = Buffer()\n ver = version\n ver_range = version\n if not is_micro:\n ver = None\n ver_range = version_range(version)\n if boost_erro... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {\n\t\tsystem_stats[] resources = new system_stats[1];\n\t\tsystem_response result = (system_response) service.get_payload_formatter().string_to_resource(system_response.class, response);\n\t\tif(result.errorcode ... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Creates a rule that matches a series of rules in order, and succeeds if they all do | [
"function seq() {\n var rules = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n rules[_i - 0] = arguments[_i];\n }\n var rs = rules.map(RuleTypeToRule);\n if (rs.length == 0)\n throw new Error(\"At least one rule is expected when calling `seq`\");\n ... | [
"public int checkAccess(String path) {\n timeLastAccessed = System.currentTimeMillis();\n int result = UNDEFINED;\n String myUA = config.getUserAgentName();\n boolean ignoreUADisc = config.getIgnoreUADiscrimination();\n\n // When checking rules, the list of rules is already ordere... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Acquire the current attribution id from the facebook app.
@return returns null if the facebook app is not present on the phone. | [
"public static String getAttributionId(ContentResolver contentResolver) {\n try {\n String [] projection = {ATTRIBUTION_ID_COLUMN_NAME};\n Cursor c = contentResolver.query(ATTRIBUTION_ID_CONTENT_URI, projection, null, null, null);\n if (c == null || !c.moveToFirst()) {\n ... | [
"def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Receive the meta data from source
@param array $metaData Metadata sent from source nodes
@param Process $source The source process
@return null | [
"public function receiveMeta($metaData,$source)\n {\n $this->streamingSource = $source;\n $this->metaData = $metaData;\n $this->startProcess->receiveMeta($metaData, $this);\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Send a POST request
@param string $url The request URL
@param array $parameters The request parameters
@param string $content The raw content
@return \apiTalk\Response The response object | [
"public function post($url, array $parameters = array(), $content = null)\n {\n return $this->call(Request::METHOD_POST, $url, $parameters, $content);\n }"
] | [
"public function prepareResponse(): void\n {\n // change default HTTP status code\n $this->response->setStatusCode(200);\n\n // clear default response headers\n $this->response->resetHeaders();\n\n // add your response headers\n $this->response->setCharset('UTF-8');\n ... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
rubocop: disable Metrics/AbcSize, Metrics/MethodLength | [
"def lookup_adapter(args)\n adapter, options = Array(args)\n path_to_adapter = \"anycable/broadcast_adapters/#{adapter}\"\n adapter_class_name = adapter.to_s.split(\"_\").map(&:capitalize).join\n\n unless BroadcastAdapters.const_defined?(adapter_class_name, false)\n begin\n requi... | [
"public Configuration withDifferenceListener(DifferenceListener differenceListener) {\n return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param $id
@return Response | [
"public function destroy($id)\n {\n $find = $this->findResourceCallable($id);\n\n $delete = $this->deleteResourceCallable($id);\n\n $resource = new DeleteResource($this->serializer);\n\n return $this->addHeaders($resource->get($id, get_class($this->getDataModel()), $find, $delete));\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Creates a new DeliveryMethod model.
If creation is successful, the browser will be redirected to the 'view' page.
@param integer $id
@param integer $languageId
@return mixed
@throws NotFoundHttpException
@throws BadRequestHttpException | [
"public function actionSave($id = null, $languageId)\n {\n if (!empty($languageId)) {\n if (!empty($id)) {\n\n $model = $this->findModel($id);\n if (empty($model)) {\n throw new NotFoundHttpException;\n }\n $modelTra... | [
"public function AddToCampaignForm($request)\n {\n // Get ID either from posted back value, or url parameter\n $id = $request->param('ID') ?: $request->postVar('ID');\n return $this->getAddToCampaignForm($id);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Symfony:"
} |
// registerRestorer adds a new helper. This should be called at package
// init() time. | [
"func registerRestorer(msg structs.MessageType, fn restorer) {\n\tif restorers == nil {\n\t\trestorers = make(map[structs.MessageType]restorer)\n\t}\n\tif restorers[msg] != nil {\n\t\tpanic(fmt.Errorf(\"Message %d is already registered\", msg))\n\t}\n\trestorers[msg] = fn\n}"
] | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Download and install a new Cloud SDK. | [
"public Path install(\n final ProgressListener progressListener, final ConsoleListener consoleListener)\n throws IOException, InterruptedException, SdkInstallerException, CommandExecutionException,\n CommandExitException {\n\n FileResourceProvider fileResourceProvider =\n fileResourcePr... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get the minimum and maximum for the series of each axis | [
"function () {\n var axis = this,\n chart = axis.chart;\n\n axis.hasVisibleSeries = false;\n\n // Reset properties in case we're redrawing (#3353)\n axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;\n\n if (axis.bu... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a <code>SAXEncoder</code> that implements
<code>DefaultHandler2</code>
<p>
Note that the output stream MUST be set.
</p>
@return writer using the previously set coding options.
@throws EXIException
EXI exception | [
"public SAXEncoder createEXIWriter() throws EXIException {\n\t\tfinal FidelityOptions fidelityOptions = exiFactory.getFidelityOptions();\n\t\tif (fidelityOptions.isFidelityEnabled(FidelityOptions.FEATURE_PREFIX)\n\t\t\t\t|| fidelityOptions\n\t\t\t\t\t\t.isFidelityEnabled(FidelityOptions.FEATURE_COMMENT)\n\t\t\t\t||... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
This sets the edit menu text and icon | [
"function() {\n var t = this,\n isEditMode = t.$el.hasClass('edit-mode'),\n text = isEditMode ? 'Lock Components' : 'Edit Components',\n icon = isEditMode ? 'lock' : 'edit';\n t.$('.nm-pvm-lock').text(text);\n t.$('.nm-pvm-edit i').attr('class', 'icon-' + icon);\n }"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Operation deleteTransactionByIdAsyncWithHttpInfo
Delete Transaction
@param string $transaction_id ID of transaction to delete. (required)
@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface | [
"protected static function deleteTransactionByIdAsyncWithHttpInfo($transaction_id) \n {\n $returnType = ''; \n $request = self::deleteTransactionByIdRequest($transaction_id); \n\n return self::getHttpClient()\n ->sendAsync($request, self::createHttpClientOption())\n ->... | [
"public function deleteAll(array $queryParams = [])\n {\n $response = $this->api->applications()->deleteAll($queryParams);\n\n return new BaseResponse($response);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
Removes every entries in the trash.
Will NOT remove associated content objects nor attributes.
Basically truncates ezcontentobject_trash table. | [
"public function cleanupTrash()\n {\n try {\n return $this->innerGateway->cleanupTrash();\n } catch (DBALException $e) {\n throw new RuntimeException('Database error', 0, $e);\n } catch (PDOException $e) {\n throw new RuntimeException('Database error', 0, $e)... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the Github comment about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about Software development:"
} |
// OpenForm appends the data values to the given URL and sends a GET request. | [
"func (bow *Browser) OpenForm(u string, data url.Values) error {\n\tul, err := url.Parse(u)\n\tif err != nil {\n\t\treturn err\n\t}\n\tul.RawQuery = data.Encode()\n\n\treturn bow.Open(ul.String())\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Handle65 handles incoming requests of packet 0x65: WindowClose | [
"func Handle65(server *Server, sender *player.Player) {\n\tpkt := new(packet.WindowClose)\n\tpkt.ReadFrom(sender.Conn)\n\n\tlog.Printf(\"WindowClose: %+v\", pkt)\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 instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Read mappings of LDAP syntaxes to Java classes. | [
"private static Map<String, String> readSyntaxMap(File syntaxMapFile) \n throws IOException {\n \n Map<String, String> result = new HashMap<String, String>();\n\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new FileReader(syntaxMapFile));\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github instruction about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
给一个字段增加指定的值
@param string $field 字段名称
@param int|float $amount 指定的值
@return int|false 成功则返回受影响的行数;如果SQL执行发生错误,返回false。
注意返回<b>0</b>和返回<b>false</b>的区别。 | [
"public function inc($field, $amount = 1) {\n $this->checkIncOrDecAmount($amount);\n\n $data = [$field => ['exp', \"{$field} + {$amount}\"]];\n return $this->update($data);\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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Closes the file-like object.
If the file-like object was passed in the init function
the encoded stream file-like object does not control
the file-like object and should not actually close it. | [
"def _Close(self):\n \n if not self._file_object_set_in_init:\n self._file_object.close()\n self._file_object = None\n\n self._decoder = None\n self._decoded_data = b''\n self._encoded_data = b''"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Called if a command service is gone.
Unregisters its commands.
:param svc_ref: A reference to the unbound service
:return: True if the commands have been unregistered | [
"def unbind_handler(self, svc_ref):\n \n if svc_ref not in self._bound_references:\n # Unknown reference\n return False\n\n # Unregister its commands\n namespace, commands = self._reference_commands[svc_ref]\n for command in commands:\n self.unregi... | [
"def __remove_service(self, key, service):\n \n try:\n # Remove the injected service\n prop_services = self._future_value[key]\n prop_services.remove(service)\n\n # Clean up\n if not prop_services:\n del self._future_value[key]\n\n ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
// SortWithInfo adds a sort order. | [
"func (s *SearchSource) SortWithInfo(info SortInfo) *SearchSource {\n\ts.sorters = append(s.sorters, info)\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Convert the value according the type of DeviceData.
@param deviceDataArgout
the DeviceData attribute to read
@return Long, the result in Long format
@throws DevFailed | [
"public static Long extractToLong(final DeviceData deviceDataArgout) throws DevFailed {\n\tfinal Object value = CommandHelper.extract(deviceDataArgout);\n\tLong argout = null;\n\tif (value instanceof Short) {\n\t argout = Long.valueOf(((Short) value).longValue());\n\t} else if (value instanceof String) {\n\t ... | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Calculate new image sizes for inset mode
:param original_width: int
:param original_height: int
:param target_width: int
:param target_height: int
:return: tuple(int, int) | [
"def inset_sizes(cls, original_width, original_height, target_width, target_height):\n \n if target_width >= original_width and target_height >= original_height:\n target_width = float(original_width)\n target_height = original_height\n\n elif target_width <= original_widt... | [
"def make_canonical_path(\n image_identifier, image_width, image_height,\n region, size, rotation, quality, format_str\n):\n \n original_aspect_ratio = float(image_width) / image_height\n\n if (\n region == 'full' or\n # Use 'full' if 'square' is requested for an already square ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about storage:"
} |
Create a new guest instance. | [
"function (embedder, params) {\n if (webViewManager == null) {\n webViewManager = process.electronBinding('web_view_manager')\n }\n\n const guest = webContents.create({\n isGuest: true,\n partition: params.partition,\n embedder: embedder\n })\n const guestInstanceId = guest.id\n guestInstances[gue... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Gets all classes with FluentExtension
@return array Array of classes to migrate | [
"public function fluentClasses()\n {\n $classes = [];\n $dataClasses = ClassInfo::subclassesFor(DataObject::class);\n array_shift($dataClasses);\n foreach ($dataClasses as $class) {\n $base = DataObject::getSchema()->baseDataClass($class);\n foreach (DataObject::... | [
"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 Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
closes the stream. | [
"void closeImpl()\n {\n ReadStreamOld is = _is;\n _is = null;\n\n WriteStreamOld os = _os;\n _os = null;\n\n try {\n if (is != null)\n is.close();\n } catch (Throwable e) {\n log.log(Level.FINER, e.toString(), e);\n }\n\n try {\n if (os != null)\n os.close();\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:"
} |
Return the reflector of the method that can execute the query on the
endpoint.
@param string $methodName Like "query"
@param \ReflectionClass $endpointReflector
@return \ReflectionMethod | [
"protected function getExecutorMethod($methodName, ReflectionClass $endpointReflector) {\n $neededMethod = strtolower($methodName) . \"Executor\";\n\n if(!$endpointReflector->hasMethod($neededMethod)) {\n $neededMethod = \"defaultExecutor\";\n }\n\n return $endpointReflector->... | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Get inferred nullness qualifier for an expression, if possible. | [
"public Optional<Nullness> getExprNullness(ExpressionTree exprTree) {\n InferenceVariable iv = TypeArgInferenceVar.create(ImmutableList.of(), exprTree);\n return constraintGraph.nodes().contains(iv) ? getNullness(iv) : Optional.empty();\n }"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Cancel this order, optionally refunding it | [
"def cancel(self, refund=True):\n \n if refund:\n self.refund()\n self.status = self.CANCELLED\n self.save()"
] | [
"def process_source(source)\n if source == \"00\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by the service user (client side).\")\n elsif source == \"02\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Flush is a blocking exporter function which reports metrics in the registry
// to the statsd client, flushing every d duration | [
"func (r *Reporter) Flush() {\n\tdefer func() {\n\t\tif rec := recover(); rec != nil {\n\t\t\thandlePanic(rec)\n\t\t}\n\t}()\n\n\tfor range time.Tick(r.interval) {\n\t\tif err := r.FlushOnce(); err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Parse KNX group addresses and return the address as an integer.
This allows to convert x/x/x and x/x address syntax to a numeric
KNX group address | [
"def parse_group_address(addr):\n \n\n if addr is None:\n raise KNXException(\"No address given\")\n\n res = None\n\n if re.match('[0-9]+$', addr):\n res = int(addr)\n\n match = re.match(\"([0-9]+)/([0-9]+)$\", addr)\n if match:\n main = match.group(1)\n sub = match.gro... | [
"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 Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Validate validates the manifold configuration. | [
"func (config ManifoldConfig) Validate() error {\n\tif config.AgentName == \"\" {\n\t\treturn errors.NotValidf(\"empty AgentName\")\n\t}\n\tif config.AuthenticatorName == \"\" {\n\t\treturn errors.NotValidf(\"empty AuthenticatorName\")\n\t}\n\tif config.ClockName == \"\" {\n\t\treturn errors.NotValidf(\"empty Clock... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns HTML for select form element.
@return string | [
"function toHtml(){\n global $PAGE;\n\n // Enhance the select with javascript.\n $this->_generateId();\n $id = $this->getAttribute('id');\n\n if (!$this->isFrozen()) {\n $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param string $apiClass
@param RuleInterface|null $next
@return RuleInterface | [
"public static function readableAll(string $apiClass, RuleInterface $next = null): RuleInterface\n {\n $primary = new AreReadableViaApiRule($apiClass);\n\n return $next === null ? $primary : new AndOperator($primary, $next);\n }"
] | [
"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 Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Capture the window of a viewer. | [
"def show(self, fmt=None):\n \n # force any delayed redraws\n # TODO: this really needs to be addressed in get_rgb_image_as_bytes()\n # of the various superclasses, as it affects other backends as well\n self.redraw_now()\n\n from IPython.display import Image\n\n if ... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Initialize the test domain with commands and events related to find in files.
@param {DomainManager} domainManager The DomainManager for the find in files domain "FindInFiles" | [
"function init(domainManager) {\n if (!domainManager.hasDomain(\"FindInFiles\")) {\n domainManager.registerDomain(\"FindInFiles\", {major: 0, minor: 1});\n }\n _domainManager = domainManager;\n domainManager.registerCommand(\n \"FindInFiles\", // domain name\n \"doSearch\", ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Answer a {@code Completes<Respose>} as the eventual outcomes of the {@code request}.
@param request the Request to the server
@return {@code Completes<Respose>} | [
"public Completes<Response> requestWith(final Request request) {\n final Completes<Response> completes =\n configuration.keepAlive ?\n Completes.repeatableUsing(configuration.stage.scheduler()) :\n Completes.using(configuration.stage.scheduler());\n consumer.re... | [
"@Override\n protected <T1, R extends Completes<?>> R dispatchQuery(BiFunction<P, T1, R> query, T1 routable1) {\n throw new UnsupportedOperationException(\"query protocols are not supported by this router by default\");\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Attach Parent Selector | [
"function () {\n\t\n\tfunction commons() {}\n\tcommons.attachParentSelector = function (parentSelector, defaultSelector) {\n\t\tvar customSelector = defaultSelector;\n\t\tif (parentSelector !== '' && parentSelector.length > 0) {\n\t\t\tif (parentSelector === defaultSelector) {\n\t\t\t\tcustomSelector = defaultSelec... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Handles the controller method.
@return \Magento\Framework\Controller\Result\Redirect | [
"public function execute() {\n // Get the validation URL from the request\n $url = $this->getRequest()->getParam('u');\n\n // Process the call after check\n if (\"https\" == parse_url($url, PHP_URL_SCHEME) && substr( parse_url($url, PHP_URL_HOST), -10 ) == \".apple.com\" ) {\n ... | [
"public function _construct()\n {\n $this->_init(\\Magento\\Cron\\Model\\Schedule::class, \\Magento\\Cron\\Model\\ResourceModel\\Schedule::class);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Gets allowable values of the enum
@return string[] | [
"public function getFirstPartyTypeAllowableValues()\n {\n return [\n self::FIRST_PARTY_TYPE_CHARACTER,\n self::FIRST_PARTY_TYPE_CORPORATION,\n self::FIRST_PARTY_TYPE_ALLIANCE,\n self::FIRST_PARTY_TYPE_FACTION,\n self::FIRST_PARTY_TYPE_SYSTEM,\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
(non-Javadoc)
@see net.spy.memcached.MemcachedNode#getSelectionOps() | [
"public final int getSelectionOps() {\n int rv = 0;\n if (getChannel().isConnected()) {\n if (hasReadOp()) {\n rv |= SelectionKey.OP_READ;\n }\n if (toWrite > 0 || hasWriteOp()) {\n rv |= SelectionKey.OP_WRITE;\n }\n } else {\n rv = SelectionKey.OP_CONNECT;\n }\n ... | [
"public void destroy() {\n\t\tclear();\n\t\tthis.client.operate(null, key, Operation.put(Bin.asNull(binName)));\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Set reply method
@param string $methodName
@return Zend_Amf_Value_MessageBody | [
"public function setReplyMethod($methodName)\n {\n if (!preg_match('#^[/?]#', $methodName)) {\n $this->_targetUri = rtrim($this->_targetUri, '/') . '/';\n }\n $this->_targetUri = $this->_targetUri . $methodName;\n return $this;\n }"
] | [
"public static function __static()\r\n\t{\r\n\t\tValueProxy::$valueFactory = array();\r\n\t\tValueProxy::$dynamicValueType = Type::FromNameAndTypeCode( ValueProxy::$CLASSNAME, TypeCode::Object );\r\n\t}"
] | codesearchnet | {
"query": "Represent the text about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
Remove pictures
@param \Dacorp\ExtraBundle\Entity\DacorpMedia $pictures | [
"public function removePicture(\\Dacorp\\ExtraBundle\\Entity\\DacorpMedia $pictures)\n {\n $this->pictures->removeElement($pictures);\n }"
] | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Return the port of the server. | [
"protected function serverPort(): int\n {\n if ($this->serverPort !== null) {\n return $this->serverPort;\n }\n\n $iterator = $this->process->getIterator(SymfonyProcess::ITER_SKIP_ERR | SymfonyProcess::ITER_KEEP_OUTPUT);\n\n foreach ($iterator as $data) {\n retur... | [
"@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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// SoftClip computes nonlinear distortion of an input. | [
"func (as ArraySpec) SoftClip() Input {\n\treturn as.proc(func(i Input) Input {\n\t\treturn i.SoftClip()\n\t})\n}"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// SetCountUpdate sets the CountUpdate field's value. | [
"func (s *InputParallelismUpdate) SetCountUpdate(v int64) *InputParallelismUpdate {\n\ts.CountUpdate = &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 Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Recurse down tree creating list_items, called from moodle_list::list_from_records
@param array $records
@param array $children
@param integer $thisrecordid | [
"public function create_children(&$records, &$children, $thisrecordid) {\n //keys where value is $thisrecordid\n $thischildren = array_keys($children, $thisrecordid);\n foreach ($thischildren as $child) {\n $thisclass = get_class($this);\n $newlistitem = new $thisclass($re... | [
"protected function process_availability($data) {\n $data = (object)$data;\n // Simply going to store the whole availability record now, we'll process\n // all them later in the final task (once all activities have been restored)\n // Let's call the low level one to be able to store the ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
The real join
@param string $joinType
@param string|string[]|SelectStatementInterface $secondTable
@param string|string[]|ExpressionInterface $onClause
@param bool $rawMode
@return $this
@access protected | [
"protected function realJoin(\n /*# string */ $joinType,\n $secondTable,\n $onClause = '',\n /*# bool */ $rawMode = false\n ) {\n $alias = 0; // no alias\n list($secondTable, $alias) = $this->fixJoinTable($secondTable);\n\n if ($rawMode || '' === $onClause || $thi... | [
"protected function parseRelation($field, ValueExpression $valueExpression)\n {\n // TODO: parse relations\n $this->query->has($field, $valueExpression->getValue());\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Converts CMIS object to JCR node.
@param id the identifier of the CMIS object
@return JCR node document. | [
"private Document cmisObject( String id ) {\n CmisObject cmisObject;\n try {\n cmisObject = session.getObject(id);\n } catch (CmisObjectNotFoundException e) {\n return null;\n }\n\n // object does not exist? return null\n if (cmisObject == null) {\n... | [
"public RepositoryFile getRepositoryFile() throws ResourceException {\n if (_fileRef == null || _fileRef.get() == null) {\n throw new ResourceException(this, \"RepositoryFile '\" + _qualifiedPath\n + \"' is not available since it was not serializable. The RepositoryFileResource ... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this} | [
"public T put(YamlNode key, BigInteger value) {\n return put(key, getNodeFactory().bigIntegerNode(value));\n }"
] | [
"protected final void mapUpdate(Map map, Object key, Object value) {\n Object o = map.get(key);\n /*\n If a value exists in map.get(key), convert the \"value\" parameter into\n the type of map.get(key). It's a best guess as to what the type of the\n Map _should_ be without ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Returns an array of all so far benchmarked sections with the measured times.
@return array Returns an array with the keys `section`, `proctime`, `realtime`, `mem`, `realtime_ms`, `proctime_ms`. | [
"public function get() {\n\t\tif ($this->active) $this->stop();\n\n\t\tforeach (array_keys($this->data) as $key) {\n\t\t\t$row =& $this->data[$key];\n\t\t\t$row['realtime_ms'] = $row['realtime']*1000;\n\t\t\tif (is_numeric($row['proctime'])) {\n\t\t\t\t$row['proctime_ms'] = $row['proctime']*1000;\n\t\t\t} else {\n\... | [
"def get_summary(profile_block_list, maxlines=20):\n \n time_list = [get_block_totaltime(block) for block in profile_block_list]\n time_list = [time if time is not None else -1 for time in time_list]\n blockid_list = [get_block_id(block) for block in profile_block_list]\n sortx = ut.list_argsort(time... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// DecodeOne decodes one value to chunk and returns the remained bytes. | [
"func (decoder *Decoder) DecodeOne(b []byte, colIdx int, ft *types.FieldType) (remain []byte, err error) {\n\tif len(b) < 1 {\n\t\treturn nil, errors.New(\"invalid encoded key\")\n\t}\n\tchk := decoder.chk\n\tflag := b[0]\n\tb = b[1:]\n\tswitch flag {\n\tcase intFlag:\n\t\tvar v int64\n\t\tb, v, err = DecodeInt(b)\... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetUserFeedback sets the UserFeedback field's value. | [
"func (s *Service) SetUserFeedback(v string) *Service {\n\ts.UserFeedback = &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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Obtains parameter in the specified format
@param int $as
@return SimpleXMLElement|\DOMDocument|string | [
"public function getParameter($as = self::AS_STRING) {\n\t\tif ($as == self::AS_SIMPLEXML) {\n\t\t\t//convert to SimpleXMLElement\n\t\t\t$success = simplexml_load_string($this->parameter);\n\t\t\t\t\n\t\t\tif ($success === false) {\n\t\t\t\t$error = libxml_get_last_error();\n\t\t\t\tthrow new \\RuntimeException(\"X... | [
"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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Documentation:"
} |
Resolves a Donee for the incoming donor
@param DonorInterface $donor The donor to fetch a donee for
@return DoneeInterface | [
"public function resolve(DonorInterface $donor)\n {\n $pair = $this->pairRepository->findPairFor($donor);\n\n if (!is_null($pair)) {\n return $pair->getDonee();\n }\n\n return $this->nextResolver->resolve($donor);\n }"
] | [
"abstract public function __construct(DataAccessInterface $dataSource);\n \n /**\n * Returns an array with all entities for the given data request.\n * \n * @param \\Zepi\\DataSource\\Core\\DataRequest $dataRequest\n * @return false|array\n */\n public function find(DataRequest $dataReq... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
切换当前的数据库连接
@access public
@param mixed $config
@return $this | [
"public function connect($config)\n {\n $this->connection = Db::connect($config);\n $this->setBuilder();\n $this->prefix = $this->connection->getConfig('prefix');\n return $this;\n }"
] | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
Applies parameter filtering for a given query
@param string $name
@param mixed $value
@param EloquentBuilder $query
@param FilterInterface $filter
@return EloquentBuilder | [
"public function apply($name, $value, $query, FilterInterface $filter)\n {\n $column = ( ! empty($this->table) ? $this->table . '.' : null)\n . ( ! empty($this->column) ? $this->column : $name);\n\n return $query->where(function ($query) use ($column) {\n \n ret... | [
"public static function DaftObjectRepositoryByDaftObject(\n SuitableForRepositoryType $object,\n ...$args\n ) : DaftObjectRepository {\n /**\n * @psalm-var class-string<TDbObj>\n */\n $className = get_class($object);\n\n return static::DaftObjectRepositoryByType($... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Create a human readable representation of a typical "last_updated" DATETIME value.
@param mixed $date
@param boolean $withTime
@return string | [
"public static function lastUpdated($date, $withTime = true): string\n {\n $objDate = self::parse($date);\n $date = self::parse($objDate)->format('Y-m-d');\n $days = self::parse(Date('Y-m-d'))->diffInDays(self::parse($date));\n\n if ($days == 0) {\n $msg = 'today';\n ... | [
"public static function configureInput(InputDefinition $definition)\n {\n $definition->addOption(new InputOption(\n 'date-fmt',\n null,\n InputOption::VALUE_REQUIRED,\n 'The date format (as a PHP date format string)',\n // @todo refactor so this can b... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Use this API to fetch filtered set of aaaglobal_authenticationnegotiateaction_binding resources.
set the filter parameter values in filtervalue object. | [
"public static aaaglobal_authenticationnegotiateaction_binding[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{\n\t\taaaglobal_authenticationnegotiateaction_binding obj = new aaaglobal_authenticationnegotiateaction_binding();\n\t\toptions option = new options();\n\t\toption.set_filter(f... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Find an IP address and display its subnet and device info. | [
"def cli(env, ip_address):\n \"\"\"\"\"\"\n\n mgr = SoftLayer.NetworkManager(env.client)\n\n addr_info = mgr.ip_lookup(ip_address)\n\n if not addr_info:\n raise exceptions.CLIAbort('Not found')\n\n table = formatting.KeyValueTable(['name', 'value'])\n table.align['name'] = 'r'\n table.al... | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Default node depart handler
If there is a matching ``visit_<type>`` method for a container node,
then we should make sure to back up to it's parent element when the node
is exited. | [
"def default_depart(self, mdnode):\n \n if mdnode.is_container():\n fn_name = 'visit_{0}'.format(mdnode.t)\n if not hasattr(self, fn_name):\n warn(\"Container node skipped: type={0}\".format(mdnode.t))\n else:\n self.current_node = self.cu... | [
"def _morph(self):\n \"\"\"\"\"\"\n self.scanner_paths = {}\n if not hasattr(self, '_local'):\n self._local = 0\n if not hasattr(self, 'released_target_info'):\n self.released_target_info = False\n\n self.store_info = 1\n self._func_exists = 4\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
// Flushes all logs that have been buffered for writing to this output. | [
"func (o *ioOutput) Flush() error {\n\tif w, ok := o.writer.(flushWriter); ok {\n\t\treturn w.Flush()\n\t}\n\tif w, ok := o.writer.(syncWriter); ok {\n\t\treturn w.Sync()\n\t}\n\treturn nil\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Creates a new retention set object by removing all records on or before given record.
@param set retention set to update
@param record reference record
@return updated retention set record after removing all elements before given reference record. | [
"public static RetentionSet removeStreamCutBefore(RetentionSet set, StreamCutReferenceRecord record) {\n Preconditions.checkNotNull(record);\n // remove all stream cuts with recordingTime before supplied cut\n int beforeIndex = getGreatestLowerBound(set, record.getRecordingTime(), StreamCutRefe... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// GetDOMStorageItems -
// storageId -
// Returns - entries - | [
"func (c *DOMStorage) GetDOMStorageItems(storageId *DOMStorageStorageId) ([]string, error) {\n\tvar v DOMStorageGetDOMStorageItemsParams\n\tv.StorageId = storageId\n\treturn c.GetDOMStorageItemsWithParams(&v)\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Parse available informations about book from the book details page.
Args:
html_chunk (obj): HTMLElement containing slice of the page with details.
Returns:
obj: :class:`structures.Publication` instance with book details. | [
"def _process_book(html_chunk):\n \n title, book_url = _parse_title_url(html_chunk)\n\n # download page with details\n data = DOWNER.download(book_url)\n dom = dhtmlparser.parseString(\n handle_encodnig(data)\n )\n details = dom.find(\"div\", {\"id\": \"kniha_detail\"})[0]\n\n # requi... | [
"def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Export the svn repository at the url to the destination location | [
"def export(self, location):\n \"\"\"\"\"\"\n url, rev = self.get_url_rev()\n logger.notify('Exporting svn repository %s to %s' % (url, location))\n logger.indent += 2\n try:\n if os.path.exists(location):\n # Subversion doesn't like to check out over an ... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Function calculates the number of ranges in the Charset
@param NumofGlyphs The number of glyphs in the font
@param Type The format of the Charset
@return The number of ranges in the Charset data structure | [
"int CountRange(int NumofGlyphs,int Type){\n \tint num=0;\n \t@SuppressWarnings(\"unused\")\n\t\tchar Sid;\n \tint i=1,nLeft;\n \twhile (i<NumofGlyphs){\n \t\tnum++;\n \t\tSid = getCard16();\n \t\tif (Type==1)\n \t\t\tnLeft = getCard8();\n \t\telse\n \t\t\tnLeft = getCard16();\n \t\... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetStackId sets the StackId field's value. | [
"func (s *DescribeRdsDbInstancesInput) SetStackId(v string) *DescribeRdsDbInstancesInput {\n\ts.StackId = &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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
This is slightly different than json.JSONEncoder.default(obj)
in that it should returned the serialized representation of the
passed object, not a serializable representation. | [
"def default(self, obj):\n \n if isinstance(obj, (datetime.date, datetime.time, datetime.datetime)):\n return '\"%s\"' % obj.isoformat()\n elif isinstance(obj, unicode):\n return '\"%s\"' % unicodedata.normalize('NFD', obj).encode('utf-8')\n elif isinstance(obj, dec... | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Run the task to initiate the data request process.
@throws coding_exception
@throws moodle_exception | [
"public function execute() {\n global $CFG, $PAGE, $SITE;\n\n require_once($CFG->dirroot . \"/{$CFG->admin}/tool/dataprivacy/lib.php\");\n\n if (!isset($this->get_custom_data()->requestid)) {\n throw new coding_exception('The custom data \\'requestid\\' is required.');\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.